Browse Source

Merge branch 'master' of https://git.yishihui.com/iOS/Introduce
合并代码

jsonwang 3 years ago
parent
commit
5e0fa0bb47

+ 1 - 0
Introduce/Record/INIntroduceController.swift

@@ -37,6 +37,7 @@ class INIntroduceController: BFBaseViewController {
     override func viewWillDisappear(_ animated: Bool) {
         super.viewWillDisappear(animated)
         PQNotification.removeObserver(self)
+        cHiddenHUB(superView: nil)
     }
 
     @objc internal func keyboardWillHide(_: Notification?) {

+ 2 - 2
Introduce/Record/INRecorderController.swift

@@ -77,9 +77,9 @@ class INRecorderController: BFBaseViewController {
         protocolLab.font = UIFont.systemFont(ofSize: 14)
         protocolLab.text = "在您使用视说服务前,请认真阅读"
         protocolLab.textColor = UIColor(red: 0.262, green: 0.262, blue: 0.262, alpha: 1)
-        protocolLab.appendLink(withText: "《视说用户协议》、 ", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor.hexColor(hexadecimal: "#90a9d2"),  underLineStyle:CTUnderlineStyle(), linkData: cUserProtocol)
+        protocolLab.appendLink(withText: "《视说用户协议》、", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor.hexColor(hexadecimal: "#90a9d2"),  underLineStyle:CTUnderlineStyle(), linkData: cUserProtocol)
         
-        protocolLab.appendLink(withText: "  《用户隐私政策》", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor.hexColor(hexadecimal: "#90a9d2"), underLineStyle:CTUnderlineStyle(), linkData: cPrivacy)
+        protocolLab.appendLink(withText: "《用户隐私政策》", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor.hexColor(hexadecimal: "#90a9d2"), underLineStyle:CTUnderlineStyle(), linkData: cPrivacy)
         
         protocolLab.appendLink(withText: ",以了解用户权利义务和个人信息处理规则。\n\n", linkFont: UIFont.systemFont(ofSize: 14), linkColor: UIColor.hexColor(hexadecimal: "#434343"), underLineStyle: CTUnderlineStyle(), linkData: nil)
         

+ 44 - 17
Introduce/Record/INVideoExportController.swift

@@ -83,6 +83,7 @@ class INVideoExportController: BFBaseViewController {
         btn.setTitleColor(UIColor.hexColor(hexadecimal: "#6B6B6B"), for: .normal)
         btn.setTitleColor(.gray, for: .disabled)
         btn.addTarget(self, action: #selector(completeAction), for: .touchUpInside)
+        btn.isHidden = true
         return btn
     }()
 
@@ -206,23 +207,13 @@ class INVideoExportController: BFBaseViewController {
                 }
                 UIApplication.shared.isIdleTimerDisabled = false
 
-                sself.isExporting = false
-//                sself.bottomView.isHidden = false
-                
-                sself.saveAllBtn.setImage(UIImage(named: "export_saveall_n"), for: .normal)
-                sself.saveOnlyBtn.setImage(UIImage(named: "export_saveonly_n"), for: .normal)
-                
-                sself.saveAllBtn.isEnabled = true
-                sself.saveOnlyBtn.isEnabled = true
-                sself.saveToPhotoBtn.isEnabled = true
-                sself.completeBtn.isEnabled = true
-
-                sself.sliderView?.isHidden = false
-                sself.sliderView?.playStart()
-                sself.progressView.isHidden = true
-                sself.progressL.isHidden = true
+                sself.resetViewStatus()
 
                 if let fileUrl = url {
+                    sself.sliderView?.isHidden = false
+                    sself.sliderView?.playStart()
+                    sself.completeBtn.isHidden = false
+
                     let item = AVPlayerItem(url: fileUrl)
                     sself.avplayer.replaceCurrentItem(with: item)
                     usleep(1000)
@@ -486,6 +477,20 @@ class INVideoExportController: BFBaseViewController {
         }
     }
 
+    func resetViewStatus() {
+
+        self.isExporting = false
+//                sself.bottomView.isHidden = false
+        
+        self.saveAllBtn.setImage(UIImage(named: "export_saveall_n"), for: .normal)
+        self.saveOnlyBtn.setImage(UIImage(named: "export_saveonly_n"), for: .normal)
+        
+        self.saveToPhotoBtn.isEnabled = true
+        self.completeBtn.isEnabled = true
+
+        self.progressView.isHidden = true
+        self.progressL.isHidden = true
+    }
     // MARK: - 按钮事件
     @objc func retryAction(){
         errorView.isHidden = true
@@ -512,8 +517,6 @@ class INVideoExportController: BFBaseViewController {
             saveOnlyBtn.setImage(UIImage(named: "export_saveonly_h"), for: .normal)
         }
         
-        saveAllBtn.isEnabled = false
-        saveOnlyBtn.isEnabled = false
         saveToPhotoBtn.isEnabled = false
         completeBtn.isEnabled = false
         
@@ -553,14 +556,29 @@ class INVideoExportController: BFBaseViewController {
         // 点击保存至相册上报
         BFEventTrackAdaptor.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_saveToAblum, pageSource: .sp_composePage, extParams: saveAllBtn.isSelected ? ["saveAll": true] : ["saveRecord": true], commonParams: commonParams())
     }
+    
+    func combineVideo(isAll:Bool){
+        
+    }
 
     @objc func saveAllAction(btn: UIButton) {
         if btn.isSelected {
             return
         }
+        
+        if isExporting {
+            whetherCancelExport {[weak self] in
+                self?.export.cancelExport()
+                self?.resetViewStatus()
+                self?.saveAllAction(btn: btn)
+            }
+            return
+        }
+        
         btn.isSelected = true
         saveOnlyBtn.isSelected = false
         avplayer.pause()
+        
         if !hasExportAll {
             exportNow()
         } else {
@@ -579,6 +597,15 @@ class INVideoExportController: BFBaseViewController {
         if btn.isSelected {
             return
         }
+        if isExporting {
+            whetherCancelExport {[weak self ] in
+                self?.export.cancelExport()
+                self?.resetViewStatus()
+                self?.saveOnlyAction(btn: btn)
+            }
+            return
+        }
+        
         btn.isSelected = true
         saveAllBtn.isSelected = false
         avplayer.pause()