Commit 64127f95 authored by youjie's avatar youjie

no message

parent fb5272cb
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
{{ item.RoomName==item.RoomName_CN?"":item.RoomName}} {{ item.RoomName==item.RoomName_CN?"":item.RoomName}}
</div> </div>
</div> </div>
<q-scroll-area style="" <!-- <q-scroll-area style=""
:thumb-style="{ :thumb-style="{
right: '2px', right: '2px',
borderRadius: '5px', borderRadius: '5px',
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
:content-active-style="{ :content-active-style="{
backgroundColor: 'rgba(0, 0, 0, 0)', backgroundColor: 'rgba(0, 0, 0, 0)',
color: 'black' color: 'black'
}"></q-scroll-area> }"></q-scroll-area> -->
<div <div
v-if="item.RatePlanList" class="col" :class="{'column':$q.platform.is.desktop,'column':$q.platform.is.mobile}"> v-if="item.RatePlanList" class="col" :class="{'column':$q.platform.is.desktop,'column':$q.platform.is.mobile}">
<template v-for="(subItem,indexs) in item.RatePlanList"> <template v-for="(subItem,indexs) in item.RatePlanList">
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
:label="$t('search')" :label="$t('search')"
@focus="searchFocusHandler" @focus="searchFocusHandler"
@blur="searchBlurHandler" @blur="searchBlurHandler"
@keyup="searchChangeHandler" @keyup.enter="searchChangeHandler"
/> />
</div> </div>
<div class="col-2"> <div class="col-2">
...@@ -94,11 +94,32 @@ ...@@ -94,11 +94,32 @@
</q-btn> </q-btn>
</div> </div>
</div> </div>
<div class="column">
<div class="text-weight-bold q-pa-sm">熱門目的地</div> <div class="text-weight-bold q-pa-sm">熱門目的地</div>
<q-separator /> <q-separator />
<div class="flex flex-wrap">
<q-scroll-area class="w-full" style="height: 305px;"
:thumb-style="{
right: '2px',
borderRadius: '5px',
backgroundColor: 'rgba(0, 0, 0, .1)',
width: '5px',
opacity: '0.75'
}"
:content-style="{
backgroundColor: 'rgba(0, 0, 0, 0)',
color: '#555'
}"
:content-active-style="{
backgroundColor: 'rgba(0, 0, 0, 0)',
color: 'black'
}">
<div class="flex flex-wrap"> <div class="flex flex-wrap">
<div class="hot-tag" @click="handleHotTagClick(item)" :class="{'hot-tag-select': setectHotTag === item.Id}" :key="item.Id" v-for="item in hotList">{{item.Name}}</div> <div class="hot-tag" @click="handleHotTagClick(item)" :class="{'hot-tag-select': setectHotTag === item.Id}" :key="item.Id" v-for="item in hotList">{{item.Name}}</div>
</div> </div>
</q-scroll-area>
</div>
</div>
</div> </div>
</div> </div>
<div class=" bg-white q-px-md" v-if="$q.screen.xs" @click="showPopupHandler"> <div class=" bg-white q-px-md" v-if="$q.screen.xs" @click="showPopupHandler">
...@@ -366,6 +387,32 @@ export default { ...@@ -366,6 +387,32 @@ export default {
beforeDestroy() { beforeDestroy() {
document.removeEventListener("click", this.clickHandler); document.removeEventListener("click", this.clickHandler);
}, },
watch: {
'$route': {
handler(to, from) {
if(to.path.indexOf('searchDida')!=-1||to.path.indexOf('detailHotalDida')!=-1){
this.getHotalHotList()
}else{
var jObj = JSON.parse(window.localStorage.getItem('baseifo'));
const hotList = this.getHotList(jObj.AreaList)
this.hotList = hotList
}
},
deep: true,
immediate: true
}
},
methods: {
getHistory() {
let historys = JSON.parse(localStorage.getItem("searchHistory")) || [];
this.historys = historys;
},
clearHistory() {
localStorage.removeItem("searchHistory");
this.historys = [];
}
},
computed: {}, computed: {},
methods: { methods: {
handleAreaTicked(target) { handleAreaTicked(target) {
...@@ -411,6 +458,35 @@ export default { ...@@ -411,6 +458,35 @@ export default {
}); });
return hotArr; return hotArr;
}, },
getHotalHotList() {
let hotArr = [];
this.apipost(
"dmc_post_B2BAndB2CGetHotCity", {},
res => {
if (res.data.resultCode == 1) {
let arr = res.data.data
arr.forEach((item,index) => {
if(!index){
item.Name = item.GName
if (item.CityList && item.CityList.length) {
item.CityList.forEach((x) => {
x.Name = x.CityName
x.Id = x.CityCode
})
hotArr = hotArr.concat(item.CityList);
} else {
if (item.IsHot === 1) {
item.Name = item.CityName
item.Id = item.CityCode
hotArr.push(item);
}
}
}
});
this.hotList = hotArr;
}
})
},
handleHotTagClick(item) { handleHotTagClick(item) {
this.setectHotTag = item.Id this.setectHotTag = item.Id
let qsearchDate = this.searchDate let qsearchDate = this.searchDate
...@@ -422,19 +498,32 @@ export default { ...@@ -422,19 +498,32 @@ export default {
// this.historys=Array.from(new Set([this.searchKey].concat(this.historys))) // this.historys=Array.from(new Set([this.searchKey].concat(this.historys)))
// localStorage['recent_search'] = JSON.stringify(this.historys) // localStorage['recent_search'] = JSON.stringify(this.historys)
var currentUrl = window.location.href; var currentUrl = window.location.href;
let urlName=""; let urlName="/search";
let currentUrlArr = currentUrl.split('/') // let currentUrlArr = currentUrl.split('/')
let urlType = currentUrlArr[4].split('?')[0] // let urlType = currentUrlArr[4].split('?')[0]
if(urlType){ // if(urlType){
urlName = `/${urlType}` // urlName = `/${urlType}`
if(urlType=='SearchDida'||urlType=='searchDida'){ // if(urlType=='searchProduct'){
// urlName = `/search`
// }else if(urlType=='detailsVisa'){
// urlName = `/searchVisa`
// }else if(urlType=='SearchDida'||urlType=='searchDida'||urlType=='detailHotalDida'){
// qsearchDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD")
// qsearchEndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
// if(urlType=='detailHotalDida') urlName = `/searchDida`
// }
// }
if(currentUrl.includes('/#/searchProduct')){
urlName="/searchProduct";
}else if(currentUrl.includes('/#/planeticket')){
urlName="/planeticket";
}else if(currentUrl.includes('/#/searchVisa')){
urlName="/searchVisa";
}else if(currentUrl.includes('/#/searchdida')||currentUrl.includes('/#/detailHotalDida')){
urlName="/searchdida";
qsearchDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD") qsearchDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD")
qsearchEndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD") qsearchEndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
}else{
qsearchDate = this.searchDate
qsearchEndDate = this.searchEndDate
}
} }
if(urlName=='/searchVisa'||urlName=='/planeticket'){ if(urlName=='/searchVisa'||urlName=='/planeticket'){
...@@ -524,24 +613,34 @@ export default { ...@@ -524,24 +613,34 @@ export default {
let qsearchDate = this.searchDate let qsearchDate = this.searchDate
let qsearchEndDate = this.searchEndDate let qsearchEndDate = this.searchEndDate
var currentUrl = window.location.href; var currentUrl = window.location.href;
let urlName=""; let urlName="/search";
let currentUrlArr = currentUrl.split('/') // let currentUrlArr = currentUrl.split('/')
let urlType = currentUrlArr[4].split('?')[0] // let urlType = currentUrlArr[4].split('?')[0]
if(urlType){ // if(urlType){
urlName = `/${urlType}` // urlName = `/${urlType}`
if(urlType=='SearchDida'||urlType=='searchDida'){ // if(urlType=='searchProduct'){
// urlName = `/search`
// }else if(urlType=='detailsVisa'){
// urlName = `/searchVisa`
// }else if(urlType=='SearchDida'||urlType=='searchDida'||urlType=='detailHotalDida'){
// qsearchDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD")
// qsearchEndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
// if(urlType=='detailHotalDida') urlName = `/searchDida`
// }
// }
if(currentUrl.includes('/#/searchProduct')){
urlName="/searchProduct";
}else if(currentUrl.includes('/#/planeticket')){
urlName="/planeticket";
}else if(currentUrl.includes('/#/searchVisa')){
urlName="/searchVisa";
}else if(currentUrl.includes('/#/searchdida')){
urlName="/searchdida";
qsearchDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD") qsearchDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD")
qsearchEndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD") qsearchEndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
} }
}
// if(currentUrl.includes('/#/searchProduct')){
// urlName="/searchProduct";
// }else if(currentUrl.includes('/#/planeticket')){
// urlName="/planeticket";
// }else if(currentUrl.includes('/#/searchVisa')){
// urlName="/searchVisa";
// }
if(urlName=='/searchVisa'||urlName=='/planeticket'){ if(urlName=='/searchVisa'||urlName=='/planeticket'){
this.CommonJump(urlName, { this.CommonJump(urlName, {
Name: this.searchKey, Name: this.searchKey,
......
...@@ -27,16 +27,17 @@ ...@@ -27,16 +27,17 @@
class="q-ma-md" class="q-ma-md"
@input="changeAddrSearchHandler" @input="changeAddrSearchHandler"
@keyup.enter="searchCity" @keyup.enter="searchCity"
@update:model-value="searchCity"
/> />
<div class="KeyCityBox absolute bg-white showbox column q-ml-md w-full q-pa-sm" <div class="KeyCityBox absolute bg-white showbox column q-ml-md w-full q-pa-sm"
v-show="showCity" v-show="showCity"
id="sb" id="city"
transition-show="fade" transition-show="fade"
elevated elevated
transition-hide="scale" transition-hide="scale"
style="z-index: 9;"> style="z-index: 9;">
<div v-for="item in KeyCityList" :key="item.Id" <div v-for="item in KeyCityList" :key="item.Id"
class="cursor-pointer" class="cursor-pointer q-py-xs"
@click="selectCity(item)" @click="selectCity(item)"
>{{ item.Name }}</div> >{{ item.Name }}</div>
</div> </div>
...@@ -167,16 +168,17 @@ ...@@ -167,16 +168,17 @@
class="q-ma-md" class="q-ma-md"
@input="changeAddrSearchHandler" @input="changeAddrSearchHandler"
@keyup.enter="searchCity" @keyup.enter="searchCity"
@update:model-value="searchCity"
/> />
<div class="KeyCityBox absolute bg-white showbox column q-ml-md w-full q-pa-sm" <div class="KeyCityBox absolute bg-white showbox column q-ml-md w-full q-pa-sm"
v-show="showCity" v-show="showCity"
id="sb" id="city"
transition-show="fade" transition-show="fade"
elevated elevated
transition-hide="scale" transition-hide="scale"
style="z-index: 9;"> style="z-index: 9;">
<div v-for="item in KeyCityList" :key="item.Id" <div v-for="item in KeyCityList" :key="item.Id"
class="cursor-pointer" class="cursor-pointer q-py-xs"
@click="selectCity(item)" @click="selectCity(item)"
>{{ item.Name }}</div> >{{ item.Name }}</div>
</div> </div>
...@@ -640,6 +642,9 @@ export default { ...@@ -640,6 +642,9 @@ export default {
immediate: true, immediate: true,
}, },
}, },
beforeDestroy() {
document.removeEventListener("click", this.clickHandler);
},
created() { created() {
this.getCity() this.getCity()
this.initGoods(); this.initGoods();
...@@ -647,6 +652,7 @@ export default { ...@@ -647,6 +652,7 @@ export default {
}, },
mounted() { mounted() {
document.addEventListener("click", this.clickHandler);
// this.CitiesTicked = this.msg.Country ? [this.msg.Country] : (this.msg.Countrys ? this.msg.Countrys : []); // this.CitiesTicked = this.msg.Country ? [this.msg.Country] : (this.msg.Countrys ? this.msg.Countrys : []);
var CategoryName = this.getUrlKey("CategoryName", window.location.href); var CategoryName = this.getUrlKey("CategoryName", window.location.href);
if (CategoryName) { if (CategoryName) {
...@@ -666,6 +672,13 @@ export default { ...@@ -666,6 +672,13 @@ export default {
} }
}, },
methods: { methods: {
clickHandler(e) {
try {
if (!document.querySelector("#city").contains(e.target)) {
this.showCity = false;
}
} catch (error) {}
},
getSorts(){ getSorts(){
this.apipost('dmc_post_B2BAndB2CDiDaHotelQueryCondition', {}, this.apipost('dmc_post_B2BAndB2CDiDaHotelQueryCondition', {},
(res) => { (res) => {
...@@ -741,8 +754,8 @@ export default { ...@@ -741,8 +754,8 @@ export default {
}, },
// 关键字搜索城市 // 关键字搜索城市
searchCity() { searchCity() {
console.log(this.msg.KeyWords) if(this.CitiesList.length||this.regionList.length||this.searchAdd.name=='') return this.showCity = false
if(this.CitiesList.length||this.regionList.length||this.msg.KeyWords=='') return this.showCity = false else if(this.msg.KeyWords==this.searchAdd.name&&this.searchAdd.name) return this.showCity = true
this.msg.KeyWords = this.searchAdd.name this.msg.KeyWords = this.searchAdd.name
this.apipost('dmc_post_B2BAndB2CGetDestination', { this.apipost('dmc_post_B2BAndB2CGetDestination', {
KeyWords: this.msg.KeyWords KeyWords: this.msg.KeyWords
...@@ -781,16 +794,16 @@ export default { ...@@ -781,16 +794,16 @@ export default {
x.CityCode = `title_${index}` x.CityCode = `title_${index}`
x.children = x.CityList x.children = x.CityList
x.CityList.forEach(y => { x.CityList.forEach(y => {
this.CitiesListAll.push(y) if(index) this.CitiesListAll.push(y)
}) })
if(index) this.CitiesList.push(x)
}) })
this.msg.CityCode = this.msg.KeyWords?'':data[0].CityList[0].CityCode // this.msg.CityCode = this.msg.KeyWords?'':data[0].CityList[0].CityCode
this.msg.CityName = this.msg.KeyWords?'':data[0].CityList[0].CityName_CN // this.msg.CityName = this.msg.KeyWords?'':data[0].CityList[0].CityName_CN
this.msg.CityCode2 = this.msg.KeyWords?'':data[0].CityList[0].CityCode // this.msg.CityCode2 = this.msg.KeyWords?'':data[0].CityList[0].CityCode
this.CitiesTicked = this.msg.KeyWords?[]:[data[0].CityList[0].CityCode] // this.CitiesTicked = this.msg.KeyWords?[]:[data[0].CityList[0].CityCode]
this.CitiesList = data;
this.CitiesJSON = JSON.parse(JSON.stringify(this.CitiesList)); this.CitiesJSON = JSON.parse(JSON.stringify(this.CitiesList));
this.getRegion() // this.getRegion()
} }
}, },
); );
...@@ -868,9 +881,9 @@ export default { ...@@ -868,9 +881,9 @@ export default {
this.msg.CityCode2 = this.CitiesTicked.length?this.CitiesTicked[0]:'' this.msg.CityCode2 = this.CitiesTicked.length?this.CitiesTicked[0]:''
let findIndex = this.CitiesListAll.findIndex(x=>x.CityCode==this.msg.CityCode) let findIndex = this.CitiesListAll.findIndex(x=>x.CityCode==this.msg.CityCode)
if(findIndex!=-1) this.msg.CityName = this.CitiesListAll[findIndex].CityName if(findIndex!=-1) this.msg.CityName = this.CitiesListAll[findIndex].CityName
if(this.msg.CityCode2!=oldCityCode){ if(this.msg.CityCode2!=oldCityCode&&this.CitiesTicked.length){
this.getRegion() this.getRegion()
} }else this.regionList = []
this.resetQuery(); this.resetQuery();
}, },
...@@ -1004,6 +1017,7 @@ export default { ...@@ -1004,6 +1017,7 @@ export default {
return walkAndCopy(tree); return walkAndCopy(tree);
}, },
changeAddrSearchHandler(v) { changeAddrSearchHandler(v) {
this.showCity = false
this.CitiesJSONTMP = JSON.parse(JSON.stringify(this.CitiesJSON)); this.CitiesJSONTMP = JSON.parse(JSON.stringify(this.CitiesJSON));
let tree = this.dfs( let tree = this.dfs(
{ CityName: "", children: this.CitiesJSONTMP }, { CityName: "", children: this.CitiesJSONTMP },
...@@ -1052,14 +1066,14 @@ export default { ...@@ -1052,14 +1066,14 @@ export default {
// } // }
// ); // );
if(treeRegion&&treeRegion.children) this.regionList = treeRegion.children; if(treeRegion&&treeRegion.children) this.regionList = treeRegion.children;
if((this.regionList.length||this.CitiesList.length)&&this.KeyCityList.length){
if(this.regionList.length||this.CitiesList.length){
this.msg.KeyWords = '' this.msg.KeyWords = ''
this.msg.KeyWords2 = '' this.msg.KeyWords2 = ''
this.msg.CityCode = this.CitiesTicked[0] this.msg.CityCode = this.CitiesTicked[0]
this.msg.CityCode2 = this.CitiesTicked[0] this.msg.CityCode2 = this.CitiesTicked[0]
this.KeyCityList = [] // this.KeyCityList = []
this.resetQuery() this.resetQuery()
this.showCity = false
} }
} }
}, },
...@@ -1194,8 +1208,13 @@ export default { ...@@ -1194,8 +1208,13 @@ export default {
</script> </script>
<style> <style>
.KeyCityBox:hover{ .KeyCityBox div:hover{
color: var(--q-color-primary); color: var(--q-color-primary);
}
.KeyCityBox div:hover{
text-decoration: solid;
opacity: .8;
} }
.addr-list:hover { .addr-list:hover {
background: #E3F2FD; background: #E3F2FD;
......
...@@ -1444,21 +1444,6 @@ export default { ...@@ -1444,21 +1444,6 @@ export default {
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
//只查询日本
// Country: "JP",
// DestinationID: '',
// City: "",
// //星级
// Star: '',
// //价格等级
// PriceLevel: 0,
// MaxPrice: 0,
// MinPrice: 0,
// HotelName: '',
// StartDate: '',
// EndDate: '',
// IsSelectImg: 1,
KeyWords: "", //关键字 KeyWords: "", //关键字
KeyWords2: "", //关键字 KeyWords2: "", //关键字
StartPrice: 100, StartPrice: 100,
...@@ -1493,6 +1478,39 @@ export default { ...@@ -1493,6 +1478,39 @@ export default {
watch:{ watch:{
'$route': { '$route': {
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.qMsg = {
pageIndex: 1,
pageSize: 20,
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: [],//儿童年龄
}],
}
if(newVal.query&&newVal.query.pageIndex){
this.qMsg = newVal.query
}else{
var qsearchKey = this.getUrlKey("qsearchKey", window.location.href); var qsearchKey = this.getUrlKey("qsearchKey", window.location.href);
var qsearchDate = this.getUrlKey("qsearchDate", window.location.href); var qsearchDate = this.getUrlKey("qsearchDate", window.location.href);
var qsearchEndDate = this.getUrlKey("qsearchEndDate", window.location.href); var qsearchEndDate = this.getUrlKey("qsearchEndDate", window.location.href);
...@@ -1515,6 +1533,12 @@ export default { ...@@ -1515,6 +1533,12 @@ export default {
this.qMsg.EndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD") this.qMsg.EndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
} }
if(areaId) {
this.qMsg.CityCode = areaId;
}
}
console.log(newVal.query.CheckInDate,'-------')
if ((qsearchKey || qsearchDate || qsearchEndDate) && this.ShowType != 2) { if ((qsearchKey || qsearchDate || qsearchEndDate) && this.ShowType != 2) {
this.goSearchHandler(); this.goSearchHandler();
} }
......
This diff is collapsed.
This diff is collapsed.
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