<template>
	<view class="se-p-30">
		<uv-form labelPosition="top" :model="form" :rules="rules" ref="form">
			<uv-form-item label="账号" prop="name" >
				<uv-input v-model="form.name" type="text" placeholder="请输入账号" customStyle="border-radius: 30px;margin-top:5px;background-color: #ffffff;padding:5px 20px;" border="none"></uv-input>
			</uv-form-item>
			<uv-form-item label="密码" prop="password">
				<uv-input v-model="form.password" type="password" placeholder="请输入密码" customStyle="border-radius: 30px;margin-top:5px;background-color: #ffffff;padding:5px 20px;" border="none"></uv-input>
			</uv-form-item>
			<uv-form-item>
				<uv-button type="primary" text="登录" customStyle="margin-top: 30px;background-color: #1EC7B6;border-radius: 30px;" @click="submit"></uv-button>
			</uv-form-item>
		</uv-form>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				form:{
					name:"",
					password:""
				},
				rules:{
					name:[
						{
							type: 'string',
							required: true,
							message: '请输入账号',
							trigger: ['blur', 'change']
						}
					],
					password:[
						{
							type: 'string',
							required: true,
							message: '请输入密码',
							trigger: ['blur', 'change']
						}
					]
				}
			}
		},
		methods:{
			submit() {
				uni.navigateTo({
					url:"/pages_subpack/house/index"
				})
				this.$refs.form.validate().then(res => {
					uni.showToast({
						icon: 'none',
						title: '校验通过'
					})
				}).catch(errors => {
					uni.showToast({
						icon: 'none',
						title: '校验失败'
					})
				})
			}
		}
	}
</script>

<style>
	page{
		background-color: #f5f5f5;
		
	}
</style>