| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480 |
- <template>
- <view class="container">
- <!-- 分段器区域 -->
- <view class="segmented">
- <uni-segmented-control :current="activeCurrent" :values="headerList" style-type="text" active-color="#096562" @clickItem="onClickItem" />
- </view>
- <!-- 列表区域 -->
- <scroll-view class="body" scroll-y @scrolltolower="handlePull">
- <!-- 每一个盒子区域 -->
- <view class="box" v-for="(item, index) in list" :key="index" @click="handleGoDetail(item)">
- <!-- 头部区域 -->
- <view class="box_top" v-if="activeCurrent === 0">
- <img mode="aspectFill" src="../../static/my/hotel.png" />
- <view class="top_name">{{ item.hotelName }}</view>
- <view class="box_type">已消费</view>
- </view>
- <!-- 房间信息区域 -->
- <view class="box_center" v-if="activeCurrent === 0">
- <img mode="aspectFill" :src="item.url" />
- <view class="center_info">
- <view>{{ item.houseOrderNumber }}间,{{ item.houseName }}</view>
- <view v-if="item.checkOutTime">{{ item.checkOutTime.slice(0, 10) }} - {{ item.checkOutTime.slice(0, 10) }}</view>
- <view>总价:¥{{ item.payAccount }}</view>
- </view>
- </view>
- <!-- 按钮区域 -->
- <view class="box_btn" v-if="activeCurrent === 0">
- <view class="btn_eva" @click.stop="handleGoPage(item)">去评价</view>
- </view>
- <!-- 审核中 已驳回 已评价 样式区域 -->
- <view class="box_top2" v-if="activeCurrent !== 0">
- <view class="top_name">{{ item.subTime }}发表</view>
- <view class="box_type color" v-if="activeCurrent === 1">审核中</view>
- <view class="box_type color2" v-if="activeCurrent === 2">已驳回</view>
- </view>
- <view class="box_rate" v-if="activeCurrent !== 0">
- 评分:
- <uni-rate readonly activeColor="#FFC300" :size="16" :value="item.score" />
- </view>
- <view class="box_content" v-if="activeCurrent !== 0">
- 审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中审核中
- </view>
- <!-- 图片列表区域 -->
- <view class="box_img" v-if="activeCurrent !== 0">
- <img
- v-for="(ele, index) in item.urls"
- :key="index"
- mode="aspectFill"
- v-if="ele.indexOf('jpg') !== -1 || ele.indexOf('png') !== -1"
- :src="ele"
- @click.stop="handleLookImg(ele, index)"
- />
- <video
- :id="item.id + index2"
- class="video"
- :show-fullscreen-btn="false"
- :show-play-btn="false"
- v-for="(video, index2) in item.urls"
- :key="index2"
- v-if="video.indexOf('mp4') !== -1"
- :src="video"
- @fullscreenchange="fullscreenchange"
- @click.stop="handleClickVideo(item.id + index2)"
- ></video>
- </view>
- <!-- 民宿信息区域 -->
- <view class="box_hotel" v-if="activeCurrent !== 0" @click.stop="">
- <img mode="aspectFill" :src="item.urls[0]" />
- <view class="hotel_info">
- <view class="info_name">{{ item.hotelName }}</view>
- <view class="info_tags">{{ item.houseOrderNumber }}间,{{ item.houseName }}</view>
- <view class="info_tags">{{ item.liveTime.slice(0, 10) }} - {{ item.checkOutTime.slice(0, 10) }}</view>
- <view class="info_tags">总价:¥{{ item.payAccount }}</view>
- </view>
- </view>
- <view class="box_desc" v-if="activeCurrent === 2">
- <view class="desc_key">备注:</view>
- <view class="desc_value">{{ item.desc }}</view>
- </view>
- </view>
- <view class="noData" v-if="list.length === 0">
- <img lazy-load :lazy-load-margin="0" src="../../static/images/noData.png" />
- {{ noDataMsg }}
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 分段器当前激活索引
- activeCurrent: 0,
- // 分段器数组
- headerList: ['待评价', '审核中', '已驳回', '已评价'],
- // 列表数据
- list: [
- {
- id: 1,
- hotelName: '民宿名称',
- url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg',
- houseOrderNumber: 1,
- houseName: '单间',
- payAccount: 229,
- subTime: '2023-09-22 16:54:20',
- liveTime: '2023-09-22 16:54:20',
- checkOutTime: '2023-09-22 16:54:20',
- score: 5,
- urls: [
- 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg',
- 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg',
- 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg',
- 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg'
- ],
- desc: '内容不实,驳回评价'
- },
- {
- id: 2,
- hotelName: '民宿名称',
- url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg',
- houseOrderNumber: 1,
- houseName: '单间',
- payAccount: 229,
- subTime: '2023-09-22 16:54:20',
- liveTime: '2023-09-22 16:54:20',
- checkOutTime: '2023-09-22 16:54:20',
- score: 5,
- urls: [
- 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg',
- 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg'
- ],
- desc: '内容不实,驳回评价'
- }
- ],
- noDataMsg: '暂无待评价数据',
- // 当前页
- page: 1,
- // 每页多少条
- rows: 6,
- // 总条数
- total: null,
- status: null,
- // 是否是全屏状态
- videoContext: null,
- isFullScreen: false
- }
- },
- onLoad() {
- // this.getData()
- },
- methods: {
- async getData() {
- const res = await this.$myRequest({
- url: '/mhotel/abcapersonageComment.action',
- data: {
- usersId: uni.getStorageSync('userInfo').id,
- status: this.status,
- page: this.page,
- rows: this.rows
- }
- })
- // console.log(res)
- if (res.code === 200 && res.page.pageList) {
- this.list = [...this.list, ...res.page.pageList]
- this.total = res.total
- this.headerList = [`待评价(${res.data.waitingCount})`, `审核中(${res.data.auditCount})`, `已驳回(${res.data.refuseAuditCount})`, `已评价(${res.data.ratedCount})`]
- }
- },
- // 切换分段器回调
- onClickItem(e) {
- this.activeCurrent = e.currentIndex
- if (e.currentIndex === 0) {
- this.noDataMsg = '暂无待评价数据'
- this.status = 0
- } else if (e.currentIndex === 1) {
- this.noDataMsg = '暂无审核中数据'
- this.status = 2
- } else if (e.currentIndex === 2) {
- this.noDataMsg = '暂无已驳回数据'
- this.status = 3
- } else if (e.currentIndex === 3) {
- this.noDataMsg = '暂无已评价数据'
- this.status = 1
- }
- // this.list = []
- // this.page = 1
- // this.getData()
- },
- // 列表下拉到底部回调
- handlePull() {
- if (this.list.length < this.total) {
- this.page++
- this.getData()
- } else {
- uni.showToast({
- title: '没有更多数据了',
- icon: 'none'
- })
- }
- },
- //去评价按钮回调
- handleGoPage(item) {
- uni.navigateTo({
- url: `/pages/evaluate/evaluate?bookingId=${item.id}&hotelId=${item.hotelId}&houseId=${item.houseId}`
- })
- },
- // 点击每一个评价订单的回调
- handleGoDetail(item) {
- if (this.activeCurrent === 1) {
- uni.navigateTo({
- url: `/pages/appraiseDetail/appraiseDetail?id=${item.bookingCommentId}`
- })
- } else {
- uni.navigateTo({
- url: `/pages/orderDetail/orderDetail?id=${item.id}`
- })
- }
- },
- // 点击图片回调
- handleLookImg(url, current) {
- this.videoContext.stop()
- uni.previewImage({
- urls: [url],
- current
- })
- },
- // 点击视频控件时触发的回调
- handleClickVideo(id) {
- this.videoContext = uni.createVideoContext(id)
- if (this.isFullScreen) {
- this.videoContext.stop()
- this.videoContext.exitFullScreen()
- } else {
- this.videoContext.requestFullScreen()
- this.videoContext.play()
- }
- },
- // 进入全屏和退出全屏时触发的回调
- fullscreenchange(e) {
- this.isFullScreen = e.detail.fullScreen
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- height: 100vh;
- background-color: #f2f3f5;
- overflow: hidden;
- .segmented {
- box-sizing: border-box;
- padding: 0 50rpx;
- height: 100rpx;
- background-color: #fff;
- }
- .body {
- box-sizing: border-box;
- padding: 20rpx 0;
- height: calc(100vh - 100rpx);
- overflow-y: auto;
- .box {
- padding: 0 20rpx 20rpx;
- margin-bottom: 20rpx;
- background-color: #fff;
- .box_top {
- display: flex;
- align-items: center;
- height: 94rpx;
- img {
- width: 47rpx;
- height: 47rpx;
- border-radius: 50%;
- }
- .top_name {
- margin-left: 18rpx;
- font-size: 32rpx;
- font-weight: bold;
- }
- .box_type {
- margin-left: auto;
- color: #808080;
- font-size: 28rpx;
- }
- }
- .box_top2 {
- display: flex;
- align-items: center;
- height: 80rpx;
- border-bottom: 1rpx solid #e5e5e5;
- img {
- width: 47rpx;
- height: 47rpx;
- border-radius: 50%;
- }
- .top_name {
- font-size: 28rpx;
- font-weight: bold;
- }
- .box_type {
- margin-left: auto;
- color: #808080;
- font-size: 28rpx;
- }
- .color {
- color: #e6a23c;
- }
- .color2 {
- color: #f56c6c;
- }
- }
- .box_center {
- display: flex;
- img {
- width: 100rpx;
- height: 100rpx;
- border-radius: 10rpx;
- }
- .center_info {
- margin-top: -5rpx;
- margin-left: 18rpx;
- color: #808080;
- font-size: 28rpx;
- }
- }
- .box_btn {
- display: flex;
- justify-content: flex-end;
- margin-top: 35rpx;
- .btn_eva {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-left: 20rpx;
- width: 178rpx;
- height: 68rpx;
- color: #808080;
- font-size: 28rpx;
- border-radius: 64rpx;
- border: 1rpx solid #808080;
- }
- }
- .box_rate {
- display: flex;
- align-items: center;
- height: 70rpx;
- color: #808080;
- font-size: 28rpx;
- }
- .box_content {
- font-size: 24rpx;
- }
- .box_img {
- display: grid;
- grid-template-columns: 1fr 1fr 1fr;
- grid-auto-rows: auto;
- padding: 20rpx 0 40rpx;
- gap: 10rpx;
- img {
- width: 216rpx;
- height: 216rpx;
- border-radius: 20rpx;
- }
- .video {
- width: 216rpx;
- height: 216rpx;
- border-radius: 20rpx;
- }
- }
- .box_hotel {
- display: flex;
- align-items: center;
- padding: 20rpx 0;
- border-top: 1rpx solid #e6e6e6;
- background-color: #fff;
- img {
- width: 120rpx;
- height: 170rpx;
- border-radius: 7rpx;
- }
- .hotel_info {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- margin-left: 20rpx;
- height: 170rpx;
- .info_name {
- font-size: 32rpx;
- font-weight: bold;
- }
- .info_star {
- display: flex;
- align-items: center;
- .star_num {
- margin-left: 10rpx;
- color: #ffc300;
- font-size: 24rpx;
- }
- }
- .info_tags {
- display: flex;
- color: #a6a6a6;
- font-size: 24rpx;
- .tag_item {
- margin-right: 20rpx;
- }
- }
- }
- }
- .box_desc {
- display: flex;
- padding-top: 15rpx;
- font-size: 28rpx;
- border-top: 1rpx solid #e6e6e6;
- .desc_key {
- }
- .desc_value {
- flex: 1;
- color: #808080;
- }
- }
- }
- .noData {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding-bottom: 20rpx;
- img {
- margin-top: 160rpx;
- width: 600rpx;
- height: 600rpx;
- }
- }
- }
- }
- </style>
|