结算页面、设置页面

This commit is contained in:
2025-11-19 18:35:53 +08:00
parent 9818dfc438
commit 60b712f216
75 changed files with 2983 additions and 647 deletions
@@ -158,12 +158,14 @@ class UserViewModel : BaseViewModel() {
/**
* 搜索食物
*/
fun searchByFoodName(foodName: String) {
fun searchByFoodName(foodName: String, action: (List<FoodInfo>) -> Unit = {}) {
Timber.d("searchByFoodName foodName = $foodName")
launchWithLoading {
val response = repository.getRestInfoFoodsByType(foodName = foodName)
if (parseResponse(response)) {
_searchFoodInfoList.value = response.result ?: emptyList()
val list = response.result ?: emptyList()
action(list)
_searchFoodInfoList.value = list
}
}
}