<!--packageI/member_cancel/member_cancel.wxml-->
<!-- 注销 -->
<block wx:if="{{!isSubmitted}}">
    <view class="cancellation" wx:if="{{!showMobileVerification}}">
    <view class="title">{{ cancelInfo.title }}</view>
    <!-- 富文本 -->
    <view style="width: 100%;">
      <rich-text style="width: 100%;"  class="rich-nodes" nodes="{{cancelInfo.content}}"></rich-text>
    </view>
    <view class="bottom-box">
      <van-checkbox value="{{ checked }}" bind:change="onAgree">我已阅读并同意</van-checkbox>
      <view class="btn-submit {{checked ? '' : 'disabled'}}" bindtap="submit">提交</view>
    </view>
  </view>

  <view class="mobile-verification" wx:else>
    <van-field value="{{country}}" wx:if="{{cancelInfo.country_code}}" bind:change="changeInput" data-key="country" center clearable placeholder="+86" label="国家区号">
    </van-field>

    <van-field value="{{mobile}}" bind:change="inpMobile" type="number" center clearable placeholder="请输入手机号" label="手机号">
      <!-- <icon class="iconfont icon-verification_phone" slot="left-icon"></icon> -->
    </van-field>

    <van-field value="{{captcha}}" wx:if="{{imgCaptcha}}"  bind:change="changeInput"  data-key="captcha" center clearable placeholder="请输入图形验证码" label="图形验证码">
      <image slot="button" class="captcha" mode="aspectFit" src="{{imgCaptcha}}" bindtap="getCaptcha"></image>
    </van-field>

    <van-field value="{{code}}"  bind:change="inpCode" center clearable placeholder="手机验证码" label="验证码">
      <!-- <icon class="iconfont icon-fontclass-yanzhengma" slot="left-icon"></icon> -->
      <van-button slot="button" size="small" round plain type="info" bindtap="sendCode" 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="btn-submit" bindtap="checkCode">申请注销</view>
  </view>
</block>


<view class="succesed" wx:else>
  <image class="img" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/audit_succeed@2x.png" alt=""></image>
  <view>账号注销申请已提交，等待审核~</view>
  <view class="btns">
    <view class="btn-cancel" bindtap="revoke">取消申请</view>
    <view class="btn-back" bindtap="back">返回</view>
  </view>
</view>


<van-popup show="{{showConfirm}}" round custom-style="width: 80%;" bind:close="closeConfirmPopup">
  <view class="confirm-popup">
    <view class="pop-title">账户注销确认</view>
    <view class="pop-content">账户一旦注销后，无法找回。您的个人信息，个人财产，优惠券等数据将失效，且不能恢复。确定提交注销申请？</view>
    <view class="bottom-btns">
      <view class="clanel" bindtap="closeConfirmPopup">暂不注销</view>
      <view class="confirm" bindtap="confirmCancel">确认注销</view>
    </view>
  </view>
</van-popup>