<!--pages/contest/answer/answer.wxml-->
<wxs src="../../../utils/util.wxs" module="format" />
<view>
  <image mode="widthFix" src="../../../imgs/contest/answer/bg.png" class="bg"></image>
  <view class="page-title">参加竞赛</view>
  <view class="top">
    <view class="top-title">您已回答
      <view class="time">
        {{format.formatTime(time)}}
      </view>秒!
    </view>
    <view class="top-nav">
      <view class="{{pagination.page==item?'active':''}}" wx:for="{{[1,2,3,4,5]}}" bindtap="bindNavTagger" data-index="{{item}}">第{{(item-1)*10+1}}-{{item*10}}题</view>
    </view>
  </view>
  <view class="content">
    <view class="content-title">2022年冬奥会知识竞赛</view>
    <view class="content-item" wx:for="{{questionList}}" wx:key="index">
      <view class="problem">
        <view class="problem-num">
          <image mode="widthFix" class="problem-icon" src="../../../imgs/contest/answer/icon.png"></image>
          <view class="problem-index">{{(pagination.page-1)*10+index+1}}</view>
        </view>
        <view class="problem-text">{{item.topic}}</view>
      </view>
      <view class="problem-key-list">
        <view class="border {{pattern?'pattern':''}} {{chooseList[(pagination.page-1)*10+index]==num?'active':''}}" bindtap="{{pattern?'':'clickChoose'}}" data-index="{{num}}" data-questionIndex="{{(pagination.page-1)*10+index}}" wx:for="{{item.options}}" wx:for-item="i" wx:for-index="num">{{['A','B','C','D'][num]}}. {{i.optionContent}}</view>
      </view>
    </view>
    <!-- <view class="content-item">
      <view class="problem">
        <view class="problem-num">
          <image mode="widthFix" class="problem-icon" src="../../../imgs/contest/answer/icon.png"></image>
          <view class="problem-index">1</view>
        </view>
        <view class="problem-text">现代奥林匹克圣火传递起于哪一年？</view>
      </view>
      <view class="problem-key-list">
        <view class="active-R">A. 1936年</view>
        <view class="">A. 1936年</view>
      </view>
    </view> -->
  </view>
  <!-- <view class="arrow-group" wx:if="{{!pattern}}">
    <image class="" mode="widthFix" src="../../../imgs/contest/answer/left{{pagination.page==1?'':'-active'}}.png" bindtap="{{pagination.page==1?'':'bindNavTagger'}}" data-index="{{pagination.page-1}}"></image>
    <image class="" mode="widthFix" src="../../../imgs/contest/answer/right{{pagination.page==5?'':'-active'}}.png" bindtap="{{pagination.page==5?'':'bindNavTagger'}}" data-index="{{pagination.page+1}}"></image>
  </view> -->
  <view class="next-one" data-index="2" bindtap="{{isupdate?'showToggle':'bindNavTagger'}}" wx:if="{{!pattern&&pagination.page==1||isupdate}}">{{isupdate?'提交':'下一页'}}</view>
  <view class="button-group-R" wx:else>
    <view class="back" bindtap="{{pattern?'updateTagger':'bindNavTagger'}}" data-index="{{pagination.page-1}}">{{pattern?'修改':'上一页'}}</view>
    <view class="next" bindtap="{{pagination.page==5?'showToggle':'bindNavTagger'}}" data-index="{{pagination.page+1}}">{{pagination.page==5?'提交':'下一页'}}</view>
  </view>

  <!-- 确认框 -->
  <view class="mask" wx:if="{{show}}" bindtap="showToggle">
  </view>
  <view class="confirm" wx:if="{{show}}">
    <image mode="widthFix" class="confirm-bg" src="../../../imgs/contest/answer/confirm-bg.png"></image>
    <view class="confirm-content">
      <image mode="widthFix" class="warning-icon" src="../../../imgs/contest/answer/warning.png"></image>
      <view class="confim-title">{{allAnswer?'您已答完全部题,确认提交吗？':isupdate?'您的答题已修改，确认提交吗？':'您未答完全部题，确认提交吗？'}}</view>
      <view class="button-group" wx:if="{{!isupdate}}">
        <view bindtap="patternToggle">预览答题</view>
        <view bindtap="clickConfim">提交</view>
      </view>
      <view class="button-group" wx:else>
       <view class="confim-button" bindtap="clickConfim">提交</view>
      </view>
      <image mode="widthFix" src="../../../imgs/contest/answer/close.png" class="close-icon" bindtap="showToggle"></image>
    </view>
  </view>
</view>
