From a403393c1190994b473e679e1751794d9a1b9502 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期二, 01 七月 2025 10:36:07 +0800
Subject: [PATCH] add: 分享+景点管理

---
 sub-pages/film-list/film-list.vue |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/sub-pages/film-list/film-list.vue b/sub-pages/film-list/film-list.vue
index 47377ab..3257cd1 100644
--- a/sub-pages/film-list/film-list.vue
+++ b/sub-pages/film-list/film-list.vue
@@ -43,14 +43,24 @@
 const search = ref('')
 const keywords = ref('') // 新增关键词状态
 const tabList = ref<FilmCategoryTree[]>([])
+const currentCategory = ref('') // 默认为空表示全部
 const onSearch = (value: string) => {
   const searchValue = typeof value === 'string' ? value : search.value
   keywords.value = searchValue
   filmPage.value = 1
   films.value = []
   filmStatus.value = 'loadmore'
- getfilms()
+  getfilms()
 
+}
+
+const click = (item: FilmCategoryTree) => {
+  currentCategory.value = item.name // 更新当前分类
+  keywords.value = search.value
+  filmPage.value = 1             // 重置页码
+  films.value = []               // 清空电影列表
+  filmStatus.value = 'loadmore'  // 重置加载状态
+  getfilms()                     // 重新加载数据
 }
 
 const handleDetailClick = (item: FilmCategoryTree) => {
@@ -100,15 +110,16 @@
 const filmStatus = ref('loading')
 const getfilms = async () => {
   if (filmStatus.value === 'nomore') return
-
   filmStatus.value = 'loading'
 
   // TODO 暂时使用光影社区的类别
   const query: FilmWorksQueryDTO = {
+	category: currentCategory.value, // 将当前分类ID加入查询参数
     classify: '',
     type: '',
     current: filmPage.value,
     size: filmSize,
+	status: 'published',
 	keywords: keywords.value // 关键修改
   };
   const records = await getFilmWorksBase(query)

--
Gitblit v1.9.3