lyb пре 4 година
родитељ
комит
b49596e0d5
5 измењених фајлова са 26 додато и 12 уклоњено
  1. 4 1
      pages.json
  2. 2 0
      pages/activity/activityDetail.vue
  3. 15 9
      pages/payResult/payResult.vue
  4. 2 0
      pages/shop/detail.vue
  5. 3 2
      store/index.js

+ 4 - 1
pages.json

@@ -267,7 +267,10 @@
             "style" :                                                                                    
             {
                 "navigationBarTitleText": "支付结果",
-                "enablePullDownRefresh": false
+                "enablePullDownRefresh": false,
+				"app-plus":{
+					"titleNView": false   // 去掉APP、H5的顶部导航
+				}
             }
             
         }

+ 2 - 0
pages/activity/activityDetail.vue

@@ -436,6 +436,8 @@
 				}
 				let res = await this.$api.order.cashExchange(params)
 				if (res.data.success) {
+					let url = encodeURIComponent(window.location.href);
+					this.$u.vuex('vuex_redirect_url', url);
 					console.log("支付订单",JSON.parse(res.data.data.prePayTn))
 					this.$shareConfig.H5Pay(JSON.parse(res.data.data.prePayTn)).then((res) => {
 						console.log("作品投票页面res", res)

+ 15 - 9
pages/payResult/payResult.vue

@@ -3,6 +3,7 @@
 		<u-icon name="checkmark-circle-fill" :color="vuex_theme.bgColor" style="margin-top: 50rpx;" size="100"></u-icon>
 		<view>订单支付成功</view>
 		<u-button  shape="circle" :custom-style="customStyle" style="margin-top: 50rpx;" @click="goback">返回</u-button>
+		<u-button  shape="circle" :custom-style="customStyle" style="margin-top: 50rpx;" @click="goback1">返回</u-button>
 	</view>
 </template>
 
@@ -36,15 +37,17 @@
 		
 		methods: {
 			goback() {
-				// let mchData = {
-				// 	action: 'jumpOut',
-				// 	jumpOutUrl: 'https://vote.guosen-fumao.cn/h5/#/pages/activity/activityDetail' //跳转的页面
-				// }				
-				// var postData = JSON.stringify(mchData);
-				// parent.postMessage(postData, 'https://payapp.weixin.qq.com')
-				uni.navigateBack({
-					delta: 1
-				})
+				let mchData = {
+					action: 'jumpOut',
+					jumpOutUrl: decodeURIComponent(this.vuex_redirect_url) //跳转的页面
+				}				
+				var postData = JSON.stringify(mchData);
+				parent.postMessage(postData, 'https://payapp.weixin.qq.com')
+			},
+			goback1() {
+				uni.redirectTo({
+				    url: decodeURIComponent(this.vuex_redirect_url)
+				});
 			}
 		}
 	}
@@ -55,6 +58,9 @@
 	display: flex;
 	flex-direction: column;
 	align-items: center;
+	justify-content: center;
 	background: #FFFFFF;
+	width: 100vw;
+	height: 100vh;
 }
 </style>

+ 2 - 0
pages/shop/detail.vue

@@ -338,6 +338,8 @@
 							// #endif
 							
 							// #ifdef H5
+							let url = encodeURIComponent(window.location.href);
+							this.$u.vuex('vuex_redirect_url', url);
 							console.log("支付订单",res.data.data)
 							this.$shareConfig.H5Pay(res.data.data).then((res) => {
 								console.log("商品兑换页面res", res)

+ 3 - 2
store/index.js

@@ -17,7 +17,7 @@ try {
 
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
 let saveStateKeys = ['vuex_audit', 'vuex_userId', 'vuex_phone', 'vuex_skin',
-	'vuex_theme', 'vuex_active_setting', 'vuex_isCMCC', 'vuex_gzh_userOpenid'
+	'vuex_theme', 'vuex_active_setting', 'vuex_isCMCC', 'vuex_gzh_userOpenid', 'vuex_redirect_url'
 ];
 
 // 保存变量到本地存储中
@@ -46,7 +46,8 @@ const store = new Vuex.Store({
 		vuex_theme: lifeData.vuex_theme ? lifeData.vuex_theme : config.themeRed.theme,
 		vuex_active_setting: lifeData.vuex_active_setting ? lifeData.vuex_active_setting : {},
 		vuex_isCMCC: lifeData.vuex_isCMCC ? lifeData.vuex_isCMCC : false,
-		vuex_gzh_userOpenid: lifeData.vuex_gzh_userOpenid ? lifeData.vuex_gzh_userOpenid : null
+		vuex_gzh_userOpenid: lifeData.vuex_gzh_userOpenid ? lifeData.vuex_gzh_userOpenid : null,
+		vuex_redirect_url: lifeData.vuex_redirect_url ? lifeData.vuex_redirect_url : null
 	},
 
 	mutations: {