<view id="historyDetail">
  <!-- 头像、用户名时间等 -->
  <view id="top">
    <view id="topLeft">
      <image src="{{ avatar }}" />
      <view>{{teenageName}}</view>
    </view>
    <view id="topRight">
      <view id="topRightTime">第{{weekNumber}}周 <text>{{beginDay}}~{{endDay}}</text></view>
      <view id="topRightTitle">上周共训练</view>
      <view id="topRightTrain"><text>{{we.toFixed(weekDuration/60)}}</text> 分钟，目标 <text id="topRightTrainStatus" wx:if="{{finishedStatus==1}}">已完成！</text><text id="topRightTrainStatusNo" wx:else>未完成！</text></view>
      <view id="topRightTitle">当前视力</view>
      <view id="topRightTrain">右眼 <text id="leftEye">{{rightEye}}</text>左眼 <text>{{leftEye}}</text></view>
    </view>
  </view>
  <!-- 视力情况 -->
  <view id="eyesight">
    <view id="eyesightTitle">
      <view class="eyesightItemLeft">视力情况</view>
      <view class="eyesightItemRight"><text>左</text><text>右</text></view>
    </view>
    <view class="eyesightItem">
      <view class="eyesightItemLeft">初测视力</view>
      <view class="eyesightItemRight">
        <text>{{leftEye}}</text>
        <text>{{rightEye}}</text>
      </view>
    </view>
    <view class="eyesightItem">
      <view class="eyesightItemLeft">本次视力</view>
      <view class="eyesightItemRight eyesightItemRightNowBox">
        <view class="eyesightItemRightNow">
          <text>{{weekLeftEye}}</text>
          <view wx:if="{{weekLeftEye>leftEye}}">
            <image src="../../assets/up.png"></image>
            <text>{{weekLeftEye-leftEye}}</text>
          </view>
          <view wx:elif="{{weekLeftEye<leftEye}}">
            <image src="../../assets/down.png"></image>
            <text>{{leftEye-weekLeftEye}}</text>
          </view>
          <view wx:else></view>
        </view>
        <view class="eyesightItemRightNow">
          <text>{{weekRightEye}}</text>
          <view wx:if="{{weekRightEye>rightEye}}">
            <image src="../../assets/up.png"></image>
            <text>{{weekRightEye-rightEye}}</text>
          </view>
          <view wx:elif="{{weekRightEye<rightEye}}">
            <image src="../../assets/down.png"></image>
            <text>{{rightEye-weekRightEye}}</text>
          </view>
          <view wx:else></view>
        </view>
      </view>
    </view>
    <view class="eyesightItem">
      <view class="eyesightItemLeft">矫正视力</view>
      <view class="eyesightItemRight">
        <text>{{leftCorrectedEye}}</text>
        <text>{{rightCorrectedEye}}</text>
      </view>
    </view>
    <view class="eyesightItem" wx:if="{{leftGlassesDegree!=''&&rightGlassesDegree!=''}}">
      <view class="eyesightItemLeft">眼镜度数</view>
      <view class="eyesightItemRight">
        <text wx:if="{{leftGlassesDegree!=''}}">{{leftGlassesDegree}}</text>
        <text wx:if="{{leftGlassesDegree==''}}">-</text>
        <text wx:if="{{rightGlassesDegree!=''}}">{{rightGlassesDegree}}</text>
        <text wx:if="{{rightGlassesDegree==''}}">-</text>
      </view>
    </view>
    <view class="eyesightItem" wx:if="{{leftWeekEye!='无'&&rightWeekEye!='无'}}">
      <view class="eyesightItemLeft">弱视</view>
      <view class="eyesightItemRight">
        <text>{{leftWeekEye}}</text>
        <text>{{rightWeekEye}}</text>
      </view>
    </view>
    <view class="eyesightItem" wx:if="{{leftLeerEye!='无'&&rightLeerEye!='无'}}">
      <view class="eyesightItemLeft">斜视</view>
      <view class="eyesightItemRight">
        <text>{{leftLeerEye}}</text>
        <text>{{rightLeerEye}}</text>
      </view>
    </view>
  </view>
  <!-- 训练图 -->
  <view class="pieChart">
    <ec-canvas id="reprotPieChart" ec="{{ pieChart }}"></ec-canvas>
  </view>
  <!-- <view id="shareBox">
    <text id="share">分享</text>
  </view> -->
  <!-- 常用应用 -->
  <view id="common">
    <view id="commonTitle">常用应用</view>
    <view id="commonList">
      <view class="commonItem" wx:for="{{appList}}" wx:key>
        <image src="{{item.icon}}" />
        <text>{{item.title}}</text>
      </view>
    </view>
  </view>
</view>

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