From 4359b8c30f16ec165a3d9a8da5c11c9581e61740 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期一, 01 九月 2025 19:32:38 +0800
Subject: [PATCH] 前端
---
small-program/pages/order-details/order-details.vue | 123 ++++++++++++++++++++++++++++++----------
1 files changed, 92 insertions(+), 31 deletions(-)
diff --git a/small-program/pages/order-details/order-details.vue b/small-program/pages/order-details/order-details.vue
index a6a75f6..26843f6 100644
--- a/small-program/pages/order-details/order-details.vue
+++ b/small-program/pages/order-details/order-details.vue
@@ -4,15 +4,18 @@
宸插彇娑�
</view> -->
<view class="order-head" :style="{ backgroundImage: 'url(' + bgImg + ')' }">
- <view class="order-head-status">{{info.statusName || ''}}</view>
- <view class="order-head-info">{{getStatusInfo()}}</view>
+ <view class="order-head-status">{{info.statusName || ''}}</view>
+ <view class="order-head-info" v-if="userInfo.id === info.acceptMemberId && info.isUpdate ==1" style="color: red;">
+ 璁㈠崟淇℃伅宸蹭慨鏀癸紝璇峰強鏃剁‘璁わ紝{{timeInfo}}鍚庡皢鑷姩鍚屾剰
+ </view>
+ <view class="order-head-info" v-else >{{getStatusInfo()}}</view>
</view>
- <view class="order-quxiao" v-if="userInfo.useIdentity != 0">
+ <view class="order-quxiao">
<view class="order-quxiao-btn" @click="show = true" v-if="userInfo.id === info.acceptMemberId && info.status ===2">鍙栨秷璁㈠崟</view>
- <view class="order-quxiao-btn" @click="show = true" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)">鍙栨秷璁㈠崟</view>
- <view class="order-quxiao-btn1" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)" @click="jumpEdit()">淇敼璁㈠崟</view>
+ <view class="order-quxiao-btn" @click="show = true" v-if="userInfo.id === info.releaseMemberId && info.isUpdate!=1 && info.status ===2">鍙栨秷璁㈠崟</view>
+ <view class="order-quxiao-btn1" v-if="userInfo.id === info.releaseMemberId && info.type!=2 && info.isUpdate!=1 && info.status ===2 " @click="jumpEdit()">淇敼璁㈠崟</view>
</view>
- <view class="order-user" v-if="userInfo.id === info.releaseMemberId && userInfo.useIdentity != 0">
+ <view class="order-user" v-if="userInfo.id === info.releaseMemberId && info.acceptMemberId">
<view class="order-user-info">
<view class="user-info-l">
<view class="user-info-l-image">
@@ -21,7 +24,7 @@
</view>
<view class="user-info-l-i">
<view class="user-info-l-i-top">
- <text>{{info.acceptName || '鍖垮悕'}}</text>
+ <text>{{info.acceptName || ''}}</text>
<view class="user-info-l-i-top-jdf">鎺ュ崟鏂�</view>
</view>
<view class="user-info-l-i-bottom">
@@ -31,7 +34,7 @@
</view>
<view class="user-info-l-i-bottom-item">
<text>鍗曟暟锛�</text>
- <text>{{info.publishNum || 0}}</text>
+ <text>{{info.receiveNum ? info.receiveNum : 0}}</text>
</view>
</view>
</view>
@@ -50,7 +53,7 @@
<text v-if="info.type===2">璁㈤鍗�</text>
</view>
- <view v-if="info.type===0" class="order-info-wz">{{info.categoryName || ''}}锝渰{info.priceNum1 || '' }}鏂�</view>
+ <view v-if="info.type===0" class="order-info-wz">{{info.categoryName || ''}}锝渰{info.priceNum1 || '' }}{{info.workType === 0?'鏂�':'浜�'}}</view>
<view v-if="info.type===1" class="order-info-wz">{{info.transportTypeName || ''}}{{' | '}}{{info.transportNum || '' }}{{info.transportUnit||''}}{{' | '}}闇�{{info.priceNum2 || '' }}杈�</view>
<view class="order-info-address">
<image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image>
@@ -98,8 +101,15 @@
</view>
<view class="price-row">
<view class="price-row-label">棰勪及鎬昏垂鐢�(鍏�)</view>
- <view class="price-row-val" style="color: #FF0000;">
+ <view class="price-row-val" :style="{color: userInfo.id !== info.acceptMemberId ? '#FF0000' : ''}">
楼{{((info.estimatedAccount||0)/100).toFixed(2) }}
+ </view>
+ </view>
+
+ <view class="price-row" v-if="userInfo.id === info.acceptMemberId">
+ <view class="price-row-label">瀹為檯鍒拌处(鍏�)</view>
+ <view class="price-row-val" style="color: #FF0000;">
+ 楼{{((info.estimatedAccount * (1 - (info.platformRata || 0))) / 100).toFixed(2) }}
</view>
</view>
</view>
@@ -108,7 +118,7 @@
<view class="order-info-title">
<text>璇勪环</text>
</view>
- <u-rate :count="count" activeColor="#FFC331" size="26" v-model="info.commentLevel"></u-rate>
+ <u-rate :count="count" readonly activeColor="#FFC331" size="26" v-model="info.commentLevel"></u-rate>
<view class="order-info-remark">
{{ info.commentInfo || '-'}}
</view>
@@ -119,7 +129,7 @@
<image v-if="info.releaseCoverImage" :src="info.releaseCoverImage" mode="widthFix"></image>
<image v-else src="/static/icon/img@2x.png" mode="widthFix"></image>
</view>
- <text>{{info.releaseName || '鍖垮悕'}}</text>
+ <text>{{info.releaseName || ''}}</text>
<view class="order-ren-left-tip">涓氫富</view>
</view>
<view class="order-ren-x"></view>
@@ -169,17 +179,20 @@
</view>
<view style="width: 100%; height: calc(108rpx + env(safe-area-inset-bottom));" v-if="![99].includes(info.status)"></view>
<view class="order-footer" v-if="![99].includes(info.status)">
- <template v-if="(userInfo.id === info.releaseMemberId) && info.status ===2">
+ <template v-if="(userInfo.id === info.releaseMemberId) && info.isUpdate!=1 &&info.status ===2">
<sunui-mverify hint="寮�濮嬩綔涓�" @change="getaccept($event)"></sunui-mverify>
</template>
<view class="order-footer-btn" v-else>
- <view class="order-footer-btn-a" @click="show = true" v-if="userInfo.id === info.acceptMemberId && info.status ===2">鍙栨秷璁㈠崟</view>
+ <view class="order-footer-btn-a" @click="show = true" v-if="1==2&& userInfo.id === info.acceptMemberId && info.status ===2">鍙栨秷璁㈠崟</view>
<view class="order-footer-btn-a" @click="show = true" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)">鍙栨秷璁㈠崟</view>
<view class="order-footer-btn-b" @click="show2=true" v-if="userInfo.id === info.releaseMemberId && (info.status ===4 && info.commentStatus!=1)">鍘昏瘎浠�</view>
- <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId &&((info.status ===3 && info.type !==2)|| (info.status ===0 && info.type===2))" @click="show1 = true">瀹屾垚骞舵敮浠�</view>
- <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)" @click="jumpEdit()">淇敼璁㈠崟</view>
+ <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId &&((info.status ===3 && info.type !==2)|| (info.status ===0 && info.type===2))" @click="show1 = true">{{info.type === 2 ? '缁х画鏀粯' : '瀹屾垚骞舵敮浠�'}}</view>
+
+ <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && ((info.status ===3 && info.type===2))" @click="payment1">瀹屾垚浣滀笟</view>
+
+ <view class="order-footer-btn-b" v-if="info.type !=2 && info.isUpdate!=1&& userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)" @click="jumpEdit()">淇敼璁㈠崟</view>
<view class="order-footer-btn-b" @click="show5 =true" v-if="userInfo.id === info.acceptMemberId && (info.isUpdate==1 && info.status ===2)">淇敼纭</view>
- <view class="order-footer-btn-b" @click="startJobs()" v-if="userInfo.id === info.releaseMemberId && (info.status ===2)">寮�濮嬩綔涓�</view>
+ <!-- <view class="order-footer-btn-b" @click="startJobs()" v-if="userInfo.id === info.releaseMemberId && (info.status ===2)">寮�濮嬩綔涓�</view> -->
<view class="order-footer-btn-b" @click="show6 =true" v-if="userInfo.id !== info.releaseMemberId && (info.status ===1)">鎶㈠崟</view>
</view>
<view style="width: 100%; height: env(safe-area-inset-bottom);"></view>
@@ -258,7 +271,7 @@
</view>
<view class="zhifu-c-info1">鏀粯閲戦锛�</view>
<view class="zhifu-c-input">
- <image src="/static/icon/楼@2x.png" mode="widthFix"></image>
+ <image src="/static/icon/ic_money@2x.png" mode="widthFix"></image>
<input type="number" v-model="amount" :disabled="info.type === 2" placeholder="璇疯緭鍏�" />
</view>
</view>
@@ -304,9 +317,12 @@
show2: false,
count: 5,
show3:false,
+ timer:null,
show4:false,
show5:false,
show6:false,
+ timeInfo:'00:00:00',
+ lessTime:null,
value:0,
wayList:[],
bgImg: require('@/static/image/bg_green@2x.png'),
@@ -320,7 +336,9 @@
onLoad(options) {
console.log(options)
var id = options.id
- this.id = id
+ this.id = id
+ },
+ onShow(options) {
this.getOrderData()
},
methods:{
@@ -361,6 +379,16 @@
url: `/pages/freight/freight?id=${this.info.id}`
})
}
+ },
+ payment1() {
+ var that = this
+ this.$u.api.doneOrder({
+ orderId: this.info.id
+ }).then(res => {
+ if (res.code === 200) {
+ that.getOrderData()
+ }
+ })
},
payment() {
var that = this
@@ -466,18 +494,27 @@
},
cancelDo(){
var that = this
- var param ={ orderId:that.id}
- this.$u.api.cancelOrder(param).then(res =>{
- if(res.code ===200){
- that.show=false
- uni.showToast({ title: '璁㈠崟鍙栨秷鎴愬姛', icon: 'error', duration: 2000 });
- if(that.userInfo.id !== that.info.releaseMemberId){
- uni.navigateBack({ delta: 1 })
- }else{
- that.getOrderData()
- }
+ uni.requestSubscribeMessage({
+ tmplIds: ['AA97cHjvlPiNO4viMkVe4JifCf9TD5b5Eb7s6El3VS8'],
+ success(res) {
+ var param ={ orderId:that.id}
+ that.$u.api.cancelOrder(param).then(res =>{
+ if(res.code ===200){
+ that.show=false
+ uni.showToast({ title: '璁㈠崟鍙栨秷鎴愬姛', icon: 'error', duration: 2000 });
+ if(that.userInfo.id !== that.info.releaseMemberId){
+ uni.navigateBack({ delta: 1 })
+ }else{
+ that.getOrderData()
+ }
+ }
+ })
+ },
+ fail(err) {
+ console.log(err)
}
- })
+ })
+
},
previemImg(src){
uni.previewImage({
@@ -501,6 +538,9 @@
}else if(this.info.status === 1){
return ''
}else if(this.info.status === 2){
+ if(this.info.isUpdate==1){
+ return ''
+ }
return '鎮ㄥ凡鎺ュ崟锛岃鎸夋椂瀹屾垚璁㈠崟浠诲姟'
}else if(this.info.status === 3){
return '璁㈠崟杩涜涓紝璇锋寜鏃跺畬鎴愯鍗曚换鍔�'
@@ -516,7 +556,10 @@
}else if(this.info.status === 1){
return '鎮ㄨ鍗曞凡缁忔垚鍔熷彂璧凤紝璇疯�愬績绛夊緟鎺ュ崟'
}else if(this.info.status === 2){
- return '璁㈠崟寮�濮嬩綔涓氬悗锛岃鎷栧姩涓嬫柟鈥滃紑濮嬩綔涓氣�濇寜'
+ if(this.info.isUpdate==1){
+ return '璁㈠崟宸蹭慨鏀癸紝璇风瓑寰呮帴鍗曟柟纭'
+ }
+ return '璁㈠崟宸叉帴鍗曪紝璇锋嫋鍔ㄤ笅鏂光�滃紑濮嬩綔涓氣�濇寜閽�'
}else if(this.info.status === 3){
return this.info.type!=2?'璁㈠崟瀹屾垚鍚庤鐐瑰嚮涓嬫柟鈥滃畬鎴愬苟鏀粯鈥濇寜閽�':'璁㈠崟姝e湪杩涜涓�'
}else if(this.info.status === 4){
@@ -525,6 +568,21 @@
return '璁㈠崟宸插彇娑�'
}
}
+ },
+ updateTimeInfo(){
+ if(this.timer){
+ clearInterval(this.timer)
+ }
+ var that =this
+ this.lessTime = Math.floor( Number(that.info.confirmCountdown || 0)/1000) ;
+ this.timer = setInterval(function(){
+ let h = Math.floor(that.lessTime/60/60) ;
+ let m = Math.floor((that.lessTime - h*60*60)/60);
+ let s= Math.floor(that.lessTime- h*60*60 -m*60);
+ that.timeInfo =(h<10?'0':'')+ h+":"+(m<10?'0':'')+m+":"+(s<10?'0':'')+s;
+ that.lessTime =that.lessTime-1;
+ // console.log( that.timeInfo)
+ },1000)
},
getOrderData(){
var that = this
@@ -537,6 +595,9 @@
if(that.info.wayInfo){
that.wayList = JSON.parse(that.info.wayInfo)
}
+ if(res.data.isUpdate == 1){
+ that.updateTimeInfo()
+ }
}else{
uni.showToast({ title: '璁㈠崟淇℃伅涓嶅瓨鍦�', icon: 'error', duration: 2000 });
}
--
Gitblit v1.9.3