From 675246cde2f297d0907518e8c465e0eb834022ed Mon Sep 17 00:00:00 2001 From: hajimi Date: Sat, 4 Jul 2026 23:59:31 +0800 Subject: [PATCH] deploy: auto commit uniapp changes 2026-07-04 23:59:31 --- uniapp/src/pages/empty/empty.vue | 20 -------- uniapp/src/pages/news_detail/news_detail.vue | 52 +++++++++++--------- 2 files changed, 28 insertions(+), 44 deletions(-) diff --git a/uniapp/src/pages/empty/empty.vue b/uniapp/src/pages/empty/empty.vue index fd0a1ad..57340cb 100644 --- a/uniapp/src/pages/empty/empty.vue +++ b/uniapp/src/pages/empty/empty.vue @@ -8,9 +8,6 @@ 搜索世博头条 - - + - @@ -399,23 +396,6 @@ const handleAiAnalysis = (post: any) => { color: #808080; } - &__publish { - width: 68rpx; - height: 68rpx; - display: flex; - align-items: center; - justify-content: center; - background: #E5EDFF; - border-radius: 12rpx; - flex-shrink: 0; - } - - &__publish-icon { - font-size: 40rpx; - color: #185dff; - font-weight: 300; - line-height: 1; - } } .community-tags { diff --git a/uniapp/src/pages/news_detail/news_detail.vue b/uniapp/src/pages/news_detail/news_detail.vue index 6e1c88f..1205210 100644 --- a/uniapp/src/pages/news_detail/news_detail.vue +++ b/uniapp/src/pages/news_detail/news_detail.vue @@ -110,25 +110,32 @@ - - 写评论... + + + + + 写下你的评论... + {{ commentTotal ? `${commentTotal}条讨论` : '抢先参与讨论' }} + - - - {{ newsData.like_count || 0 }} + + + + + {{ formatActionCount(newsData.like_count || 0) }} - - - {{ newsData.dislike_count || 0 }} - - - + + + + {{ newsData.collect ? '已藏' : '收藏' }} - + + + 分享 @@ -546,17 +553,6 @@ const handleLike = async () => { } } -const handleDislike = async () => { - try { - const res = await articleVote({ article_id: Number(newsId), vote_type: 2 }) - voteStatus.value = res.action === 'cancel' ? 0 : 2 - newsData.value.like_count = res.like_count - newsData.value.dislike_count = res.dislike_count - } catch (e) { - // ignore - } -} - const handleCollect = async () => { try { if (newsData.value.collect) { @@ -583,6 +579,14 @@ const handleShare = () => { showSharePopup.value = true } +const formatActionCount = (value: number | string) => { + const count = Number(value || 0) + if (!Number.isFinite(count) || count <= 0) return '点赞' + if (count >= 10000) return `${(count / 10000).toFixed(count >= 100000 ? 0 : 1)}万` + if (count > 999) return '999+' + return String(count) +} + const formatTime = (t: string) => { if (!t) return '' const d = new Date(t.replace(/-/g, '/'))