<template>
	<view class="content jbetween">
		<view class="top hflex acenter jbetween">
			<text>邀请码</text>
			<u-input v-model="code" border="none" placeholder="请填写邀请码" inputAlign="right"></u-input>
		</view>
		<view class="btn" @click="sure">确认</view>
	</view>
</template>

<script>
	import $api from '@/static/js/api.js'
	export default {
		data() {
			return {
				code: '',
			}
		},
		methods: {
			sure() {
				var that = this
				$api.req({
					url: 'user/bind-invite',
					method: 'post',
					data: {
						invite_code: that.code
					}
				}, function(res) {
					$api.info(res.msg)
					setTimeout(() => {
						uni.navigateBack()
					}, 1000)
				})
			},
		}
	}
</script>

<style lang="scss">
	.content::v-deep {
		background: #FFFFFF;

		.btn {
			width: 702rpx;
			height: 88rpx;
			background: #00B0B0;
			border-radius: 44rpx;
			font-size: 36rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 88rpx;
			text-align: center;
			position: fixed;
			bottom: 62rpx;
			left: 24rpx;
		}

		.top {
			width: 100%;
			box-sizing: border-box;
			padding: 40rpx 28rpx;
			border-top: 1px solid #F5F5F5;
			border-bottom: 1px solid #F5F5F5;

			text {
				font-size: 32rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #333333;
			}

			.u-input {
				width: 550rpx;
			}
		}
	}
</style>