|
@@ -6,9 +6,9 @@
|
|
|
// Copyright © 2021 BytesFlow. All rights reserved.
|
|
|
//
|
|
|
|
|
|
-import UIKit
|
|
|
import BFCommonKit
|
|
|
@_exported import BFUIKit
|
|
|
+import UIKit
|
|
|
|
|
|
class PQStuckPointMusicContentController: BFBaseViewController {
|
|
|
var itemList: [Any] = Array<Any>.init() // 所有分类数据
|
|
@@ -33,14 +33,7 @@ class PQStuckPointMusicContentController: BFBaseViewController {
|
|
|
// 卡点音乐页面类型
|
|
|
var contentType: stuckPointMusicContentType = .catagery {
|
|
|
didSet {
|
|
|
- if contentType == .page || contentType == .serach {
|
|
|
- // SanW - 待修改 -
|
|
|
-// collectionView.addRefreshView(type: .REFRESH_TYPE_FOOTER) { [weak self] isRefresh in
|
|
|
-// if self?.refreshHandle != nil {
|
|
|
-// self?.refreshHandle!(isRefresh, self?.contentType ?? .catagery)
|
|
|
-// }
|
|
|
-// }
|
|
|
- } else {
|
|
|
+ if contentType == .catagery {
|
|
|
lastIndexPath = IndexPath(item: 0, section: 0)
|
|
|
}
|
|
|
}
|
|
@@ -68,13 +61,13 @@ class PQStuckPointMusicContentController: BFBaseViewController {
|
|
|
}
|
|
|
// 延迟scrollView上子视图的响应,所以当直接拖动UISlider时,如果此时touch时间在150ms以内,UIScrollView会认为是拖动自己,从而拦截了event,导致UISlider接收不到滑动的event
|
|
|
collectionView.delaysContentTouches = false
|
|
|
- collectionView.addRefreshView (type:.REFRESH_TYPE_FOOTER) {[weak self, weak collectionView] isRefresh in
|
|
|
- if !isRefresh && self?.contentType != .catagery{
|
|
|
+ collectionView.addRefreshView(type: .REFRESH_TYPE_FOOTER) { [weak self, weak collectionView] isRefresh in
|
|
|
+ if !isRefresh, self?.contentType != .catagery {
|
|
|
// 请求一下加载更多
|
|
|
if self?.refreshHandle != nil {
|
|
|
self?.refreshHandle!(isRefresh, self?.contentType ?? .catagery)
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
collectionView?.mj_footer?.endRefreshing()
|
|
|
}
|
|
|
}
|
|
@@ -102,7 +95,7 @@ class PQStuckPointMusicContentController: BFBaseViewController {
|
|
|
emptyData.netDisRefreshBgColor = UIColor.hexColor(hexadecimal: "#FA6400")
|
|
|
emptyData.netDisTitle = "内容加载失败"
|
|
|
emptyData.netDisTitleColor = UIColor.hexColor(hexadecimal: "#333333")
|
|
|
- emptyData.netemptyDisImage = UIImage.init(named: "empty_netDis_icon")
|
|
|
+ emptyData.netemptyDisImage = UIImage(named: "empty_netDis_icon")
|
|
|
emptyData.netDisRefreshTitle = NSMutableAttributedString(string: "重新加载", attributes: [.font: UIFont.systemFont(ofSize: 16, weight: .medium), .foregroundColor: UIColor.white])
|
|
|
return emptyData
|
|
|
}()
|
|
@@ -247,9 +240,9 @@ extension PQStuckPointMusicContentController: UICollectionViewDelegate, UICollec
|
|
|
func collectionView(_ collectionView: UICollectionView, layout _: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
|
|
let itemData: Any = itemList[indexPath.item]
|
|
|
if let sul = itemData as? ([PQStuckPointMusicTagsModel], ([UICollectionViewLayoutAttributes], CGFloat)) {
|
|
|
- let height: CGFloat = (sul.0.count > 0) ? (sul.1.1 + 35) : 0
|
|
|
+ let height: CGFloat = (sul.0.count > 0) ? (sul.1.1 + 35) : 0
|
|
|
return CGSize(width: collectionView.frame.width, height: height)
|
|
|
- }else if itemData is BFEmptyModel {
|
|
|
+ } else if itemData is BFEmptyModel {
|
|
|
return CGSize(width: collectionView.frame.width, height: 290)
|
|
|
} else {
|
|
|
return CGSize(width: collectionView.frame.width, height: cellHight)
|