|
@@ -9,64 +9,7 @@ class TSDiscoverVC: TSBaseVC {
|
|
|
|
|
|
let viewModel:TSDiscoverViewModel = TSDiscoverViewModel()
|
|
let viewModel:TSDiscoverViewModel = TSDiscoverViewModel()
|
|
var hintBaseVC:TSAIListHintBaseVC = TSAIListHintBaseVC(config: .defaultConfig)
|
|
var hintBaseVC:TSAIListHintBaseVC = TSAIListHintBaseVC(config: .defaultConfig)
|
|
- lazy var photoPickerManager: TSPhotoPickerManager = TSPhotoPickerManager(viewController: self)
|
|
|
|
-
|
|
|
|
-// lazy var vipBtn: UIButton = {
|
|
|
|
-// let vipBtn = UIButton.createButton(image: UIImage(named: "nav_vip")) { [weak self] in
|
|
|
|
-// guard let self = self else { return }
|
|
|
|
-// if kPurchaseCountDownTime.isCountDown {
|
|
|
|
-// kPresentModalVC(target: self, modelVC: TSPurchasePromotionalVC(isAnimation: false))
|
|
|
|
-// }else{
|
|
|
|
-// TSPurchaseVC.show(target: self)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// vipBtn.isHidden = true
|
|
|
|
-// return vipBtn
|
|
|
|
-// }()
|
|
|
|
-//
|
|
|
|
-// lazy var purchaseCountdownView : TSPurchaseCountdownView = {
|
|
|
|
-// let purchaseCountdownView = TSPurchaseCountdownView()
|
|
|
|
-// purchaseCountdownView.clickBlock = { [weak self] in
|
|
|
|
-// guard let self = self else { return }
|
|
|
|
-// kPresentModalVC(target: self, modelVC: TSPurchasePromotionalVC(isAnimation: false))
|
|
|
|
-// }
|
|
|
|
-// purchaseCountdownView.isHidden = true
|
|
|
|
-// return purchaseCountdownView
|
|
|
|
-// }()
|
|
|
|
-// lazy var navBarView: TSBaseNavContentBarView = {
|
|
|
|
-// let navBarView = TSBaseNavContentBarView()
|
|
|
|
-//
|
|
|
|
-// let label = UILabel.createLabel(text: "Discover".localized,font: .font(size: 22,weight: .semibold),textColor: .white)
|
|
|
|
-// label.addShadow(shadowColor: UIColor.black.cgColor, shadowOffset: CGSize(width: 2, height: 2), shadowRadius: 2, shadowOpacity: 0.3)
|
|
|
|
-// navBarView.barView.addSubview(label)
|
|
|
|
-// label.snp.makeConstraints { make in
|
|
|
|
-// make.centerY.equalToSuperview()
|
|
|
|
-// make.leading.equalTo(17.0)
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// let stackView:UIStackView = UIStackView()
|
|
|
|
-// stackView.spacing = 8
|
|
|
|
-// navBarView.barView.addSubview(stackView)
|
|
|
|
-// stackView.addArrangedSubview(vipBtn)
|
|
|
|
-// stackView.addArrangedSubview(purchaseCountdownView)
|
|
|
|
-// stackView.snp.makeConstraints { make in
|
|
|
|
-// make.centerY.equalToSuperview()
|
|
|
|
-// make.trailing.equalTo(-16)
|
|
|
|
-// }
|
|
|
|
-// vipBtn.snp.makeConstraints { make in
|
|
|
|
-// make.width.height.equalTo(24)
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// purchaseCountdownView.snp.makeConstraints { make in
|
|
|
|
-// make.height.equalTo(24)
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// return navBarView
|
|
|
|
-// }()
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
lazy var collectionView: TSBaseCollectionView = {
|
|
lazy var collectionView: TSBaseCollectionView = {
|
|
let collectionViewLayout = UICollectionViewFlowLayout()
|
|
let collectionViewLayout = UICollectionViewFlowLayout()
|
|
let collectionView = TSBaseCollectionView(frame: .zero, collectionViewLayout: collectionViewLayout)
|
|
let collectionView = TSBaseCollectionView(frame: .zero, collectionViewLayout: collectionViewLayout)
|
|
@@ -88,11 +31,6 @@ class TSDiscoverVC: TSBaseVC {
|
|
override func createView() {
|
|
override func createView() {
|
|
addNormalNavBarView()
|
|
addNormalNavBarView()
|
|
|
|
|
|
-// navBarContentView.addSubview(navBarView)
|
|
|
|
-// navBarView.snp.makeConstraints { make in
|
|
|
|
-// make.edges.equalToSuperview()
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
contentView.snp.updateConstraints { make in
|
|
contentView.snp.updateConstraints { make in
|
|
make.top.equalTo(0)
|
|
make.top.equalTo(0)
|
|
}
|
|
}
|
|
@@ -106,39 +44,11 @@ class TSDiscoverVC: TSBaseVC {
|
|
}
|
|
}
|
|
|
|
|
|
override func dealThings() {
|
|
override func dealThings() {
|
|
-// NotificationCenter.default.addObserver(self, selector: #selector(updateVipView), name: .kPurchaseDidChanged, object: nil)
|
|
|
|
-// updateVipView()
|
|
|
|
-// NotificationCenter.default.addObserver(self, selector: #selector(checkkPurchaseCountDownTime), name: .kCloseTSPurchasePromotionalVC, object: nil)
|
|
|
|
-// checkkPurchaseCountDownTime()
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
-// @objc func updateVipView() {
|
|
|
|
-// kMainAsync{
|
|
|
|
-// self.vipBtn.isHidden = PurchaseManager.default.isVip
|
|
|
|
-// self.checkkPurchaseCountDownTime()
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// @objc func checkkPurchaseCountDownTime(){
|
|
|
|
-// if kPurchaseCountDownTime.isCountDown {
|
|
|
|
-// self.purchaseCountdownView.isHidden = false
|
|
|
|
-// kPurchaseCountDownTime.complete = { [weak self] minutes, seconds, end in
|
|
|
|
-// guard let self = self else { return }
|
|
|
|
-// if end {
|
|
|
|
-// self.purchaseCountdownView.isHidden = true
|
|
|
|
-// }else{
|
|
|
|
-// self.purchaseCountdownView.minLabel.text = minutes
|
|
|
|
-// self.purchaseCountdownView.secLabel.text = seconds
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }else{
|
|
|
|
-// self.purchaseCountdownView.isHidden = true
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
super.viewWillAppear(animated)
|
|
super.viewWillAppear(animated)
|
|
-// checkkPurchaseCountDownTime()
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -232,46 +142,6 @@ extension TSDiscoverVC: UICollectionViewDataSource ,UICollectionViewDelegate,UIC
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-//extension TSDiscoverVC: UIScrollViewDelegate {
|
|
|
|
-// // 开始拖拽(用户开始滚动)
|
|
|
|
-// func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
|
|
|
-//// dePrint("scrollView.contentOffset.y=\(scrollView.contentOffset.y)")
|
|
|
|
-//
|
|
|
|
-// let height:CGFloat = 50 + k_Nav_Height
|
|
|
|
-//
|
|
|
|
-//// let alpha = scrollView.contentOffset.y/height
|
|
|
|
-//// navBarView.backgroundColor = .mainBg.withAlphaComponent(alpha)
|
|
|
|
-//
|
|
|
|
-// navBarView.backgroundColor = scrollView.contentOffset.y >= height ? .mainBg : .clear
|
|
|
|
-// }
|
|
|
|
-//}
|
|
|
|
-//extension TSDiscoverVC: UIScrollViewDelegate {
|
|
|
|
-// // 开始拖拽(用户开始滚动)
|
|
|
|
-// func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
|
|
|
|
-// print("滚动开始")
|
|
|
|
-// NotificationCenter.default.post(name: .kDiscoverScrollViewWillBegin, object: nil)
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// // 结束拖拽(用户手指离开屏幕)
|
|
|
|
-// func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
|
|
|
|
-// if !decelerate {
|
|
|
|
-// print("滚动完全停止(无减速动画)")
|
|
|
|
-// NotificationCenter.default.post(name: .kDiscoverScrollViewEndDecelerating, object: nil)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// // 结束减速(滚动完全停止)
|
|
|
|
-// func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
|
|
|
|
-// print("滚动完全停止")
|
|
|
|
-// NotificationCenter.default.post(name: .kDiscoverScrollViewEndDecelerating, object: nil)
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// // 以下方法组合可以准确判断滚动是否真正结束
|
|
|
|
-// func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
|
|
|
|
-// print("编程触发的滚动动画结束")
|
|
|
|
-// NotificationCenter.default.post(name: .kDiscoverScrollViewEndDecelerating, object: nil)
|
|
|
|
-// }
|
|
|
|
-//}
|
|
|
|
|
|
|
|
extension TSDiscoverVC {
|
|
extension TSDiscoverVC {
|
|
|
|
|