|
@@ -202,6 +202,13 @@ open class PQRemindView: UIView {
|
|
|
|
|
|
/// 空白提示页
|
|
|
open class PQEmptyRemindView: UIView {
|
|
|
+ // 是否没网提示
|
|
|
+ public var isNetLost:Bool = false {
|
|
|
+ didSet {
|
|
|
+ addData()
|
|
|
+ addLayout()
|
|
|
+ }
|
|
|
+ }
|
|
|
// 回调
|
|
|
public var fullRefreshBloc: ((_ isNetConnected: Bool, _ emptyData: PQEmptyModel?) -> Void)?
|
|
|
|
|
@@ -287,7 +294,7 @@ extension PQEmptyRemindView {
|
|
|
if emptyData?.summaryColor != nil {
|
|
|
remindSubLab.textColor = (emptyData?.summaryColor)!
|
|
|
}
|
|
|
- if !isNetConnected() {
|
|
|
+ if isNetLost {
|
|
|
remindSubLab.isHidden = true
|
|
|
refreshBtn.isHidden = false
|
|
|
remindLab.text = emptyData?.netDisTitle ?? "网络连接失败,请检查网络后重试"
|
|
@@ -366,7 +373,7 @@ extension PQEmptyRemindView {
|
|
|
// }
|
|
|
remindLab.snp.remakeConstraints { make in
|
|
|
make.left.right.equalToSuperview()
|
|
|
- make.top.equalTo(imageView.snp_bottom).offset(cDefaultMargin)
|
|
|
+ make.top.equalTo(imageView.snp.bottom).offset(cDefaultMargin)
|
|
|
}
|
|
|
remindSubLab.snp.makeConstraints { make in
|
|
|
make.left.right.equalToSuperview()
|
|
@@ -381,12 +388,12 @@ extension PQEmptyRemindView {
|
|
|
}
|
|
|
|
|
|
@objc func fullRefresh() {
|
|
|
- let isConnected: Bool = isNetConnected()
|
|
|
- if !isConnected {
|
|
|
- cShowHUB(superView: nil, msg: "网络不给力")
|
|
|
- }
|
|
|
+// let isConnected: Bool = isNetConnected()
|
|
|
+// if isNetLost {
|
|
|
+// cShowHUB(superView: nil, msg: "网络不给力")
|
|
|
+// }
|
|
|
if fullRefreshBloc != nil {
|
|
|
- fullRefreshBloc!(isConnected, emptyData)
|
|
|
+ fullRefreshBloc!(isNetLost, emptyData)
|
|
|
}
|
|
|
}
|
|
|
|