huangxiaojing 2 年 前
コミット
1aa1b27773

+ 0 - 1
pages/activity/lottery/index.vue

@@ -16,7 +16,6 @@
         </div>
       </template>
     </RoundTurntable>
-    <div class="num">剩余机会{{num}}次</div>
     <van-popup v-model="showPay" closeable close-icon-position="top-right" round :close-on-click-overlay="false" @closed="closed">
       <div class="popup-view">
         <div class="txt1">恭喜你获得{{actualPrice}}年卡</div>

+ 3 - 0
static/screenAndroid/WXdraw.js

@@ -117,6 +117,9 @@ function doConnectDirectives() {
       // 当前云机无其他终端在线,获得控制权
       changIsControl(true);
     }
+    if (result.type === 'downAdnInstallRep') {
+      $.toast(result.data.msg, 'text', 4000);
+    }
     if (result.type === 'forwardMsg') {
       /**
        * @type {boolean} isControl 当前是否拥有控制权,初始化时为false

+ 21 - 19
static/screenAndroid/WXtrialInterface.html

@@ -96,7 +96,7 @@
       <audio preload="auto" autoplay controls poster="images/loader-thumb.jpg" id="audioPlayer"
         style="position: absolute; top: 0; width: 0; height: 0"></audio>
       <div class="count-view" id="countView">
-        <div class="fnca"><span class="count"></span><div class="line"></div><img class="wh22" src="../static/img/close.png" alt="" onclick="handleclose()"></div>  
+        <div class="fnca"><span class="countdown-time" style="color: #ffffff;"></span><div class="line"></div><img class="wh22" src="../static/img/close.png" alt="" onclick="handleclose()"></div>  
       </div>
     </div>
     <div class="leftmains">
@@ -162,7 +162,7 @@
         playsinline="true" x5-video-player-type="h5-page">
         您的浏览器不支持 video 标签。
       </video>
-      <div class="time-close-wrap"><span class="time-node"></span> 关闭</div>
+      <!-- <div class="time-close-wrap"><span class="time-node"></span> 关闭</div> -->
     </div>
   </div>
   <div class="buy-phone-wrap">
@@ -242,14 +242,9 @@
           <div class="apply-row-title">{{filename}}</div>
           <div class="apply-row-down">{{installNum}}</div>
         </div>
-        <div class="apply-down-btn" data-url="{{downloadUrl}}">下载</div>
+        <div class="apply-down-btn" data-id="{{id}}" data-url="{{downloadUrl}}">下载</div>
       </div>
     </script>
-    <img class="w100h130" src="../static/img/jishi-icon.png" alt="">
-    <div class="fs16">计费规则</div>
-    <div class="fs14">进入云机开始计时,下线停止计时<br />
-      云机时长剩余:<span class="count c00DB88"></span></div>
-      <div class="jishi-close-icon" onclick="handleCloseDialog()">我知道了</div>
   </div>
   <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
   <script src="https://lf1-cdn-tos.bytegoofy.com/goofy/developer/jssdk/jssdk-1.0.3.js"></script>
@@ -1350,8 +1345,7 @@
       var residueTimer = null;
       // 获取云机剩余时长
       function getResidueTime() {
-        let value = localStorage.getItem('isShowRecommend');
-        if(value) {
+        if (sourceType !== 5) {
           return
         }
         return $.ajax({
@@ -1365,16 +1359,16 @@
         }).then(function (res) {
           if (res.status === 0) {
             let time = res.data;
-            $('.countdown-wrap').eq(0).show();
             residueTimer = setInterval(() => {
-              time--;
-              if(time < 0) {
-                $('.apply-wrap').eq(0).hide();
-                $('.countdown-wrap').eq(0).hide();
-                $('.time-lang-wrap').eq(0).show();
+              if (time > 0) {
+                time--;
+                $('.countdown-time').text(residueTimeStamp(time));
+              } else {
+                clearInterval(residueTimer);
+                decodeWoker.postMessage('close');
+                decodeWoker.terminate();
+                quit();
               }
-              showTime = getResultTime(time);
-						  $('.countdown-time').eq(0).text(showTime);
             }, 1000)
           } else {
             return Promise.reject(new Error(res.msg));
@@ -1449,10 +1443,18 @@
 
       // 点击下载按钮
       $('.apply-wrap')[0].addEventListener('click',(e)=>{
+        let id = e.target.dataset.id;
         let downloadUrl = e.target.dataset.url;
         let className = e.target.className;
         if(className === 'apply-down-btn'){
-          window.location.href = downloadUrl;
+          var pings2 = {
+            type: 'downAndInstallApk',
+            data: {
+              apkUrl: downloadUrl,
+              taskUid: id
+            },
+          };
+          wsss.send(JSON.stringify(pings2));
         }
       })
 

+ 3 - 3
static/screenAndroid/css/WXtrialInterface.css

@@ -514,7 +514,7 @@ li {
   position: fixed;
   top: 0;
   left: 0;
-  z-index: 9999;
+  z-index: 99;
   background: rgba(0, 0, 0, 0.5);
   display: none;
 }
@@ -1001,7 +1001,7 @@ li {
   border-radius: 1px;
   opacity: 0.3;
 }
-.dialog-jifei {
+/* .dialog-jifei {
   width: 13.26rem;
   height: 13.17rem;
   background: #FFFFFF;
@@ -1010,7 +1010,7 @@ li {
   top: 8.15rem;
   left: calc(50% - 6.63rem);
   display: none;
-}
+} */
 .w100h130 {
   width: 4.52rem;
   display: block;

+ 6 - 4
static/screenAndroid/timer.js

@@ -39,7 +39,10 @@ function handleQuit() {
 }
 var residueTime = 0, residueTimer, isShowCountdown = +parameters['isShowCountdown'], isShowRule = +parameters['isShowRule'];
 if (isShowCountdown) {
-  $('#countView').show();
+  $('#countView').eq(0).show();
+}
+if (isShowRule) {
+  $('.countdown-wrap').eq(0).show();
 }
 if (sourceType === 5) {
   $.ajax({
@@ -110,6 +113,5 @@ function handleclose() {
     },
   });
 }
-function handleCloseDialog() {
-  $('.dialog-jifei').hide();
-}
+
+$.toast.prototype.defaults.duration = 4000

+ 3 - 0
static/screenIos/WXdraw.js

@@ -125,6 +125,9 @@ function doConnectDirectives() {
       // 当前云机无其他终端在线,获得控制权
       changIsControl(true);
     }
+    if (result.type === 'downAdnInstallRep') {
+      $.toast(result.data.msg, 'text', 4000);
+    }
     if (result.type === 'forwardMsg') {
       /**
        * @type {boolean} isControl 当前是否拥有控制权,初始化时为false

+ 21 - 19
static/screenIos/WXtrialInterface.html

@@ -89,7 +89,7 @@
         <canvas id="playCanvas" width="450" height="800"></canvas>
       </div>
       <div class="count-view" id="countView">
-        <div class="fnca"><span class="count"></span>
+        <div class="fnca"><span class="countdown-time" style="color: #ffffff;"></span>
           <div class="line"></div><img class="wh22" src="../static/img/close.png" alt="" onclick="handleclose()">
         </div>
       </div>
@@ -235,14 +235,9 @@
           <div class="apply-row-title">{{filename}}</div>
           <div class="apply-row-down">{{installNum}}</div>
         </div>
-        <div class="apply-down-btn" data-url="{{downloadUrl}}">下载</div>
+        <div class="apply-down-btn" data-id="{{id}}" data-url="{{downloadUrl}}">下载</div>
       </div>
     </script>
-    <img class="w100h130" src="../static/img/jishi-icon.png" alt="">
-    <div class="fs16">计费规则</div>
-    <div class="fs14">进入云机开始计时,下线停止计时<br />
-      云机时长剩余:<span class="count c00DB88"></span></div>
-    <div class="jishi-close-icon" onclick="handleCloseDialog()">我知道了</div>
   </div>
   <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
   <script src="https://lf1-cdn-tos.bytegoofy.com/goofy/developer/jssdk/jssdk-1.0.3.js"></script>
@@ -600,7 +595,7 @@
     }
 
     initAD();
-      getResidueTime();
+    getResidueTime();
     $.alert({
       title: '提示',
       text: '开始使用云手机',
@@ -1346,8 +1341,7 @@
       var residueTimer = null;
       // 获取云机剩余时长
       function getResidueTime() {
-        let value = localStorage.getItem('isShowRecommend');
-        if(value) {
+        if (sourceType !== 5) {
           return
         }
         return $.ajax({
@@ -1361,16 +1355,16 @@
         }).then(function (res) {
           if (res.status === 0) {
             let time = res.data;
-            $('.countdown-wrap').eq(0).show();
             residueTimer = setInterval(() => {
-              time--;
-              if(time < 0) {
-                $('.apply-wrap').eq(0).hide();
-                $('.countdown-wrap').eq(0).hide();
-                $('.time-lang-wrap').eq(0).show();
+              if (time > 0) {
+                time--;
+                $('.countdown-time').text(residueTimeStamp(time));
+              } else {
+                clearInterval(residueTimer);
+                decodeWoker.postMessage('close');
+                decodeWoker.terminate();
+                quit();
               }
-              showTime = getResultTime(time);
-						  $('.countdown-time').eq(0).text(showTime);
             }, 1000)
           } else {
             return Promise.reject(new Error(res.msg));
@@ -1445,10 +1439,18 @@
 
       // 点击下载按钮
       $('.apply-wrap')[0].addEventListener('click',(e)=>{
+        let id = e.target.dataset.id;
         let downloadUrl = e.target.dataset.url;
         let className = e.target.className;
         if(className === 'apply-down-btn'){
-          window.location.href = downloadUrl;
+          var pings2 = {
+            type: 'downAndInstallApk',
+            data: {
+              apkUrl: downloadUrl,
+              taskUid: id
+            },
+          };
+          wsss.send(JSON.stringify(pings2));
         }
       })
 

+ 3 - 3
static/screenIos/css/WXtrialInterface.css

@@ -526,7 +526,7 @@ textarea {
   position: fixed;
   top: 0;
   left: 0;
-  z-index: 9999;
+  z-index: 99;
   background: rgba(0, 0, 0, 0.5);
   display: none;
 }
@@ -927,7 +927,7 @@ textarea {
   border-radius: 1px;
   opacity: 0.3;
 }
-.dialog-jifei {
+/* .dialog-jifei {
   width: 13.26rem;
   height: 13.17rem;
   background: #FFFFFF;
@@ -936,7 +936,7 @@ textarea {
   top: 8.15rem;
   left: calc(50% - 6.63rem);
   display: none;
-}
+} */
 .w100h130 {
   width: 4.52rem;
   display: block;

+ 4 - 35
static/screenIos/timer.js

@@ -39,39 +39,10 @@ function handleQuit() {
 }
 var residueTime = 0, residueTimer, isShowCountdown = +parameters['isShowCountdown'], isShowRule = +parameters['isShowRule'];
 if (isShowCountdown) {
-  $('#countView').show();
+  $('#countView').eq(0).show();
 }
-if (sourceType === 5) {
-  $.ajax({
-    url: baseUrl + '/api/resources/yearMember/getResidueTime?userCardId=' + userCardId,
-    headers: {
-      Authorization: token,
-    },
-    type: 'get',
-    dataType: 'json',
-    async: false,
-    success: function (res) {
-      if (res.status === 0) {
-        residueTime = res.data;
-        if (residueTime > 0) {
-          $('.count').text(residueTimeStamp(residueTime))
-        }
-        residueTimer = setInterval(() => {
-          if (residueTime > 0) {
-            residueTime--;
-            $('.count').text(residueTimeStamp(residueTime))
-          } else {
-            clearInterval(residueTimer);
-            decodeWoker.postMessage('close');
-            decodeWoker.terminate();
-            quit();
-          }
-        }, 1000);
-      } else {
-        $.toast(res.msg, 'text');
-      }
-    },
-  });
+if (isShowRule) {
+  $('.countdown-wrap').eq(0).show();
 }
 function residueTimeStamp(value) {
   let theTime = value;//秒
@@ -110,6 +81,4 @@ function handleclose() {
     },
   });
 }
-function handleCloseDialog() {
-  $('.dialog-jifei').hide();
-}
+$.toast.prototype.defaults.duration = 4000