<template>
	<view class="container">
		<!-- 提示信息 -->
		<view class="hint flex_r flex_ac">请填写本人真实信息</view>
		<!-- 提示信息-end -->

		<!-- 提交内容 -->
		<view class="con">
			<view class="list flex_r flex_ac">
				<view class="list_name">真实姓名:</view>
				<input class="list_input flex_grow" type="text" v-model="name" placeholder="请输入您的真实姓名" />
			</view>
			<view class="list flex_r flex_ac">
				<view class="list_name">身份证号:</view>
				<input class="list_input flex_grow" type="text" v-model="code" placeholder="请输入您的身份证号" />
			</view>
				<div class="checkbox-box flex_r flex_ac">
					<checkbox-group @change="checkboxChange" class="flex_r flex_ac">
						<label class="checkbox flex_r flex_ac">
							<checkbox class='checkboxCom' value="agree" />
							<view>我同意</view>
						</label>
						<span @click="goto('/pages/agreement/index',{tit:'隐私协议',type:26})" class="hover_a">《用户服务协议》</span>
                        <text>和</text>
						<span @click="goto('/pages/agreement/index',{tit:'隐私协议',type:27})" class="hover_a">《隐私协议》</span>
					</checkbox-group>
				</div>
			
			<view class="btn flex_r flex_ac flex_jc" @tap="submit">提交审核</view>
		</view>
		<!-- 提交内容-end -->
	</view>
</template>

<script>
	let page = 1;
	let app = getApp();
	var appEv = app.$vm.$options;
	import {
		post
	} from "@/request/api.js";
	import {
		ToPayOpre
	} from "@/utils/reqTools.js";
	let toPayOpre = new ToPayOpre();
	export default {
		data() {
			return {
				name: "",
				code: "",
				isDisabled: false, //是否选中协议
			};

		},
		onLoad() {
			this.loadData()
		},
		methods: {
			submit() {
				if(!this.isDisabled){
					appEv.errTips("请阅读并同意相关协议");
					return;
				}

				// #ifdef  H5
				let type = "H5";
				// #endif
				// #ifdef  APP
				let type = "app";
				// #endif
				// #ifdef  MP-WEIXIN
				let type = "jsapi";
				// #endif
				let data = {
					name: this.name,
					card: this.code,
					trade_type: type,
					amount:this.amount
				};
				post("v1/user/authentication", data).then(res => {
					if (res.code === 0) {
						uni.redirectTo({
							url: "/pages/autonym-pay/index?amount=" + this.amount + '&payDetail=' + encodeURIComponent(JSON.stringify(res.data.data)),
						});

					} else {
						appEv.errTips(res.msg)
					}

				});
			},
			loadData(){
				post("v1/user/isPayAuth").then(res => {
					if(res.code === 0){
						this.amount = res.data.amount
					}
				})
			},
			checkboxChange(e) {
			    var value = e.detail.value;
			    this.isDisabled = value.length != 0
			},
		}
	};
</script>

<style lang="scss" scoped>
	// 页面配置
	// 页面配置-end

	// 提示信息
	.hint {
		width: 100%;
		height: 74rpx;
		font-size: 24rpx;
		color: #e75b25;
		padding: 0 30rpx;
		background: #f4f4f4;
	}

	.privacy{
		margin-top:20rpx;
		text-align: right;
		text{
			color: #17bb87;
		}
	}

	// 提示信息-end

	// 提交内容
	.con {
		width: 1005;
		overflow: hidden;
		padding: 30rpx;
		box-sizing: border-box;
	}

	.list {
		width: 100%;
		height: 100rpx;
		border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
	}

	.list_name {
		font-size: 28rpx;
		color: #333333;
		font-weight: "SourceHanSansCN-Medium";
		width: 130rpx;
	}

	.list_input {
		width: calc(100% - 140rpx);
		margin-left: 10rpx;
		height: 100%;
		font-size: 28rpx;
		color: #333;
	}

	.btn {
		width: 395rpx;
		height: 95rpx;
		border-radius: 10rpx;
		background: #17bb87;
		color: #fff;
		font-size: 34rpx;
		font-family: "SourceHanSansCN-Medium";
		margin: 100rpx auto 0;
	}

	// 提交内容-end

	
.checkbox-box{
    margin-top: 60rpx;
    margin-bottom: -20px;
    font-size: 28rpx;

}
.checkbox-box text{
    /* color: #07d; */
    /* color: #44A92F; */
    color: #44a92f;
}
.checkbox-box .checkbox .checkboxCom{
    transform: scale(0.84);
    -webkit-transform: scale(0.84);
}
</style>
