<template>
	<view class="content">
		<view class="one">
			<image :src="logoUrl" mode="aspectFit"></image>
			<view class="version">{{versionInfo.version}}</view>
		</view>
		<view class="two">
			<view class="two_1">
				抵制不良游戏，拒绝盗版游戏。
			</view>
			<view class="two_1">
				注意自我保护，谨防受骗上当。
			</view>
			<view class="two_1">
				适度游戏宜脑，沉迷游戏伤身体。
			</view>
			<view class="two_1">
				合理安排时间，享受健康时间。
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				logoUrl: 'https://broadcast.waityou24.cn/files/test/20230116145912.jpg',
				timer: null,
				versionInfo: {}, 
			}
		},
		onLoad() {
			const that = this;
			that.search('/pagesHome/home/index');
		},
		onShow() {
			const that = this;
			// 获取版本信息
			plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
				that.$set(that, `versionInfo`, wgtinfo)
				that.setTitle(wgtinfo)
			})
		},
		methods: {
			async search(e) {
				const that = this;
				uni.redirectTo({
					url: e
				})
				// that.timer = setTimeout(() => {
				// 	uni.redirectTo({
				// 		url: e
				// 	})
				// 	clearTimeout(that.timer);
				// 	that.timer = null;
				// }, 2000)
			},
			// 赋值标题栏
			setTitle(e) {
				uni.setNavigationBarTitle({
					title: e.name
				});
			}
		}
	}
</script>

<style lang="scss">
	.content {
		.one {
			flex-grow: 1;
			text-align: center;

			image {
				width: 50vw;
				height: 50vw;
				border-radius: 90%;
				box-shadow: 0 0 5px #f1f1f1;
				margin: 30vw 0 0 0;
			}

			.version {
				margin: 2vw 0 0 0;
			}
		}

		.two {
			text-align: center;
			padding: 10px 0;

			.two_1 {
				padding: 0 0 10px 0;
				font-size: 14px;
			}
		}
	}
</style>
