From bb4b49f9045c92ad90c38943891663821aedaabd Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期一, 14 十月 2024 14:54:07 +0800
Subject: [PATCH] update

---
 environments/index.js                   |    4 +-
 manifest.json                           |    2 
 sub_pages/customer/shopping/confirm.vue |   74 +++++++++++++++++++-----------------
 store/index.js                          |    3 +
 4 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/environments/index.js b/environments/index.js
index a6f20e1..c8a5cf9 100644
--- a/environments/index.js
+++ b/environments/index.js
@@ -1,7 +1,7 @@
 export default {
 	
-	// httpBaseUri: 'https://www.hmyxianhua.com/flower',
-	httpBaseUri: 'http://47.99.58.211/flower',
+	httpBaseUri: 'https://www.hmyxianhua.com/flower',
+	// httpBaseUri: 'http://47.99.58.211/flower',
 	// httpBaseUri: 'http://localhost:8080/flower',
 	clientId: '',
 	secret: '',
diff --git a/manifest.json b/manifest.json
index bc72d1d..bdb4255 100644
--- a/manifest.json
+++ b/manifest.json
@@ -49,7 +49,7 @@
     "quickapp" : {},
     /* 快应用特有相关 */
     "mp-weixin" : {
-        "appid" : "wx6d0ecc4e18710458",
+        "appid" : "wx1441324401626290",
         "setting" : {
             "urlCheck" : false,
             "es6" : true,
diff --git a/store/index.js b/store/index.js
index 74f075d..db2ae33 100644
--- a/store/index.js
+++ b/store/index.js
@@ -32,7 +32,8 @@
 			'delivery': 0,
 			'order': 0,
 			'shopnum': 0,
-			'coupon': 0
+			'coupon': 0,
+			'cache_topay':0,
 		},
 		cache: {
 			coupon: {},
diff --git a/sub_pages/customer/shopping/confirm.vue b/sub_pages/customer/shopping/confirm.vue
index 662ac88..570129d 100644
--- a/sub_pages/customer/shopping/confirm.vue
+++ b/sub_pages/customer/shopping/confirm.vue
@@ -69,40 +69,42 @@
 		async onShow() {
 			// 支付回调
 			// #ifdef PUB_CUSTOMER_DEV
-			let options = wx.getEnterOptionsSync();
-			if (options.scene == '1038' && options.referrerInfo.appId=='wxef277996acc166c3') {
-				// 代表从收银台小程序返回
-				let extraData = options.referrerInfo.extraData;
-				// if (!extraData) {
-				// 	// "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
-				// } else {
-				// 	if (extraData.code == 'success') {
-				// 		// "支付成功";
-				// 	} else if (extraData.code == 'cancel') {
-				// 		// "支付已取消";
-				// 		this.$message.showToast("支付已取消" + extraData.errmsg)
-				// 	} else {
-				// 		// "支付失败:" + extraData.errmsg;
-				// 		this.$message.showToast("支付失败:" + extraData.errmsg)
-				// 	}
-				// }
-				//
-				//只要是进入了这个支付页面,都算是支付了,不管成功与否都返回
-				console.log('pay success options.referrerInfo', options.referrerInfo)
-				//返回上一页
-				let tmp = this
-				await tmp.$store.dispatch('sign_add', 'shopping')
-				//清空优惠券
-				tmp.$store.dispatch('cache_coupon_select', {})
-				tmp.$store.dispatch('cache_goods_select', [])
-				
-				await tmp.$message.showToast('支付成功',{
-					duration:500
-				})
-				uni.navigateBack()
-				return
-			}
+			if (this.sign['cache_topay']) {
+				let options = wx.getEnterOptionsSync();
+				if (options.scene == '1038' && options.referrerInfo.appId == 'wxef277996acc166c3') {
+					// 代表从收银台小程序返回
+					let extraData = options.referrerInfo.extraData;
+					// if (!extraData) {
+					// 	// "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
+					// } else {
+					// 	if (extraData.code == 'success') {
+					// 		// "支付成功";
+					// 	} else if (extraData.code == 'cancel') {
+					// 		// "支付已取消";
+					// 		this.$message.showToast("支付已取消" + extraData.errmsg)
+					// 	} else {
+					// 		// "支付失败:" + extraData.errmsg;
+					// 		this.$message.showToast("支付失败:" + extraData.errmsg)
+					// 	}
+					// }
+					//
+					//只要是进入了这个支付页面,都算是支付了,不管成功与否都返回
+					console.log('pay success options.referrerInfo', options.referrerInfo)
+					//返回上一页
+					let tmp = this
+					await tmp.$store.dispatch('sign_add', 'shopping')
+					//清空优惠券
+					tmp.$store.dispatch('cache_coupon_select', {})
+					tmp.$store.dispatch('cache_goods_select', [])
 
+					// await tmp.$message.showToast('支付操作', {
+					// duration: 500
+					// })
+					uni.navigateBack()
+					await tmp.$store.dispatch('sign_clear', 'cache_topay')
+					return
+				}
+			}
 
 			// #endif
 			//优惠券
@@ -365,7 +367,7 @@
 									})
 									// #endif
 									// openEmbeddedMiniProgram,需要小程序基础库版本不低于 2.26.2
-									
+
 									// #ifdef PUB_CUSTOMER_DEV
 									var param = {
 										// cusid: "平台分配的商户号",
@@ -385,8 +387,10 @@
 										// sign: "签名,参考2.1",
 										...data,
 									}
+									await tmp.$store.dispatch('sign_add', 'cache_topay')
+
 									wx.openEmbeddedMiniProgram({
-										appId: 'wxef277996acc166c3',			
+										appId: 'wxef277996acc166c3',
 										extraData: param
 									})
 									// #endif

--
Gitblit v1.9.3