<view class="areaAgent">
  <view class="banner">
    	<image wx:if="{{upload_flag}}" class="img" style="width:100%;height:307rpx;" src="{{apply_background}}" mode="widthFix" />
    	<image wx:else  class="img" style="width:100%;height:307rpx;" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/applyRegionalAgency.jpg" mode="widthFix"  />
  </view>
  <!-- 可申请 -->
  <view class="content" wx:if="{{apply=='1'}}">
    <van-field value="{{ name }}" placeholder="请填写姓名" class="inp" border="{{ false }}" bind:blur="onChangeOne" />
    <van-field value="{{ phone }}" placeholder="请填写手机号" class="inp" border="{{ false }}" bind:blur="onChangeTwo" />
    <van-field value="{{ username }}" placeholder="请填写登录账号" class="inp" border="{{ false }}" bind:blur="onChangeThree" />
    <van-field value="{{ password }}" type="password" placeholder="请填写登录密码" class="inp" border="{{ false }}" bind:blur="onChangeFour" />
    <van-field value="{{ selectLevel.name }}" readonly catchtap="onshow" placeholder="代理等级" class="inp" border="{{ false }}" />
    <van-field value="{{ provicevalue }}" readonly catchtap="selectProviceHandleShow" placeholder="省级区域" wx:if="{{prozoneshow}}" class="inp" border="{{ false }}" />
    <van-field value="{{ cityvalue }}" readonly placeholder="市级区域" catchtap="showCity" wx:if="{{cityzoneshow}}" class="inp" border="{{ false }}" />
    <van-field value="{{ regionvalue }}" readonly placeholder="区/县级区域" catchtap="showReg" wx:if="{{regzoneshow}}" class="inp" border="{{ false }}" />
    <van-field value="{{ streetvalue }}" readonly placeholder="街道/乡镇区域" wx:if="{{strshow}}" catchtap="showStr" class="inp" border="{{ false }}" />
    <button type="button" style="color:#fff;background-color: #f15353;" data-bler="false" catchtap="submit" class="submit">
      提 交
    </button>
    <view class="agreement" wx:if="{{is_open_agreement==1}}">
        <van-checkbox
              value="{{ is_agreement }}"
              checked-color="rgb(241, 83, 83)"
              shape="square"
              icon-size="55rpx"
              bind:change="changeAgreement">
                  <text catchtap="setExplainFlag">申请协议</text>
        </van-checkbox>
    </view>
  </view>
  <!-- 驳回再次提交审核 -->
  <view class="content" wx:if="{{apply=='2'}}">
    <van-field value="{{ name }}" placeholder="请填写姓名" class="inp" border="{{ false }}" bind:blur="onChangeOne" />
    <van-field value="{{ phone }}" placeholder="请填写手机号" class="inp" border="{{ false }}" bind:blur="onChangeTwo" />
    <van-field value="{{ username }}" placeholder="请填写登录账号" class="inp" border="{{ false }}" bind:blur="onChangeThree" />
    <van-field value="{{ password }}" type="password" placeholder="请填写登录密码" class="inp" border="{{ false }}" bind:blur="onChangeFour" />
    <van-field value="{{ selectLevel.name }}" readonly catchtap="onshow" placeholder="代理等级" class="inp" border="{{ false }}" />
    <van-field value="{{ provicevalue }}" readonly catchtap="selectProviceHandleShow" placeholder="省级区域" wx:if="{{prozoneshow}}" class="inp" border="{{ false }}" />
    <van-field value="{{ cityvalue }}" readonly placeholder="市级区域" catchtap="showCity" wx:if="{{cityzoneshow}}" class="inp" border="{{ false }}" />
    <van-field value="{{ regionvalue }}" readonly placeholder="区/县级区域" catchtap="showReg" wx:if="{{regzoneshow}}" class="inp" border="{{ false }}" />
    <van-field value="{{ streetvalue }}" readonly placeholder="街道/乡镇区域" wx:if="{{strshow}}" catchtap="showStr" class="inp" border="{{ false }}" />
    <button type="button" style="color:#fff;background-color: #f15353;" data-bler="true" catchtap="submit" class="submit">
      提 交
    </button>
  </view>
  <!-- 待审核 -->
  <view class="success" wx:if="{{apply=='0'}}">
    <view class="ico">
      <icon class="iconfont icon-record_go"></icon>
    </view>
    <view class="text">{{tipMsg}}</view>
    <view class="a" catchtap="goHome">
      <view class="sub">去商城逛逛</view>
    </view>
  </view>
  <!-- 申请被驳回不可再申请 -->
  <view class="success" wx:if="{{apply=='3'}}">
    <view class="ico">
      <icon class="iconfont icon-record_go"></icon>
    </view>
    <view class="text">{{tipMsg}}</view>
    <view class="a" catchtap="goHome">
      <view class="sub">去商城逛逛</view>
    </view>
  </view>
  <view class="vip_main" wx:if="{{!isCheck}}">
    <view class="title">推广特权</view>
    <view class="vip vip1">
      <view class="ico1">
        <icon class=" iconfont  icon-extension_code"></icon>
      </view>
      <view class="text">
        <view class="t1">专属二维码</view>
        <view class="t2">拥有专属推广二维码，用于推广客户；</view>
      </view>
    </view>
    <view class="vip">
      <view class="ico2">
        <icon class=" iconfont  icon-pay_a"></icon>
      </view>
      <view class="text">
        <view class="t1">推广收入</view>
        <view class="t2">推广的客户购买商品后，您将获得相应的推广收入；</view>
      </view>
    </view>
  </view>
  <!-- 等级弹窗 -->
  <van-popup show="{{ selshow }}" position="right" custom-style="width:100%;height:100%;background:#fff;" overlay="{{ false }}" bind:close="onClose">
    <view class="level">
      <van-nav-bar title="代理等级" left-arrow bind:click-left="onClickLeft" />
      <view wx:for="{{level}}" data-item="{{item}}" catchtap="getlevelVal" style="display:flex;justify-content:space-between;padding: 0 5px;align-items:center;font-size:14px;color:#555;height:100rpx;" wx:key="index">
        <span style="color: #555;font-size:14px;">{{item.name}}</span>
        <van-icon name="arrow"></van-icon>
      </view>
    </view>
  </van-popup>
  <!-- 省级区域 -->
  <van-popup show="{{ proshow }}" position="right" custom-style="width:100%;height:100%;background:#fff;" overlay="{{ false }}" bind:close="onClose">
    <view class="provicevalue" style="height:100%;overflow-y:scroll;">
      <van-nav-bar title="省级区域" left-arrow bind:click-left="onClickLeft" />
      <view wx:for="{{provinceoptions}}" wx:key="index" data-item="{{item}}" catchtap="selectProviceHandle" style="display:flex;justify-content:space-between;padding: 0 14px;align-items:center;font-size:14px;color:#555;height:100rpx;">
        <span>{{item.areaname}}</span>
        <van-icon name="arrow"></van-icon>
      </view>
    </view>
  </van-popup>
  <!-- 市级区域 -->
  <van-popup show="{{ cityshow }}" position="right" custom-style="width:100%;height:100%;background:#fff;" overlay="{{ false }}" bind:close="onClose">
    <view class="city" style="height:100%;overflow-y:scroll;">
      <van-nav-bar title="市级区域" left-arrow bind:click-left="onClickLeft" />
      <view wx:for="{{cityoptions}}" wx:key="index" data-item="{{item}}" catchtap="selectCityHandle" style="display:flex;justify-content:space-between;padding: 0 14px;align-items:center;font-size:14px;color:#555;height:100rpx;">
        <span>{{item.areaname}}</span>
        <van-icon name="arrow"></van-icon>
      </view>
    </view>
  </van-popup>
  <!-- 区/县级区域 -->
  <van-popup show="{{ regshow }}" position="right" custom-style="width:100%;height:100%;background:#fff;" overlay="{{ false }}" bind:close="onClose">
    <view class="level" style="height:100%;overflow-y:scroll;">
      <van-nav-bar title="区/县级区域" left-arrow bind:click-left="onClickLeft" />
      <view wx:for="{{regionoptions}}" wx:key="index" data-item="{{item}}" catchtap="selectRegionHandle" style="display:flex;justify-content:space-between;padding: 0 14px;align-items:center;font-size:14px;color:#555;height:100rpx;">
        <span>{{item.areaname}}</span>
        <van-icon name="arrow"></van-icon>
      </view>
    </view>
  </van-popup>
  <!-- 街道/乡镇区域 -->
  <van-popup show="{{ streetshow }}" position="right" custom-style="width:100%;height:100%;background:#fff;" overlay="{{ false }}" bind:close="onClose">
    <view class="level" style="height:100%;overflow-y:scroll;">
      <van-nav-bar title="街道/乡镇区域" left-arrow bind:click-left="onClickLeft" />
      <view wx:for="{{stroptions}}" wx:key="index" style="display:flex;justify-content:space-between;padding: 0 14px;align-items:center;font-size:14px;color:#555;height:100rpx;" data-item="{{item}}" catchtap="selectStrionHandle">
        <span>{{item.areaname}}</span>
        <van-icon name="arrow"></van-icon>
      </view>
    </view>
  </van-popup>

   <!-- 协议 -->
   <van-popup show="{{ agreementShow }}" position="right" custom-style="width:100%;height:100%;background:#fff;" overlay="{{ false }}" bind:close="onClose">
    <view class="level" style="height:100%;overflow-y:scroll;">
      <van-nav-bar title="申请协议" left-arrow bind:click-left="onClickLeft" />
      <rich-text nodes="{{agreement}}"></rich-text>
    </view>
  </van-popup>

</view>