<!--pages/certificateCreate/certificateCreate.wxml-->
<view class="certificate-create-page">
  <view class="title">新建电子证书</view>
  <view class="form-box">
    <view class="form-item">
      <view class="label">电子证书名称</view>
      <input model:value="{{name}}" class="name-input" placeholder="{{etcDefaultName}}" style="width: 200px;" />
    </view>
    <view class="form-item switch">
      <view class="label">
        授权查看人

        <view class="switch-box">
          <switch checked="{{isEveryone}}" data-key="isEveryone" bindchange="switchChange" />
          所有人　
        </view>
      </view>
      <view class="tagList">
        <view class="tagItem" wx:for="{{whiteList}}">{{item}}<image data-index="{{index}}" bindtap="handleDeletePhone" class="icon_delete" src="/assets/images/certification/icon_delete.png"></image>
        </view>
      </view>
      <view class="operations" wx:if="{{!isEveryone}}">
        <view bindtap="showAddPhone">
          <image class="icon_add" src="/assets/images/information/icon_add.png"></image>添加
        </view>
        <view bindtap="handleContact">
          <image class="icon_contact" src="/assets/images/inspected/icon_contact.png"></image>通讯录获取
        </view>
      </view>
      <!-- <input wx:if="{{!unNum}}" model:value="{{authorizationTimes}}" type="number" class="time" placeholder="请输入查看次数" /> -->
    </view>
    <view class="form-item switch">
      <view class="label">
        允许查看次数
        <view class="switch-box">
          <switch checked="{{unNum}}" data-key="unNum" bindchange="switchChange" />
          不限次数
        </view>
      </view>
      <input wx:if="{{!unNum}}" model:value="{{authorizationTimes}}" type="number" class="time" placeholder="请输入查看次数" />
    </view>
    <view class="form-item switch">
      <view class="label">
        授权期限
        <view class="switch-box">
          <switch checked="{{unTime}}" data-key="unTime" bindchange="switchChange" />
          不限时间
        </view>
      </view>
      <picker wx:if="{{!unTime}}" mode="date" start="{{startDate}}" value="{{endDate}}" bindchange="bindDateChange">
        <view class="time">
          <image src="/assets/images/certification/calendar.png" />
          {{endDate || '选择截止时间'}}
        </view>
      </picker>
    </view>
  </view>
  <view class="btn-box">
    <btn width="268rpx" height="82rpx" fontSize="28rpx" bind:tap="submit">确认新建</btn>
  </view>

  <shadow wx:if="{{memberShow}}">
    <view class="member-shadow">
      <image class="cancel" src="/assets/images/inspected/cancel.png" bind:tap="hideShadow" />
      <view class="title">开通年费会员 获免费次数</view>
      <view class="price">低至<text>{{dayPrice}}元/天</text></view>
      <view class="grid-box">
        <view class="grid-item">
          <image src="/assets/images/inspected/icon1.png" />
          <text>电子证书特权</text>
        </view>
        <view class="grid-item">
          <image src="/assets/images/inspected/icon2.png" />
          <text>查验特权</text>
        </view>
        <view class="grid-item">
          <image src="/assets/images/inspected/icon3.png" />
          <text>应答特权</text>
        </view>
        <view class="grid-item">
          <image src="/assets/images/inspected/icon4.png" />
          <text>批量处理</text>
        </view>
      </view>
      <view class="btn-box" style="margin-top: 36rpx">
        <btn type="member" width="443rpx" height="80rpx" fontSize="28rpx" bind:tap="jumpMember">点击购买年费会员</btn>
      </view>
      <view class="btn-box" style="margin-top: 23rpx">
        <btn type="member" plain width="443rpx" height="80rpx" fontSize="28rpx" bind:tap="buyOnce">购买单次¥{{electronicCertificateSinglePayment / 100}}</btn>
      </view>
      <image class="bg" src="/assets/images/inspected/shadow-bg.png" />
    </view>
  </shadow>

  <shadow wx:if="{{addPhoneShow}}">
    <view class="addPhone-shadow">
      <view class="title">授权手机号</view>
      <view class="form"><input class="border_input" model:value="{{phone}}" type="text" placeholder="请输入授权查看该报告的手机号" /></view>
      <view class="btns">
        <view class="btn btn_cancel" bindtap="closeAddPhone">取消</view>
        <view class="btn btn_ok" bindtap="addPhone">确定</view>
      </view>
      <!-- <image class="cancel" src="/assets/images/inspected/cancel.png" bind:tap="hideShadow" />
      <view class="title">开通年费会员 获免费次数</view>
      <view class="price">低至<text>{{dayPrice}}元/天</text></view>
      <view class="grid-box">
        <view class="grid-item">
          <image src="/assets/images/inspected/icon1.png" />
          <text>电子证书特权</text>
        </view>
        <view class="grid-item">
          <image src="/assets/images/inspected/icon2.png" />
          <text>查验特权</text>
        </view>
        <view class="grid-item">
          <image src="/assets/images/inspected/icon3.png" />
          <text>应答特权</text>
        </view>
        <view class="grid-item">
          <image src="/assets/images/inspected/icon4.png" />
          <text>批量处理</text>
        </view>
      </view>
      <view class="btn-box" style="margin-top: 36rpx">
        <btn type="member" width="443rpx" height="80rpx" fontSize="28rpx" bind:tap="jumpMember">点击购买年费会员</btn>
      </view>
      <view class="btn-box" style="margin-top: 23rpx">
        <btn type="member" plain width="443rpx" height="80rpx" fontSize="28rpx" bind:tap="buyOnce">购买单次¥{{electronicCertificateSinglePayment / 100}}</btn>
      </view>
      <image class="bg" src="/assets/images/inspected/shadow-bg.png" /> -->
    </view>
  </shadow>
</view>