<template>
	<view class="cmain">
		<view class="item">
			<card v-model="item.pic" pic="../../static/images/sfz1.png"></card>
		</view>
		<view class="title">上传您的身份证头像面</view>
		<view class="item">
			<card v-model="item.pic" pic="../../static/images/sfz2.png"></card>
		</view>
		<view class="title">上传您的身份证国徽面</view>
		<button class="btn">人脸认证</button>
	</view>
</template>

<script>
export default {
	data() {
		return {
			item: {}
		};
	},
	onLoad(e) {},
	methods: {
		save() {
			let rule = [
				{ name: 'typeCode', checkType: 'notnull', errorMsg: '请输入编码' },
				{ name: 'typeName', checkType: 'notnull', errorMsg: '请输入名称' },
				{ name: 'status', checkType: 'notnull', errorMsg: '请选择状态' }
			];
			if (!this.verify.check(this.item, rule)) {
				uni.showModal({ content: this.verify.error, showCancel: false });
				return false;
			}
			this.http.request({
				url: '/project/projectType',
				method: this.item.id ? 'PUT' : 'POST',
				data: this.item,
				success: res => {
					uni.showToast({ title: '操作成功' });
					setTimeout(() => {
						uni.$emit('ctype');
						uni.navigateBack();
					}, 1000);
				}
			});
		}
	}
};
</script>

<style lang="scss">
.item {
	text-align: center;
	padding: 20px;
	background-color: #f7f8fa;
	border-radius: 15px;
	image {
		width: 100%;
		border-radius: 5px;
	}
}
.title {
	padding: 20px;
	text-align: center;
	font-weight: bold;
	color: $font-c;
	font-size: 17px;
}
.btn{
	margin-top: 20px;
}
</style>
