lanan-repair/pages-order/my/evaluate.vue

161 lines
4.0 KiB
Vue
Raw Normal View History

2024-09-22 15:07:01 +08:00
<template>
<view class="container">
<v-navigation-bar background-color="#fff" title-color="#333" title="我的评价"></v-navigation-bar>
<view class="body">
<view v-for="(item, index) in evaluateList" :key="index" class="item">
2024-10-14 18:06:55 +08:00
<view class="date">{{ item.commentTime }}</view>
2024-09-22 15:07:01 +08:00
<view class="message">
2024-09-24 20:45:24 +08:00
<!-- 这家修理厂的喷漆工艺非常不错特别均匀师傅也很细心如果您需要做喷漆或者维修服务不要错过这里-->
2024-10-14 18:36:20 +08:00
{{item.commentDesc || "未输入评价内容"}}
2024-09-22 15:07:01 +08:00
</view>
<view class="rate">
<!-- 设置尺寸大小 -->
2024-10-14 18:06:55 +08:00
<uni-rate :readonly="true" allow-half :value="item.commentStar"/>
2024-09-22 15:07:01 +08:00
</view>
<view class="shopInfo">
2024-09-24 20:45:24 +08:00
<image class="shopImg" :src="item.image" mode="aspectFill"></image>
2024-09-22 15:07:01 +08:00
<view class="shopInfo_content">
2024-09-24 20:45:24 +08:00
<view class="shopName">{{ item.tenantName }}</view>
2024-10-14 18:06:55 +08:00
<view class="shopAddress">{{ item.goodsTitle }}</view>
2024-09-22 15:07:01 +08:00
</view>
</view>
</view>
2024-10-14 18:06:55 +08:00
<view class="no-data" v-if="evaluateList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
2024-09-22 15:07:01 +08:00
</view>
</view>
</template>
<script>
import VNavigationBar from '@/components/VNavigationBar.vue'
2024-09-24 14:08:50 +08:00
import request from "@/utils/request";
2024-09-22 15:07:01 +08:00
export default {
components: {
VNavigationBar,
},
data() {
return {
2024-09-24 20:45:24 +08:00
// evaluateList: [{}, {}, {}],
2024-09-24 14:08:50 +08:00
queryParams:{
pageNum: 1,
pageSize: 10
2024-09-24 20:45:24 +08:00
},
evaluateList: [],
2024-09-22 15:07:01 +08:00
};
2024-09-24 14:08:50 +08:00
},
onShow(){
this.getAppraisePage()
},
methods:{
2024-10-14 18:06:55 +08:00
/**
* 时间戳转文字
* */
timestampToDate(timestamp) {
let date = new Date(timestamp); // 将时间戳转换为Date对象
let year = date.getFullYear(); // 获取年份
let month = date.getMonth() + 1; // 获取月份,需要+1因为月份是从0开始计算的
let day = date.getDate(); // 获取日
let hours = date.getHours(); // 获取小时
let minutes = date.getMinutes(); // 获取分钟
let seconds = date.getSeconds(); // 获取秒钟
// 格式化月份、日期、小时、分钟、秒
month = month < 10 ? '0' + month : month;
day = day < 10 ? '0' + day : day;
hours = hours < 10 ? '0' + hours : hours;
minutes = minutes < 10 ? '0' + minutes : minutes;
seconds = seconds < 10 ? '0' + seconds : seconds;
// 拼接成 yyyy-MM-dd HH:mm:ss 格式
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; // 返回格式化后的时间字符串
},
2024-09-24 14:08:50 +08:00
async getAppraisePage(){
const res = await request({
url: "/userClient/repair/order/getAppraise",
method: "get",
params:{
...this.queryParams,
pageNo: this.queryParams.pageNum
}
})
2024-09-24 20:45:24 +08:00
this.evaluateList = res.data.records
this.evaluateList.forEach(item => {
2024-10-14 18:06:55 +08:00
item.commentTime = this.timestampToDate(item.commentTime)
2024-09-28 00:17:38 +08:00
item.image = require("../static/inImage.jpg")
2024-09-24 20:45:24 +08:00
})
2024-09-24 14:08:50 +08:00
}
}
2024-09-22 15:07:01 +08:00
}
</script>
<style lang="less" scoped>
.container {
height: 100%;
background-color: #F3F5F7;
display: flex;
flex-direction: column;
.body {
padding: 20rpx 0;
flex: 1;
height: 0;
overflow: auto;
display: flex;
flex-direction: column;
row-gap: 10rpx;
}
2024-09-24 14:08:50 +08:00
2024-09-22 15:07:01 +08:00
.item {
background-color: #fff;
padding: 30rpx;
2024-09-24 14:08:50 +08:00
2024-09-22 15:07:01 +08:00
display: flex;
flex-direction: column;
row-gap: 20rpx;
}
2024-09-24 14:08:50 +08:00
2024-09-22 15:07:01 +08:00
.date {
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
2024-09-24 14:08:50 +08:00
2024-09-22 15:07:01 +08:00
.shopInfo {
display: flex;
align-items: stretch;
column-gap: 20rpx;
2024-09-24 14:08:50 +08:00
2024-09-22 15:07:01 +08:00
.shopImg {
width: 160rpx;
height: 100rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
background-color: #efefef;
}
2024-09-24 14:08:50 +08:00
2024-09-22 15:07:01 +08:00
.shopInfo_content {
flex: 1;
width: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
2024-09-24 14:08:50 +08:00
2024-09-22 15:07:01 +08:00
padding: 6rpx 0;
}
2024-09-24 14:08:50 +08:00
2024-09-22 15:07:01 +08:00
.shopName {
font-size: 28rpx;
color: #333333;
}
.shopAddress {
font-size: 24rpx;
color: #666666;
}
}
2024-10-14 18:06:55 +08:00
.no-data{
text-align: center;
}
2024-09-22 15:07:01 +08:00
}
2024-09-24 14:08:50 +08:00
</style>