<!-- pages/add_record/index.wxml -->
<import src='/template/operate_btn/index.wxml'></import>
<view class='kg-separater ' style='height:2rpx;'></view>
<view class="segmentedControl">
  <!-- 循环遍历 -->
  <block wx:for="{{radioValues}}">
    <text data-index="{{index}}" bindtap="indexChanged" class="{{clazz[index]}}">{{item.value}}</text>
  </block>
</view>
<view class='kg-separater'></view>
<view hidden='{{controlIndex != 0}}'>
  <!-- 滑动区域 -->
  <scroll-view style='height:calc(100vh - 50px - 2rpx - 20rpx - 140rpx)' scroll-y='true'>
    <template is="section_header" data="{{title:'分类'}}"></template>
    <!-- 分类选项 -->
    <view class="category">
      <view wx:for="{{categorys}}">
        <view class="eat_category_btn {{typeIndex == index ? 'selected' : ''}}" bindtap='tapType' data-index='{{index}}'>
          {{item}}
        </view>
      </view>
    </view>
    <view class='kg-separater'></view>
    <!-- 数量 -->
    <view style='margin:20rpx'>
      <view wx:for="{{eatRecord}}">
        <view wx:for="{{item.recordItems}}" wx:for-item="r">
          <view class='kg-quantity-cell'>
            <template is='quantity_cell' data="{{title:item.recordStudentName,type:r.cellType,unit:r.cellUnit, options: r.cellOptions, selectOptionIndex:r.optionIndex}}"></template>
          </view>
        </view>
      </view>

    </view>
    <view class='kg-separater'></view>
    <template is="section_header" data="{{title:'今日拍照'}}"></template>
    <view class='home-student-picture-item' style='padding-left:20rpx;padding-bottom:40rpx;'>
      <!-- 选择的图片 -->
      <view wx:for="{{selectPic}}">
        <view class='add_picture_view'>
          <image src='{{item}}' class='add_picture' bindtap='previewPic' data-index='{{index}}' mode='aspectFill'></image>
          <image src='/src/img/cancel.png' class='delete' bindtap='deleteImg' data-index='{{index}}'></image>
        </view>
      </view>
      <!-- 添加图片按钮 -->
      <view class='add_picture_view' bindtap='addPicture'>
        <image src='/src/img/take_photo.png' class='add_picture'></image>
      </view>
    </view>
  </scroll-view>
</view>

<!-- 睡觉 -->
<view hidden='{{controlIndex != 1}}'>
  <!-- 滑动区域 -->
  <scroll-view style='height:calc(100vh - 50px - 2rpx - 20rpx - 140rpx)' scroll-y='true'>
    <view style='margin:20rpx'>
      <view wx:for="{{sleepRecord}}">
        <view wx:for="{{item.recordItems}}" wx:for-item="r">
          <view class='kg-quantity-cell'>
            <template is='quantity_cell' data="{{title:item.recordStudentName,type:r.cellType,unit:r.cellUnit, options: r.cellOptions, selectOptionIndex:r.optionIndex}}"></template>
          </view>
        </view>
      </view>
    </view>
  </scroll-view>
</view>

<!-- WC -->
<view hidden='{{controlIndex != 2}}'>
  <scroll-view style='height:calc(100vh - 50px - 2rpx - 20rpx - 140rpx)' scroll-y='true'>
    <view style='margin:20rpx'>
      <view wx:for="{{wcRecord}}">
        <view wx:for="{{item.recordItems}}" wx:for-item="r">
          <view class='kg-quantity-cell'>
            <template is='quantity_cell' data="{{title:item.recordStudentName,type:r.cellType,unit:r.cellUnit, options: r.cellOptions, selectOptionIndex:r.optionIndex}}"></template>
          </view>
        </view>
      </view>
    </view>
  </scroll-view>
</view>


<template is="operate_btn" data="{{title:'保存'}}"></template>