|
@@ -214,6 +214,8 @@ public class PQStuckPointMaterialController: PQBaseViewController {
|
|
|
view.insertSubview(materialListView, belowSubview: bottomRemindView)
|
|
|
// 卡点音乐素材选择曝光上报
|
|
|
PQEventTrackViewModel.baseReportUpload(businessType: .bt_windowView, objectType: .ot_view_selectSyncedUpMaterial, pageSource: .sp_stuck_selectMaterial, extParams: nil, remindmsg: "卡点视频数据上报-(曝光上报:卡点视频素材选择页)")
|
|
|
+ // 注册通知
|
|
|
+ addNotification(self, selector: #selector(dismissVc), name: cFinishedPublishedNotiKey, object: nil)
|
|
|
}
|
|
|
|
|
|
/// 按钮点击事件
|
|
@@ -267,6 +269,19 @@ public class PQStuckPointMaterialController: PQBaseViewController {
|
|
|
PQEventTrackViewModel.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_click_back, pageSource: .sp_stuck_selectMaterial, extParams: nil, remindmsg: "卡点视频数据上报-(点击上报:返回按钮)")
|
|
|
}
|
|
|
|
|
|
+ // 返回
|
|
|
+ @objc func dismissVc() {
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {[weak self] in
|
|
|
+ if self?.isPresent ?? false {
|
|
|
+ self?.dismiss(animated: true, completion: nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ deinit {
|
|
|
+ PQNotification.removeObserver(self)
|
|
|
+ }
|
|
|
+
|
|
|
/// 图库选择的回调
|
|
|
/// - Parameter seletedData: <#seletedData description#>
|
|
|
/// - Returns: <#description#>
|
|
@@ -279,10 +294,6 @@ public class PQStuckPointMaterialController: PQBaseViewController {
|
|
|
changeCollecBtn.imagePosition(at: .right, space: cDefaultMargin / 2)
|
|
|
photoMaterialVc.assetCollection = seletedData?.assetCollection
|
|
|
photoMaterialVc.msgType = photoMaterialVc.msgType
|
|
|
-// photoMaterialVc.msgType = .video
|
|
|
-// choseLocalAllBtn.isSelected = false
|
|
|
-// choseLocalVideoBtn.isSelected = true
|
|
|
-// choseLocalImageBtn.isSelected = false
|
|
|
}
|
|
|
|
|
|
/// 点击选择的回调
|
|
@@ -294,29 +305,13 @@ public class PQStuckPointMaterialController: PQBaseViewController {
|
|
|
confirmBtn.isSelected = (selectedDataCount > 0 && (imageCount >= 2 || selectedDataCount > imageCount))
|
|
|
if confirmBtn.isSelected {
|
|
|
confirmBtn.backgroundColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
|
|
|
-// if !materialHeadView.isHidden {
|
|
|
-// UIView.animate(withDuration: 0.5, delay: 0, options: .allowUserInteraction) { [weak self] in
|
|
|
-// // 调整位置
|
|
|
-// self?.adjustPhotoMaterialFrame()
|
|
|
-// } completion: { [weak self] _ in
|
|
|
-// self?.materialHeadView.isHidden = true
|
|
|
-// }
|
|
|
-// }
|
|
|
} else {
|
|
|
confirmBtn.backgroundColor = PQBFConfig.shared.otherTintColor
|
|
|
-// if materialHeadView.isHidden {
|
|
|
-// UIView.animate(withDuration: 0.5, delay: 0, options: .allowUserInteraction) { [weak self] in
|
|
|
-// // 调整位置
|
|
|
-// self?.adjustPhotoMaterialFrame(isHidden: false)
|
|
|
-// } completion: { _ in
|
|
|
-// }
|
|
|
-// }
|
|
|
}
|
|
|
if selectedDataCount <= 0 {
|
|
|
bottomRemindLab.attributedText = NSAttributedString(string: "至少选择 1 个视频或 2 张照片")
|
|
|
} else if selectedImageDataCount == 1, selectedDataCount == selectedImageDataCount {
|
|
|
let att = NSMutableAttributedString(string: "至少选择 1 个视频或 2 张照片")
|
|
|
-// att.setAttributes([.foregroundColor: UIColor.hexColor(hexadecimal: "#EE0051")], range: NSRange(location: 5, length: 1))
|
|
|
bottomRemindLab.attributedText = att
|
|
|
} else {
|
|
|
let att = NSMutableAttributedString(string: "素材总时长 \(totalDuration.formatDurationToHMS())")
|
|
@@ -326,32 +321,6 @@ public class PQStuckPointMaterialController: PQBaseViewController {
|
|
|
confirmBtn.setTitle(selectedDataCount > 0 ? "确定(\(selectedDataCount))" : "确定", for: .normal)
|
|
|
}
|
|
|
|
|
|
- /// 调整位置
|
|
|
- /// - Parameter isHidden: <#isHidden description#>
|
|
|
- /// - Returns: <#description#>
|
|
|
- func adjustPhotoMaterialFrame(isHidden _: Bool = true) {
|
|
|
-// if isHidden {
|
|
|
-// materialHeadView.alpha = 0
|
|
|
-// materialHeadView.frame = CGRect(x: 0, y: 0, width: materialHeadView.frame.width, height: 0)
|
|
|
-// photoMaterialVc.updateFrame(newFrame: CGRect(x: 0, y: choseLocalAllBtn.frame.maxY + margin, width: view.frame.width, height: view.frame.height - (choseLocalAllBtn.frame.maxY + margin + bottomRemindView.frame.height) - (selectedDataCount > 0 ? materialListView.frame.height : 0)), isAnimate: true)
|
|
|
-// } else {
|
|
|
-// materialHeadView.isHidden = false
|
|
|
-// materialHeadView.alpha = 1
|
|
|
-// materialHeadView.frame = CGRect(x: margin / 2, y: choseLocalAllBtn.frame.maxY + margin, width: view.frame.width - margin, height: topImageH)
|
|
|
-// photoMaterialVc.updateFrame(newFrame: CGRect(x: 0, y: (choseLocalAllBtn.frame.maxY + margin + topImageH) + margin / 2, width: view.frame.width, height: view.frame.height - ((choseLocalAllBtn.frame.maxY + margin + topImageH) + margin + bottomRemindView.frame.height) - (selectedDataCount > 0 ? materialListView.frame.height : 0)), isAnimate: true)
|
|
|
-// }
|
|
|
- }
|
|
|
-
|
|
|
- /// 更新frame
|
|
|
- /// - Parameter contentOffset: <#contentOffset description#>
|
|
|
- func updateMaterialHeadFrame(contentOffset _: CGPoint) {
|
|
|
-// BFLog(message: "===\((navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) + topImageH),\(contentOffset.y)")
|
|
|
-// if !materialHeadView.isHidden, contentOffset.y <= ((navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) + topImageH), contentOffset.y >= 0 {
|
|
|
-// materialHeadView.frame.origin.y = (navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) - contentOffset.y
|
|
|
-// photoMaterialVc.updateFrame(newFrame: CGRect(x: 0, y: materialHeadView.frame.maxY + margin / 2, width: view.frame.width, height: view.frame.height - (materialHeadView.frame.maxY + margin + bottomRemindView.frame.height) - (selectedDataCount > 0 ? materialListView.frame.height : 0)))
|
|
|
-// }
|
|
|
- }
|
|
|
-
|
|
|
/// 处理已经选择的数据
|
|
|
/// - Returns: <#description#>
|
|
|
func dealWithSelectedMaterials(isDissmiss: Bool, isChose: Bool, materialData: PQEditVisionTrackMaterialsModel?) {
|