This commit is contained in:
GaoHao
2025-01-20 11:15:55 +08:00
3 changed files with 15 additions and 18 deletions

View File

@@ -94,7 +94,7 @@
} from '@/store/common.js'
const $common = useCommonStore()
onShow(() => {
console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
// console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
// 判断ios是否审核
$common.init()
let sysInfo = uni.getSystemInfoSync()
@@ -123,6 +123,7 @@
content: "",
confirmText: "",
cancelText: "",
downloadLink: ""
},
setindexdata :"false"
})
@@ -157,7 +158,7 @@
//获取当前系统版本信息
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
//请求后台接口 解析数据 对比版本
selectNewApp().then(res => {
selectNewApp().then( async res => {
res = res[0];
console.log(uni.getSystemInfoSync().platform == 'ios',1101)
let version;
@@ -166,14 +167,10 @@
}
if (uni.getSystemInfoSync().platform == 'ios') {
version = res.iosVersion
$common.setversion(widgetInfo.version, version)
}
version = res.version
// && uni.getSystemInfoSync().platform == 'android'
if (widgetInfo.version < version) {
let downloadLink = '';
let androidLink = res.androidWgtUrl;
let iosLink = res.iosWgtUrl;
}
let isVersion = await $common.setversion(widgetInfo.version, version)
if ( isVersion == 1 ) {
datas.version.downloadLink = res.androidWgtUrl;
datas.version.show = true;
datas.version.title = "发现新版本";
datas.version.content = res.des;
@@ -200,7 +197,7 @@
});
if (uni.getSystemInfoSync().platform == 'android') {
uni.downloadFile({
url: androidLink,
url: datas.version.downloadLink,
success: downloadResult => {
console.log(downloadResult)
if (downloadResult.statusCode === 200) {
@@ -223,7 +220,7 @@
});
}
if (uni.getSystemInfoSync().platform == 'ios') {
plus.runtime.openURL(iosLink, function(res) {});
plus.runtime.openURL(datas.version.downloadLink, function(res) {});
}
}