<template>
	<view class="container avstarBack relative">
		<uni-navbar title="忘记账号"></uni-navbar>
		<view class="box commonMt relative">
			<view class="absolute">
				<view class="choose-line-bottom commonBj ">
					<u--form :model="form" ref="formRef" :rules="rules" labelWidth="0" class="formStyle">
						<u-form-item prop="name" ref="form1">
							<view class="redCircle"></view>
							<text class="itemText">企业名称</text>
							<u-input class="inputStyle" v-model="form.name" placeholder="请输入企业名称">
							</u-input>
						</u-form-item>
						<u-form-item prop="abbreviation">
							<view class="redCircle"></view>
							<text class="itemText">企业简称</text>
							<u-input class="inputStyle" v-model="form.abbreviation" placeholder="请输入企业简称">
							</u-input>
						</u-form-item>
						<u-form-item prop="creadit">
							<view class="redCircle"></view>
							<text class="itemText">信用代码</text>
							<u-input class="inputStyle" v-model="form.creadit" placeholder="请输入信用代码">
							</u-input>
						</u-form-item>
						<u-form-item prop="legal">
							<view class="redCircle"></view>
							<text class="itemText">企业法人</text>
							<u-input class="inputStyle" v-model="form.legal" placeholder="请输入企业法人姓名" />
						</u-form-item>
						<u-form-item prop="phone">
							<view class="redCircle"></view>
							<text class="itemText">联系电话</text>
							<u-input class="inputStyle" v-model="form.phone" placeholder="请输入联系电话" />
						</u-form-item>
					</u--form>
				</view>
				<u-button @click="submit" shape="circle" color="linear-gradient(to top, #F59A02, #FFD334 )"  class="buttonStyle mt33 commonMb buttonLang">确认</u-button>
			</view>
		</view>

		<tooltipNew :show="isSuccess" type='type4' @close='close' :username='username'></tooltipNew>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				username: 'jsh4578',
				// 查询成功过后的弹出框
				isSuccess: false,
				form: {
					name: '',
					abbreviation: '',
					creadit: '',
					legal: '',
					phone: ''
				},
				rules: {
					name: [{
						required: true,
						message: '请输入企业名称',
						trigger: ['blur', 'change']
					}, ],
					password: [{
						required: true,
						message: '请设置登录密码',
						trigger: ['blur', 'change']
					}, ],
					abbreviation: [{
						required: true,
						message: '请输入企业简称',
						trigger: ['blur', 'change']
					}, ],
					creadit: [{
						required: true,
						message: '请输入18位企业统一信用代码',
						validator: (rule, value, callback) => {

							if (value.length === 18) {
								return true;
							} else {
								return false;
							}

						},
						trigger: ['blur', 'change']
					}, ],
					legal: [{
						required: true,
						message: '请输入企业法人姓名',
						trigger: ['blur', 'change']
					}, ],
					phone: [{
						required: true,
						message: '请输入联系电话',
						trigger: ['blur', 'change']
					}, ]
				}
			}
		},
		methods: {
			close() {
				this.isSuccess = false;
			},
			submit() {
				// this.$refs.uForm.validate().then(res => {
				// 	this.$tab.reLaunch('/pages/register/index')
				// 	uni.$u.toast('校验通过')
				// }).catch(errors => {
				// 	console.log(errors,'errors');
				// 	uni.$u.toast('校验失败')
				// })
				this.isSuccess = true
			}
		}
	}
</script>

<style lang="scss" scoped>
	.relative {
		position: relative;
	}

	.absolute {
		position: absolute;
		bottom: 46rpx;
		width: 100%;
	}

	.avstarBack {
		background-image: url(@/static/images/editInfo/forgetUsername.png);
	}

	.choose-line-bottom {
		padding: 41rpx 35rpx;
	}

	.mt33 {
		margin-top: 33rpx;
	}

	.mt {
		margin-top: 26rpx;
	}
</style>
