Commit ac783bfd authored by youjie's avatar youjie

酒店列表

parent 632641f8
......@@ -52,7 +52,7 @@ export default {
</script>
<style>
@import url("//at.alicdn.com/t/c/font_1890699_5zxmcxmwvtf.css");
@import url("//at.alicdn.com/t/c/font_1890699_3sxjt5uqjme.css");
@font-face {
font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
......
......@@ -20,7 +20,7 @@ const product = {
} else if (t === 5) {
url = "/detailHotal/" + configId + '/' + productInfo.b2CPrice
} else if (t === 6) {
url = `/detailHotalDida/${configId}/${productInfo.lowrateBySetCurrency}/${encodeURIComponent(productInfo.CheckInDate)}/${encodeURIComponent(productInfo.CheckOutDate)}`
url = `/detailHotalDida/${configId}/${productInfo.unitprice}/${encodeURIComponent(productInfo.CheckInDate)}/${encodeURIComponent(productInfo.CheckOutDate)}`
}
} else {
throw new Error("參數不合法");
......
......@@ -10,42 +10,60 @@
<div class="col row items-center justify-center bg-white">
<div @click="showAddress = true" class="nav-item">目的地<i class="iconfont iconarrowdown text-grey-6" style="margin-top: 3px; margin-left:4px"></i></div>
<div @click="showPrice = true" class="nav-item">價錢/时间<i class="iconfont iconarrowdown text-grey-6" style="margin-top: 3px; margin-left:4px"></i></div>
<div @click="showStarRating = true" class="nav-item">星级<i class="iconfont iconarrowdown text-grey-6" style="margin-top: 3px; margin-left:4px"></i></div>
</div>
</div>
<popup mode="top" v-model="showAddress">
<q-card flat class="rounded-borders q-py-md">
<div class="text-subtitle1 text-weight-bold q-mx-md">篩選目的地</div>
<q-input
v-model="searchAdd.name"
type="text"
standout
placeholder="搜尋目的地"
class="q-ma-md"
@input="changeAddrSearchHandler"
/>
<q-tree
ref="area"
:nodes="areaList"
<div class="relative">
<q-input
v-model="searchAdd.name"
type="text"
standout
placeholder="搜尋目的地"
class="q-ma-md"
@input="changeAddrSearchHandler"
@keyup.enter="searchCity"
@blur="searchCity"
/>
<div class="KeyCityBox absolute bg-white showbox column q-ml-md w-full q-pa-sm"
v-show="showCity"
id="sb"
transition-show="fade"
elevated
transition-hide="scale"
style="z-index: 9;">
<div v-for="item in KeyCityListAll" :key="item.Id"
class="cursor-pointer"
@click="selectCity(item)"
>{{ item.Name }}</div>
</div>
</div>
<q-tree
ref="Cities"
:nodes="CitiesList"
no-connectors
node-key="Id"
label-key="Name"
node-key="CityCode"
label-key="CityName"
tick-strategy="leaf-filtered"
@update:ticked="handleAreaTicked"
:ticked="areaTicked"
@update:ticked="handleCitiesTicked"
:ticked="CitiesTicked"
text-color="#666"
no-nodes-label=" "
no-results-label=" "
/>
<q-tree
ref="province"
:nodes="provinceList"
ref="region"
:nodes="regionList"
no-connectors
node-key="Id"
label-key="Name"
tick-strategy="leaf"
@update:ticked="handleProvTicked"
:ticked="provTicked"
tick-strategy="leaf-filtered"
@update:ticked="handleRegionTicked"
:ticked="regionTicked"
text-color="#666"
no-nodes-label=" "
no-results-label=" "
......@@ -69,7 +87,24 @@
color="primary"
class="q-mt-md"
/>
</q-card><q-card flat class="rounded-borders q-mt-lg row no-padding q-mb-lg">
<div class="row">
<q-chip
square
class="cursor-pointer"
clickable
:text-color="msg.PriceName != x.Name ? 'dark' : 'white'"
:class="{
'bg-grey-3': msg.PriceName != x.Name,
'bg-primary': msg.PriceName == x.Name,
}"
v-for="(x, i) in PriceList"
:key="i"
@click="chosenSortHandler(x)"
>{{ x.Name }}</q-chip
>
</div>
</q-card>
<q-card flat class="rounded-borders q-mt-lg row no-padding q-mb-lg">
<div
class="q-px-md q-py-sm "
style="border-right: 1px solid #eee; border-radius: 0 !important"
......@@ -96,33 +131,97 @@
</div>
</q-popup-proxy>
</div>
</q-card></popup>
</q-card>
</popup>
<popup mode="top" v-model="showStarRating">
<q-card flat class="rounded-borders q-py-md">
<div class="text-subtitle1 text-weight-bold q-mx-md q-pb-sm">篩選星级</div>
<q-tree
ref="region"
:nodes="StarRatingList"
no-connectors
node-key="Id"
label-key="Name"
tick-strategy="leaf"
@update:ticked="handleQStarRegionTicked"
:ticked="msg.QStarRating"
text-color="#666"
no-nodes-label=" "
no-results-label=" "
/>
</q-card>
</popup>
</div>
<div v-else class="col-3" :class="$q.platform.is.desktop ? 'q-mr-lg' : 'q-ma-md'">
<q-card flat class="rounded-borders q-py-md">
<div class="text-subtitle1 text-weight-bold q-mx-md">篩選目的地</div>
<q-input
v-model="searchAdd.name"
type="text"
standout
placeholder="搜尋目的地"
class="q-ma-md"
@input="changeAddrSearchHandler"
<div class="relative">
<q-input
v-model="searchAdd.name"
type="text"
standout
placeholder="搜尋目的地"
class="q-ma-md"
@input="changeAddrSearchHandler"
@keyup.enter="searchCity"
/>
<div class="KeyCityBox absolute bg-white showbox column q-ml-md w-full q-pa-sm"
v-show="showCity"
id="sb"
transition-show="fade"
elevated
transition-hide="scale"
style="z-index: 9;">
<div v-for="item in KeyCityListAll" :key="item.Id"
class="cursor-pointer"
@click="selectCity(item)"
>{{ item.Name }}</div>
</div>
</div>
<q-tree
ref="Cities"
:nodes="CitiesList"
no-connectors
node-key="CityCode"
label-key="CityName"
tick-strategy="leaf-filtered"
@update:ticked="handleCitiesTicked"
:ticked="CitiesTicked"
text-color="#666"
no-nodes-label=" "
no-results-label=" "
/>
<q-tree
ref="area"
:nodes="areaList"
ref="region"
:nodes="regionList"
no-connectors
node-key="Id"
label-key="Name"
tick-strategy="leaf-filtered"
@update:ticked="handleAreaTicked"
:ticked="areaTicked"
@update:ticked="handleRegionTicked"
:ticked="regionTicked"
text-color="#666"
no-nodes-label=" "
no-results-label=" "
/>
<q-tree
<!-- <q-tree
ref="area"
:nodes="KeyCityList"
no-connectors
node-key="Id"
label-key="Name"
tick-strategy="leaf-filtered"
@update:ticked="handleKeyCityTicked"
:ticked="KeyCityTicked"
text-color="#666"
no-nodes-label=" "
no-results-label=" "
/> -->
<!-- <q-tree
ref="province"
:nodes="provinceList"
no-connectors
......@@ -134,7 +233,7 @@
text-color="#666"
no-nodes-label=" "
no-results-label=" "
/>
/> -->
</q-card>
......@@ -167,6 +266,22 @@
</div>
</q-card>
<q-card flat class="rounded-borders q-py-xs q-mt-lg">
<q-tree
ref="region"
:nodes="StarRatingList"
no-connectors
node-key="Id"
label-key="Name"
tick-strategy="leaf"
@update:ticked="handleQStarRegionTicked"
:ticked="msg.QStarRating"
text-color="#666"
no-nodes-label=" "
no-results-label=" "
/>
</q-card>
<q-card flat class="rounded-borders q-pa-md q-mt-lg">
<div class="text-subtitle1 text-weight-bold">價錢篩選(CNY</div>
<div class="q-mt-md text-grey-6 text-subtitle2 text-regular">
......@@ -181,7 +296,26 @@
color="primary"
class="q-mt-md"
/>
<div class="row">
<q-chip
square
class="cursor-pointer"
clickable
:text-color="msg.PriceName != x.Name ? 'dark' : 'white'"
:class="{
'bg-grey-3': msg.PriceName != x.Name,
'bg-primary': msg.PriceName == x.Name,
}"
v-for="(x, i) in PriceList"
:key="i"
@click="chosenSortHandler(x)"
>{{ x.Name }}</q-chip
>
</div>
</q-card>
</div>
<div class="col q-mt-sm">
<div class="rounded-borders bg-white">
......@@ -202,7 +336,7 @@
:label="x.Name"
/>
</div>
<div v-if="false"
<div
class="q-pa-md row items-center"
style="border-top: 1px solid #eee"
>
......@@ -212,15 +346,15 @@
:icon="x.icon"
class="cursor-pointer"
clickable
:text-color="msg.orderBy != x.value ? 'dark' : 'white'"
:text-color="msg.QOrderBy != x.Id ? 'dark' : 'white'"
:class="{
'bg-grey-3': msg.orderBy != x.value,
'bg-primary': msg.orderBy == x.value,
'bg-grey-3': msg.QOrderBy != x.Id,
'bg-primary': msg.QOrderBy == x.Id,
}"
v-for="(x, i) in sortArray"
:key="i"
@click="chosenSortHandler(x)"
>{{ x.label }}</q-chip
@click="chosenSortHandler(x,1)"
>{{ x.Name }}</q-chip
>
</div>
</div>
......@@ -259,19 +393,22 @@
class="f12 rounded-borders text-secondary"
label="急速確認"
/>
<!-- <q-chip
v-if="x.address"
style="background: #26a69a1a"
size="sm"
class="f12 rounded-borders text-secondary"
:label="x.address"
/> -->
<template v-if="x.tagList.length">
<q-chip
v-for="(item,index) in x.tagList"
:key="index"
style="background: #26a69a1a"
size="sm"
class="f12 rounded-borders text-secondary"
:label="item"
/>
</template>
</div>
<div
class="text-subtitle2 text-grey text-weight-regular ellipsis-2-lines"
style="line-height: 1.6"
>
{{ x.DescriptionList.length?x.DescriptionList[0].NoHtmlHotelDescription:'' }}
{{ x.description?x.description:'' }}
</div>
<div class="row items-center f12 text-grey-6 q-mt-md">
<q-icon
......@@ -293,7 +430,7 @@
</div>
<div class="text-h6 product-price">
CNY{{ x.lowrateBySetCurrency }}<span class="price-stuff">元起</span>
CNY{{ x.unitprice }}<span class="price-stuff">元起</span>
</div>
</div>
</div>
......@@ -348,15 +485,15 @@ export default {
data() {
return {
showAddress: false,
showCategory: false,
showStarRating: false,
showDate: false,
showPrice: false,
areaTicked: [],
ticked: [],
selected: [],
searchAdd: {
name: "日本",
value: "JP",
name: "",
value: "",
},
areaList: [],
chosenAddress: [],
......@@ -421,21 +558,21 @@ export default {
],
DataList: [],
sortArray: [
{
label: "默认排序",
value: 0,
icon: "iconfont icongood",
},
{
label: "價格:低到高",
value: 1,
icon: "iconfont iconmeiyuan",
},
{
label: "價格:高到低",
value: 2,
icon: "iconfont iconmeiyuan",
},
// {
// label: "默认排序",
// value: 0,
// icon: "iconfont icongood",
// },
// {
// label: "價格:低到高",
// value: 1,
// icon: "iconfont iconmeiyuan",
// },
// {
// label: "價格:高到低",
// value: 2,
// icon: "iconfont iconmeiyuan",
// },
],
TotalCount: 0,
PageCount: 0,
......@@ -447,18 +584,34 @@ export default {
expandedProvince: false,
provinceList: [],
provTicked: [],
CitiesList: [],
CitiesTicked: [],
CitiesListAll: [],
DestiByCityList: [],// 搜索城市
regionListAll: [],// 区域
regionList: [],// 区域
regionTicked: [],
KeyCityList: [],// 搜索城市
KeyCityListAll: [],// 搜索城市
KeyCityTicked: [],
showCity: false,
StarList: [],
TagList: [],
NearbyList: [],
StarRatingList: [],
PriceList: [],
};
},
watch: {
qMsg: {
handler(newVal, oldVal) {
this.msg = this.qMsg;
this.msg = JSON.parse(JSON.stringify(this.qMsg));
this.msg.priceRange = {
min: 1,
max: 100000,
};
this.msg.MinPrice = 0;
this.msg.MaxPrice = 100000;
this.msg.StartPrice = 0;
this.msg.EndPrice = 100000;
this.dayArray.forEach((x) => {
x.checked = false;
});
......@@ -468,7 +621,7 @@ export default {
}
this.dateRange = { from: this.msg.StartDate, to: this.msg.EndDate };
if(newVal!=oldVal){
this.goSearchHandler();
this.resetQuery();
}
},
deep: true,
......@@ -476,14 +629,15 @@ export default {
},
},
created() {
this.getCity()
this.initAreaList();
this.initGoods();
this.getSorts()
},
mounted() {
this.areaTicked = this.msg.Country ? [this.msg.Country] : (this.msg.Countrys ? this.msg.Countrys : []);
this.msg.placeIds = this.getChoseAddressCity().join(",");
this.areaTicked = this.msg.Country ? [this.msg.Country] : (this.msg.Countrys ? this.msg.Countrys : []);
this.msg.placeIds = this.getChoseAddressCity().join(",");
var CategoryName = this.getUrlKey("CategoryName", window.location.href);
if (CategoryName) {
let list = this.goodsType.find(
......@@ -502,6 +656,169 @@ export default {
}
},
methods: {
getSorts(){
this.apipost('dmc_post_B2BAndB2CDiDaHotelQueryCondition', {},
(res) => {
if(res.data.resultCode == 1){
let data = res.data.data
data.OrderByList.unshift({
Name: "默认排序",
Id: 0,
icon: "iconfont icongood",
})
data.OrderByList.forEach((x,index) => {
if(x.Id==1){
x.icon = 'iconfont iconmeiyuan'
}else if(x.Id==2){
x.icon = 'iconfont iconmeiyuan'
}else if(x.Id==3){
x.icon = 'iconfont icongood'
}else if(x.Id==4){
x.icon = 'iconfont icongood'
}
})
this.sortArray = data.OrderByList
// data.StarRatingList.forEach((x,index) => {
// x.Name = x.StarRating
// x.Id = x.StarRating
// })
this.StarRatingList = [
{
Id: 0,
Name: "星级",
children: data.StarRatingList,
},
]
this.PriceList = data.PriceList
}
})
this.apipost('dmc_post_GetDiDaHotelQuery', {
},
(res) => {
if (res.data.resultCode == 1) {
let data = res.data.data
data.OrderByList.forEach((x,index) => {
if(x.Id==1){
x.icon = 'iconfont icongood'
}else if(x.Id==2){
x.icon = 'iconfont iconmeiyuan'
}else if(x.Id==3){
x.icon = 'iconfont iconmeiyuan'
}else if(x.Id==4){
x.icon = 'iconfont icongood'
}
})
this.StarList = data.StarList
this.TagList = data.TagList
this.NearbyList = data.NearbyList
}
},
(err) => {
}
);
},
selectCity(item){
this.msg.CityCode = item.Id
this.msg.CityCode2 = item.Id
this.msg.CityName = item.Name.split(' ')[0]
this.msg.KeyWords2 = item.Name.split(' ')[0]
this.showCity = false
this.resetQuery()
},
// 关键字搜索城市
searchCity() {
if(this.CitiesList.length||this.regionList.length) return
this.msg.KeyWords = this.searchAdd.name
this.apipost('dmc_post_B2BAndB2CGetDestination', {
KeyWords: this.msg.KeyWords
},
(res) => {
if (res.data.resultCode == 1) {
let data = res.data.data
data.forEach((x,index) => {
x.Name = x.NameCN
x.Id = x.CityCode
})
this.KeyCityListAll = data
this.KeyCityList = [
{
Id: 0,
Name: '关键字',
children: data
}
]
this.KeyCityJSON = JSON.parse(JSON.stringify(this.KeyCityList));
this.showCity = true
}
},
(err) => {
}
);
},
getCity(){
this.apipost(
"dmc_post_B2BAndB2CGetHotCity", {},
res => {
if (res.data.resultCode == 1) {
let data = res.data.data
data.forEach((x,index) => {
x.CityName = x.GName
x.CityCode = `title_${index}`
x.children = x.CityList
x.CityList.forEach(y => {
this.CitiesListAll.push(y)
})
})
this.msg.CityCode = data[0].CityList[0].CityCode
this.msg.CityName = data[0].CityList[0].CityName_CN
this.msg.CityCode2 = data[0].CityList[0].CityCode
this.CitiesTicked = [data[0].CityList[0].CityCode]
this.CitiesList = data;
this.CitiesJSON = JSON.parse(JSON.stringify(this.CitiesList));
this.getRegion()
}
},
);
},
// 区域
getRegion() {
//this.parameters.regionCode = ''
var regMsg = {
CityCode: this.msg.CityCode2,
Name: this.msg.CityName,
};
this.apipost('dmc_post_GetDestinationByCityCode', regMsg,
(res) => {
if (res.data.resultCode == 1) {
this.regionListAll = []
this.regionList = []
let data = res.data.data;
let arrList = function(list){
list.forEach(x => {
x.Id = x.CityCode;
x.Name = x.CityName_CN;
})
}
arrList(data);
this.regionTicked = [data[0].CityCode]
this.regionListAll = data
this.regionList = [
{
Id: 0,
Name: '区域',
children: data
}
]
this.regionJSON = JSON.parse(JSON.stringify(this.regionList));
}
},
(err) => {}
);
},
changeHandler(item) {
if(item.checked) {
this.msg.DestinationID = item.Id;
......@@ -520,6 +837,57 @@ export default {
},
handleSelected(target) {
},
// 关键字查询
handleKeyCityTicked(target) {
if(target.length>1) this.KeyCityTicked = [target[target.length-1]]
else if(target.length==1) this.KeyCityTicked = target
else this.KeyCityTicked = [];
this.msg.CityCode = this.KeyCityTicked[0]
this.msg.CityCode2 = this.KeyCityTicked[0]
let findIndex = this.KeyCityListAll.findIndex(x=>x.CityCode==this.msg.CityCode)
if(findIndex!=-1) this.msg.KeyWords2 = this.KeyCityListAll[findIndex].NameCN.split(' ')[0]
this.msg.KeyWords = ''
this.msg.hotelId = null
this.resetQuery();
},
handleQStarRegionTicked(target) {
this.msg.QStarRating = target
this.resetQuery();
},
// 区域
handleRegionTicked(target) {
if(target.length>1) this.regionTicked = [target[target.length-1]]
else if(target.length==1) this.regionTicked = target
else this.regionTicked = [];
this.msg.regionCode = this.regionTicked[0]
let findIndex = this.regionListAll.findIndex(x=>x.CityCode==this.msg.regionCode)
if(findIndex!=-1) this.msg.CityName_CN = this.regionListAll[findIndex].CityName_CN
console.log(this.msg.CityName_CN,this.msg.regionCode)
return
this.resetQuery();
},
// 目的地城市
handleCitiesTicked(target) {
let oldCityCode = this.msg.CityCode2
if(target.length>1) this.CitiesTicked = [target[target.length-1]]
else if(target.length==1) this.CitiesTicked = target
else this.CitiesTicked = [];
this.CitiesList.forEach(x=>{
x.children.forEach(y => {
if(y.CityCode==this.msg.CityCode){
this.msg.GName = x.CityName
}
})
})
this.msg.CityCode = this.CitiesTicked[0]
this.msg.CityCode2 = this.CitiesTicked[0]
let findIndex = this.CitiesListAll.findIndex(x=>x.CityCode==this.msg.CityCode)
if(findIndex!=-1) this.msg.CityName = this.CitiesListAll[findIndex].CityName
if(this.msg.CityCode2!=oldCityCode){
this.getRegion()
}
this.resetQuery();
},
handleTicked(target) {
let goodsType = this.goodsType.filter(x=>{return x.Id==target})
......@@ -549,6 +917,7 @@ export default {
this.getProvinceList(this.msg.Country);
this.resetQuery();
},
initAreaList() {
this.apipost(
"dmc_post_GetDiDaCountryList", {},
......@@ -577,8 +946,6 @@ export default {
}
]
this.areaListJSON = JSON.parse(JSON.stringify(this.areaList));
this.changeAddrSearchHandler('日本')
this.getProvinceList(this.msg.Country);
},
);
},
......@@ -622,8 +989,24 @@ export default {
}
},
chosenSortHandler(x) {
this.msg.orderBy = x.value;
chosenSortHandler(x,type) {
if(type){
this.msg.QOrderBy = x.Id;
}else{
this.msg.StartPrice = x.MinPrice
this.msg.EndPrice = x.MaxPrice
this.msg.PriceName = x.Name
this.priceModel = {
min: 0,
max: x.MaxPrice,
}
this.msg.priceRange = {
'min': x.MinPrice,
'max': x.MaxPrice,
}
}
this.resetQuery();
},
getChoseAddressCity() {
......@@ -652,10 +1035,10 @@ export default {
// this.msg.maxTripDay = "0";
// this.dayArray.forEach(x => {
// if (x.checked) {
// this.msg.MinPrice =
// this.msg.MinPrice > x.min ? x.min : this.msg.MinPrice;
// this.msg.MaxPrice =
// this.msg.MaxPrice < x.max ? x.max : this.msg.MaxPrice;
// this.msg.StartPrice =
// this.msg.StartPrice > x.min ? x.min : this.msg.StartPrice;
// this.msg.EndPrice =
// this.msg.EndPrice < x.max ? x.max : this.msg.EndPrice;
// }
// });
// this.msg.minTripDay =
......@@ -679,8 +1062,13 @@ export default {
},
testHandler(e) {
this.$forceUpdate();
this.msg.MinPrice = e.min;
this.msg.MaxPrice = e.max;
this.msg.StartPrice = e.min;
this.msg.EndPrice = e.max;
this.PriceList.forEach((x) => {
if(e.min>=x.MinPrice && e.max<=x.MaxPrice){
this.msg.PriceName = x.Name;
}
})
this.resetQuery();
},
dateRangeHandler(e) {
......@@ -764,54 +1152,63 @@ export default {
return walkAndCopy(tree);
},
changeAddrSearchHandler(v) {
this.areaListJSONTMP = JSON.parse(JSON.stringify(this.areaListJSON));
this.CitiesJSONTMP = JSON.parse(JSON.stringify(this.CitiesJSON));
let tree = this.dfs(
{ Name: "", children: this.areaListJSONTMP },
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
}
);
tree = this.dfs(
tree,
{ CityName: "", children: this.CitiesJSONTMP },
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
({ CityName }) => {
return CityName.indexOf(v) !== -1;
}
);
tree = this.dfs(
tree,
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
({ CityName }) => {
return CityName.indexOf(v) !== -1;
}
);
if(tree&&tree.children)this.areaList = tree.children;
if(this.provinceJSON){
this.provinceJSONTMP = JSON.parse(JSON.stringify(this.provinceJSON));
let treeProvince = this.dfs(
{ Name: "", children: this.provinceJSONTMP },
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
}
);
treeProvince = this.dfs(
treeProvince,
// tree = this.dfs(
// tree,
// (name, depth) => {},
// ({ CityName }) => {
// return CityName.indexOf(v) !== -1;
// }
// );
if(tree.children) this.CitiesList = tree.children;
if(this.regionJSON){
this.regionJSONTMP = JSON.parse(JSON.stringify(this.regionJSON));
let treeRegion = this.dfs(
{ Name: "", children: this.regionJSONTMP },
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
}
);
treeProvince = this.dfs(
treeProvince,
treeRegion = this.dfs(
treeRegion,
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
}
);
if(treeProvince&&treeProvince.children)this.provinceList = treeProvince.children;
// treeRegion = this.dfs(
// treeRegion,
// (name, depth) => {},
// ({ Name }) => {
// return Name.indexOf(v) !== -1;
// }
// );
if(treeRegion&&treeRegion.children) this.regionList = treeRegion.children;
if((this.regionList.length||this.CitiesList.length)&&this.KeyCityList.length){
this.msg.KeyWords = ''
this.msg.KeyWords2 = ''
this.msg.CityCode = this.CitiesTicked[0]
this.msg.CityCode2 = this.CitiesTicked[0]
this.KeyCityList = []
this.resetQuery()
this.showCity = false
}
}
},
resetQuery(){
......@@ -821,41 +1218,11 @@ export default {
goSearchHandler() {
this.$q.loading.show();
this.DataList = [];
let minTripDay = -1,
maxTripDay = -1,
minPrice = -1,
maxPrice = -1;
if (this.qMsg.MinPrice != "") {
minPrice = parseFloat(this.qMsg.MinPrice);
}
if (this.qMsg.MaxPrice != "") {
maxPrice = parseFloat(this.qMsg.MaxPrice);
if (minPrice > maxPrice) {
this.Error("价格区间的最低价格不能低于最大价格");
return false;
}
}
var companyId = -1;
if (localStorage.groupinfo) {
var groupinfo = JSON.parse(localStorage.groupinfo);
companyId =
groupinfo.siteList[0] && groupinfo.siteList[0].companyId
? groupinfo.siteList[0].companyId
: -1;
}
if (localStorage.b2bUser) {
var b2bUser = JSON.parse(window.localStorage.getItem("b2bUser"));
if (b2bUser) {
this.msg.priceOrderByField = 2;
}
}
this.PageCount = 0;
this.TotalCount = 0;
// b2c_get_GetB2CMergeProductPageList
// dmc_post_GetDiDaHotelPageList
this.apipost(
"dmc_post_GetDiDaHotelPageList",
"dmc_post_B2BAndB2CGetDidaHotelPage",
this.msg,
(res) => {
this.$q.loading.hide();
......@@ -867,19 +1234,17 @@ export default {
if (tempArray && tempArray.length > 0) {
tempArray.forEach(item => {
item.productType = 6;
item.configId = item.hotelId;
item.configId = item.hotelid;
item.images = []
item.ImgList.forEach(img => {
this.checkImageExists(img.ImageUrl, (exists) => {
if(item.coverimg){
this.checkImageExists(item.coverimg, (exists) => {
if(exists){
item.images.push(img.ImageUrl)
item.images.push(item.coverimg)
}
});
})
}
});
this.DataList = tempArray;
// this.$forceUpdate();
}
}
},
......@@ -942,10 +1307,10 @@ export default {
);
this.goodsType = category.children;
// this.ticked = categoryInfo;
this.priceModel = { min: priceInfo.MinPrice, max: priceInfo.MaxPrice };
this.priceModel = { min: priceInfo.StartPrice, max: priceInfo.EndPrice };
// this.msg.priceRange = {
// min: priceInfo.MinPrice,
// max: priceInfo.MaxPrice,
// min: priceInfo.StartPrice,
// max: priceInfo.EndPrice,
// };
let arr = [];
dayInfo.forEach((item) => {
......@@ -978,6 +1343,9 @@ export default {
</script>
<style>
.KeyCityBox:hover{
color: var(--q-color-primary);
}
.addr-list:hover {
background: #E3F2FD;
}
......
......@@ -687,7 +687,7 @@
<template>
<div class="SearchMain" :class="{ 'desktop-page': $q.platform.is.desktop }">
<div class="SearchTop">
<div class="q-my-md" v-if="qMsg.HotelName">
<div class="q-my-md" v-if="qMsg.KeyWords">
<q-breadcrumbs>
<q-breadcrumbs-el
icon="home"
......@@ -695,12 +695,12 @@
class="cursor-pointer"
@click="CommonJump('/index', {})"
/>
<q-breadcrumbs-el :label="qMsg.HotelName" />
<q-breadcrumbs-el :label="qMsg.KeyWords" />
</q-breadcrumbs>
</div>
<div class="text-h6 text-left" v-if="qMsg.HotelName">
<div class="text-h6 text-left" v-if="qMsg.KeyWords">
搜尋結果 “
<span class="text-primary">{{ qMsg.HotelName }}</span
<span class="text-primary">{{ qMsg.KeyWords }}</span
>
</div>
<!-- 电脑端 -->
......@@ -712,7 +712,7 @@
@click="(isShowDialog = true), goSearchHandler"
>
<i class="iconfont iconchazhao"></i>
{{ qMsg.HotelName }}
{{ qMsg.KeyWords }}
</div>
<div class="search-item" @click="(isShowDialog = true), goSearchHandler">
<i class="iconfont iconrili"></i>
......@@ -1077,7 +1077,7 @@
<q-input
filled
id="search_key"
v-model="qMsg.HotelName"
v-model="qMsg.KeyWords"
class="bg-grey-1"
:label="$t('search')"
/>
......@@ -1203,7 +1203,7 @@
<q-input
filled
id="search_key"
v-model="qMsg.HotelName"
v-model="qMsg.KeyWords"
class="bg-grey-1"
:label="$t('search')"
/>
......@@ -1445,19 +1445,45 @@ export default {
pageSize: 20,
//只查询日本
Country: "JP",
DestinationID: '',
City: "",
//星级
Star: '',
//价格等级
PriceLevel: 0,
MaxPrice: 0,
MinPrice: 0,
HotelName: '',
StartDate: '',
EndDate: '',
IsSelectImg: 1,
// Country: "JP",
// DestinationID: '',
// City: "",
// //星级
// Star: '',
// //价格等级
// PriceLevel: 0,
// MaxPrice: 0,
// MinPrice: 0,
// HotelName: '',
// StartDate: '',
// EndDate: '',
// IsSelectImg: 1,
KeyWords: "", //关键字
KeyWords2: "", //关键字
StartPrice: 100,
EndPrice: 0,
QOrderBy: "0", //排序类型
QStarRating: [], //星级
GName: '', //热门
CityCode: '', //目的地代码
CityName: '', //目的地
CityCode2: '', //目的地代码
regionCode: '', //区域
CityName_CN: '',
rooms: 1,
adultsNumber: 2,
childrenNumberZC: 0,
childrenNumberBZC: 0,
peoples: 2,
interCurrent: 0,
searchroomGroup: [{
roomNum: 1,
numberOfAdults: 2,
numberOfChildren: 0,
ChildAgeDetails: [],
ChildAgeTexts: [],//儿童年龄
}],
},
ShowType: 0, //显示样式(0-豆腐格,1-列表)
//行程列表
......@@ -1473,10 +1499,10 @@ export default {
var areaId = this.getUrlKey("areaId", window.location.href);
var areaName = this.getUrlKey("areaName", window.location.href);
if (qsearchKey) {
this.qMsg.HotelName = qsearchKey;
this.qMsg.KeyWords = qsearchKey;
}else if (areaName) {
this.qMsg.HotelName = areaName;
}else this.qMsg.HotelName = ''
this.qMsg.KeyWords = areaName;
}else this.qMsg.KeyWords = ''
if (qsearchDate) {
this.qMsg.StartDate = qsearchDate;
......@@ -1583,7 +1609,7 @@ export default {
);
},
searchFocusHandler() {
if (this.qMsg.HotelName == "") {
if (this.qMsg.KeyWords == "") {
setTimeout(() => {
this.showSplitPannel = true;
}, 200);
......@@ -1591,7 +1617,7 @@ export default {
},
searchBlurHandler() {},
searchChangeHandler() {
if (this.qMsg.HotelName == "") {
if (this.qMsg.KeyWords == "") {
this.showSplitPannel = true;
} else {
this.showSplitPannel = false;
......@@ -1608,7 +1634,7 @@ export default {
}
},
chosenAreaHandler(name) {
this.qMsg.HotelName = name;
this.qMsg.KeyWords = name;
this.showSplitPannel = false;
},
//数据改变
......@@ -1621,7 +1647,7 @@ export default {
this.goSearchHandler();
},
setSearchKey(obj) {
this.qMsg.HotelName = obj.Name;
this.qMsg.KeyWords = obj.Name;
},
goSearchHandler() {
this.$q.loading.show();
......@@ -1642,7 +1668,7 @@ export default {
}
this.SearchResult =
this.qMsg.StartDate + "-" + this.qMsg.EndDate + " " + this.qMsg.HotelName;
this.qMsg.StartDate + "-" + this.qMsg.EndDate + " " + this.qMsg.KeyWords;
let msg = this.qMsg
// if (localStorage.b2bUser) {
// var b2bUser = JSON.parse(window.localStorage.getItem("b2bUser"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment