<template>
	<view class="container">
		<view class="page">
			<view class="housing">
				<view class="steps">
					<view class="item active">
						<view class="uni-icons"><uni-icons type="home-filled" size="20" color="#6A59F2"></uni-icons>
						</view>
						<view class="name">房屋信息</view>
					</view>
					<view class="dotted dottedActive"></view>
					<view class="item active">
						<view class="uni-icons"><uni-icons type="person-filled" size="20" color="#6A59F2"></uni-icons>
						</view>
						<view class="name">住户信息</view>
					</view>
					<view class="dotted"></view>
					<view class="item">
						<view class="uni-icons"><uni-icons type="auth-filled" size="20" color="#B5B8ED"></uni-icons>
						</view>
						<view class="name">物业审核</view>
					</view>
					<view class="dotted"></view>
					<view class="item">
						<view class="uni-icons"><uni-icons type="checkbox-filled" size="20" color="#B5B8ED"></uni-icons>
						</view>
						<view class="name">认证成功</view>
					</view>
				</view>
				<view class="form">
					<uni-forms>
						<view class="form-item">
							<view class="form-item-fl">
								<view class="asterisk">*</view>业主姓名
							</view>
							<view class="form-item-fr">
								<input class="form-item-tit" v-model="formData.name" focus placeholder="请输入真实姓名" />
							</view>
						</view>
						<view class="form-item">
							<view class="form-item-fl">
								<view class="asterisk">*</view>联系方式
							</view>
							<view class="form-item-fr">
								<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入手机号码" />
							</view>
						</view>
						<view class="form-item">
							<view class="form-item-fl">
								<view class="asterisk"></view>住户性别
							</view>
							<view class="form-item-fr">
								<uni-data-checkbox v-model="formData.sex" :localdata="sexs" class="form-item-tit" />
							</view>
						</view>
						<view class="form-item">
							<view class="form-item-fl">
								<view class="asterisk"></view>证件类型
							</view>
							<view class="form-item-fr">
								<picker @change="bindPickerChange" :value="formData.name2" :range="array"
									class="form-item-tit">
									<view class="uni-input">{{array[index] || '请选择证件类型'}}</view>
								</picker>
								<uni-icons type="forward" color="#E4E4EA"></uni-icons>
							</view>
						</view>
						<view class="form-item">
							<view class="form-item-fl">
								<view class="asterisk"></view>证件号码
							</view>
							<view class="form-item-fr">
								<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入证件号码" />
							</view>
						</view>
						<view class="form-item">
							<view class="form-item-fl">
								<view class="asterisk">*</view>与业主关系
							</view>
							<view class="form-item-fr">
								<picker @change="bindPickerChange" :value="formData.name2" :range="array"
									class="form-item-tit">
									<view class="uni-input">{{array[index] || '请选择与业主关系'}}</view>
								</picker>
								<uni-icons type="forward" color="#E4E4EA"></uni-icons>
							</view>
						</view>
						<view class="form-item">
							<view class="form-item-fl">
								<view class="asterisk">*</view>住户姓名
							</view>
							<view class="form-item-fr">
								<input class="form-item-tit" v-model="formData.name" focus placeholder="请输入住户姓名" />
							</view>
						</view>
						<view class="form-item">
							<view class="form-item-fl">
								<view class="asterisk">*</view>住户手机号码
							</view>
							<view class="form-item-fr">
								<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入手机号码" />
							</view>
						</view>
					</uni-forms>
				</view>

				<view class="form-submit" @click="toAudit()">提交审核</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				formData: {
					name: '',
					name1: '',
					sex: '',
					name2: '',
				},
				sexs: [{
					text: '男',
					value: 0
				}, {
					text: '女',
					value: 1
				}],

				index: '',
				array: ['选择一', '选择二', '选择三']
			}
		},
		methods: {
			bindPickerChange: function(e) {
				this.index = e.detail.value
			},
			toAudit() {
				uni.navigateTo({
					url: '/pages/housingAudit/index',
				});
			}
		},
		onLoad() {

		},
		onShow() {

		}
	}
</script>
<style>
	page {
		background-color: #F8F6F9;
	}
</style>
<style lang="scss" scoped>
	.page {
		padding: 30rpx;
	}

	.housing {
		.steps {
			display: flex;
			justify-content: space-between;
			background-color: #ffffff;
			border-radius: 16rpx;
			padding: 30rpx;
			margin-bottom: 30rpx;

			.item {
				display: flex;
				flex-wrap: wrap;
				justify-content: center;

				.uni-icons {
					text-align: center;
					width: 60rpx;
					height: 60rpx;
					border-radius: 60rpx;
					border: 1px solid #B5B8ED;
					line-height: 60rpx;
				}

				.name {
					margin-top: 10rpx;
					font-size: 28rpx;
					color: #9D9CA6;
				}

			}

			.active {
				.uni-icons {
					border: 1px solid #6A59F2;
				}

				.name {
					color: #373737;
				}
			}

			.dotted {
				margin-top: 28rpx;
				width: 40px;
				height: 1px;
				border-bottom: 1px dashed #B5B8ED;
			}

			.dottedActive {
				border-bottom: 1px solid #6A59F2;
			}
		}

		.form {
			background-color: #ffffff;
			border-radius: 16rpx;
			padding: 30rpx;
			margin-bottom: 30rpx;

			.form-item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				height: 84rpx;
				line-height: 84rpx;
				border-bottom: 1px solid #F8F6F9;
				overflow: hidden;
			}

			.form-item-fl {
				font-size: 28rpx;
				color: #373737;
				display: flex;

				.asterisk {
					color: #F42E2E;
					width: 10rpx;
					margin-right: 6rpx;
				}

			}

			.form-item-fr {
				display: flex;
				flex: 2;
				align-items: center;
				justify-content: flex-end;
				margin-left: 20rpx;
			}

			.form-item-tit {
				font-size: 28rpx;
				color: #666;
				margin-right: 20rpx;
				text-align: right;
			}
		}
	}

	.form-submit {
		height: 80rpx;
		line-height: 80rpx;
		background-color: #6A59F2;
		border-radius: 80rpx;
		width: 100%;
		text-align: center;
		font-size: 28rpx;
		color: #FFFFFF;
	}
</style>