Commit 182c25d6 authored by youjie's avatar youjie

酒店

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