Commit 8cd606d22f9d252261d7c77c34fadc0f2f457440
1 parent
00430ebc
no message
Showing
3 changed files
with
16 additions
and
1 deletions
CNLiveMineModule/Classes/Controller/CNLiveMineController.m
| @@ -122,7 +122,9 @@ static const CGFloat timeValue = 1.5; | @@ -122,7 +122,9 @@ static const CGFloat timeValue = 1.5; | ||
| 122 | } | 122 | } |
| 123 | ]; | 123 | ]; |
| 124 | for(NSDictionary *dic in data){ | 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 | [self.tableView reloadData]; | 129 | [self.tableView reloadData]; |
| 128 | 130 |
CNLiveMineModule/Classes/Model/CNLiveMineModel.h
| @@ -36,6 +36,8 @@ typedef NS_ENUM(NSInteger, CNLiveMineCellType) { | @@ -36,6 +36,8 @@ typedef NS_ENUM(NSInteger, CNLiveMineCellType) { | ||
| 36 | @property (nonatomic, assign) CGFloat height; | 36 | @property (nonatomic, assign) CGFloat height; |
| 37 | @property (nonatomic, assign) CGFloat margin; | 37 | @property (nonatomic, assign) CGFloat margin; |
| 38 | 38 | ||
| 39 | +- (void)editModel:(BOOL)showMapTool; | ||
| 40 | + | ||
| 39 | @end | 41 | @end |
| 40 | 42 | ||
| 41 | NS_ASSUME_NONNULL_END | 43 | NS_ASSUME_NONNULL_END |
CNLiveMineModule/Classes/Model/CNLiveMineModel.m
| @@ -15,6 +15,17 @@ static const NSInteger margin = 10; | @@ -15,6 +15,17 @@ static const NSInteger margin = 10; | ||
| 15 | @"buttons" : @"CNLiveMineButtonModel" | 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 | - (CNLiveMineCellType)type{ | 29 | - (CNLiveMineCellType)type{ |
| 19 | if([self.style isEqualToString:@"1"]){ | 30 | if([self.style isEqualToString:@"1"]){ |
| 20 | return CNLiveMineCellTypeOrder; | 31 | return CNLiveMineCellTypeOrder; |