|
|
@@ -51,6 +51,7 @@
|
|
|
//浏览器默认的
|
|
|
localStorage.eqSn = '30:9C:23:0C:8B:1E';
|
|
|
localStorage.version = '1.1.0';
|
|
|
+
|
|
|
function plusReady() {
|
|
|
if (typeof plus == 'undefined') return false;
|
|
|
// 获取本地应用资源版本号
|
|
|
@@ -60,6 +61,7 @@
|
|
|
|
|
|
//首发版本 '1.1.0' 在线版不需要自动升级
|
|
|
that.checkUpdate(that.curVersion); //开启自动升级
|
|
|
+
|
|
|
});
|
|
|
|
|
|
// 获取手机UUID
|
|
|
@@ -107,12 +109,17 @@
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
if (version != json.Version) {
|
|
|
- let url = "http://cal.beswell.com:85/v1/Sensors/DownloadVueFramework";
|
|
|
- that.downWgt(url, json.Version);
|
|
|
- that.$notify({
|
|
|
- title: '升级提醒',
|
|
|
- message: h('i', {style: 'color: teal'}, '检测到新的版本,正在下载最新版本')
|
|
|
- });
|
|
|
+ // 正式
|
|
|
+ // let url = "http://cal.beswell.com:85/v1/Sensors/DownloadVueFramework";
|
|
|
+ // 测试
|
|
|
+ let url = "http://192.168.0.162/wgt/H5BB8BEB3.wgt";
|
|
|
+ console.log('Version'+ json.Version);
|
|
|
+ console.log(json);
|
|
|
+ that.downWgt(url,json.Version);
|
|
|
+ // that.$notify({
|
|
|
+ // title: '升级提醒',
|
|
|
+ // message: h('i', {style: 'color: teal'}, '检测到新的版本,正在下载最新版本')
|
|
|
+ // });
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -121,29 +128,29 @@
|
|
|
let that = this;
|
|
|
plus.downloader.createDownload(url, {filename: "_doc/update/"}, function (d, status) {
|
|
|
// plus.downloader.createDownload(url, {}, function (d, status) {
|
|
|
- console.log(status);
|
|
|
if (status == 200) {
|
|
|
+ console.log(d);
|
|
|
console.log("下载wgt成功:" + d.filename);
|
|
|
that.installWgt(d.filename); // 安装wgt包
|
|
|
} else {
|
|
|
console.log("下载wgt失败!");
|
|
|
- plus.nativeUI.alert("下载wgt失败!");
|
|
|
+ // plus.nativeUI.alert("下载wgt失败!");
|
|
|
}
|
|
|
plus.nativeUI.closeWaiting();
|
|
|
}).start();
|
|
|
},
|
|
|
installWgt(path) {
|
|
|
- plus.nativeUI.showWaiting("安装wgt文件...");
|
|
|
+ // plus.nativeUI.showWaiting("安装wgt文件...");
|
|
|
plus.runtime.install(path, {}, function () {
|
|
|
plus.nativeUI.closeWaiting();
|
|
|
console.log("安装wgt文件成功!");
|
|
|
- plus.nativeUI.alert("应用资源更新完成!", function () {
|
|
|
- plus.runtime.restart();
|
|
|
- });
|
|
|
+ // plus.nativeUI.alert("应用资源更新完成!", function () {
|
|
|
+ plus.runtime.restart();
|
|
|
+ // });
|
|
|
}, function (e) {
|
|
|
plus.nativeUI.closeWaiting();
|
|
|
console.log("安装wgt文件失败[" + e.code + "]:" + e.message);
|
|
|
- plus.nativeUI.alert("安装wgt文件失败[" + e.code + "]:" + e.message);
|
|
|
+ // plus.nativeUI.alert("安装wgt文件失败[" + e.code + "]:" + e.message);
|
|
|
});
|
|
|
}
|
|
|
|