<template>
	<view>
		<u-navbar :title="tit" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
			height='36'></u-navbar>
			<view class="cont" v-if="stause">  
				
				<view class="tip">注意：绑定账号需为本人账号，发生绑定错误可能会出现转账错误的情况</view>
				<view class="input_box">
					<view class="text">真实姓名</view>
					<view class="ipt">
						 <u-input v-model="name" placeholder='请输入持卡人姓名' placeholder-style='font-size: 24rpx;'/>
					</view>
					
				</view>
				<view class="input_box">
					<view class="text">身份证号码</view>
					<view class="ipt">
						 <u-input v-model="idnum" placeholder='请输入身份证号码' placeholder-style='font-size: 24rpx;'/>
					</view>
					
				</view>
				<view class="input_box">
					<view class="text" >支付宝账号</view>
					<view class="ipt">
						 <u-input v-model="cardnum" placeholder='请输入支付宝账号' placeholder-style='font-size: 24rpx;'/>
					</view>
					
				</view>
				
				<!-- <view class="input_box">
					<view class="text" style="margin-right: 150rpx;">验证码</view>
					<view class="ipt" style="width: 170rpx;">
						 <u-input v-model="name" placeholder='请输入验证码' placeholder-style='font-size: 20rpx;color: red;'/>
					</view>
					<view class="yzmbtn">
						获取验证码
					</view>
					
				</view> -->
				<view class="btn" @click="band()">
					确认绑定
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgc: {
					backgroundColor: "#F7FAFE",
				},
				name:'',
				idnum:'',
				cardnum:'',
				tit:'test',
				stause:false,
			}
		},
		onLoad() {
			this.getstause()
		},
		methods: {
			tobd(){
				uni.navigateTo({
					url:''
				})
			},
			getstause(){
				
				this.$u.get('/app/config/wa' ).then((res) => {
					if (res.code == 200) {
						console.log(res)
						this.stause=res.data
						if(this.stause==true){
							this.tit='支付宝账号绑定'
						}
					}
				})
			},
			band(){
				let data ={
					accountType:3,
					name:this.name,
					idCard:this.idnum,
					accountNo:this.cardnum
				}
				this.$u.post('/app/account',data).then((res) => {
					if (res.code == 200) {
						uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 2000
						});
						uni.navigateBack({
						               delta: 1 // 返回上级页面
						           });
					}else{
						uni.showToast({
						  title: res.msg,
						  icon: 'none',
						  duration: 2000
						});
					}
				})
			}
			
		}
	}
</script>

<style lang="scss" >
	page{
		background: #F7FAFE;
	}
.cont{
	display: flex;
	// justify-content: center;
	flex-wrap: wrap;
	margin: 0 auto;
	width: 594rpx;
	.tip{
		margin-top: 62rpx;
		font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
		font-weight: 400;
		font-size: 24rpx;
		color: #FF8D1A;
		line-height: 36rpx;
	}
	.input_box{
		margin-top: 66rpx;
		width: 594rpx;
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		.text{
			width: 30%;
			// margin-right: 102rpx;
			font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
			font-weight: 400;
			font-size: 24rpx;
			color: #262B37;
		}
		.ipt{
			width: 70%;
			.u-input::placeholder {
			    font-size: 20px;
			    color: red;
			}
		}
		.yzmbtn{
			margin-left: 50rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 150rpx;
			height: 50rpx;
			background: #8EA9E4;
			border-radius: 10rpx 10rpx 10rpx 10rpx;
			
			font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
			font-weight: 400;
			font-size: 20rpx;
			color: #FFFFFF;
		}
	}
	.btn{
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 218rpx;
		width: 590rpx;
		height: 84rpx;
		background: #2A82E4;
		border-radius: 40rpx;
		font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
		font-weight: 400;
		font-size: 36rpx;
		color: #FFFFFF;
		
	}
}
</style>
