Ver Fonte

修复版本号获取错误问题

duanchangpeng há 5 anos atrás
pai
commit
b8942398a3

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
hbuild/GoAllOutTv/GoAllOutTv/index.html


+ 2 - 2
hbuild/GoAllOutTv/GoAllOutTv/manifest.json

@@ -3,8 +3,8 @@
     "id" : "H5BB8BEB3", /*应用的标识*/
     "name" : "小飞龙", /*应用名称,程序桌面图标名称*/
     "version" : {
-        "name" : "1.3.6", /*应用版本名称*/
-        "code" : 29
+        "name" : "1.3.8", /*应用版本名称*/
+        "code" : 31
     },
     "description" : "小飞龙TV平台", /*应用描述信息*/
     "icons" : {

+ 31 - 44
tv/src/views/Index.vue

@@ -54,51 +54,33 @@ export default {
       localStorage.eqSn = '30:9C:23:0C:8B:1E';
       localStorage.version = '1.1.0';
 
+      if (window.plus) {
+        plusReady();
+      } else {
+        console.log('mui is not ready');
+        // 调试时候关闭
+        this.getServeIpAddress(localStorage.eqSn);
+        // plusReady();
+        document.addEventListener('plusready', plusReady, false);
+      }
+
       function plusReady() {
         if (typeof plus == 'undefined') return false;
         // 获取本地应用资源版本号
         plus.runtime.getProperty(plus.runtime.appid, function (inf) {
           localStorage.version = inf.version;
           that.curVersion = inf.version;
-
           //首发版本 '1.1.0' 在线版不需要自动升级
-          that.checkUpdate(that.curVersion); //开启自动升级
-
-
-        });
-
-        //   获取手机UUID
-        plus.device.getInfo({
-          success: function (e) {
-            let uuid = JSON.stringify(e.uuid).toString().substr(1);
-            uuid = uuid.substring(0, uuid.length - 1);
-            localStorage.eqSn = uuid;
-            console.log('===== uuid =====:' + uuid);
-            // const h = this.$createElement;
-            // that.$notify({
-            //     title: '获取UUID',
-            //     message: h('i', {style: 'color: teal'}, 'uuid:'+JSON.stringify(e).uuid)
-            // });
-            // 8e501b0bde9ce600
-            // 打印uuid
-            // alert('getDeviceInfo success: ' + JSON.stringify(e.uuid));
-            // alert('clientWidth:' + document.documentElement.clientWidth);
-            // alert('clientWidth:' + document.documentElement.clientHeight);
-            // alert('devicePixelRatio:' + window.devicePixelRatio);
-            console.log('getDeviceInfo success: ' + JSON.stringify(e.uuid));
-            // 正式版打开
-            that.getServeIpAddress(e.uuid);
-            // 公司盒子打开自动更新
-            if (localStorage.eqSn == 'a1f2d679c1624d3a' || localStorage.eqSn == '30:9C:23:0C:8B:1E' || localStorage.eqSn == '8e501b0bde9ce600') {
+          // 内测版自动升级
+          if (localStorage.eqSn == 'a1f2d679c1624d3a' || localStorage.eqSn == '30:9C:23:0C:8B:1E') {
               let url = 'http://192.168.0.3:19096/v1/Sensors/QueryVueFramework';
               let param = {};
               let postdata = qs.stringify(param);
               axios.post(url, postdata).then(function (data) {
                 let json = data.data;
                 if (json.Code == 0) {
-                  console.log('Version' + json.Version);
-                  if (localStorage.version != json.Version) {
-                    // 测试
+                  if (localStorage.version != json.VueFramework.Version) {
+                    // 测试版本下载
                     let downUrl = "http://192.168.0.3:19096/v1/Sensors/DownloadVueFramework";
                     that.downWgt(downUrl);
                   }
@@ -108,24 +90,29 @@ export default {
               }, function (response) {
                 console.info(response);
               })
+          }else{
+            // 正式版
+            //开启自动升级
+            that.checkUpdate(that.curVersion);
+          }
+        });
 
-            }
+        //   获取手机UUID
+        plus.device.getInfo({
+          success: function (e) {
+            let uuid = JSON.stringify(e.uuid).toString().substr(1);
+            uuid = uuid.substring(0, uuid.length - 1);
+            localStorage.eqSn = uuid;
+            console.log('===== uuid =====:' + uuid);
+            console.log('getDeviceInfo success: ' + JSON.stringify(e.uuid));
+            // 正式版打开
+            // 获取转发端口地址
+            that.getServeIpAddress(e.uuid);
           },
           fail: function (e) {
             console.log('getDeviceInfo failed: ' + JSON.stringify(e));
           }
         });
-
-      }
-
-      if (window.plus) {
-        plusReady();
-      } else {
-        console.log('mui is not ready');
-        // 调试时候关闭
-        this.getServeIpAddress(localStorage.eqSn);
-        // plusReady();
-        document.addEventListener('plusready', plusReady, false);
       }
     },
     // 是否有新版本

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff