Commit fc027c63f7e0ae2a0fae0eaef1f5df667dd299c0

Authored by yanglingyu
1 parent 9376a509

根据UI做页面调整,根据需求做弹窗调整

CNLiveCServiceModule/Classes/Present/CNLiveServicePresent.m
... ... @@ -135,7 +135,7 @@ static const CGFloat margin = 15;
135 135 showNum = 8;
136 136 itemSize = CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70);
137 137 }else{
138   - cellheight = 105;
  138 + cellheight = 125;
139 139 showNum = 4;
140 140 itemSize = CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70);
141 141 subTitle = dic[@"category"][@"subTitle"];
... ... @@ -275,13 +275,16 @@ static const CGFloat margin = 15;
275 275 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/servingList") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
276 276 NSDictionary * dic = responseObject[@"data"];
277 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 288 if (dic) {
286 289 NSString *lastPage = dic[@"hasNextPage"];
287 290 !succeed?:succeed(array.copy,!lastPage.boolValue);
... ... @@ -336,23 +339,26 @@ static const CGFloat margin = 15;
336 339 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/allCategory") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
337 340 NSDictionary * dic = responseObject[@"data"];
338 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 362 if (dic) {
357 363 NSString *lastPage = dic[@"hasNextPage"];
358 364 !succeed?:succeed(array.copy,!lastPage.boolValue);
... ...
CNLiveCServiceModule/Classes/View/CNLiveAlertTipView.m
... ... @@ -50,7 +50,7 @@
50 50 }];
51 51 [tipView.notShowBtn mas_makeConstraints:^(MASConstraintMaker *make) {
52 52 make.bottom.equalTo(tipView.cancelBtn.mas_top).offset(-10);
53   - make.width.offset(105);
  53 + make.width.offset(125);
54 54 make.height.offset(20);
55 55 make.left.equalTo(tipView).offset(15);
56 56 }];
... ... @@ -125,7 +125,7 @@
125 125 _sureBtn.layer.cornerRadius = 21;
126 126 _sureBtn.titleLabel.font = UIFontMake(16);
127 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 129 _sureBtn.enabled = NO;
130 130 }
131 131 return _sureBtn;
... ...
CNLiveCServiceModule/Classes/View/CNLiveChineServiceCell.m
... ... @@ -28,7 +28,7 @@
28 28 -(void)makeSubViewsLayout
29 29 {
30 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 32 make.centerY.equalTo(self.contentView);
33 33 make.height.width.offset(45);
34 34 }];
... ...
CNLiveCServiceModule/Classes/View/CNLiveCycleCell.m
... ... @@ -110,7 +110,7 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell";
110 110 if ([_model.title isEqual:@"中国服务号"]) {
111 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 114 return UIEdgeInsetsMake(5, 0, 5, 0);
115 115 }
116 116 if ([_model.title isEqual:@"大家都在用"]) {
... ...
CNLiveCServiceModule/Classes/View/CNLiveServiceEpiCell.m
... ... @@ -137,7 +137,7 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell";
137 137 {
138 138 if (!_titleLabel) {
139 139 _titleLabel = [[UILabel alloc] init];
140   - _titleLabel.font = UIFontMake(17);
  140 + _titleLabel.font = UIFontBoldMake(17);
141 141 _titleLabel.textColor = CNLiveColorWithHexString(@"#EB5039");
142 142 }
143 143 return _titleLabel;
... ...
CNLiveCServiceModule/Classes/View/CNLiveServiceLookCell.m
... ... @@ -100,7 +100,7 @@
100 100 {
101 101 if (!_titleLabel) {
102 102 _titleLabel = [[UILabel alloc] init];
103   - _titleLabel.font = UIFontMake(17);
  103 + _titleLabel.font = UIFontBoldMake(17);
104 104 _titleLabel.textColor = CNLiveColorWithHexString(@"#1F74E9");
105 105 _titleLabel.textAlignment = NSTextAlignmentLeft;
106 106 }
... ...
CNLiveCServiceModule/Classes/View/CNLiveServiceOrLookCell.m
... ... @@ -63,14 +63,25 @@
63 63 if (type == CNLiveCellShowTypeService) {
64 64 self.describe.hidden = YES;
65 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 72 }else{
67 73 self.describe.hidden = NO;
68 74 self.rightBtn.layer.cornerRadius = 9;
69 75 [self.rightBtn setTitle:@"进入 " forState:UIControlStateNormal];
70 76 [self.rightBtn setImage:[UIImage loadCServiceBundle:@"service_enter"] forState:UIControlStateNormal];
71 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 86 - (UIImageView *)logoImage{
76 87 if (!_logoImage) {
... ...