<nav-bar navbar-data='{{navbarData}}' bind:back="back"></nav-bar>
<view class="main" style="padding-top:{{height}}px;height:{{windowHeight-height}}px">
  <van-collapse accordion value="{{ activeName }}" bind:change="onChange">
    <van-collapse-item wx:key="item" wx:for="{{list}}" wx:for-index="idx" name="{{idx}}">
      <view slot="title" class="date">
        <van-icon name="clock-o" /><text>{{item.date}}</text>
      </view>
      <view class="mealList" wx:for-item="meal" wx:for="{{mealList}}" wx:for-index="midx" wx:key="meal"
        data-id="{{item[meal.key]._id}}" data-label="{{meal.label}}" data-date="{{item.date}}"
        data-isuse="{{item[meal.key].list.length>0?item[meal.key].is_use:''}}" bindtap="detail">
        <view class="label">
          <text>{{meal.label}}</text>
          <!-- <text
            wx:if="{{item[meal.key].list.length>0}}">{{item[meal.key].is_use=='0'?"待使用":item[meal.key].is_use=='1'?"待评价":item[meal.key].is_use=='2'?"已完成":"失效"}}</text> -->
            <text
            wx:if="{{item[meal.key].list.length>0}}">{{item[meal.key].is_use=='0'?"待使用":item[meal.key].is_use=='1'?"已完成":"失效"}}</text>
          <text wx:else>未订餐</text>
        </view>
        <history-list list="{{item[meal.key].list}}"></history-list>
      </view>
    </van-collapse-item>
  </van-collapse>
</view>