Browse Source

标题有效性判断

jsonwang 3 years ago
parent
commit
f2eb23cbc7

+ 13 - 5
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointPublicController.swift

@@ -303,10 +303,18 @@ class PQStuckPointPublicController: PQBaseViewController {
             if(title?.count != 0 && title != self?.titleLabel.text){
                 self?.changPlayerIsPause(isPause: false)
 
-                self?.setTitleText(text: title ?? "",textColor: .black)
-                //更新数据
-                self?.videoData?.title = title
-                self?.updateCoverImagegOrTitle()
+                //判断文字是否有效
+                var inputText = ""
+                inputText = title?.replacingOccurrences(of: "\n", with: "") ?? ""
+                inputText = inputText.replacingOccurrences(of: " ", with: "")
+                 
+                if(inputText.count > 0){
+                    self?.setTitleText(text: title ?? "",textColor: .black)
+                    //更新数据
+                    self?.videoData?.title = title
+                    self?.updateCoverImagegOrTitle()
+                }
+             
             }
          
         }
@@ -1123,7 +1131,7 @@ extension PQStuckPointPublicController {
                 if path != nil {
                     self?.isShared = true
                     
-                    PQSingletoWXApiUtil.shared.share(type: 1, scene: Int32(WXSceneTimeline.rawValue), title: self?.videoData?.title ?? "", description: "", imageUrl: self?.videoData?.shareImgPath, path: path, videoId: (self?.videoData?.uniqueId)!, pageSource: self?.videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
+                    PQSingletoWXApiUtil.shared.share(type: 1, scene: Int32(WXSceneTimeline.rawValue), title: self?.videoData?.title ?? "\(BFLoginUserInfo.shared.nickName)made a music video for you", description: "", imageUrl: self?.videoData?.shareImgPath, path: path, videoId: (self?.videoData?.uniqueId)!, pageSource: self?.videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
                     }
                 } else {
                     cShowHUB(superView: nil, msg: "网络不佳哦")

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

@@ -172,6 +172,7 @@ class PQEditPublicTitleView: UIView {
    
         if confirmBtnClock != nil {
             confirmBtnClock!(inputTV.text)
+            inputTV.text = ""
         }
         viewClick()
     }