From 05d1310a6ec27656712c0c5e5e57b3365d3faf56 Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期四, 29 五月 2025 16:54:34 +0800
Subject: [PATCH] api

---
 sub-pages/community/index.vue |   39 +++++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/sub-pages/community/index.vue b/sub-pages/community/index.vue
index 388b7d7..51f7dbb 100644
--- a/sub-pages/community/index.vue
+++ b/sub-pages/community/index.vue
@@ -4,7 +4,8 @@
       <view class="header">
         <up-icon name="list" size="40rpx" color="#333333" @click="onSettingClick" />
         <view>
-          <up-tabs :list="list1">
+          <!-- <up-tabs :list="list1"> -->
+          <up-tabs :list="userTabList">
             <!-- <template #left>
             <up-icon name="list" size="40rpx" color="#333333" />
           </template> -->
@@ -43,8 +44,12 @@
 <script setup lang="ts">
 import SettingPopup from '@/components/setting/setting-popup.vue';
 import { reactive, ref, onMounted } from 'vue';
-import { onLoad } from '@dcloudio/uni-app'
-
+import { FilmCategoryTree, FilmWorks } from '@/types/index'
+import { onLoad, onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
+import { FilmTabCategory, FilmWorksCategory } from '@/enums/dict'
+import { useGlobal } from '@/composables/useGlobal'
+const { $http, $message, $store } = useGlobal()
+import { getTabList } from '@/sub-pages/utils/api'
 // 控制设置弹窗显示
 const settingShow = ref(false);
 // 方法定义
@@ -53,21 +58,13 @@
 }
 
 // 创建响应式数据  
-const list1 = reactive([
-  { name: '关注' },
-  { name: '发现' },
-  { name: '苏州' },
-]);
-
-const tabList = ref([
-  { id: 'recommend', name: '推荐' },
-  { id: 'straight', name: '直播' },
-  { id: 'short', name: '短剧' },
-  { id: 'food', name: '美食' },
-  { id: 'travel', name: '穿搭' },
-  { id: 'beauty', name: '美甲' },
-  { id: 'more', name: '更多' },
-])
+// const list1 = reactive([
+//   { name: '关注' },
+//   { name: '发现' },
+//   { name: '苏州' },
+// ]);
+const userTabList = ref<FilmCategoryTree[]>([])
+const tabList = ref<FilmCategoryTree[]>([])
 
 const flowList = ref([
   {
@@ -124,6 +121,12 @@
   theme.value = storedTheme
 })
 
+
+onShow(() => {
+  getTabList(FilmTabCategory.USER_TYPE,userTabList,false)
+  getTabList(FilmTabCategory.FILM_TYPE, tabList)
+});
+
 </script>
 <style lang="scss" scoped>
 .header {

--
Gitblit v1.9.3