index.wxml 7.89 KB
<!-- 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}}" wx:key="{{item}}">
    <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)' scroll-y='true'>
    <template is="section_header" data="{{title:'分类',rightTitle:!hidePhoto ? '清除' : ''}}"></template>
    <!-- 分类选项 -->
    <view class="category">
      <view wx:for="{{categorys}}" wx:key="{{item}}">
        <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}}" wx:for-index="dietIndex" wx:key="{{item.signSummaryId}}">
        <view wx:for="{{item.recordItems}}" wx:for-item="r" wx:key="{{item.id}}">
          <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, cellIndex:dietIndex, inputValue:r.value}}"></template>
          </view>
        </view>
      </view>
    </view>

    <view wx:if="{{!hidePhoto}}">
      <textarea placeholder=' 请输入您要备注的信息...' class='add_remark' value='{{remark}}' bindinput='remarkInput'></textarea>
      <view class='kg-separater'></view>
      <button class='img_title' open-type='getUserInfo'>拍照</button>
      <view class='kg-separater ' style='height:2rpx;'></view>
      <view class='home-student-picture-item' style='padding-left:20rpx;padding-bottom:40rpx;'>
        <!-- 选择的图片 -->
        <view wx:for="{{pictureUrl}}" wx:key="{{item}}">
          <view class='add_picture_view'>
            <image src='{{item}}' class='add_picture' catchtap='previewPic' data-index='{{index}}' mode='aspectFill'></image>
            <image src='/src/img/cancel.png' class='delete' bindtap='deleteImg' data-index='{{index}}'></image>
          </view>
        </view>
        <view wx:if="{{pictureUrl.length < 2}}">
          <!-- 添加图片按钮 -->
          <view class='add_picture_view' bindtap='addPicture'>
            <image src='/src/img/take_photo.png' class='add_picture'></image>
          </view>
        </view>
      </view>
      <textarea placeholder=' 请输入您要备注的信息...' class='add_remark' value='{{picRemark}}' bindinput='picRemarkInput'></textarea>
    </view>
    <view style='width:100vw;height:140rpx;'></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}}" wx:for-index="dietIndex" wx:key="{{item.signSummaryId}}">
        <view wx:for="{{item.recordItems}}" wx:for-item="r" wx:key="{{item.id}}">
          <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, cellIndex:dietIndex, inputValue:r.value}}"></template>
          </view>
        </view>
      </view>
    </view>
    <view wx:if="{{!hidePhoto}}">
      <textarea placeholder=' 请输入您要备注的信息...' class='add_remark' value='{{remark}}' bindinput='remarkInput'></textarea>
      <view class='kg-separater'></view>
      <button class='img_title' open-type='getUserInfo'>拍照</button>
      <view class='kg-separater ' style='height:2rpx;'></view>
      <view class='home-student-picture-item' style='padding-left:20rpx;padding-bottom:40rpx;'>
        <!-- 选择的图片 -->
        <view wx:for="{{pictureUrl}}" wx:key="{{item}}">
          <view class='add_picture_view'>
            <image src='{{item}}' class='add_picture' catchtap='previewPic' data-index='{{index}}' mode='aspectFill'></image>
            <image src='/src/img/cancel.png' class='delete' bindtap='deleteImg' data-index='{{index}}'></image>
          </view>
        </view>
        <view wx:if="{{pictureUrl.length < 2}}">
          <!-- 添加图片按钮 -->
          <view class='add_picture_view' bindtap='addPicture'>
            <image src='/src/img/take_photo.png' class='add_picture'></image>
          </view>
        </view>
      </view>
      <textarea placeholder=' 请输入您要备注的信息...' class='add_remark' value='{{picRemark}}' bindinput='picRemarkInput'></textarea>
    </view>
    <view style='width:100vw;height:140rpx;'></view>
  </scroll-view>
</view>

<!-- WC -->
<view hidden='{{controlIndex != 2}}'>
  <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="{{wcCategorys}}" wx:key="{{item}}">
        <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="{{wcRecord}}" wx:for-index="dietIndex" wx:key="{{item.signSummaryId}}">
        <view wx:for="{{item.recordItems}}" wx:for-item="r" wx:key="{{item.id}}">
          <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, cellIndex:dietIndex, inputValue:r.value}}"></template>
          </view>
        </view>
      </view>
    </view>


    <!-- <view style='margin:20rpx'>
      <view wx:for="{{wcRecord}}" wx:for-index="dietIndex" wx:key="{{item.signSummaryId}}">
        <view class='kg-quantity-cell'>
          <template is='quantity_cell' data="{{title:item.recordStudentName,type:item.cellType,unit:item.cellUnit, options: item.cellOptions, selectOptionIndex:item.optionIndex, cellIndex:dietIndex, inputValue:item.value}}"></template>
          <text class='kg-text-normal-gray' style='margin-top:20rpx;color: black;' space="ensp">{{item.wcString}}</text>
        </view>
      </view>
    </view> -->
    <view wx:if="{{!hidePhoto}}">
      <textarea placeholder=' 请输入您要备注的信息...' class='add_remark' value='{{remark}}' bindinput='remarkInput'></textarea>
      <view class='kg-separater'></view>
      <button class='img_title' open-type='getUserInfo'>拍照</button>
      <view class='kg-separater ' style='height:2rpx;'></view>
      <view class='home-student-picture-item' style='padding-left:20rpx;padding-bottom:40rpx;'>
        <!-- 选择的图片 -->
        <view wx:for="{{pictureUrl}}" wx:key="{{item}}">
          <view class='add_picture_view'>
            <image src='{{item}}' class='add_picture' catchtap='previewPic' data-index='{{index}}' mode='aspectFill'></image>
            <image src='/src/img/cancel.png' class='delete' bindtap='deleteImg' data-index='{{index}}'></image>
          </view>
        </view>
        <view wx:if="{{pictureUrl.length < 2}}">
          <!-- 添加图片按钮 -->
          <view class='add_picture_view' bindtap='addPicture'>
            <image src='/src/img/take_photo.png' class='add_picture'></image>
          </view>
        </view>
      </view>
      <textarea placeholder=' 请输入您要备注的信息...' class='add_remark' value='{{picRemark}}' bindinput='picRemarkInput'></textarea>
    </view>
    <view style='width:100vw;height:140rpx;'></view>
  </scroll-view>
</view>


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