<wxs src="../../../../core/wxs/dictionary.wxs" module="dictionary" />
<!--module/user/pages/user-certification/user-certification.wxml-->
<t-navbar title="完善信息" left-arrow="{{!hide}}" />
<scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
  <form bindsubmit="onSubmit">
    <view class="open-button">
      <t-cell t-class="cell-border-gradient" required title="手机号" hover="{{!model['phone']}}" note="{{model['phone'] || '点击获取手机号码'}}">
        <t-loading wx:if="{{loading}}" theme="spinner" size="24rpx" slot="note" />
      </t-cell>
      <button wx:if="{{!loading && !model['phone']}}" class="open-button__inner" size="mini" open-type="getRealtimePhoneNumber" bind:getrealtimephonenumber="getPhoneNumber">选择授权手机</button>
    </view>
    <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper" required title="姓名">
      <input class="cell-field__inner" slot="note" name="name" value="{{model['name']}}" type="text" placeholder="请输入姓名" confirm-type="next" />
    </t-cell>
    <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper" required title="身份证号">
      <input class="cell-field__inner" slot="note" name="cardno" model:value="{{model['cardno']}}" type="idcard" placeholder="请输入身份证号" maxlength="18" confirm-type="next" bind:blur="verifyCardno" />
      <t-loading wx:if="{{verifying}}" slot="note" theme="spinner" size="24rpx" slot="note" />
    </t-cell>
    <t-cell t-class="cell-border-gradient" required title="年龄" note="{{model['age']}}岁" />
    <t-cell t-class="cell-border-gradient" required title="性别" note="{{dictionary.label($dictionaries, 'sys_user_sex', model['sex'])}}" />
    <user-data-edit model="{{model}}" retractable="{{true}}" dirty="{{dirty}}"></user-data-edit>

    <view class="privacy-contract-wrapper">
      <t-radio t-class="privacy-contract" t-class-border="no-border" icon="circle" block="{{false}}" checked="{{privacyContract.agree}}" bind:change="onAgreeChange">
        <text slot="content" style="font-size: 14px;">我已阅读与同意 <text class="name" catch:tap="openPrivacyContract">{{privacyContract.name}}</text></text>
      </t-radio>
    </view>

    <form-button block index="1"></form-button>
  </form>
</scroll-view>

<t-message id="{{$messageId}}" />
<popup-privacy show="{{privacyContract.show}}" bind:setting="onPrivacySetting" bind:agree="onAgree"></popup-privacy>