Bladeren bron

提交人:jtm
提交内容:菜品刷新优化

江天明 1 jaar geleden
bovenliggende
commit
b949d6e2c7
1 gewijzigde bestanden met toevoegingen van 3 en 8 verwijderingen
  1. 3 8
      BusinessMain/src/main/java/com/develop/main/viewmodel/HomeViewModel.kt

+ 3 - 8
BusinessMain/src/main/java/com/develop/main/viewmodel/HomeViewModel.kt

@@ -382,16 +382,11 @@ class HomeViewModel : BaseViewModel() {
                 val newFoods = searchLocalFood.subList(startFoodSearchSize, endFoodSearchSize)
                 lastLocalSearchFoodList.addAll(newFoods)
             }
-            val result = mutableListOf<Any>()
-            val homeHeader = HomeHeader()
-            homeHeader.filterSortModel = FilterSortModel("")
-            homeHeader.categoryModel = CategoryModel(recipeCount + foodCount, recipeCount, foodCount)
             val foodContentList = mutableListOf<FoodContentModel>()
-            result.add(homeHeader)
             when (lastSearchCategoryType) {
                 CategoryType.All -> {
                     lastTotalLocalSearchRecipeList.forEach {
-                        result.add(
+                        foodContentList.add(
                             FoodContentModel(
                                 it.photoPath ?: "",
                                 it.name ?: "",
@@ -406,7 +401,7 @@ class HomeViewModel : BaseViewModel() {
 
                 CategoryType.Recipes -> {
                     lastLocalRecipeList.forEach {
-                        result.add(
+                        foodContentList.add(
                             FoodContentModel(
                                 it.photoPath ?: "",
                                 it.name ?: "",
@@ -421,7 +416,7 @@ class HomeViewModel : BaseViewModel() {
 
                 CategoryType.Ingredients -> {
                     lastLocalSearchFoodList.forEach {
-                        result.add(
+                        foodContentList.add(
                             FoodContentModel(
                                 it.photoPath ?: "",
                                 it.name ?: "",