浏览代码

Merge branch 'dev' of https://git.yishihui.com/iOS/MusicVideoPlus into dev

harry 3 年之前
父节点
当前提交
1a834917e8
共有 1 个文件被更改,包括 23 次插入19 次删除
  1. 23 19
      MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

+ 23 - 19
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{
@@ -341,16 +346,15 @@ class MVHomeController: MVBaseController {
         jumpVideoData = videoData
         // 无网
         if !isNetConnected() {
-            let remindData: PQBaseModel = PQBaseModel()
-            remindData.title = "似乎已断开与互联网的连接"
-            let remindView = PQRemindView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
-            UIApplication.shared.keyWindow?.addSubview(remindView)
-            remindView.remindData = remindData
-            remindView.remindBlock = { sender, _ in
+ 
+            
+            PQUploadRemindView.showUploadRemindView(title:"似乎已断开与互联网的连接", summary: "", canMoreOpration:true,confirmTitle: "重新连接",cancelTitle:"取消", confirmColor:UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)) { sender, _ in
                 if sender.tag == 2 {
                     openAppSetting()
                 }
+
             }
+ 
             return
         }
         // 先判断是否登录