46 lines
2.3 KiB
Plaintext
46 lines
2.3 KiB
Plaintext
<!--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 wx:if="{{item.expiredDays === 0}}" shape="round" theme="primary" variant="light-outline">今日</t-tag>
|
|
<t-tag wx:if="{{item.expiredDays > 0}}" shape="round" theme="danger" variant="light-outline">已逾期{{item.expiredDays}}天</t-tag>
|
|
</view>
|
|
<view class="font-14 grey mt-5">种植于:{{item.plantTimeStr}}</view>
|
|
<view class="flex flex-center flex-justify-start mt-16 ">
|
|
<view class="font-12 grey">需要养护:</view>
|
|
<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>
|
|
</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>
|