<template>
	<view class="pages">
		<u-navbar :custom-back="btnback" title="实名认证" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
			title-size='36' height='44'></u-navbar>
		<!-- 未有实名认证 -->
		<view class="">
			<view class="listval">
				<view class="tit"> 真实姓名</view>
				<view class="but"> <input type="text" placeholder="请输入真实姓名" v-model="name" /> </view>
			</view>
			<view class="listval">
				<view class="tit"> 身份证号</view>
				<view class="but"> <input type="text" placeholder="请输入身份证号" v-model="names" /> </view>
			</view>
			<view class="listval">
				<view class="yz" v-if="yzflag">
				</view>
				<view class="yz" v-else>
				</view>
			</view>
			<view class="" style="width: 100%;margin-top: 50rpx;color: red;text-align: center;">
				提现需实名认证，请输入真实有效实名信息！
			</view>
		</view>
		<!-- 已有实名认证 -->
		
		
		<view class="baocun" v-if="flag">
			进行人脸验证
		</view>
		<view class="baocun" @click="btnyz" v-else>
			进行人脸验证
		</view>
		
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgc: {
					backgroundColor: "#8883f0",
				},
				name: '',
				names: '',
				tel: '',
				flag: false,
				yzflag: true
			}
		},
		onLoad() {
            
		},
		// 分享到好友（会话）
		onShareAppMessage: function() {
			return {
				title: '创亿康',
				path: '/pages/index/index'
			}
		},

		// 分享到朋友圈  
		onShareTimeline: function() {
			return {
				title: '创亿康',
				query: '',
				path: '/pages/index/index'
			}
		},
		methods: {
			btnback(){
				uni.reLaunch({
					url:'/page_user/yetx'
				})
			},
			btnyz() {
				this.flag = true
				let data = {
					realName: this.name,
					realIdCard: this.names,
					// realPhone: this.tel
				}
				this.$u.put('/app/user/realName', data).then(res => {
					if (res.code == 200) {
						this.flag = false
						let https = encodeURIComponent(res.data.jumpUrl)
						console.log(https);
						uni.navigateTo({
							url: '/pages/sjshiming?https=' + https
						})
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						})
						this.flag = false
					}
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	/deep/ .u-title {
		padding-bottom: 15rpx;
	}

	/deep/ .u-icon__icon {
		padding-bottom: 15rpx;
	}

	.pages {
		background-color: #F7FAFE !important;
		height: 100vh;
		width: 100%;
		padding: 0 50rpx;
		box-sizing: border-box;

		.baocun {
			width: 584rpx;
			height: 90rpx;
			background: linear-gradient(90deg, #8883F0 0%, #A29EFF 100%);
			border-radius: 54rpx 54rpx 54rpx 54rpx;
			margin: auto;
			text-align: center;
			line-height: 90rpx;
			position: fixed;
			left: 50%;
			transform: translateX(-50%);
			bottom: 60rpx;
			font-weight: 500;
			font-size: 40rpx;
			color: #FFFFFF;
		}

		.listval {
			width: 100%;
			display: flex;
			justify-content: space-between;
			margin-top: 34rpx;

			.yz {
				color: red;
			}

			.rl {
				border-bottom: 1rpx solid #3D3D3D;
			}

			.tit {
				margin-top: 12rpx;
				font-size: 32rpx;
				color: #3D3D3D;
			}

			.but {
				width: 462rpx;
				height: 70rpx;
				background: #F0F0F0;
				border-radius: 12rpx 12rpx 12rpx 12rpx;

				input {
					height: 70rpx;
					line-height: 70rpx;
					padding-left: 22rpx;
				}
			}
		}
	}
</style>