|
@@ -74,7 +74,8 @@ class TSGenerateHistoryVC: TSBaseVC {
|
|
override func dealThings() {
|
|
override func dealThings() {
|
|
updateListView()
|
|
updateListView()
|
|
|
|
|
|
- NotificationCenter.default.addObserver(forName: .kGenerateRintoneOperationChanged, object: nil, queue: nil) { notification in
|
|
|
|
|
|
+ NotificationCenter.default.addObserver(forName: .kGenerateRintoneOperationChanged, object: nil, queue: nil) {[weak self] notification in
|
|
|
|
+ guard let self = self else { return }
|
|
if let userInfo = notification.userInfo as? [String: Any],let state = userInfo["state"] as? TSProgressState {
|
|
if let userInfo = notification.userInfo as? [String: Any],let state = userInfo["state"] as? TSProgressState {
|
|
switch state {
|
|
switch state {
|
|
case .start, .success(_),.failed(_),.none:
|
|
case .start, .success(_),.failed(_),.none:
|
|
@@ -90,10 +91,11 @@ class TSGenerateHistoryVC: TSBaseVC {
|
|
collectionView.reloadData()
|
|
collectionView.reloadData()
|
|
}
|
|
}
|
|
|
|
|
|
- override func navBarClickLeftAction() {
|
|
|
|
- super.navBarClickLeftAction()
|
|
|
|
- self.reloadUIBlock?()
|
|
|
|
- }
|
|
|
|
|
|
+// override func navBarClickLeftAction() {
|
|
|
|
+// super.navBarClickLeftAction()
|
|
|
|
+// self.reloadUIBlock?()
|
|
|
|
+// }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
extension TSGenerateHistoryVC: UICollectionViewDataSource ,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout {
|
|
extension TSGenerateHistoryVC: UICollectionViewDataSource ,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout {
|
|
@@ -117,9 +119,10 @@ extension TSGenerateHistoryVC: UICollectionViewDataSource ,UICollectionViewDeleg
|
|
let itemModel = sectionModel.list.safeObj(At: indexPath.item),
|
|
let itemModel = sectionModel.list.safeObj(At: indexPath.item),
|
|
let cell = cell as? TSAIRintoneHistoryCell
|
|
let cell = cell as? TSAIRintoneHistoryCell
|
|
{
|
|
{
|
|
- cell.delegate = self
|
|
|
|
|
|
+ weak var weakSelf = self
|
|
|
|
+ cell.delegate = weakSelf
|
|
cell.setRingBtn.indexPath = indexPath
|
|
cell.setRingBtn.indexPath = indexPath
|
|
- cell.setRingBtn.addTarget(self, action: #selector(clickSetRingBtn(_ :)), for: .touchUpInside)
|
|
|
|
|
|
+ cell.setRingBtn.addTarget(weakSelf, action: #selector(clickSetRingBtn(_ :)), for: .touchUpInside)
|
|
if let model = itemModel as? TSActionInfoModel {
|
|
if let model = itemModel as? TSActionInfoModel {
|
|
cell.model = model
|
|
cell.model = model
|
|
}else if let ringModel = itemModel as? TSRingModel {
|
|
}else if let ringModel = itemModel as? TSRingModel {
|
|
@@ -177,7 +180,8 @@ extension TSGenerateHistoryVC: SwipeCollectionViewCellDelegate {
|
|
// 删除操作
|
|
// 删除操作
|
|
let deleteAction = SwipeAction(style: .destructive, title: nil) {[weak self] action, indexPath in
|
|
let deleteAction = SwipeAction(style: .destructive, title: nil) {[weak self] action, indexPath in
|
|
guard let self = self else { return }
|
|
guard let self = self else { return }
|
|
- showCustomAlert(message: "Are you sure to delete".localized, deleteHandler: {
|
|
|
|
|
|
+ showCustomAlert(message: "Are you sure to delete".localized, deleteHandler: { [weak self] in
|
|
|
|
+ guard let self = self else { return }
|
|
if let sectionModel = self.viewModel.modelList.safeObj(At: indexPath.section),
|
|
if let sectionModel = self.viewModel.modelList.safeObj(At: indexPath.section),
|
|
let model = sectionModel.list.safeObj(At: indexPath.item){
|
|
let model = sectionModel.list.safeObj(At: indexPath.item){
|
|
if let model = model as? TSActionInfoModel {
|
|
if let model = model as? TSActionInfoModel {
|