|
@@ -43,13 +43,29 @@ class MVMineProductController: PQBaseViewController {
|
|
|
return proCollectView
|
|
|
}()
|
|
|
|
|
|
+ lazy var emptyView: MVProductEmptyView = {
|
|
|
+ let emptyView = MVProductEmptyView.init(frame: CGRect.init(x: 0, y: headH, width: collectionView.frame.width, height: collectionView.frame.height - headH))
|
|
|
+ emptyView.btnClickHandle = {[weak self] sender in
|
|
|
+ let vc = PQStuckPointMaterialController()
|
|
|
+ self?.navigationController?.pushViewController(vc, animated: true)
|
|
|
+ }
|
|
|
+ emptyView.isHidden = true
|
|
|
+ return emptyView
|
|
|
+ }()
|
|
|
override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
|
view.addSubview(collectionView)
|
|
|
+ collectionView.addSubview(emptyView)
|
|
|
collectionView.addSubview(headInfoView)
|
|
|
leftBackButton()
|
|
|
loadRequestData()
|
|
|
setTitle(title: BFLoginUserInfo.shared.nickName, color: UIColor(white: 0, alpha: 0))
|
|
|
+ MVMineViewModel.userInfoData { [weak self] count, _ in
|
|
|
+ if count != nil {
|
|
|
+ BFLoginUserInfo.shared.videos = "\(count ?? 0)"
|
|
|
+ self?.headInfoView.updateProducts()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// 请求网络数据
|
|
@@ -62,19 +78,32 @@ class MVMineProductController: PQBaseViewController {
|
|
|
pageNum = pageNum + 1
|
|
|
}
|
|
|
MVMineViewModel.userVideoListData(pageNum: pageNum) { [weak self] videoList, _ in
|
|
|
- if videoList != nil, (videoList?.count ?? 0) > 0 {
|
|
|
- if isRefresh {
|
|
|
- self?.itemsList = videoList!
|
|
|
+ if videoList != nil {
|
|
|
+ if (videoList?.count ?? 0) > 0 {
|
|
|
+ if isRefresh {
|
|
|
+ self?.itemsList = videoList!
|
|
|
+ } else {
|
|
|
+ self?.itemsList = self!.itemsList + videoList!
|
|
|
+ }
|
|
|
+ self?.flowLayout.findList = self?.itemsList as! [PQVideoListModel]
|
|
|
+ self?.collectionView.reloadData()
|
|
|
+ self?.emptyView.isHidden = true
|
|
|
} else {
|
|
|
- self?.itemsList = self!.itemsList + videoList!
|
|
|
+ self?.emptyView.isHidden = false
|
|
|
}
|
|
|
- self?.flowLayout.findList = self?.itemsList as! [PQVideoListModel]
|
|
|
- self?.collectionView.reloadData()
|
|
|
} else {
|
|
|
+ cShowHUB(superView: nil, msg: "没有网络连接")
|
|
|
self?.pageNum = (self?.pageNum ?? 1) - 1
|
|
|
}
|
|
|
- self?.collectionView.mj_header?.endRefreshing()
|
|
|
- self?.collectionView.mj_footer?.endRefreshing()
|
|
|
+ if isRefresh {
|
|
|
+ self?.collectionView.mj_header?.endRefreshing()
|
|
|
+ self?.collectionView.mj_footer?.resetNoMoreData()
|
|
|
+ } else {
|
|
|
+ self?.collectionView.mj_footer?.endRefreshing()
|
|
|
+ }
|
|
|
+ if (videoList?.count ?? 0) < 20 {
|
|
|
+ self?.collectionView.mj_footer?.endRefreshingWithNoMoreData()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -94,7 +123,7 @@ extension MVMineProductController: UICollectionViewDelegate, UICollectionViewDat
|
|
|
return cell
|
|
|
}
|
|
|
|
|
|
- private func collectionView(collectionView _: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
|
|
+ func collectionView(_: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
|
|
if itemsList[indexPath.item].auditStatus != 5 || itemsList[indexPath.item].transcodeStatus != 3 {
|
|
|
return
|
|
|
}
|
|
@@ -137,6 +166,10 @@ extension MVMineProductController: UICollectionViewDelegate, UICollectionViewDat
|
|
|
})
|
|
|
self?.flowLayout.findList = self?.itemsList as! [PQVideoListModel]
|
|
|
self?.collectionView.reloadData()
|
|
|
+ cShowHUB(superView: nil, msg: "删除成功")
|
|
|
+ if (self?.itemsList.count ?? 0) <= 0 {
|
|
|
+ self?.loadRequestData()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -151,4 +184,6 @@ extension MVMineProductController: UICollectionViewDelegate, UICollectionViewDat
|
|
|
firstBtn?.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
|
|
|
seleView.contentView.subviews[2].backgroundColor = UIColor.hexColor(hexadecimal: "#F2F2F2")
|
|
|
}
|
|
|
+
|
|
|
+ @objc func btnClick(sender _: UIButton) {}
|
|
|
}
|