Selaa lähdekoodia

Merge branch 'develop' of http://192.168.32.253:3000/Software/android-cloud-H5 into develop

wuyongxiang 2 vuotta sitten
vanhempi
commit
2538c6f5f5
3 muutettua tiedostoa jossa 89 lisäystä ja 73 poistoa
  1. 11 15
      pages/activity/lottery/index.vue
  2. 39 31
      static/screenAndroid/timer.js
  3. 39 27
      static/screenIos/timer.js

+ 11 - 15
pages/activity/lottery/index.vue

@@ -550,14 +550,6 @@ export default {
             actualPrice: this.actualPrice,
           });
         } else if (this.$userAgent.isMiniProgram) {
-          if (this.payType === 'aliPay') {
-            Toast({
-              message: '微信小程序不支持支付宝支付',
-              position: 'top',
-              duration: 4000,
-            });
-            return false;
-          }
           this.$wx.miniProgram.navigateTo({
             url:
               '/packageA/order/status/index?record=' +
@@ -661,13 +653,17 @@ export default {
             this.makePoint('activity_9.9年卡');
           localStorage.setItem('year-9-9', 1);
         }
-        this.mealId = res.data.mealId;
-        this.selMealId = res.data.mealId;
-        this.getMealInfo();
-        this.paySupportType = res.data.paySupportType;
-        this.payType = this.paySupportType[0];
-        this.phoneType = res.data.phoneType;
-        this.title = res.data.title;
+
+        this.mealId = res.data.mealId
+        this.selMealId = res.data.mealId
+        this.getMealInfo()
+        this.paySupportType = res.data.paySupportType
+        if (this.$userAgent.isMiniProgram) {
+          this.paySupportType = ['wxPay']
+        }
+        this.payType = this.paySupportType[0]
+        this.phoneType = res.data.phoneType
+        this.title = res.data.title
         this.prizeIndex = res.data.luckDrawType;
       } else {
         Toast({

+ 39 - 31
static/screenAndroid/timer.js

@@ -1,35 +1,41 @@
 function handleQuit() {
-  $.actions({
-    actions: [{
-      text: "退出",
-      onClick: function () {
-        decodeWoker.postMessage('close');
-        decodeWoker.terminate();
-        quit();
-      }
-    }, {
-      text: "退出并下机",
-      onClick: function () {
-        $.ajax({
-          url: baseUrl + '/api/resources/yearMember/downline?userCardId=' + userCardId,
-          headers: {
-            Authorization: token
-          },
-          type: 'get',
-          dataType: 'json',
-          function(res) {
-            if (res.status === 0) {
-              decodeWoker.postMessage('close');
-              decodeWoker.terminate();
-              quit();
-            } else {
-              $.toast(res.msg, 'text');
-            }
-          },
-        });
-      }
-    }]
-  });
+  if (sourceType === 5) {
+    $.actions({
+      actions: [{
+        text: "退出",
+        onClick: function () {
+          ws.close();
+          wsss.close();
+          quit();
+        }
+      }, {
+        text: "退出并下机",
+        onClick: function () {
+          $.ajax({
+            url: baseUrl + '/api/resources/yearMember/downline?userCardId=' + userCardId,
+            headers: {
+              Authorization: token
+            },
+            type: 'get',
+            dataType: 'json',
+            function(res) {
+              if (res.status === 0) {
+                ws.close();
+                wsss.close();
+                quit();
+              } else {
+                $.toast(res.msg, 'text');
+              }
+            },
+          });
+        }
+      }]
+    });
+  } else {
+    ws.close();
+    wsss.close();
+    quit();
+  }
 }
 var residueTime = 0, residueTimer, isShowCountdown = +parameters['isShowCountdown'], isShowRule = +parameters['isShowRule'];
 if (isShowCountdown) {
@@ -56,6 +62,8 @@ if (sourceType === 5) {
             $('.count').text(residueTimeStamp(residueTime))
           } else {
             clearInterval(residueTimer);
+            ws.close();
+            wsss.close();
             quit();
           }
         }, 1000);

+ 39 - 27
static/screenIos/timer.js

@@ -1,31 +1,41 @@
 function handleQuit() {
-  $.actions({
-    actions: [{
-      text: "退出",
-      onClick: function () {
-        quit();
-      }
-    }, {
-      text: "退出并下机",
-      onClick: function () {
-        $.ajax({
-          url: baseUrl + '/api/resources/yearMember/downline?userCardId=' + userCardId,
-          headers: {
-            Authorization: token
-          },
-          type: 'get',
-          dataType: 'json',
-          function(res) {
-            if (res.status === 0) {
-              quit();
-            } else {
-              $.toast(res.msg, 'text');
-            }
-          },
-        });
-      }
-    }]
-  });
+  if (sourceType === 5) {
+    $.actions({
+      actions: [{
+        text: "退出",
+        onClick: function () {
+          decodeWoker.postMessage('close');
+          decodeWoker.terminate();
+          quit();
+        }
+      }, {
+        text: "退出并下机",
+        onClick: function () {
+          $.ajax({
+            url: baseUrl + '/api/resources/yearMember/downline?userCardId=' + userCardId,
+            headers: {
+              Authorization: token
+            },
+            type: 'get',
+            dataType: 'json',
+            function(res) {
+              if (res.status === 0) {
+                decodeWoker.postMessage('close');
+                decodeWoker.terminate();
+                quit();
+              } else {
+                $.toast(res.msg, 'text');
+              }
+            },
+          });
+        }
+      }]
+    });
+  } else {
+    decodeWoker.postMessage('close');
+    decodeWoker.terminate();
+    quit();
+  }
 }
 var residueTime = 0, residueTimer, isShowCountdown = +parameters['isShowCountdown'], isShowRule = +parameters['isShowRule'];
 if (isShowCountdown) {
@@ -52,6 +62,8 @@ if (sourceType === 5) {
             $('.count').text(residueTimeStamp(residueTime))
           } else {
             clearInterval(residueTimer);
+            decodeWoker.postMessage('close');
+            decodeWoker.terminate();
             quit();
           }
         }, 1000);