|
|
@@ -2,7 +2,7 @@
|
|
|
<view class="container" :style="'overflow:' + (showPage ? 'hidden' : 'visible')">
|
|
|
<!-- 顶部民宿图片区域 -->
|
|
|
<view class="banner">
|
|
|
- <img class="img" :src="info.imgUrl || '../../static/index/banner.png'" />
|
|
|
+ <img class="img" :src="info.coverImg || '../../static/index/banner.png'" />
|
|
|
|
|
|
<view class="slogan">
|
|
|
<img src="../../static/index/slogan.png" />
|
|
|
@@ -11,10 +11,10 @@
|
|
|
|
|
|
<!-- 民宿详细信息区域 -->
|
|
|
<view class="detail">
|
|
|
- <view class="detail_name">{{ info.hotelName || '默认名字' }}</view>
|
|
|
+ <view class="detail_name">{{ info.hname || '默认名字' }}</view>
|
|
|
|
|
|
<view class="detail_info">
|
|
|
- <view class="info_left">2021年装修|2023年开业</view>
|
|
|
+ <view class="info_left">{{ info.fitupTime }}装修|{{ info.openTime }}开业</view>
|
|
|
<view class="info_right" @click="goPageDetailInfo">
|
|
|
设施/详情
|
|
|
<img src="../../static/index/right.png" />
|
|
|
@@ -22,33 +22,25 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="detail_group">
|
|
|
- <view class="group_item">
|
|
|
- <img src="../../static/index/meeting.png" />
|
|
|
- 会议室
|
|
|
- </view>
|
|
|
- <view class="group_item">
|
|
|
- <img src="../../static/index/brekker.png" />
|
|
|
- 含早
|
|
|
- </view>
|
|
|
- <view class="group_item">
|
|
|
- <img src="../../static/index/parking.png" />
|
|
|
- 免费停车场
|
|
|
+ <view class="group_item" v-for="item in info.hconfigList" :key="item.id">
|
|
|
+ <img :src="item.fileUrl || '../../static/index/meeting.png'" />
|
|
|
+ {{ item.name }}
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="address">
|
|
|
- <view class="address_left">宜春市靖安县北高速路口什么路899号</view>
|
|
|
+ <view class="address_left">{{ info.hposition }}</view>
|
|
|
<view class="address_right">
|
|
|
<view class="right_box" @click="handleMap(info)">
|
|
|
<img src="../../static/index/map.png" />
|
|
|
</view>
|
|
|
- <view class="right_box" @click="handlePhone(info.phone)">
|
|
|
+ <view class="right_box" @click="handlePhone(info.managerPhone)">
|
|
|
<img src="../../static/index/phone.png" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="distance">距离我{{ info.distance }}km</view>
|
|
|
+ <view class="distance" v-if="distance">距离我{{ distance }}km</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 房型信息区域 -->
|
|
|
@@ -84,24 +76,22 @@
|
|
|
></uv-calendar>
|
|
|
|
|
|
<!-- 房型列表区域 -->
|
|
|
- <view class="body_content">
|
|
|
+ <view class="body_content" v-if="list.length">
|
|
|
<!-- 每一个房型盒子区域 -->
|
|
|
<view class="body_box" v-for="item in list" :key="item.id" @click="handleLookDetail(item)">
|
|
|
<view class="box_left">
|
|
|
- <img :src="item.imgUrl" />
|
|
|
+ <img :src="item.fileInfoList[0].url || '../../static/index/banner.png'" />
|
|
|
</view>
|
|
|
|
|
|
<view class="box_center">
|
|
|
- <view class="center_top">{{ item.name }}</view>
|
|
|
+ <view class="center_top">{{ item.hName }}</view>
|
|
|
<view class="center_center">
|
|
|
+ <view class="center_item">{{ item.hAreas }}㎡</view>
|
|
|
<view class="center_item">大床</view>
|
|
|
<view class="center_item">无早</view>
|
|
|
</view>
|
|
|
<view class="center_bottom">
|
|
|
- <img class="img" src="../../static/index/wifi.png" />
|
|
|
- <img class="img" src="../../static/index/air.png" />
|
|
|
- <img class="img" src="../../static/index/smoke.png" />
|
|
|
- <img class="img" src="../../static/index/lock.png" />
|
|
|
+ <img v-for="item2 in item.hConfigList" :key="item2.id" class="img" :src="item2.fileUrl || '../../static/index/wifi.png'" />
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -110,7 +100,7 @@
|
|
|
<text>¥</text>
|
|
|
{{ item.price }}
|
|
|
</view>
|
|
|
- <view class="right_btn" :class="{ inactive: !item.active }" @click.stop="goPageAffOrder(item)">订</view>
|
|
|
+ <view class="right_btn" :class="{ inactive: !item.remainRooms }" @click.stop="goPageAffOrder(item)">订</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -119,18 +109,15 @@
|
|
|
<view class="body_pop">
|
|
|
<!-- 轮播图区域 -->
|
|
|
<swiper indicator-dots circular indicator-color="#FFFFFF" indicator-active-color="#096562" class="pop_swiper">
|
|
|
- <swiper-item class="pop_swiper_item">
|
|
|
- <img class="img" src="../../static/index/banner.png" />
|
|
|
- </swiper-item>
|
|
|
- <swiper-item class="pop_swiper_item">
|
|
|
- <img class="img" src="../../static/index/banner.png" />
|
|
|
+ <swiper-item class="pop_swiper_item" v-for="item in roomInfo.fileInfoList" :key="item.id">
|
|
|
+ <img class="img" :src="item.url || '../../static/index/banner.png'" />
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
<!-- 轮播图关闭图标区域 -->
|
|
|
<img class="pop_icon" src="../../static/index/close.png" @click="handleClosePop" />
|
|
|
|
|
|
<view class="pop_body">
|
|
|
- <view class="body_title">{{ roomInfo.name }}</view>
|
|
|
+ <view class="body_title">{{ roomInfo.hName }}</view>
|
|
|
<view class="body_tags">
|
|
|
<view class="tags_item">
|
|
|
<img class="img" src="../../static/index/bed.png" />
|
|
|
@@ -142,7 +129,7 @@
|
|
|
</view>
|
|
|
<view class="tags_item">
|
|
|
<img class="img" src="../../static/index/place.png" />
|
|
|
- 15-20㎡
|
|
|
+ {{ roomInfo.hAreas }}㎡
|
|
|
</view>
|
|
|
<view class="tags_item">
|
|
|
<img class="img" src="../../static/index/window.png" />
|
|
|
@@ -151,15 +138,15 @@
|
|
|
</view>
|
|
|
<view class="body_title2">费用明细</view>
|
|
|
<view class="body_detail">
|
|
|
- <view class="detail_old">¥{{ roomInfo.price }}</view>
|
|
|
- <view class="detail_box">
|
|
|
+ <!-- <view class="detail_old">¥{{ roomInfo.price }}</view> -->
|
|
|
+ <!-- <view class="detail_box">
|
|
|
黄金会员9折
|
|
|
<text>-¥25</text>
|
|
|
</view>
|
|
|
<view class="detail_box">
|
|
|
活动
|
|
|
<text>-¥2.5</text>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
|
|
|
<view class="detail_new">
|
|
|
每间每晚
|
|
|
@@ -168,20 +155,25 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="body_bottom">
|
|
|
- <view class="bottom_left" @click="handlePhone('18320846714')">
|
|
|
+ <view class="bottom_left" @click="handlePhone(info.managerPhone)">
|
|
|
<img class="img" src="../../static/index/phone2.png" />
|
|
|
联系商家
|
|
|
</view>
|
|
|
<view class="bottom_right">
|
|
|
<text>¥</text>
|
|
|
{{ roomInfo.price }}
|
|
|
- <view class="btn" @click="goPageAffOrder(roomInfo)">预定</view>
|
|
|
+ <view class="btn" :class="{ inactive: !roomInfo.remainRooms }" @click="goPageAffOrder(roomInfo)">预定</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</uv-popup>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="noData" v-else>
|
|
|
+ <img src="../../static/images/noData.png" />
|
|
|
+ 暂无数据
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -193,29 +185,7 @@ export default {
|
|
|
// 滚动穿透控制
|
|
|
showPage: false,
|
|
|
// 房型数据数组
|
|
|
- list: [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- imgUrl: '../../static/index/banner.png',
|
|
|
- name: '01户型',
|
|
|
- price: '323.00',
|
|
|
- active: true
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- imgUrl: '../../static/index/banner.png',
|
|
|
- name: '02户型',
|
|
|
- price: '283.00',
|
|
|
- active: false
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- imgUrl: '../../static/index/banner.png',
|
|
|
- name: '03户型',
|
|
|
- price: '223.00',
|
|
|
- active: true
|
|
|
- }
|
|
|
- ],
|
|
|
+ list: [],
|
|
|
// 住几晚
|
|
|
nightNum: 1,
|
|
|
// 入住时间-月
|
|
|
@@ -235,26 +205,79 @@ export default {
|
|
|
// 酒店信息
|
|
|
info: {},
|
|
|
// 房间信息
|
|
|
- roomInfo: {}
|
|
|
+ roomInfo: {},
|
|
|
+ // 民宿Id
|
|
|
+ hotelId: '',
|
|
|
+ // 是否有定位权限
|
|
|
+ showLocation: false,
|
|
|
+ distance: '',
|
|
|
+ queryStartTime: '',
|
|
|
+ queryEndTime: ''
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- // console.log(JSON.parse(options.info))
|
|
|
- if (options.info) {
|
|
|
- this.info = JSON.parse(options.info)
|
|
|
- }
|
|
|
this.getTimes()
|
|
|
+ this.hotelId = options.id
|
|
|
+ this.distance = options.distance === 'undefined' ? false : options.distance
|
|
|
+ uni.getSetting({
|
|
|
+ success: (res) => {
|
|
|
+ this.showLocation = res.authSetting['scope.userLocation']
|
|
|
+ this.getHotelInfo()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getHotelInfo() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/mhotel/ahpgetHouseByHotelId.action',
|
|
|
+ data: {
|
|
|
+ // hotelId: this.hotelId,
|
|
|
+ hotelId: 2,
|
|
|
+ queryStartTime: this.queryStartTime,
|
|
|
+ queryEndTime: this.queryEndTime
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.info = res.data.data
|
|
|
+ this.list = res.data.data.houseList
|
|
|
+ }
|
|
|
+ },
|
|
|
// 点击地图图标回调
|
|
|
handleMap(item) {
|
|
|
- uni.openLocation({
|
|
|
- latitude: 28.86054,
|
|
|
- longitude: 115.361744,
|
|
|
- name: item.hotelName,
|
|
|
- address: '靖安县---详细地址',
|
|
|
- success: () => {}
|
|
|
- })
|
|
|
+ if (this.showLocation) {
|
|
|
+ let lat = item.hpositionWens.split(',')[0] * 1
|
|
|
+ let lng = item.hpositionWens.split(',')[1] * 1
|
|
|
+ uni.openLocation({
|
|
|
+ latitude: lat,
|
|
|
+ longitude: lng,
|
|
|
+ name: item.hname,
|
|
|
+ address: item.hposition,
|
|
|
+ success: () => {}
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ content: '当前没有定位权限,是否去设置打开?',
|
|
|
+ confirmText: '确认',
|
|
|
+ cancelText: '取消',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.openSetting({
|
|
|
+ success: (res) => {
|
|
|
+ this.showLocation = true
|
|
|
+ this.handleMap(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '获取定位权限失败,无法使用地图功能',
|
|
|
+ icon: 'none',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// 点击电话图标回调
|
|
|
handlePhone(phone) {
|
|
|
@@ -269,7 +292,7 @@ export default {
|
|
|
},
|
|
|
// 点击每一个户型回调
|
|
|
handleLookDetail(item) {
|
|
|
- // console.log(item)
|
|
|
+ console.log(item)
|
|
|
this.roomInfo = item
|
|
|
this.showPage = true
|
|
|
this.$refs.popup.open('bottom')
|
|
|
@@ -277,16 +300,18 @@ export default {
|
|
|
// 点击设施详情回调
|
|
|
goPageDetailInfo() {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/detailInfo/detailInfo'
|
|
|
+ url: `/pages/detailInfo/detailInfo?hotelId=${this.hotelId}`
|
|
|
})
|
|
|
},
|
|
|
// 点击 订 预定 按钮回调
|
|
|
goPageAffOrder(item) {
|
|
|
- let flag = uni.getStorageSync('login')
|
|
|
+ console.log(this.defaultDateMultiple)
|
|
|
+ let flag = uni.getStorageSync('openid')
|
|
|
if (flag) {
|
|
|
- if (item.active) {
|
|
|
+ if (item.remainRooms) {
|
|
|
this.$refs.popup.close()
|
|
|
this.showPage = false
|
|
|
+
|
|
|
let info = JSON.stringify({
|
|
|
nightNum: this.nightNum,
|
|
|
startTimeDay: this.startTimeDay,
|
|
|
@@ -295,7 +320,10 @@ export default {
|
|
|
endTimeDay: this.endTimeDay,
|
|
|
endTimeMonth: this.endTimeMonth,
|
|
|
endTimeWeek: this.endTimeWeek,
|
|
|
- price: item.price
|
|
|
+ item: item,
|
|
|
+ queryStartTime: this.queryStartTime,
|
|
|
+ queryEndTime: this.queryEndTime,
|
|
|
+ dayList: this.defaultDateMultiple
|
|
|
})
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/affirmOrder/affirmOrder?info=${info}`
|
|
|
@@ -303,7 +331,8 @@ export default {
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: '该房间已售罄',
|
|
|
- icon: 'none'
|
|
|
+ icon: 'none',
|
|
|
+ mask: true
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
@@ -325,7 +354,10 @@ export default {
|
|
|
},
|
|
|
// 选择日历确定按钮回调
|
|
|
handleConfirm(e) {
|
|
|
- // console.log(e)
|
|
|
+ this.defaultDateMultiple = e
|
|
|
+ this.queryStartTime = e[0]
|
|
|
+ this.queryEndTime = e[e.length - 1]
|
|
|
+ this.getHotelInfo()
|
|
|
this.startTimeWeek = this.getWeek(e[0])
|
|
|
this.endTimeWeek = this.getWeek(e[e.length - 1])
|
|
|
let temStart = e[0].split('-')
|
|
|
@@ -355,6 +387,8 @@ export default {
|
|
|
this.endTimeDay = tomorrow.getDate().toString().padStart(2, 0)
|
|
|
// 日历默认选择的日期
|
|
|
this.defaultDateMultiple = [`${today.getFullYear()}-${this.startTimeMonth}-${this.startTimeDay}`, `${tomorrow.getFullYear()}-${this.endTimeMonth}-${this.endTimeDay}`]
|
|
|
+ this.queryStartTime = this.defaultDateMultiple[0]
|
|
|
+ this.queryEndTime = this.defaultDateMultiple[1]
|
|
|
},
|
|
|
|
|
|
// 传入参数获取当前是星期几
|
|
|
@@ -827,11 +861,29 @@ export default {
|
|
|
border-radius: 64rpx;
|
|
|
background-color: #096562;
|
|
|
}
|
|
|
+
|
|
|
+ .inactive {
|
|
|
+ background-color: #cccccc;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .noData {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ padding-bottom: 20rpx;
|
|
|
+
|
|
|
+ img {
|
|
|
+ margin-top: 60rpx;
|
|
|
+ width: 600rpx;
|
|
|
+ height: 600rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|