<!--pages/clockIn/index.wxml-->
<view class="clockin">
  

  <view class="btn-item">
    <view class="btn-item-box">
      <t-row gutter="8">
        <t-col span="8">
          <view class="{{timeType == 2? 'primary': ''}}" data-index="{{2}}" bindtap="changeBtn">近 7 天</view>
        </t-col>
        <t-col span="8">
          <view class="{{timeType == 3? 'primary': ''}}" data-index="{{3}}" bindtap="changeBtn">近 30 天</view>
        </t-col>

        <t-col span="8">
          <view class="{{timeType == 4? 'primary': ''}}" data-index="{{4}}" bindtap="changeBtn">近 90 天</view>
        </t-col>
      </t-row>
  </view>
  </view>
<view class="tip">
    <text>只展示近90天内的服药记录</text>
  </view>
  <scroll-view 
    class="scroll-container" 
    scroll-y="true" 
    bindscrolltolower="onLoadMore"
    lower-threshold="50"
    enable-back-to-top="true">
    <view wx:for="{{list}}" wx:key="index" class="group_1">
      <view class="group_2">
        <view class="text-wrapper_1">
          <text lines="1" class="text_2">{{item.medicine_date}}</text>
          <text lines="1" class="text_3"></text>
        </view>
      </view>
      <view class="group_3">
        <view class="group-item" wx:for="{{item.dayList}}" wx:for-item="day">
          <view class="after"></view>
          <view class="{{day.status == 2 ? 'section_2 acitve' : 'section_2'}}">
            <view class="group_4"></view>
            <text lines="1" class="text_4">{{day.medicine_time}}</text>
          </view>
          <view class="section_3" wx:for="{{day.detail}}" wx:for-item="detail">
            <view class="block_1">
              <view class="image-text_1">
                <view class="section_4"></view>
                <view class="text-group_1">
                  <text lines="1" class="text_5">{{detail.name}}</text>
                  <text lines="1" class="text_6">{{detail.dose}} {{detail.time}}</text>
                </view>
              </view>
              <view class="box_1"></view>
              <text lines="1" class="text_7 active" wx:if="{{day.status == 2}}">已打卡</text>
              <text lines="1" class="text_7" wx:if="{{day.status == 1}}">未打卡</text>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- 加载更多提示 -->
    <view class="loading-more" wx:if="{{loading}}">
      <text>加载中...</text>
    </view>
    <view class="no-more" wx:if="{{noMore}}">
      <text>没有更多数据了</text>
    </view>
  </scroll-view>
</view>