<wxs module="util" src="../../../wxs/util-fun.wxs"></wxs>
<view>
  <view>
    <video id="myVideo" src="{{item.url}}" autoplay initial-time="{{item.position}}" show-fullscreen-btn
      bindtimeupdate="timeUpdate" show-play-btn="false" show-screen-lock-button="true" object-fit="cover"
      wx:if="{{onPlay}}"></video>
    <image src="{{info.tb}}" mode="widthFix" style="width:100%;" wx:else />
  </view>

  <!-- <view class="tc p20 fs30">
    <text>学时: {{info.getXs/10}}/{{info.totalXs/10}}</text>
    <text style="margin-left:10rpx">最高分: {{info.score}}</text>
  </view> -->

  <view class="cate-section">

    <view class="cate-item">
      <i-avatar  size="40" color="#e96900a0"> {{info.getXs/10}} </i-avatar>
      <text class="pt20">获得学时</text>
    </view>

    <view class="cate-item">
      <i-avatar size="40" color="#e96900a0"> {{info.totalXs/10}} </i-avatar>
      <text class="pt20">总学时</text>
    </view>

    <view class="cate-item">
      <i-avatar  size="40" color="#e96900a0"> {{info.score}} </i-avatar>
      <text class="pt20">最高分</text>
    </view>

    <view class="cate-item" bindtap="gotoExam">
      <i-avatar  size="40" color="#e96900a0"> {{info.score>60?'是':'否'}} </i-avatar>
      <text class="pt20">进入考试</text>
    </view>
  </view>

  <view wx:for="{{mediaList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="mt20">
    <i-card title="{{item.name}}" bindtap="playMedia" data-index="{{index}}">
      <view slot="content">视频学时: {{item.xs/10}}</view>
      <view slot="footer">
        学习进度：{{util.getPercent(item) }}%
      </view>

    </i-card>
  </view>


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