<template>
	<view class="content">
		<view style="height: 190rpx;"></view>
		<view class="a-title">
			<view class="title">本人实名认证</view>
			<view class="text">用于身份实名核验，反洗钱，资料将严格保密</view>
		</view>
		<view class="a-idcard-box">
			<view class="front bg-image">
				<zzx-icon name="upload" size="30"></zzx-icon>
				<view class="">上传人像面</view>
			</view>
			<view class="flip-side bg-image">
				<zzx-icon name="upload" size="30"></zzx-icon>
				<view class="">上传国徽面</view>
			</view>
		</view>
		<view class="a-form">
			<view class="form-item">
				<view class="">真实姓名</view>
				<input type="text" placeholder="请输入本人姓名" />
			</view>
			<view class="form-item">
				<view class="">身份证号</view>
				<input type="idcard" placeholder="请输入本人身份证号" />
			</view>
			<view class="form-item">
				<view class="">手机号码</view>
				<input type="number" placeholder="请输入手机号" />
			</view>
			<view class="form-tips">老人或无手机号，可填写亲友手机号</view>
		</view>
		<view class="u-select-btn">
			<button hover-class="hover-btn" @click="submit">下一步</button>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref } from 'vue';
	const submit = () => {
		uni.navigateTo({
			url: '/pages/index/identityCertifying/index'
		})
		return
		uni.checkIsSupportSoterAuthentication({
			success: (res) => {
				wx.startFacialRecognitionVerify({
					name: '',
					idCardNumber: '',
					success: (res) => {
						if (res.errMsg == 'startFacialRecognitionVerify:ok') {
							console.log(res,'人脸识别结果：success');
						}
					},
					fail: (err) => {
						console.log(err,'人脸识别结果：fail')
						uni.showToast({
							title: '人脸识别失败',
							icon: 'none',
							duration: 20000,
						});
					}
				})
			},
			fail: (err) => {
				console.log(err)
			}
		})
	}
</script>

<style lang="less" scoped>
	.content {
		background: #fff;
		height: 1300rpx;

		.a-title {
			text-align: center;

			.title {
				font-weight: 800;
				font-size: 36rpx;
				color: #222222;
			}

			.text {
				margin-top: 20rpx;
				font-size: 24rpx;
				color: #AAAAAA;
			}
		}
		.a-idcard-box{
			display: flex;
			align-items: center;
			justify-content: space-around;
			font-size: 28rpx;
			color: #222222;
			margin-top: 40rpx;
			.front{
				width: 332rpx;
				height: 204rpx;
				border-radius: 16rpx;
				background-image: url('@/static/idcard-front.png');
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;
			}
			.flip-side{
				width: 332rpx;
				height: 204rpx;
				border-radius: 16rpx;
				background-image: url('@/static/idcard-flipSide.png');
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;
			}
		}

		.a-form {
			margin-top: 20rpx;

			.form-item {
				height: 110rpx;
				display: flex;
				align-items: center;
				gap: 20rpx;
				border-bottom: 1rpx solid #F0F0F0;
				font-weight: bold;
				font-size: 28rpx;
				color: #222222;

				&>input {
					font-weight: normal;
				}
			}
			.form-tips{
				margin-top: 20rpx;
				font-size: 24rpx;
				color: #AAAAAA;
			}
		}

		.u-select-btn {
			position: fixed;
			width: 100%;
			height: 300rpx;
			left: 0;
			bottom: 0;
			background: #fff;

			&>button {
				width: 95%;
				height: 100rpx;
				line-height: 100rpx;
				background: #D3FD76;
				border-radius: 60rpx;
				font-weight: bold;
				font-size: 32rpx;
				color: #222222;
			}

			&>button::after {
				border: none;
			}

			.hover-btn {
				background: #ccf371;
				color: #999999;
			}
		}
	}
</style>