80 lines
2.0 KiB
Vue
80 lines
2.0 KiB
Vue
<template>
|
||
<u-modal v-model="show" :show-cancel-button="is_focus_upgrade" confirm-text="升级" title="发现新版本" @cancel="cancel" @confirm="confirm">
|
||
<view class="u-update-content">
|
||
<!-- <rich-text :nodes="content"></rich-text> -->
|
||
</view>
|
||
</u-modal>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
data() {
|
||
return {
|
||
is_focus_upgrade: Boolean, // 是否强制更新
|
||
show: true,
|
||
// 传递给uni-app"rich-text"组件的内容,可以使用"<br>"进行换行
|
||
content: `
|
||
1. 新增几个bug<br>
|
||
2. 新增Modal模态框组件<br>
|
||
3. 新增压窗屏组件,可以在APP上以弹窗的形式遮盖导航栏和底部tabbar<br>
|
||
`,
|
||
isAutoUpdate: false,
|
||
}
|
||
},
|
||
onLoad(option) {
|
||
this.is_focus_upgrade = option.status == 1 ? false : true;
|
||
},
|
||
onReady() {
|
||
this.show = true;
|
||
},
|
||
methods: {
|
||
cancel() {
|
||
this.closeModal();
|
||
},
|
||
confirm() {
|
||
// #ifdef APP-PLUS
|
||
if (plus.os.name == "Android") {
|
||
const appurl = "market://details?id=com.tencent.mobileqq"; //这个是通用应用市场,如果想指定某个应用商店,需要单独查这个应用商店的包名或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);
|
||
}
|
||
// endif
|
||
// ifdef H5
|
||
this.closeModal();
|
||
// #endif
|
||
},
|
||
closeModal() {
|
||
const pages = getCurrentPages();
|
||
// console.log(pages);
|
||
if(pages.length == 2) {
|
||
this.$u.route('/pageA/welcome/welcome');
|
||
} else {
|
||
uni.navigateBack();
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
page {
|
||
background-color: rgba(0, 0, 0, 0);
|
||
}
|
||
.u-mode-center-box {
|
||
background-color: transparent;
|
||
}
|
||
// .u-full-content {
|
||
// background-color: #00C777;
|
||
// }
|
||
.u-update-content {
|
||
font-size: 26rpx;
|
||
color: $u-content-color;
|
||
line-height: 1.7;
|
||
padding: 30rpx;
|
||
}
|
||
::v-deep.u-mode-center-box {
|
||
background-color: transparent;
|
||
}
|
||
</style> |