<view class="page">
  <view class="page__bd">
    <view style="height:4px"></view>
    <view class="weui-panel weui-panel_access" style="margin:8px">
      <view class="weui-panel__hd">{{exam.name}}</view>
      <view class="weui-panel__bd">
        <view class="weui-media-box weui-media-box_text">
          <!-- <h4 class="weui-media-box__title">标题一</h4> -->
          <view class="weui-media-box__desc">
            工作类别:{{exam.workscope_name}}
          </view>
          <view class="weui-media-box__desc">
            考试地点:{{exam.place}}
          </view>
          <view class="weui-media-box__desc">
            开关时间:{{exam.opentime}}-{{exam.closetime}}
          </view>
          <view class="weui-media-box__desc">
            监考人:{{exam.proctor_name}}-{{exam.proctor_phone}}
          </view>
        </view>
        <view style="text-align:right;padding-right:8rpx" wx:if="{{exam.qdimgs.length==0}}">
          <button type="primary" size="mini" bindtap="upImg" data-id="{{exam.id}}">上传图片</button>
        </view>
        <view class="weui-cell" style="padding:8px;font-size:14px;" wx:if="{{exam.qdimgs.length>0}}">
                <view class="weui-cell__bd">
                    <view class="weui-uploader">
                        <view class="weui-uploader__hd">
                          <view class="weui-uploader__overview">
                              <view class="weui-uploader__title">签到表图片</view>
                          </view>
                        </view>
                        <view class="weui-uploader__bd">
                            <view class="weui-uploader__files" id="uploaderFiles">
                                <block wx:for="{{exam.qdimgs}}" wx:key="*this">
                                    <view class="weui-uploader__file" bindtap="previewImage" id="{{item}}" data-type="qdimgs"
                                    data-index="{{index}}">
                                        <image class="weui-uploader__img" src="{{item}}" mode="aspectFill" />
                                    </view>
                                </block>
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="weui-cell" style="padding:8px;font-size:14px;" wx:if="{{exam.xcimgs.length>0}}">
                <view class="weui-cell__bd">
                    <view class="weui-uploader">
                        <view class="weui-uploader__hd">
                          <view class="weui-uploader__overview">
                              <view class="weui-uploader__title">现场照片</view>
                          </view>
                        </view>
                        <view class="weui-uploader__bd">
                            <view class="weui-uploader__files" id="uploaderFiles">
                                <block wx:for="{{exam.xcimgs}}" wx:key="*this">
                                    <view class="weui-uploader__file" bindtap="previewImage" id="{{item}}" data-type="xcimgs" 
                                    data-index="{{index}}">
                                        <image class="weui-uploader__img" src="{{item}}" mode="aspectFill" />
                                    </view>
                                </block>
                            </view>
                        </view>
                    </view>
                </view>
            </view>

      </view>
    </view>
    <view class="weui-panel weui-panel_access">
      <view class="weui-panel__hd">共{{tests.length}}次考试记录</view>
      <view class="weui-panel__bd">
        <view class="weui-media-box weui-media-box_text" wx:for="{{tests}}" wx:key="unique">
          <h4 class="weui-media-box__title">
            <text style="color:green;" wx:if="{{item.is_pass}}">通过</text>
            <text style="color:red;" wx:else>未过</text>
            {{item.consumer_detail.name}}
          </h4>
          <view class="weui-media-box__desc">
            {{item.consumer_detail.company_name}} {{item.consumer_detail.deptname}}
          </view>
          <view class="weui-media-box__desc">
            身份证号:{{item.consumer_detail.ID_number}}
          </view>
          <view class="weui-media-box__desc">
            开始答题:{{item.start_time}}-耗时:{{item.took_format}}
          </view>
          <view class="weui-media-box__desc">
            得分:{{item.score}}
          </view>
          <view class="weui-media-box__desc" wx:if="{{item.candidate_}}">
            证书编号:
            <text style="color:darkblue">{{item.candidate_.number}}</text>
          </view>
          <view style="text-align:right;padding-right:8rpx">
            <button type="default" size="mini" bindtap="goCandidate" style="margin-left:4px" data-id="{{item.id}}"
              data-candidate_="{{item.candidate_}}" wx:if="{{item.candidate_}}">查看证书</button>
            <button type="primary" size="mini" bindtap="issue" data-id="{{item.id}}" data-index="{{index}}"
              wx:else>颁发证书</button>
            <button type="default" size="mini" bindtap="godetail" style="margin-left:4px"
              data-id="{{item.id}}">答卷详情</button>
          </view>
        </view>

      </view>
      <!-- <view class="weui-panel__ft">
				<a class="weui-cell weui-cell_active weui-cell_access weui-cell_link">
					<view class="weui-cell__bd">查看更多</view>
					<text class="weui-cell__ft"></text>
				</a>
			</view> -->
    </view>
    <view class="weui-loadmore weui-loadmore_line" wx:if="{{isLoadedAll}}">
      <text class="weui-loadmore__tips">到底了</text>
    </view>
  </view>
</view>