<template>
	<view class="page">

		<!-- <view class="code">
			<image src="../../static/code.png" mode=""></image>
			<text>扫描二维码，您的朋友也可以使用或下载哦~</text>
		</view> -->

		<view class="xy-list">

			<view class="list">
				<view class="title"></view>
				<view class="content">


					<text>
						防沉迷 安全呵护成长
						1.默认每天最多使用时长为40分钟
						2.每日晚上22时至次日上午6时，期间无法使用“本萌创星球”本APP应用
						3.进入青少年模式，需要进行实名认证，认证通过后，若年龄低于18周岁则自
						动进入青少年模式
						4.目前仅支持通过二代身份证认证
						5.若您是未成年人，请先通过您的监护人提供并确认同意收集您的实名信息
					</text>
				</view>

			</view>

		</view>
		<view class="btn" v-if="showYongMode">您已进入青少年模式</view>
		<view class="btn" @click="onGoGoGo()" v-if="showYong">进入青少年模式</view>

		<DialogBox ref="DialogBox"></DialogBox>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				showYong: false,
				showYongMode: false,
				myinfo: {}
			};
		},
		onLoad() {},
		onShow() {
			this.loadInfo();
		},
		methods: {
			onBack() {},

			loadInfo() {
				let that = this;
				uni.request({
					url: this.$apiHost + '/My/idcheck',
					data: {
						uuid: getApp().globalData.uuid
					},
					header: {
						"content-type": "application/json",
						'sign': getApp().globalData.headerSign
					},
					success: (res) => {
						console.log("----:", res.data);
						that.myinfo = res.data;
						if (that.myinfo.step < 9) {
							that.showYong = true;
						} else {
							that.showYong = false;
							if (res.data.age < 18) {
								that.showYongMode = true;
							}
						}
					},
					complete: (com) => {
						// uni.hideLoading();
					},
					fail: (e) => {
						console.log("----e:", e);
					}
				});
			},
			onGoGoGo() {
				let that = this;
				that.$refs['DialogBox'].confirm({
					title: '提示',
					content: '您还没有实名，请先去实名认证',
					DialogType: 'inquiry',
					btn1: '否',
					btn2: '是',
					animation: 0
				}).then((res) => {
					uni.navigateTo({
						url: '/pages/my/idcheck'
					})
				})
			}

		}
	}
</script>

<style scoped lang="scss">
	page {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		background-color: #fff;
	}

	.xy-list {
		padding: 0 4%;
		border-radius: 20rpx;
		margin: 20rpx auto;

		.list {
			display: flex;
			align-items: flex-start;
			justify-content: space-between;
			flex-direction: column;
			width: 100%;
			padding-bottom: 20rpx;
			padding-top: 10rpx;

			.title {
				color: #333;
				width: 100%;
				text-align: center;
			}

			.content {
				display: flex;
				align-items: center;
				padding-left: 20rpx;
				color: #333;

				text {
					font-size: 26rpx;
					line-height: 42rpx;

				}
			}
		}
	}

	.btn {
		position: fixed;
		bottom: 80rpx;
		left: 200rpx;
		width: 350rpx;
		height: 70rpx;
		background-color: #f0f0f0;
		border-radius: 70rpx;
		text-align: center;
		line-height: 70rpx;
	}
</style>