|
@@ -75,7 +75,6 @@
|
|
|
<!-- 房型列表 -->
|
|
<!-- 房型列表 -->
|
|
|
<view class="room-kuang">
|
|
<view class="room-kuang">
|
|
|
<view class="room-xinxi" v-for="(item, index) in roomType" :key="index">
|
|
<view class="room-xinxi" v-for="(item, index) in roomType" :key="index">
|
|
|
- <!-- <image v-if="item.h_type.indexOf('标准') !== -1" class="room-image" src="../../static/index/std.jpg" @click="inputDialogToggle(item.id)"></image> -->
|
|
|
|
|
<image v-if="item.h_type.indexOf('标准') !== -1" class="room-image" src="../../static/index/std.jpg" @click="inputDialogToggle(item.h_type)">
|
|
<image v-if="item.h_type.indexOf('标准') !== -1" class="room-image" src="../../static/index/std.jpg" @click="inputDialogToggle(item.h_type)">
|
|
|
</image>
|
|
</image>
|
|
|
<image v-else-if="item.h_type.indexOf('高级') !== -1" class="room-image" src="../../static/index/adv1.jpg"
|
|
<image v-else-if="item.h_type.indexOf('高级') !== -1" class="room-image" src="../../static/index/adv1.jpg"
|
|
@@ -92,8 +91,8 @@
|
|
|
<image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
<image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
|
<image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
<image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- <view class="before-price"><strike>¥{{item.price}}</strike></view> -->
|
|
|
|
|
<view class="room-price">¥{{ item.price }}</view>
|
|
<view class="room-price">¥{{ item.price }}</view>
|
|
|
|
|
+ <view class="room-num">今剩{{ item.s_yum }}间</view>
|
|
|
<view class="room-button" :class="{'room-button2': item.s_yum == 0}">
|
|
<view class="room-button" :class="{'room-button2': item.s_yum == 0}">
|
|
|
<text v-if="item.s_yum == 0">已满</text>
|
|
<text v-if="item.s_yum == 0">已满</text>
|
|
|
<text v-else @click="navigateToOrderRoom(item.s_yum, item.id, item.h_type, item.price)">订</text>
|
|
<text v-else @click="navigateToOrderRoom(item.s_yum, item.id, item.h_type, item.price)">订</text>
|
|
@@ -229,7 +228,11 @@
|
|
|
dai_type: [], // 办理入住判断条件
|
|
dai_type: [], // 办理入住判断条件
|
|
|
dai_panduan: [], // 办理入住判断条件赋值
|
|
dai_panduan: [], // 办理入住判断条件赋值
|
|
|
order_txt: '', //订房事故时信息
|
|
order_txt: '', //订房事故时信息
|
|
|
- cardNumber: ''
|
|
|
|
|
|
|
+ cardNumber: '',
|
|
|
|
|
+ dates: [],
|
|
|
|
|
+ biaozhun_min: 1000,
|
|
|
|
|
+ gaoji_min: 1000,
|
|
|
|
|
+ haohua_min: 1000
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
@@ -358,23 +361,45 @@
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
// 获取房型
|
|
// 获取房型
|
|
|
- this.getRoomType()
|
|
|
|
|
|
|
+ this.getRoomType('')
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 房型接口
|
|
// 房型接口
|
|
|
- getRoomType() {
|
|
|
|
|
|
|
+ getRoomType(param) {
|
|
|
let that = this
|
|
let that = this
|
|
|
|
|
+ let d = ''
|
|
|
that.roomType = []
|
|
that.roomType = []
|
|
|
- // ?startDate=" + that.startDate.substring(0, 10) + "&endDate=" + that.endDate.substring(0, 10)
|
|
|
|
|
- var arrDate = this.$utils.getDateComponents(new Date(), 'date');
|
|
|
|
|
|
|
+ if (param == '') {
|
|
|
|
|
+ var arrDate = this.$utils.getDateComponents(new Date(), 'date');
|
|
|
|
|
+ d = arrDate.date
|
|
|
|
|
+ } else
|
|
|
|
|
+ d = param
|
|
|
that.$myRequest({
|
|
that.$myRequest({
|
|
|
- url: '/hotelReservation/zhotel/appday_list.action?date=' + arrDate.date,
|
|
|
|
|
|
|
+ url: '/hotelReservation/zhotel/appday_list.action?date=' + d,
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
// console.log(res.data);
|
|
// console.log(res.data);
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
let data = res.data.data;
|
|
let data = res.data.data;
|
|
|
data.forEach(item => {
|
|
data.forEach(item => {
|
|
|
- that.roomType.push(item)
|
|
|
|
|
|
|
+ let it = {
|
|
|
|
|
+ date: item.date,
|
|
|
|
|
+ h_type: item.h_type,
|
|
|
|
|
+ id: item.id,
|
|
|
|
|
+ price: item.price,
|
|
|
|
|
+ y_num: item.y_num,
|
|
|
|
|
+ z_num: item.z_num,
|
|
|
|
|
+ s_yum: item.s_yum
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.h_type.indexOf('标准') !== -1 && item.s_yum < that.biaozhun_min) {
|
|
|
|
|
+ that.biaozhun_min = item.s_yum
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.h_type.indexOf('高级') !== -1 && item.s_yum < that.gaoji_min) {
|
|
|
|
|
+ that.gaoji_min = item.s_yum
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.h_type.indexOf('豪华') !== -1 && item.s_yum < that.haohua_min) {
|
|
|
|
|
+ that.haohua_min = item.s_yum
|
|
|
|
|
+ }
|
|
|
|
|
+ that.roomType.push(it)
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -562,7 +587,7 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- console.log(this.xuzhu_panduan)
|
|
|
|
|
|
|
+ // console.log(this.xuzhu_panduan)
|
|
|
if (this.xuzhu_panduan.length > 1) {
|
|
if (this.xuzhu_panduan.length > 1) {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: "/pages/my_orderlist/my_orderlist?Inv=3"
|
|
url: "/pages/my_orderlist/my_orderlist?Inv=3"
|
|
@@ -586,17 +611,69 @@
|
|
|
this.$refs.popup_picker.open()
|
|
this.$refs.popup_picker.open()
|
|
|
},
|
|
},
|
|
|
change(e) {
|
|
change(e) {
|
|
|
|
|
+ var that = this;
|
|
|
var before = e.range.before;
|
|
var before = e.range.before;
|
|
|
var after = e.range.after;
|
|
var after = e.range.after;
|
|
|
- this.info.selected = [{
|
|
|
|
|
- date: before,
|
|
|
|
|
- info: '到店'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- date: after,
|
|
|
|
|
- info: '离店'
|
|
|
|
|
- }
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (before !== '' && after === '')
|
|
|
|
|
+ this.getRoomType(before);
|
|
|
|
|
+
|
|
|
|
|
+ this.dates = this.$utils.generateDates(before, after);
|
|
|
|
|
+ if (this.dates.length !== 0) {
|
|
|
|
|
+ let temp = this.roomType;
|
|
|
|
|
+ this.info.selected = []
|
|
|
|
|
+ this.dates.forEach((date) => {
|
|
|
|
|
+ that.$myRequest({
|
|
|
|
|
+ url: '/hotelReservation/zhotel/appday_list.action?date=' + date,
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ // console.log(res.data);
|
|
|
|
|
+ if (res.data.code === 200) {
|
|
|
|
|
+ var min = 1000;
|
|
|
|
|
+ let data = res.data.data;
|
|
|
|
|
+ data.forEach(item => {
|
|
|
|
|
+ if (item.h_type.indexOf('标准') !== -1 && item.s_yum < that.biaozhun_min) {
|
|
|
|
|
+ temp.forEach((it) => {
|
|
|
|
|
+ if (it.h_type.indexOf('标准') !== -1)
|
|
|
|
|
+ it.s_yum = item.s_yum
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.h_type.indexOf('高级') !== -1 && item.s_yum < that.gaoji_min) {
|
|
|
|
|
+ temp.forEach((it) => {
|
|
|
|
|
+ if (it.h_type.indexOf('高级') !== -1)
|
|
|
|
|
+ it.s_yum = item.s_yum
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.h_type.indexOf('豪华') !== -1 && item.s_yum < that.haohua_min) {
|
|
|
|
|
+ temp.forEach((it) => {
|
|
|
|
|
+ if (it.h_type.indexOf('豪华') !== -1)
|
|
|
|
|
+ it.s_yum = item.s_yum
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if (min > item.s_yum)
|
|
|
|
|
+ min = item.s_yum
|
|
|
|
|
+ });
|
|
|
|
|
+ this.info.selected.push({
|
|
|
|
|
+ date: date,
|
|
|
|
|
+ info: min.toString()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.roomType = []
|
|
|
|
|
+ this.roomType = temp;
|
|
|
|
|
+ }, 2000)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.info.selected = [{
|
|
|
|
|
+ date: before,
|
|
|
|
|
+ info: '到店'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ date: after,
|
|
|
|
|
+ info: '离店'
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
if (before !== '' && after === '') {
|
|
if (before !== '' && after === '') {
|
|
|
this.startWeek = '周' + e.lunar.ncWeek.substring(2, 3)
|
|
this.startWeek = '周' + e.lunar.ncWeek.substring(2, 3)
|
|
|
} else if (before !== '' && after !== '') {
|
|
} else if (before !== '' && after !== '') {
|