huangxiaojing hace 2 años
padre
commit
6bdd7d71ec

+ 144 - 133
static/screenAndroid/WXtrialInterface.html

@@ -96,7 +96,9 @@
       <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="countdown-time" style="color: #ffffff;"></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 +164,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">
@@ -211,11 +213,7 @@
         <div class="apply-title">应用推荐</div>
         <div class="apply-list"></div>
         <div class="apply-list-change">换一批</div>
-        <img
-          class="apply-close"
-          src="img/close.png"
-          alt=""
-        />
+        <img class="apply-close" src="img/close.png" alt="" />
       </div>
     </div>
     <div class="time-lang-wrap">
@@ -289,7 +287,6 @@
       $('.loading_sceen_pic').attr('src', '../static/img/home_bg_PRO.png');
     }
     initAD();
-      getResidueTime();
     let dbName = parameters['username'],
       version = 1,
       storeName = 'usercard';
@@ -395,6 +392,13 @@
           onOK: function () {
             setTimeout(() => {
               isAudioPlay = true;
+              getResidueTime();
+              if (isShowCountdown) {
+                $('#countView').eq(0).show();
+              }
+              if (isShowRule) {
+                $('.countdown-wrap').eq(0).show();
+              }
             }, 1000);
           },
         });
@@ -407,6 +411,13 @@
           var video = document.getElementById('playerVideo');
           video.play();
           isAudioPlay = true;
+          getResidueTime();
+          if (isShowCountdown) {
+            $('#countView').eq(0).show();
+          }
+          if (isShowRule) {
+            $('.countdown-wrap').eq(0).show();
+          }
         },
       });
     }
@@ -592,6 +603,7 @@
       };
     }
     var intervaler;
+    var isShowCountdown = +parameters['isShowCountdown'], isShowRule = +parameters['isShowRule'];
     function doConnectBusiness() {
       ws = new WebSocket(socketURL);
       ws.binaryType = 'arraybuffer';
@@ -1338,140 +1350,139 @@
       });
     }
 
-      var residueTimer = null;
-      // 获取云机剩余时长
-      function getResidueTime() {
-        if (sourceType !== 5) {
-          return
-        }
-        return $.ajax({
-          url: baseUrl + `/api/resources/yearMember/getResidueTime?userCardId=${userCardId}`,
-          headers: {
-            Authorization: token,
-          },
-          type: 'get',
-          dataType: 'json',
-          contentType: 'application/json;charset=UTF-8',
-        }).then(function (res) {
-          if (res.status === 0) {
-            let time = res.data;
-            residueTimer = setInterval(() => {
-              if (time > 0) {
-                time--;
-                $('.countdown-time').text(residueTimeStamp(time)); 
-              } else {
-                clearInterval(residueTimer);
-                downline();
-              }
-            }, 1000)
-          } else {
-            return Promise.reject(new Error(res.msg));
-          }
-        });
+    var residueTimer = null;
+    // 获取云机剩余时长
+    function getResidueTime() {
+      if (sourceType !== 5) {
+        return
       }
-
-      // 秒转化为时分秒
-      function getResultTime(time) {
-        let theTime = parseInt(time);// 秒
-        let theTime1 = 0;// 分
-        let theTime2 = 0;// 小时
-        
-        if(theTime > 60) {
-        theTime1 = parseInt(theTime/60);
-        theTime = parseInt(theTime%60);
-        
-        if(theTime1 > 60) {
-        theTime2 = parseInt(theTime1/60);
-        theTime1 = parseInt(theTime1%60);
+      return $.ajax({
+        url: baseUrl + `/api/resources/yearMember/getResidueTime?userCardId=${userCardId}`,
+        headers: {
+          Authorization: token,
+        },
+        type: 'get',
+        dataType: 'json',
+        contentType: 'application/json;charset=UTF-8',
+      }).then(function (res) {
+        if (res.status === 0) {
+          let time = res.data;
+          residueTimer = setInterval(() => {
+            if (time > 0) {
+              time--;
+              $('.countdown-time').text(residueTimeStamp(time));
+            } else {
+              clearInterval(residueTimer);
+              downline();
+            }
+          }, 1000)
+        } else {
+          return Promise.reject(new Error(res.msg));
         }
+      });
+    }
+
+    // 秒转化为时分秒
+    function getResultTime(time) {
+      let theTime = parseInt(time);// 秒
+      let theTime1 = 0;// 分
+      let theTime2 = 0;// 小时
+
+      if (theTime > 60) {
+        theTime1 = parseInt(theTime / 60);
+        theTime = parseInt(theTime % 60);
+
+        if (theTime1 > 60) {
+          theTime2 = parseInt(theTime1 / 60);
+          theTime1 = parseInt(theTime1 % 60);
         }
-        let result = '' + parseInt(theTime);
-        if(theTime1 > 0) {
+      }
+      let result = '' + parseInt(theTime);
+      if (theTime1 > 0) {
         result = '' + parseInt(theTime1) + ':' + result;
-        }
-        if(theTime2 > 0) {
-        result = '' + parseInt(theTime2) + ':' + result;
-        }
-        return result;
       }
-      // 推荐列表
-      function getRecommend() {
-        return $.ajax({
-          url: baseUrl + `/api/public/v1/market/get/recommend?userCardId=${userCardId}`,
-          headers: {
-            Authorization: token,
-          },
-          
-          type: 'get',
-          dataType: 'json',
-          contentType: 'application/json;charset=UTF-8',
-        }).then(function (res) {
-          if (res.status === 0) {
-            $('.apply-wrap').eq(0).show();
-            let list = res.data;
-            let result = '';
-            list.map(item => {
-							item.installNum = `有${item.installNum}人下载`
-              result += $('#apply').text().replace(/{{(.*?)}}/g, function(node, key) {
-                return item[key];
-              })
-            })
-            $('.apply-list').eq(0).append(result)
-          } else {
-            return Promise.reject(new Error(res.msg));
-          }
-        });
+      if (theTime2 > 0) {
+        result = '' + parseInt(theTime2) + ':' + result;
       }
+      return result;
+    }
+    // 推荐列表
+    function getRecommend() {
+      return $.ajax({
+        url: baseUrl + `/api/public/v1/market/get/recommend?userCardId=${userCardId}`,
+        headers: {
+          Authorization: token,
+        },
 
-      //点击了换一批
-      $('.apply-list-change')[0].addEventListener('click',() => {
-        $('.apply-list').eq(0).empty();
-        getRecommend();
-      })
-
-      //点击了关闭按钮
-      $('.apply-close')[0].addEventListener('click',() => {
-        localStorage.setItem('isShowRecommend', true);
-        $('.apply-wrap').eq(0).hide();
-      })
-
-      // 点击下载按钮
-      $('.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'){
-          var pings2 = {
-            type: 'downAndInstallApk',
-            data: {
-              apkUrl: downloadUrl,
-              taskUid: id
-            },
-          };
-          wsss.send(JSON.stringify(pings2));
-        }
-      })
-
-      // 点击了我知道了
-      $('.countdown-btn')[0].addEventListener('click',() => {
-        $('.countdown-wrap').eq(0).hide();
-        clearInterval(residueTimer);
-        getRecommend();
-      })
-
-      // 点击了续时长
-      $('.time-lang-btn')[0].addEventListener('click',() => {
-        $('.time-lang-wrap').eq(0).hide();
-        if (window.__wxjs_environment === 'miniprogram') {
-          wx.miniProgram.navigateTo({
-            url:`/packageA/order/renew/index?record=` + userCardId
-          });
-        } else {
-          uni.webView.navigateTo({
-            url: '/pages/order/renew?record=' + userCardId
+        type: 'get',
+        dataType: 'json',
+        contentType: 'application/json;charset=UTF-8',
+      }).then(function (res) {
+        if (res.status === 0) {
+          $('.apply-wrap').eq(0).show();
+          let list = res.data;
+          let result = '';
+          list.map(item => {
+            item.installNum = `有${item.installNum}人下载`
+            result += $('#apply').text().replace(/{{(.*?)}}/g, function (node, key) {
+              return item[key];
+            })
           })
+          $('.apply-list').eq(0).append(result)
+        } else {
+          return Promise.reject(new Error(res.msg));
         }
-      })
+      });
+    }
+
+    //点击了换一批
+    $('.apply-list-change')[0].addEventListener('click', () => {
+      $('.apply-list').eq(0).empty();
+      getRecommend();
+    })
+
+    //点击了关闭按钮
+    $('.apply-close')[0].addEventListener('click', () => {
+      localStorage.setItem('isShowRecommend', true);
+      $('.apply-wrap').eq(0).hide();
+    })
+
+    // 点击下载按钮
+    $('.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') {
+        var pings2 = {
+          type: 'downAndInstallApk',
+          data: {
+            apkUrl: downloadUrl,
+            taskUid: id
+          },
+        };
+        wsss.send(JSON.stringify(pings2));
+      }
+    })
+
+    // 点击了我知道了
+    $('.countdown-btn')[0].addEventListener('click', () => {
+      $('.countdown-wrap').eq(0).hide();
+      getRecommend();
+    })
+
+    // 点击了续时长
+    $('.time-lang-btn')[0].addEventListener('click', () => {
+      $('.time-lang-wrap').eq(0).hide();
+      if (window.__wxjs_environment === 'miniprogram') {
+        wx.miniProgram.navigateTo({
+          url: `/packageA/order/renew/index?record=` + userCardId
+        });
+      } else {
+        uni.webView.navigateTo({
+          url: '/pages/order/renew?record=' + userCardId
+        })
+      }
+    })
 
     //广告信息
     var adData = null; // 广告数据

+ 1 - 40
static/screenAndroid/timer.js

@@ -40,45 +40,7 @@ function downline() {
     },
   });
 }
-var residueTime = 0, residueTimer, isShowCountdown = +parameters['isShowCountdown'], isShowRule = +parameters['isShowRule'];
-if (isShowCountdown) {
-  $('#countView').eq(0).show();
-}
-if (isShowRule) {
-  $('.countdown-wrap').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);
-            ws.close();
-            wsss.close();
-            quit();
-          }
-        }, 1000);
-      } else {
-        $.toast(res.msg, 'text');
-      }
-    },
-  });
-}
+
 function residueTimeStamp(value) {
   let theTime = value;//秒
   let middle = 0;//分
@@ -94,7 +56,6 @@ function residueTimeStamp(value) {
   theTime < 10 ? theTime = '0' + theTime : theTime = theTime
   middle < 10 ? middle = '0' + middle : middle = middle
   hour < 10 ? hour = '0' + hour : hour = hour
-  console.log(hour + ':' + middle + ':' + theTime)
   return hour + ':' + middle + ':' + theTime
 }
 function handleclose() {

+ 133 - 131
static/screenIos/WXtrialInterface.html

@@ -204,11 +204,7 @@
         <div class="apply-title">应用推荐</div>
         <div class="apply-list"></div>
         <div class="apply-list-change">换一批</div>
-        <img
-          class="apply-close"
-          src="img/close.png"
-          alt=""
-        />
+        <img class="apply-close" src="img/close.png" alt="" />
       </div>
     </div>
     <div class="time-lang-wrap">
@@ -595,12 +591,19 @@
     }
 
     initAD();
-    getResidueTime();
+    var isShowCountdown = +parameters['isShowCountdown'], isShowRule = +parameters['isShowRule'];
     $.alert({
       title: '提示',
       text: '开始使用云手机',
       onOK: function () {
         isAudioPlay = true;
+        if (isShowCountdown) {
+          $('#countView').eq(0).show();
+        }
+        if (isShowRule) {
+          $('.countdown-wrap').eq(0).show();
+        }
+        getResidueTime();
       },
     });
     //云机倒计时
@@ -1334,140 +1337,139 @@
       }
     }
 
-      var residueTimer = null;
-      // 获取云机剩余时长
-      function getResidueTime() {
-        if (sourceType !== 5) {
-          return
-        }
-        return $.ajax({
-          url: baseUrl + `/api/resources/yearMember/getResidueTime?userCardId=${userCardId}`,
-          headers: {
-            Authorization: token,
-          },
-          type: 'get',
-          dataType: 'json',
-          contentType: 'application/json;charset=UTF-8',
-        }).then(function (res) {
-          if (res.status === 0) {
-            let time = res.data;
-            residueTimer = setInterval(() => {
-              if (time > 0) {
-                time--;
-                $('.countdown-time').text(residueTimeStamp(time));
-              } else {
-                clearInterval(residueTimer);
-                downline();
-              }
-            }, 1000)
-          } else {
-            return Promise.reject(new Error(res.msg));
-          }
-        });
+    var residueTimer = null;
+    // 获取云机剩余时长
+    function getResidueTime() {
+      if (sourceType !== 5) {
+        return
       }
-
-      // 秒转化为时分秒
-      function getResultTime(time) {
-        let theTime = parseInt(time);// 秒
-        let theTime1 = 0;// 分
-        let theTime2 = 0;// 小时
-        
-        if(theTime > 60) {
-        theTime1 = parseInt(theTime/60);
-        theTime = parseInt(theTime%60);
-        
-        if(theTime1 > 60) {
-        theTime2 = parseInt(theTime1/60);
-        theTime1 = parseInt(theTime1%60);
+      return $.ajax({
+        url: baseUrl + `/api/resources/yearMember/getResidueTime?userCardId=${userCardId}`,
+        headers: {
+          Authorization: token,
+        },
+        type: 'get',
+        dataType: 'json',
+        contentType: 'application/json;charset=UTF-8',
+      }).then(function (res) {
+        if (res.status === 0) {
+          let time = res.data;
+          residueTimer = setInterval(() => {
+            if (time > 0) {
+              time--;
+              $('.countdown-time').text(residueTimeStamp(time));
+            } else {
+              clearInterval(residueTimer);
+              downline();
+            }
+          }, 1000)
+        } else {
+          return Promise.reject(new Error(res.msg));
         }
+      });
+    }
+
+    // 秒转化为时分秒
+    function getResultTime(time) {
+      let theTime = parseInt(time);// 秒
+      let theTime1 = 0;// 分
+      let theTime2 = 0;// 小时
+
+      if (theTime > 60) {
+        theTime1 = parseInt(theTime / 60);
+        theTime = parseInt(theTime % 60);
+
+        if (theTime1 > 60) {
+          theTime2 = parseInt(theTime1 / 60);
+          theTime1 = parseInt(theTime1 % 60);
         }
-        let result = '' + parseInt(theTime);
-        if(theTime1 > 0) {
+      }
+      let result = '' + parseInt(theTime);
+      if (theTime1 > 0) {
         result = '' + parseInt(theTime1) + ':' + result;
-        }
-        if(theTime2 > 0) {
-        result = '' + parseInt(theTime2) + ':' + result;
-        }
-        return result;
       }
-      // 推荐列表
-      function getRecommend() {
-        return $.ajax({
-          url: baseUrl + `/api/public/v1/market/get/recommend?userCardId=${userCardId}`,
-          headers: {
-            Authorization: token,
-          },
-          
-          type: 'get',
-          dataType: 'json',
-          contentType: 'application/json;charset=UTF-8',
-        }).then(function (res) {
-          if (res.status === 0) {
-            $('.apply-wrap').eq(0).show();
-            let list = res.data;
-            let result = '';
-            list.map(item => {
-							item.installNum = `有${item.installNum}人下载`
-              result += $('#apply').text().replace(/{{(.*?)}}/g, function(node, key) {
-                return item[key];
-              })
-            })
-            $('.apply-list').eq(0).append(result)
-          } else {
-            return Promise.reject(new Error(res.msg));
-          }
-        });
+      if (theTime2 > 0) {
+        result = '' + parseInt(theTime2) + ':' + result;
       }
+      return result;
+    }
+    // 推荐列表
+    function getRecommend() {
+      return $.ajax({
+        url: baseUrl + `/api/public/v1/market/get/recommend?userCardId=${userCardId}`,
+        headers: {
+          Authorization: token,
+        },
 
-      //点击了换一批
-      $('.apply-list-change')[0].addEventListener('click',() => {
-        $('.apply-list').eq(0).empty();
-        getRecommend();
-      })
-
-      //点击了关闭按钮
-      $('.apply-close')[0].addEventListener('click',() => {
-        localStorage.setItem('isShowRecommend', true);
-        $('.apply-wrap').eq(0).hide();
-      })
-
-      // 点击下载按钮
-      $('.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'){
-          var pings2 = {
-            type: 'downAndInstallApk',
-            data: {
-              apkUrl: downloadUrl,
-              taskUid: id
-            },
-          };
-          wsss.send(JSON.stringify(pings2));
-        }
-      })
-
-      // 点击了我知道了
-      $('.countdown-btn')[0].addEventListener('click',() => {
-        $('.countdown-wrap').eq(0).hide();
-        clearInterval(residueTimer);
-        getRecommend();
-      })
-
-      // 点击了续时长
-      $('.time-lang-btn')[0].addEventListener('click',() => {
-        $('.time-lang-wrap').eq(0).hide();
-        if (window.__wxjs_environment === 'miniprogram') {
-          wx.miniProgram.navigateTo({
-            url:`/packageA/order/renew/index?record=` + userCardId
-          });
-        } else {
-          uni.webView.navigateTo({
-            url: '/pages/order/renew?record=' + userCardId
+        type: 'get',
+        dataType: 'json',
+        contentType: 'application/json;charset=UTF-8',
+      }).then(function (res) {
+        if (res.status === 0) {
+          $('.apply-wrap').eq(0).show();
+          let list = res.data;
+          let result = '';
+          list.map(item => {
+            item.installNum = `有${item.installNum}人下载`
+            result += $('#apply').text().replace(/{{(.*?)}}/g, function (node, key) {
+              return item[key];
+            })
           })
+          $('.apply-list').eq(0).append(result)
+        } else {
+          return Promise.reject(new Error(res.msg));
         }
-      })
+      });
+    }
+
+    //点击了换一批
+    $('.apply-list-change')[0].addEventListener('click', () => {
+      $('.apply-list').eq(0).empty();
+      getRecommend();
+    })
+
+    //点击了关闭按钮
+    $('.apply-close')[0].addEventListener('click', () => {
+      localStorage.setItem('isShowRecommend', true);
+      $('.apply-wrap').eq(0).hide();
+    })
+
+    // 点击下载按钮
+    $('.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') {
+        var pings2 = {
+          type: 'downAndInstallApk',
+          data: {
+            apkUrl: downloadUrl,
+            taskUid: id
+          },
+        };
+        wsss.send(JSON.stringify(pings2));
+      }
+    })
+
+    // 点击了我知道了
+    $('.countdown-btn')[0].addEventListener('click', () => {
+      $('.countdown-wrap').eq(0).hide();
+      getRecommend();
+    })
+
+    // 点击了续时长
+    $('.time-lang-btn')[0].addEventListener('click', () => {
+      $('.time-lang-wrap').eq(0).hide();
+      if (window.__wxjs_environment === 'miniprogram') {
+        wx.miniProgram.navigateTo({
+          url: `/packageA/order/renew/index?record=` + userCardId
+        });
+      } else {
+        uni.webView.navigateTo({
+          url: '/pages/order/renew?record=' + userCardId
+        })
+      }
+    })
 
     /**
      * 初始化广告

+ 1 - 8
static/screenIos/timer.js

@@ -40,13 +40,7 @@ function downline() {
     },
   });
 }
-var residueTime = 0, residueTimer, isShowCountdown = +parameters['isShowCountdown'], isShowRule = +parameters['isShowRule'];
-if (isShowCountdown) {
-  $('#countView').eq(0).show();
-}
-if (isShowRule) {
-  $('.countdown-wrap').eq(0).show();
-}
+
 function residueTimeStamp(value) {
   let theTime = value;//秒
   let middle = 0;//分
@@ -62,7 +56,6 @@ function residueTimeStamp(value) {
   theTime < 10 ? theTime = '0' + theTime : theTime = theTime
   middle < 10 ? middle = '0' + middle : middle = middle
   hour < 10 ? hour = '0' + hour : hour = hour
-  console.log(hour + ':' + middle + ':' + theTime)
   return hour + ':' + middle + ':' + theTime
 }
 function handleclose() {