lihao 2 年 前
コミット
ddb9593006
共有1 個のファイルを変更した8 個の追加5 個の削除を含む
  1. 8 5
      static/screenIos/WXtrialInterface.html

+ 8 - 5
static/screenIos/WXtrialInterface.html

@@ -355,7 +355,8 @@
       userCardType = isNaN(parameters['userCardType']) ? userCardType : +parameters['userCardType'],
       disconnectionFlag = false,
       getDate = false;
-
+    
+    var flag = true
     // 计时套餐显示退出并下机按钮
     if ([1,2,3].includes(userCardType)) {
       $('#dormant').css({ display: 'block' })
@@ -1159,10 +1160,10 @@
         encodeURIComponent(cardToken),
       );
       window.webSocketWorker = webSocketWorker;
-      webSocketWorker.onopen = function() {
-        getResidueTime();
-      }
       webSocketWorker.onmessage = function (event) {
+        if(flag) {
+          getResidueTime();
+        }
         var input = event.data;
         if (input[0] == 0xff && isAudioPlay) {
           decodeAAC(input);
@@ -1420,7 +1421,9 @@
         type: 'get',
         dataType: 'json',
         contentType: 'application/json;charset=UTF-8',
-      }).then(function (res) { });
+      }).then(function (res) { 
+        flag = false
+      });
     }
 
     // 秒转化为时分秒