Commit 9485a65a3bc0162a606a5d5f5e3006a3eb865a7a
1 parent
5b43147f
no message
Showing
14 changed files
with
66 additions
and
25 deletions
CNLiveScioLive/AppDelegate.m
| @@ -31,9 +31,6 @@ | @@ -31,9 +31,6 @@ | ||
| 31 | //推送 | 31 | //推送 |
| 32 | [self registerRemoteNotification]; | 32 | [self registerRemoteNotification]; |
| 33 | [self registerNotification:launchOptions]; | 33 | [self registerNotification:launchOptions]; |
| 34 | - | ||
| 35 | - //版本更新 | ||
| 36 | - [self checkAppUpdate]; | ||
| 37 | 34 | ||
| 38 | //收藏 | 35 | //收藏 |
| 39 | [[DBAction sharedDBAction] createTable]; | 36 | [[DBAction sharedDBAction] createTable]; |
| @@ -45,7 +42,10 @@ | @@ -45,7 +42,10 @@ | ||
| 45 | 42 | ||
| 46 | //语言 | 43 | //语言 |
| 47 | [self setApplicationLanguage]; | 44 | [self setApplicationLanguage]; |
| 48 | - | 45 | + |
| 46 | + //版本更新 | ||
| 47 | + [self checkAppUpdate]; | ||
| 48 | + | ||
| 49 | [self initializeSDKConfiguration]; | 49 | [self initializeSDKConfiguration]; |
| 50 | 50 | ||
| 51 | if(IS_CHINESE){ | 51 | if(IS_CHINESE){ |
| @@ -478,11 +478,11 @@ | @@ -478,11 +478,11 @@ | ||
| 478 | NSString *newVersion =[results objectForKey:@"version"]; | 478 | NSString *newVersion =[results objectForKey:@"version"]; |
| 479 | if([newVersion compare:nowVersion options:NSNumericSearch] == NSOrderedDescending) { | 479 | if([newVersion compare:nowVersion options:NSNumericSearch] == NSOrderedDescending) { |
| 480 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"upDate"]; | 480 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"upDate"]; |
| 481 | - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"版本更新" | 481 | + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:CustomStr(@"VersionUpdate") |
| 482 | message:[results objectForKey:@"releaseNotes"] | 482 | message:[results objectForKey:@"releaseNotes"] |
| 483 | delegate:self | 483 | delegate:self |
| 484 | - cancelButtonTitle:@"取消" | ||
| 485 | - otherButtonTitles:@"更新",nil]; | 484 | + cancelButtonTitle:CustomStr(@"Cancel") |
| 485 | + otherButtonTitles:CustomStr(@"Update"),nil]; | ||
| 486 | [alert show]; | 486 | [alert show]; |
| 487 | return; | 487 | return; |
| 488 | } | 488 | } |
CNLiveScioLive/Pages/Home/CNHomeBaseViewController.m
| @@ -126,7 +126,6 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -126,7 +126,6 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 126 | } | 126 | } |
| 127 | #pragma mark - UITableViewDelegate | 127 | #pragma mark - UITableViewDelegate |
| 128 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | 128 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ |
| 129 | - | ||
| 130 | CNHomeModel *model = self.data[indexPath.row]; | 129 | CNHomeModel *model = self.data[indexPath.row]; |
| 131 | if([model.showType isEqualToString:@"0"]){ | 130 | if([model.showType isEqualToString:@"0"]){ |
| 132 | return 200*MainHScale+85;//一张图 上边 | 131 | return 200*MainHScale+85;//一张图 上边 |
| @@ -136,7 +135,8 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -136,7 +135,8 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 136 | if(model.img && ![model.img isEqualToString:@""]){ | 135 | if(model.img && ![model.img isEqualToString:@""]){ |
| 137 | return 80*MainScale+20;//一张图 左边 | 136 | return 80*MainScale+20;//一张图 左边 |
| 138 | } | 137 | } |
| 139 | - return 80;//无图 | 138 | +// return 80;//无图 |
| 139 | + return model.titleHeight+40;//无图 | ||
| 140 | } | 140 | } |
| 141 | else if([model.showType isEqualToString:@"2"]){ | 141 | else if([model.showType isEqualToString:@"2"]){ |
| 142 | return (MainScreenWidth-20-20)/3.0+85;//三张图 | 142 | return (MainScreenWidth-20-20)/3.0+85;//三张图 |
| @@ -146,11 +146,13 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -146,11 +146,13 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 146 | if(model.img && ![model.img isEqualToString:@""]){ | 146 | if(model.img && ![model.img isEqualToString:@""]){ |
| 147 | return 80*MainScale+20;//一张图 左边 | 147 | return 80*MainScale+20;//一张图 左边 |
| 148 | } | 148 | } |
| 149 | - return 80;//无图 | ||
| 150 | - | 149 | +// return 80;//无图 |
| 150 | + return model.titleHeight+40;//无图 | ||
| 151 | + | ||
| 151 | }else{ | 152 | }else{ |
| 152 | - return 80;//无图 | ||
| 153 | - | 153 | +// return 80;//无图 |
| 154 | + return model.titleHeight+40;//无图 | ||
| 155 | + | ||
| 154 | } | 156 | } |
| 155 | } | 157 | } |
| 156 | 158 |
CNLiveScioLive/Pages/Home/CNHomeENViewController.m
| @@ -144,7 +144,8 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -144,7 +144,8 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 144 | if(model.img && ![model.img isEqualToString:@""]){ | 144 | if(model.img && ![model.img isEqualToString:@""]){ |
| 145 | return 80*MainScale+20;//一张图 左边 | 145 | return 80*MainScale+20;//一张图 左边 |
| 146 | } | 146 | } |
| 147 | - return 80;//无图 | 147 | +// return 80;//无图 |
| 148 | + return model.titleHeight+40;//无图 | ||
| 148 | } | 149 | } |
| 149 | else if([model.showType isEqualToString:@"2"]){ | 150 | else if([model.showType isEqualToString:@"2"]){ |
| 150 | return (MainScreenWidth-20-20)/3.0+85;//三张图 | 151 | return (MainScreenWidth-20-20)/3.0+85;//三张图 |
| @@ -154,10 +155,12 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -154,10 +155,12 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 154 | if(model.img && ![model.img isEqualToString:@""]){ | 155 | if(model.img && ![model.img isEqualToString:@""]){ |
| 155 | return 80*MainScale+20;//一张图 左边 | 156 | return 80*MainScale+20;//一张图 左边 |
| 156 | } | 157 | } |
| 157 | - return 80;//无图 | 158 | +// return 80;//无图 |
| 159 | + return model.titleHeight+40;//无图 | ||
| 158 | 160 | ||
| 159 | }else{ | 161 | }else{ |
| 160 | - return 80;//无图 | 162 | +// return 80;//无图 |
| 163 | + return model.titleHeight+40;//无图 | ||
| 161 | 164 | ||
| 162 | } | 165 | } |
| 163 | } | 166 | } |
CNLiveScioLive/Pages/Home/CNHomeModel.h
| @@ -49,4 +49,7 @@ | @@ -49,4 +49,7 @@ | ||
| 49 | @property (nonatomic, copy) NSString *playType; | 49 | @property (nonatomic, copy) NSString *playType; |
| 50 | 50 | ||
| 51 | @property (nonatomic, copy) NSString *gxbArticleId; | 51 | @property (nonatomic, copy) NSString *gxbArticleId; |
| 52 | + | ||
| 53 | +@property (nonatomic, assign) CGFloat titleHeight; | ||
| 54 | + | ||
| 52 | @end | 55 | @end |
CNLiveScioLive/Pages/Home/CNHomeModel.m
| @@ -9,5 +9,15 @@ | @@ -9,5 +9,15 @@ | ||
| 9 | #import "CNHomeModel.h" | 9 | #import "CNHomeModel.h" |
| 10 | 10 | ||
| 11 | @implementation CNHomeModel | 11 | @implementation CNHomeModel |
| 12 | +static NSInteger const margin = 10; | ||
| 12 | 13 | ||
| 14 | +- (CGFloat)titleHeight{ | ||
| 15 | + | ||
| 16 | + NSStringDrawingOptions options = NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading; | ||
| 17 | + | ||
| 18 | + CGRect titleRect = [_title boundingRectWithSize:CGSizeMake(MainScreenWidth - 4*margin,MAXFLOAT) options:options attributes:@{NSFontAttributeName:Font(16)} context:nil]; | ||
| 19 | + | ||
| 20 | + return titleRect.size.height; | ||
| 21 | + | ||
| 22 | +} | ||
| 13 | @end | 23 | @end |
CNLiveScioLive/Pages/Home/外宣要闻/Controller/CNLiveHeraldedNewsViewController.m
| @@ -169,7 +169,8 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -169,7 +169,8 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 169 | if(model.img && ![model.img isEqualToString:@""]){ | 169 | if(model.img && ![model.img isEqualToString:@""]){ |
| 170 | return 80*MainScale+20;//一张图 左边 | 170 | return 80*MainScale+20;//一张图 左边 |
| 171 | } | 171 | } |
| 172 | - return 80;//无图 | 172 | +// return 80;//无图 |
| 173 | + return model.titleHeight+40;//无图 | ||
| 173 | } | 174 | } |
| 174 | else if([model.showType isEqualToString:@"2"]){ | 175 | else if([model.showType isEqualToString:@"2"]){ |
| 175 | // return 210*MainScale;//三张图 | 176 | // return 210*MainScale;//三张图 |
| @@ -180,10 +181,12 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -180,10 +181,12 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 180 | if(model.img && ![model.img isEqualToString:@""]){ | 181 | if(model.img && ![model.img isEqualToString:@""]){ |
| 181 | return 80*MainScale+20;//一张图 左边 | 182 | return 80*MainScale+20;//一张图 左边 |
| 182 | } | 183 | } |
| 183 | - return 80;//无图 | 184 | +// return 80;//无图 |
| 185 | + return model.titleHeight+40;//无图 | ||
| 184 | 186 | ||
| 185 | }else{ | 187 | }else{ |
| 186 | - return 80;//无图 | 188 | +// return 80;//无图 |
| 189 | + return model.titleHeight+40;//无图 | ||
| 187 | 190 | ||
| 188 | } | 191 | } |
| 189 | } | 192 | } |
CNLiveScioLive/Pages/Home/外宣要闻/View/CNLiveNewsNoPicTableViewCell.m
| @@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
| 88 | make.left.equalTo(self->_backgroundImage.mas_left).with.offset(10); | 88 | make.left.equalTo(self->_backgroundImage.mas_left).with.offset(10); |
| 89 | make.top.equalTo(self->_backgroundImage.mas_top).with.offset(5); | 89 | make.top.equalTo(self->_backgroundImage.mas_top).with.offset(5); |
| 90 | make.right.equalTo(self->_backgroundImage.mas_right).with.offset(-10); | 90 | make.right.equalTo(self->_backgroundImage.mas_right).with.offset(-10); |
| 91 | - make.height.offset(40); | 91 | +// make.height.offset(self->_model.titleHeight); |
| 92 | 92 | ||
| 93 | }]; | 93 | }]; |
| 94 | 94 |
CNLiveScioLive/Pages/Home/答记者问/Controller/CNLiveReporterAskedViewController.m
| @@ -140,7 +140,8 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -140,7 +140,8 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 140 | if(model.img && ![model.img isEqualToString:@""]){ | 140 | if(model.img && ![model.img isEqualToString:@""]){ |
| 141 | return 80*MainScale+20;//一张图 左边 | 141 | return 80*MainScale+20;//一张图 左边 |
| 142 | } | 142 | } |
| 143 | - return 80;//无图 | 143 | +// return 80;//无图 |
| 144 | + return model.titleHeight+40;//无图 | ||
| 144 | } | 145 | } |
| 145 | else if([model.showType isEqualToString:@"2"]){ | 146 | else if([model.showType isEqualToString:@"2"]){ |
| 146 | return (MainScreenWidth-20-20)/3.0+85;//三张图 | 147 | return (MainScreenWidth-20-20)/3.0+85;//三张图 |
| @@ -150,10 +151,12 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | @@ -150,10 +151,12 @@ static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell"; | ||
| 150 | if(model.img && ![model.img isEqualToString:@""]){ | 151 | if(model.img && ![model.img isEqualToString:@""]){ |
| 151 | return 80*MainScale+20;//一张图 左边 | 152 | return 80*MainScale+20;//一张图 左边 |
| 152 | } | 153 | } |
| 153 | - return 80;//无图 | 154 | +// return 80;//无图 |
| 155 | + return model.titleHeight+40;//无图 | ||
| 154 | 156 | ||
| 155 | }else{ | 157 | }else{ |
| 156 | - return 80;//无图 | 158 | +// return 80;//无图 |
| 159 | + return model.titleHeight+40;//无图 | ||
| 157 | 160 | ||
| 158 | } | 161 | } |
| 159 | } | 162 | } |
CNLiveScioLive/Pages/My/通知公告/Controller/CNMyAnnouncementsViewController.m
| @@ -156,7 +156,8 @@ static NSString *myAnnouncementsTableViewCell = @"CNMyAnnouncementsTableViewCell | @@ -156,7 +156,8 @@ static NSString *myAnnouncementsTableViewCell = @"CNMyAnnouncementsTableViewCell | ||
| 156 | */ | 156 | */ |
| 157 | #pragma mark - UITableViewDelegate | 157 | #pragma mark - UITableViewDelegate |
| 158 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | 158 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ |
| 159 | - return 80; | 159 | + CNMyAnnouncementsModel *model = self.data[indexPath.row]; |
| 160 | + return model.titleHeight+40; | ||
| 160 | 161 | ||
| 161 | } | 162 | } |
| 162 | 163 |
CNLiveScioLive/Pages/My/通知公告/Model/CNMyAnnouncementsModel.h
| @@ -69,4 +69,6 @@ | @@ -69,4 +69,6 @@ | ||
| 69 | @property (nonatomic, copy) NSString *videoUrl; | 69 | @property (nonatomic, copy) NSString *videoUrl; |
| 70 | @property (nonatomic, copy) NSString *vipFlag; | 70 | @property (nonatomic, copy) NSString *vipFlag; |
| 71 | 71 | ||
| 72 | +@property (nonatomic, assign) CGFloat titleHeight; | ||
| 73 | + | ||
| 72 | @end | 74 | @end |
CNLiveScioLive/Pages/My/通知公告/Model/CNMyAnnouncementsModel.m
| @@ -9,5 +9,15 @@ | @@ -9,5 +9,15 @@ | ||
| 9 | #import "CNMyAnnouncementsModel.h" | 9 | #import "CNMyAnnouncementsModel.h" |
| 10 | 10 | ||
| 11 | @implementation CNMyAnnouncementsModel | 11 | @implementation CNMyAnnouncementsModel |
| 12 | +static NSInteger const margin = 10; | ||
| 12 | 13 | ||
| 14 | +- (CGFloat)titleHeight{ | ||
| 15 | + | ||
| 16 | + NSStringDrawingOptions options = NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading; | ||
| 17 | + | ||
| 18 | + CGRect titleRect = [_title boundingRectWithSize:CGSizeMake(MainScreenWidth - 2*margin,MAXFLOAT) options:options attributes:@{NSFontAttributeName:Font(15)} context:nil]; | ||
| 19 | + | ||
| 20 | + return titleRect.size.height; | ||
| 21 | + | ||
| 22 | +} | ||
| 13 | @end | 23 | @end |
CNLiveScioLive/Pages/My/通知公告/View/CNMyAnnouncementsTableViewCell.m
| @@ -26,7 +26,7 @@ static NSInteger margin = 10; | @@ -26,7 +26,7 @@ static NSInteger margin = 10; | ||
| 26 | self.contentView.backgroundColor = [UIColor whiteColor]; | 26 | self.contentView.backgroundColor = [UIColor whiteColor]; |
| 27 | 27 | ||
| 28 | _titleLabel = [[UILabel alloc] init]; | 28 | _titleLabel = [[UILabel alloc] init]; |
| 29 | - _titleLabel.numberOfLines = 2; | 29 | + _titleLabel.numberOfLines = 0; |
| 30 | _titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; | 30 | _titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; |
| 31 | _titleLabel.textColor = HEXCOLOR(0x333333); | 31 | _titleLabel.textColor = HEXCOLOR(0x333333); |
| 32 | _titleLabel.font = [UIFont systemFontOfSize:15]; | 32 | _titleLabel.font = [UIFont systemFontOfSize:15]; |
CNLiveScioLive/Pages/Sources/en.lproj/Localizable.strings
| @@ -20,6 +20,8 @@ | @@ -20,6 +20,8 @@ | ||
| 20 | "Reset" = "Reset"; | 20 | "Reset" = "Reset"; |
| 21 | "Unlimited" = "Unlimited"; | 21 | "Unlimited" = "Unlimited"; |
| 22 | "Clear" = "Clear"; | 22 | "Clear" = "Clear"; |
| 23 | +"VersionUpdate" = "Version Update"; | ||
| 24 | +"Update" = "Update"; | ||
| 23 | 25 | ||
| 24 | //NEWS | 26 | //NEWS |
| 25 | "NEWS" = "NEWS"; | 27 | "NEWS" = "NEWS"; |
CNLiveScioLive/Pages/Sources/zh-Hans.lproj/Localizable.strings