Files
dou_fire/App.vue
唐明明 8d8c14ec66 同步
2023-02-13 11:58:29 +08:00

80 lines
3.0 KiB
Vue

<script>
import { getVersions } from './apis/interfaces/versions'
export default {
onLaunch: function() {
//#ifdef APP-PLUS
// 获取系统版本号
getVersions({
platform: plus.os.name,
version : plus.runtime.version
}).then(res => {
if (res.update) {
uni.showModal({
title : "更新提示",
content : res.note || '版本更新信息',
confirmText : "更新",
showCancel : !res.info.must,
success : modalRes => {
if (modalRes.confirm) {
if (plus.os.name == "Android") {
uni.showToast({
title: '新版本下载中,将在下载完成后自动为您安装更新包',
icon: 'none'
})
uni.downloadFile({
url: res.info.download,
success: apkPick => {
plus.runtime.install(apkPick
.tempFilePath, '',
installRES => {
// 安装完成用于提示新版本引导,暂时无用
}, installERR => {
// 安装失败
})
},
fail(err) {
uni.showToast({
title: '安装包下载失败,请检查您的网络或稍后重试',
icon: 'none'
})
}
})
} else {
uni.showToast({
title: '暂无ios版本',
icon: 'none'
})
}
}
}
})
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
//#endif
},
globalData:{
signUrl: "https://web.douhuofalv.com/app/e-sign?sign_type=order",
// https://web.douhuotest.douhuofalv.com/app/e-sign?sign_type=order 测试环境
certificationUrl: 'http://web.douhuofalv.com/app/e-sign?sign_type=personal',
// 'https://web.douhuotest.douhuofalv.com/app/e-sign?sign_type=personal' 测试环境
}
}
</script>
<style lang="scss">
@import "uview-ui/index.scss";
@import "@/static/iconfont.css";
.content{
background: #f8f8f8;
min-height: 100vh;
padding: 0 0 1rpx;
box-sizing: border-box;
}
</style>