Commit 08576e66 authored by CZ1004's avatar CZ1004

【优化】1、相似项数据错乱2、压缩过程返回

parent aab07368
...@@ -45,6 +45,8 @@ class CompressingViewController: BaseViewController { ...@@ -45,6 +45,8 @@ class CompressingViewController: BaseViewController {
return view return view
}() }()
let alert = EmailContentDelAlert(state: .endCompress)
lazy var animationView : LottieAnimationView = { lazy var animationView : LottieAnimationView = {
let animationView = LottieAnimationView(name: "iOS压缩完成") let animationView = LottieAnimationView(name: "iOS压缩完成")
animationView.layer.cornerRadius = 12 animationView.layer.cornerRadius = 12
...@@ -93,7 +95,19 @@ class CompressingViewController: BaseViewController { ...@@ -93,7 +95,19 @@ class CompressingViewController: BaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.view.backgroundColor = UIColor(red: 0.95, green: 0.96, blue: 0.99, alpha: 1) self.view.backgroundColor = UIColor(red: 0.95, green: 0.96, blue: 0.99, alpha: 1)
self.titleView.isHidden = true self.titleView.callBack = { text in
// 弹框
self.view.showBlur()
self.alert.endCompressCallback = { idx in
self.view.hideBlur()
self.navigationController?.popViewController(animated: true)
}
self.alert.callblock = {idx in
self.view.hideBlur()
}
self.alert.show()
}
setUI() setUI()
...@@ -182,6 +196,8 @@ class CompressingViewController: BaseViewController { ...@@ -182,6 +196,8 @@ class CompressingViewController: BaseViewController {
/// - comVideoDataSource: 压缩后的视频链接数组 /// - comVideoDataSource: 压缩后的视频链接数组
fileprivate func updateNextView(_ compressAllSize: Double,_ comDataSource : [Data],_ comVideoDataSource : [URL]) { fileprivate func updateNextView(_ compressAllSize: Double,_ comDataSource : [Data],_ comVideoDataSource : [URL]) {
DispatchQueue.main.async { DispatchQueue.main.async {
self.view.hideBlur()
self.alert.dismiss(animated: true) {
let vc = CompressCompletedViewController() let vc = CompressCompletedViewController()
vc.currentMediaType = self.currentMediaType vc.currentMediaType = self.currentMediaType
vc.comDataSource = comDataSource vc.comDataSource = comDataSource
...@@ -191,6 +207,7 @@ class CompressingViewController: BaseViewController { ...@@ -191,6 +207,7 @@ class CompressingViewController: BaseViewController {
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
} }
}
// MARK: 设置UI // MARK: 设置UI
......
...@@ -401,7 +401,7 @@ class HomeInfoViewController:BaseViewController { ...@@ -401,7 +401,7 @@ class HomeInfoViewController:BaseViewController {
titleLabel.centerY = navCenterY titleLabel.centerY = navCenterY
titleView.addSubview(titleLabel) titleView.addSubview(titleLabel)
view.addSubview(tablewView) view.addSubview(self.tablewView)
view.addSubview(self.defaultImageView) view.addSubview(self.defaultImageView)
self.defaultImageView.snp.makeConstraints { make in self.defaultImageView.snp.makeConstraints { make in
make.width.height.equalTo(180) make.width.height.equalTo(180)
...@@ -448,7 +448,7 @@ class HomeInfoViewController:BaseViewController { ...@@ -448,7 +448,7 @@ class HomeInfoViewController:BaseViewController {
// self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115 // self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115
// seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width // seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
tablewView.changeALlValue(isSeleted: seletedAllBtn.isSelected) self.tablewView.changeALlValue(isSeleted: seletedAllBtn.isSelected)
} }
@objc func seletedAllBtnClick() { @objc func seletedAllBtnClick() {
......
...@@ -89,7 +89,7 @@ class HomeInfoView :UIView { ...@@ -89,7 +89,7 @@ class HomeInfoView :UIView {
self.ids = ids self.ids = ids
self.titleText = titleText self.titleText = titleText
self.type = type self.type = type
super.init(frame: frame)
for array in ids ?? [] { for array in ids ?? [] {
var smodels:[ImageSeletedCollectionItem] = [] var smodels:[ImageSeletedCollectionItem] = []
...@@ -111,8 +111,7 @@ class HomeInfoView :UIView { ...@@ -111,8 +111,7 @@ class HomeInfoView :UIView {
models.append(smodel) models.append(smodel)
} }
self.ids = sortData(source: ids ?? [], type: .latest)
super.init(frame: frame)
setupUI() setupUI()
...@@ -150,7 +149,6 @@ class HomeInfoView :UIView { ...@@ -150,7 +149,6 @@ class HomeInfoView :UIView {
self.tableView.reloadSections(IndexSet(integer: 0), with: .automatic) self.tableView.reloadSections(IndexSet(integer: 0), with: .automatic)
} }
} }
self.headerView.sortViewSubmitCallBack(ResourceFilterBoxModel(sortType: .latest))
} }
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
......
...@@ -15,9 +15,14 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg ...@@ -15,9 +15,14 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg
case list case list
case emailSignOut case emailSignOut
case emailApply case emailApply
case endCompress
} }
var callblock:((Int)->Void) = { idx in} var callblock:((Int)->Void) = { idx in}
var endCompressCallback:((Int)->Void) = {idx in}
var state:EmailStateAlert = .group var state:EmailStateAlert = .group
@IBOutlet weak var EmailContentMessage: UILabel! @IBOutlet weak var EmailContentMessage: UILabel!
...@@ -52,7 +57,14 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg ...@@ -52,7 +57,14 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg
EmailContentAction1.setTitle("Yes", for: .normal) EmailContentAction1.setTitle("Yes", for: .normal)
EmailContentAction2.setTitle("Cancel", for: .normal) EmailContentAction2.setTitle("Cancel", for: .normal)
break break
case .endCompress:
EmailContentMessage.text = "Would you like to stop compressing?"
EmailContentAction1.setTitle("Keep Compressing", for: .normal)
EmailContentAction2.setTitle("Stop Compressing", for: .normal)
tipsLabel.text = "If you stop now you won't get the results"
break
} }
} }
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
...@@ -76,7 +88,9 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg ...@@ -76,7 +88,9 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg
@IBAction func delMails(_ sender: Any) { @IBAction func delMails(_ sender: Any) {
callblock(2) callblock(2)
self.dismiss(animated: true) self.dismiss(animated: true) {
self.endCompressCallback(2)
}
} }
init(state:EmailStateAlert) { init(state:EmailStateAlert) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment