<template>
  <auth-wrap class="register-container" ref="authWrap">
    <view class="form-content" slot="content">
      <u--form
          labelPosition="left"
          :model="model1"
          :rules="rules"
          ref="uForm"
      >
        <u-form-item
            prop="userInfo.name"
            borderBottom
            ref="item1"
        >
          <u--input
              prefixIcon="account"
              v-model="model1.userInfo.name"
              border="none"
          ></u--input>
        </u-form-item>
        <u-form-item
            prop="userInfo.tel"
            borderBottom
            ref="item1"
        >
          <u--input
              prefixIcon="phone"
              placeholder="输入手机号"
              border="none"
              v-model="model1.userInfo.tel"
          ></u--input>
        </u-form-item>

        <u-form-item
            label="性别"
            prop="userInfo.sex"
            borderBottom
        >
          <u--input
              v-model="model1.userInfo.sex"
              disabled
              disabledColor="#ffffff"
              placeholder="请选择性别"
              border="none"
          ></u--input>
          <u-icon
              slot="right"
              name="arrow-right"
          ></u-icon>
        </u-form-item>
      </u--form>
    </view>
  </auth-wrap>
</template>

<script>

import { ICON_CFG } from '@/common/EnumConst';
import AuthWrap from '@/components/AuthComp/index.vue';
import { getImageUrl, setStorageObj } from '@/util';

export default {
  name: 'login',
  components: { AuthWrap },
  props: {},
  data() {
    return {
      ICON_CFG,
      model1: {
        userInfo: {
          name: 'uView UI',
          sex: '',
        },
      },
      actions: [{
        name: '男',
      },
        {
          name: '女',
        },
        {
          name: '保密',
        },
      ],
      rules: {
        'userInfo.name': {
          type: 'string',
          required: true,
          message: '请填写姓名',
          trigger: ['blur', 'change']
        },
        'userInfo.sex': {
          type: 'string',
          max: 1,
          required: true,
          message: '请选择男或女',
          trigger: ['blur', 'change']
        },
      },
    };
  },
  created() {
  },
  onLoad() {
    //如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
    this.$refs.uForm.setRules(this.rules)
  },
  onReady() {
    //如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
    this.$refs.uForm.setRules(this.rules)
  },
  methods: {
    getImageUrl,
  },
};
</script>
<style lang="scss" src="./index.scss" />;
