<view id="reportBox">
  <view class="reportItem" wx:for="{{trainList}}" wx:key="{{index}}" data-id="{{item.historyId}}" bindtap="detail">
    <view class="reportItemTop">
      <view class="reportItemTopTime">
        第{{item.weekNumber}}周
        <text>{{item.beginDay}}~{{item.endDay}}</text>
      </view>
      <view id="taskComplete" wx:if="{{ item.finishedStatus==1 }}">
        目标达成
        <image src="../../assets/task_complete.png" />
      </view>
      <view id="taskNocomplete" wx:else>
        未达成
        <image src="../../assets/task_incomplete.png" />
      </view>
    </view>
    <view class="reportItemBox">
      <view class="reportItemDes">训练分{{item.trainingTimes}}组，共计 <text>{{we.toFixed(item.weekDuration/60)}}</text> 分钟</view>
      <view class="reportItemDes">本次视力 <text>{{item.nowVision}}</text></view>
      <view class="reprotWeekChart">
        <ec-canvas id="mychart-{{index}}" ec="{{ weekChart }}"></ec-canvas>
      </view>
      <view class="reportItemChartText">
        <view wx:for="{{item.typeTrainingList}}" wx:key>
          <text class="dot"></text>
          {{item.title}} {{item.trainingDuration}}%
        </view>
      </view>
    </view>
  </view>
  <view class="loadingBottom" hidden="{{!isLoading}}">
    <image src="../../assets/loading.gif"></image>
    <text>加载中</text>
  </view>
</view>

<wxs module="we">
  var toFixed = function (value) {
    return Math.floor(value);
  }
  module.exports = {
    toFixed :toFixed
  }
</wxs>

