<!--pages/register/register.wxml-->
<view class="container">
  <view class="title">注册</view>
  <wux-form
    id="wux-form"
    layout="{{ layout }}"
    validateMessages="{{ validateMessages }}"
    bind:change="onValuesChange"
  >
    <wux-field name="phone" label="手机号" initialValue="{{''}}" rules="{{ [{ required: true,message:'' },{ validator: 'checkPhone' } ] }}">
      <wux-input maxlength="11" placeholder="请输入手机号" />
    </wux-field>
    <wux-field name="code" label="验证码" rules="{{ [{ required: true, message: '验证码不能为空' }] }}">
        <wux-input placeholder="请输入验证码" />
        <view slot="extra" style="color: #387ef5; padding-left: 12px;" bind:tap="onSendCode">{{ c2 || '发送验证码'}}</view>
    </wux-field>
    <wux-field name="name" label="用户名">
        <wux-input placeholder="请输入用户名" />
    </wux-field>
    <wux-field name="email" label="邮箱" rules="{{ [{ required: false },{type:'email',message:'邮箱格式错误'}] }}">
        <wux-input placeholder="请输入邮箱" />
    </wux-field>
    <view slot="footer" class="btn-area btn-area_auto">
        <button type="primary" bindtap="onSubmit">注册</button>
      </view>
  </wux-form>
</view>