@@ -104,10 +104,14 @@ - (void)refresh{
104
104
}];
105
105
}
106
106
107
+ - (BOOL )p_isHeaderNeedToShow {
108
+
109
+ return (!_isHeaderClosed && (_curUser.canUpgradeByCompleteUserInfo || _curUser.willExpired ));
110
+ }
107
111
- (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 " ];
111
115
if (isHeaderNeedToShow) {
112
116
__weak typeof (self) weakSelf = self;
113
117
UIButton *closeBtn = [UIButton new ];
@@ -121,25 +125,35 @@ - (void)configHeader{
121
125
make.top .bottom .right .equalTo (headerV);
122
126
make.width .equalTo (closeBtn.mas_height );
123
127
}];
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" ]];
125
136
tipL.adjustsFontSizeToFitWidth = YES ;
126
137
tipL.minimumScaleFactor = .5 ;
127
138
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? @" 银牌会员" : @" 普通会员" ];
131
140
[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
+ }
134
147
}];
135
148
[headerV addSubview: tipL];
136
149
[tipL mas_makeConstraints: ^(MASConstraintMaker *make) {
137
150
make.centerY .equalTo (headerV);
138
- make.left .equalTo (headerV). offset ( 15 );
151
+ make.left .equalTo (noticeV. mas_right );
139
152
make.right .equalTo (closeBtn.mas_left );
140
153
}];
141
154
}
142
155
self.myTableView .tableHeaderView = headerV;
156
+ [self .myTableView reloadData ];
143
157
}
144
158
145
159
#pragma mark Table M
@@ -166,10 +180,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
166
180
cell.curServiceInfo = _curServiceInfo;
167
181
ESWeak (self, weakSelf);
168
182
cell.leftBlock = ^(){
169
- [weakSelf goToProjects ];
183
+ [weakSelf goToProjectsForPrivate: YES ];
170
184
};
171
185
cell.rightBlock = ^(){
172
- [weakSelf goToTeams ];
186
+ [weakSelf goToProjectsForPrivate: NO ];
173
187
};
174
188
[tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: 0 ];
175
189
return cell;
@@ -182,15 +196,28 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
182
196
indexPath.row == 1 ? [cell setTitle: @" 帮助与反馈" icon: @" user_info_help" ]:
183
197
indexPath.row == 2 ? [cell setTitle: @" 设置" icon: @" user_info_setup" ]:
184
198
[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
+ }];
193
211
}
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
+ // }
194
221
[tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
195
222
return cell;
196
223
}
@@ -210,7 +237,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSIntege
210
237
return kLine_MinHeight ;
211
238
}
212
239
- (CGFloat)tableView : (UITableView *)tableView heightForHeaderInSection : (NSInteger )section {
213
- return 15 ;
240
+ return (section == 0 && [ self p_isHeaderNeedToShow ])? kLine_MinHeight : 15 ;
214
241
}
215
242
216
243
- (UIView *)tableView : (UITableView *)tableView viewForHeaderInSection : (NSInteger )section {
@@ -284,16 +311,24 @@ - (void)goToAbout{
284
311
[self .navigationController pushViewController: [AboutViewController new ] animated: YES ];
285
312
}
286
313
287
- - (void )goToProjects {
314
+ - (void )goToProjectsForPrivate : ( BOOL ) isForPrivateProjects {
288
315
ProjectListViewController *vc = [[ProjectListViewController alloc ] init ];
289
316
vc.curUser = _curUser;
290
317
vc.isFromMeRoot = YES ;
318
+ vc.isForPrivateProjects = isForPrivateProjects;
291
319
[self .navigationController pushViewController: vc animated: YES ];
292
320
}
293
321
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
+ // }
297
332
298
333
- (void )goToMeDisplay {
299
334
MeDisplayViewController *vc = [MeDisplayViewController new ];
0 commit comments