|
@@ -30,26 +30,25 @@ export function getUpApp() {
|
|
|
const x = +arr[i];
|
|
|
// 本地版本号
|
|
|
const y = +arr1[i];
|
|
|
- // 判断当前版本是否为小于等于线上版本
|
|
|
- if (x >= y) {
|
|
|
+ if (x <= y) {
|
|
|
// 设置显示数据
|
|
|
store.commit('changeState', {
|
|
|
name: 'app',
|
|
|
value: true
|
|
|
});
|
|
|
- // 当版本较低时更新数据
|
|
|
- if (x > y) {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '请更新应用',
|
|
|
- showCancel: false,
|
|
|
- success(e) {
|
|
|
- plus.runtime.openURL(
|
|
|
- iosAppStroeUrl
|
|
|
- );
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
+ // 判断当前版本是否为小于等于线上版本
|
|
|
+ if (x > y) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '请更新应用',
|
|
|
+ showCancel: false,
|
|
|
+ success(e) {
|
|
|
+ plus.runtime.openURL(
|
|
|
+ iosAppStroeUrl
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -60,11 +59,6 @@ export function getUpApp() {
|
|
|
}
|
|
|
// 当前系统为安卓则显示数据
|
|
|
if (hj === 'android') {
|
|
|
- // 设置默认显示数据
|
|
|
- store.commit('changeState', {
|
|
|
- name: 'app',
|
|
|
- value: true
|
|
|
- });
|
|
|
uni.request({
|
|
|
url: getUpAppUrl,
|
|
|
method: 'GET',
|
|
@@ -89,20 +83,23 @@ export function getUpApp() {
|
|
|
const y = +arr1[i];
|
|
|
console.log(arr, arr1, "版本号")
|
|
|
// 判断当前版本是否为小于等于线上版本
|
|
|
- if (x >= y) {
|
|
|
- // 只有ios才需要显示
|
|
|
- // 当版本较低时更新数据
|
|
|
- if (x > y) {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '请更新应用',
|
|
|
- showCancel: false,
|
|
|
- success(e) {
|
|
|
- // plus.runtime.openURL('http://lxscimg.liuniu946.com/lxscV' + version + '.apk');
|
|
|
- downApp(version);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ if (x <= y) {
|
|
|
+ // 设置默认显示数据
|
|
|
+ store.commit('changeState', {
|
|
|
+ name: 'app',
|
|
|
+ value: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (x > y) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '请更新应用',
|
|
|
+ showCancel: false,
|
|
|
+ success(e) {
|
|
|
+ // plus.runtime.openURL('http://lxscimg.liuniu946.com/lxscV' + version + '.apk');
|
|
|
+ downApp(version);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|