Преглед на файлове

1.调整无网空白页

wenweiwei преди 3 години
родител
ревизия
ee14723bf8

+ 5 - 0
BFCommonKit/Classes/BFBase/Controller/PQBaseWebViewController.swift

@@ -15,6 +15,11 @@ open class PQBaseWebViewController: PQBaseViewController {
         let emptyData = PQEmptyModel()
         emptyData.title = "网页加载失败,请重试~"
         emptyData.emptyImage = "pic_network"
+        emptyData.netDisRefreshBgColor = UIColor.hexColor(hexadecimal: "#FA6400")
+        emptyData.netDisTitle = "内容加载失败"
+        emptyData.netDisTitleColor = UIColor.hexColor(hexadecimal: "#333333")
+        emptyData.netemptyDisImage = UIImage.init(named: "empty_netDis_icon")
+        emptyData.netDisRefreshTitle = NSMutableAttributedString(string: "重新加载", attributes: [.font: UIFont.systemFont(ofSize: 16, weight: .medium), .foregroundColor: UIColor.white])
         return emptyData
     }()
 

+ 5 - 0
BFCommonKit/Classes/BFBase/Model/PQBaseModel.swift

@@ -190,4 +190,9 @@ public class PQEmptyModel: NSObject {
     public var refreshImage: String? // 刷新按钮图片
     public var refreshTitle: NSMutableAttributedString? // 刷新按钮文字
     public var refreshBgColor: UIColor? // 刷新按钮背景颜色
+    public var netemptyDisImage: UIImage? // 无网空白提示图
+    public var netDisRefreshTitle: NSMutableAttributedString? // 无网刷新按钮文字
+    public var netDisTitle: String? // 无网标题
+    public var netDisTitleColor: UIColor? // 无网标题颜色
+    public var netDisRefreshBgColor: UIColor? // 无网刷新按钮背景颜色
 }

+ 17 - 5
BFCommonKit/Classes/BFBase/View/PQRemindView.swift

@@ -288,13 +288,25 @@ extension PQEmptyRemindView {
             remindSubLab.textColor = (emptyData?.summaryColor)!
         }
         if !isNetConnected() {
-            remindLab.text = "网络连接失败,请检查网络后重试"
             remindSubLab.isHidden = true
             refreshBtn.isHidden = false
-            refreshBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#EE0051")
-            refreshBtn.setTitleColor(UIColor.white, for: .normal)
-            refreshBtn.setTitle("刷新", for: .normal)
-            imageView.image = UIImage.moduleImage(named: "pic_network", moduleName: "BFCommonKit")
+            remindLab.text = emptyData?.netDisTitle ?? "网络连接失败,请检查网络后重试"
+            if emptyData?.netDisRefreshBgColor != nil {
+                refreshBtn.backgroundColor = emptyData?.netDisRefreshBgColor
+            } else {
+                refreshBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#EE0051")
+            }
+            if emptyData?.netDisTitleColor != nil {
+                refreshBtn.setTitleColor(emptyData?.netDisTitleColor, for: .normal)
+            }else{
+                refreshBtn.setTitleColor(UIColor.white, for: .normal)
+            }
+            if emptyData?.netDisRefreshTitle != nil {
+                refreshBtn.setAttributedTitle(emptyData?.netDisRefreshTitle, for: .normal)
+            }else {
+                refreshBtn.setTitle("刷新", for: .normal)
+            }
+            imageView.image = emptyData?.netemptyDisImage ?? UIImage.moduleImage(named: "pic_network", moduleName: "BFCommonKit")
         } else {
 //            if emptyData?.emptyImage != nil, emptyData?.emptyImage?.count ?? 0 > 0 {
 //                imageView.image = UIImage.moduleImage(named: emptyData?.emptyImage ?? "", moduleName: "BFCommonKit")