Commit 57d3b819 authored by zhengke's avatar zhengke

修改

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