From 2b9cd0d9c50fae99402da7857addfe643fcbc6d8 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 23 四月 2026 20:05:42 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/gtzxinglijicun
---
small-program/pages/evaluate/evaluate.vue | 192 +++++++++++++++++++++++++++++++++++++++--------
1 files changed, 157 insertions(+), 35 deletions(-)
diff --git a/small-program/pages/evaluate/evaluate.vue b/small-program/pages/evaluate/evaluate.vue
index 3dc8bb9..f5d9049 100644
--- a/small-program/pages/evaluate/evaluate.vue
+++ b/small-program/pages/evaluate/evaluate.vue
@@ -4,20 +4,19 @@
<view class="rate-block">
<view class="title-row">
<text class="title-label">瀵勪欢闂ㄥ簵锛�</text>
- <text class="title-value">涓搧蹇繍鍗楃珯鏃楄埌搴�</text>
+ <text class="title-value">{{info.depositShopName||''}}</text>
</view>
<view class="star-row">
<view class="star-list">
- <!-- <view
+ <view
v-for="n in 5"
:key="'shop-' + n"
class="star-item"
- :class="{ active: n <= shopRate, dashed: n === 1 || n === 3 }"
- @tap="shopRate = n"
- >鈽�</view> -->
- <u-rate :count="count" activeColor="#FFC331" v-model="value"></u-rate>
+ :class="{ active: n < form.depositScore, dashed: n === 1 || n === 3 }"
+ @tap="form.depositScore = n+1"
+ >鈽�</view>
</view>
- <text class="rate-text">{{ shopRate }}鏄�</text>
+ <text class="rate-text">{{ form.depositScore }}鏄�</text>
</view>
</view>
@@ -26,67 +25,67 @@
<view class="rate-block">
<view class="title-row">
<text class="title-label">閰嶉�佸徃鏈猴細</text>
- <text class="title-value">寮犱紵</text>
+ <text class="title-value">{{info.driverName || ''}}</text>
</view>
- <view class="star-row no-text-row">
+ <view class="star-row">
<view class="star-list">
- <!-- <view
+ <view
v-for="n in 5"
:key="'driver-' + n"
class="star-item"
- :class="{ active: n <= driverRate, dashed: n === 1 }"
- @tap="driverRate = n"
- >鈽�</view> -->
- <u-rate :count="count" activeColor="#FFC331" v-model="value"></u-rate>
+ :class="{ active: n < form.driverScore, dashed: n === 1 }"
+ @tap=" form.driverScore = n+1"
+ >鈽�</view>
</view>
+ <text class="rate-text">{{ form.driverScore }}鏄�</text>
</view>
</view>
<view class="divider"></view>
- <view class="rate-block">
+ <view class="rate-block" v-if="info.type ===1 && info.takeShopId ">
<view class="title-row">
<text class="title-label">鏀朵欢闂ㄥ簵锛�</text>
- <text class="title-value">涓搧蹇繍鍚堣偉绔欐棗鑸板簵</text>
+ <text class="title-value">{{info.takeShopName || 0}}</text>
</view>
- <view class="star-row no-text-row">
+ <view class="star-row">
<view class="star-list">
- <!-- <view
+ <view
v-for="n in 5"
:key="'receive-' + n"
class="star-item"
- :class="{ active: n <= receiveRate, dashed: n === 1 }"
- @tap="receiveRate = n"
- >鈽�</view> -->
- <u-rate :count="count" activeColor="#FFC331" v-model="value"></u-rate>
+ :class="{ active: n < form.takeScore, dashed: n === 1 }"
+ @tap="form.takeScore = n+1"
+ >鈽�</view>
</view>
+ <text class="rate-text">{{ form.takeScore }}鏄�</text>
</view>
</view>
<view class="divider"></view>
<view class="upload-row">
- <view class="upload-box">
+ <view class="upload-box" @click="chooseAndUploadImage(9)">
<view class="upload-plus">+</view>
<text class="upload-text">涓婁紶鐓х墖</text>
</view>
<view v-for="(item, index) in photoList" :key="index" class="photo-box">
- <image class="photo-image" :src="item" mode="aspectFill"></image>
- <text class="photo-delete">鍒犻櫎</text>
+ <image class="photo-image" :src="item.url" mode="aspectFill"></image>
+ <text class="photo-delete" @click="deleteImage(index)">鍒犻櫎</text>
</view>
</view>
<view class="textarea-box">
<view class="textarea-placeholder-wrap">
<view class="textarea-icon"></view>
- <textarea v-model="content" class="textarea" maxlength="200" placeholder="璇疯璇存偍瀵规湰娆℃湇鍔$殑鎰熷彈" placeholder-class="textarea-placeholder"></textarea>
+ <textarea v-model="form.content" class="textarea" maxlength="200" placeholder="璇疯璇存偍瀵规湰娆℃湇鍔$殑鎰熷彈" placeholder-class="textarea-placeholder"></textarea>
</view>
- <text class="textarea-count">{{ content.length }}/200</text>
+ <text class="textarea-count">{{ form.content.length }}/200</text>
</view>
</view>
<view class="submit-wrap">
- <view class="submit-btn">鎻愪氦璇勪环</view>
+ <view class="submit-btn" @click="orderComment">鎻愪氦璇勪环</view>
</view>
</view>
</template>
@@ -95,16 +94,139 @@
export default {
data() {
return {
- shopRate: 2,
- driverRate: 0,
- receiveRate: 0,
- content: '',
+ id:null,
+ info:{},
+ form:{
+ content: "",
+ depositScore: 5,
+ driverScore: 5,
+ orderId: null,
+ takeScore: 5,
+ fileList:[]
+ },
photoList: [
'/static/icon/nav_home_sel@2x.png',
'/static/icon/nav_xingcheng_sel@2x.png'
- ],
- count: 5,
- value: 2
+ ]
+ }
+ },
+ onShow() {
+ this.info={}
+ this.getUserDetail()
+ },
+ onLoad(options) {
+ this.id = options.id
+ this.photoList=[]
+ this.form={
+ content: "",
+ depositScore: 5,
+ driverScore: 5,
+ orderId: this.id,
+ takeScore: 5,
+ images:[]
+ }
+ },
+ methods:{
+ deleteImage(index) {
+ this.photoList.splice(index, 1)
+ this.form.images.splice(index, 1)
+ },
+ async uploadFiles(filePaths, maxCount = 9) {
+ if (!filePaths || filePaths.length === 0) {
+ return []
+ }
+ const limitedPaths = filePaths.slice(0, maxCount)
+ const uploadTasks = limitedPaths.map(filePath => {
+ return new Promise((resolve, reject) => {
+ uni.uploadFile({
+ url: this.$baseUrl + '/web/public/upload',
+ filePath: filePath,
+ name: 'file',
+ formData: {
+ folder: 'orders'
+ },
+ success: (res) => {
+ if (res.statusCode === 200) {
+ const data = JSON.parse(res.data)
+ if (data.code === 200) {
+ resolve(data.data)
+ } else {
+ reject(new Error(data.msg || '涓婁紶澶辫触'))
+ }
+ } else {
+ reject(new Error('涓婁紶澶辫触'))
+ }
+ },
+ fail: (err) => {
+ reject(err)
+ }
+ })
+ })
+ })
+ try {
+ const results = await Promise.all(uploadTasks)
+ return results
+ } catch (error) {
+ uni.showToast({
+ title: '涓婁紶澶辫触',
+ icon: 'none'
+ })
+ throw error
+ }
+ },
+ async chooseAndUploadImage(maxCount = 9) {
+ const currentCount = this.form.images.length
+ const remainingCount = maxCount - currentCount
+ if (remainingCount <= 0) {
+ uni.showToast({
+ title: `鏈�澶氫笂浼�${maxCount}寮犲浘鐗嘸,
+ icon: 'none'
+ })
+ return
+ }
+ var that = this
+ uni.chooseImage({
+ count: remainingCount,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({
+ title: '涓婁紶涓�...',
+ mask: true
+ })
+ try {
+ const uploadResults = await that.uploadFiles(tempFilePaths, maxCount)
+ const fullPaths = uploadResults.map(item => item.url || item.path || item)
+ that.photoList = [...that.photoList, ...fullPaths.map(url => ({ url }))]
+ that.form.images = [...that.form.images, ...fullPaths]
+ uni.hideLoading()
+ uni.showToast({
+ title: '涓婁紶鎴愬姛',
+ icon: 'success'
+ })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ async orderComment(){
+ var that =this
+ let res = await that.$u.api.orderComment(this.form);
+ if (res.code === 200 ) {
+ this.info.commentStatus == 1
+ uni.$emit('updateOrder',{info:this.info,delete:0})
+ uni.navigateBack({delta:-1})
+ }
+ },
+ async getUserDetail(){
+ var that =this
+ let res = await this.$u.api.getOrderDetail( this.id )
+ if (res.code === 200) {
+ this.info = res.data
+ uni.$emit('updateOrder',{info:this.info,delete:0})
+ }
}
}
}
--
Gitblit v1.9.3