<!--pages/add/index.wxml-->
<view class="padding">
  <view class="row padding">
    <view>植物图片</view>
    <view class="mt-32">
      <view class="border flex flex-center" bind:tap="upload" >
        <view class="flex flex-center flex-col" wx:if="{{pic.length === 0}}">
          <view class="camera  flex flex-center">
            <t-icon name="camera-filled" class="primary" size="24"></t-icon>
          </view>
          <view class="mt-32">点击上传或拍摄植物照片</view>
          <view class="mt-16 font-12 grey">支持JPG、PNG 格式,最大 5MB</view>
        </view>
        <view wx:else class="flex flex-center full-width">
          <image src="{{pic}}" mode="aspectFill" style="height: 398rpx;padding: 0rpx; border-radius: 16rpx;" ></image>
        </view>
      </view>
    </view>
  </view>

  <view class="row padding mt-32">
    <view>植物信息</view>
    <view class="mt-32">
      <view>
        <view class="custom-label font-14 ml-32">植物名称 </view>
        <view></view>
      </view>
      <t-input placeholder="请输入植物名称" bind:change="input" layout="vertical">
      </t-input>

      <view class="mt-32">
        <view class="custom-label font-14 ml-32">种植日期 </view>
      </view>
      <t-cell title="{{form.plantTime}}" right-icon="calendar-1"  bind:tap="showDatePicker"></t-cell>
    </view>
  </view>
  <view class="row padding mt-32">
    <view>养护事项</view>
    <view class="mt-32">
      <view>
        <count-picker item="{{item}}" wx:for="{{form.carePlans}}" bind:ok="update"></count-picker>
        
      </view>
    </view>
  </view>

  <view class="flex flex-center  full-width mt-32 mb-32">
    <t-button style="width: 80%;" theme="primary" shape="round" bind:tap="submit">添加植物</t-button>
  </view>

  <!-- date -->
  <t-calendar min-date="{{minDate}}" max-date="{{value}}" value="{{value}}" visible="{{showDate}}" confirm-btn="确认" bind:confirm="handleConfirm" />

  

</view>