From 0e814840b18f025a59b92bd9953d201a1ace1ba0 Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Wed, 21 Oct 2026 15:59:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E5=89=A7=E9=9B=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=B1=95=E7=A4=BA=E5=88=86=E9=9B=86=E4=BA=92=E5=8A=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/admin/types.ts | 5 ++ .../contentManagement/DramaManagementView.vue | 17 +++---- .../EpisodeManagementView.vue | 48 ++++++++++++++++++- 3 files changed, 58 insertions(+), 12 deletions(-) diff --git a/src/api/admin/types.ts b/src/api/admin/types.ts index 632951a..8056e89 100644 --- a/src/api/admin/types.ts +++ b/src/api/admin/types.ts @@ -77,6 +77,10 @@ export interface EpisodeItem { status: string statusText: string views?: number + likeCount?: number + commentCount?: number + favoriteCount?: number + heat?: number sort?: number } @@ -89,6 +93,7 @@ export interface EpisodeSaveData { videoUrl?: string isFree?: boolean unlockCoin?: number + likeCount?: number status?: string sort?: number } diff --git a/src/views/contentManagement/DramaManagementView.vue b/src/views/contentManagement/DramaManagementView.vue index d914ec6..fd63ee5 100644 --- a/src/views/contentManagement/DramaManagementView.vue +++ b/src/views/contentManagement/DramaManagementView.vue @@ -43,6 +43,7 @@ const coverError = ref('') const coverFileName = ref('') const editingId = ref(null) const editingCommentCount = ref(0) +const editingLikeCount = ref(0) const formRef = ref() const form = reactive({ title: '', @@ -52,7 +53,6 @@ const form = reactive({ freeEpisodes: 3, unlockCoin: 0, favoriteCount: 0, - likeCount: 0, heat: 0, isHot: false, cover: '' @@ -162,7 +162,6 @@ function openCreate() { freeEpisodes: 3, unlockCoin: 0, favoriteCount: 0, - likeCount: 0, heat: 0, isHot: false, cover: '' @@ -170,6 +169,7 @@ function openCreate() { coverFileName.value = '' coverError.value = '' editingCommentCount.value = 0 + editingLikeCount.value = 0 dialogVisible.value = true resetValidation() } @@ -184,7 +184,6 @@ function openEdit(row) { freeEpisodes: row.freeEpisodes ?? 3, unlockCoin: row.unlockCoin ?? 0, favoriteCount: row.favoriteCount ?? 0, - likeCount: row.likeCount ?? 0, heat: row.views ?? 0, isHot: !!row.isHot, cover: row.cover || '' @@ -192,6 +191,7 @@ function openEdit(row) { coverFileName.value = row.cover ? coverBasename(row.cover) : '' coverError.value = '' editingCommentCount.value = row.commentCount ?? 0 + editingLikeCount.value = row.likeCount ?? 0 dialogVisible.value = true resetValidation() } @@ -606,13 +606,8 @@ onMounted(async () => { /> - +
{{ formatCount(editingLikeCount) }}
+

全剧分集汇总,只读

{
{{ formatCount(editingCommentCount) }}
-

实时统计,不可编辑

+

全剧汇总,实时统计,只读

diff --git a/src/views/contentManagement/EpisodeManagementView.vue b/src/views/contentManagement/EpisodeManagementView.vue index 6e1b4a9..0a5e5fd 100644 --- a/src/views/contentManagement/EpisodeManagementView.vue +++ b/src/views/contentManagement/EpisodeManagementView.vue @@ -35,6 +35,7 @@ const videoFileName = ref('') const previewVisible = ref(false) const previewEpisode = ref(null) const editingId = ref(null) +const editingCommentCount = ref(0) const formRef = ref() const form = reactive({ number: 1, @@ -43,6 +44,7 @@ const form = reactive({ videoUrl: '', isFree: true, unlockCoin: 0, + likeCount: 0, status: 'draft' }) @@ -127,10 +129,12 @@ function openCreate() { videoUrl: '', isFree: true, unlockCoin: selectedDrama.value?.unlockCoin ?? 0, + likeCount: 0, status: 'draft' }) videoFileName.value = '' videoError.value = '' + editingCommentCount.value = 0 dialogVisible.value = true resetValidation() } @@ -144,10 +148,12 @@ function openEdit(row) { videoUrl: row.videoUrl || '', isFree: !!row.isFree, unlockCoin: row.unlockCoin || 0, + likeCount: row.likeCount ?? 0, status: row.status }) videoFileName.value = row.videoUrl ? episodeBasename(row.videoUrl) : '' videoError.value = '' + editingCommentCount.value = row.commentCount ?? 0 dialogVisible.value = true resetValidation() } @@ -167,6 +173,7 @@ async function saveEpisode() { videoUrl: form.videoUrl.trim(), isFree: form.isFree, unlockCoin: form.isFree ? 0 : form.unlockCoin || 0, + likeCount: form.likeCount, status: form.status } saving.value = true @@ -325,7 +332,9 @@ onMounted(async () => { 当前短剧 {{ selectedDrama?.title || '暂无短剧' }} 共 {{ selectedDrama?.episodes ?? episodes.length }} 集共 {{ selectedDrama?.episodes ?? episodes.length }} 集 · 收藏 + {{ formatCount(selectedDrama?.favoriteCount ?? 0) }} · 热度 + {{ formatCount(selectedDrama?.views ?? 0) }}
@@ -398,6 +407,24 @@ onMounted(async () => { + + + +