From b9388c64ae875a0455bece287a0b772d55cf1ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Mon, 8 Aug 2022 13:24:21 +0800 Subject: [PATCH] =?UTF-8?q?app=E6=89=93=E5=8C=85=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 29 +++++++++++++++++++++++++---- common/http.api.js | 2 ++ manifest.json | 15 ++++++--------- pages/home/home_.vue | 4 ++-- 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/App.vue b/App.vue index 50a39ac..86f486d 100644 --- a/App.vue +++ b/App.vue @@ -57,6 +57,27 @@ } }); // #endif + uni.getSystemInfo({ + success(res) { + if (res.platform == 'android') { + that.$u.api.apkCheck().then(res1 => { + if (res.appVersion < res1.version) { + uni.showModal({ + title: "版本更新", + content: '有新的版本发布, 请下载新版本', + confirmText: '立即更新', + showCancel: false, + success: function(res2) { + if (res2.confirm) { + plus.runtime.openURL(res1.file) + } + } + }); + } + }) + } + } + }) // #ifdef APP-PLUS uni.showLoading({ title: '自动登录中...', @@ -64,10 +85,10 @@ }) uni.getStorage({ key: 'mySecret', - success: function (res) { + success: function(res) { let secret = res.data - if(secret){ - that.$u.api.loginSecret(JSON.parse(secret)).then(res=>{ + if (secret) { + that.$u.api.loginSecret(JSON.parse(secret)).then(res => { that.$u.api.getUserInfo().then(res => { that.$u.vuex('vuex_user', res) // 修改资源请求地址 @@ -77,7 +98,7 @@ }) }) } - + }, complete() { uni.hideLoading() diff --git a/common/http.api.js b/common/http.api.js index 0ee9140..e99e501 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -27,6 +27,7 @@ const install = (Vue, vm) => { let unbindmp = (data = {}) => vm.$u.post('/system/user/unbind_wxmp/', data); //微信小程序解绑 let bindSecret = (data = {}) => vm.$u.post('/system/user/bind_secret/', data); //App密钥绑定 + let apkCheck = ()=>vm.$u.get('/system/apk/'); //apk检查 let getDickey = (params = {}) => vm.$u.get('/system/dict/', params); //查询字典 @@ -84,6 +85,7 @@ const install = (Vue, vm) => { unbindmp, bindSecret, loginSecret, + apkCheck, userList, deptList, diff --git a/manifest.json b/manifest.json index f3d149d..2df70f9 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "曲阳金隅EHS", "appid" : "__UNI__B00D419", "description" : "曲阳金隅EHS", - "versionName" : "1.0.0", - "versionCode" : "100", + "versionName" : "1.00.01", + "versionCode" : 10001, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { @@ -15,12 +15,8 @@ "delay" : 0 }, "modules" : { - "OAuth" : {}, - "Payment" : {}, - "Push" : {}, - "Share" : {}, - "Speech" : {}, - "VideoPlayer" : {} + "VideoPlayer" : {}, + "Push" : {} }, /* 应用发布信息 */ "distribute" : { @@ -63,7 +59,8 @@ }, /* ios打包配置 */ "ios" : { - "UIBackgroundModes" : [ "audio" ] + "UIBackgroundModes" : [ "audio" ], + "dSYMs" : false }, /* SDK配置 */ "sdkConfigs" : { diff --git a/pages/home/home_.vue b/pages/home/home_.vue index 3b9ec14..5602cdb 100644 --- a/pages/home/home_.vue +++ b/pages/home/home_.vue @@ -46,7 +46,7 @@ 实时报警 - + 查看更多 @@ -257,7 +257,7 @@ color: #5b5b5b; overflow: hidden; text-overflow: ellipsis; - display: box; + display: flex; display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2;