feat: 百科rag
This commit is contained in:
@@ -142,5 +142,12 @@ Page({
|
||||
title: `植物百科 - ${this.data.plant.name}`,
|
||||
path: `/pages/wiki/detail/index?id=${this.data.plant.id}`
|
||||
};
|
||||
},
|
||||
|
||||
askAiAboutPlant() {
|
||||
const name = this.data.plant ? this.data.plant.name : '';
|
||||
wx.navigateTo({
|
||||
url: `/pages/wiki/chat/index?prefillQuestion=${encodeURIComponent(name + '怎么养护?')}`
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -195,9 +195,14 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="height: 40rpx;"></view>
|
||||
<view style="height: 120rpx;"></view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- Ask AI FAB -->
|
||||
<view class="ask-ai-fab" bindtap="askAiAboutPlant">
|
||||
<text class="fab-emoji">🤖</text>
|
||||
<text>问 AI</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
@@ -286,3 +286,27 @@ page {
|
||||
transform: scale(0.9);
|
||||
transition: transform 0.1s;
|
||||
}
|
||||
|
||||
/* Ask AI FAB */
|
||||
.ask-ai-fab {
|
||||
position: fixed;
|
||||
right: 32rpx;
|
||||
bottom: 48rpx;
|
||||
background: linear-gradient(135deg, rgba(21,101,192,0.92), rgba(25,118,210,0.92));
|
||||
backdrop-filter: blur(12px);
|
||||
color: #fff;
|
||||
padding: 20rpx 32rpx;
|
||||
border-radius: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
box-shadow: 0 8rpx 28rpx rgba(21,101,192,0.3);
|
||||
z-index: 100;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.ask-ai-fab:active { transform: scale(0.92); }
|
||||
|
||||
.fab-emoji { font-size: 32rpx; line-height: 1; }
|
||||
|
||||
Reference in New Issue
Block a user