Commit 182c25d6 authored by youjie's avatar youjie

酒店

parent 4aad1a62
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
searchCity, searchCity,
CheckDate CheckDate
}, },
props:['isMap','msg'], props:['isMap','msg','daysObj'],
data() { data() {
return { return {
city: "成都", city: "成都",
...@@ -350,11 +350,12 @@ ...@@ -350,11 +350,12 @@
this.parameters = { this.parameters = {
...val ...val
} }
console.log(val,'----val')
if(val.QOrderBy){ if(val.QOrderBy){
let list = this.options1.filter(x=>{ let list = this.options1.filter(x=>{
return x.value==val.QOrderBy return x.value==val.QOrderBy
}) })
this.optionsTitle[0] = list[0].label if(list&&list.length>0) this.optionsTitle[0] = list[0].label
} }
if(val.CityName_CN){ if(val.CityName_CN){
this.optionsTitle[1] = val.CityName_CN this.optionsTitle[1] = val.CityName_CN
...@@ -373,6 +374,15 @@ ...@@ -373,6 +374,15 @@
} }
}, },
deep: true, deep: true,
},
daysObj: {
handler (val, oldval) {
this.startDay = val.startDay;
this.endDay = val.endDay;
this.day = val.day;
this.dayObj = val
},
deep: true,
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -382,35 +392,35 @@ ...@@ -382,35 +392,35 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "酒店", title: "酒店",
}); });
if(!this.day){ // if(!this.day){
let d1 = new Date(); // let d1 = new Date();
let d = new Date(); // let d = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1)); // let d2 = new Date(d.setDate(d.getDate() + 1));
let startWeek = "周" + "日一二三四五六".charAt(new Date().getDay()); // let startWeek = "周" + "日一二三四五六".charAt(new Date().getDay());
let endWeek = "周" + "日一二三四五六".charAt(new Date().getDay() + 1); // let endWeek = "周" + "日一二三四五六".charAt(new Date().getDay() + 1);
let month1 = d1.getMonth() + 1; // let month1 = d1.getMonth() + 1;
let day1 = d1.getDate(); // let day1 = d1.getDate();
let Month1 = month1>9?month1:'0'+month1; // let Month1 = month1>9?month1:'0'+month1;
let Day1 = day1>9?day1:'0'+day1; // let Day1 = day1>9?day1:'0'+day1;
let month2 = d2.getMonth() + 1; // let month2 = d2.getMonth() + 1;
let day2 = d2.getDate(); // let day2 = d2.getDate();
let Month2 = month2>9?month2:'0'+month2; // let Month2 = month2>9?month2:'0'+month2;
let Day2 = day2>9?day2:'0'+day2; // let Day2 = day2>9?day2:'0'+day2;
var obj = { // var obj = {
start: `${d1.getFullYear()}-${Month1}-${Day1}`, // start: `${d1.getFullYear()}-${Month1}-${Day1}`,
end: `${d2.getFullYear()}-${Month2}-${Day2}`, // end: `${d2.getFullYear()}-${Month2}-${Day2}`,
startDay: `${Month1}-${Day1}`, // startDay: `${Month1}-${Day1}`,
endDay: `${Month2}-${Day2}`, // endDay: `${Month2}-${Day2}`,
day: 1, // day: 1,
startWeek: startWeek, // startWeek: startWeek,
endWeek: endWeek, // endWeek: endWeek,
}; // };
this.startDay = obj.startDay; // this.startDay = obj.startDay;
this.endDay = obj.endDay; // this.endDay = obj.endDay;
this.day = obj.day; // this.day = obj.day;
this.dayObj = obj // this.dayObj = obj
} // }
this.getCity() this.getCity()
this.getSearchCondition() this.getSearchCondition()
// this.getLocation() // this.getLocation()
...@@ -700,7 +710,7 @@ ...@@ -700,7 +710,7 @@
goMapHotel(){ goMapHotel(){
this.closeDropdown() this.closeDropdown()
uni.navigateTo({ uni.navigateTo({
url: `/pages/hotel/mapList?msg=${encodeURIComponent(JSON.stringify(this.parameters))}?dayObj=${JSON.stringify(this.dayObj)}` url: `/pages/hotel/mapList?msg=${encodeURIComponent(JSON.stringify(this.parameters))}&dayObj=${encodeURIComponent(JSON.stringify(this.dayObj))}`
}); });
} }
}, },
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<hotelHeaders :title="pageTitle"></hotelHeaders> <hotelHeaders :title="pageTitle"></hotelHeaders>
<hotelSearch <hotelSearch
:msg="searchObj" :msg="searchObj"
:daysObj="dayObj"
:isMap="1" :isMap="1"
@change="change" @change="change"
@getItem="getItem"></hotelSearch> @getItem="getItem"></hotelSearch>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<hotelHeaders :title="pageTitle"></hotelHeaders> <hotelHeaders :title="pageTitle"></hotelHeaders>
<hotelSearch <hotelSearch
:msg="searchObj" :msg="searchObj"
:daysObj="dayObj"
@change="change" @change="change"
@getItem="getItem"></hotelSearch> @getItem="getItem"></hotelSearch>
</view> </view>
...@@ -163,15 +164,14 @@ ...@@ -163,15 +164,14 @@
this.searchObj.Name = options.Name; this.searchObj.Name = options.Name;
} }
if (options && options.msg) { if (options && options.msg) {
this.searchObj = { this.searchObj = JSON.parse(decodeURIComponent(options.msg))
...this.searchObj,
...JSON.parse(decodeURIComponent(options.msg))
};
console.log(JSON.parse(decodeURIComponent(options.msg)),'--------')
this.pageTitle = this.searchObj.CityName this.pageTitle = this.searchObj.CityName
} }
console.log(options,'----111111111111')
if(options && options.dayObj){ if(options && options.dayObj){
this.dayObj = JSON.parse(options.dayObj) this.dayObj = JSON.parse(decodeURIComponent(options.dayObj))
this.searchObj.QStartDate = this.dayObj.start;
this.searchObj.QEndDate = this.dayObj.end;
this.startDay = this.dayObj.startDay; this.startDay = this.dayObj.startDay;
this.endDay = this.dayObj.endDay; this.endDay = this.dayObj.endDay;
this.day = this.dayObj.day; this.day = this.dayObj.day;
...@@ -181,41 +181,41 @@ ...@@ -181,41 +181,41 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "酒店", title: "酒店",
}); });
let d1 = new Date(); // let d1 = new Date();
let d = new Date(); // let d = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1)); // let d2 = new Date(d.setDate(d.getDate() + 1));
let startWeek = "周" + "日一二三四五六".charAt(new Date().getDay()); // let startWeek = "周" + "日一二三四五六".charAt(new Date().getDay());
let endWeek = "周" + "日一二三四五六".charAt(new Date().getDay() + 1); // let endWeek = "周" + "日一二三四五六".charAt(new Date().getDay() + 1);
let month1 = d1.getMonth() + 1; // let month1 = d1.getMonth() + 1;
let day1 = d1.getDate(); // let day1 = d1.getDate();
let Month1 = month1>9?month1:'0'+month1; // let Month1 = month1>9?month1:'0'+month1;
let Day1 = day1>9?day1:'0'+day1; // let Day1 = day1>9?day1:'0'+day1;
let month2 = d2.getMonth() + 1; // let month2 = d2.getMonth() + 1;
let day2 = d2.getDate(); // let day2 = d2.getDate();
let Month2 = month2>9?month2:'0'+month2; // let Month2 = month2>9?month2:'0'+month2;
let Day2 = day2>9?day2:'0'+day2; // let Day2 = day2>9?day2:'0'+day2;
var obj = { // var obj = {
start: `${d1.getFullYear()}-${Month1}-${Day1}`, // start: `${d1.getFullYear()}-${Month1}-${Day1}`,
end: `${d2.getFullYear()}-${Month2}-${Day2}`, // end: `${d2.getFullYear()}-${Month2}-${Day2}`,
startDay: `${Month1}-${Day1}`, // startDay: `${Month1}-${Day1}`,
endDay: `${Month2}-${Day2}`, // endDay: `${Month2}-${Day2}`,
day: 1, // day: 1,
startWeek: startWeek, // startWeek: startWeek,
endWeek: endWeek, // endWeek: endWeek,
startTime: `${d1.getFullYear()}-${Month1}-${Day1}`, // startTime: `${d1.getFullYear()}-${Month1}-${Day1}`,
endTime: `${d1.getFullYear()}-${Month2}-${Day2}` // endTime: `${d1.getFullYear()}-${Month2}-${Day2}`
}; // };
this.dayObj = obj; // this.dayObj = obj;
uni.setStorage({ // uni.setStorage({
key: "Time", // key: "Time",
data: JSON.stringify(obj), // data: JSON.stringify(obj),
}); // });
this.searchObj.QStartDate = obj.start; // this.searchObj.QStartDate = obj.start;
this.searchObj.QEndDate = obj.end; // this.searchObj.QEndDate = obj.end;
this.startDay = obj.startDay; // this.startDay = obj.startDay;
this.endDay = obj.endDay; // this.endDay = obj.endDay;
this.day = obj.day; // this.day = obj.day;
}, },
methods: { methods: {
getItem(parameters,obj) { getItem(parameters,obj) {
......
...@@ -358,7 +358,7 @@ ...@@ -358,7 +358,7 @@
this.init(); this.init();
setTimeout(() => { setTimeout(() => {
uni.removeStorageSync("LoginState") uni.removeStorageSync("LoginState")
}, 10000); }, 1000);
}, },
gbAuth() { gbAuth() {
this.showAuth = false; this.showAuth = false;
......
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