Commit ba06273c3cea07c8cb7d26b53b6f421bcfdfb997

Authored by guzijian
1 parent 96200802

feat: 修改评价逻辑。新增查看评价页面

garbage-removal/src/apis/evaluate.js 0 → 100644
  1 +import { request } from "@/utils/request";
  2 +
  3 +// 评价
  4 +export async function queryEvaluateDetail(orderId) {
  5 + return await request.get(`/order/evaluate/detail/${orderId}`);
  6 +}
... ...
garbage-removal/src/pages.json
... ... @@ -42,6 +42,14 @@
42 42 "enablePullDownRefresh": false
43 43 }
44 44 },{
  45 + "path": "pages/order/evaluate-info/index",
  46 + "style": {
  47 + "navigationBarTitleText": "评价详情",
  48 + "navigationBarTextStyle": "white",
  49 + "navigationBarBackgroundColor": "#53c21d",
  50 + "enablePullDownRefresh": false
  51 + }
  52 + },{
45 53 "path": "pages/order/evaluate/index",
46 54 "style": {
47 55 "navigationBarTitleText": "写评价",
... ...
garbage-removal/src/pages/home/index.vue
1 1 <template>
2 2 <view class="home-container">
3   -
4 3 <view class="top-swiper-image-scroll">
5 4 <u-swiper :list="swiperImageList" keyName="image" :autoplay="true" circular></u-swiper>
6 5 <view :style="{
... ...
garbage-removal/src/pages/order/detail/index.vue
... ... @@ -23,6 +23,7 @@
23 23 <!-- 派单信息 -->
24 24 <view class="order-detail-container-box-card">
25 25 <view class="order-detail-container-header-card-title">
  26 + <view class="order-detail-container-header-card-uicon"></view>
26 27 派单信息
27 28 </view>
28 29 <view class="order-detail-container-header-item">
... ... @@ -66,6 +67,7 @@
66 67 <!-- 派单记录 -->
67 68 <view class="order-detail-container-box-card">
68 69 <view class="order-detail-container-header-card-title">
  70 + <view class="order-detail-container-header-card-uicon"></view>
69 71 派单人员
70 72 </view>
71 73 <!-- <view class="order-detail-container-header-item">
... ... @@ -104,6 +106,7 @@
104 106 <!-- 处理信息 -->
105 107 <view class="order-detail-container-box-card">
106 108 <view class="order-detail-container-header-card-title">
  109 + <view class="order-detail-container-header-card-uicon"></view>
107 110 处理信息
108 111 </view>
109 112 <view v-if="dataGram.garOrderHandlerId" style="width: 100%;">
... ... @@ -167,6 +170,9 @@
167 170 <u-button @click="handleEvaluate(orderId, userType)"
168 171 v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '管理负责人'" shape="circle" color="#a9e08f"
169 172 text="去评价"></u-button>
  173 + <u-button @click="handleEvaluateDetail(orderId, userType)"
  174 + v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '管理负责人'" shape="circle" color="#a9e08f"
  175 + text="查看评价"></u-button>
170 176 <u-button
171 177 v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.putOnImages.length != 0 && dataGram.putDownImages.length != 0 && dataGram.garCancelFlag === 0"
172 178 @click="handleSubmitSuccess(orderId)" shape="circle" color="#a9e08f" text="完成派单"></u-button>
... ... @@ -225,6 +231,10 @@ onLoad((options) =&gt; {
225 231 const handleClose = (e) => {
226 232 cancelShow.value = false
227 233 }
  234 +const handleEvaluateDetail = (orderId, userType) => {
  235 + uni.$u.route(`pages/order/evaluate-info/index`,
  236 + { orderId: orderId, userType: userType })
  237 +}
228 238 const selectClick = (index) => {
229 239 currentCancelName.value = index.name;
230 240 }
... ... @@ -409,6 +419,15 @@ $custom-bottom-height: 200rpx;
409 419 border-bottom: 3rpx solid $u-info-light;
410 420 margin-bottom: $custom-marin-bottom;
411 421 color: $u-primary;
  422 + display: flex;
  423 + align-items: center;
  424 +
  425 + .order-detail-container-header-card-uicon {
  426 + background-color: $u-primary;
  427 + margin-right: 10rpx;
  428 + height: 35rpx;
  429 + width: 15rpx;
  430 + }
412 431 }
413 432  
414 433 .order-detail-container-header-item {
... ...
garbage-removal/src/pages/order/evaluate-info/index.vue 0 → 100644
  1 +<template>
  2 + <view class="page-evaluate">
  3 + <view class="evaluate-user-box">
  4 + <view class="user-info-title">
  5 + <u-avatar :src="pic" size="70"></u-avatar>
  6 + <view class="user-name">
  7 + 居民用户
  8 + </view>
  9 + </view>
  10 + <view v-if="evaluateUser" class="evaluate-content">
  11 + <view class="evaluate-score">
  12 + <u-icon v-for="todo in maxStar" :name="evaluateUser.garEvaluateScore > todo ? 'star-fill' : 'star'" :key="todo"
  13 + color="#f9ae3d" size="28"></u-icon>
  14 + </view>
  15 + <view class="evaluate-txt">
  16 + {{ evaluateUser.garEvaluateContent }}
  17 + </view>
  18 + </view>
  19 + <view class="evaluate-empty" v-else>
  20 + 暂无评价~~
  21 + </view>
  22 + </view>
  23 + <view class="evaluate-user-box">
  24 + <view class="user-info-title">
  25 + <u-avatar :src="pic" size="70"></u-avatar>
  26 + <view class="user-name">
  27 + 管理负责人
  28 + </view>
  29 + </view>
  30 + <view v-if="evaluateManager" class="evaluate-content">
  31 + <view class="evaluate-score">
  32 + <u-icon v-for="todo in maxStar" :name="evaluateManager.garEvaluateScore > todo ? 'star-fill' : 'star'"
  33 + :key="todo" color="#f9ae3d" size="28"></u-icon>
  34 + </view>
  35 + <view class="evaluate-txt">
  36 + {{ evaluateManager.garEvaluateContent }}
  37 + </view>
  38 + </view>
  39 + <view class="evaluate-empty" v-else>
  40 + 暂无评价~~
  41 + </view>
  42 + </view>
  43 + </view>
  44 +</template>
  45 +
  46 +<script setup>
  47 +import { queryEvaluateDetail } from "@/apis/evaluate";
  48 +import headImg from "@/static/image/st_pic.png";
  49 +import { onLoad } from '@dcloudio/uni-app';
  50 +import { ref } from 'vue';
  51 +const pic = ref(headImg)
  52 +// 定义最大积分
  53 +let maxScore = 5
  54 +const maxStar = ref([])
  55 +
  56 +// 用户评价对象
  57 +const evaluateUser = ref()
  58 +// 管理负责人评价
  59 +const evaluateManager = ref()
  60 +onLoad((options) => {
  61 + for (let index = 0; index < maxScore; index++) {
  62 + maxStar.value.push(index);
  63 + }
  64 + // 查询评价
  65 + queryEvaluateDetail(options.orderId).then(res => {
  66 +
  67 + res.data.data.forEach(element => {
  68 + if (element.garEvaluateTarget == 0) {
  69 + evaluateUser.value = element
  70 + }
  71 + if (element.garEvaluateTarget == 1) {
  72 + evaluateManager.value = element
  73 + }
  74 + });
  75 + })
  76 +})
  77 +</script>
  78 +
  79 +<style lang="scss" scoped>
  80 +$page-padding: 20rpx;
  81 +
  82 +.page-evaluate {
  83 + height: 100%;
  84 + width: 100%;
  85 + padding: $page-padding;
  86 + background-color: #ffffff;
  87 + box-sizing: border-box;
  88 +
  89 + .evaluate-user-box {
  90 + box-sizing: border-box;
  91 + color: $u-main-color;
  92 + width: 100%;
  93 + padding: $page-padding;
  94 + border-radius: $page-padding;
  95 + border: 2rpx solid $u-border-color;
  96 + margin: 40rpx 0;
  97 + min-height: 300rpx;
  98 +
  99 + .user-info-title {
  100 + display: flex;
  101 + align-items: center;
  102 +
  103 + .user-name {
  104 + margin-left: 20rpx;
  105 + box-sizing: border-box;
  106 + }
  107 + }
  108 +
  109 + .evaluate-content {
  110 + margin: 20rpx 0;
  111 + box-sizing: border-box;
  112 +
  113 + .evaluate-score {
  114 + display: flex;
  115 + }
  116 +
  117 + .evaluate-txt {
  118 + color: $u-info;
  119 + }
  120 + }
  121 +
  122 + .evaluate-empty {
  123 + margin: 20rpx 0;
  124 + box-sizing: border-box;
  125 + color: $u-info;
  126 + }
  127 + }
  128 +}
  129 +</style>
... ...
garbage-removal/src/pages/order/swiper-list-item/index.vue
... ... @@ -68,6 +68,7 @@
68 68 <script setup>
69 69 import { queryOrderList, updateOrder } from "@/apis/order.js";
70 70 import { useMainStore } from '@/stores/index.js';
  71 +import { onShow } from "@dcloudio/uni-app";
71 72 import { computed, ref, watch } from 'vue';
72 73 const props = defineProps({
73 74 tabIndex: {
... ... @@ -178,6 +179,18 @@ const queryList = (pageNo, pageSize) =&gt; {
178 179 paging.value.complete(false);
179 180 })
180 181 }
  182 +
  183 +onShow(() => {
  184 + if (props.currentIndex == props.tabIndex) {
  185 + if (firstLoaded.value) {
  186 + setTimeout(() => {
  187 + paging.value.reload();
  188 + }, 50);
  189 + }
  190 + }
  191 +})
  192 +
  193 +// 重写load的方法,自动刷新
181 194 watch(() => props.currentIndex, (val1, val2) => {
182 195 if (props.currentIndex == props.tabIndex) {
183 196 if (!firstLoaded.value) {
... ...
garbage-removal/src/pages/wode/index.vue
... ... @@ -6,14 +6,7 @@
6 6 </view>
7 7 <view class="u-flex-1">
8 8 <view class="u-font-18 u-p-b-20">普通用户</view>
9   - <!-- <view class="u-font-14 u-tips-color"></view> -->
10 9 </view>
11   - <!-- <view class="u-m-l-10 u-p-10">
12   - <u-icon name="scan" color="#969799" size="28"></u-icon>
13   - </view>
14   - <view class="u-m-l-10 u-p-10">
15   - <u-icon name="arrow-right" color="#969799" size="28"></u-icon>
16   - </view> -->
17 10 </view>
18 11  
19 12 <view class="u-m-t-20">
... ...