feat: 百科rag

This commit is contained in:
Blizzard
2026-04-23 11:13:23 +08:00
parent 40f3a8cfa8
commit 9fe2fd42e0
23 changed files with 1129 additions and 69 deletions
+12 -1
View File
@@ -14,6 +14,7 @@ Page({
total: 0,
isLastPage: false,
isLoading: false,
isRefreshing: false,
scrollTop: 0
},
@@ -34,13 +35,23 @@ Page({
this.loadPlants(true);
},
// Pull to refresh
// Pull to refresh (page-level)
onPullDownRefresh() {
this.loadPlants(true).then(() => {
wx.stopPullDownRefresh();
});
},
// Pull to refresh (scroll-view)
onRefresh() {
this.setData({ isRefreshing: true });
this.loadPlants(true).then(() => {
this.setData({ isRefreshing: false });
}).catch(() => {
this.setData({ isRefreshing: false });
});
},
// Infinite scroll
onReachBottom() {
if (!this.data.isLastPage && !this.data.isLoading) {
+5 -2
View File
@@ -17,7 +17,9 @@
</view>
<view class="banner-container">
<image src="https://images.unsplash.com/photo-1585320806297-9794b3e4eeae?w=800" class="garden-banner" mode="aspectFill" />
<view class="garden-banner-bg">
<text class="banner-deco">🌿🌸🍀🌺</text>
</view>
<view class="banner-overlay">
<text class="count-tag">共养护 {{total}} 盆植物</text>
</view>
@@ -45,7 +47,7 @@
</view>
</view>
<scroll-view wx:else scroll-y class="garden-list-container" enhanced show-scrollbar="{{false}}" bindscrolltolower="onScrollLower" scroll-top="{{scrollTop}}">
<scroll-view wx:else scroll-y class="garden-list-container" enhanced show-scrollbar="{{false}}" bindscrolltolower="onScrollLower" scroll-top="{{scrollTop}}" refresher-enabled="{{true}}" bindrefresherrefresh="onRefresh" refresher-triggered="{{isRefreshing}}">
<view class="plant-grid">
<view wx:for="{{plants}}" wx:key="id" class="plant-card" bindtap="navigateToDetail" data-id="{{item.id}}">
<view class="plant-image-container">
@@ -55,6 +57,7 @@
width="100%"
height="100%"
t-class="uploaded-img"
lazy
/>
<view class="days-badge">{{item.daysPlanted}}天</view>
</view>
+18 -8
View File
@@ -83,9 +83,19 @@
flex-shrink: 0;
}
.garden-banner {
.garden-banner-bg {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #558B2F 0%, #7CB342 40%, #AED581 100%);
display: flex;
align-items: center;
justify-content: center;
}
.banner-deco {
font-size: 56rpx;
letter-spacing: 24rpx;
opacity: 0.4;
}
.banner-overlay {
@@ -207,23 +217,23 @@
position: fixed;
right: 40rpx;
bottom: 60rpx;
background: #558B2F;
background: rgba(85, 139, 47, 0.92);
backdrop-filter: blur(12px);
color: white;
padding: 24rpx 40rpx;
border-radius: 60rpx;
padding: 20rpx 36rpx;
border-radius: 48rpx;
display: flex;
align-items: center;
gap: 12rpx;
box-shadow: 0 12rpx 32rpx rgba(85, 139, 47, 0.4);
gap: 10rpx;
box-shadow: 0 8rpx 28rpx rgba(85, 139, 47, 0.35);
z-index: 1000;
font-size: 28rpx;
font-size: 26rpx;
font-weight: 700;
transition: all 0.2s ease;
}
.floating-add-btn:active {
transform: scale(0.92);
box-shadow: 0 4rpx 16rpx rgba(85, 139, 47, 0.2);
}
/* List Footer */
.list-footer {