From bc5d79cdd957fcee510d7a1cee07f6775af65596 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 03 三月 2026 10:04:46 +0800
Subject: [PATCH] 合并

---
 mini-program/pages/confirm-order/confirm-order.vue |   63 +++++++++++++++++++------------
 1 files changed, 39 insertions(+), 24 deletions(-)

diff --git a/mini-program/pages/confirm-order/confirm-order.vue b/mini-program/pages/confirm-order/confirm-order.vue
index 0b07b24..a32915c 100644
--- a/mini-program/pages/confirm-order/confirm-order.vue
+++ b/mini-program/pages/confirm-order/confirm-order.vue
@@ -96,16 +96,16 @@
 					<view class="info-item-label">杩愯垂</view>
 					<view class="info-item-price1">楼{{orderInfo.mailAmount}}</view>
 				</view>
-				<view class="info-item">
+				<view class="info-item" @click="show = true">
 					<view class="info-item-label">浼樻儬鍒�</view>
-					<view class="info-item-price1" @click="show = true">
+					<view class="info-item-price1">
 						-楼{{orderInfo.couponAmount}}
 						<image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
 					</view>
 				</view>
-				<view class="info-item">
+				<view class="info-item" @click="show1 = true">
 					<view class="info-item-label">绉垎鎶垫墸</view>
-					<view class="info-item-price1" @click="show1 = true">
+					<view class="info-item-price1">
 						-楼{{orderInfo.integralAmount}}
 						<image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
 					</view>
@@ -160,6 +160,7 @@
 					</view>
 				</scroll-view>
 				<view class="coupon-btn" @click="confirmCoupon">纭畾</view>
+				<view style="width: 100%; height: 30rpx;"></view>
 			</view>
 		</u-popup>
 		<!-- 绉垎 -->
@@ -178,6 +179,7 @@
 					</view>
 				</view>
 				<view class="coupon-btn" @click="confirmJF">纭畾</view>
+				<view style="width: 100%; height: 30rpx;"></view>
 			</view>
 		</u-popup>
 		<!-- 闂ㄥ簵 -->
@@ -268,6 +270,7 @@
 				isPosition: true,
 				lat: '',
 				lgt: '',
+				loading: false,
 			};
 		},
 		onLoad(option) {
@@ -283,6 +286,9 @@
 			uni.$on('city', (data) => {
 				this.cityName = data
 				this.getShopLists()
+			})
+			uni.$on('addressDele', (data) => {
+				this.getDefaultAddr()
 			})
 			this.getDefaultAddr()
 		},
@@ -398,6 +404,16 @@
 			// 鏀粯
 			payment() {
 				var that = this;
+				if (that.receiveType === 0 && !that.addr) return uni.showToast({
+					title: '璇烽�夋嫨鏀惰揣鍦板潃',
+					icon: 'none'
+				})
+				if (that.receiveType === 1 && !that.shopId) return uni.showToast({
+					title: '璇烽�夋嫨闂ㄥ簵',
+					icon: 'none'
+				})
+				if (this.loading) return;
+				this.loading = true
 				this.$u.api.orderPay({
 					addressId: this.addr ? this.addr.id : null,
 					couponId: this.couponId,
@@ -408,18 +424,14 @@
 					titlePrice: this.orderInfo.payAmount,
 					shopId: this.shopId ? this.shopId.id : null
 				}).then(res => {
+					this.loading = false
 					if (res.code === 200) {
 						// 绉垎鎶垫墸
 						if (res.data.payType === 1) {
-							// if (this.receiveType === 0) {
-								uni.redirectTo({
-									url: `/pagesA/pages/order-details/order-details?id=${res.data.orderId}&userType=0`
-								})
-							// } else {
-							// 	uni.reLaunch({
-							// 		url: `/pages/payment-successful/payment-successful?id=${res.data.orderId}&userType=0`
-							// 	})
-							// }
+							uni.$emit('shuaxin')
+							uni.redirectTo({
+								url: `/pagesA/pages/order-details/order-details?id=${res.data.orderId}&userType=0`
+							})
 						} else {
 							wx.requestPayment({
 								timeStamp: res.data.response.timeStamp,
@@ -428,19 +440,18 @@
 								signType: res.data.response.signType,
 								paySign: res.data.response.paySign,
 								success (pay) {
+									uni.$emit('shuaxin')
 									if (pay.errMsg === "requestPayment:ok") {
-										// if (that.receiveType === 0) {
-											uni.redirectTo({
-												url: `/pagesA/pages/order-details/order-details?id=${res.data.orderId}&userType=0`
-											})
-										// } else {
-										// 	uni.reLaunch({
-										// 		url: `/pages/payment-successful/payment-successful?id=${res.data.orderId}&userType=0`
-										// 	})
-										// }
-									} else {
-										uni.showToast({ title: '璁㈠崟鍙栨秷鏀粯', icon: 'none' })
+										uni.redirectTo({
+											url: `/pagesA/pages/order-details/order-details?id=${res.data.orderId}&userType=0`
+										})
 									}
+								},
+								fail (err) {
+									uni.$emit('shuaxin')
+									uni.navigateTo({
+										url: '/pagesA/pages/order/order?userType=0&status=1'
+									})
 								}
 							})
 						}
@@ -1041,6 +1052,10 @@
 				height: 144rpx;
 				display: flex;
 				align-items: center;
+				margin-bottom: 20rpx;
+				&:last-child {
+					margin: 0 !important;
+				}
 				.item-image {
 					flex-shrink: 0;
 					width: 144rpx;

--
Gitblit v1.9.3