Commit a689b0b1 authored by youjie's avatar youjie

优化

parent 02e79d83
......@@ -21,12 +21,13 @@
<destination class="q-pa-sm"
:msg="{
CityCode:msg.CityCode,
KeyWords2:msg.Name_CN,
KeyWords:msg.KeyWords,
KeyWords2:msg.CityName,
StartDate:msg.CheckInDate,
EndDate:msg.CheckOutDate,
searchroomGroup:msg.searchroomGroup}"
Type="1"
@change="changeMsg"
@change="clearQuery"
@changeCity="changCity"
@clear="clearQuery"></destination>
<div class="q-pt-sm cursor-pointer">
......@@ -206,12 +207,13 @@
<destination class="q-pa-sm"
:msg="{
CityCode:msg.CityCode,
KeyWords2:msg.Name_CN,
KeyWords:msg.KeyWords,
KeyWords2:msg.CityName,
StartDate:msg.CheckInDate,
EndDate:msg.CheckOutDate,
searchroomGroup:msg.searchroomGroup}"
Type="2"
@change="changeMsg"
@change="clearQuery"
@changeCity="changCity"
@clear="clearQuery"></destination>
......@@ -674,51 +676,10 @@ export default {
};
},
watch: {
// '$route':{
// handler(newVal, oldVal) {
// this.msg = JSON.parse(JSON.stringify(this.qMsg));
// this.msg.priceRange = {
// min: 1,
// max: 100000,
// };
// this.msg.StartPrice = 0;
// this.msg.EndPrice = 100000;
// this.dateRange = { from: this.msg.StartDate, to: this.msg.EndDate };
// if(newVal!=oldVal){
// this.resetQuery();
// }
// var qsearchKey = this.getUrlKey("qsearchKey", window.location.href);
// var qsearchDate = this.getUrlKey("qsearchDate", window.location.href);
// var qsearchEndDate = this.getUrlKey("qsearchEndDate", window.location.href);
// var areaId = this.getUrlKey("areaId", window.location.href);
// var areaName = this.getUrlKey("areaName", window.location.href);
// if (qsearchKey) {
// this.msg.KeyWords = qsearchKey;
// }else if (areaName) {
// this.msg.KeyWords = areaName;
// }else this.msg.KeyWords = ''
// if(this.msg.KeyWords) this.searchCity();
// if (qsearchDate) {
// this.msg.StartDate = qsearchDate;
// }else {
// this.msg.StartDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD")
// }
// if (qsearchEndDate) {
// this.msg.EndDate = qsearchEndDate;
// }else {
// this.msg.EndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
// }
// this.resetQuery();
// },
// deep: true,
// immediate: true,
// },
qMsg: {
handler(newVal, oldVal) {
this.msg = JSON.parse(JSON.stringify(this.qMsg));
console.log(newVal.KeyWords2,'----222')
this.msg.priceRange = {
min: 1,
max: 100000,
......@@ -737,6 +698,9 @@ export default {
this.CitiesTicked = []
this.regionTicked = []
}
if(this.msg.CityCode){
this.getRegion(this.msg.CityCode)
}
this.resetQuery();
},
deep: true,
......@@ -778,21 +742,13 @@ export default {
...this.msg,
...msg
}
setTimeout(() => {
this.resetQuery()
}, 200);
this.$emit('change', this.msg)
},
changCity(y){
this.msg.CityCode2 = y.CityCode
this.msg.CityCode = y.CityCode
this.resetQuery()
this.getRegion()
},
changeMsg(msg){
this.msg.KeyWords2 = msg.KeyWords2?msg.KeyWords2:''
this.msg.CityCode = msg.CityCode?msg.CityCode:''
this.msg.hotelId = msg.hotelId?msg.hotelId:''
this.resetQuery()
this.getRegion(this.msg.CityCode)
},
clickHandler(e) {
try {
......@@ -930,17 +886,16 @@ export default {
// 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()
}
},
);
},
// 区域
getRegion() {
getRegion(CityCode) {
//this.parameters.regionCode = ''
var regMsg = {
CityCode: this.msg.CityCode2,
Name: this.msg.CityName,
CityCode: CityCode,
Name: '',
};
this.apipost('dmc_post_GetDestinationByCityCode', regMsg,
(res) => {
......@@ -1020,7 +975,7 @@ export default {
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.CitiesTicked.length){
this.getRegion()
this.getRegion(this.msg.CityCode2)
}else this.regionList = []
this.resetQuery();
},
......
......@@ -698,11 +698,11 @@
<q-breadcrumbs-el :label="qMsg.KeyWords" />
</q-breadcrumbs>
</div>
<div class="text-h6 text-left" v-if="qMsg.KeyWords">
<!-- <div class="text-h6 text-left" v-if="qMsg.KeyWords">
搜尋結果 “
<span class="text-primary">{{ qMsg.KeyWords }}</span
>
</div>
</div> -->
<!-- 电脑端 -->
<div class="row SearchContent q-mt-md" v-if="!$q.screen.xs && 1 == 0">
<div class="search-filter-inner">
......@@ -1511,6 +1511,8 @@ export default {
}
if(newVal.query&&newVal.query.pageIndex){
this.qMsg = newVal.query
console.log(newVal.query.KeyWords2,'----')
// this.qMsg.KeyWords = newVal.query.KeyWords?newVal.query.KeyWords:newVal.query.KeyWords2?newVal.query.KeyWords2:''
}else{
var qsearchKey = this.getUrlKey("qsearchKey", window.location.href);
var qsearchDate = this.getUrlKey("qsearchDate", window.location.href);
......@@ -1538,7 +1540,6 @@ export default {
this.qMsg.CityCode = areaId;
}
}
console.log(newVal.query.CheckInDate,'-------')
if ((qsearchKey || qsearchDate || qsearchEndDate) && this.ShowType != 2) {
this.goSearchHandler();
......@@ -1574,7 +1575,7 @@ export default {
methods: {
handlerSearchChange(value) {
this.qMsg = value;
this.goSearchHandler();
if(this.ShowType != 2) this.goSearchHandler();
},
//清除所有条件
clearAll() {
......
......@@ -193,7 +193,7 @@
<!-- 目的地 -->
<destination class="q-ml-sm" :msg="{
CityCode:CityCode?CityCode:dataList.CityCode,
KeyWords2:dataList.Name_CN,
KeyWords:dataList.Name_CN,
StartDate:msg.CheckInDate,
EndDate:msg.CheckOutDate,
searchroomGroup:msg.searchroomGroup}"
......
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