Commit 0e85c12544f42bea81fd2ede7997427310272aa0
1 parent
49211d9b
按需修改评价功能
Showing
5 changed files
with
66 additions
and
49 deletions
garbage-removal/src/pages/order-info/order-driver/detail/index.vue
| ... | ... | @@ -185,10 +185,10 @@ |
| 185 | 185 | v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#a9e08f" |
| 186 | 186 | text="去评价"></u-button> |
| 187 | 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 | 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 | 192 | text="查看评价"></u-button> |
| 193 | 193 | <u-button @click="handleEvaluateDetail(orderId, userType)" |
| 194 | 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 | 220 | v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#19a97c" |
| 221 | 221 | text="去评价"></u-button> |
| 222 | 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 | 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 | 227 | text="查看评价"></u-button> |
| 228 | 228 | <u-button @click="handleEvaluateDetail(orderId, userType)" |
| 229 | 229 | v-if="dataGram.garEvaluateFlag === 1 && userType === '用户'" shape="square" color="#19a97c" | ... | ... |
garbage-removal/src/pages/order-info/order-other/evaluate-info/index.vue
| 1 | 1 | <template> |
| 2 | 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 | 4 | <view class="user-info-title"> |
| 5 | 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 | 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 | 12 | </view> |
| 15 | 13 | <view class="evaluate-txt"> |
| 16 | - {{ evaluateUser.garEvaluateContent }} | |
| 14 | + {{ data.garEvaluateContent }} | |
| 17 | 15 | </view> |
| 18 | 16 | </view> |
| 19 | - <view class="evaluate-empty" v-else> | |
| 20 | - 暂无评价~~ | |
| 21 | - </view> | |
| 17 | + | |
| 22 | 18 | </view> |
| 23 | 19 | <view class="evaluate-user-box"> |
| 24 | 20 | <view class="user-info-title"> |
| 25 | 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 | 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 | 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 | 35 | </view> |
| 38 | 36 | </view> |
| 39 | - <view class="evaluate-empty" v-else> | |
| 40 | - 暂无评价~~ | |
| 41 | - </view> | |
| 37 | + | |
| 42 | 38 | </view> |
| 43 | 39 | </view> |
| 44 | 40 | </template> |
| 45 | 41 | |
| 46 | 42 | <script setup> |
| 43 | +import { uploadEvaluate } from "@/apis/order.js"; | |
| 47 | 44 | import { queryEvaluateDetail } from "@/apis/evaluate"; |
| 48 | 45 | import headImg from "@/static/image/st_pic.png"; |
| 49 | 46 | import { onLoad } from '@dcloudio/uni-app'; |
| ... | ... | @@ -52,28 +49,44 @@ const pic = ref(headImg) |
| 52 | 49 | // 定义最大积分 |
| 53 | 50 | let maxScore = 5 |
| 54 | 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 | 57 | onLoad((options) => { |
| 58 | + orderId.value = options.orderId; | |
| 59 | + userType.value = options.userType; | |
| 61 | 60 | for (let index = 0; index < maxScore; index++) { |
| 62 | 61 | maxStar.value.push(index); |
| 63 | 62 | } |
| 64 | 63 | // 查询评价 |
| 65 | 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 | 90 | </script> |
| 78 | 91 | |
| 79 | 92 | <style lang="scss" scoped> |
| ... | ... | @@ -94,7 +107,6 @@ $page-padding: 20rpx; |
| 94 | 107 | border-radius: $page-padding; |
| 95 | 108 | border: 2rpx solid $u-border-color; |
| 96 | 109 | margin: 40rpx 0; |
| 97 | - min-height: 300rpx; | |
| 98 | 110 | |
| 99 | 111 | .user-info-title { |
| 100 | 112 | display: flex; | ... | ... |
garbage-removal/src/pages/order/order-other/swiper-list-item/index.vue
| ... | ... | @@ -51,12 +51,12 @@ |
| 51 | 51 | </view> |
| 52 | 52 | <!-- 公司对用户评价 --> |
| 53 | 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 | 55 | <view class="more"> |
| 56 | 56 | <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> --> |
| 57 | 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 | 60 | </view> |
| 61 | 61 | </view> |
| 62 | 62 | </view> |
| ... | ... | @@ -126,6 +126,11 @@ const handleClose = (e) => { |
| 126 | 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 | 136 | * @param {*} val | ... | ... |
garbage-removal/src/pages/wode-info/wode-info-other-order/index.vue
| ... | ... | @@ -51,12 +51,12 @@ |
| 51 | 51 | </view> |
| 52 | 52 | <!-- 公司对用户评价 --> |
| 53 | 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 | 55 | <view class="more"> |
| 56 | 56 | <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> --> |
| 57 | 57 | </view> |
| 58 | 58 | <view hover-class="btn-hover" class="logistics btn" @click="handleUserEvaluate(item.garOrderId, userType)"> |
| 59 | - 去评价 | |
| 59 | + 查看评价 | |
| 60 | 60 | </view> |
| 61 | 61 | </view> |
| 62 | 62 | </view> | ... | ... |