Browse Source

1.优化页面UI

王鹏鹏 2 years ago
parent
commit
c49c16f1f1

+ 3 - 3
baselib/src/main/java/com/yingyangfly/baselib/mvvm/BaseViewModel.kt

@@ -39,9 +39,9 @@ abstract class BaseViewModel : ViewModel() {
                 loadingStateFlow.value = StatusViewType.LOADING
             }
         }.onCompletion {
-            // if (showLoading) {
-            loadingStateFlow.value = StatusViewType.DISMISS
-            // }
+            if (showLoading) {
+                loadingStateFlow.value = StatusViewType.DISMISS
+            }
         }.flowOn(Dispatchers.IO).catch { e ->
             apiException(e).toast()
             loadingStateFlow.value = StatusViewType.ERROR

+ 1 - 1
workbenches/src/main/java/com/yingyang/workbenches/freetraining/FreeTrainViewModel.kt

@@ -17,7 +17,7 @@ class FreeTrainViewModel : BaseViewModel() {
     fun getSelectByDictType(
         fail: ((msg: String) -> Unit)? = null,
         success: ((success: List<TrainTypeBean>) -> Unit)? = null,
-    ) = launchFlow(true) {
+    ) = launchFlow(false) {
         WORKBENCHES_API.getSelectByDictType("game_type")
     }.runUI(
         success,