From 88697c49dec6b7a84515497300a7b5c968612549 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 19 四月 2023 15:32:32 +0800
Subject: [PATCH] #
---
App.vue | 26 +++++++++++---------------
1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/App.vue b/App.vue
index 2b02d83..c206b2f 100644
--- a/App.vue
+++ b/App.vue
@@ -4,6 +4,7 @@
globalData: {
baseHttp: '',
baseUrll: '',
+ upVersion: 0,
},
onLaunch: function() {
Vue.prototype.ColorList = [{
@@ -84,9 +85,8 @@
]
},
onShow: function() {
- // this.getVersion();
- // this.baseUrll = uni.getStorageSync("baseUrl")
- // console.log(this.baseUrll);
+ this.getVersion();
+ this.baseUrll = uni.getStorageSync("baseUrl")
console.log('App Show')
},
onHide: function() {
@@ -118,10 +118,15 @@
let that = this;
uni.request({
url: that.baseUrll + "/mobile/appUpdate/queryUpdate",
- // data: {combParam: 'asd'},
method:'GET',
success(res) {
- console.log(res);
+ // 鏂癮pp鐗堟湰
+ that.upVersion = Number(res.data.data)
+ // 褰撳墠app鐗堟湰
+ let currentVersion = Number(that.version)
+ if(that.upVersion > currentVersion) {
+ that.downWgt(); //涓嬭浇鏂囦欢
+ }
}
})
return
@@ -179,8 +184,7 @@
},
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: '鏇存柊涓�︹��'
})
@@ -229,16 +233,8 @@
// 涓嬭浇杩涘害
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();
- // }
});
},
}
--
Gitblit v1.9.1