<template>
	<view class="integralTransforms">
		<view class="header">
			<text class="title">{{ integral || '0.00' }}</text><br>
			<text>可转换USDT</text>
		</view>
		<view class="account">
			<text class="title">收款人账户</text>
			<input class="text" type="text" placeholder="请输入收款人账户" v-model="account"/>
		</view>
		<view class="num">
			<text class="title">转账数量</text>
				<view class="">
					<text class="ti">￥</text>
					<input class="text" type="number" v-model.number="num" placeholder="请输入转账数量" />
				</view>
		</view>
		<view class="button" @click="submit">
			提交申请
		</view>
		<view class="record">
			收款记录
		</view>
	</view>
</template>

<script> 
	export default {
		data() {
			return {
				num: '',//转账数量
				account: '',//收款人账户
			}
		},
		methods: {
			submit() {
				const data = {
					num: this.num,
					account: this.account
				}
				console.log(data)
			}
		},
		computed: {
			//积分
			integral() {
				return this.$store.state.user.userInfo.integral
			}
		},
		watch: {
			num() {
				if (this.num > this.integral) {
					this.num = this.integral
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.integralTransforms {
		.header,.account,.num {
			background-color: #fff;
			margin: 20rpx 0;
			padding: 30rpx;
			input {
				margin-top: 10rpx;
			}
			.title {
				font-size: 30rpx;
				color: #333333;
				font-family: PingFang-SC-Regular;
			}
			.text{
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #999999;
				
			}
		}
		.header {
			text-align: center;
			text:nth-child(1) {
				font-size: 45rpx;
			}
			text:nth-child(3) {
				font-size: 30rpx;
				color: #666666;
			}
		}
		.num {
			.ti {
				float: left;
			}
		}
		.button {
			width: 630rpx;
			margin: 120rpx auto 10rpx;
			
			line-height: 94rpx;
			text-align: center;
			border-radius: 10rpx;
			background: linear-gradient(90deg, #438BED 0%,  #44BFEC 100%);
			color: #fff;
		}
		.record{
			width: 630rpx;
			margin: 0 auto;
			text-align: center;
			border: 1rpx solid #44BFEC;
			background: linear-gradient(90deg, #44BFEC, #438BED);
			border-radius: 10rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
			line-height: 94rpx;
			
			background: linear-gradient(0deg, #44BFEC 0%, #438BED 100%);
			-webkit-background-clip: text;
			-webkit-text-fill-color: transparent;
		}
	}
</style>
