Parcourir la source

1, 添加缓存 2, 添加数据加载动画

jsonwang il y a 3 ans
Parent
commit
311968af94

+ 5 - 5
MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -129,13 +129,13 @@ class MVHomeController: MVBaseController {
             return
         }
       
-        
+        PQLoadingHUB.shared.showHUB(superView:view)
         MVHomeViewModel.getHomeHotVideos { [weak self] hotVideos, _ in
             BFLog(message: "hotVideos count is :\(hotVideos.count)")
+            PQLoadingHUB.shared.dismissHUB(superView:(self?.view)!)
             let cacheData = MVHotVideoModel.getCacheData()
-            if(cacheData.count == 0){
-                self?.refreshData(hotVideos: hotVideos)
-            }
+            self?.refreshData(hotVideos: hotVideos)
+            
  
         }
     }
@@ -144,7 +144,7 @@ class MVHomeController: MVBaseController {
          
         mVideos = hotVideos
         categoryCollectionView.reloadData()
-        if (mVideos.count ?? 0) > 0 {
+        if mVideos.count > 0 {
             mVideos[0].isSelected = true
             for hotModel in mVideos {
                 for video in hotModel.videos {