<!--packageH/signPage/personBank/personBank.wxml-->
<view class="form">
  <!-- 第一步认证------阅读同意协议 -->
  <view class="agree-box" wx:if="{{step === 1}}">
    <image class="renzheng-img" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/sign/yq_sign_renzheng@2x.png"  mode='widthFix'></image>
    <rich-text style="padding: 20rpx; text-align: center" nodes="{{agreement.auth_notice_desc}}"></rich-text>
    <!--<view style="display: inline-block; margin-top: 25rpx;">-->
      <!--<van-checkbox-group value="{{checkboxGroup}}"  style="display: flex; justify-content: center; font-size: 12px;" bind:change="handlerInput" data-type="checkboxGroup">-->
        <!--<van-checkbox name="1">我已阅读并同意</van-checkbox><text class="link" bindtap="showProtocol">《实名认证服务协议》</text>-->
      <!--</van-checkbox-group>-->
    <!--</view>-->
    <view class="btn" bindtap="getMemberData">开始认证</view>
  </view>

  <!-- 个人认证 -->
  <view class="content" wx:if="{{step === 2 || step === 3}}">
      <form bind:submit="onSubmit">
        <van-field
          value="{{form.name}}"
          data-type="form.name"
          name="姓名"
          label="姓名"
          placeholder="请填写姓名"
          bind:change="handlerInput"
        />
        <van-field
          value="{{form.id_no}}"
          data-type="form.id_no"
          name="身份证号"
          label="身份证号"
          placeholder="请填写身份证号"
          bind:change="handlerInput"
        />
        <van-field
          value="{{form.tel}}"
          data-type="form.tel"
          type="number"
          name="手机号"
          label="手机号"
          placeholder="请填写手机号"
          bind:change="handlerInput"
        />

        <view class="inp-item">
          <view class="item-box">
            <view class="left-text" style="width: 200rpx;">认证方式</view>
            <view class="right-content" style="flex: 1;">
              <van-radio-group
                slot="input"
                style="display: flex; flex-wrap: wrap;"
                value="{{activeName}}"
                bind:change="handlerInput"
                data-type="activeName"
              >
                <van-radio class="van-radio" name="1">手机号认证</van-radio>
                <van-radio class="van-radio" name="2">银行卡认证</van-radio>
                <!--<van-radio class="van-radio" name="3">人脸识别认证</van-radio>-->
              </van-radio-group>
            </view>
          </view>
        </view>

        <van-field
          value="{{bank_no}}"
          wx:if="{{step === 3 && activeName === '2'}}"
          name="个人银行卡号"
          label="个人银行卡号"
          placeholder="请填写个人银行卡号"
          data-type="bank_no"
          bind:change="handlerInput"
        />

        <van-field wx:if="{{step === 3 && (activeName=='1' || activeName=='2')}}"
          value="{{authcode}}"
          center
          clearable
          label="短信验证码"
          placeholder="请输入短信验证码"
          data-type="authcode"
          bind:change="handlerInput"
          use-button-slot
        >
          <van-button slot="button" size="small" round plain type="info" catchtap="sureIdentify" wx:if="{{count <= 0}}">
            获取验证码
          </van-button>
          <van-button slot="button" size="small" round plain type="info" disabled wx:if="{{count> 0}}">
            {{count}}秒后重新获取
          </van-button>
        </van-field>

        <view class="inp-item" wx:if="{{step === 3 && activeName === '3'}}">
          <view class="item-box">
            <view class="left-text" style="width: 200rpx;">识别方式</view>
            <view class="right-content" style="flex: 1;">
              <van-radio-group value="{{form.face_auth_mode}}" bind:change="handlerInput" data-type="form.face_auth_mode">
                <van-radio style="display: flex;" name="1">支付宝人脸识别</van-radio>
                <van-radio style="display: flex; margin-top: 10px;" name="2">腾讯云人脸识别</van-radio>
              </van-radio-group>
            </view>
          </view>
        </view>
      </form>

      <view class="btn" catchtap="toStep" wx:if="{{step === 2}}">进行认证</view>
      <view class="btn" catchtap="sendCode" wx:if="{{step === 3}}">立即认证</view>
    </view>

    <!-- 弹出框 -->
    <van-popup
    show="{{protocolShow}}"
    position="right"
    overlay="{{false}}"
    custom-style="width: 100%; height: 100%;"
    >
      <view class="protocolcontent">
        <van-nav-bar
          title="实名认证服务协议"
          left-text="返回"
          right-text=""
          left-arrow
          bind:click-left="closePopup"
          style="position: sticky; top: 0;"
        />
        <view style="padding: 10px;">
          <rich-text nodes="{{agreement.auth_agreement_desc}}"></rich-text>
        </view>
      </view>
    </van-popup>
</view>
