|
|
@@ -15,10 +15,15 @@
|
|
|
<view class="slogan">
|
|
|
<img src="../../static/index/slogan.png" />
|
|
|
</view>
|
|
|
+ <!-- 720°全景链接区域 -->
|
|
|
<view class="full" v-if="info.linkProUrl" @click="handleGoPull(info.linkProUrl)">
|
|
|
<img src="../../static/index/full.png" />
|
|
|
720°全景
|
|
|
</view>
|
|
|
+ <!-- 收藏按钮区域 -->
|
|
|
+ <view class="collect">
|
|
|
+ <uni-fav circle bgColorChecked="#096562" :checked="info.is_collect_hotel" @click="changeCollect(info.is_collect_hotel)" />
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 民宿详细信息区域 -->
|
|
|
@@ -58,7 +63,7 @@
|
|
|
<!-- 房型信息区域 -->
|
|
|
<view class="body">
|
|
|
<!-- 选择日期区域 -->
|
|
|
- <view class="body_header" @click="handleOpen">
|
|
|
+ <view class="body_header" @click="handleOpen()">
|
|
|
<view class="header_start">
|
|
|
<view class="header_top">{{ getWeek(startTime) }}入住</view>
|
|
|
<view class="header_bottom">{{ startTime.slice(5, 7) }}月{{ startTime.slice(8, 10) }}日</view>
|
|
|
@@ -86,6 +91,7 @@
|
|
|
:selected="selected"
|
|
|
:startDate="earlyTime"
|
|
|
:endDate="lateTime"
|
|
|
+ @monthSwitch="monthSwitch"
|
|
|
@confirm="handleConfirm"
|
|
|
/>
|
|
|
|
|
|
@@ -185,37 +191,37 @@
|
|
|
<view class="evaluate_title">评价</view>
|
|
|
<view class="evaluate_body">
|
|
|
<!-- 评分区域 -->
|
|
|
- <view class="header">
|
|
|
+ <view class="header" v-if="score">
|
|
|
<view class="header_box">
|
|
|
<!-- 总评分区域 -->
|
|
|
- <view class="box_left">4.6</view>
|
|
|
+ <view class="box_left">{{ score }}</view>
|
|
|
<view class="box_right">
|
|
|
<!-- 位置评分区域 -->
|
|
|
<view class="right_item">
|
|
|
- <view class="item_info">位置 4.6</view>
|
|
|
+ <view class="item_info">位置 {{ scoreWz }}</view>
|
|
|
<view class="item_progress">
|
|
|
- <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="(4.6 / 5) * 100" />
|
|
|
+ <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreWz * 1) / 5) * 100" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 设施评分区域 -->
|
|
|
<view class="right_item">
|
|
|
- <view class="item_info">设施 4.6</view>
|
|
|
+ <view class="item_info">设施 {{ scoreSs }}</view>
|
|
|
<view class="item_progress">
|
|
|
- <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="(4.6 / 5) * 100" />
|
|
|
+ <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreSs * 1) / 5) * 100" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 服务评分区域 -->
|
|
|
<view class="right_item">
|
|
|
- <view class="item_info">服务 4.6</view>
|
|
|
+ <view class="item_info">服务 {{ scoreFw }}</view>
|
|
|
<view class="item_progress">
|
|
|
- <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="(4.6 / 5) * 100" />
|
|
|
+ <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreFw * 1) / 5) * 100" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 卫生评分区域 -->
|
|
|
<view class="right_item">
|
|
|
- <view class="item_info">卫生 4.6</view>
|
|
|
+ <view class="item_info">卫生 {{ scoreWs }}</view>
|
|
|
<view class="item_progress">
|
|
|
- <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="(4.6 / 5) * 100" />
|
|
|
+ <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreWs * 1) / 5) * 100" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -223,20 +229,20 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 每一个评价区域 -->
|
|
|
- <view class="evaluate_box" v-for="item in commentList" :key="item.id">
|
|
|
+ <view class="evaluate_box" v-for="item in commentList" :key="item.id" @click="handleGoDetail(item)">
|
|
|
<!-- 用户信息区域 -->
|
|
|
- <view class="box_userInfo" @click="handleGoDetail(item)">
|
|
|
- <img mode="aspectFill" :src="item.imgUrl" />
|
|
|
+ <view class="box_userInfo">
|
|
|
+ <img mode="aspectFill" :src="item.headPhoto" />
|
|
|
<view class="userInfo_msg">
|
|
|
- <view class="msg_name">{{ item.name }}</view>
|
|
|
+ <view class="msg_name">{{ item.userName }}</view>
|
|
|
<view class="msg_star">
|
|
|
- <uni-rate readonly activeColor="#FFC300" :size="16" :value="item.rate" />
|
|
|
+ <uni-rate readonly activeColor="#FFC300" :size="16" :value="item.score" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 入住时间区域 -->
|
|
|
- <view class="box_time">{{ item.liveTime }}入住,{{ item.subTime }}发表 | {{ item.type }}</view>
|
|
|
+ <view class="box_time">{{ item.liveTime.slice(0, 10) }}入住,{{ item.commentTime.slice(0, 10) }}发表 | {{ item.houseName }}</view>
|
|
|
|
|
|
<!-- 评价内容区域 -->
|
|
|
<uv-read-more show-height="85rpx" closeText="全文" color="#096663" fontSize="24rpx" textIndent="0" :toggle="true" :shadowStyle="shadowStyle">
|
|
|
@@ -247,12 +253,12 @@
|
|
|
|
|
|
<!-- 图片区域 -->
|
|
|
<view class="box_img">
|
|
|
- <img v-for="(ele, index) in item.imgList" :key="index" mode="aspectFill" :src="ele" @click="handleClickImg(item.imgList, index)" />
|
|
|
+ <img v-for="(ele, index) in item.url" :key="index" mode="aspectFill" :src="ele" @click.stop="handleClickImg(item.url, index)" />
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="foot" @click="handleGoPage" v-if="commentList.length">
|
|
|
- 查看全部{{ commentList.length }}条评价
|
|
|
+ 查看全部{{ total }}条评价
|
|
|
<img src="../../static/index/right.png" />
|
|
|
</view>
|
|
|
|
|
|
@@ -298,67 +304,24 @@ export default {
|
|
|
activeIndex: 0,
|
|
|
headerList: ['预定', '评价'],
|
|
|
// 评价列表数据
|
|
|
- commentList: [
|
|
|
- // {
|
|
|
- // id: 1,
|
|
|
- // imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
|
|
|
- // name: '张三',
|
|
|
- // rate: 4.6,
|
|
|
- // liveTime: '2023-07',
|
|
|
- // subTime: '2023-08-01',
|
|
|
- // type: '大床房',
|
|
|
- // content:
|
|
|
- // '评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容的丰富的丰富评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容的丰富的丰富',
|
|
|
- // imgList: [
|
|
|
- // 'https://img1.baidu.com/it/u=2776549017,1408541252&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
|
|
|
- // 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201912%2F28%2F20191228151619_wxioq.thumb.1000_0.jpg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695352503&t=cf595866bbcbd5c6a01ffe69913da7e0'
|
|
|
- // ],
|
|
|
- // count: 12
|
|
|
- // },
|
|
|
- // {
|
|
|
- // id: 2,
|
|
|
- // imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
|
|
|
- // name: '李四',
|
|
|
- // rate: 4.1,
|
|
|
- // liveTime: '2023-08',
|
|
|
- // subTime: '2023-08-11',
|
|
|
- // type: '双人房',
|
|
|
- // content:
|
|
|
- // '评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容的丰富的丰富评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容的丰富的丰富',
|
|
|
- // imgList: [
|
|
|
- // 'https://img1.baidu.com/it/u=2776549017,1408541252&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
|
|
|
- // 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
|
|
|
- // 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201912%2F28%2F20191228151619_wxioq.thumb.1000_0.jpg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695352503&t=cf595866bbcbd5c6a01ffe69913da7e0',
|
|
|
- // 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F70a86822-e473-4ad8-9147-fad3e5cbc5ec%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695352600&t=689d4a86e77580db11cdc227291ef6f7'
|
|
|
- // ],
|
|
|
- // count: 8
|
|
|
- // },
|
|
|
- // {
|
|
|
- // id: 3,
|
|
|
- // imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
|
|
|
- // name: '王八',
|
|
|
- // rate: 3.8,
|
|
|
- // liveTime: '2023-07',
|
|
|
- // subTime: '2023-07-11',
|
|
|
- // type: '普通房',
|
|
|
- // content:
|
|
|
- // '评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容的丰富的丰富评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容的丰富的丰富',
|
|
|
- // imgList: [],
|
|
|
- // count: 26
|
|
|
- // }
|
|
|
- ],
|
|
|
+ commentList: [],
|
|
|
queryDom: null,
|
|
|
domTop: null,
|
|
|
- selected: [
|
|
|
- // {
|
|
|
- // date: '2023-09-07',
|
|
|
- // topinfo: '¥456'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // date: '2023-09-08',
|
|
|
- // topinfo: '¥888'
|
|
|
- // }
|
|
|
- ]
|
|
|
+ selected: [],
|
|
|
+ // 总评分
|
|
|
+ score: '',
|
|
|
+ // 服务评分
|
|
|
+ scoreFw: '',
|
|
|
+ // 设施评分
|
|
|
+ scoreSs: '',
|
|
|
+ // 卫生评分
|
|
|
+ scoreWs: '',
|
|
|
+ // 位置评分
|
|
|
+ scoreWz: '',
|
|
|
+ // 评论总条数
|
|
|
+ total: null,
|
|
|
+ // 是否收藏
|
|
|
+ ischecked: false
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -390,20 +353,46 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 点击收藏按钮回调
|
|
|
+ async changeCollect(is_collect_hotel) {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: is_collect_hotel ? '/mhotel/ahpdelCollectHotel.action' : '/mhotel/ahpcollectHotel.action',
|
|
|
+ data: {
|
|
|
+ userId: uni.getStorageSync('userInfo').id,
|
|
|
+ hotelId: this.hotelId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title: is_collect_hotel ? '取消收藏成功' : '收藏成功',
|
|
|
+ icon: 'success',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ this.info.is_collect_hotel = !this.info.is_collect_hotel
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取评论数据
|
|
|
- getEvaData() {
|
|
|
- uni.request({
|
|
|
- url: 'http://192.168.161.224:8088/mhotel/abcaevaluatePage.action',
|
|
|
+ async getEvaData() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/mhotel/abcaevaluatePage.action',
|
|
|
data: {
|
|
|
hotelId: this.hotelId,
|
|
|
page: 1,
|
|
|
rows: 5,
|
|
|
status: 0
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- console.log(res.data)
|
|
|
}
|
|
|
})
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code === 200 && res.page.pageList) {
|
|
|
+ this.score = res.score.score.toFixed(1)
|
|
|
+ this.scoreFw = res.score.scoreFw.toFixed(1)
|
|
|
+ this.scoreSs = res.score.scoreSs.toFixed(1)
|
|
|
+ this.scoreWs = res.score.scoreWs.toFixed(1)
|
|
|
+ this.scoreWz = res.score.scoreWz.toFixed(1)
|
|
|
+ this.commentList = res.page.pageList
|
|
|
+ this.total = res.page.total
|
|
|
+ }
|
|
|
},
|
|
|
// 获取民宿信息
|
|
|
async getHotelInfo() {
|
|
|
@@ -411,6 +400,7 @@ export default {
|
|
|
url: '/mhotel/ahpgetHouseByHotelId.action',
|
|
|
data: {
|
|
|
hotelId: this.hotelId,
|
|
|
+ userId: uni.getStorageSync('userInfo').id,
|
|
|
queryStartTime: this.startTime,
|
|
|
queryEndTime: this.endTime
|
|
|
}
|
|
|
@@ -436,6 +426,10 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ monthSwitch(e) {
|
|
|
+ let time = e.year + '-' + e.month.toString().padStart(2, 0) + '-01'
|
|
|
+ this.handleOpen(time)
|
|
|
+ },
|
|
|
// 选择日期确定回调
|
|
|
handleConfirm(e) {
|
|
|
this.startTime = e.range.before
|
|
|
@@ -538,7 +532,8 @@ export default {
|
|
|
queryEndTime: this.endTime,
|
|
|
dayList: this.dayList,
|
|
|
hTypeName: this.info.hTypeName,
|
|
|
- hotelName: this.info.hotel_name
|
|
|
+ hotelName: this.info.hotel_name,
|
|
|
+ hotelId: this.hotelId
|
|
|
})
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/affirmOrder/affirmOrder?info=${info}`
|
|
|
@@ -564,8 +559,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 点击日期区域回调
|
|
|
- handleOpen() {
|
|
|
- this.$refs.calendar.open()
|
|
|
+ async handleOpen(time) {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/mhotel/house/price/priceCalendar.action',
|
|
|
+ data: {
|
|
|
+ merchantId: this.info.managerId,
|
|
|
+ startTime: time ? time : this.startTime
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.selected = res.data
|
|
|
+ }
|
|
|
+ if (!time) {
|
|
|
+ this.$refs.calendar.open()
|
|
|
+ }
|
|
|
},
|
|
|
// 传入参数获取当前是星期几
|
|
|
getWeek(time) {
|
|
|
@@ -599,9 +606,8 @@ export default {
|
|
|
},
|
|
|
// 点击每一个评价回调
|
|
|
handleGoDetail(item) {
|
|
|
- let info = encodeURIComponent(JSON.stringify(item))
|
|
|
uni.navigateTo({
|
|
|
- url: `/pages/appraiseDetail/appraiseDetail?info=${info}`
|
|
|
+ url: `/pages/appraiseDetail/appraiseDetail?id=${item.id}`
|
|
|
})
|
|
|
},
|
|
|
// 点击评价图片回调
|
|
|
@@ -614,7 +620,7 @@ export default {
|
|
|
},
|
|
|
handleGoPage() {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/appraise/appraise'
|
|
|
+ url: `/pages/appraise/appraise?hotelId=${this.hotelId}`
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -699,6 +705,12 @@ export default {
|
|
|
height: 40rpx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .collect {
|
|
|
+ position: absolute;
|
|
|
+ top: 68rpx;
|
|
|
+ left: 8rpx;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.detail {
|