<template>
	<view class="tixian">
		<view class="tixian-header u-flex-col u-row-between" style="background: #fff;">
			<text>到账银行卡</text>
			<view class="u-flex u-row-between">
				<view class="u-flex">
					<!-- <image style="width: 56rpx;height: 56rpx" src="" mode=""></image> -->
					<view class="">
						<!-- <text>中国农业银行</text> -->
						<text>{{bankdata.bank_type_name}}</text>
						(
						<!-- <text>1234</text> -->
						<text>{{bankdata.bank_no.slice(-4)}}</text>
						)
					</view>
				</view>
				<u-icon name="arrow-right" size="12"></u-icon>
			</view>
		</view>
		<view class="tixian-box" style="background: #fff;">
			<view class="box-title">
				提现金额
			</view>
			<view class="box-input u-flex u-row-between">
				<view class="u-flex">
					<text>¥</text>
					<input :disabled="true" type="number" v-model="money" style="width: 400rpx;">
				</view>
				<view class="right" @click="return1">
					重新选择
				</view>
			</view>
		</view>
		<view class="tixian-btn" @click="tixian">
			确认提现
		</view>
	</view>
</template>

<script>
	import {
		withdraw,
		getBank,
		index
	} from "@/units/inquire.js"
	export default {
		data() {
			return {
				bankdata: {},
				money: '',
				price: '',
				current: "",
			}
		},
		onLoad(options) {
			this.money = options.money
			this.current = options.current
			this.ids = options.ids
			console.log("ppppppppppp", options);
		},
		onShow() {
			this.getdata()
		},
		methods: {
			return1() {
				uni.navigateTo({
					url: "/pagesD/tixian1?current=" + this.current
				})
			},
			tixian() {
				uni.showLoading({
					mask: true,
					title: "请稍后"
				})
				//发起提现
				withdraw({
					ids: this.ids,
				}).then(res => {
					if (res.code == 1) {
						this.$u.toast("发起提现成功")
						this.money = ''
						setTimeout(() => {
							this.getdata()
							uni.navigateBack()
						}, 800)
					} else {
						this.$u.toast(res.msg)
					}
				})
			},
			getdata() {
				getBank().then(res => {
					this.bankdata = res.data || {}
				})
				// index().then(res => {
				// 	this.money = res.data.money || 0
				// })
			},
		}
	}
</script>

<style lang="scss" scoped>
	.tixian {
		height: 100vh;
		background: #F3F3F3;
		padding: 20rpx 24rpx 0 24rpx;
		box-sizing: border-box;

		.right {
			font-size: 32rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #0C66C2;
		}

		.tixian-btn {
			width: 702rpx;
			line-height: 92rpx;
			background: #0C66C2;
			border-radius: 12rpx;
			margin: 60rpx auto;
			text-align: center;
			font-size: 34rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
		}

		.tixian-box {
			width: 702rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			margin: 20rpx auto;
			padding: 0 24rpx;
			box-sizing: border-box;

			.box-down {
				height: 90rpx;

				text:first-child {
					font-size: 26rpx;
					font-family: SFPro-Regular, SFPro;
					font-weight: 400;
					color: #222222;
				}

				text:last-child {
					font-size: 26rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #0C66C2;
				}
			}

			.box-input {
				height: 145rpx;
				border-bottom: 2rpx solid #F0F0F0;

				text {
					font-size: 72rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #222222;
					margin-right: 28rpx;
				}

				input {
					height: 145rpx;
					flex: 1;
					font-size: 72rpx;
				}
			}

			.box-title {
				font-size: 32rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #222222;
				padding-top: 32rpx;
			}

		}

		.tixian-header {
			width: 702rpx;
			height: 204rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			margin: 20rpx auto;
			padding: 32rpx 24rpx 42rpx 24rpx;
			box-sizing: border-box;

			text:first-child {
				font-size: 32rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #222222;
			}

			text:last-child {
				font-size: 32rpx;
				font-family: SFPro-Regular, SFPro;
				font-weight: 400;
				color: #222222;
			}
		}
	}

	page {
		background-color: #F3F3F3;
	}
</style>