@@ -253,11 +253,21 @@ - (NSString *)p_appID{
253253}
254254
255255- (BOOL )p_needToCheckIfNewVersion {
256- return (!_isHeaderClosed && (_useNewStyle && _myProjects.type == ProjectsTypeAll) && !self.isNewerVersionAvailable );
256+ return (!_isHeaderClosed &&
257+ (_useNewStyle && _myProjects.type == ProjectsTypeAll) &&
258+ !self.isNewerVersionAvailable );
257259}
258260
259261- (BOOL )p_needToShowVersionTip {
260- return (!_isHeaderClosed && (_useNewStyle && _myProjects.type == ProjectsTypeAll) && self.isNewerVersionAvailable );
262+ return (!_isHeaderClosed &&
263+ (_useNewStyle && _myProjects.type == ProjectsTypeAll) &&
264+ self.isNewerVersionAvailable );
265+ }
266+
267+ - (BOOL )p_needToShowHeaderTip {
268+ return (!_isHeaderClosed &&
269+ (_useNewStyle && _myProjects.type == ProjectsTypeAll) &&
270+ (self.isNewerVersionAvailable || ![NSObject isPrivateCloud ].boolValue ));
261271}
262272
263273- (void )refreshUI {
@@ -353,11 +363,21 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
353363}
354364
355365- (CGFloat)tableView : (UITableView *)tableView heightForHeaderInSection : (NSInteger )section {
356- return [self p_needToShowVersionTip ]?40 :0 ;
366+ if ([self p_needToShowHeaderTip ]) {
367+ static UILabel *tipL;
368+ if (!tipL) {
369+ tipL = [UILabellabelWithFont: [UIFontsystemFontOfSize: 12 ]textColor: [UIColorcolorWithHexString: @" 0x136BFB" ]];
370+ tipL.numberOfLines =0 ;
371+ }
372+ tipL.attributedText = [self p_headerTipStr ];
373+ return [tipLsizeThatFits: CGSizeMake (kScreen_Width -40 *1 , CGFLOAT_MAX)].height +16 ;
374+ }else {
375+ return 0 ;
376+ }
357377}
358378
359379- (UIView *)tableView : (UITableView *)tableView viewForHeaderInSection : (NSInteger )section {
360- if ([self p_needToShowVersionTip ]) {
380+ if ([self p_needToShowHeaderTip ]) {
361381 UIView *headerV = [[UIViewalloc ]initWithFrame: CGRectMake (0 ,0 ,kScreen_Width ,40 )];
362382 headerV.backgroundColor = [UIColorcolorWithHexString: @" 0xECF9FF" ];
363383 __weaktypeof (self) weakSelf = self;
@@ -368,32 +388,51 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger
368388 }forControlEvents: UIControlEventTouchUpInside];
369389 [headerVaddSubview: closeBtn];
370390 [closeBtnmas_makeConstraints: ^(MASConstraintMaker *make) {
371- make.top .bottom .right .equalTo (headerV);
372- make.width .equalTo (closeBtn.mas_height );
391+ make.top .right .equalTo (headerV);
392+ make.width .mas_equalTo (40 );
393+ make.height .mas_equalTo (36 );// 文字单行显示时的高度
373394 }];
374- UIImageView *noticeV = [[UIImageViewalloc ]initWithImage: [UIImageimageNamed: @" button_tip_notice" ]];
375- noticeV.contentMode = UIViewContentModeCenter;
376- [headerVaddSubview: noticeV];
377- [noticeVmas_makeConstraints: ^(MASConstraintMaker *make) {
378- make.top .bottom .left .equalTo (headerV);
379- make.width .equalTo (noticeV.mas_height );
380- }];
381- UILabel *tipL = [UILabellabelWithFont: [UIFontsystemFontOfSize: 15 ]textColor: [UIColorcolorWithHexString: @" 0x136BFB" ]];
382- tipL.adjustsFontSizeToFitWidth =YES ;
383- tipL.minimumScaleFactor = .5 ;
395+ // UIImageView *noticeV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"button_tip_notice"]];
396+ // noticeV.contentMode = UIViewContentModeCenter;
397+ // [headerV addSubview:noticeV];
398+ // [noticeV mas_makeConstraints:^(MASConstraintMaker *make) {
399+ // make.top.bottom.left.equalTo(headerV);
400+ // make.width.mas_equalTo(0);
401+ // }];
402+ UILabel *tipL = [UILabellabelWithFont: [UIFontsystemFontOfSize: 12 ]textColor: [UIColorcolorWithHexString: @" 0x136BFB" ]];
403+ tipL.numberOfLines =0 ;
384404 tipL.userInteractionEnabled =YES ;
385- tipL.text =kTarget_Enterprise ?@" 立即升级最新 CODING 企业版客户端" :@" 立即升级最新 Coding 客户端" ;
386- [tipLbk_whenTapped: ^{
387- [[UIApplicationsharedApplication ]openURL: [NSURL URLWithString: kAppUrl ]];
388- }];
405+ tipL.attributedText = [self p_headerTipStr ];
406+ if ([self p_needToShowVersionTip ]) {
407+ [tipLbk_whenTapped: ^{
408+ [[UIApplicationsharedApplication ]openURL: [NSURL URLWithString: kAppUrl ]];
409+ }];
410+ }
389411 [headerVaddSubview: tipL];
390412 [tipLmas_makeConstraints: ^(MASConstraintMaker *make) {
391- make.centerY .equalTo (headerV);
392- make.left .equalTo (noticeV. mas_right );
413+ make.centerY .equalTo (headerV). mas_offset ( 3 ) ;
414+ make.left .equalTo (headerV). offset ( 15 );
393415 make.right .equalTo (closeBtn.mas_left );
394416 }];
395417return headerV;
396- }else {
418+ }else {
419+ return nil ;
420+ }
421+ }
422+
423+ - (NSAttributedString *)p_headerTipStr {
424+ if ([self p_needToShowHeaderTip ]) {
425+ NSString *tipStr;
426+ if ([self p_needToShowVersionTip ]) {
427+ tipStr =kTarget_Enterprise ?@" 立即升级最新 CODING 企业版客户端" :@" 立即升级最新 Coding 客户端" ;
428+ }else {
429+ tipStr =@" 温馨提示:出于实际使用场景限制的考虑,该 App 不再进行更多新功能开发,建议您前往 PC 端网页版体验更完整的产品功能。" ;
430+ }
431+ NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new ];
432+ paragraphStyle.lineSpacing =6 ;
433+ NSDictionary *attributes = @{NSParagraphStyleAttributeName : paragraphStyle};
434+ return [[NSAttributedString alloc ]initWithString: tipStrattributes: attributes];
435+ }else {
397436return nil ;
398437 }
399438}