|  | @@ -85,7 +85,7 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |          return btn
 | 
	
		
			
				|  |  |      }()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    lazy var exportBtn: UIButton = {
 | 
	
		
			
				|  |  | +    lazy var saveToPhotoBtn: UIButton = {
 | 
	
		
			
				|  |  |          let btn = UIButton()
 | 
	
		
			
				|  |  |          btn.setTitle(" 保存到相册", for: .normal)
 | 
	
		
			
				|  |  |          btn.setTitleColor(.white, for: .normal)
 | 
	
	
		
			
				|  | @@ -99,7 +99,7 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |      lazy var bottomView: UIView = {
 | 
	
		
			
				|  |  |          let vv = UIView()
 | 
	
		
			
				|  |  |          vv.backgroundColor = .black
 | 
	
		
			
				|  |  | -        vv.isHidden = true
 | 
	
		
			
				|  |  | +//        vv.isHidden = true
 | 
	
		
			
				|  |  |          return vv
 | 
	
		
			
				|  |  |      }()
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -143,8 +143,13 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  UIApplication.shared.isIdleTimerDisabled = false
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                self?.isExporting = false
 | 
	
		
			
				|  |  | -                sself.bottomView.isHidden = false
 | 
	
		
			
				|  |  | +                sself.isExporting = false
 | 
	
		
			
				|  |  | +//                sself.bottomView.isHidden = false
 | 
	
		
			
				|  |  | +                sself.saveAllBtn.isEnabled = true
 | 
	
		
			
				|  |  | +                sself.saveOnlyBtn.isEnabled = true
 | 
	
		
			
				|  |  | +                sself.saveToPhotoBtn.isEnabled = true
 | 
	
		
			
				|  |  | +                sself.completeBtn.isEnabled = true
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  sself.progreddL.isHidden = false
 | 
	
		
			
				|  |  |                  sself.progressView.isHidden = true
 | 
	
		
			
				|  |  |                  sself.progressL.isHidden = true
 | 
	
	
		
			
				|  | @@ -189,7 +194,16 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      override func backBtnClick() {
 | 
	
		
			
				|  |  | -        if !(hasExportAll || hasExportOnly) {}
 | 
	
		
			
				|  |  | +        if isExporting {
 | 
	
		
			
				|  |  | +            whetherCancelExport {
 | 
	
		
			
				|  |  | +                self.export.cancelExport()
 | 
	
		
			
				|  |  | +                super.backBtnClick()
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            return
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if !(hasExportAll || hasExportOnly) {
 | 
	
		
			
				|  |  | +            
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          export.cancelExport()
 | 
	
		
			
				|  |  |          super.backBtnClick()
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -226,7 +240,7 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          bottomView.addSubview(saveAllBtn)
 | 
	
		
			
				|  |  |          bottomView.addSubview(saveOnlyBtn)
 | 
	
		
			
				|  |  | -        bottomView.addSubview(exportBtn)
 | 
	
		
			
				|  |  | +        bottomView.addSubview(saveToPhotoBtn)
 | 
	
		
			
				|  |  |          bottomView.addSubview(completeBtn)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          backV.snp.makeConstraints { make in
 | 
	
	
		
			
				|  | @@ -262,21 +276,21 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          completeBtn.snp.makeConstraints { make in
 | 
	
		
			
				|  |  | -            make.left.right.equalTo(exportBtn)
 | 
	
		
			
				|  |  | +            make.left.equalTo(16)
 | 
	
		
			
				|  |  | +            make.right.equalTo(-16)
 | 
	
		
			
				|  |  |              make.bottom.equalTo(-1 * cSafeAreaHeight - 3)
 | 
	
		
			
				|  |  |              make.height.equalTo(20)
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        exportBtn.snp.makeConstraints { make in
 | 
	
		
			
				|  |  | -            make.left.equalTo(saveAllBtn)
 | 
	
		
			
				|  |  | -            make.right.equalTo(saveOnlyBtn)
 | 
	
		
			
				|  |  | +        saveToPhotoBtn.snp.makeConstraints { make in
 | 
	
		
			
				|  |  | +            make.left.right.equalTo(completeBtn)
 | 
	
		
			
				|  |  |              make.height.equalTo(50)
 | 
	
		
			
				|  |  |              make.bottom.equalTo(completeBtn.snp.top).offset(-10)
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          saveAllBtn.snp.makeConstraints { make in
 | 
	
		
			
				|  |  | -            make.left.equalTo(16)
 | 
	
		
			
				|  |  | -            make.bottom.equalTo(exportBtn.snp.top).offset(-21)
 | 
	
		
			
				|  |  | +            make.left.equalTo(completeBtn)
 | 
	
		
			
				|  |  | +            make.bottom.equalTo(saveToPhotoBtn.snp.top).offset(-21)
 | 
	
		
			
				|  |  |              make.height.equalTo(70)
 | 
	
		
			
				|  |  |              make.top.equalTo(28)
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -284,7 +298,7 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |          saveOnlyBtn.snp.makeConstraints { make in
 | 
	
		
			
				|  |  |              make.left.equalTo(saveAllBtn.snp.right).offset(16)
 | 
	
		
			
				|  |  |              make.top.height.width.equalTo(saveAllBtn)
 | 
	
		
			
				|  |  | -            make.right.equalTo(-16)
 | 
	
		
			
				|  |  | +            make.right.equalTo(completeBtn)
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          DispatchQueue.main.asyncAfter(deadline: .now() + 0) { [weak self] in
 | 
	
	
		
			
				|  | @@ -300,7 +314,12 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |              return
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          isExporting = true
 | 
	
		
			
				|  |  | -        bottomView.isHidden = true
 | 
	
		
			
				|  |  | +//        bottomView.isHidden = true
 | 
	
		
			
				|  |  | +        saveAllBtn.isEnabled = false
 | 
	
		
			
				|  |  | +        saveOnlyBtn.isEnabled = false
 | 
	
		
			
				|  |  | +        saveToPhotoBtn.isEnabled = false
 | 
	
		
			
				|  |  | +        completeBtn.isEnabled = false
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          progressView.isHidden = false
 | 
	
		
			
				|  |  |          progressL.isHidden = false
 | 
	
		
			
				|  |  |          progreddL.isHidden = true
 | 
	
	
		
			
				|  | @@ -382,32 +401,34 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |              alertV.cancelBtn.setTitle("确认保存", for: .normal)
 | 
	
		
			
				|  |  |              alertV.remindData = remindData
 | 
	
		
			
				|  |  |              alertV.remindBlock = { [weak self] item, _ in
 | 
	
		
			
				|  |  | -                guard let ssefl = self else {
 | 
	
		
			
				|  |  | +                guard let sself = self else {
 | 
	
		
			
				|  |  |                      return
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  if item.tag == 1 { // 确定返回到上一层
 | 
	
		
			
				|  |  | -                    if ssefl.hasExportOnly{
 | 
	
		
			
				|  |  | +                    if sself.hasExportOnly{
 | 
	
		
			
				|  |  |                          PHPhotoLibrary.shared().performChanges {
 | 
	
		
			
				|  |  | -                            PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: ssefl.saveOnlyUlr)
 | 
	
		
			
				|  |  | +                            PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: sself.saveOnlyUlr)
 | 
	
		
			
				|  |  |                          } completionHandler: { isFinished, _ in
 | 
	
		
			
				|  |  |                              
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    if ssefl.hasExportAll{
 | 
	
		
			
				|  |  | +                    if sself.hasExportAll{
 | 
	
		
			
				|  |  |                          PHPhotoLibrary.shared().performChanges {
 | 
	
		
			
				|  |  | -                            PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: ssefl.saveAllUlr)
 | 
	
		
			
				|  |  | +                            PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: sself.saveAllUlr)
 | 
	
		
			
				|  |  |                          } completionHandler: { isFinished, _ in
 | 
	
		
			
				|  |  |                              
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                self?.navigationController?.popToRootViewController(animated: true)
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +                
 | 
	
		
			
				|  |  | +                sself.export.cancelExport()
 | 
	
		
			
				|  |  | +                sself.navigationController?.popToRootViewController(animated: true)
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              UIApplication.shared.keyWindow?.addSubview(alertV)
 | 
	
		
			
				|  |  | -            return
 | 
	
		
			
				|  |  | +        }else{
 | 
	
		
			
				|  |  | +            export.cancelExport()
 | 
	
		
			
				|  |  | +            navigationController?.popToRootViewController(animated: true)
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        navigationController?.popToRootViewController(animated: true)
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @objc func play() {
 | 
	
	
		
			
				|  | @@ -423,4 +444,25 @@ class INVideoExportController: BFBaseViewController {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    func whetherCancelExport(comfirm:(()->Void)?){
 | 
	
		
			
				|  |  | +        let remindData = BFBaseModel()
 | 
	
		
			
				|  |  | +        remindData.summary = "正在合成中,是否取消?"
 | 
	
		
			
				|  |  | +        let alertV = BFRemindView(frame: view.bounds)
 | 
	
		
			
				|  |  | +        alertV.isBanned = true
 | 
	
		
			
				|  |  | +        alertV.confirmBtn.setTitle("继续合成", for: .normal)
 | 
	
		
			
				|  |  | +        alertV.cancelBtn.setTitle("取消合成", for: .normal)
 | 
	
		
			
				|  |  | +        alertV.remindData = remindData
 | 
	
		
			
				|  |  | +        alertV.remindBlock = { [weak self] item, _ in
 | 
	
		
			
				|  |  | +            guard let sself = self else {
 | 
	
		
			
				|  |  | +                return
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if item.tag == 1 { // 确定返回到上一层
 | 
	
		
			
				|  |  | +                sself.export.cancelExport()
 | 
	
		
			
				|  |  | +                comfirm?()
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        UIApplication.shared.keyWindow?.addSubview(alertV)
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |