<wxs module="enumItem" src="../../../wxs/enumItem.wxs"></wxs>
<view>
  <view>
    <swiper indicator-dots="false" autoplay="true" interval="5000" duration="1000">
      <swiper-item>
        <image src="/assets/carousel/1.png" class="slide-image" />
      </swiper-item>
      <swiper-item>
        <image src="/assets/carousel/2.png" class="slide-image" />
      </swiper-item>
      <swiper-item>
        <image src="/assets/carousel/3.png" class="slide-image" />
      </swiper-item>
    </swiper>
  </view>

  <view wx:if="{{!userInfo.identify}}" >
    <view style="text-align:center;margin:50rpx"> 
      <text> 您未开通在线练习业务 </text>
    </view>
    <view style="text-align:center;margin:50rpx"> 
      <text> 实名认证后，可获得试卷 </text>
    </view>
  
    <navigator class="mt50" url="/pages/user/identify/index" hover-class="navigator-hover" open-type="navigate" >
      <button class="i-btn  i-btn-primary i-btn-square" > 实名认证 </button>
    </navigator>
  </view>

  <view wx:else>
    <view class="cate-section">
      <button class="cate-item" bindtap="gotoCollection">
        <i-icon type="collection" size="40" color="#e96900a0" />
        <text>收藏题库</text>
      </button>

      <button class="cate-item" bindtap="gotoError">
        <i-icon type="flag" size="40" color="#e96900a0" />
        <text>错题重做</text>
      </button>

      <button class="cate-item" bindtap="gotoHistory">
        <i-icon type="createtask" size="40" color="#e96900a0" />
        <text>考试记录</text>
      </button>
    </view>

    <i-panel>
      <view class="cate-section">
        <view wx:for="{{groups}}" wx:key="groupId" class="cate-item cate-item-3">
          <button class="cate-item" wx:if="{{item.isBuy}}" bindtap="gotoExam" data-id="{{item.groupId}}">
            <i-icon type="browse" size="40" color="#7595f1a0" />
            <text>{{item.title}}</text>
          </button>

          <button class="cate-item" wx:else bindtap="startWxpay" data-id="{{item.groupId}}">
            <i-icon type="lock" size="40" color="#e96900a0" />
            <text>{{item.title}}</text>
          </button>
        </view>
      </view>
    </i-panel>
  </view>

  <modal title="iOS端暂不支持虚拟支付业务" confirm-text="保存图片" hidden="{{!buyModel}}" no-cancel="true" bindconfirm="downloadFile">
    <image src="{{info.code_url}}" mode="widthFix" style="width:100%"></image>
    <view style="color:red;text-align:center;">
      <text> IOS端暂不支持虚拟支付业务</text>
    </view>
  </modal>
</view>