shish 8 months ago
parent
commit
0d70c26ff1

+ 2 - 1
hdApp/src/pages.json

@@ -523,7 +523,8 @@
 				{ "path": "addCgConfirm","style": {"navigationBarTitleText": "确认订单", "enablePullDownRefresh": false } },
 				{ "path": "addCgConfirm","style": {"navigationBarTitleText": "确认订单", "enablePullDownRefresh": false } },
 				{ "path": "addCgResult","style": {"navigationBarTitleText": "结果", "enablePullDownRefresh": false } },
 				{ "path": "addCgResult","style": {"navigationBarTitleText": "结果", "enablePullDownRefresh": false } },
 				{ "path": "confirmTake","style": {"navigationBarTitleText": "确认收货", "enablePullDownRefresh": false } },
 				{ "path": "confirmTake","style": {"navigationBarTitleText": "确认收货", "enablePullDownRefresh": false } },
-				{ "path": "contact","style": {"navigationBarTitleText": "联系我们", "enablePullDownRefresh": false } }
+				{ "path": "contact","style": {"navigationBarTitleText": "联系我们", "enablePullDownRefresh": false } },
+				{ "path": "appPay","style": {"navigationBarTitleText": "支付", "enablePullDownRefresh": false } }
 			]
 			]
 		},
 		},
 		{
 		{

+ 27 - 0
hdApp/src/pagesPurchase/appPay.vue

@@ -0,0 +1,27 @@
+<template>
+	<view>
+		<web-view :src="payUrl" @message="getMessage"></web-view>
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				payUrl: ''
+			}
+		},
+		onLoad() {
+			// 从本地存储读取 payUrl
+			this.payUrl = uni.getStorageSync('tempPayUrl')
+            console.log(this.payUrl)
+		},
+        methods: {
+            getMessage(e){
+            },
+			init(){
+			}
+        }
+	}
+</script>
+<style>
+</style>

+ 5 - 3
hdApp/src/pagesPurchase/wechatPay.vue

@@ -187,8 +187,6 @@ export default {
     },
     },
     appAliPayFn(payWay){
     appAliPayFn(payWay){
       let that = this
       let that = this
-      // #ifdef MP-WEIXIN
-      // #endif
       // #ifdef APP-PLUS
       // #ifdef APP-PLUS
       uni.showLoading()
       uni.showLoading()
       let id = this.option.id ? this.option.id : 0   
       let id = this.option.id ? this.option.id : 0   
@@ -198,7 +196,11 @@ export default {
           if(res.data.payUrl){
           if(res.data.payUrl){
             that.orderSn = res.data.orderSn
             that.orderSn = res.data.orderSn
             that.needCheck = 1
             that.needCheck = 1
-            plus.runtime.openWeb(res.data.payUrl)
+            let payUrl = res.data.payUrl?res.data.payUrl:''
+            // 保存 payUrl 到本地存储
+            uni.setStorageSync('tempPayUrl', payUrl)
+            // 跳转到 appPay 页面
+            this.$util.pageTo({ url: '/pagesPurchase/appPay', type: 2 })
           }
           }
         }
         }
       })
       })