<template>
	<u-modal v-model="show" :title-style="titleStyle" :confirm-text="i18n.confirm" confirm-color="#7081FF"
		:title="i18n.UpdateTips" @confirm="confirm">
		<view class="u-update-content">
			<rich-text :nodes="tipUpdateContent"></rich-text>
		</view>
	</u-modal>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				// :title-style="contentStyle" :content-style="contentStyle" :cancel-style="contentStyle" :confirm-style="contentStyle"
				// contentStyle:{
				// 	backgroundColor: '#111747'
				// },
				titleStyle: {
					color: '#7081FF'
				},
				appUrl: '',
				tipUpdateContent: ''
			}
		},
		onLoad(option) {
			this.show = true;
			this.appUrl = option.appUrl
			this.tipUpdateContent = option.tipUpdateContent
		},
		onHide() {
			//退出app
			// #ifdef APP-PLUS
			if (plus.os.name.toLowerCase() === 'android') {
				plus.runtime.quit();
			} else {
				const threadClass = plus.ios.importClass("NSThread");
				const mainThread = plus.ios.invoke(threadClass, "mainThread");
				plus.ios.invoke(mainThread, "exit");
			}
			// #endif
		},
		methods: {
			// cancel() {
			// 	this.closeModal();
			// },
			confirm() {
				plus.runtime.openURL(this.appUrl)
				// this.closeModal();
			}
			// ,
			// closeModal() {
			// 	uni.navigateBack();
			// }
		},
		computed: {
		},
	}
</script>

<style scoped lang="scss">
	@import "../../libs/css/style.components.scss";

	// .u-full-content {
	// 	background-color: $primaryPageBoxColor !important;
	// }

	.u-update-content {
		font-size: 26rpx;
		color: #7081FF;
		line-height: 1.7;
		padding: 30rpx;
	}
</style>
