From 93775e1f3d79a1e11b839abbf24201dafcd9e646 Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期五, 25 四月 2025 13:45:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 app/src/main/java/com/example/firstapp/ui/home/HomeViewModel.kt |   36 +++++++++++++++++++++++++++++-------
 1 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/app/src/main/java/com/example/firstapp/ui/home/HomeViewModel.kt b/app/src/main/java/com/example/firstapp/ui/home/HomeViewModel.kt
index b367f26..fdf8755 100644
--- a/app/src/main/java/com/example/firstapp/ui/home/HomeViewModel.kt
+++ b/app/src/main/java/com/example/firstapp/ui/home/HomeViewModel.kt
@@ -192,17 +192,37 @@
         loadDataByType("火车票")
     }
 
+
+    fun loadAllCategoryData() {
+        getFullCategories().forEach { category ->
+            loadDataByType(category.name)
+        }
+    }
+
+
+    fun getFullCategories(): List<CategoryConfig> {
+        return listOf(
+            CategoryConfig(1, "快递", 0, true),
+            CategoryConfig(2, "还款", 1, true),
+            CategoryConfig(3, "收入", 2, true),
+//            CategoryConfig(4, "航班", 3, true),
+//            CategoryConfig(5, "火车票", 4, true)
+        )
+    }
+
     private fun loadCategories() {
         viewModelScope.launch {
             try {
                 // 默认完整分类列表
-                val fullCategories = listOf(
-                    CategoryConfig(1, "快递", 0, true),
-                    CategoryConfig(2, "还款", 1, true),
-                    CategoryConfig(3, "收入", 2, true),
-                    CategoryConfig(4, "航班", 3, true),
-                    CategoryConfig(5, "火车票", 4, true)
-                )
+//                val fullCategories = listOf(
+//                    CategoryConfig(1, "快递", 0, true),
+//                    CategoryConfig(2, "还款", 1, true),
+//                    CategoryConfig(3, "收入", 2, true),
+//                    CategoryConfig(4, "航班", 3, true),
+//                    CategoryConfig(5, "火车票", 4, true)
+//                )
+
+                val fullCategories=getFullCategories()
                 
                 // 基础分类(非会员可见)
                 val basicCategories = listOf(
@@ -359,6 +379,8 @@
         // 只清除内存中的数据
         _categories.value = emptyList()
         categoriesLoaded = false
+        // 删除token
+        PreferencesManager.clearUserData()
     }
 
 }
\ No newline at end of file

--
Gitblit v1.9.3