<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" style="margin-right: 126rpx;">银行卡号</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:'',
				status:false,
				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:1,
					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{
			margin-right: 102rpx;
			font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
			font-weight: 400;
			font-size: 24rpx;
			color: #262B37;
		}
		.ipt{
			width: 360rpx;
			.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>