Commit 57d3b819 authored by zhengke's avatar zhengke

修改

parent b63ed354
......@@ -57,8 +57,9 @@
}
},
mounted(){
console.log(this.dayObj,'dayObj');
console.log(this.searchObj,'searchObj');
},
created(){
},
methods:{
goHotelDetail(id){
......
......@@ -10,7 +10,6 @@
<template v-else>
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/default_room.jpg" mode="aspectFill">
</image>
<view class="mark"></view>
</template>
</view>
<view class="rm-right">
......@@ -64,7 +63,6 @@
},
methods: {
previewOrder(item) {
console.log(item,'数据');
uni.navigateTo({
url: "/pages/hotel/order?RoomInfo="+ JSON.stringify(item) + '&dayObj=' + JSON.stringify(this.dayObj) + '&HotelInfo=' + JSON.stringify(this.hotelData)
})
......@@ -87,6 +85,7 @@
.room-good .f11 {
font-size: 22rpx;
font-weight: 500;
margin-top:10rpx;
}
.room-good .rm-right {
......
......@@ -97,13 +97,13 @@
</view>
<view class="date-box flex" @click="showTimePopup=true">
<view class="date">
<text>{{roomMsg.StartDate}}</text>
<text class="date-week">{{startWeek}}</text>
<text>{{startDay}}</text>
<text class="date-week">{{getWeek(roomMsg.StartDate)}}</text>
</view>
<view class="hr-line"></view>
<view class="date">
<text>{{roomMsg.EndDate}}</text>
<text class="date-week">{{endWeek}}</text>
<text>{{endDay}}</text>
<text class="date-week">{{getWeek(roomMsg.EndDate)}}</text>
</view>
<view class="ver-line"></view>
<view class="date">
......@@ -234,8 +234,6 @@
StartDate: '',
EndDate: ''
},
startWeek: '',
endWeek: '',
day: 0,
threeLevelList: [{
name: "单人床",
......@@ -269,7 +267,9 @@
HotelArr:[] ,//推荐酒店
searchObj:{},
dayObj:{},
hotelData:{} //传递到房间预订组件
hotelData:{} ,//传递到房间预订组件
startDay:'',
endDay:''
}
},
components: {
......@@ -301,11 +301,12 @@
if (options.dayObj) {
console.log(options.dayObj,'options.dayObj');
var tempDay = JSON.parse(options.dayObj);
this.roomMsg.StartDate = tempDay.StartDate;
this.roomMsg.EndDate = tempDay.EndDate;
this.roomMsg.StartDate = tempDay.start;
this.roomMsg.EndDate = tempDay.end;
this.startDay = tempDay.startDay;
this.endDay = tempDay.endDay;
this.day = tempDay.day;
this.startWeek = tempDay.startWeek;
this.endWeek = tempDay.endWeek;
this.dayObj = tempDay;
}
if(options.searchObj){
this.searchObj = JSON.parse(options.searchObj);
......@@ -364,13 +365,11 @@
chosenDateResult(obj) {
this.roomMsg.StartDate = obj.start;
this.roomMsg.EndDate = obj.end;
this.startWeek = obj.startWeek;
this.endWeek = obj.endWeek;
this.startDay = obj.startDay;
this.endDay = obj.endDay;
this.day = obj.day;
this.getRoomType();
this.dayObj.StartDate = obj.start;
this.dayObj.EndDate = obj.end;
this.dayObj.day = obj.day;
this.dayObj = obj;
this.showTimePopup = false
},
//切换日期获取房型
......@@ -402,24 +401,9 @@
return d > 9 ? d : "0" + d
},
getWeek(date) {
console.log(date, 'date');
let day = date.getDay();
if (day === 1) {
var week = "一";
} else if (day === 2) {
week = "二";
} else if (day === 3) {
week = "三";
} else if (day === 4) {
week = "四";
} else if (day === 5) {
week = "五";
} else if (day === 6) {
week = "六";
} else if (day === 7) {
week = "日";
}
return "周" + week
var weekArray = new Array("日", "一", "二", "三", "四", "五", "六");
var week = weekArray[new Date(date).getDay()];//注意此处必须是先new一个Date
return '周'+week;
},
changeNearbyType(t) {
this.nearbyType = t
......
......@@ -185,6 +185,7 @@
endDay: `${d2.getMonth()+1}-${d2.getDate()}`,
day: 1
}
this.dayObj = obj;
uni.setStorage({
key: 'Time',
data: JSON.stringify(obj)
......@@ -232,8 +233,7 @@
this.startDay = obj.startDay;
this.endDay = obj.endDay;
this.day = obj.day;
this.dayObj.startWeek = obj.startWeek;
this.dayObj.endWeek = obj.endWeek;
this.dayObj = obj;
this.getList(1);
this.showTimePopup = false
},
......@@ -378,9 +378,6 @@
//获取列表数据
getList(type) {
this.searchObj.QStars = this.tempRateAndPrice.rate.toString();
this.dayObj.StartDate = this.searchObj.QStartDate;
this.dayObj.EndDate = this.searchObj.QEndDate;
this.dayObj.day = this.day;
if(type==1){
this.HotelList=[];
......
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