| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858 |
- <template>
- <view class="chat-container">
- <!-- 导航栏 -->
- <view class="chat-nav" :class="'mascot-' + mascotCode">
- <view class="nav-back" @click="goBack">
- <text class="nav-back-icon">‹</text>
- </view>
- <text class="nav-title">{{ isNutrition ? '精准营养助手' : (isHealthCoach ? 'AI 健康管家' : 'AI 家庭助手') }}</text>
- <view class="nav-actions">
- <view class="mascot-badge" v-if="mascotCode && !isNutrition" @click="showConversations = !showConversations">
- <text class="mascot-badge-icon">{{ mascotIcon }}</text>
- <text class="mascot-badge-name">{{ mascotName }}</text>
- </view>
- <text class="nav-action" @click="showConversations = !showConversations" v-else>☰</text>
- </view>
- </view>
- <!-- 会话列表(侧拉) -->
- <view class="conv-overlay" v-if="showConversations" @click="showConversations = false"></view>
- <view class="conv-sidebar" :class="{ 'conv-sidebar-open': showConversations }">
- <view class="conv-header">
- <text class="conv-header-title">会话列表</text>
- <text class="conv-header-new" @click="newConversation">+ 新会话</text>
- </view>
- <scroll-view class="conv-list" scroll-y>
- <view class="conv-item" v-for="conv in conversations" :key="conv.id"
- :class="{ 'conv-item-active': conv.id === currentConversationId }"
- @click="switchConversation(conv.id)">
- <text class="conv-item-name">{{ conv.name || '新会话' }}</text>
- <text class="conv-item-time">{{ formatTime(conv.updated_at) }}</text>
- </view>
- <BaseEmpty v-if="conversations.length === 0" text="暂无会话" icon="💬" />
- </scroll-view>
- </view>
- <!-- 消息列表 -->
- <scroll-view class="message-list" scroll-y :scroll-into-view="scrollToId" scroll-with-animation
- @scrolltoupper="loadMoreMessages" id="messageList">
- <view class="message-list-inner">
- <view class="welcome-card" v-if="messages.length === 0 && !sending">
- <view class="welcome-icon">{{ mascotIcon || (isNutrition ? '🥗' : (isHealthCoach ? '🏥' : '🤖')) }}</view>
- <text class="welcome-title">{{ isNutrition ? '你好!我是精准营养助手' : (isHealthCoach ? '你好!我是AI健康管家' : ('你好!我是' + (mascotName || '家庭助手'))) }}</text>
- <text class="welcome-desc">{{ welcomeSubtitle }}</text>
- <view class="welcome-suggestions">
- <view class="welcome-suggestion" v-if="!isNutrition && !isHealthCoach" @click="quickQuestion('小明最近任务完成怎么样?')">
- <text class="suggestion-icon">📋</text>
- <text class="suggestion-text">小明最近任务完成怎么样?</text>
- </view>
- <view class="welcome-suggestion" v-if="!isNutrition && !isHealthCoach" @click="quickQuestion('我家孩子的能量评分怎么样?')">
- <text class="suggestion-icon">⚡</text>
- <text class="suggestion-text">孩子的能量评分怎么样?</text>
- </view>
- <view class="welcome-suggestion" v-if="!isNutrition && !isHealthCoach" @click="quickQuestion('今天有什么需要我做的事情?')">
- <text class="suggestion-icon">✅</text>
- <text class="suggestion-text">今天有什么需要我做的事情?</text>
- </view>
- <view class="welcome-suggestion" v-if="isNutrition" @click="quickQuestion('根据报告,我的孩子需要补充哪些营养?')">
- <text class="suggestion-icon">🥦</text>
- <text class="suggestion-text">根据报告,我的孩子需要补充哪些营养?</text>
- </view>
- <view class="welcome-suggestion" v-if="isNutrition" @click="quickQuestion('有哪些食物或产品推荐?')">
- <text class="suggestion-icon">🛒</text>
- <text class="suggestion-text">有哪些食物或产品推荐?</text>
- </view>
- <view class="welcome-suggestion" v-if="isHealthCoach" @click="quickQuestion('我家孩子挑食怎么办?')">
- <text class="suggestion-icon">🍽️</text>
- <text class="suggestion-text">我家孩子挑食怎么办?</text>
- </view>
- <view class="welcome-suggestion" v-if="isHealthCoach" @click="quickQuestion('孩子最近总感冒,怎么调养?')">
- <text class="suggestion-icon">🤧</text>
- <text class="suggestion-text">孩子最近总感冒,怎么调养?</text>
- </view>
- <view class="welcome-suggestion" v-if="isHealthCoach" @click="quickQuestion('什么样的体质?如何调理?')">
- <text class="suggestion-icon">🔍</text>
- <text class="suggestion-text">什么样的体质?如何调理?</text>
- </view>
- </view>
- </view>
- <view class="message-group" v-for="(msg, idx) in messages" :key="msg.id">
- <!-- 用户消息 -->
- <view class="message message-user" v-if="msg.query">
- <view class="message-bubble user-bubble">{{ msg.query }}</view>
- </view>
- <!-- AI 回复 -->
- <view class="message message-ai" v-if="msg.answer">
- <view class="message-avatar">{{ isHealthCoach ? '🏥' : (mascotIcon || '🤖') }}</view>
- <view class="message-bubble ai-bubble">
- <text class="ai-answer-text">{{ msg.answer }}</text>
- <!-- 推荐卡片 -->
- <view class="rec-list" v-if="msg.recommendations && msg.recommendations.length > 0">
- <view class="rec-card" v-for="(rec, ri) in msg.recommendations" :key="ri" @click="gotoRec(rec)">
- <image class="rec-cover" v-if="rec.coverImage" :src="rec.coverImage" mode="aspectFill" />
- <view class="rec-info">
- <text class="rec-type-tag">{{ rec.type === 'product' ? '商品' : rec.type === 'activity' ? '活动' : '文章' }}</text>
- <text class="rec-name">{{ rec.name }}</text>
- <text class="rec-desc">{{ rec.description }}</text>
- <text class="rec-price" v-if="rec.price">¥{{ rec.price }}</text>
- </view>
- </view>
- </view>
- <!-- AI 任务卡片 -->
- <view class="task-list" v-if="msg.tasks && msg.tasks.length > 0">
- <AITaskCard v-for="(task, ti) in msg.tasks" :key="ti" :task="task" :conversationId="currentConversationId" @accepted="onTaskAccepted" />
- </view>
- <!-- 报告来源标识 -->
- <view class="source-label" v-if="msg.sourceReport">
- 来源:{{ msg.sourceReport.type === 'nutrition' ? '营养报告' : '测评报告' }} #{{ msg.sourceReport.id }}
- </view>
- </view>
- </view>
- </view>
- <!-- 加载中 -->
- <view class="message message-ai" v-if="sending">
- <view class="message-avatar">{{ mascotIcon || '🤖' }}</view>
- <view class="message-bubble ai-bubble typing">
- <text class="typing-dot">.</text>
- <text class="typing-dot">.</text>
- <text class="typing-dot">.</text>
- </view>
- </view>
- <view id="scrollBottom"></view>
- </view>
- </scroll-view>
- <!-- 输入区 -->
- <view class="chat-input-area">
- <view class="chat-input-wrap">
- <input class="chat-input" v-model="inputText" placeholder="问我关于家庭和孩子的问题..."
- :disabled="sending" @confirm="sendMessage" confirm-type="send" />
- </view>
- <view class="chat-send-btn" :class="{ 'chat-send-active': inputText.trim() }"
- @click="sendMessage">
- <text class="send-icon">➤</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { aiSendMessage, aiGetConversations, aiGetMessages, aiDeleteConversation, aiSendNutritionMessage, aiSendHealthCoachMessage } from '../../utils/api.js'
- import BaseEmpty from '../../components/BaseEmpty.vue'
- import AITaskCard from '../../components/AITaskCard.vue'
- export default {
- components: { BaseEmpty, AITaskCard },
- data() {
- return {
- inputText: '',
- messages: [],
- conversations: [],
- currentConversationId: '',
- sending: false,
- showConversations: false,
- scrollToId: '',
- pageLoaded: false,
- pendingFirstMessage: '',
- fromPage: '',
- mode: '',
- reportId: '',
- recommendations: [],
- mascotCode: '',
- mascotName: '',
- mascotIcon: ''
- }
- },
- computed: {
- isNutrition: function() {
- return this.mode === 'nutrition'
- },
- isHealthCoach: function() {
- return this.mode === 'health'
- },
- welcomeSubtitle: function() {
- if (this.isNutrition) {
- return '我可以基于菌群检测报告,为你提供个性化的营养建议和推荐'
- }
- if (this.isHealthCoach) {
- return '专注儿童健康咨询:体质调理、营养喂养、科学保健'
- }
- if (this.fromPage) {
- var pageNames = {
- 'pages/body/index': '身',
- 'pages/wisdom/index': '智',
- 'pages/mind/index': '心',
- 'pages/index/index': '首页',
- 'pages/index/parent-index': '首页',
- 'pages/index/child-index': '首页',
- 'pages/profile/profile': '我的',
- 'pages/profile/children': '我的',
- 'pages/shop/index': '商城',
- 'pages/discover/index': '发现'
- }
- var pageName = pageNames[this.fromPage] || this.fromPage
- return '从 ' + pageName + ' 发起,我可以帮你了解:'
- }
- return '我可以帮你了解孩子的成长情况,比如:'
- }
- },
- onLoad: function(options) {
- this.mode = options.mode || ''
- this.fromPage = options.fromPage ? decodeURIComponent(options.fromPage) : ''
- this.reportId = options.reportId || ''
- if (options.firstMessage) {
- this.pendingFirstMessage = decodeURIComponent(options.firstMessage)
- }
- // 加载用户mascot设置
- var userInfo = uni.getStorageSync('userInfo')
- if (userInfo) {
- if (userInfo.mascot === 'xibao') {
- this.mascotCode = 'xibao'
- this.mascotName = '浠宝'
- this.mascotIcon = '🌟'
- } else if (userInfo.mascot === 'fubao') {
- this.mascotCode = 'fubao'
- this.mascotName = '福宝'
- this.mascotIcon = '💪'
- }
- }
- this.loadConversations()
- // 如果有预填消息,自动发送
- var self = this
- if (this.pendingFirstMessage) {
- this.$nextTick(function() {
- self.inputText = self.pendingFirstMessage
- self.pendingFirstMessage = ''
- self.sendMessage()
- })
- }
- },
- onShow() {
- if (this.pageLoaded) {
- this.loadConversations()
- }
- this.pageLoaded = true
- },
- methods: {
- goBack() {
- uni.navigateBack()
- },
-
- onTaskAccepted() {
- this.loadConversations()
- },
- async loadConversations() {
- try {
- const res = await aiGetConversations()
- this.conversations = res.data || []
- } catch (e) {
- console.log('加载会话列表失败', e)
- }
- },
- async switchConversation(convId) {
- this.currentConversationId = convId
- this.showConversations = false
- this.messages = []
- this.$nextTick(() => {
- this.scrollToBottom()
- })
- try {
- const res = await aiGetMessages({ conversationId: convId })
- this.messages = res.data || []
- this.$nextTick(() => {
- this.scrollToBottom()
- })
- } catch (e) {
- console.log('加载消息失败', e)
- }
- },
- newConversation() {
- this.currentConversationId = ''
- this.showConversations = false
- this.messages = []
- this.inputText = ''
- this.$nextTick(() => {
- this.scrollToBottom()
- })
- },
- async sendMessage() {
- const text = this.inputText.trim()
- if (!text || this.sending) return
- // 立即显示用户消息
- const tempMsg = { id: 'temp_' + Date.now(), query: text, answer: '' }
- this.messages.push(tempMsg)
- this.inputText = ''
- this.sending = true
- this.$nextTick(() => {
- this.scrollToBottom()
- })
- try {
- var params = {
- query: text,
- conversationId: this.currentConversationId
- }
- if (this.reportId) {
- params.reportId = this.reportId
- }
- var res, data
- if (this.mode === 'nutrition') {
- res = await aiSendNutritionMessage(params)
- data = res.data || {}
- const lastMsg = this.messages[this.messages.length - 1]
- if (lastMsg) {
- lastMsg.answer = data.answer || ''
- lastMsg.recommendations = data.recommendations || []
- lastMsg.tasks = data.tasks || []
- if (this.reportId) {
- lastMsg.sourceReport = { id: this.reportId, type: 'nutrition' }
- }
- }
- } else if (this.mode === 'health') {
- res = await aiSendHealthButlerMessage(params)
- data = res.data || {}
- const lastMsg = this.messages[this.messages.length - 1]
- if (lastMsg) {
- lastMsg.answer = data.answer || ''
- lastMsg.recommendations = data.recommendations || []
- lastMsg.tasks = data.tasks || []
- }
- } else {
- res = await aiSendMessage(params)
- data = res.data || {}
- const lastMsg = this.messages[this.messages.length - 1]
- if (lastMsg) {
- lastMsg.answer = data.answer || ''
- lastMsg.recommendations = data.recommendations || []
- lastMsg.tasks = data.tasks || []
- if (this.reportId) {
- lastMsg.sourceReport = { id: this.reportId, type: 'assessment' }
- }
- }
- }
- // 更新 conversationId(新建会话时 Dify 返回)
- if (data.conversationId && !this.currentConversationId) {
- this.currentConversationId = data.conversationId
- // 刷新会话列表
- this.loadConversations()
- }
- } catch (e) {
- // 显示错误
- const lastMsg = this.messages[this.messages.length - 1]
- if (lastMsg) {
- lastMsg.answer = '抱歉,我暂时无法回答,请稍后再试。'
- }
- } finally {
- this.sending = false
- this.$nextTick(() => {
- this.scrollToBottom()
- })
- }
- },
- quickQuestion(text) {
- this.inputText = text
- this.sendMessage()
- },
- gotoRec(rec) {
- if (rec.url) {
- uni.navigateTo({ url: rec.url })
- }
- },
- loadMoreMessages() {
- // 分页加载历史(当前简化)
- },
- scrollToBottom() {
- this.scrollToId = 'scrollBottom'
- },
- formatTime(timestamp) {
- if (!timestamp) return ''
- const d = new Date(timestamp * 1000)
- const now = new Date()
- const diff = now - d
- if (diff < 86400000) {
- return d.getHours().toString().padStart(2, '0') + ':' + d.getMinutes().toString().padStart(2, '0')
- }
- return (d.getMonth() + 1) + '/' + d.getDate()
- }
- }
- }
- </script>
- <style scoped>
- .chat-container {
- display: flex;
- flex-direction: column;
- height: 100vh;
- background: var(--bg, #FFF7ED);
- position: relative;
- }
- /* 导航栏 */
- .chat-nav {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 88rpx 24rpx 16rpx;
- background: #fff;
- border-bottom: 1rpx solid var(--border-light, #E2E8F0);
- position: relative;
- z-index: 100;
- }
- .chat-nav.mascot-xibao {
- background: linear-gradient(135deg, #FFF7ED 0%, #FFE4CC 100%);
- border-bottom-color: #FF8C42;
- }
- .chat-nav.mascot-xibao .nav-title {
- color: #D97706;
- }
- .chat-nav.mascot-fubao {
- background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
- border-bottom-color: #F59E0B;
- }
- .chat-nav.mascot-fubao .nav-title {
- color: #B45309;
- }
- .nav-back {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .nav-back-icon {
- font-size: 40rpx;
- color: var(--text, #1E293B);
- font-weight: 600;
- }
- .nav-title {
- font-size: 32rpx;
- font-weight: 600;
- color: var(--text, #1E293B);
- }
- .nav-actions {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .nav-action {
- font-size: 36rpx;
- color: var(--text-secondary, #64748B);
- }
- /* 会话列表侧拉 */
- .conv-overlay {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0,0,0,0.3);
- z-index: 200;
- }
- .conv-sidebar {
- position: fixed;
- top: 0;
- right: -500rpx;
- width: 460rpx;
- height: 100vh;
- background: #fff;
- z-index: 210;
- transition: right 0.3s ease;
- display: flex;
- flex-direction: column;
- }
- .conv-sidebar-open {
- right: 0;
- }
- .conv-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 100rpx 24rpx 16rpx;
- border-bottom: 1rpx solid var(--border-light, #E2E8F0);
- }
- .conv-header-title {
- font-size: 28rpx;
- font-weight: 600;
- color: var(--text, #1E293B);
- }
- .conv-header-new {
- font-size: 24rpx;
- color: var(--color-primary, #5B9BD5);
- font-weight: 500;
- }
- .conv-list {
- flex: 1;
- overflow-y: auto;
- }
- .conv-item {
- padding: 20rpx 24rpx;
- border-bottom: 1rpx solid var(--border-light, #E2E8F0);
- }
- .conv-item-active {
- background: rgba(91, 155, 213, 0.06);
- }
- .conv-item-name {
- font-size: 26rpx;
- color: var(--text, #1E293B);
- display: block;
- margin-bottom: 6rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .conv-item-time {
- font-size: 20rpx;
- color: var(--muted, #94A3B8);
- }
- /* 消息列表 */
- .message-list {
- flex: 1;
- overflow-y: auto;
- padding: 20rpx 24rpx;
- }
- .message-list-inner {
- min-height: 100%;
- }
- /* 欢迎卡片 */
- .welcome-card {
- text-align: center;
- padding: 60rpx 20rpx 40rpx;
- }
- .welcome-icon {
- font-size: 80rpx;
- margin-bottom: 20rpx;
- transition: transform 0.3s;
- }
- .mascot-xibao .welcome-icon {
- animation: welcomeFloat 3s ease-in-out infinite;
- }
- .mascot-fubao .welcome-icon {
- animation: welcomeFloat 3s ease-in-out infinite 0.5s;
- }
- @keyframes welcomeFloat {
- 0%, 100% { transform: translateY(0); }
- 50% { transform: translateY(-10rpx); }
- }
- .welcome-title {
- font-size: 32rpx;
- font-weight: 600;
- color: var(--text, #1E293B);
- display: block;
- margin-bottom: 12rpx;
- }
- .welcome-desc {
- font-size: 24rpx;
- color: var(--text-secondary, #64748B);
- display: block;
- margin-bottom: 32rpx;
- }
- .welcome-suggestions {
- display: flex;
- flex-direction: column;
- gap: 16rpx;
- padding: 0 20rpx;
- }
- .welcome-suggestion {
- display: flex;
- align-items: center;
- background: #fff;
- padding: 20rpx 24rpx;
- border-radius: 16rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
- }
- .suggestion-icon {
- font-size: 28rpx;
- margin-right: 12rpx;
- }
- .suggestion-text {
- font-size: 24rpx;
- color: var(--text, #1E293B);
- }
- /* 消息 */
- .message {
- margin-bottom: 24rpx;
- }
- .message-user {
- display: flex;
- justify-content: flex-end;
- }
- .message-ai {
- display: flex;
- align-items: flex-start;
- }
- .message-avatar {
- width: 56rpx;
- height: 56rpx;
- font-size: 36rpx;
- margin-right: 12rpx;
- flex-shrink: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 50%;
- transition: transform 0.2s;
- }
- .mascot-xibao .message-avatar {
- background: linear-gradient(135deg, #FFF7ED 0%, #FFE4CC 100%);
- border: 2rpx solid #FF8C42;
- }
- .mascot-fubao .message-avatar {
- background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
- border: 2rpx solid #F59E0B;
- }
- .message-bubble {
- max-width: 70%;
- padding: 16rpx 20rpx;
- font-size: 26rpx;
- line-height: 1.6;
- border-radius: 16rpx;
- word-break: break-word;
- }
- .user-bubble {
- background: var(--color-primary, #5B9BD5);
- color: #fff;
- border-bottom-right-radius: 4rpx;
- }
- .ai-bubble {
- background: #fff;
- color: var(--text, #1E293B);
- border-bottom-left-radius: 4rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
- }
- /* 输入区 */
- .chat-input-area {
- display: flex;
- align-items: center;
- padding: 16rpx 24rpx;
- padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
- background: #fff;
- border-top: 1rpx solid var(--border-light, #E2E8F0);
- }
- .chat-input-wrap {
- flex: 1;
- background: var(--bg, #FFF7ED);
- border-radius: 40rpx;
- padding: 0 24rpx;
- margin-right: 16rpx;
- }
- .chat-input {
- height: 72rpx;
- font-size: 26rpx;
- color: var(--text, #1E293B);
- }
- .chat-send-btn {
- width: 72rpx;
- height: 72rpx;
- border-radius: 50%;
- background: var(--border-light, #E2E8F0);
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- }
- .chat-send-active {
- background: var(--color-primary, #5B9BD5);
- }
- .send-icon {
- font-size: 28rpx;
- color: #fff;
- }
- /* 打字动画 */
- .typing {
- display: flex;
- align-items: center;
- gap: 4rpx;
- min-height: 40rpx;
- }
- .typing-dot {
- font-size: 40rpx;
- line-height: 1;
- animation: typingBounce 1.4s infinite;
- }
- .typing-dot:nth-child(2) {
- animation-delay: 0.2s;
- }
- .typing-dot:nth-child(3) {
- animation-delay: 0.4s;
- }
- @keyframes typingBounce {
- 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
- 30% { opacity: 1; transform: translateY(-8rpx); }
- }
- /* 推荐卡片 */
- .ai-answer-text {
- display: block;
- margin-bottom: 16rpx;
- line-height: 1.7;
- }
- .rec-list {
- border-top: 1rpx solid var(--border-light, #E2E8F0);
- padding-top: 16rpx;
- display: flex;
- flex-direction: column;
- gap: 12rpx;
- }
- /* 任务卡片列表 */
- .task-list {
- border-top: 1rpx solid var(--border-light, #E2E8F0);
- padding-top: 16rpx;
- display: flex;
- flex-direction: column;
- gap: 12rpx;
- }
- /* 报告来源标识 */
- .source-label {
- margin-top: 16rpx;
- font-size: 22rpx;
- color: var(--muted, #94A3B8);
- text-align: right;
- }
- .rec-card {
- display: flex;
- flex-direction: row;
- background: var(--bg, #FFF7ED);
- border-radius: 12rpx;
- overflow: hidden;
- padding: 12rpx;
- }
- .rec-cover {
- width: 120rpx;
- height: 120rpx;
- border-radius: 8rpx;
- margin-right: 12rpx;
- flex-shrink: 0;
- background: #E2E8F0;
- }
- .rec-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- gap: 4rpx;
- min-width: 0;
- }
- .rec-type-tag {
- display: inline-block;
- font-size: 18rpx;
- color: var(--color-primary, #5B9BD5);
- background: rgba(91, 155, 213, 0.1);
- padding: 2rpx 12rpx;
- border-radius: 8rpx;
- align-self: flex-start;
- }
- .rec-name {
- font-size: 26rpx;
- font-weight: 600;
- color: var(--text, #1E293B);
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .rec-desc {
- font-size: 22rpx;
- color: var(--text-secondary, #64748B);
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .rec-price {
- font-size: 26rpx;
- color: #F97316;
- font-weight: 600;
- }
- /* Mascot badge in nav */
- .mascot-badge {
- display: flex;
- align-items: center;
- gap: 4rpx;
- padding: 6rpx 16rpx;
- background: #EEF2FF;
- border-radius: 20rpx;
- font-size: 22rpx;
- }
- .mascot-badge-icon {
- font-size: 24rpx;
- }
- .mascot-badge-name {
- color: #6366F1;
- font-weight: 500;
- }
- </style>
|