Kaynağa Gözat

9块9年卡对接ios-h5支付

huangxiaojing 2 yıl önce
ebeveyn
işleme
bc29e13f91
1 değiştirilmiş dosya ile 9 ekleme ve 9 silme
  1. 9 9
      pages/activity/lottery/index.vue

+ 9 - 9
pages/activity/lottery/index.vue

@@ -174,6 +174,7 @@ export default {
     this.getLuckDrawActivity()
     this.getMealInfo()
     this.getCarouselList()
+    console.log(this.$userAgent.isMobile);
   },
   methods: {
     async getCarouselList() {
@@ -210,15 +211,14 @@ export default {
             actualPrice: this.actualPrice
           });
         } else {
-          document.addEventListener('UniAppJSBridgeReady', () => {
-            // 使用postMessage 方法可以发送消息到应用, 消息内容需要在data 对象中,否则webview无法接收到
-            uni.postMessage({
-              data: {
-                payType: this.payType === 'aliPay' ? 3 : 2,
-                orderNum: res.data.myOrderNum,
-                buyType: 1
-              }
-            })
+          console.log(511);
+          // 使用postMessage 方法可以发送消息到应用, 消息内容需要在data 对象中,否则webview无法接收到
+          uni.postMessage({
+            data: {
+              payType: this.payType === 'aliPay' ? 3 : 2,
+              orderNum: res.data.myOrderNum,
+              buyType: 1
+            }
           })
         }
       } catch (error) {