<!--packageH/Advertising/advertisingApply/advertisingApply.wxml-->
<view id="Advertising-apply">
  <image src="{{configInfo.banner}}" style="width:100%" wx:if="{{configInfo.banner}}" mode="widthFix"></image>
  <block wx:if="{{configInfo&&configInfo.status == 1}}">
    <view class="main">
      <view class="titel-border">
        <view class="border-r"></view>
        申请信息
      </view>
      <van-field value="{{ apply.realname }}" label="姓名" border="{{ false }}" required placeholder="请输入姓名"
        input-align="right" bind:blur="realnameinp"/>
      <van-field value="{{ apply.mobile }}" label="手机号" border="{{ false }}" required placeholder="请输入联系电话"
        input-align="right" bind:blur="mobileinp"/>
      <van-field value="{{ apply.gender }}" bindtap="showSexs" label="性别" border="{{ false }}"
        placeholder="请选择性别" input-align="right" readonly right-icon="arrow" />
      <van-cell required="{{true}}" title="请选择所在区域 " bind:click="addressShowbtn"
        value="{{addressName?addressName:'选择区域'}}" is-link border="{{ false }}" />
      <van-cell wx:if="{{strShow}}" title="所在街道：" border="{{ false }}" bind:click="streetShowbtn" value="{{street?street:'选择街道'}}" is-link />
      <van-field value="{{ apply.address }}" rows="1" border="{{ false }}" input-align="right" autosize label="详细地址"
        type="textarea" bind:blur="addressinp" placeholder="请输入详细地址" />
      <van-cell title="上传证件" required border="{{ false }}" />
      <view class="certificate-arr">
        <view class="certificate-box">
          <yz_uploader bind:updateImages="updateFrontIDcard" max_count="1"></yz_uploader>
          <view class="certificate-title">上传身份证人像面</view>
        </view>
        <view class="certificate-box">
          <yz_uploader bind:updateImages="updatebackIDcard" max_count="1"></yz_uploader>
          <view class="certificate-title">上传身份证国徽面</view>
        </view>
        <view class="certificate-box">
          <yz_uploader bind:updateImages="updatebusinessFlie" max_count="1"></yz_uploader>
          <view class="certificate-title">经营许可证</view>
        </view>
        <view class="certificate-box">
          <yz_uploader bind:updateImages="updateGenerateFlie" max_count="1"></yz_uploader>
          <view class="certificate-title">生产许可证</view>
        </view>
      </view>
      <van-cell title="其他证件" border="{{ false }}" />
      <view class="certificate-arr other-file-box">
        <view class="certificate-box">
          <yz_uploader bind:updateImages="updateotherFlie"></yz_uploader>
        </view>
      </view>

      <view class="protocol-box">
        <van-checkbox value="{{checked}}" bind:change="onChangechecked">
          <view class="text-color" catchtap="showProtocols">《申请协议》</view>
        </van-checkbox>
      </view>

      <van-popup show="{{showProtocol}}" closeable bind:close="onCloseProtocol" round custom-style="width: 630rpx">
          <view class="Protocol-popup">
            <view class="title-h1">申请协议</view>
            <view class="Protocol-text">
              <mp-html content="{{configInfo.protocol}}" />
              <!-- <rich-text nodes="{{configInfo.protocol}}"></rich-text> -->
            </view>
          </view>
        </van-popup>


      <van-popup show="{{showSex}}" bind:close="onCloseSex" closeable round custom-style="width: 500rpx; height: 320rpx">
        <view class="sex-title">请选择您的性别</view>
        <view class="sex-select">
          <view class="sex-child {{sexId == 1?'active-select-radio':''}}" catchtap="selcetSex" data-tag="1">
            <view class="sex-icon">
              <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/man_icon.png" alt="" />
            </view>
            <icon class="iconfont icon-all_select_active"></icon>
            男
          </view>
          <view style="color:#999;">或</view>
          <view class="sex-child {{sexId == 2?'active-select-radio':''}}" catchtap="selcetSex" data-tag="2">
            <view class="sex-icon">
              <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/woman_icon.png" alt="" />
            </view>
            <icon class="iconfont icon-all_select_active"></icon>
            女
          </view>
        </view>
      </van-popup>


      <view class="b-mask {{addressShow}}" bindtap="_closeDateLw"></view>
      <view class="dateBe {{addressShow}}">
        <view class="head">
          <view class="ll" bindtap="_closeDateLw">取消</view>
          <view class="rr" bindtap="resultAdd">确定</view>
        </view>
        <view class="main">
          <picker-view indicator-style="height: 50px;" style="width: 100%; height: 300px;"
            value="{{[pickerValue[0],pickerValue[1],pickerValue[2]]}}" bindchange="bindChange">
            <picker-view-column id="provinceData">
              <view wx:for="{{provinceData}}" wx:key="index" style="line-height: 50px">{{item.areaname}}</view>
            </picker-view-column>
            <picker-view-column id="cityData">
              <view wx:for="{{cityData}}" wx:key="index" style="line-height: 50px">{{item.areaname}}</view>
            </picker-view-column>
            <picker-view-column id="districtData">
              <view wx:for="{{districtData}}" wx:key="index" style="line-height: 50px">{{item.areaname}}</view>
            </picker-view-column>
          </picker-view>
        </view>
      </view>
      <van-popup show="{{streetShow}}" custom-style="width:100%;height:100%;overflow:auto" position="right"
        bind:close="onClose">
        <van-nav-bar title="选择街道" left-text="" right-text="" left-arrow bind:click-left="treetShowLeft" />
        <view class="content">
          <block wx:for="{{districtVal}}" wx:key="index">
            <van-cell title="{{item.areaname}}" data-item="{{item}}" bind:click="streetConfirm" is-link />
          </block>
        </view>
      </van-popup>
    </view>
    <view class="btnBox">
      <view class="span" catchtap="submitApply">提交</view>
    </view>
  </block>
  <view wx:if="{{configInfo.status&&configInfo.status != 1}}" class="okApply">
    <view class="ico"><icon class="fa fa-check"></icon></view>
    <view class="text">{{ configInfo.status == 2 ? "已提交申请，等待审核通过..." : "您已是广告主，无需重复申请！" }}</view>
    <view class="sub" bindtap="gotoHome">去商城逛逛</view>
  </view>
</view>