Commit 08576e66 authored by CZ1004's avatar CZ1004

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

parent aab07368
......@@ -45,6 +45,8 @@ class CompressingViewController: BaseViewController {
return view
}()
let alert = EmailContentDelAlert(state: .endCompress)
lazy var animationView : LottieAnimationView = {
let animationView = LottieAnimationView(name: "iOS压缩完成")
animationView.layer.cornerRadius = 12
......@@ -93,7 +95,19 @@ class CompressingViewController: BaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
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()
......@@ -182,13 +196,16 @@ class CompressingViewController: BaseViewController {
/// - comVideoDataSource: 压缩后的视频链接数组
fileprivate func updateNextView(_ compressAllSize: Double,_ comDataSource : [Data],_ comVideoDataSource : [URL]) {
DispatchQueue.main.async {
let vc = CompressCompletedViewController()
vc.currentMediaType = self.currentMediaType
vc.comDataSource = comDataSource
vc.comVideoDataSource = comVideoDataSource
vc.model = self.model
vc.completedSize = compressAllSize
self.navigationController?.pushViewController(vc, animated: true)
self.view.hideBlur()
self.alert.dismiss(animated: true) {
let vc = CompressCompletedViewController()
vc.currentMediaType = self.currentMediaType
vc.comDataSource = comDataSource
vc.comVideoDataSource = comVideoDataSource
vc.model = self.model
vc.completedSize = compressAllSize
self.navigationController?.pushViewController(vc, animated: true)
}
}
}
......
......@@ -401,7 +401,7 @@ class HomeInfoViewController:BaseViewController {
titleLabel.centerY = navCenterY
titleView.addSubview(titleLabel)
view.addSubview(tablewView)
view.addSubview(self.tablewView)
view.addSubview(self.defaultImageView)
self.defaultImageView.snp.makeConstraints { make in
make.width.height.equalTo(180)
......@@ -448,7 +448,7 @@ class HomeInfoViewController:BaseViewController {
// self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115
// seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
tablewView.changeALlValue(isSeleted: seletedAllBtn.isSelected)
self.tablewView.changeALlValue(isSeleted: seletedAllBtn.isSelected)
}
@objc func seletedAllBtnClick() {
......
......@@ -89,7 +89,7 @@ class HomeInfoView :UIView {
self.ids = ids
self.titleText = titleText
self.type = type
super.init(frame: frame)
for array in ids ?? [] {
var smodels:[ImageSeletedCollectionItem] = []
......@@ -111,8 +111,7 @@ class HomeInfoView :UIView {
models.append(smodel)
}
super.init(frame: frame)
self.ids = sortData(source: ids ?? [], type: .latest)
setupUI()
......@@ -150,7 +149,6 @@ class HomeInfoView :UIView {
self.tableView.reloadSections(IndexSet(integer: 0), with: .automatic)
}
}
self.headerView.sortViewSubmitCallBack(ResourceFilterBoxModel(sortType: .latest))
}
required init?(coder: NSCoder) {
......
......@@ -15,9 +15,14 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg
case list
case emailSignOut
case emailApply
case endCompress
}
var callblock:((Int)->Void) = { idx in}
var endCompressCallback:((Int)->Void) = {idx in}
var state:EmailStateAlert = .group
@IBOutlet weak var EmailContentMessage: UILabel!
......@@ -52,7 +57,14 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg
EmailContentAction1.setTitle("Yes", for: .normal)
EmailContentAction2.setTitle("Cancel", for: .normal)
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? {
......@@ -76,7 +88,9 @@ class EmailContentDelAlert: UIViewController, UIViewControllerTransitioningDeleg
@IBAction func delMails(_ sender: Any) {
callblock(2)
self.dismiss(animated: true)
self.dismiss(animated: true) {
self.endCompressCallback(2)
}
}
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