From 6761e4f06daef8e5cb71fb8f3fde9ca9a353bb2c Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期二, 22 七月 2025 16:46:51 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
---
pages/index/vers.vue | 103 +++++++++++++--------------------------------------
1 files changed, 27 insertions(+), 76 deletions(-)
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