Commit ac783bfd authored by youjie's avatar youjie

酒店列表

parent 632641f8
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
</script> </script>
<style> <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-face {
font-family: "oswald"; font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf"); src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
......
...@@ -20,7 +20,7 @@ const product = { ...@@ -20,7 +20,7 @@ const product = {
} else if (t === 5) { } else if (t === 5) {
url = "/detailHotal/" + configId + '/' + productInfo.b2CPrice url = "/detailHotal/" + configId + '/' + productInfo.b2CPrice
} else if (t === 6) { } 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 { } else {
throw new Error("參數不合法"); throw new Error("參數不合法");
......
...@@ -10,12 +10,15 @@ ...@@ -10,12 +10,15 @@
<div class="col row items-center justify-center bg-white"> <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="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="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>
</div> </div>
<popup mode="top" v-model="showAddress"> <popup mode="top" v-model="showAddress">
<q-card flat class="rounded-borders q-py-md"> <q-card flat class="rounded-borders q-py-md">
<div class="text-subtitle1 text-weight-bold q-mx-md">篩選目的地</div> <div class="text-subtitle1 text-weight-bold q-mx-md">篩選目的地</div>
<div class="relative">
<q-input <q-input
v-model="searchAdd.name" v-model="searchAdd.name"
type="text" type="text"
...@@ -23,29 +26,44 @@ ...@@ -23,29 +26,44 @@
placeholder="搜尋目的地" placeholder="搜尋目的地"
class="q-ma-md" class="q-ma-md"
@input="changeAddrSearchHandler" @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 <q-tree
ref="area" ref="Cities"
:nodes="areaList" :nodes="CitiesList"
no-connectors no-connectors
node-key="Id" node-key="CityCode"
label-key="Name" label-key="CityName"
tick-strategy="leaf-filtered" tick-strategy="leaf-filtered"
@update:ticked="handleAreaTicked" @update:ticked="handleCitiesTicked"
:ticked="areaTicked" :ticked="CitiesTicked"
text-color="#666" text-color="#666"
no-nodes-label=" " no-nodes-label=" "
no-results-label=" " no-results-label=" "
/> />
<q-tree <q-tree
ref="province" ref="region"
:nodes="provinceList" :nodes="regionList"
no-connectors no-connectors
node-key="Id" node-key="Id"
label-key="Name" label-key="Name"
tick-strategy="leaf" tick-strategy="leaf-filtered"
@update:ticked="handleProvTicked" @update:ticked="handleRegionTicked"
:ticked="provTicked" :ticked="regionTicked"
text-color="#666" text-color="#666"
no-nodes-label=" " no-nodes-label=" "
no-results-label=" " no-results-label=" "
...@@ -69,7 +87,24 @@ ...@@ -69,7 +87,24 @@
color="primary" color="primary"
class="q-mt-md" 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 <div
class="q-px-md q-py-sm " class="q-px-md q-py-sm "
style="border-right: 1px solid #eee; border-radius: 0 !important" style="border-right: 1px solid #eee; border-radius: 0 !important"
...@@ -96,11 +131,35 @@ ...@@ -96,11 +131,35 @@
</div> </div>
</q-popup-proxy> </q-popup-proxy>
</div> </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>
<div v-else class="col-3" :class="$q.platform.is.desktop ? 'q-mr-lg' : 'q-ma-md'"> <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"> <q-card flat class="rounded-borders q-py-md">
<div class="text-subtitle1 text-weight-bold q-mx-md">篩選目的地</div> <div class="text-subtitle1 text-weight-bold q-mx-md">篩選目的地</div>
<div class="relative">
<q-input <q-input
v-model="searchAdd.name" v-model="searchAdd.name"
type="text" type="text"
...@@ -108,21 +167,61 @@ ...@@ -108,21 +167,61 @@
placeholder="搜尋目的地" placeholder="搜尋目的地"
class="q-ma-md" class="q-ma-md"
@input="changeAddrSearchHandler" @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 <q-tree
ref="area" ref="region"
:nodes="areaList" :nodes="regionList"
no-connectors no-connectors
node-key="Id" node-key="Id"
label-key="Name" label-key="Name"
tick-strategy="leaf-filtered" tick-strategy="leaf-filtered"
@update:ticked="handleAreaTicked" @update:ticked="handleRegionTicked"
:ticked="areaTicked" :ticked="regionTicked"
text-color="#666" text-color="#666"
no-nodes-label=" " no-nodes-label=" "
no-results-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" ref="province"
:nodes="provinceList" :nodes="provinceList"
no-connectors no-connectors
...@@ -134,7 +233,7 @@ ...@@ -134,7 +233,7 @@
text-color="#666" text-color="#666"
no-nodes-label=" " no-nodes-label=" "
no-results-label=" " no-results-label=" "
/> /> -->
</q-card> </q-card>
...@@ -167,6 +266,22 @@ ...@@ -167,6 +266,22 @@
</div> </div>
</q-card> </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"> <q-card flat class="rounded-borders q-pa-md q-mt-lg">
<div class="text-subtitle1 text-weight-bold">價錢篩選(CNY</div> <div class="text-subtitle1 text-weight-bold">價錢篩選(CNY</div>
<div class="q-mt-md text-grey-6 text-subtitle2 text-regular"> <div class="q-mt-md text-grey-6 text-subtitle2 text-regular">
...@@ -181,7 +296,26 @@ ...@@ -181,7 +296,26 @@
color="primary" color="primary"
class="q-mt-md" 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> </q-card>
</div> </div>
<div class="col q-mt-sm"> <div class="col q-mt-sm">
<div class="rounded-borders bg-white"> <div class="rounded-borders bg-white">
...@@ -202,7 +336,7 @@ ...@@ -202,7 +336,7 @@
:label="x.Name" :label="x.Name"
/> />
</div> </div>
<div v-if="false" <div
class="q-pa-md row items-center" class="q-pa-md row items-center"
style="border-top: 1px solid #eee" style="border-top: 1px solid #eee"
> >
...@@ -212,15 +346,15 @@ ...@@ -212,15 +346,15 @@
:icon="x.icon" :icon="x.icon"
class="cursor-pointer" class="cursor-pointer"
clickable clickable
:text-color="msg.orderBy != x.value ? 'dark' : 'white'" :text-color="msg.QOrderBy != x.Id ? 'dark' : 'white'"
:class="{ :class="{
'bg-grey-3': msg.orderBy != x.value, 'bg-grey-3': msg.QOrderBy != x.Id,
'bg-primary': msg.orderBy == x.value, 'bg-primary': msg.QOrderBy == x.Id,
}" }"
v-for="(x, i) in sortArray" v-for="(x, i) in sortArray"
:key="i" :key="i"
@click="chosenSortHandler(x)" @click="chosenSortHandler(x,1)"
>{{ x.label }}</q-chip >{{ x.Name }}</q-chip
> >
</div> </div>
</div> </div>
...@@ -259,19 +393,22 @@ ...@@ -259,19 +393,22 @@
class="f12 rounded-borders text-secondary" class="f12 rounded-borders text-secondary"
label="急速確認" label="急速確認"
/> />
<!-- <q-chip <template v-if="x.tagList.length">
v-if="x.address" <q-chip
v-for="(item,index) in x.tagList"
:key="index"
style="background: #26a69a1a" style="background: #26a69a1a"
size="sm" size="sm"
class="f12 rounded-borders text-secondary" class="f12 rounded-borders text-secondary"
:label="x.address" :label="item"
/> --> />
</template>
</div> </div>
<div <div
class="text-subtitle2 text-grey text-weight-regular ellipsis-2-lines" class="text-subtitle2 text-grey text-weight-regular ellipsis-2-lines"
style="line-height: 1.6" style="line-height: 1.6"
> >
{{ x.DescriptionList.length?x.DescriptionList[0].NoHtmlHotelDescription:'' }} {{ x.description?x.description:'' }}
</div> </div>
<div class="row items-center f12 text-grey-6 q-mt-md"> <div class="row items-center f12 text-grey-6 q-mt-md">
<q-icon <q-icon
...@@ -293,7 +430,7 @@ ...@@ -293,7 +430,7 @@
</div> </div>
<div class="text-h6 product-price"> <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> </div>
</div> </div>
...@@ -348,15 +485,15 @@ export default { ...@@ -348,15 +485,15 @@ export default {
data() { data() {
return { return {
showAddress: false, showAddress: false,
showCategory: false, showStarRating: false,
showDate: false, showDate: false,
showPrice: false, showPrice: false,
areaTicked: [], areaTicked: [],
ticked: [], ticked: [],
selected: [], selected: [],
searchAdd: { searchAdd: {
name: "日本", name: "",
value: "JP", value: "",
}, },
areaList: [], areaList: [],
chosenAddress: [], chosenAddress: [],
...@@ -421,21 +558,21 @@ export default { ...@@ -421,21 +558,21 @@ export default {
], ],
DataList: [], DataList: [],
sortArray: [ sortArray: [
{ // {
label: "默认排序", // label: "默认排序",
value: 0, // value: 0,
icon: "iconfont icongood", // icon: "iconfont icongood",
}, // },
{ // {
label: "價格:低到高", // label: "價格:低到高",
value: 1, // value: 1,
icon: "iconfont iconmeiyuan", // icon: "iconfont iconmeiyuan",
}, // },
{ // {
label: "價格:高到低", // label: "價格:高到低",
value: 2, // value: 2,
icon: "iconfont iconmeiyuan", // icon: "iconfont iconmeiyuan",
}, // },
], ],
TotalCount: 0, TotalCount: 0,
PageCount: 0, PageCount: 0,
...@@ -447,18 +584,34 @@ export default { ...@@ -447,18 +584,34 @@ export default {
expandedProvince: false, expandedProvince: false,
provinceList: [], provinceList: [],
provTicked: [], provTicked: [],
CitiesList: [],
CitiesTicked: [],
CitiesListAll: [],
DestiByCityList: [],// 搜索城市
regionListAll: [],// 区域
regionList: [],// 区域
regionTicked: [],
KeyCityList: [],// 搜索城市
KeyCityListAll: [],// 搜索城市
KeyCityTicked: [],
showCity: false,
StarList: [],
TagList: [],
NearbyList: [],
StarRatingList: [],
PriceList: [],
}; };
}, },
watch: { watch: {
qMsg: { qMsg: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.msg = this.qMsg; this.msg = JSON.parse(JSON.stringify(this.qMsg));
this.msg.priceRange = { this.msg.priceRange = {
min: 1, min: 1,
max: 100000, max: 100000,
}; };
this.msg.MinPrice = 0; this.msg.StartPrice = 0;
this.msg.MaxPrice = 100000; this.msg.EndPrice = 100000;
this.dayArray.forEach((x) => { this.dayArray.forEach((x) => {
x.checked = false; x.checked = false;
}); });
...@@ -468,7 +621,7 @@ export default { ...@@ -468,7 +621,7 @@ export default {
} }
this.dateRange = { from: this.msg.StartDate, to: this.msg.EndDate }; this.dateRange = { from: this.msg.StartDate, to: this.msg.EndDate };
if(newVal!=oldVal){ if(newVal!=oldVal){
this.goSearchHandler(); this.resetQuery();
} }
}, },
deep: true, deep: true,
...@@ -476,9 +629,10 @@ export default { ...@@ -476,9 +629,10 @@ export default {
}, },
}, },
created() { created() {
this.getCity()
this.initAreaList(); this.initAreaList();
this.initGoods(); this.initGoods();
this.getSorts()
}, },
mounted() { mounted() {
...@@ -502,6 +656,169 @@ export default { ...@@ -502,6 +656,169 @@ export default {
} }
}, },
methods: { 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) { changeHandler(item) {
if(item.checked) { if(item.checked) {
this.msg.DestinationID = item.Id; this.msg.DestinationID = item.Id;
...@@ -520,6 +837,57 @@ export default { ...@@ -520,6 +837,57 @@ export default {
}, },
handleSelected(target) { 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) { handleTicked(target) {
let goodsType = this.goodsType.filter(x=>{return x.Id==target}) let goodsType = this.goodsType.filter(x=>{return x.Id==target})
...@@ -549,6 +917,7 @@ export default { ...@@ -549,6 +917,7 @@ export default {
this.getProvinceList(this.msg.Country); this.getProvinceList(this.msg.Country);
this.resetQuery(); this.resetQuery();
}, },
initAreaList() { initAreaList() {
this.apipost( this.apipost(
"dmc_post_GetDiDaCountryList", {}, "dmc_post_GetDiDaCountryList", {},
...@@ -577,8 +946,6 @@ export default { ...@@ -577,8 +946,6 @@ export default {
} }
] ]
this.areaListJSON = JSON.parse(JSON.stringify(this.areaList)); this.areaListJSON = JSON.parse(JSON.stringify(this.areaList));
this.changeAddrSearchHandler('日本')
this.getProvinceList(this.msg.Country);
}, },
); );
}, },
...@@ -622,8 +989,24 @@ export default { ...@@ -622,8 +989,24 @@ export default {
} }
}, },
chosenSortHandler(x) { chosenSortHandler(x,type) {
this.msg.orderBy = x.value; 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(); this.resetQuery();
}, },
getChoseAddressCity() { getChoseAddressCity() {
...@@ -652,10 +1035,10 @@ export default { ...@@ -652,10 +1035,10 @@ export default {
// this.msg.maxTripDay = "0"; // this.msg.maxTripDay = "0";
// this.dayArray.forEach(x => { // this.dayArray.forEach(x => {
// if (x.checked) { // if (x.checked) {
// this.msg.MinPrice = // this.msg.StartPrice =
// this.msg.MinPrice > x.min ? x.min : this.msg.MinPrice; // this.msg.StartPrice > x.min ? x.min : this.msg.StartPrice;
// this.msg.MaxPrice = // this.msg.EndPrice =
// this.msg.MaxPrice < x.max ? x.max : this.msg.MaxPrice; // this.msg.EndPrice < x.max ? x.max : this.msg.EndPrice;
// } // }
// }); // });
// this.msg.minTripDay = // this.msg.minTripDay =
...@@ -679,8 +1062,13 @@ export default { ...@@ -679,8 +1062,13 @@ export default {
}, },
testHandler(e) { testHandler(e) {
this.$forceUpdate(); this.$forceUpdate();
this.msg.MinPrice = e.min; this.msg.StartPrice = e.min;
this.msg.MaxPrice = e.max; 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(); this.resetQuery();
}, },
dateRangeHandler(e) { dateRangeHandler(e) {
...@@ -764,54 +1152,63 @@ export default { ...@@ -764,54 +1152,63 @@ export default {
return walkAndCopy(tree); return walkAndCopy(tree);
}, },
changeAddrSearchHandler(v) { changeAddrSearchHandler(v) {
this.areaListJSONTMP = JSON.parse(JSON.stringify(this.areaListJSON)); this.CitiesJSONTMP = JSON.parse(JSON.stringify(this.CitiesJSON));
let tree = this.dfs( let tree = this.dfs(
{ Name: "", children: this.areaListJSONTMP }, { CityName: "", children: this.CitiesJSONTMP },
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
}
);
tree = this.dfs(
tree,
(name, depth) => {}, (name, depth) => {},
({ Name }) => { ({ CityName }) => {
return Name.indexOf(v) !== -1; return CityName.indexOf(v) !== -1;
} }
); );
tree = this.dfs( tree = this.dfs(
tree, tree,
(name, depth) => {}, (name, depth) => {},
({ Name }) => { ({ CityName }) => {
return Name.indexOf(v) !== -1; return CityName.indexOf(v) !== -1;
} }
); );
if(tree&&tree.children)this.areaList = tree.children; // tree = this.dfs(
// tree,
// (name, depth) => {},
// ({ CityName }) => {
// return CityName.indexOf(v) !== -1;
// }
// );
if(tree.children) this.CitiesList = tree.children;
if(this.provinceJSON){ if(this.regionJSON){
this.provinceJSONTMP = JSON.parse(JSON.stringify(this.provinceJSON)); this.regionJSONTMP = JSON.parse(JSON.stringify(this.regionJSON));
let treeProvince = this.dfs( let treeRegion = this.dfs(
{ Name: "", children: this.provinceJSONTMP }, { Name: "", children: this.regionJSONTMP },
(name, depth) => {}, (name, depth) => {},
({ Name }) => { ({ Name }) => {
return Name.indexOf(v) !== -1; return Name.indexOf(v) !== -1;
} }
); );
treeProvince = this.dfs( treeRegion = this.dfs(
treeProvince, treeRegion,
(name, depth) => {}, (name, depth) => {},
({ Name }) => { ({ Name }) => {
return Name.indexOf(v) !== -1; return Name.indexOf(v) !== -1;
} }
); );
treeProvince = this.dfs( // treeRegion = this.dfs(
treeProvince, // treeRegion,
(name, depth) => {}, // (name, depth) => {},
({ Name }) => { // ({ Name }) => {
return Name.indexOf(v) !== -1; // 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
} }
);
if(treeProvince&&treeProvince.children)this.provinceList = treeProvince.children;
} }
}, },
resetQuery(){ resetQuery(){
...@@ -821,41 +1218,11 @@ export default { ...@@ -821,41 +1218,11 @@ export default {
goSearchHandler() { goSearchHandler() {
this.$q.loading.show(); this.$q.loading.show();
this.DataList = []; 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.PageCount = 0;
this.TotalCount = 0; this.TotalCount = 0;
// b2c_get_GetB2CMergeProductPageList
// dmc_post_GetDiDaHotelPageList
this.apipost( this.apipost(
"dmc_post_GetDiDaHotelPageList", "dmc_post_B2BAndB2CGetDidaHotelPage",
this.msg, this.msg,
(res) => { (res) => {
this.$q.loading.hide(); this.$q.loading.hide();
...@@ -867,19 +1234,17 @@ export default { ...@@ -867,19 +1234,17 @@ export default {
if (tempArray && tempArray.length > 0) { if (tempArray && tempArray.length > 0) {
tempArray.forEach(item => { tempArray.forEach(item => {
item.productType = 6; item.productType = 6;
item.configId = item.hotelId; item.configId = item.hotelid;
item.images = [] item.images = []
item.ImgList.forEach(img => { if(item.coverimg){
this.checkImageExists(img.ImageUrl, (exists) => { this.checkImageExists(item.coverimg, (exists) => {
if(exists){ if(exists){
item.images.push(img.ImageUrl) item.images.push(item.coverimg)
} }
}); });
}) }
}); });
this.DataList = tempArray; this.DataList = tempArray;
// this.$forceUpdate();
} }
} }
}, },
...@@ -942,10 +1307,10 @@ export default { ...@@ -942,10 +1307,10 @@ export default {
); );
this.goodsType = category.children; this.goodsType = category.children;
// this.ticked = categoryInfo; // this.ticked = categoryInfo;
this.priceModel = { min: priceInfo.MinPrice, max: priceInfo.MaxPrice }; this.priceModel = { min: priceInfo.StartPrice, max: priceInfo.EndPrice };
// this.msg.priceRange = { // this.msg.priceRange = {
// min: priceInfo.MinPrice, // min: priceInfo.StartPrice,
// max: priceInfo.MaxPrice, // max: priceInfo.EndPrice,
// }; // };
let arr = []; let arr = [];
dayInfo.forEach((item) => { dayInfo.forEach((item) => {
...@@ -978,6 +1343,9 @@ export default { ...@@ -978,6 +1343,9 @@ export default {
</script> </script>
<style> <style>
.KeyCityBox:hover{
color: var(--q-color-primary);
}
.addr-list:hover { .addr-list:hover {
background: #E3F2FD; background: #E3F2FD;
} }
......
...@@ -687,7 +687,7 @@ ...@@ -687,7 +687,7 @@
<template> <template>
<div class="SearchMain" :class="{ 'desktop-page': $q.platform.is.desktop }"> <div class="SearchMain" :class="{ 'desktop-page': $q.platform.is.desktop }">
<div class="SearchTop"> <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>
<q-breadcrumbs-el <q-breadcrumbs-el
icon="home" icon="home"
...@@ -695,12 +695,12 @@ ...@@ -695,12 +695,12 @@
class="cursor-pointer" class="cursor-pointer"
@click="CommonJump('/index', {})" @click="CommonJump('/index', {})"
/> />
<q-breadcrumbs-el :label="qMsg.HotelName" /> <q-breadcrumbs-el :label="qMsg.KeyWords" />
</q-breadcrumbs> </q-breadcrumbs>
</div> </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> </div>
<!-- 电脑端 --> <!-- 电脑端 -->
...@@ -712,7 +712,7 @@ ...@@ -712,7 +712,7 @@
@click="(isShowDialog = true), goSearchHandler" @click="(isShowDialog = true), goSearchHandler"
> >
<i class="iconfont iconchazhao"></i> <i class="iconfont iconchazhao"></i>
{{ qMsg.HotelName }} {{ qMsg.KeyWords }}
</div> </div>
<div class="search-item" @click="(isShowDialog = true), goSearchHandler"> <div class="search-item" @click="(isShowDialog = true), goSearchHandler">
<i class="iconfont iconrili"></i> <i class="iconfont iconrili"></i>
...@@ -1077,7 +1077,7 @@ ...@@ -1077,7 +1077,7 @@
<q-input <q-input
filled filled
id="search_key" id="search_key"
v-model="qMsg.HotelName" v-model="qMsg.KeyWords"
class="bg-grey-1" class="bg-grey-1"
:label="$t('search')" :label="$t('search')"
/> />
...@@ -1203,7 +1203,7 @@ ...@@ -1203,7 +1203,7 @@
<q-input <q-input
filled filled
id="search_key" id="search_key"
v-model="qMsg.HotelName" v-model="qMsg.KeyWords"
class="bg-grey-1" class="bg-grey-1"
:label="$t('search')" :label="$t('search')"
/> />
...@@ -1445,19 +1445,45 @@ export default { ...@@ -1445,19 +1445,45 @@ export default {
pageSize: 20, pageSize: 20,
//只查询日本 //只查询日本
Country: "JP", // Country: "JP",
DestinationID: '', // DestinationID: '',
City: "", // City: "",
//星级 // //星级
Star: '', // Star: '',
//价格等级 // //价格等级
PriceLevel: 0, // PriceLevel: 0,
MaxPrice: 0, // MaxPrice: 0,
MinPrice: 0, // MinPrice: 0,
HotelName: '', // HotelName: '',
StartDate: '', // StartDate: '',
EndDate: '', // EndDate: '',
IsSelectImg: 1, // 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-列表) ShowType: 0, //显示样式(0-豆腐格,1-列表)
//行程列表 //行程列表
...@@ -1473,10 +1499,10 @@ export default { ...@@ -1473,10 +1499,10 @@ export default {
var areaId = this.getUrlKey("areaId", window.location.href); var areaId = this.getUrlKey("areaId", window.location.href);
var areaName = this.getUrlKey("areaName", window.location.href); var areaName = this.getUrlKey("areaName", window.location.href);
if (qsearchKey) { if (qsearchKey) {
this.qMsg.HotelName = qsearchKey; this.qMsg.KeyWords = qsearchKey;
}else if (areaName) { }else if (areaName) {
this.qMsg.HotelName = areaName; this.qMsg.KeyWords = areaName;
}else this.qMsg.HotelName = '' }else this.qMsg.KeyWords = ''
if (qsearchDate) { if (qsearchDate) {
this.qMsg.StartDate = qsearchDate; this.qMsg.StartDate = qsearchDate;
...@@ -1583,7 +1609,7 @@ export default { ...@@ -1583,7 +1609,7 @@ export default {
); );
}, },
searchFocusHandler() { searchFocusHandler() {
if (this.qMsg.HotelName == "") { if (this.qMsg.KeyWords == "") {
setTimeout(() => { setTimeout(() => {
this.showSplitPannel = true; this.showSplitPannel = true;
}, 200); }, 200);
...@@ -1591,7 +1617,7 @@ export default { ...@@ -1591,7 +1617,7 @@ export default {
}, },
searchBlurHandler() {}, searchBlurHandler() {},
searchChangeHandler() { searchChangeHandler() {
if (this.qMsg.HotelName == "") { if (this.qMsg.KeyWords == "") {
this.showSplitPannel = true; this.showSplitPannel = true;
} else { } else {
this.showSplitPannel = false; this.showSplitPannel = false;
...@@ -1608,7 +1634,7 @@ export default { ...@@ -1608,7 +1634,7 @@ export default {
} }
}, },
chosenAreaHandler(name) { chosenAreaHandler(name) {
this.qMsg.HotelName = name; this.qMsg.KeyWords = name;
this.showSplitPannel = false; this.showSplitPannel = false;
}, },
//数据改变 //数据改变
...@@ -1621,7 +1647,7 @@ export default { ...@@ -1621,7 +1647,7 @@ export default {
this.goSearchHandler(); this.goSearchHandler();
}, },
setSearchKey(obj) { setSearchKey(obj) {
this.qMsg.HotelName = obj.Name; this.qMsg.KeyWords = obj.Name;
}, },
goSearchHandler() { goSearchHandler() {
this.$q.loading.show(); this.$q.loading.show();
...@@ -1642,7 +1668,7 @@ export default { ...@@ -1642,7 +1668,7 @@ export default {
} }
this.SearchResult = this.SearchResult =
this.qMsg.StartDate + "-" + this.qMsg.EndDate + " " + this.qMsg.HotelName; this.qMsg.StartDate + "-" + this.qMsg.EndDate + " " + this.qMsg.KeyWords;
let msg = this.qMsg let msg = this.qMsg
// if (localStorage.b2bUser) { // if (localStorage.b2bUser) {
// var b2bUser = JSON.parse(window.localStorage.getItem("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