<!--index.wxml-->
<view class="flex flex-center flex-col">
  <view class="full-width white-bg">
    <view class="padding">
      <view class="mb-16 flex flex-center flex-justify-between">
        <view>
          📅 今日养护（4个任务）
        </view>
        <view>
          已经完成 4 / 5
        </view>
      </view>
      <t-progress theme="plump" color="{{ {  from: '#0052D9', to: '#00A870' } }}" percentage="80" status="active" />
    </view>

  </view>
  <view wx:if="{{list.length === 0}}" class="flex flex-center flex-col " style="margin-top: 268rpx;">
    <view class="empty flex flex-center flex-col">
    </view>
    <view class="mt-16 flex flex-center flex-col">
      <view class="font-16 bold">暂无任务</view>
    </view>
    <view style="width: 100vw; margin-top: 48rpx; " class="flex flex-center">
      <t-button theme="primary" style="width: 60%;" size="small" shape="round" bind:tap="goAdd">添加一颗新的植物</t-button>
    </view>
  </view>

  <!-- list 数据 -->
  <scroll-view scroll-y="{{true}}" wx:else>
    <view class="padding">
      <view wx:for="{{list}}" >
        <view class="mb-16 bo">{{item.name}}</view>
        <view wx:for="{{item.careList}}">
          <view class="row padding mb-32" data-id="{{item.id}}" bind:tap="goInfo">
          <view class="flex flex-center flex-justify-start">
            <image class="pic" mode="aspectFill" wx:if="{{item.plant.imgList[0].url}}" src="{{item.plant.imgList[0].url}}"></image>
            <image class="pic" mode="aspectFill" wx:else src="https://res.catter.cn/pub/2025/09/30/20250930143920286.png"></image>
            <view style="margin-left:16rpx;" class="full-width">
              <view class="flex flex-center flex-justify-between full-width">
                <view class="font-16 bold">{{item.plant.name}}</view>
                <t-tag wx:if="{{item.todayCare.status === 1}}" shape="round" theme="primary">立即完成</t-tag>
                <t-tag wx:if="{{item.todayCare.status === 2}}" shape="round">已完成</t-tag>
                <t-tag wx:if="{{item.todayCare.status === 3}}" shape="round" theme="primary">跳过</t-tag>
                <t-tag wx:if="{{item.todayCare.status === 4}}" shape="round" theme="danger">已逾期{{item.todayCare.expireDays}}天</t-tag>
              </view>
              <view class="flex flex-center flex-justify-start mt-16 ">
                <view class="mr-16 flex flex-center" wx:for="{{item.todayCares}}">
                  <t-icon name="{{item.icon}}" style="color: {{item.color}};"></t-icon>
                </view>
              </view>
            </view>
          </view>
        </view>
        </view>
      </view>




    </view>
  </scroll-view>
</view>