Browse Source

1.修复 TZPhotoPreviewCell 内存泄漏
2. IOS端二级详情页取消选中返回上一级没有进行去取消

huangxiaodong 2 years ago
parent
commit
ed40e15c61

+ 3 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/PhotoPreviewViewController.h

@@ -22,6 +22,9 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, assign) NSInteger minimumNumberOfSelection;
 
 @property (nonatomic,copy) NSString *availableStorage;
+
+//更新选择状态
+@property (nonatomic,copy) void (^changeSelectIndex)(NSMutableArray *indexPathsForSelectedItems);
 @end
 
 NS_ASSUME_NONNULL_END

+ 17 - 9
创维盒子/双子星云手机/Class/Set/uploadFile/PhotoPreviewViewController.m

@@ -69,6 +69,14 @@
     [self.curCell pausePlayerAndShowNaviBar];
 }
 
+- (void)backBtnPressed{
+    [super backBtnPressed];
+    
+    if(_changeSelectIndex){
+        _changeSelectIndex(_indexPathsForSelectedItems);
+    }
+}
+
 #pragma mark 点击选中按钮
 - (void)didClickButtonFun:(UIButton*)but
 {
@@ -303,15 +311,15 @@
     }
     
     cell.model = model;
-    [cell setSingleTapGestureBlock:^{
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        //[strongSelf didTapPreviewCell];
-        
-        if([cell isKindOfClass:[TZVideoPreviewCell class]]){
-            weakSelf.curCell = cell;
-        }
-        
-    }];
+//    [cell setSingleTapGestureBlock:^{
+//        __strong typeof(weakSelf) strongSelf = weakSelf;
+//        //[strongSelf didTapPreviewCell];
+//        
+//        if([cell isKindOfClass:[TZVideoPreviewCell class]]){
+//            weakSelf.curCell = cell;
+//        }
+//        
+//    }];
 
     return cell;
 }

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/AJPhotoListCell.m

@@ -60,7 +60,7 @@
         self.selectButton = but;
     }
     
-    self.selectButton.selected = NO;
+    self.selectButton.selected = isSelected;
    
 }
 

+ 12 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/uploadImageOrVideoViewController.m

@@ -388,6 +388,18 @@
     vc.minimumNumberOfSelection = _minimumNumberOfSelection;
     vc.availableStorage = self.uploadFileBottomV.availableStorage;
     [self.navigationController pushViewController:vc animated:YES];
+    
+    KWeakSelf
+    vc.changeSelectIndex = ^(NSMutableArray * _Nonnull indexPathsForSelectedItems) {
+        [weakSelf refreshDataAndUIFunWith:indexPathsForSelectedItems];
+    };
+}
+
+#pragma mark 从详情页回来 刷新数据和UI
+- (void)refreshDataAndUIFunWith:(NSMutableArray *)indexPathsForSelectedItems
+{
+    self.indexPathsForSelectedItems = indexPathsForSelectedItems;
+    [self.photoListView reloadData];
 }
 
 #pragma mark 处理点击选中相关