Commit fc027c63f7e0ae2a0fae0eaef1f5df667dd299c0
1 parent
9376a509
根据UI做页面调整,根据需求做弹窗调整
Showing
7 changed files
with
44 additions
and
27 deletions
CNLiveCServiceModule/Classes/Present/CNLiveServicePresent.m
| @@ -135,7 +135,7 @@ static const CGFloat margin = 15; | @@ -135,7 +135,7 @@ static const CGFloat margin = 15; | ||
| 135 | showNum = 8; | 135 | showNum = 8; |
| 136 | itemSize = CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70); | 136 | itemSize = CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70); |
| 137 | }else{ | 137 | }else{ |
| 138 | - cellheight = 105; | 138 | + cellheight = 125; |
| 139 | showNum = 4; | 139 | showNum = 4; |
| 140 | itemSize = CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70); | 140 | itemSize = CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70); |
| 141 | subTitle = dic[@"category"][@"subTitle"]; | 141 | subTitle = dic[@"category"][@"subTitle"]; |
| @@ -275,13 +275,16 @@ static const CGFloat margin = 15; | @@ -275,13 +275,16 @@ static const CGFloat margin = 15; | ||
| 275 | [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/servingList") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | 275 | [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/servingList") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { |
| 276 | NSDictionary * dic = responseObject[@"data"]; | 276 | NSDictionary * dic = responseObject[@"data"]; |
| 277 | NSMutableArray *array = [NSMutableArray array]; | 277 | NSMutableArray *array = [NSMutableArray array]; |
| 278 | - if (dic[@"list"]&&[dic[@"list"] isKindOfClass:[NSArray class]]) { | ||
| 279 | - NSArray *list = dic[@"list"]; | ||
| 280 | - for (NSDictionary *dict in list) { | ||
| 281 | - CNLiveSearchModel *searchModel = [CNLiveSearchModel mj_objectWithKeyValues:dict]; | ||
| 282 | - [array addObject:searchModel]; | 278 | + if (dic) { |
| 279 | + if (dic[@"list"]&&[dic[@"list"] isKindOfClass:[NSArray class]]) { | ||
| 280 | + NSArray *list = dic[@"list"]; | ||
| 281 | + for (NSDictionary *dict in list) { | ||
| 282 | + CNLiveSearchModel *searchModel = [CNLiveSearchModel mj_objectWithKeyValues:dict]; | ||
| 283 | + [array addObject:searchModel]; | ||
| 284 | + } | ||
| 283 | } | 285 | } |
| 284 | } | 286 | } |
| 287 | + | ||
| 285 | if (dic) { | 288 | if (dic) { |
| 286 | NSString *lastPage = dic[@"hasNextPage"]; | 289 | NSString *lastPage = dic[@"hasNextPage"]; |
| 287 | !succeed?:succeed(array.copy,!lastPage.boolValue); | 290 | !succeed?:succeed(array.copy,!lastPage.boolValue); |
| @@ -336,23 +339,26 @@ static const CGFloat margin = 15; | @@ -336,23 +339,26 @@ static const CGFloat margin = 15; | ||
| 336 | [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/allCategory") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | 339 | [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/allCategory") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { |
| 337 | NSDictionary * dic = responseObject[@"data"]; | 340 | NSDictionary * dic = responseObject[@"data"]; |
| 338 | NSMutableArray *array = [NSMutableArray array]; | 341 | NSMutableArray *array = [NSMutableArray array]; |
| 339 | - if (dic[@"list"]&&[dic[@"list"] isKindOfClass:[NSArray class]]) { | ||
| 340 | - NSArray *list = dic[@"list"]; | ||
| 341 | - | ||
| 342 | - for (NSDictionary *dict in list) { | ||
| 343 | - NSDictionary *dictionary = @{ | ||
| 344 | - @"title":dict[@"title"], | ||
| 345 | - @"lists":dict[@"list"], | ||
| 346 | - @"layout":@{ | ||
| 347 | - @"width":@((SCREEN_WIDTH-4*margin-3*margin)/4.0), | ||
| 348 | - @"height":@(70) | ||
| 349 | - } | ||
| 350 | - }; | ||
| 351 | - CNLiveSearchHotsModel *searchModel = [CNLiveSearchHotsModel mj_objectWithKeyValues:dictionary]; | ||
| 352 | - [array addObject:searchModel]; | 342 | + if (dic) { |
| 343 | + if (dic[@"list"]&&[dic[@"list"] isKindOfClass:[NSArray class]]) { | ||
| 344 | + NSArray *list = dic[@"list"]; | ||
| 345 | + | ||
| 346 | + for (NSDictionary *dict in list) { | ||
| 347 | + NSDictionary *dictionary = @{ | ||
| 348 | + @"title":dict[@"title"], | ||
| 349 | + @"lists":dict[@"list"], | ||
| 350 | + @"layout":@{ | ||
| 351 | + @"width":@((SCREEN_WIDTH-4*margin-3*margin)/4.0), | ||
| 352 | + @"height":@(70) | ||
| 353 | + } | ||
| 354 | + }; | ||
| 355 | + CNLiveSearchHotsModel *searchModel = [CNLiveSearchHotsModel mj_objectWithKeyValues:dictionary]; | ||
| 356 | + [array addObject:searchModel]; | ||
| 357 | + } | ||
| 353 | } | 358 | } |
| 354 | } | 359 | } |
| 355 | 360 | ||
| 361 | + | ||
| 356 | if (dic) { | 362 | if (dic) { |
| 357 | NSString *lastPage = dic[@"hasNextPage"]; | 363 | NSString *lastPage = dic[@"hasNextPage"]; |
| 358 | !succeed?:succeed(array.copy,!lastPage.boolValue); | 364 | !succeed?:succeed(array.copy,!lastPage.boolValue); |
CNLiveCServiceModule/Classes/View/CNLiveAlertTipView.m
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | }]; | 50 | }]; |
| 51 | [tipView.notShowBtn mas_makeConstraints:^(MASConstraintMaker *make) { | 51 | [tipView.notShowBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
| 52 | make.bottom.equalTo(tipView.cancelBtn.mas_top).offset(-10); | 52 | make.bottom.equalTo(tipView.cancelBtn.mas_top).offset(-10); |
| 53 | - make.width.offset(105); | 53 | + make.width.offset(125); |
| 54 | make.height.offset(20); | 54 | make.height.offset(20); |
| 55 | make.left.equalTo(tipView).offset(15); | 55 | make.left.equalTo(tipView).offset(15); |
| 56 | }]; | 56 | }]; |
| @@ -125,7 +125,7 @@ | @@ -125,7 +125,7 @@ | ||
| 125 | _sureBtn.layer.cornerRadius = 21; | 125 | _sureBtn.layer.cornerRadius = 21; |
| 126 | _sureBtn.titleLabel.font = UIFontMake(16); | 126 | _sureBtn.titleLabel.font = UIFontMake(16); |
| 127 | [_sureBtn setBackgroundImage:[UIImage gradientVerticalImageWithColors:@[CNLiveColorWithHexString(@"#FFAA4A"),CNLiveColorWithHexString(@"#EC5645")] rect:CGRectMake(0, 0, 120, 39)] forState:UIControlStateNormal]; | 127 | [_sureBtn setBackgroundImage:[UIImage gradientVerticalImageWithColors:@[CNLiveColorWithHexString(@"#FFAA4A"),CNLiveColorWithHexString(@"#EC5645")] rect:CGRectMake(0, 0, 120, 39)] forState:UIControlStateNormal]; |
| 128 | - [_sureBtn setBackgroundImage:[UIImage imageWithColor:CNLiveColorWithHexString(@"#EEEEEE")] forState:UIControlStateDisabled]; | 128 | + _sureBtn.clipsToBounds = YES; |
| 129 | _sureBtn.enabled = NO; | 129 | _sureBtn.enabled = NO; |
| 130 | } | 130 | } |
| 131 | return _sureBtn; | 131 | return _sureBtn; |
CNLiveCServiceModule/Classes/View/CNLiveChineServiceCell.m
| @@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
| 28 | -(void)makeSubViewsLayout | 28 | -(void)makeSubViewsLayout |
| 29 | { | 29 | { |
| 30 | [self.logoView mas_makeConstraints:^(MASConstraintMaker *make) { | 30 | [self.logoView mas_makeConstraints:^(MASConstraintMaker *make) { |
| 31 | - make.left.equalTo(self.contentView).offset(15); | 31 | + make.left.equalTo(self.contentView).offset(10*kScreenWidth/375); |
| 32 | make.centerY.equalTo(self.contentView); | 32 | make.centerY.equalTo(self.contentView); |
| 33 | make.height.width.offset(45); | 33 | make.height.width.offset(45); |
| 34 | }]; | 34 | }]; |
CNLiveCServiceModule/Classes/View/CNLiveCycleCell.m
| @@ -110,7 +110,7 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell"; | @@ -110,7 +110,7 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell"; | ||
| 110 | if ([_model.title isEqual:@"中国服务号"]) { | 110 | if ([_model.title isEqual:@"中国服务号"]) { |
| 111 | return UIEdgeInsetsMake(10, 5, 10, 5); | 111 | return UIEdgeInsetsMake(10, 5, 10, 5); |
| 112 | } | 112 | } |
| 113 | - if ([_model.title isEqual:@""] || ![_model.subTitle isEqualToString:@""]) { | 113 | + if ([_model.title isEqual:@""] && [_model.subTitle isEqualToString:@""]) { |
| 114 | return UIEdgeInsetsMake(5, 0, 5, 0); | 114 | return UIEdgeInsetsMake(5, 0, 5, 0); |
| 115 | } | 115 | } |
| 116 | if ([_model.title isEqual:@"大家都在用"]) { | 116 | if ([_model.title isEqual:@"大家都在用"]) { |
CNLiveCServiceModule/Classes/View/CNLiveServiceEpiCell.m
| @@ -137,7 +137,7 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell"; | @@ -137,7 +137,7 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell"; | ||
| 137 | { | 137 | { |
| 138 | if (!_titleLabel) { | 138 | if (!_titleLabel) { |
| 139 | _titleLabel = [[UILabel alloc] init]; | 139 | _titleLabel = [[UILabel alloc] init]; |
| 140 | - _titleLabel.font = UIFontMake(17); | 140 | + _titleLabel.font = UIFontBoldMake(17); |
| 141 | _titleLabel.textColor = CNLiveColorWithHexString(@"#EB5039"); | 141 | _titleLabel.textColor = CNLiveColorWithHexString(@"#EB5039"); |
| 142 | } | 142 | } |
| 143 | return _titleLabel; | 143 | return _titleLabel; |
CNLiveCServiceModule/Classes/View/CNLiveServiceLookCell.m
| @@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
| 100 | { | 100 | { |
| 101 | if (!_titleLabel) { | 101 | if (!_titleLabel) { |
| 102 | _titleLabel = [[UILabel alloc] init]; | 102 | _titleLabel = [[UILabel alloc] init]; |
| 103 | - _titleLabel.font = UIFontMake(17); | 103 | + _titleLabel.font = UIFontBoldMake(17); |
| 104 | _titleLabel.textColor = CNLiveColorWithHexString(@"#1F74E9"); | 104 | _titleLabel.textColor = CNLiveColorWithHexString(@"#1F74E9"); |
| 105 | _titleLabel.textAlignment = NSTextAlignmentLeft; | 105 | _titleLabel.textAlignment = NSTextAlignmentLeft; |
| 106 | } | 106 | } |
CNLiveCServiceModule/Classes/View/CNLiveServiceOrLookCell.m
| @@ -63,14 +63,25 @@ | @@ -63,14 +63,25 @@ | ||
| 63 | if (type == CNLiveCellShowTypeService) { | 63 | if (type == CNLiveCellShowTypeService) { |
| 64 | self.describe.hidden = YES; | 64 | self.describe.hidden = YES; |
| 65 | [self.rightBtn setImage:[UIImage loadCServiceBundle:@"service_right"] forState:UIControlStateNormal]; | 65 | [self.rightBtn setImage:[UIImage loadCServiceBundle:@"service_right"] forState:UIControlStateNormal]; |
| 66 | + [self.rightBtn mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 67 | + make.right.equalTo(self.contentView).offset(-10); | ||
| 68 | + make.centerY.equalTo(self.logoImage); | ||
| 69 | + make.width.offset(18); | ||
| 70 | + make.height.offset(18); | ||
| 71 | + }]; | ||
| 66 | }else{ | 72 | }else{ |
| 67 | self.describe.hidden = NO; | 73 | self.describe.hidden = NO; |
| 68 | self.rightBtn.layer.cornerRadius = 9; | 74 | self.rightBtn.layer.cornerRadius = 9; |
| 69 | [self.rightBtn setTitle:@"进入 " forState:UIControlStateNormal]; | 75 | [self.rightBtn setTitle:@"进入 " forState:UIControlStateNormal]; |
| 70 | [self.rightBtn setImage:[UIImage loadCServiceBundle:@"service_enter"] forState:UIControlStateNormal]; | 76 | [self.rightBtn setImage:[UIImage loadCServiceBundle:@"service_enter"] forState:UIControlStateNormal]; |
| 71 | self.rightBtn.backgroundColor = CNLiveColorWithHexString(@"#2C7EEE"); | 77 | self.rightBtn.backgroundColor = CNLiveColorWithHexString(@"#2C7EEE"); |
| 78 | + [self.rightBtn mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 79 | + make.right.equalTo(self.contentView).offset(-10); | ||
| 80 | + make.centerY.equalTo(self.logoImage); | ||
| 81 | + make.width.offset(45); | ||
| 82 | + make.height.offset(18); | ||
| 83 | + }]; | ||
| 72 | } | 84 | } |
| 73 | - [self setNeedsLayout]; | ||
| 74 | } | 85 | } |
| 75 | - (UIImageView *)logoImage{ | 86 | - (UIImageView *)logoImage{ |
| 76 | if (!_logoImage) { | 87 | if (!_logoImage) { |