<!--pages/today/index.wxml-->
<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 class="font-12 grey mt-16">今天暂无农事需要完成</view>
      </view>
    </view>
    <view wx:else class="padding">
      <view class="mb-32">
        <view wx:for="{{list}}">
          <view class="">
            <view wx:for="{{item.todayFarm}}" wx:for-item="sub" class=" row padding mb-32" data-id="{{item.id}}" bind:tap="goInfo">
              <view>
                <view class="action font-16 bold">{{sub.name}}</view>
                <view class="flex flex-center flex-justify-between">
                  <view class="flex flex-center flex-justify-start mt-16">
                    <image src="{{item.pic}}" class="pic"></image>
                    <view class="ml-16">{{item.name}}</view>
                  </view>
                  <view>
                    <t-avatar  wx:if="{{sub.status != 2}}" size="56rpx"  image="https://res.catter.cn/pub/2025/10/14/20251014105954456.svg" data-item="{{sub}}" bind:tap="skip" class="mr-16"/>
                    <t-button wx:if="{{sub.status == 1}}" theme="danger" variant="outline" shape="round" size="small" data-item="{{sub}}" bind:tap="addFarmLog">未完成</t-button>
                    <t-button wx:if="{{sub.status == 2}}" theme="primary" shape="round" size="small" data-item="{{sub}}" bind:tap="addFarmLog">完成</t-button>
                    <t-button wx:if="{{sub.status == 3}}" disabled shape="round" size="small" >已跳过</t-button>
                    <t-button wx:if="{{sub.status == 4}}" theme="danger" shape="round" variant="outline"  size="small" data-item="{{sub}}" bind:tap="addFarmLog">逾期</t-button>
                    
                  </view>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>