<!--components/popup-user-auth/popup-user-auth.wxml-->
<t-popup placement="bottom" show-overlay="{{overlay}}" visible="{{visible}}">
  <view class="popup">
    <view class="popup__header">{{title}}</view>
    <view class="popup__content">
      <form class="user-auth-form" bindsubmit="onSubmit">
        <view wx:if="{{!phoneProps.length}}" class="open-button">
          <t-cell t-class="cell-border-gradient phone-cell" t-class-note="note-class" required title="手机号" hover="{{!phoneProps.fill}}" note="{{loading ? '' : phoneProps.fill || '点击获取手机号码'}}">
            <t-loading wx:if="{{loading}}" theme="spinner" size="24rpx" slot="note" />
          </t-cell>
          <button wx:if="{{!loading && !phoneProps.fill}}" class="open-button__inner" size="mini" open-type="getPhoneNumber" bind:getphonenumber="getPhoneNumberHandle">选择授权手机</button>
        </view>
        <label wx:else>
          <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper" required title="手机号">
            <view class="field-container" slot="note">
              <text wx:if="{{phoneProps.prefix}}">{{ phoneProps.prefix }}</text>
              <input name="phone" type="number" model:value="{{phoneProps.fill}}" maxlength="{{phoneProps.length}}" placeholder="请补充" placeholder-style="color:#F76260" confirm-type="next" />
              <text wx:if="{{phoneProps.suffix}}">{{ phoneProps.suffix }}</text>
            </view>
          </t-cell>
        </label>
        <label wx:if="{{cardnoProps.length}}">
          <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper" required title="身份证号">
            <view class="field-container" slot="note">
              <text wx:if="{{cardnoProps.prefix}}">{{ cardnoProps.prefix }}</text>
              <input name="cardno" type="idcard" model:value="{{cardnoProps.fill}}" maxlength="{{cardnoProps.length}}" placeholder="请补充" placeholder-style="color:#F76260" confirm-type="next" />
              <text wx:if="{{cardnoProps.suffix}}">{{ cardnoProps.suffix }}</text>
            </view>
          </t-cell>
        </label>
        <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" loading="{{submitting}}" disableOnClick="{{false}}">提交</form-button>
      </form>
    </view>
  </view>
</t-popup>
<popup-privacy show="{{privacyContract.show}}" overlay="{{false}}" bind:setting="onPrivacySetting" bind:agree="onAgree" bind:disagree="onDisagree" />