<!--index.wxml-->
<view class="flex flex-center flex-col">
    <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 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}}" 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.pic}}" src="{{item.pic}}"></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.name}}</view>
              <t-tag shape="round" theme="primary">健康</t-tag>
            </view>
            <view class="font-14 grey mt-5">已养护{{item.PlantDays}}天</view>
            <view class="flex flex-center flex-justify-start mt-16 ">
              <t-avatar size="56rpx"  image="https://res.catter.cn/pub/2025/10/14/20251014103658702.svg" />
              <view class="ml-32">
                <t-avatar size="56rpx"  image="https://res.catter.cn/pub/2025/10/14/20251014104232616.svg" />
              </view>
            </view>
          </view>
        </view>
      </view>
      </view>
    </scroll-view>
    <view class="bottom" wx:if="{{list.length === 0}}">
      <view class="font-12 grey mt-16">您添加的植物将全部显示在这里</view>
    </view>

    <t-fab wx:if="{{list.length > 0}}" icon="add" bind:click="goAdd"></t-fab>
</view>
