Skip to content

Commit c53b3b4

Browse files
committed
完善个人信息
1 parent 4473c07 commit c53b3b4

14 files changed

+301
-9
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,13 @@
11951195
B12B64181FF0E4CB00ACFDCC /* skill_delete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B12B64161FF0E4CA00ACFDCC /* skill_delete@2x.png */; };
11961196
B12B64191FF0E4CB00ACFDCC /* skill_delete@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B12B64171FF0E4CA00ACFDCC /* skill_delete@3x.png */; };
11971197
B12B641C1FF0F5E400ACFDCC /* JDStatusBarLayoutMarginHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B12B641B1FF0F5E300ACFDCC /* JDStatusBarLayoutMarginHelper.m */; };
1198+
B12B641F1FF2835800ACFDCC /* CodingVipTipManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B12B641E1FF2835800ACFDCC /* CodingVipTipManager.m */; };
1199+
B12B64261FF33E0100ACFDCC /* button_red_close@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B12B64201FF33DFE00ACFDCC /* button_red_close@3x.png */; };
1200+
B12B64271FF33E0100ACFDCC /* button_red_close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B12B64211FF33DFF00ACFDCC /* button_red_close@2x.png */; };
1201+
B12B64281FF33E0100ACFDCC /* button_tip_close@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B12B64221FF33DFF00ACFDCC /* button_tip_close@3x.png */; };
1202+
B12B64291FF33E0100ACFDCC /* upgrade_success@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B12B64231FF33DFF00ACFDCC /* upgrade_success@2x.png */; };
1203+
B12B642A1FF33E0100ACFDCC /* upgrade_success@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B12B64241FF33E0000ACFDCC /* upgrade_success@3x.png */; };
1204+
B12B642B1FF33E0100ACFDCC /* button_tip_close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B12B64251FF33E0000ACFDCC /* button_tip_close@2x.png */; };
11981205
B14689B41EE100B200B01371 /* vip_3_30@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B14689A41EE100B200B01371 /* vip_3_30@2x.png */; };
11991206
B14689B51EE100B200B01371 /* vip_3_30@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B14689A51EE100B200B01371 /* vip_3_30@3x.png */; };
12001207
B14689B61EE100B200B01371 /* vip_3_40@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B14689A61EE100B200B01371 /* vip_3_40@2x.png */; };
@@ -3191,6 +3198,14 @@
31913198
B12B64171FF0E4CA00ACFDCC /* skill_delete@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "skill_delete@3x.png"; sourceTree = "<group>"; };
31923199
B12B641A1FF0F5E300ACFDCC /* JDStatusBarLayoutMarginHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JDStatusBarLayoutMarginHelper.h; sourceTree = "<group>"; };
31933200
B12B641B1FF0F5E300ACFDCC /* JDStatusBarLayoutMarginHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JDStatusBarLayoutMarginHelper.m; sourceTree = "<group>"; };
3201+
B12B641D1FF2835800ACFDCC /* CodingVipTipManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CodingVipTipManager.h; sourceTree = "<group>"; };
3202+
B12B641E1FF2835800ACFDCC /* CodingVipTipManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CodingVipTipManager.m; sourceTree = "<group>"; };
3203+
B12B64201FF33DFE00ACFDCC /* button_red_close@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_red_close@3x.png"; sourceTree = "<group>"; };
3204+
B12B64211FF33DFF00ACFDCC /* button_red_close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_red_close@2x.png"; sourceTree = "<group>"; };
3205+
B12B64221FF33DFF00ACFDCC /* button_tip_close@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_tip_close@3x.png"; sourceTree = "<group>"; };
3206+
B12B64231FF33DFF00ACFDCC /* upgrade_success@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "upgrade_success@2x.png"; sourceTree = "<group>"; };
3207+
B12B64241FF33E0000ACFDCC /* upgrade_success@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "upgrade_success@3x.png"; sourceTree = "<group>"; };
3208+
B12B64251FF33E0000ACFDCC /* button_tip_close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_tip_close@2x.png"; sourceTree = "<group>"; };
31943209
B14689A41EE100B200B01371 /* vip_3_30@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vip_3_30@2x.png"; sourceTree = "<group>"; };
31953210
B14689A51EE100B200B01371 /* vip_3_30@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vip_3_30@3x.png"; sourceTree = "<group>"; };
31963211
B14689A61EE100B200B01371 /* vip_3_40@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vip_3_40@2x.png"; sourceTree = "<group>"; };
@@ -4803,6 +4818,8 @@
48034818
4E5D13141C0EDFE700985AEB /* SendRewardManager.m */,
48044819
4E80E9331E011D6000DE1BC6 /* RewardTipManager.h */,
48054820
4E80E9341E011D6000DE1BC6 /* RewardTipManager.m */,
4821+
B12B641D1FF2835800ACFDCC /* CodingVipTipManager.h */,
4822+
B12B641E1FF2835800ACFDCC /* CodingVipTipManager.m */,
48064823
);
48074824
path = Manager;
48084825
sourceTree = "<group>";
@@ -5721,6 +5738,12 @@
57215738
B1C871B91EB338FD003DACF0 /* project_tag_icon@3x.png */,
57225739
B12B64161FF0E4CA00ACFDCC /* skill_delete@2x.png */,
57235740
B12B64171FF0E4CA00ACFDCC /* skill_delete@3x.png */,
5741+
B12B64211FF33DFF00ACFDCC /* button_red_close@2x.png */,
5742+
B12B64201FF33DFE00ACFDCC /* button_red_close@3x.png */,
5743+
B12B64251FF33E0000ACFDCC /* button_tip_close@2x.png */,
5744+
B12B64221FF33DFF00ACFDCC /* button_tip_close@3x.png */,
5745+
B12B64231FF33DFF00ACFDCC /* upgrade_success@2x.png */,
5746+
B12B64241FF33E0000ACFDCC /* upgrade_success@3x.png */,
57245747
);
57255748
path = Images;
57265749
sourceTree = "<group>";
@@ -6739,6 +6762,7 @@
67396762
4EB52F221C76BA3B00B5EBEA /* tag_button_randomColor@3x.png in Resources */,
67406763
4ED4B48A1D82646100EED8C6 /* user_info_help@3x.png in Resources */,
67416764
4E6383B81B32640900D98648 /* messageComment@2x.png in Resources */,
6765+
B12B642A1FF33E0100ACFDCC /* upgrade_success@3x.png in Resources */,
67426766
8EA6D1A319E240C40076D59C /* tweet_comment_btn@2x.png in Resources */,
67436767
D09E6ACE1BF9CCCF009D37F8 /* fliter_square@2x.png in Resources */,
67446768
1319D1081CA7FE6E00729F82 /* PR_create@2x.png in Resources */,
@@ -6798,6 +6822,7 @@
67986822
7E8E59811B6F91C40083CA02 /* bubble_left_play_2@2x.png in Resources */,
67996823
4EB52F631C7C5C4F00B5EBEA /* task_resource_reference_Task@3x.png in Resources */,
68006824
4E93F23A1B84356500017916 /* file_menu_icon_delete@2x.png in Resources */,
6825+
B12B64261FF33E0100ACFDCC /* button_red_close@3x.png in Resources */,
68016826
1319D10C1CA81FE100729F82 /* PR_merge@3x.png in Resources */,
68026827
8E97CEB01A0C7E26006F9AD7 /* coding_emoji_25@2x.png in Resources */,
68036828
7E335D9D1B6F5E94003D0F3D /* keyboard_arrow_down@2x.png in Resources */,
@@ -6973,6 +6998,7 @@
69736998
B1C8714D1EADF3AC003DACF0 /* mrpr_icon_fileChange@3x.png in Resources */,
69746999
4EAAD0511E542B2D008AA957 /* icon_code_executable@2x.png in Resources */,
69757000
B1C8714B1EADF217003DACF0 /* user_info_company@3x.png in Resources */,
7001+
B12B64291FF33E0100ACFDCC /* upgrade_success@2x.png in Resources */,
69767002
D0C447C41C02DB5400DC1C4B /* pop_Tweet@2x.png in Resources */,
69777003
4E6383A81B3262D300D98648 /* taskPriority1@2x.png in Resources */,
69787004
4E80E9581E02911E00DE1BC6 /* search_icon_pr@2x.png in Resources */,
@@ -7065,6 +7091,7 @@
70657091
4EB52F211C76BA3B00B5EBEA /* tag_button_randomColor@2x.png in Resources */,
70667092
4E9423E51E69401B0095F1CD /* blankpage_image_Notice@3x.png in Resources */,
70677093
B1C871391EADF155003DACF0 /* project_item_mr_pr@3x.png in Resources */,
7094+
B12B642B1FF33E0100ACFDCC /* button_tip_close@2x.png in Resources */,
70687095
4E6383FC1B33C18700D98648 /* task_activity_icon_reassign@2x.png in Resources */,
70697096
4EB52F5E1C7C5C4F00B5EBEA /* task_resource_reference_ProjectFile@2x.png in Resources */,
70707097
4E6383B71B32640900D98648 /* messageAT@2x.png in Resources */,
@@ -7091,6 +7118,7 @@
70917118
4E5D13111C0ECB3400985AEB /* tweet_btn_rewarded@2x.png in Resources */,
70927119
4E66EE291A28226000DA1B3E /* button_file_move_enable@2x.png in Resources */,
70937120
B1C8711B1EADF0B1003DACF0 /* messageSystem@3x.png in Resources */,
7121+
B12B64271FF33E0100ACFDCC /* button_red_close@2x.png in Resources */,
70947122
4E9423F51E69401B0095F1CD /* blankpage_image_Wiki@3x.png in Resources */,
70957123
4EE1A23E1B5F3834004284F1 /* project_tag_icon@2x.png in Resources */,
70967124
133DAA651CC13A30004D8501 /* PR_update_title@3x.png in Resources */,
@@ -7351,6 +7379,7 @@
73517379
4E80E95D1E02911E00DE1BC6 /* search_icon_task@3x.png in Resources */,
73527380
B1C871641EB182C7003DACF0 /* checkbox_unchecked@3x.png in Resources */,
73537381
8E97CE9D1A0C7E26006F9AD7 /* coding_emoji_06@2x.png in Resources */,
7382+
B12B64281FF33E0100ACFDCC /* button_tip_close@3x.png in Resources */,
73547383
4E9423E81E69401B0095F1CD /* blankpage_image_ShopOrder@2x.png in Resources */,
73557384
4E0849821A918A7F00BD27F6 /* coding_emoji_40@2x.png in Resources */,
73567385
4E9423DD1E69401B0095F1CD /* blankpage_image_Default@3x.png in Resources */,
@@ -7658,6 +7687,7 @@
76587687
8E1C3E0A19E8DFE300EF3032 /* SettingAccountViewController.m in Sources */,
76597688
4E8765681A22E5B40090CFB9 /* SWTableViewCell.m in Sources */,
76607689
4E94C4E71B4A6AC700EB668A /* ScanBGView.m in Sources */,
7690+
B12B641F1FF2835800ACFDCC /* CodingVipTipManager.m in Sources */,
76617691
4E0BD8701B6C7E3D0061CAA6 /* CSTopicHeaderView.m in Sources */,
76627692
4EBB624D1A6F526C0045DAEF /* NJKWebViewProgressView.m in Sources */,
76637693
4E6383F21B32CC7600D98648 /* TaskActivityCell.m in Sources */,

Coding_iOS/Controllers/MeSetting/SettingMineInfoViewController.m

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@
2222
#import "UserInfoDetailTagCell.h"
2323
#import "JDStatusBarNotification.h"
2424
#import "SettingSkillsViewController.h"
25+
#import "SettingAccountViewController.h"
2526

2627
@interface SettingMineInfoViewController ()
2728
@property (strong, nonatomic) UITableView *myTableView;
2829
@property (strong, nonatomic) User *curUser;
2930
@property (strong, nonatomic) JobManager *curJobManager;
3031
@property (strong, nonatomic) TagsManager *curTagsManager;
32+
33+
@property (assign, nonatomic) BOOL isHeaderClosed;
3134
@end
3235

3336
@implementation SettingMineInfoViewController
@@ -36,7 +39,6 @@ - (void)viewDidLoad {
3639
[super viewDidLoad];
3740
// Do any additional setup after loading the view.
3841
self.title = @"个人信息";
39-
self.curUser =[Login curLoginUser];
4042

4143
// 添加myTableView
4244
_myTableView = ({
@@ -72,6 +74,17 @@ - (void)viewDidLoad {
7274
}];
7375
}
7476

77+
- (void)viewWillAppear:(BOOL)animated{
78+
[super viewWillAppear:animated];
79+
self.curUser =[Login curLoginUser];
80+
}
81+
82+
- (void)setCurUser:(User *)curUser{
83+
_curUser = curUser;
84+
85+
[self configHeader];
86+
}
87+
7588
- (void)didReceiveMemoryWarning {
7689
[super didReceiveMemoryWarning];
7790
// Dispose of any resources that can be recreated.
@@ -82,6 +95,44 @@ - (void)didReceiveMemoryWarning {
8295
self.view = nil;
8396
}
8497

98+
- (void)configHeader{
99+
BOOL isHeaderNeedToShow = !_isHeaderClosed && (!_curUser.is_phone_validated.boolValue || !_curUser.email_validation.boolValue) && _curUser.vip.integerValue < 2;
100+
UIView *headerV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, !isHeaderNeedToShow? 1: 44)];
101+
headerV.backgroundColor = !isHeaderNeedToShow? [UIColor clearColor]: [UIColor colorWithHexString:@"0xF2DADA"];
102+
if (isHeaderNeedToShow) {
103+
__weak typeof(self) weakSelf = self;
104+
UIButton *closeBtn = [UIButton new];
105+
[closeBtn setImage:[UIImage imageNamed:@"button_red_close"] forState:UIControlStateNormal];
106+
[closeBtn bk_addEventHandler:^(id sender) {
107+
weakSelf.isHeaderClosed = YES;
108+
[weakSelf configHeader];
109+
} forControlEvents:UIControlEventTouchUpInside];
110+
[headerV addSubview:closeBtn];
111+
[closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
112+
make.top.bottom.right.equalTo(headerV);
113+
make.width.equalTo(closeBtn.mas_height);
114+
}];
115+
UILabel *tipL = [UILabel labelWithFont:[UIFont systemFontOfSize:14] textColor:[UIColor colorWithHexString:@"0xA64C4B"]];
116+
tipL.adjustsFontSizeToFitWidth = YES;
117+
tipL.minimumScaleFactor = .5;
118+
tipL.userInteractionEnabled = YES;
119+
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:@"验证手机或邮箱后完善资料才能升级,去验证"];
120+
[attrStr addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:[attrStr.string rangeOfString:@"去验证"]];
121+
tipL.attributedText = attrStr;
122+
[tipL bk_whenTapped:^{
123+
SettingAccountViewController *vc = [SettingAccountViewController new];
124+
[weakSelf.navigationController pushViewController:vc animated:YES];
125+
}];
126+
[headerV addSubview:tipL];
127+
[tipL mas_makeConstraints:^(MASConstraintMaker *make) {
128+
make.centerY.equalTo(headerV);
129+
make.left.equalTo(headerV).offset(15);
130+
make.right.equalTo(closeBtn.mas_left);
131+
}];
132+
}
133+
self.myTableView.tableHeaderView = headerV;
134+
}
135+
85136
#pragma mark TableM
86137

87138
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
@@ -379,10 +430,10 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
379430
NSNumber *index = [_curJobManager indexOfJobName:_curUser.job_str];
380431
[ActionSheetStringPicker showPickerWithTitle:nil rows:@[jobNameArray] initialSelection:@[index] doneBlock:^(ActionSheetStringPicker *picker, NSArray *selectedIndex, NSArray *selectedValue) {
381432
NSString *preValue = weakSelf.curUser.job_str;
382-
NSString *preValueKey = weakSelf.curUser.job;
433+
NSNumber *preValueKey = weakSelf.curUser.job;
383434

384435
NSNumber *jobIndex = selectedIndex.firstObject;
385-
NSString *job = [NSString stringWithFormat:@"%d", jobIndex.intValue +1];
436+
NSNumber *job = @(jobIndex.intValue +1);
386437
NSString *job_str = selectedValue.firstObject;
387438
_curUser.job = job;
388439
_curUser.job_str = job_str;

Coding_iOS/Controllers/RootControllers/Me_RootViewController.m

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ @interface Me_RootViewController ()<UITableViewDataSource, UITableViewDelegate>
4040

4141
@property (strong, nonatomic) User *curUser;
4242
@property (strong, nonatomic) UserServiceInfo *curServiceInfo;
43+
44+
@property (assign, nonatomic) BOOL isHeaderClosed;
4345
@end
4446

4547
@implementation Me_RootViewController
4648
- (void)viewDidLoad{
4749
[super viewDidLoad];
4850
// Do any additional setup after loading the view.
49-
self.title = @"";
50-
_curUser = [Login curLoginUser]? [Login curLoginUser]: [User userWithGlobalKey:@""];
51-
[self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"addUserBtn_Nav"] style:UIBarButtonItemStylePlain target:self action:@selector(goToAddUser)] animated:NO];
52-
51+
self.title = @"";
52+
_curUser = [Login curLoginUser]? [Login curLoginUser]: [User userWithGlobalKey:@""];
53+
[self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"addUserBtn_Nav"] style:UIBarButtonItemStylePlain target:self action:@selector(goToAddUser)] animated:NO];
54+
5355
// 添加myTableView
5456
_myTableView = ({
5557
UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
@@ -75,6 +77,7 @@ - (void)viewDidLoad{
7577

7678
_refreshControl = [[ODRefreshControl alloc] initInScrollView:self.myTableView];
7779
[_refreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
80+
[self configHeader];
7881
}
7982

8083
- (void)viewWillAppear:(BOOL)animated{
@@ -91,6 +94,7 @@ - (void)refresh{
9194
if (dataS) {
9295
weakSelf.curServiceInfo = dataS;
9396
}
97+
[weakSelf configHeader];
9498
[weakSelf.myTableView reloadData];
9599
[weakSelf.refreshControl endRefreshing];
96100
}];
@@ -100,6 +104,44 @@ - (void)refresh{
100104
}];
101105
}
102106

107+
- (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"];
111+
if (isHeaderNeedToShow) {
112+
__weak typeof(self) weakSelf = self;
113+
UIButton *closeBtn = [UIButton new];
114+
[closeBtn setImage:[UIImage imageNamed:@"button_tip_close"] forState:UIControlStateNormal];
115+
[closeBtn bk_addEventHandler:^(id sender) {
116+
weakSelf.isHeaderClosed = YES;
117+
[weakSelf configHeader];
118+
} forControlEvents:UIControlEventTouchUpInside];
119+
[headerV addSubview:closeBtn];
120+
[closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
121+
make.top.bottom.right.equalTo(headerV);
122+
make.width.equalTo(closeBtn.mas_height);
123+
}];
124+
UILabel *tipL = [UILabel labelWithFont:[UIFont systemFontOfSize:14] textColor:[UIColor colorWithHexString:@"0x836E33"]];
125+
tipL.adjustsFontSizeToFitWidth = YES;
126+
tipL.minimumScaleFactor = .5;
127+
tipL.userInteractionEnabled = YES;
128+
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:@"完善个人信息,即可升级成为银牌会员。去完善"];
129+
[attrStr addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:[attrStr.string rangeOfString:@"去完善"]];
130+
tipL.attributedText = attrStr;
131+
[tipL bk_whenTapped:^{
132+
SettingMineInfoViewController *vc = [SettingMineInfoViewController new];
133+
[weakSelf.navigationController pushViewController:vc animated:YES];
134+
}];
135+
[headerV addSubview:tipL];
136+
[tipL mas_makeConstraints:^(MASConstraintMaker *make) {
137+
make.centerY.equalTo(headerV);
138+
make.left.equalTo(headerV).offset(15);
139+
make.right.equalTo(closeBtn.mas_left);
140+
}];
141+
}
142+
self.myTableView.tableHeaderView = headerV;
143+
}
144+
103145
#pragma mark Table M
104146
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
105147
return 3;
642 Bytes
Loading
862 Bytes
Loading
497 Bytes
Loading
749 Bytes
Loading
23.9 KB
Loading
40.8 KB
Loading

Coding_iOS/Models/User.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@
1212

1313
@property (strong, nonatomic) NSDictionary *propertyArrayMap;
1414

15-
@property (readwrite, nonatomic, strong) NSString *avatar, *name, *global_key, *path, *slogan, *company, *tags_str, *tags, *location, *job_str, *job, *email, *birthday, *pinyinName;
15+
//vip 1-4:普通、银牌、金牌、钻石
16+
17+
@property (readwrite, nonatomic, strong) NSString *avatar, *name, *global_key, *path, *slogan, *company, *tags_str, *tags, *location, *job_str, *email, *birthday, *pinyinName;
1618
@property (readwrite, nonatomic, strong) NSString *curPassword, *resetPassword, *resetPasswordConfirm, *phone, *introduction, *phone_country_code, *country, *school;
1719

18-
@property (readwrite, nonatomic, strong) NSNumber *id, *sex, *follow, *followed, *fans_count, *follows_count, *tweets_count, *status, *points_left, *email_validation, *is_phone_validated, *vip, *degree;
20+
@property (readwrite, nonatomic, strong) NSNumber *id, *sex, *follow, *followed, *fans_count, *follows_count, *tweets_count, *status, *points_left, *email_validation, *is_phone_validated, *vip, *degree, *job;
1921
@property (readwrite, nonatomic, strong) NSDate *created_at, *last_logined_at, *last_activity_at, *updated_at;
2022

2123
@property (strong, nonatomic) NSArray *skills;
2224

2325
@property (strong, nonatomic, readonly) NSString *skills_str, *degree_str;
2426

27+
@property (assign, nonatomic, readonly) BOOL isUserInfoCompleted;
28+
2529
+ (User *)userWithGlobalKey:(NSString *)global_key;
2630

2731
+ (NSArray *)degreeList;
@@ -44,4 +48,5 @@
4448
- (NSString *)localFriendsPath;
4549

4650
- (NSString *)changePasswordTips;
51+
4752
@end

Coding_iOS/Models/User.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ - (NSString *)localFriendsPath{
208208
return @"FriendsPath";
209209
}
210210

211+
- (BOOL)isUserInfoCompleted{
212+
if (!_sex || _birthday.length <= 0 || _location.length <= 0 || !_job || !_degree || _school.length <= 0 || !_is_phone_validated.boolValue || !_email_validation.boolValue || _skills.count <= 0) {
213+
return NO;
214+
}
215+
return YES;
216+
}
217+
211218
- (NSString *)changePasswordTips{
212219
NSString *tipStr = nil;
213220
if (!self.curPassword || self.curPassword.length <= 0){

0 commit comments

Comments
 (0)