From feac6371ea942775b4cd138e2eff07fa8b32c6ac Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 19 Sep 2026 20:31:58 +0800 Subject: [PATCH] =?UTF-8?q?ux:=20=E9=A6=96=E9=A1=B5=E4=BB=8A=E6=97=A5?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=8F=AF=E7=82=B9=E8=BF=9B=E8=AF=A6=E6=83=85?= =?UTF-8?q?=EF=BC=9B=E6=90=9C=E7=B4=A2=E9=A1=B5=E7=83=AD=E9=97=A8=E8=AF=8D?= =?UTF-8?q?=EF=BC=9B=E8=B6=8B=E5=8A=BF=E9=A1=B5=E5=8E=BB=E5=81=87=E6=95=B0?= =?UTF-8?q?=E6=8D=AE/=E5=A7=8B=E7=BB=88=E8=BF=9B=E7=AB=99=E5=86=85?= =?UTF-8?q?=E8=AF=A6=E6=83=85(=E9=98=85=E8=AF=BB=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=94=9F=E6=95=88)=EF=BC=9B=E8=B5=84=E8=AE=AF?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=8E=BB=E5=A4=A7emoji=E5=A4=B4=E5=9B=BE/?= =?UTF-8?q?=E5=8A=A0=E4=BA=BA=E8=AF=9D=E8=A7=A3=E8=AF=BB=E5=8D=A1/?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E6=8C=89=E9=92=AE=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/pages/index/index.vue | 2 ++ client/src/pages/news/news.vue | 24 ++++++++++---- client/src/pages/search/search.vue | 31 +++++++++++++++--- client/src/pages/trend/trend.vue | 51 ++---------------------------- 4 files changed, 49 insertions(+), 59 deletions(-) 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(() => {