<!-- 账号密码登录 accountLogin  -->
<template>
  <view>
    <!-- 表单项 -->
    <u-form
      ref="accountLoginRef"
      labelWidth="140"
      labelAlign="left"
      labelPosition="top"
    >
      <u-form-item prop="loginName" label="手机号">
        <view class="input-line">
					<u-input
							placeholder="请输入手机号"
							v-model="model.loginName"
							border="none"
							type="number"
							maxlength="11"
					></u-input>
        </view>
      </u-form-item>

      <u-form-item prop="password" label="密码">
        <view class="input-line">
					<u-input
						type="password"
						placeholder="请输入密码"
						v-model="model.password"
						border="none"
					></u-input>
        </view>
      </u-form-item>
    </u-form>
  </view>
</template>

<script>
	import {login} from '@/common/request/apis/login'
	export default{
		data() {
			return {
				model:{
					loginName:'',
					password:''
				},
			}
		},
		methods:{
			accountLoginSubmit() {
			  // if(!uni.$u.test.mobile(this.model.mobile)){
			  // 	return uni.$u.toast("请输入正确手机号");
			  // }
			  if(!this.model.password) {
			  	return uni.$u.toast("请输入密码");
			  }
			  uni.$u.toast("登录成功!");
				login(this.model)
				.then(res=>{
					
				})
			  // setTimeout(()=>{
					// uni.redirectTo({
					// 	url:'/pages/index/index'
					// })
			  // },1000)
			}
		}
	}

</script>

<style lang="scss" scoped>
// @import "../index.scss";
.input-line {
	display: flex;
	align-items: center;
	width: 100%;
  background-color: #f5f7fb;
  border-radius: 16rpx;
  padding-left: 30rpx;
  height: 88rpx;
  box-sizing: border-box;
}
</style>
