2020-08-18 09:42:26 +00:00
|
|
|
|
<template>
|
2020-08-25 02:13:49 +00:00
|
|
|
|
<u-modal v-model="show" :show-cancel-button="is_focus_upgrade" confirm-text="升级" title="发现新版本" @cancel="cancel" @confirm="confirm">
|
2020-08-18 09:42:26 +00:00
|
|
|
|
<view class="u-update-content">
|
2020-08-25 02:13:49 +00:00
|
|
|
|
<!-- <rich-text :nodes="content"></rich-text> -->
|
2020-08-18 09:42:26 +00:00
|
|
|
|
</view>
|
|
|
|
|
</u-modal>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2020-08-25 02:13:49 +00:00
|
|
|
|
is_focus_upgrade: Boolean, // 是否强制更新
|
2020-08-18 09:42:26 +00:00
|
|
|
|
show: true,
|
|
|
|
|
// 传递给uni-app"rich-text"组件的内容,可以使用"<br>"进行换行
|
|
|
|
|
content: `
|
|
|
|
|
1. 新增几个bug<br>
|
|
|
|
|
2. 新增Modal模态框组件<br>
|
|
|
|
|
3. 新增压窗屏组件,可以在APP上以弹窗的形式遮盖导航栏和底部tabbar<br>
|
|
|
|
|
`,
|
2020-08-25 04:06:37 +00:00
|
|
|
|
isAutoUpdate: false,
|
2020-08-18 09:42:26 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2020-08-25 02:13:49 +00:00
|
|
|
|
onLoad(option) {
|
|
|
|
|
this.is_focus_upgrade = option.status == 1 ? false : true;
|
2020-08-25 04:06:37 +00:00
|
|
|
|
// type manual 从检查更新页面过来 auto 从app过来
|
|
|
|
|
this.isAutoUpdate = option.type == 'manual' ? false : true;
|
2020-08-25 02:13:49 +00:00
|
|
|
|
},
|
2020-08-18 09:42:26 +00:00
|
|
|
|
onReady() {
|
|
|
|
|
this.show = true;
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
cancel() {
|
|
|
|
|
this.closeModal();
|
|
|
|
|
},
|
|
|
|
|
confirm() {
|
2020-08-25 03:50:45 +00:00
|
|
|
|
// #ifdef APP-PLUS
|
2020-08-25 02:40:47 +00:00
|
|
|
|
if (plus.os.name == "Android") {
|
|
|
|
|
const appurl = "market://details?id=自己打包用的包名"; //这个是通用应用市场,如果想指定某个应用商店,需要单独查这个应用商店的包名或scheme及参数
|
|
|
|
|
plus.runtime.openURL(appurl);
|
|
|
|
|
} else if(plus.os.name == "ios") {
|
|
|
|
|
const appurl = "itms-apps://itunes.apple.com/cn/app/id1144816653?mt=8";
|
|
|
|
|
plus.runtime.openURL(appurl);
|
|
|
|
|
}
|
2020-08-25 03:50:45 +00:00
|
|
|
|
// #endif
|
|
|
|
|
// #ifdef H5
|
2020-08-18 09:42:26 +00:00
|
|
|
|
this.closeModal();
|
2020-08-25 03:50:45 +00:00
|
|
|
|
// #endif
|
2020-08-18 09:42:26 +00:00
|
|
|
|
},
|
|
|
|
|
closeModal() {
|
2020-08-25 04:06:37 +00:00
|
|
|
|
if(isAutoUpdate) {
|
|
|
|
|
this.$u.route('/pageA/login/login');
|
|
|
|
|
} else {
|
|
|
|
|
uni.navigateBack();
|
|
|
|
|
}
|
2020-08-18 09:42:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2020-08-18 10:05:15 +00:00
|
|
|
|
page {
|
|
|
|
|
background-color: rgba(0, 0, 0, 0);
|
2020-08-18 09:42:26 +00:00
|
|
|
|
}
|
2020-08-18 10:05:15 +00:00
|
|
|
|
/deep/ .u-mode-center-box {
|
|
|
|
|
background-color: transparent;
|
2020-08-18 09:42:26 +00:00
|
|
|
|
}
|
2020-08-18 10:05:15 +00:00
|
|
|
|
// .u-full-content {
|
|
|
|
|
// background-color: #00C777;
|
|
|
|
|
// }
|
2020-08-18 09:42:26 +00:00
|
|
|
|
.u-update-content {
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: $u-content-color;
|
|
|
|
|
line-height: 1.7;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
}
|
2020-08-18 13:11:28 +00:00
|
|
|
|
::v-deep.u-mode-center-box {
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
}
|
2020-08-18 09:42:26 +00:00
|
|
|
|
</style>
|