cloudroam
10 天以前 a4892378960434c17bb20f19e537df54be598142
add: tap查询、首页跳转
已修改2个文件
14 ■■■■ 文件已修改
pages/home/home.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub-pages/film-list/film-list.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.vue
@@ -79,7 +79,7 @@
// 旅行卡片数据
const detailUrl = '/api/filmworks/list'
const detailUrl = '/sub-pages/film-list/film-detail'
const tripCardList = ref<FilmWorks[]>([])
// 分页后的数组,每页3条
sub-pages/film-list/film-list.vue
@@ -43,6 +43,7 @@
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
@@ -51,6 +52,15 @@
  filmStatus.value = 'loadmore'
 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,11 +110,11 @@
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,