From 4e3e18cdb0d75c098b68353ef8c86cdd7c0f79b2 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期四, 21 八月 2025 15:27:34 +0800
Subject: [PATCH] 111
---
small-program/pages/order-details/order-details.vue | 167 +++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 143 insertions(+), 24 deletions(-)
diff --git a/small-program/pages/order-details/order-details.vue b/small-program/pages/order-details/order-details.vue
index 2149440..f3f372d 100644
--- a/small-program/pages/order-details/order-details.vue
+++ b/small-program/pages/order-details/order-details.vue
@@ -163,17 +163,17 @@
</view>
</view>
</view>
- <view style="width: 100%; height: calc(108rpx + env(safe-area-inset-bottom));"></view>
- <view class="order-footer">
+ <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)">
<view class="order-footer-btn">
<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="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))">鍘绘敮浠�</view>
- <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)">淇敼璁㈠崟</view>
- <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.isUpdate==1 && info.status ===2)">淇敼纭</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" @click="show5 =true" v-if="userInfo.id === info.acceptMemberId && (info.isUpdate==1 && info.status ===2)">淇敼纭</view>
<view class="order-footer-btn-b" @click="show3 =true" v-if="userInfo.id === info.releaseMemberId && (info.status ===2)">寮�濮嬩綔涓�</view>
- <view class="order-footer-btn-b" v-if="userInfo.id !== info.releaseMemberId && (info.status ===1)">鎶㈠崟</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>
</view>
@@ -194,16 +194,47 @@
</u-modal>
<u-modal
title="娓╅Θ鎻愮ず"
- :show="show3"
+ :show="show4"
closeOnClickOverlay
showCancelButton
>
<view class="slot-content">
- 纭寮�濮嬩綔涓氬悧锛�
+ 纭鍙栨秷璁㈠崟鍚楋紵
</view>
<view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
- <view class="btn1" @click="show3 = false">鎴戝啀鎯虫兂</view>
- <view class="btn2" @click="beginDo">纭寮�濮�</view>
+ <view class="btn1" @click="show = false">鎴戝啀鎯虫兂</view>
+ <view class="btn2" @click="cancelDo">纭鍙栨秷</view>
+ </view>
+ </u-modal>
+ <u-modal
+ title="娓╅Θ鎻愮ず"
+ :show="show6"
+ closeOnClickOverlay
+ showCancelButton
+ >
+ <view class="slot-content">
+ 纭鎶㈠崟鍚楋紵
+ </view>
+ <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+ <view class="btn1" @click="show6 = false">鎴戝啀鎯虫兂</view>
+ <view class="btn2" @click="acceptDo">纭鎺ュ崟</view>
+ </view>
+ </u-modal>
+ <u-modal
+ title="娓╅Θ鎻愮ず"
+ :show="show5"
+ closeOnClickOverlay
+ showCancelButton
+ >
+ <view class="slot-content">
+ 鏄惁鍚屾剰璁㈠崟淇敼鍐呭锛�
+ </view>
+ <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+ <view class="btn1" @click="show5=false">鎴戝啀鎯虫兂</view>
+ <view style="width: 20rpx; height: 100%;"></view>
+ <view class="btn2" style="background-color: #f56c6c; color: #ffffff;" @click="confirmUpdDo(1)">涓嶅悓鎰�</view>
+ <view style="width: 20rpx; height: 100%;"></view>
+ <view class="btn2" @click="confirmUpdDo(0)">鍚屾剰</view>
</view>
</u-modal>
<!-- 鏀粯寮圭獥 -->
@@ -215,16 +246,16 @@
<image @click="show1 = false" src="/static/icon/ic_close@2x.png" mode="widthFix"></image>
</view>
<view class="zhifu-c">
- <view class="zhifu-c-info">
- 璇风‘璁ら噾棰濆苟鏀粯璐圭敤缁� <text>鑾茶姳鍔冲姟鍏徃</text>
+ <view class="zhifu-c-info" v-if="info.type !== 2">
+ 璇风‘璁ら噾棰濆苟鏀粯璐圭敤缁� <text>{{info.acceptName}}</text>
</view>
<view class="zhifu-c-info1">鏀粯閲戦锛�</view>
<view class="zhifu-c-input">
<image src="/static/icon/楼@2x.png" mode="widthFix"></image>
- <input type="number" placeholder="璇疯緭鍏�" />
+ <input type="number" v-model="amount" :disabled="info.type === 2" placeholder="璇疯緭鍏�" />
</view>
</view>
- <view class="zhifu-botton">纭鏀粯</view>
+ <view class="zhifu-botton" @click="payment">纭鏀粯</view>
</view>
</u-popup>
@@ -265,13 +296,17 @@
show2: false,
count: 5,
show3:false,
+ show4:false,
+ show5:false,
+ show6:false,
value:0,
wayList:[],
bgImg: require('@/static/image/bg_green@2x.png'),
id: null,
loading:false,
commentInfo:'',
- info: {},
+ info: {},
+ amount: ''
};
},
onLoad(options) {
@@ -281,6 +316,80 @@
this.getOrderData()
},
methods:{
+ // 淇敼
+ jumpEdit() {
+ if (this.info.type === 0 && this.info.workType === 0) {
+ uni.navigateTo({
+ url: `/pages/using-workers/using-workers?id=${this.info.id}`
+ })
+ } else if (this.info.type === 0 && this.info.workType === 1) {
+ uni.navigateTo({
+ url: `/pages/sorting/sorting?id=${this.info.id}`
+ })
+ } else if (this.info.type === 0 && this.info.workType === 2) {
+ uni.navigateTo({
+ url: `/pages/packaging-worker/packaging-worker?id=${this.info.id}`
+ })
+ } else if (this.info.type === 1) {
+ uni.navigateTo({
+ url: `/pages/freight/freight?id=${this.info.id}`
+ })
+ }
+ },
+ payment() {
+ var that = this
+ // 璁㈤
+ if (this.info.type === 2) {
+ this.$u.api.reusePay({
+ orderId: this.info.id
+ }).then(res => {
+ if (res.code === 200) {
+ wx.requestPayment({
+ timeStamp: res.data.object.timeStamp,
+ nonceStr: res.data.object.nonceStr,
+ package: res.data.object.packageVal,
+ signType: res.data.object.signType,
+ paySign: res.data.object.paySign,
+ success (res1) {
+ if (res1.errMsg = 'requestPayment:ok') {
+ that.show1 = false
+ uni.showToast({ title: '鏀粯鎴愬姛', icon: 'success', duration: 2000 });
+ that.getOrderData()
+ }
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+ }
+ })
+ } else {
+ this.$u.api.doneOrder({
+ orderId: this.info.id,
+ amount: Number(this.amount) * 100
+ }).then(res => {
+ if (res.code === 200) {
+ wx.requestPayment({
+ timeStamp: res.data.object.timeStamp,
+ nonceStr: res.data.object.nonceStr,
+ package: res.data.object.packageVal,
+ signType: res.data.object.signType,
+ paySign: res.data.object.paySign,
+ success (res1) {
+ if (res1.errMsg = 'requestPayment:ok') {
+ that.show1 = false
+ uni.showToast({ title: '鏀粯鎴愬姛', icon: 'success', duration: 2000 });
+ that.getOrderData()
+ }
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+ }
+ })
+ }
+ },
commentDo(){
var that = this
var param = { info: that.commentInfo,level:that.value||0,orderId: this.id}
@@ -303,14 +412,18 @@
}
})
},
- confirmUpdDo(){
+ confirmUpdDo(status){
var that = this
- var param = {orderId: this.id}
- this.$u.api.confirmUpdDo(param).then(res =>{
+ var param = {orderId: this.id,status:status}
+ this.$u.api.confirmUpd(param).then(res =>{
if(res.code ===200){
- that.show=false
- uni.showToast({ title: '鎿嶄綔鎴愬姛', icon: 'error', duration: 2000 });
- that.getOrderData()
+ that.show5=false
+ uni.showToast({ title: '纭鎴愬姛', icon: 'error', duration: 2000 });
+ if(status==1){
+ uni.navigateBack({ delta: 1 })
+ }else{
+ that.getOrderData()
+ }
}
})
},
@@ -319,7 +432,7 @@
var param = {orderId: this.id}
this.$u.api.accept(param).then(res =>{
if(res.code ===200){
- that.show=false
+ that.show6=false
uni.showToast({ title: '鎶㈠崟鎴愬姛', icon: 'error', duration: 2000 });
that.getOrderData()
}
@@ -333,6 +446,11 @@
that.show=false
uni.showToast({ title: '璁㈠崟鍙栨秷鎴愬姛', icon: 'error', duration: 2000 });
that.getOrderData()
+ if(that.userInfo.id !== that.info.releaseMemberId){
+ uni.navigateBack({ delta: 1 })
+ }else{
+ that.getOrderData()
+ }
}
})
},
@@ -390,6 +508,7 @@
if(res.code ===200){
if(that.userInfo.id === res.data.releaseMemberId || that.userInfo.id === res.data.acceptMemberId ){
that.info = res.data
+ that.amount = ((that.info.estimatedAccount || 0) / 100).toFixed(2)
if(that.info.wayInfo){
that.wayList = JSON.parse(that.info.wayInfo)
}
@@ -582,7 +701,7 @@
align-items: center;
justify-content: space-between;
.order-footer-btn-a {
- width: 334rpx;
+ flex: 1;
height: 88rpx;
line-height: 88rpx;
text-align: center;
@@ -593,7 +712,7 @@
border: 1rpx solid #B2B2B2;
}
.order-footer-btn-b {
- width: 334rpx;
+ flex: 1;
height: 88rpx;
line-height: 88rpx;
text-align: center;
--
Gitblit v1.9.3