diff --git a/client/src/pages/index/index.vue b/client/src/pages/index/index.vue index e2deae2..538560e 100644 --- a/client/src/pages/index/index.vue +++ b/client/src/pages/index/index.vue @@ -221,6 +221,8 @@ function goFirstUnlit() { function resumeRead() { if (lastRead.value?.id) { uni.navigateTo({ url: `/pages/detail/detail?id=${lastRead.value.id}` }) + } else if (todayKnowledge.value?.id || todayKnowledge.value?._id) { + uni.navigateTo({ url: `/pages/detail/detail?id=${todayKnowledge.value.id || todayKnowledge.value._id}` }) } } diff --git a/client/src/pages/news/news.vue b/client/src/pages/news/news.vue index 3c7dab4..51307bc 100644 --- a/client/src/pages/news/news.vue +++ b/client/src/pages/news/news.vue @@ -11,11 +11,6 @@ - - - {{ heroEmoji }} - - {{ categoryLabel }} @@ -50,6 +45,14 @@ {{ news.summary }} + + + 💡 一句话说清 + {{ news.plainExplain }} + 🎯 对你意味着 + {{ news.takeAway }} + + @@ -176,10 +179,19 @@ function onFavorite() { } function onShare() { + // #ifdef MP-WEIXIN + uni.showModal({ + title: '分享给朋友', + content: '点击右上角「···」→ 转发给朋友或分享到朋友圈', + showCancel: false, + }) + // #endif + // #ifdef H5 uni.setClipboardData({ - data: news.value.link || `https://ai-dimension.yuzhiran.com.cn/news/${news.value._id || ''}`, + data: news.value.sourceUrl || `https://wdkj.yuzhiran.com.cn/trends/${news.value._id || ''}`, success: () => uni.showToast({ title: '链接已复制', icon: 'none' }) }) + // #endif } function openSource() { diff --git a/client/src/pages/search/search.vue b/client/src/pages/search/search.vue index 4245cdc..da6aead 100644 --- a/client/src/pages/search/search.vue +++ b/client/src/pages/search/search.vue @@ -31,11 +31,13 @@ 搜索中... - + - 没有找到相关知识 + 🔍 输入关键词搜索 AI 知识 - 支持按标题、摘要、标签搜索 + + {{ w }} + @@ -92,6 +94,11 @@ import { knowledgeApi } from '@/utils/api' import { DIMENSIONS } from '@/utils/dimensions' const searchText = ref('') +const HOT_WORDS = ['大模型', 'Transformer', 'DeepSeek', '提示词', 'AI绘画', '智能体', 'RAG', '具身智能'] +function quickSearch(w) { + searchText.value = w + doSearch() +} const results = ref([]) const loading = ref(false) const hasSearched = ref(false) @@ -395,4 +402,20 @@ onShareAppMessage(() => ({ font-size: 11px; color: var(--text-secondary); } - + +.hot-words { + display: flex; + flex-wrap: wrap; + gap: 8px; + justify-content: center; + margin-top: 16px; + padding: 0 20px; +} +.hot-word { + padding: 6px 16px; + border-radius: 999px; + background: var(--glass-bg, #f3f4fa); + color: var(--text-secondary, #4a4f63); + font-size: 13px; +} + \ No newline at end of file diff --git a/client/src/pages/trend/trend.vue b/client/src/pages/trend/trend.vue index 920bac5..f68b7e8 100644 --- a/client/src/pages/trend/trend.vue +++ b/client/src/pages/trend/trend.vue @@ -121,8 +121,7 @@ async function fetchTrends() { items.value = data.list || data.items || [] } catch (err) { console.error('获取趋势失败:', err) - // 降级:本地示例 - items.value = getSampleData() + uni.showToast({ title: '加载失败,下拉重试', icon: 'none' }) } finally { loading.value = false } @@ -159,57 +158,11 @@ function formatDate(dateStr) { } function goDetail(item) { - // 如果有原文链接,跳转外部 - if (item.link) { - // 微信小程序不支持直接打开外部链接,复制链接提示 - uni.setClipboardData({ - data: item.link, - success: () => { - uni.showModal({ - title: '打开链接', - content: '链接已复制,请在浏览器中打开', - showCancel: false - }) - } - }) - return - } + // 始终进入站内详情页(人话解读/阅读量统计/收藏/分享);原文链接在详情页内提供 uni.setStorageSync('__news_item__', JSON.stringify(item)) uni.navigateTo({ url: '/pages/news/news' }) } -function getSampleData() { - return [ - { - title: 'DeepSeek 发布 R1 推理模型', - summary: 'DeepSeek R1 在多项基准测试中超越 GPT-4o,引发全球关注', - source: '量子位', - newsDate: new Date(Date.now() - 2 * 3600000).toISOString(), - category: 'product', - hot: true, - hotCount: 2000, - viewCount: 15000 - }, - { - title: 'Google Gemini 1.5 Pro 发布', - summary: '支持 200 万 token 上下文窗口,多模态能力大幅提升', - source: '机器之心', - newsDate: new Date(Date.now() - 6 * 3600000).toISOString(), - category: 'product', - viewCount: 8000 - }, - { - title: 'Transformer 论文作者新方向', - summary: '从注意力机制到状态空间模型,作者分享最新研究进展', - source: 'PaperWeekly', - newsDate: new Date(Date.now() - 12 * 3600000).toISOString(), - category: 'paper', - picked: true, - viewCount: 5000 - } - ] -} - // 微信小程序分享 // #ifdef MP-WEIXIN onShareAppMessage(() => {