@@ -104,10 +104,14 @@ - (void)refresh{
104104 }];
105105}
106106
107+ - (BOOL )p_isHeaderNeedToShow {
108+
109+ return (!_isHeaderClosed && (_curUser.canUpgradeByCompleteUserInfo || _curUser.willExpired ));
110+ }
107111- (void )configHeader {
108- BOOL isHeaderNeedToShow = !_isHeaderClosed && !_curUser. isUserInfoCompleted && _curUser. vip . integerValue < 2 ;
109- UIView *headerV = [[UIView alloc ] initWithFrame: CGRectMake (0 , 0 , kScreen_Width , !isHeaderNeedToShow? 1: 44 )];
110- headerV.backgroundColor = !isHeaderNeedToShow? [UIColor clearColor ]: [UIColor colorWithHexString: @" 0xF7F4D6 " ];
112+ BOOL isHeaderNeedToShow = [ self p_isHeaderNeedToShow ] ;
113+ UIView *headerV = [[UIView alloc ] initWithFrame: CGRectMake (0 , 0 , kScreen_Width , !isHeaderNeedToShow? 1: 40 )];
114+ headerV.backgroundColor = !isHeaderNeedToShow? [UIColor clearColor ]: [UIColor colorWithHexString: @" 0xECF9FF " ];
111115 if (isHeaderNeedToShow) {
112116 __weak typeof (self) weakSelf = self;
113117 UIButton *closeBtn = [UIButton new ];
@@ -121,25 +125,35 @@ - (void)configHeader{
121125 make.top .bottom .right .equalTo (headerV);
122126 make.width .equalTo (closeBtn.mas_height );
123127 }];
124- UILabel *tipL = [UILabel labelWithFont: [UIFont systemFontOfSize: 14 ] textColor: [UIColor colorWithHexString: @" 0x836E33" ]];
128+ UIImageView *noticeV = [[UIImageView alloc ] initWithImage: [UIImage imageNamed: @" button_tip_notice" ]];
129+ noticeV.contentMode = UIViewContentModeCenter;
130+ [headerV addSubview: noticeV];
131+ [noticeV mas_makeConstraints: ^(MASConstraintMaker *make) {
132+ make.top .bottom .left .equalTo (headerV);
133+ make.width .equalTo (noticeV.mas_height );
134+ }];
135+ UILabel *tipL = [UILabel labelWithFont: [UIFont systemFontOfSize: 15 ] textColor: [UIColor colorWithHexString: @" 0x136BFB" ]];
125136 tipL.adjustsFontSizeToFitWidth = YES ;
126137 tipL.minimumScaleFactor = .5 ;
127138 tipL.userInteractionEnabled = YES ;
128- NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc ] initWithString: @" 完善个人信息,即可升级成为银牌会员。去完善" ];
129- [attrStr addAttribute: NSUnderlineStyleAttributeName value: @(NSUnderlineStyleSingle) range: [attrStr.string rangeOfString: @" 去完善" ]];
130- tipL.attributedText = attrStr;
139+ tipL.text = _curUser.canUpgradeByCompleteUserInfo ? @" 完善个人信息,即可升级银牌会员" : [NSString stringWithFormat: @" 会员过期将自动降级到%@ " , _curUser.isUserInfoCompleted? @" 银牌会员" : @" 普通会员" ];
131140 [tipL bk_whenTapped: ^{
132- SettingMineInfoViewController *vc = [SettingMineInfoViewController new ];
133- [weakSelf.navigationController pushViewController: vc animated: YES ];
141+ if (weakSelf.curUser .canUpgradeByCompleteUserInfo ) {
142+ SettingMineInfoViewController *vc = [SettingMineInfoViewController new ];
143+ [weakSelf.navigationController pushViewController: vc animated: YES ];
144+ }else {
145+ kTipAlert (@" 请前往 Coding 网页版进行升级操作" );
146+ }
134147 }];
135148 [headerV addSubview: tipL];
136149 [tipL mas_makeConstraints: ^(MASConstraintMaker *make) {
137150 make.centerY .equalTo (headerV);
138- make.left .equalTo (headerV). offset ( 15 );
151+ make.left .equalTo (noticeV. mas_right );
139152 make.right .equalTo (closeBtn.mas_left );
140153 }];
141154 }
142155 self.myTableView .tableHeaderView = headerV;
156+ [self .myTableView reloadData ];
143157}
144158
145159#pragma mark Table M
@@ -166,10 +180,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
166180 cell.curServiceInfo = _curServiceInfo;
167181 ESWeak (self, weakSelf);
168182 cell.leftBlock = ^(){
169- [weakSelf goToProjects ];
183+ [weakSelf goToProjectsForPrivate: YES ];
170184 };
171185 cell.rightBlock = ^(){
172- [weakSelf goToTeams ];
186+ [weakSelf goToProjectsForPrivate: NO ];
173187 };
174188 [tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: 0 ];
175189 return cell;
@@ -182,15 +196,28 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
182196 indexPath.row == 1 ? [cell setTitle: @" 帮助与反馈" icon: @" user_info_help" ]:
183197 indexPath.row == 2 ? [cell setTitle: @" 设置" icon: @" user_info_setup" ]:
184198 [cell setTitle: @" 关于我们" icon: @" user_info_about" ]);
185- if (indexPath.section == 1 && indexPath.row == 1 && [[FunctionTipsManager shareManager ] needToTip: kFunctionTipStr_Me_Shop ]) {
186- // cell.accessoryType = UITableViewCellAccessoryNone;
187- CGFloat pointX = kScreen_Width - 40 ;
188- CGFloat pointY = [UserInfoIconCell cellHeight ]/2 ;
189- [cell.contentView addBadgeTip: kBadgeTipStr withCenterPosition: CGPointMake (pointX, pointY)];
190- }else {
191- // cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
192- [cell.contentView removeBadgeTips ];
199+
200+ NSInteger pointTag = 101 ;
201+ [cell.contentView removeViewWithTag: pointTag];
202+ if (indexPath.section == 1 && indexPath.row == 0 ) {
203+ UILabel *pointL = [UILabel labelWithFont: [UIFont systemFontOfSize: 13 ] textColor: kColorLightBlue ];
204+ pointL.text = [NSString stringWithFormat: @" %@ 码币" , _curServiceInfo.point_left ?: @" --" ];
205+ pointL.tag = pointTag;
206+ [cell.contentView addSubview: pointL];
207+ [pointL mas_makeConstraints: ^(MASConstraintMaker *make) {
208+ make.centerY .equalTo (cell.contentView );
209+ make.right .offset (-kPaddingLeftWidth );
210+ }];
193211 }
212+ // if (indexPath.section == 1 && indexPath.row == 1 && [[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_Me_Shop]) {
213+ // // cell.accessoryType = UITableViewCellAccessoryNone;
214+ // CGFloat pointX = kScreen_Width - 40;
215+ // CGFloat pointY = [UserInfoIconCell cellHeight]/2;
216+ // [cell.contentView addBadgeTip:kBadgeTipStr withCenterPosition:CGPointMake(pointX, pointY)];
217+ // }else{
218+ // // cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
219+ // [cell.contentView removeBadgeTips];
220+ // }
194221 [tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
195222 return cell;
196223 }
@@ -210,7 +237,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSIntege
210237 return kLine_MinHeight ;
211238}
212239- (CGFloat)tableView : (UITableView *)tableView heightForHeaderInSection : (NSInteger )section {
213- return 15 ;
240+ return (section == 0 && [ self p_isHeaderNeedToShow ])? kLine_MinHeight : 15 ;
214241}
215242
216243- (UIView *)tableView : (UITableView *)tableView viewForHeaderInSection : (NSInteger )section {
@@ -284,16 +311,24 @@ - (void)goToAbout{
284311 [self .navigationController pushViewController: [AboutViewController new ] animated: YES ];
285312}
286313
287- - (void )goToProjects {
314+ - (void )goToProjectsForPrivate : ( BOOL ) isForPrivateProjects {
288315 ProjectListViewController *vc = [[ProjectListViewController alloc ] init ];
289316 vc.curUser = _curUser;
290317 vc.isFromMeRoot = YES ;
318+ vc.isForPrivateProjects = isForPrivateProjects;
291319 [self .navigationController pushViewController: vc animated: YES ];
292320}
293321
294- - (void )goToTeams {
295- [self .navigationController pushViewController: [TeamListViewController new ] animated: YES ];
296- }
322+ // - (void)goToProjects{
323+ // ProjectListViewController *vc = [[ProjectListViewController alloc] init];
324+ // vc.curUser = _curUser;
325+ // vc.isFromMeRoot = YES;
326+ // [self.navigationController pushViewController:vc animated:YES];
327+ // }
328+ //
329+ // - (void)goToTeams{
330+ // [self.navigationController pushViewController:[TeamListViewController new] animated:YES];
331+ // }
297332
298333- (void )goToMeDisplay {
299334 MeDisplayViewController *vc = [MeDisplayViewController new ];
0 commit comments