From 47d56a8b0f22fb15a46b69dfd46fac23560ad2cd Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 12 五月 2026 09:07:49 +0800
Subject: [PATCH] 改bug

---
 mini-program/pagesA/pages/order/order.vue |   66 +++++++++++++++++++++++++++------
 1 files changed, 54 insertions(+), 12 deletions(-)

diff --git a/mini-program/pagesA/pages/order/order.vue b/mini-program/pagesA/pages/order/order.vue
index 4c3c1b2..12164f3 100644
--- a/mini-program/pagesA/pages/order/order.vue
+++ b/mini-program/pagesA/pages/order/order.vue
@@ -178,7 +178,8 @@
 					{ name: '寰呮敮浠�', id: 0 ,index:1},
 					{ name: '寰呭彂璐�/鑷彁', id: 1,index:2 },
 					{ name: '寰呮敹璐�', id: 2 ,index:3},
-				]
+				],
+				loading: false
 			};
 		},
 		onLoad(options) {
@@ -278,8 +279,34 @@
 					this.currentOrder = item
 				}
 			},
-			
 			payOrder(item){
+				var that = this;
+				if (this.loading) return;
+				this.loading = true
+				this.$u.api.replayPay({
+					orderId: item.id
+				}).then(res => {
+					this.loading = false
+					if (res.code === 200) {
+						wx.requestPayment({
+							timeStamp: res.data.response.timeStamp,
+							nonceStr: res.data.response.nonceStr,
+							package: res.data.response.packageValue,
+							signType: res.data.response.signType,
+							paySign: res.data.response.paySign,
+							success (pay) {
+								if (pay.errMsg === "requestPayment:ok") {
+									that.getFirstPageData()
+								} else {
+									uni.showToast({ title: '璁㈠崟鍙栨秷鏀粯', icon: 'none' })
+								}
+							},
+							fail(err) {
+								console.log(err)
+							}
+						})
+					}
+				})
 			},
 			doneOrder(item){
 				this.currentOrder = null
@@ -292,16 +319,22 @@
 				if(this.userType == 1 || this.currentOrder==null || this.currentOrder.id == null) {
 					return
 				}
+				if (this.loading) return;
+				this.loading = true
 				var that =this
 				let res = await this.$u.api.affirmOrder({ orderId: this.currentOrder.id  });
-				if (res.code === 200 ) { 
+				this.loading = false
+				that.showDone = false
+				if (res.code === 200 ) {
+					that.getFirstPageData()
 					//淇敼璁㈠崟鐘舵��
-					this.dataList.forEach(item=>{
-						if(item.id==this.currentOrder.id){
-							item.status =3
-						}
-					}) 
-					this.doneOrder()
+					// this.dataList.forEach(item=>{
+					// 	if(item.id==this.currentOrder.id){
+					// 		item.status =3
+					// 	}
+					// }) 
+					// this.doneOrder()
+					this.showDone()
 				}else{
 					/* uni.showToast({
 						title:res.message||'纭畾鏀惰揣澶辫触锛�',
@@ -313,16 +346,21 @@
 				if(this.userType == 1 || this.currentOrder==null || this.currentOrder.id == null) {
 					return
 				}
+				if (this.loading) return;
+				this.loading = true
 					var that =this
 				let res = await that.$u.api.cancelOrder({ orderId: this.currentOrder.id  });
-				if (res.code === 200 ) { 
+				this.loading = false
+				this.showCancel = false
+				if (res.code === 200 ) {
 					//淇敼璁㈠崟鐘舵��
 					this.dataList.forEach(item=>{
 						if(item.id==this.currentOrder.id){
 							item.status = 4
 						}
 					}) 
-					this.cancelOrder()
+					// this.cancelOrder()
+					that.getFirstPageData()
 				}else{
 					/* uni.showToast({
 						title:res.message||'鍙栨秷璁㈠崟澶辫触锛�',
@@ -334,9 +372,13 @@
 				if(this.userType == 1 || this.currentOrder==null || this.currentOrder.id == null) {
 					return
 				}
+				if (this.loading) return;
+				this.loading = true
 				var that =this
 				let res = await that.$u.api.delOrder({ orderId: this.currentOrder.id  });
-				if (res.code === 200 ) { 
+				this.loading = false
+				this.showDelete = false
+				if (res.code === 200 ) {
 					//淇敼璁㈠崟鐘舵��
 					/* var tindex = -1;
 					this.dataList.forEach((item,index)=>{

--
Gitblit v1.9.3