Commit 64127f95 authored by youjie's avatar youjie

no message

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