Commit ba06273c3cea07c8cb7d26b53b6f421bcfdfb997
1 parent
96200802
feat: 修改评价逻辑。新增查看评价页面
Showing
7 changed files
with
175 additions
and
8 deletions
garbage-removal/src/apis/evaluate.js
0 → 100644
garbage-removal/src/pages.json
| @@ -42,6 +42,14 @@ | @@ -42,6 +42,14 @@ | ||
| 42 | "enablePullDownRefresh": false | 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 | "path": "pages/order/evaluate/index", | 53 | "path": "pages/order/evaluate/index", |
| 46 | "style": { | 54 | "style": { |
| 47 | "navigationBarTitleText": "写评价", | 55 | "navigationBarTitleText": "写评价", |
garbage-removal/src/pages/home/index.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="home-container"> | 2 | <view class="home-container"> |
| 3 | - | ||
| 4 | <view class="top-swiper-image-scroll"> | 3 | <view class="top-swiper-image-scroll"> |
| 5 | <u-swiper :list="swiperImageList" keyName="image" :autoplay="true" circular></u-swiper> | 4 | <u-swiper :list="swiperImageList" keyName="image" :autoplay="true" circular></u-swiper> |
| 6 | <view :style="{ | 5 | <view :style="{ |
garbage-removal/src/pages/order/detail/index.vue
| @@ -23,6 +23,7 @@ | @@ -23,6 +23,7 @@ | ||
| 23 | <!-- 派单信息 --> | 23 | <!-- 派单信息 --> |
| 24 | <view class="order-detail-container-box-card"> | 24 | <view class="order-detail-container-box-card"> |
| 25 | <view class="order-detail-container-header-card-title"> | 25 | <view class="order-detail-container-header-card-title"> |
| 26 | + <view class="order-detail-container-header-card-uicon"></view> | ||
| 26 | 派单信息 | 27 | 派单信息 |
| 27 | </view> | 28 | </view> |
| 28 | <view class="order-detail-container-header-item"> | 29 | <view class="order-detail-container-header-item"> |
| @@ -66,6 +67,7 @@ | @@ -66,6 +67,7 @@ | ||
| 66 | <!-- 派单记录 --> | 67 | <!-- 派单记录 --> |
| 67 | <view class="order-detail-container-box-card"> | 68 | <view class="order-detail-container-box-card"> |
| 68 | <view class="order-detail-container-header-card-title"> | 69 | <view class="order-detail-container-header-card-title"> |
| 70 | + <view class="order-detail-container-header-card-uicon"></view> | ||
| 69 | 派单人员 | 71 | 派单人员 |
| 70 | </view> | 72 | </view> |
| 71 | <!-- <view class="order-detail-container-header-item"> | 73 | <!-- <view class="order-detail-container-header-item"> |
| @@ -104,6 +106,7 @@ | @@ -104,6 +106,7 @@ | ||
| 104 | <!-- 处理信息 --> | 106 | <!-- 处理信息 --> |
| 105 | <view class="order-detail-container-box-card"> | 107 | <view class="order-detail-container-box-card"> |
| 106 | <view class="order-detail-container-header-card-title"> | 108 | <view class="order-detail-container-header-card-title"> |
| 109 | + <view class="order-detail-container-header-card-uicon"></view> | ||
| 107 | 处理信息 | 110 | 处理信息 |
| 108 | </view> | 111 | </view> |
| 109 | <view v-if="dataGram.garOrderHandlerId" style="width: 100%;"> | 112 | <view v-if="dataGram.garOrderHandlerId" style="width: 100%;"> |
| @@ -167,6 +170,9 @@ | @@ -167,6 +170,9 @@ | ||
| 167 | <u-button @click="handleEvaluate(orderId, userType)" | 170 | <u-button @click="handleEvaluate(orderId, userType)" |
| 168 | v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '管理负责人'" shape="circle" color="#a9e08f" | 171 | v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '管理负责人'" shape="circle" color="#a9e08f" |
| 169 | text="去评价"></u-button> | 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 | <u-button | 176 | <u-button |
| 171 | v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.putOnImages.length != 0 && dataGram.putDownImages.length != 0 && dataGram.garCancelFlag === 0" | 177 | v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.putOnImages.length != 0 && dataGram.putDownImages.length != 0 && dataGram.garCancelFlag === 0" |
| 172 | @click="handleSubmitSuccess(orderId)" shape="circle" color="#a9e08f" text="完成派单"></u-button> | 178 | @click="handleSubmitSuccess(orderId)" shape="circle" color="#a9e08f" text="完成派单"></u-button> |
| @@ -225,6 +231,10 @@ onLoad((options) => { | @@ -225,6 +231,10 @@ onLoad((options) => { | ||
| 225 | const handleClose = (e) => { | 231 | const handleClose = (e) => { |
| 226 | cancelShow.value = false | 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 | const selectClick = (index) => { | 238 | const selectClick = (index) => { |
| 229 | currentCancelName.value = index.name; | 239 | currentCancelName.value = index.name; |
| 230 | } | 240 | } |
| @@ -409,6 +419,15 @@ $custom-bottom-height: 200rpx; | @@ -409,6 +419,15 @@ $custom-bottom-height: 200rpx; | ||
| 409 | border-bottom: 3rpx solid $u-info-light; | 419 | border-bottom: 3rpx solid $u-info-light; |
| 410 | margin-bottom: $custom-marin-bottom; | 420 | margin-bottom: $custom-marin-bottom; |
| 411 | color: $u-primary; | 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 | .order-detail-container-header-item { | 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,6 +68,7 @@ | ||
| 68 | <script setup> | 68 | <script setup> |
| 69 | import { queryOrderList, updateOrder } from "@/apis/order.js"; | 69 | import { queryOrderList, updateOrder } from "@/apis/order.js"; |
| 70 | import { useMainStore } from '@/stores/index.js'; | 70 | import { useMainStore } from '@/stores/index.js'; |
| 71 | +import { onShow } from "@dcloudio/uni-app"; | ||
| 71 | import { computed, ref, watch } from 'vue'; | 72 | import { computed, ref, watch } from 'vue'; |
| 72 | const props = defineProps({ | 73 | const props = defineProps({ |
| 73 | tabIndex: { | 74 | tabIndex: { |
| @@ -178,6 +179,18 @@ const queryList = (pageNo, pageSize) => { | @@ -178,6 +179,18 @@ const queryList = (pageNo, pageSize) => { | ||
| 178 | paging.value.complete(false); | 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 | watch(() => props.currentIndex, (val1, val2) => { | 194 | watch(() => props.currentIndex, (val1, val2) => { |
| 182 | if (props.currentIndex == props.tabIndex) { | 195 | if (props.currentIndex == props.tabIndex) { |
| 183 | if (!firstLoaded.value) { | 196 | if (!firstLoaded.value) { |
garbage-removal/src/pages/wode/index.vue
| @@ -6,14 +6,7 @@ | @@ -6,14 +6,7 @@ | ||
| 6 | </view> | 6 | </view> |
| 7 | <view class="u-flex-1"> | 7 | <view class="u-flex-1"> |
| 8 | <view class="u-font-18 u-p-b-20">普通用户</view> | 8 | <view class="u-font-18 u-p-b-20">普通用户</view> |
| 9 | - <!-- <view class="u-font-14 u-tips-color"></view> --> | ||
| 10 | </view> | 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 | </view> | 10 | </view> |
| 18 | 11 | ||
| 19 | <view class="u-m-t-20"> | 12 | <view class="u-m-t-20"> |