| | |
| | | globalData: { |
| | | baseHttp: '', |
| | | baseUrll: '', |
| | | upVersion: 0, |
| | | }, |
| | | onLaunch: function() { |
| | | Vue.prototype.ColorList = [{ |
| | |
| | | onShow: function() { |
| | | this.getVersion(); |
| | | this.baseUrll = uni.getStorageSync("baseUrl") |
| | | // console.log(this.baseUrll); |
| | | console.log('App Show') |
| | | }, |
| | | onHide: function() { |
| | |
| | | url: that.baseUrll + "/mobile/appUpdate/queryUpdate", |
| | | method:'GET', |
| | | success(res) { |
| | | console.log(res); |
| | | // 新app版本 |
| | | that.upVersion = Number(res.data.data) |
| | | // 当前app版本 |
| | | let currentVersion = Number(that.version) |
| | | if(that.upVersion > currentVersion) { |
| | | that.downWgt(); //下载文件 |
| | | } |
| | | } |
| | | }) |
| | | return |
| | |
| | | }, |
| | | downWgt() { |
| | | let that = this; |
| | | const downloadUrl = "http://192.168.4.188:8088/jfwms/static/appupload/android_debug.apk" |
| | | console.log('url:' + downloadUrl) |
| | | const downloadUrl = that.baseUrll + "/static/appupload/" + that.upVersion + ".apk" |
| | | uni.showLoading({ |
| | | title: '更新中……' |
| | | }) |
| | |
| | | |
| | | // 下载进度 |
| | | downloadTask.onProgressUpdate(res => { |
| | | // that.$u.toast(res.progress) |
| | | that.downloadNum = res.progress |
| | | console.log('下载进度' + that.downloadNum); |
| | | // console.log('已经下载的数据长度' + res.totalBytesWritten); |
| | | // console.log('预期需要下载的数据总长度' + res.totalBytesExpectedToWrite); |
| | | |
| | | // 满足测试条件,取消下载任务。 |
| | | // if (res.progress > 50) { |
| | | // downloadTask.abort(); |
| | | // } |
| | | }); |
| | | }, |
| | | } |
| | |
| | | "name" : "中扬WMS", |
| | | "appid" : "__UNI__DA5854D", |
| | | "description" : "", |
| | | "versionName" : "20230202A", |
| | | "versionName" : "2023020501", |
| | | "versionCode" : 104, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |