|
|
@@ -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);
|
|
|
}
|
|
|
},
|
|
|
// 是否有新版本
|