| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | 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}) |
| | | } |
| | | } |
| | | } |
| | | } |