소스 검색

1,无网络时显示提示逻辑调整

jsonwang 3 년 전
부모
커밋
3205d7097e
1개의 변경된 파일18개의 추가작업 그리고 13개의 파일을 삭제
  1. 18 13
      MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

+ 18 - 13
MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -82,11 +82,23 @@ class MVHomeController: MVBaseController {
     }()
     //网络错误提示
     lazy var emptyRemindView: PQEmptyRemindView = {
-        let emptyRemindView = PQEmptyRemindView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth - 120 - cAKSafeAreaHeight))
+        let emptyRemindView = PQEmptyRemindView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
         emptyRemindView.fullRefreshBloc = { [weak self] _, _ in
             self?.getData()
             
-        }
+       }
+       emptyRemindView.isNetLost = true
+       emptyRemindView.remindLab.textColor = .black
+       emptyRemindView.remindLab.text = "网络错误"
+       emptyRemindView.remindLab.font = UIFont.boldSystemFont(ofSize: 20)
+       emptyRemindView.imageView.image = nil
+       emptyRemindView.remindSubLab.text = "请检查网络后重试"
+       emptyRemindView.remindSubLab.isHidden = false
+       emptyRemindView.refreshBtn.isHidden = false
+       emptyRemindView.refreshBtn.backgroundColor =  UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
+       emptyRemindView.refreshBtn.setTitle("重试", for: .normal)
+        
+
         return emptyRemindView
     }()
 
@@ -177,17 +189,10 @@ class MVHomeController: MVBaseController {
     //显示网络未连接提示
     func showNetworkError(isHidden:Bool) {
     
-        emptyRemindView.isHidden = isHidden
-    
-        emptyRemindView.remindLab.textColor = .black
-        emptyRemindView.remindLab.text = "网络错误"
-        emptyRemindView.remindLab.font = UIFont.boldSystemFont(ofSize: 20)
-        emptyRemindView.imageView.image = nil
-        emptyRemindView.remindSubLab.text = "请检查网络后重试"
-        emptyRemindView.remindSubLab.isHidden = false
-        emptyRemindView.refreshBtn.isHidden = false
-        emptyRemindView.refreshBtn.backgroundColor =   UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
-        emptyRemindView.refreshBtn.setTitle("重试", for: .normal)
+        //有数据时不进行操作
+        if(MVHotVideoModel.getCacheData().count != 0){
+            return
+        }
         if(isHidden){
             emptyRemindView.removeFromSuperview()
         }else{