From ed9e939e595003a3044d45b0860ceb2ca77b9723 Mon Sep 17 00:00:00 2001
From: qq_41295110 <qq_41295110@noreply.gitcode.com>
Date: 星期二, 22 七月 2025 13:46:32 +0800
Subject: [PATCH] 版本更新功能
---
manifest.json | 7 +-
pages/index/vers.vue | 103 +++++++++-------------------------
pages/index/index.vue | 6 ++
pages/index/mine.vue | 12 ++++
README.md | 1
5 files changed, 50 insertions(+), 79 deletions(-)
diff --git a/README.md b/README.md
index cd48958..4ce2f9f 100644
--- a/README.md
+++ b/README.md
@@ -26,3 +26,4 @@
娣诲姞鍔熻兘妯″潡:
娴嬭瘯鏁版嵁锛氱敓浜ч鏂欙紙MATO00048891锛�,
+
diff --git a/manifest.json b/manifest.json
index d94139d..09c0a4e 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "鏅轰簯LMES",
"appid" : "__UNI__B002F49",
"description" : "",
- "versionName" : "1.0.16",
- "versionCode" : 116,
+ "versionName" : "1.0.17",
+ "versionCode" : 117,
"transformPx" : false,
/* 5+App鐗规湁鐩稿叧 */
"app-plus" : {
@@ -45,7 +45,8 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
- ]
+ ],
+ "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
/* ios鎵撳寘閰嶇疆 */
"ios" : {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 836835b..9c9ea09 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -9,11 +9,17 @@
</view>
</view>
</view>
+
+ <vers></vers>
</view>
</template>
<script>
+ import vers from './vers.vue';
export default {
+ components: {
+ vers
+ },
data() {
return {
serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
diff --git a/pages/index/mine.vue b/pages/index/mine.vue
index 5e8a582..839e4d0 100644
--- a/pages/index/mine.vue
+++ b/pages/index/mine.vue
@@ -180,5 +180,17 @@
font-size: 36rpx;
text-align: center;
}
+
+ .vers{
+ position: fixed;
+ z-index: 99;
+ bottom: 0;
+ left: 0;
+ font-size: 28rpx;
+ color: #888;
+ margin-bottom: 20rpx;
+ text-align: center;
+ width: 100%;
+ }
}
</style>
diff --git a/pages/index/vers.vue b/pages/index/vers.vue
index 9c4f518..b83dc4c 100644
--- a/pages/index/vers.vue
+++ b/pages/index/vers.vue
@@ -20,7 +20,7 @@
export default {
data() {
return {
- serverUrl: 'https://api.zj-yonghutong.com',
+ serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
showTc:false,
// 鐗堟湰鏇存柊
loadPercent:0,
@@ -38,83 +38,38 @@
if(uni.getSystemInfoSync().platform !=='ios'){
this.update();
}else if(uni.getSystemInfoSync().platform =='ios'){
- this.updateIOS();
+ uni.showToast({
+ title:'璇蜂娇鐢ㄥ畨鍗撴墜鏈猴紝浠ュ厤鍙戠敓鍏煎鎬ч棶棰�',
+ icon:'none'
+ })
}
//#endif
},
methods: {
- updateIOS() {
- var _this = this;
- uni.request({
- url: 'https://api.zj-yonghutong.com/v1/config/configKeyObject/APPVersionIOS',
- header: {
- 'Authorization': 'Bearer ' + getToken(),
- 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
- },
- method: 'GET',
- success: result => {
- console.log(result)
- if (result.data.code == 200) {
- uni.setStorageSync('remarkURL',result.data.data.remark)
- plus.runtime.getProperty(plus.runtime.appid, function(inf) {
- console.log(inf)
- uni.setStorageSync('vers',inf.version)
- _this.vers = result.data.data.configValue
- if(result.data.data.configValue > inf.versionCode){ //濡傛灉绾夸笂鐗堟湰澶т簬褰撳墠鐗堟湰
- var configType = result.data.data.fieldOne //褰撳墠绾夸笂鏈�鏂版暣鍖呯増鏈�
- _this.fieldTwo = result.data.data.fieldTwo//鏇存柊鍐呭
- if(configType > inf.versionCode ){//濡傛灉绾夸笂鏈�鏂版暣鍖呯増鏈ぇ浜庡綋鍓嶇増鏈紝鍒欐暣鍖呮洿鏂�
- _this.showTc = true
- console.log(555555)
- }else{//鐑洿鏂�
- uni.showLoading({
- title:'鍙戠幇鏂拌祫婧愶紝姝e湪涓嬭浇涓�...',
- mask:true,
- })
- uni.downloadFile({
- url: 'https://api.zj-yonghutong.com/profile/kangleju.wgt',
- success: (downloadResult) => {
- if (downloadResult.statusCode === 200) {
- uni.hideLoading()
- plus.runtime.install(downloadResult.tempFilePath, {
- force: false
- }, function() {
- console.log('install success...');
- plus.runtime.restart();
- }, function(e) {
- console.error('install fail...');
- });
- }
- }
- });
- }
- }
- });
- }
- },
- })
- },
update() {
var _this = this;
uni.request({
- url:'https://api.zj-yonghutong.com/v1/config/configKeyObject/APPVersion',
- header: {
- 'Authorization': 'Bearer ' + getToken(),
- // 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
- },
- method: 'GET',
+ url:_this.serverUrl + '/LMES/AppUpdate',
+ data: { type:'' },
success: result => {
- if (result.data.code == 200) {
- // console.log(1111111,result)
- uni.setStorageSync('remarkURL',result.data.data.remark)
+ console.log(1111111,result)
+ // "DowloadPath": 鏁村寘鏇存柊涓嬭浇鍦板潃,
+ // "HotDowloadPath": 鏈�鏂扮儹鏇存柊涓嬭浇鍦板潃,
+ // "VersionNumber": "鏈�鏂版暣鍖呯増鏈�",
+ // "HotVersionNumber": "鏈�鏂扮増鏈�",
+ // "Content": ""
+ if (result.data.count == 1) {
+ var datas = result.data.data[0]
+ uni.setStorageSync('remarkURL',datas.DowloadPath)
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
console.log(inf)
- _this.vers = result.data.data.configValue
+ _this.vers = datas.HotVersionNumber
uni.setStorageSync('vers','V' + inf.version)
- if(result.data.data.configValue > inf.versionCode){ //濡傛灉绾夸笂鐗堟湰澶т簬褰撳墠鐗堟湰
- var configType = result.data.data.fieldOne //褰撳墠绾夸笂鏈�鏂版暣鍖呯増鏈�
- _this.fieldTwo = result.data.data.fieldTwo//鏇存柊鍐呭
- if(configType > inf.versionCode ){//濡傛灉绾夸笂鏈�鏂版暣鍖呯増鏈ぇ浜庡綋鍓嶇増鏈紝鍒欐暣鍖呮洿鏂�
+ console.log(datas.HotVersionNumber,inf.versionCode,datas.HotVersionNumber > inf.versionCode)
+ if(datas.HotVersionNumber > inf.versionCode){
+ var configType = datas.VersionNumber
+ _this.fieldTwo = datas.Content
+ if(configType > inf.versionCode ){
_this.showTc = true
console.log(configType,_this.showTc,_this.fieldTwo)
}else{
@@ -123,7 +78,7 @@
mask:true,
})
uni.downloadFile({
- url: 'https://api.zj-yonghutong.com/profile/kangleju.wgt',
+ url: datas.HotDowloadPath,
success: (downloadResult) => {
if (downloadResult.statusCode === 200) {
uni.hideLoading()
@@ -146,12 +101,8 @@
})
},
upOn(){
- if(uni.getSystemInfoSync().platform !=='ios'){
- this.doUpData();
- this.loadPercent = 0
- }else if(uni.getSystemInfoSync().platform =='ios'){
- plus.runtime.openURL(uni.getStorageSync('remarkURL'));
- }
+ this.doUpData();
+ this.loadPercent = 0
},
doUpData() {
this.waitLine = true
@@ -236,9 +187,9 @@
width: 550rpx;
height: 730rpx;
position: absolute;
- top: 10vh;
+ top: 20vh;
left: 100rpx;
- background-image: url('../../../static/images/newVer.png');
+ background-image: url('/static/images/newVer.png');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
--
Gitblit v1.9.1