Commit 8cd606d22f9d252261d7c77c34fadc0f2f457440

Authored by zhangxiaowen
1 parent 00430ebc

no message

CNLiveMineModule/Classes/Controller/CNLiveMineController.m
... ... @@ -122,7 +122,9 @@ static const CGFloat timeValue = 1.5;
122 122 }
123 123 ];
124 124 for(NSDictionary *dic in data){
125   - [self.data addObject:[CNLiveMineModel mj_objectWithKeyValues:dic]];
  125 + CNLiveMineModel *model = [CNLiveMineModel mj_objectWithKeyValues:dic];
  126 + [model editModel:NO];
  127 + [self.data addObject:model];
126 128 }
127 129 [self.tableView reloadData];
128 130  
... ...
CNLiveMineModule/Classes/Model/CNLiveMineModel.h
... ... @@ -36,6 +36,8 @@ typedef NS_ENUM(NSInteger, CNLiveMineCellType) {
36 36 @property (nonatomic, assign) CGFloat height;
37 37 @property (nonatomic, assign) CGFloat margin;
38 38  
  39 +- (void)editModel:(BOOL)showMapTool;
  40 +
39 41 @end
40 42  
41 43 NS_ASSUME_NONNULL_END
... ...
CNLiveMineModule/Classes/Model/CNLiveMineModel.m
... ... @@ -15,6 +15,17 @@ static const NSInteger margin = 10;
15 15 @"buttons" : @"CNLiveMineButtonModel"
16 16 };
17 17 }
  18 +
  19 +- (void)editModel:(BOOL)showMapTool{
  20 + if ([self.style isEqualToString:@"2"]) {
  21 + NSMutableArray *array = [NSMutableArray arrayWithArray:self.buttons];
  22 + if (!showMapTool) {
  23 + [array removeLastObject];
  24 + self.buttons = [NSArray arrayWithArray:array];
  25 + }
  26 + }
  27 +}
  28 +
18 29 - (CNLiveMineCellType)type{
19 30 if([self.style isEqualToString:@"1"]){
20 31 return CNLiveMineCellTypeOrder;
... ...