<template>
	
	<view class="page">
		<view class="form">
			<u-form :model="form" ref="uForm">
				<u-form-item label-width="10" label=" " prop="curName">
					<u-input placeholder="请输入推荐人" v-model="curName" disabled="true" type="textarea"></u-input>
				</u-form-item>
				<u-form-item label-width="150" label="审核状态" prop="check_data" required>
					<u-radio-group v-model="form.check_data" active-color="#2979ff">
						<u-radio name="1">通过</u-radio>
						<u-radio name="2">拒绝</u-radio>
					</u-radio-group>
				</u-form-item>
				<u-form-item label-width="150" label="备注信息" prop="check_des" label-position="top">
					<u-input placeholder="备注信息" v-model="form.check_des" type="textarea"></u-input>
				</u-form-item>
			</u-form>
			<u-gap height="60"></u-gap>
			<u-button type="primary" @click="submitHandle">确定</u-button>
		</view>
	</view>
</template>
<script>
var that;
export default {
	data() {
		return {
			curName: '',
			curId: '',
			form: {
				check_des: '',
				check_data: '1',
			},
		};
	},
	onLoad(params) {
		this.curId = params.id
		this.curName = `${params.name}`
	},
	// 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
	onReady() {
		this.$refs.uForm.setRules(this.rules);
	},
	methods: {
		submitHandle() {
			const that = this
			this.$refs.uForm.validate(valid => {
				if (valid) {
					let params = {
						...that.form,
						id: that.curId,
					}
					uni.api.cust.apitradereview(params).then(res => {
						uni.$msgConfirm('审核成功', () => {
							uni.navigateBack()
						}, () => {
							uni.navigateBack()
						})
					})
				}
			});
		},

	}
};
</script>
<style lang="scss">
.page {
	background-color: #ffffff;
}

.form {
	border-radius: 10rpx;
	padding: 0 40rpx;
}

.popup-body {
	.tips-title {
		font-size: $u-p;
		margin-bottom: 20rpx;
	}

	.tips-content {
		font-size: $u-p2;
		color: $u-tips-color;
		margin-bottom: 60rpx;
	}
}

.id_card {
	color: #606266;
	width: 100%;
	height: 350rpx;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background-color: #f4f5f6;
	font-size: $u-p2;
	border-radius: 10rpx;

	image {
		border-radius: 10rpx;
	}
}

.footer {
	position: relative;
	text-align: center;
	font-size: $u-p2;
	left: 0;
	bottom: 20rpx;
	.agreement {
		color: $u-theme-color;
	}
}

.slot-content {
	font-size: 28rpx;
	color: $u-content-color;
	padding: 20rpx;
}

.warp {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.rect {
	width: 400rpx;
	height: 400rpx;
	background-color: #fff;
}
</style>
