deming/pageE/setting/updateVersion.vue
2020-08-25 12:06:37 +08:00

80 lines
2.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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;
// type manual 从检查更新页面过来 auto 从app过来
this.isAutoUpdate = option.type == 'manual' ? false : true;
},
onReady() {
this.show = true;
},
methods: {
cancel() {
this.closeModal();
},
confirm() {
// #ifdef APP-PLUS
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);
}
// #endif
// #ifdef H5
this.closeModal();
// #endif
},
closeModal() {
if(isAutoUpdate) {
this.$u.route('/pageA/login/login');
} else {
uni.navigateBack();
}
}
}
}
</script>
<style scoped lang="scss">
page {
background-color: rgba(0, 0, 0, 0);
}
/deep/ .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>