This commit is contained in:
xyc 2025-05-29 09:39:52 +08:00
parent bfecf06b2c
commit 1bfed6c99d
9 changed files with 263 additions and 2 deletions

View File

@ -0,0 +1,261 @@
<template>
<view class="comment-list">
<headersVue titles="用户评价" style="position: static !important;">
<u-icon name="arrow-left" color="#fff" size="18"></u-icon>
</headersVue>
<view style="padding: 20rpx;">
<!-- 顶部标题 -->
<view class="header">
<text class="title">用户评价</text>
<text class="total">{{total}}条评价</text>
</view>
<!-- 评价列表 -->
<scroll-view scroll-y class="scroll-view" @scrolltolower="loadMore" v-if="comments.length > 0">
<view class="comment-item" v-for="(item, index) in comments" :key="index"
@click="goDetail(item.inspectionInfoId)">
<!-- 用户信息 -->
<view class="user-info">
<image class="avatar" :src="item.userImg" mode="aspectFill"></image>
<view class="info-right">
<text class="name">{{item.realName}}</text>
<view class="star-rating">
<uni-rate :value="item.commentStar" :size="14" :readonly="true" :margin="2" />
<text class="time">{{item.commentTime}}</text>
</view>
</view>
</view>
<!-- 评价内容 -->
<view class="comment-content">
<text>{{item.commentDesc}}</text>
</view>
<!-- 关联商品 -->
<view class="related-goods" v-if="item.goodsTitle">
<text>相关商品{{item.goodsTitle}}</text>
</view>
<!-- 分隔线 -->
<view class="divider"></view>
</view>
<!-- 加载更多提示 -->
<view class="load-more">
<text v-if="loading">加载中...</text>
<text v-else-if="noMore">没有更多了</text>
</view>
</scroll-view>
<!-- 空状态 -->
<view class="empty" v-else>
<image src="/static/images/empty-comment.png" mode="aspectFit"></image>
<text>暂无评价</text>
</view>
</view>
</view>
</template>
<script>
//
import uniRate from '@/uni_modules/uni-rate/components/uni-rate/uni-rate.vue'
import headersVue from '../../components/header/headers.vue';
import request from '../../utils/request';
// import {
// formatTime
// } from '@/utils/util.js'
export default {
components: {
uniRate,
headersVue
},
data() {
return {
comments: [], //
pageNum: 1, //
pageSize: 10, //
total: 0, //
loading: false, //
noMore: false //
}
},
mounted() {
this.getList()
},
methods: {
//
formatTime(time) {
return formatTime(time, 'yyyy-MM-dd hh:mm')
},
goDetail(id) {
console.log('当前检测id', id);
if (id == null || id == undefined || !id) {
uni.showToast({
title: '暂时无法查看该订单!',
icon: "none"
})
return
}
uni.navigateTo({
url: `/pages/index/orderdetails?inspectionInfoId=${id}`
})
},
//
async getList() {
if (this.loading || this.noMore) return
this.loading = true
try {
const res = await request({
url: '/orderApi/getCommentOrderList',
methods: 'GET',
params: {
pageNum: this.pageNum,
pageSize: this.pageSize
}
})
if (res.code === 200) {
this.total = res.data.total
this.comments = [...this.comments, ...res.data.records]
//
if (res.data.records.length < this.pageSize) {
this.noMore = true
} else {
this.pageNum++
}
}
} catch (error) {
console.error('获取评价列表失败:', error)
} finally {
this.loading = false
}
},
//
loadMore() {
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.comment-list {
// padding: 20rpx;
background-color: #f7f7f7;
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.total {
font-size: 24rpx;
color: #999;
}
}
.scroll-view {
height: calc(85vh - 80rpx);
}
.comment-item {
background-color: #fff;
border-radius: 12rpx;
padding: 24rpx;
margin-bottom: 20rpx;
.user-info {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.info-right {
flex: 1;
.name {
font-size: 28rpx;
color: #333;
margin-bottom: 8rpx;
display: block;
}
.star-rating {
display: flex;
align-items: center;
.time {
font-size: 22rpx;
color: #999;
margin-left: 15rpx;
}
}
}
}
.comment-content {
font-size: 26rpx;
color: #333;
line-height: 1.6;
margin-bottom: 20rpx;
}
.related-goods {
font-size: 24rpx;
color: #999;
padding: 10rpx 0;
}
.divider {
height: 1rpx;
background-color: #eee;
margin: 20rpx -24rpx 0;
}
}
.load-more {
text-align: center;
padding: 20rpx;
font-size: 24rpx;
color: #999;
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 60vh;
image {
width: 300rpx;
height: 300rpx;
margin-bottom: 30rpx;
}
text {
font-size: 28rpx;
color: #999;
}
}
}
</style>

View File

@ -271,7 +271,7 @@
label: '3-8小时',
value: ['180', '480']
}, {
label: '8小时以上',
label: '8小时',
value: ['480']
}, ],
skuNames: [{

View File

@ -101,7 +101,7 @@
</view>
<view class="on-input" v-if="item.otherPhone">
<uni-icons type="map" color="#999999" size="16"></uni-icons>
<text>办人电话</text>
<text>办人电话</text>
<text>{{ item.otherPhone }}</text>
</view>
</view>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
static/imgs/newDayOrder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
static/imgs/newjg3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/imgs/newjg4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/imgs/pingjia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB