From 5790b0ab01d5afc174c56461d69a595b4635c1fa Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期六, 19 七月 2025 11:57:05 +0800
Subject: [PATCH] 调接口

---
 small-program/pages/order-details/order-details.vue |   94 ++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 85 insertions(+), 9 deletions(-)

diff --git a/small-program/pages/order-details/order-details.vue b/small-program/pages/order-details/order-details.vue
index 9c36d3b..db76e11 100644
--- a/small-program/pages/order-details/order-details.vue
+++ b/small-program/pages/order-details/order-details.vue
@@ -169,8 +169,8 @@
 				<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.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.releaseMemberId && (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"  @click="show4 =true" v-if="userInfo.id !== info.releaseMemberId && (info.status ===1)">鎶㈠崟</view>
@@ -244,16 +244,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>
 		
@@ -302,7 +302,8 @@
 				id: null,
 				loading:false,
 				commentInfo:'',
-				info: {}, 
+				info: {},
+				amount: ''
 			};
 		},
 		onLoad(options) {
@@ -312,6 +313,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}
@@ -421,6 +496,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)
 							}
@@ -613,7 +689,7 @@
 				align-items: center;
 				justify-content: space-between; 
 				.order-footer-btn-a {
-					width: 334rpx;
+					flex: 1;
 					height: 88rpx;
 					line-height: 88rpx;
 					text-align: center;
@@ -624,7 +700,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