Commit 0e85c12544f42bea81fd2ede7997427310272aa0

Authored by liujun001
1 parent 49211d9b

按需修改评价功能

garbage-removal/src/pages/order-info/order-driver/detail/index.vue
@@ -185,10 +185,10 @@ @@ -185,10 +185,10 @@
185 v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#a9e08f" 185 v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#a9e08f"
186 text="去评价"></u-button> 186 text="去评价"></u-button>
187 <u-button @click="handleEvaluate(orderId, userType)" 187 <u-button @click="handleEvaluate(orderId, userType)"
188 - v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人'" shape="square" color="#a9e08f"  
189 - text="去评价"></u-button> 188 + v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1" shape="square" color="#a9e08f"
  189 + text="查看评价" ></u-button>
190 <u-button @click="handleEvaluateDetail(orderId, userType)" 190 <u-button @click="handleEvaluateDetail(orderId, userType)"
191 - v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '运输企业负责人'" shape="square" color="#a9e08f" 191 + v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1" shape="square" color="#a9e08f"
192 text="查看评价"></u-button> 192 text="查看评价"></u-button>
193 <u-button @click="handleEvaluateDetail(orderId, userType)" 193 <u-button @click="handleEvaluateDetail(orderId, userType)"
194 v-if="dataGram.garEvaluateFlag === 1 && userType === '用户'" shape="square" color="#a9e08f" 194 v-if="dataGram.garEvaluateFlag === 1 && userType === '用户'" shape="square" color="#a9e08f"
garbage-removal/src/pages/order-info/order-other/detail/index.vue
@@ -220,10 +220,10 @@ @@ -220,10 +220,10 @@
220 v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#19a97c" 220 v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#19a97c"
221 text="去评价"></u-button> 221 text="去评价"></u-button>
222 <u-button @click="handleEvaluate(orderId, userType)" 222 <u-button @click="handleEvaluate(orderId, userType)"
223 - v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人'" shape="square" color="#19a97c"  
224 - text="去评价"></u-button> 223 + v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1" shape="square" color="#19a97c"
  224 + text="查看评价"></u-button>
225 <u-button @click="handleEvaluateDetail(orderId, userType)" 225 <u-button @click="handleEvaluateDetail(orderId, userType)"
226 - v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '运输企业负责人'" shape="square" color="#19a97c" 226 + v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1" shape="square" color="#19a97c"
227 text="查看评价"></u-button> 227 text="查看评价"></u-button>
228 <u-button @click="handleEvaluateDetail(orderId, userType)" 228 <u-button @click="handleEvaluateDetail(orderId, userType)"
229 v-if="dataGram.garEvaluateFlag === 1 && userType === '用户'" shape="square" color="#19a97c" 229 v-if="dataGram.garEvaluateFlag === 1 && userType === '用户'" shape="square" color="#19a97c"
garbage-removal/src/pages/order-info/order-other/evaluate-info/index.vue
1 <template> 1 <template>
2 <view class="page-evaluate"> 2 <view class="page-evaluate">
3 - <view class="evaluate-user-box"> 3 + <view class="evaluate-user-box" v-for="(data,key,index) in evaluteData" :index="index">
4 <view class="user-info-title"> 4 <view class="user-info-title">
5 <u-avatar :src="pic" size="70"></u-avatar> 5 <u-avatar :src="pic" size="70"></u-avatar>
6 - <view class="user-name">  
7 - 用户  
8 - </view> 6 + <view class="user-name" v-if="data.garEvaluateTarget == 0">用户</view>
  7 + <view class="user-name" v-else>运输企业负责人</view>
9 </view> 8 </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'"  
13 - :key="todo" color="#f9ae3d" size="28"></u-icon> 9 + <view class="evaluate-content">
  10 + <view class="evaluate-score" v-if="data.garEvaluateScore > -1">
  11 + <u-icon v-for="todo in maxStar" :name="data.garEvaluateScore > todo ? 'star-fill' : 'star'" :key="todo" color="#f9ae3d" size="28"></u-icon>
14 </view> 12 </view>
15 <view class="evaluate-txt"> 13 <view class="evaluate-txt">
16 - {{ evaluateUser.garEvaluateContent }} 14 + {{ data.garEvaluateContent }}
17 </view> 15 </view>
18 </view> 16 </view>
19 - <view class="evaluate-empty" v-else>  
20 - 暂无评价~~  
21 - </view> 17 +
22 </view> 18 </view>
23 <view class="evaluate-user-box"> 19 <view class="evaluate-user-box">
24 <view class="user-info-title"> 20 <view class="user-info-title">
25 <u-avatar :src="pic" size="70"></u-avatar> 21 <u-avatar :src="pic" size="70"></u-avatar>
26 - <view class="user-name">  
27 - 运输企业负责人  
28 - </view> 22 + <view class="user-name">{{userType}} </view>
29 </view> 23 </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> 24 +
  25 +
  26 + <view class='issue' style="margin-top: 15px;margin-bottom: 10px;">
  27 + <view class="issue-head">
  28 + <text class="issue-head-title">评价回复</text>
34 </view> 29 </view>
35 - <view class="evaluate-txt">  
36 - {{ evaluateManager.garEvaluateContent }} 30 + <u-textarea @blur="blur" :value="content" :placeholder="评价回复" style="height: 180rpx;margin-top: 15px;"></u-textarea>
  31 +
  32 + <view class="issue-btn-box" style="margin-top: 5px;margin-bottom: 10px;">
  33 + <button class="submit-btn" type="primary" @click="doSubmit(orderId, -1, 0)" v-if="userType ==='用户'">提交回复</button>
  34 + <button class="submit-btn" type="primary" @click="doSubmit(orderId, -1, 1)" v-else>提交回复</button>
37 </view> 35 </view>
38 </view> 36 </view>
39 - <view class="evaluate-empty" v-else>  
40 - 暂无评价~~  
41 - </view> 37 +
42 </view> 38 </view>
43 </view> 39 </view>
44 </template> 40 </template>
45 41
46 <script setup> 42 <script setup>
  43 +import { uploadEvaluate } from "@/apis/order.js";
47 import { queryEvaluateDetail } from "@/apis/evaluate"; 44 import { queryEvaluateDetail } from "@/apis/evaluate";
48 import headImg from "@/static/image/st_pic.png"; 45 import headImg from "@/static/image/st_pic.png";
49 import { onLoad } from '@dcloudio/uni-app'; 46 import { onLoad } from '@dcloudio/uni-app';
@@ -52,28 +49,44 @@ const pic = ref(headImg) @@ -52,28 +49,44 @@ const pic = ref(headImg)
52 // 定义最大积分 49 // 定义最大积分
53 let maxScore = 5 50 let maxScore = 5
54 const maxStar = ref([]) 51 const maxStar = ref([])
  52 +const content = ref("")
  53 +const orderId = ref()
  54 +const evaluteData=ref([])
  55 +const userType=ref()
55 56
56 -// 用户评价对象  
57 -const evaluateUser = ref()  
58 -// 运输企业负责人评价  
59 -const evaluateManager = ref()  
60 onLoad((options) => { 57 onLoad((options) => {
  58 + orderId.value = options.orderId;
  59 + userType.value = options.userType;
61 for (let index = 0; index < maxScore; index++) { 60 for (let index = 0; index < maxScore; index++) {
62 maxStar.value.push(index); 61 maxStar.value.push(index);
63 } 62 }
64 // 查询评价 63 // 查询评价
65 queryEvaluateDetail(options.orderId).then(res => { 64 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 - }); 65 + evaluteData.value=res.data.data;
  66 + console.log(evaluteData.value);
75 }) 67 })
76 }) 68 })
  69 +
  70 +
  71 +const doSubmit = (orderId, score, evaluateType) => {
  72 +
  73 + uploadEvaluate({ orderId, score,content: content.value, evaluateType }).then(res => {
  74 + if (res.data.success) {
  75 + uni.$u.toast("评价成功")
  76 + setTimeout(() => {
  77 + uni.$u.route({
  78 + type: "switchTab",
  79 + url: "pages/order/index"
  80 + })
  81 + }, 200);
  82 + }
  83 + })
  84 +}
  85 +
  86 +
  87 +const blur = (e) => {
  88 + content.value = e.detail.value
  89 +}
77 </script> 90 </script>
78 91
79 <style lang="scss" scoped> 92 <style lang="scss" scoped>
@@ -94,7 +107,6 @@ $page-padding: 20rpx; @@ -94,7 +107,6 @@ $page-padding: 20rpx;
94 border-radius: $page-padding; 107 border-radius: $page-padding;
95 border: 2rpx solid $u-border-color; 108 border: 2rpx solid $u-border-color;
96 margin: 40rpx 0; 109 margin: 40rpx 0;
97 - min-height: 300rpx;  
98 110
99 .user-info-title { 111 .user-info-title {
100 display: flex; 112 display: flex;
garbage-removal/src/pages/order/order-other/swiper-list-item/index.vue
@@ -51,12 +51,12 @@ @@ -51,12 +51,12 @@
51 </view> 51 </view>
52 <!-- 公司对用户评价 --> 52 <!-- 公司对用户评价 -->
53 <view class="bottom" 53 <view class="bottom"
54 - v-if="item.garHandlerEvaluateFlag === 0 && item.garOrderHandlerStatus === 3 && userType === '运输企业负责人'"> 54 + v-if="item.garHandlerEvaluateFlag === 0 && item.garOrderHandlerStatus === 3 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1">
55 <view class="more"> 55 <view class="more">
56 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> --> 56 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> -->
57 </view> 57 </view>
58 - <view hover-class="btn-hover" class="logistics btn" @click="handleUserEvaluate(item.garOrderId, userType)">  
59 - 去评价 58 + <view hover-class="btn-hover" class="logistics btn" @click="handleEvaluateDetail(item.garOrderId, userType)">
  59 + 查看评价
60 </view> 60 </view>
61 </view> 61 </view>
62 </view> 62 </view>
@@ -126,6 +126,11 @@ const handleClose = (e) =&gt; { @@ -126,6 +126,11 @@ const handleClose = (e) =&gt; {
126 cancelShow.value = false 126 cancelShow.value = false
127 } 127 }
128 128
  129 +const handleEvaluateDetail = (orderId, userType) => {
  130 + uni.$u.route(`pages/order-info/order-other/evaluate-info/index`,
  131 + { orderId: orderId, userType: userType })
  132 +}
  133 +
129 /** 134 /**
130 * 跳转公司详情 135 * 跳转公司详情
131 * @param {*} val 136 * @param {*} val
garbage-removal/src/pages/wode-info/wode-info-other-order/index.vue
@@ -51,12 +51,12 @@ @@ -51,12 +51,12 @@
51 </view> 51 </view>
52 <!-- 公司对用户评价 --> 52 <!-- 公司对用户评价 -->
53 <view class="bottom" 53 <view class="bottom"
54 - v-if="item.garHandlerEvaluateFlag === 0 && item.garOrderHandlerStatus === 3 && userType === '运输企业负责人'"> 54 + v-if="item.garHandlerEvaluateFlag === 0 && item.garOrderHandlerStatus === 3 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1">
55 <view class="more"> 55 <view class="more">
56 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> --> 56 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> -->
57 </view> 57 </view>
58 <view hover-class="btn-hover" class="logistics btn" @click="handleUserEvaluate(item.garOrderId, userType)"> 58 <view hover-class="btn-hover" class="logistics btn" @click="handleUserEvaluate(item.garOrderId, userType)">
59 - 评价 59 + 查看评价
60 </view> 60 </view>
61 </view> 61 </view>
62 </view> 62 </view>