瀏覽代碼

UI bug fix

jsonwang 3 年之前
父節點
當前提交
11388fad98

+ 21 - 11
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointPublicController.swift

@@ -226,7 +226,7 @@ class PQStuckPointPublicController: PQBaseViewController {
         let progressView = UIProgressView(progressViewStyle: .default)
         progressView.trackTintColor = UIColor(white: 0, alpha: 0.5)
         progressView.progressTintColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
-        progressView.transform = CGAffineTransform(scaleX: 1.0, y: playerHeaderView.frame.height / 3.0)
+        progressView.transform = CGAffineTransform(scaleX: 1.0, y: playerHeaderView.frame.height)
         return progressView
     }()
 
@@ -296,12 +296,15 @@ class PQStuckPointPublicController: PQBaseViewController {
         publicTitleView.isHidden = true
         publicTitleView.confirmBtnClock = { [weak self] title in
             BFLog(message: "传出的 title  is :\(String(describing: title))")
-            self?.changPlayerIsPause(isPause: false)
+            if(title?.count != 0 && title != self?.titleLabel.text){
+                self?.changPlayerIsPause(isPause: false)
 
-            self?.setTitleText(text: title ?? "",textColor: .black)
-            //更新数据
-            self?.videoData?.title = title
-            self?.updateCoverImagegOrTitle()
+                self?.setTitleText(text: title ?? "",textColor: .black)
+                //更新数据
+                self?.videoData?.title = title
+                self?.updateCoverImagegOrTitle()
+            }
+         
         }
         publicTitleView.viewIsHiddenCallBack = { [weak self] in
             
@@ -445,6 +448,7 @@ class PQStuckPointPublicController: PQBaseViewController {
         view.addSubview(publicTitleView)
         view.addSubview(publicEditCoverView)
    
+        coverImageTitle.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(settingCoverImage)))
         coverImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(settingCoverImage)))
         
         progressView.snp.makeConstraints { make in
@@ -1129,7 +1133,7 @@ extension PQStuckPointPublicController {
             navigationController?.viewControllers = [(navigationController?.viewControllers.first)!]
             // 发送通知
             postNotification(name: cFinishedPublishedNotiKey)
-            postNotification(name: cFinishSharedNotiKey)
+
 
         default:
             break
@@ -1262,7 +1266,7 @@ extension PQStuckPointPublicController {
     //更新标题或封面
     func updateCoverImagegOrTitle() {
         
-        PQLoadingHUB.shared.showHUB()
+        PQLoadingHUB.shared.showHUB(isMode: true)
         
         PQBaseViewModel.ossTempToken { [weak self] response, msg in
             let image: UIImage = (self?.uploadData?.image)!
@@ -1285,12 +1289,18 @@ extension PQStuckPointPublicController {
                     if code == 1 && ossObjectKey == objectKey && ossObjectKey.count > 0 {
                         PQUploadViewModel.updateVideo(title: self?.videoData?.title ?? "", videoId: self?.videoData?.uniqueId ?? "", coverImgPath: objectKey, descr: "") { newVideoData, msg in
                             PQLoadingHUB.shared.dismissHUB()
+                   
                             if newVideoData == nil {
                                 cShowHUB(superView: self?.view, msg: msg)
+                                //可能有敏感词 要刷一组新标题并自动更新
+                                let numberRandom: UInt32 = UInt32(arc4random_uniform(UInt32(  self?.publicTitleView.titles.count ?? 0)))
+                     
+                                self?.setTitleText(text:   self?.publicTitleView.titles[Int(numberRandom)] ?? "")
+                                
+                                self?.updateCoverImagegOrTitle()
+                                
                                 return
                             }
-//                            self?.navigationController?.popToRootViewController(animated: true)
-//                            postNotification(name: cUpdateVideoSuccessKey, userInfo: ["videoData": newVideoData!])
                         }
                     } else {
                         PQLoadingHUB.shared.dismissHUB()
@@ -1328,7 +1338,7 @@ extension PQStuckPointPublicController {
     
     @objc func imageSelectedImage(notify: Notification) {
         let imageData: UIImage? = notify.userInfo?["image"] as? UIImage
-        if imageData != nil {
+        if imageData != nil  {
             changPlayerIsPause(isPause: false)
             BFLog(message: "从系统相册选择了一个照片")
             publicEditCoverView.isHidden = true

+ 18 - 14
BFFramework/Classes/Stuckpoint/View/PQEditPublicCoverImageView.swift

@@ -71,21 +71,25 @@ class PQEditPublicCoverImageView: UIView {
         for i in 0 ... 8 {
             let coverImageBtn = UIButton(type: .custom)
             var frame: CGRect = .zero
-            frame.size.width = 108.0
-            frame.size.height = 108.0
+            frame.size.width = 108.0 * cAdaptatWidth
+            frame.size.height = 108.0 * cAdaptatWidth
+            
             // 按钮横向间隔10,左边距16
-            frame.origin.x = CGFloat((i % 3) * (108 + 10) + 16)
+            let spedScorp = 10.0 * cAdaptatWidth
+            let spedHeght = 16.0 * cAdaptatWidth
+            frame.origin.x = CGFloat((i % 3) * (Int(frame.size.width) + Int(spedScorp)) + Int(spedHeght))
             // 按钮竖向间隔10,左边距16
-            frame.origin.y = floor(CGFloat(i / 3)) * (frame.size.height + 10) + 16
+            frame.origin.y = floor(CGFloat(i / 3)) * (frame.size.height + spedScorp) + spedHeght
             coverImageBtn.frame = frame
             coverImageBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#F6F6F6")
             coverImageBtn.tag = (i + 1) * 100
             coverImageBtn.adjustsImageWhenHighlighted = false
+            coverImageBtn.imageView?.contentMode = .scaleAspectFit
             coverImageBtn.addTarget(self, action: #selector(coverImageBtnClick(sender:)), for: .touchUpInside)
-            coverImageBtn.contentMode = .scaleAspectFit
             //选中后的角标
-            let iconView = UIImageView.init(frame: CGRect(x: 108.0 - 22.0 - 6, y: 6, width: 22, height: 22))
+            let iconView = UIImageView.init(frame: CGRect(x: frame.size.width  - 22.0 - 6, y: 6, width: 22, height: 22))
             iconView.image = UIImage().BF_Image(named: "editCoverimageSelected")
+          
             iconView.tag = 1000
             if(i == 0){
                 iconView.isHidden = false
@@ -102,7 +106,7 @@ class PQEditPublicCoverImageView: UIView {
         backView.snp.makeConstraints { make in
             make.right.equalToSuperview()
             make.width.equalTo(cScreenWidth)
-            make.height.equalTo(459 + cAKSafeAreaHeight)
+            make.height.equalTo(459 * cAdaptatWidth + cAKSafeAreaHeight)
             make.bottom.equalToSuperview()
         }
 
@@ -114,16 +118,16 @@ class PQEditPublicCoverImageView: UIView {
         }
 
         selectPhotoBtn.snp.makeConstraints { make in
-            make.left.equalToSuperview().offset(16)
-            make.width.equalTo(164)
-            make.height.equalTo(54)
+            make.left.equalToSuperview().offset(16 * cAdaptatWidth)
+            make.width.equalTo(164 * cAdaptatWidth )
+            make.height.equalTo(54 * cAdaptatWidth)
             make.bottom.equalToSuperview().offset(-19 - cAKSafeAreaHeight)
         }
 
         compliteBtn.snp.makeConstraints { make in
-            make.left.equalTo(selectPhotoBtn.snp_right).offset(14)
-            make.width.equalTo(164)
-            make.height.equalTo(54)
+            make.left.equalTo(selectPhotoBtn.snp_right).offset(14.0 * cAdaptatWidth)
+            make.width.equalTo(164 * cAdaptatWidth)
+            make.height.equalTo(54 * cAdaptatWidth)
             make.top.equalTo(selectPhotoBtn.snp_top)
         }
     }
@@ -148,7 +152,7 @@ class PQEditPublicCoverImageView: UIView {
                     
                     let btn = self?.backView.viewWithTag((i + 1) * 100) as? UIButton
                     btn?.setImage(images?[i], for: .normal)
-                    btn?.imageView?.contentMode = .scaleAspectFill
+               
                 }
             }
 

+ 1 - 1
BFFramework/Classes/Stuckpoint/View/PQEditPublicTitleView.swift

@@ -263,7 +263,7 @@ class PQEditPublicTitleViewContentCell: UICollectionViewCell {
         let textSize =  sizeWithText(text: titleStr ?? "", font: UIFont.systemFont(ofSize: 17, weight: .regular), size: CGSize.init(width: 295, height: CGFloat.greatestFiniteMagnitude))
   
         titleLab.snp.remakeConstraints { make in
-            make.height.equalTo(textSize.height)
+            make.height.equalTo(textSize.height * cAdaptatWidth)
             make.right.equalToSuperview().offset(-64)
             make.left.equalToSuperview().offset(16)
             make.top.equalToSuperview().offset(14)