<template>
	<view class="box fromClass">
		<view class="lanBox">
			<view class="lan border-bottom">
				<view class="left">姓名</view>
				<view class="right">
					<input name="name" type="text" v-model="content.name" placeholder="姓名" />
				</view>
			</view>
			<view class="lan border-bottom">
				<view class="left">手机号</view>
				<view class="right">
					<input name="name" type="text" v-model="content.phone" placeholder="手机号" />
				</view>
			</view>
			<view class="lan border-bottom">
				<view class="left">企业全称</view>
				<view class="right">
					<input name="name" type="text" v-model="content.comName" placeholder="企业全称" />
				</view>
			</view>
		</view>
		<view class="btn" @click="confirmInfo">提交</view>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex";
	export default {
		data() {
			return {
				content: {
					name: "",
					phone: "",
					comName: "",
				}
			};
		},
		computed: {
			...mapState(["HomeContent"]),
		},
		methods: {
			// 提交
			confirmInfo() {
				let that = this
				if (!this.content.name) {
					this.$tools.msg("请输入姓名")
					return;
				}
				if (!this.content.phone) {
					this.$tools.msg("请输入手机号")
					return;
				}
				if (!this.content.comName) {
					this.$tools.msg("请输入企业全称")
					return;
				}
				console.log('content', this.content)
				that.$model.getApplyfor(this.content).then(res => {
					if (res.code == 0) {
						that.$tools.msg("注册成功，账号/密码同手机号!");
						setTimeout(function() {
							uni.redirectTo({
								url: "/pageTwo/login/login"
							})
						}, 2000)

					} else {
						that.$tools.msg(res.message);
					}
				});
			},
		},
		onLoad(options) {},
	};
</script>

<style scoped="scoped" lang="scss">
	.zhizhao,
	.touxiang {
		justify-content: center;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.lan {
		margin: 0 10px !important;
	}

	.right {
		/deep/input {
			width: 100%;
		}
	}

	.radio {
		width: 100%;
		height: 40px;
		line-height: 40px;
		display: flex;
		justify-content: space-between;
		align-items: center;

		label {
			display: flex;
		}

		icon {
			color: #dfdfdf;
			font-size: 22px;
			margin-right: 5px;
		}

		.icon-yuanxingxuanzhongfill {
			color: $uni-color-success;
		}

		:nth-child(3) {
			width: 50%;

			view {
				width: 50%;
				display: flex;
			}

			/deep/input {
				width: 50% !important;
				border-bottom: 1px solid #dfdfdf;
			}
		}
	}

	.checkbox {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;

		label {
			width: 33%;
			display: flex;
			font-size: 12px;
			margin: 5px 0;
			align-items: center;
		}
	}
</style>