Commit 09c19fd8300d7ea92a0eb1c02b34717613d0773b

Authored by yanglingyu
1 parent 1a6a37c8

专题增加无图模式

CNLiveScioLive/Pages/Home/新闻详情/OldController/MoreSpecialViewController.m
... ... @@ -12,6 +12,7 @@
12 12 #import "BigImageTableViewCell.h"
13 13 #import "LeftImageTableViewCell.h"
14 14 #import "ThreeImageTableViewCell.h"
  15 +#import "NoPictureTableViewCell.h"
15 16  
16 17 @interface MoreSpecialViewController ()<UITableViewDataSource,UITableViewDelegate> {
17 18 NSDictionary *_dictionary;
... ... @@ -352,6 +353,28 @@
352 353 }
353 354 return cell;
354 355 } else if ([@"3" isEqualToString:showType]) {
  356 + if ([@"" isEqualToString:_dic[@"img"]]) {
  357 + static NSString *identifier = @"NoPictureCell";
  358 + NoPictureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  359 + if (cell == nil) {
  360 + cell = [[NoPictureTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
  361 + cell.selectionStyle = UITableViewCellSelectionStyleNone;
  362 + }
  363 + cell.titleLabel.text = _dic[@"title"];
  364 + cell.timeLabel.text = [_dic[@"createDate"] componentsSeparatedByString:@" "][0];
  365 + NSString *text = [NSString stringWithFormat:@"%@",_dic[@"tags"]];
  366 + if ([text containsString:@"null"]) {
  367 + text = @"";
  368 + }
  369 + if ([text length] > 0) {
  370 + [cell.tagsLabel setHidden:NO];
  371 + [cell.tagsLabel setText:text];
  372 + [cell reSetTagFrame];
  373 + } else {
  374 + [cell.tagsLabel setHidden:YES];
  375 + }
  376 + return cell;
  377 + } else {
355 378 static NSString *identifier = @"LeftImageCell";
356 379 LeftImageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
357 380 if (cell == nil) {
... ... @@ -387,6 +410,7 @@
387 410 [cell.tagsLabel setHidden:YES];
388 411 }
389 412 return cell;
  413 + }
390 414 }
391 415 static NSString *identifier = @"cell";
392 416 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
... ...
CNLiveScioLive/Pages/Home/新闻详情/OldController/SCIOSpecialViewController.m
... ... @@ -14,6 +14,7 @@
14 14 #import "BigImageTableViewCell.h"
15 15 #import "LeftImageTableViewCell.h"
16 16 #import "ThreeImageTableViewCell.h"
  17 +#import "NoPictureTableViewCell.h"
17 18 #import "YWWebScrollView.h"
18 19 #import "Html5Utils.h"
19 20  
... ... @@ -504,6 +505,28 @@
504 505 }
505 506 return cell;
506 507 } else if ([@"3" isEqualToString:showType]) {
  508 + if ([@"" isEqualToString:_dic[@"img"]]) {
  509 + static NSString *identifier = @"NoPictureCell";
  510 + NoPictureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  511 + if (cell == nil) {
  512 + cell = [[NoPictureTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
  513 + cell.selectionStyle = UITableViewCellSelectionStyleNone;
  514 + }
  515 + cell.titleLabel.text = _dic[@"title"];
  516 + cell.timeLabel.text = [_dic[@"createDate"] componentsSeparatedByString:@" "][0];
  517 + NSString *text = [NSString stringWithFormat:@"%@",_dic[@"tags"]];
  518 + if ([text containsString:@"null"]) {
  519 + text = @"";
  520 + }
  521 + if ([text length] > 0) {
  522 + [cell.tagsLabel setHidden:NO];
  523 + [cell.tagsLabel setText:text];
  524 + [cell reSetTagFrame];
  525 + } else {
  526 + [cell.tagsLabel setHidden:YES];
  527 + }
  528 + return cell;
  529 + } else {
507 530 static NSString *identifier = @"LeftImageCell";
508 531 LeftImageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
509 532 if (cell == nil) {
... ... @@ -540,6 +563,7 @@
540 563 [cell.tagsLabel setHidden:YES];
541 564 }
542 565 return cell;
  566 + }
543 567 }
544 568 static NSString *identifier = @"cell";
545 569 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
... ...