Skip to content

Commit 0c35e85

Browse files
sumengsumeng
authored andcommitted
Merge remote-tracking branch 'upstream/master'
2 parents 195f42c + 1c05174 commit 0c35e85

15 files changed

Lines changed: 175 additions & 19 deletions

.DS_Store

0 Bytes
Binary file not shown.

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@
368368
4EACB4411A2C448F0097ABB3 /* button_file_move_unable@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EACB43E1A2C448F0097ABB3 /* button_file_move_unable@2x.png */; };
369369
4EACB4431A2C45300097ABB3 /* button_file_download_enable@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EACB4421A2C45300097ABB3 /* button_file_download_enable@2x.png */; };
370370
4EACB4461A2C60110097ABB3 /* ProjectActivities.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EACB4451A2C60110097ABB3 /* ProjectActivities.m */; };
371+
4EAE068E1B78484D00179F4B /* user_info_point@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE068D1B78484D00179F4B /* user_info_point@2x.png */; };
372+
4EAE06901B784E9200179F4B /* store_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE068F1B784E9200179F4B /* store_icon@2x.png */; };
373+
4EAE06921B7880BA00179F4B /* me_info_arrow_left@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE06911B7880BA00179F4B /* me_info_arrow_left@2x.png */; };
371374
4EB0C2001A807ED00042FC4F /* NSURL+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EB0C1FF1A807ED00042FC4F /* NSURL+Common.m */; };
372375
4EB845331AB83C3B0030DC69 /* git_icon_fork@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EB845301AB83C3B0030DC69 /* git_icon_fork@2x.png */; };
373376
4EB845341AB83C3B0030DC69 /* git_icon_star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EB845311AB83C3B0030DC69 /* git_icon_star@2x.png */; };
@@ -1415,6 +1418,9 @@
14151418
4EACB4421A2C45300097ABB3 /* button_file_download_enable@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_file_download_enable@2x.png"; sourceTree = "<group>"; };
14161419
4EACB4441A2C60110097ABB3 /* ProjectActivities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectActivities.h; sourceTree = "<group>"; };
14171420
4EACB4451A2C60110097ABB3 /* ProjectActivities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectActivities.m; sourceTree = "<group>"; };
1421+
4EAE068D1B78484D00179F4B /* user_info_point@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "user_info_point@2x.png"; sourceTree = "<group>"; };
1422+
4EAE068F1B784E9200179F4B /* store_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "store_icon@2x.png"; sourceTree = "<group>"; };
1423+
4EAE06911B7880BA00179F4B /* me_info_arrow_left@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "me_info_arrow_left@2x.png"; sourceTree = "<group>"; };
14181424
4EB0C1FE1A807ED00042FC4F /* NSURL+Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+Common.h"; sourceTree = "<group>"; };
14191425
4EB0C1FF1A807ED00042FC4F /* NSURL+Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+Common.m"; sourceTree = "<group>"; };
14201426
4EB845301AB83C3B0030DC69 /* git_icon_fork@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "git_icon_fork@2x.png"; sourceTree = "<group>"; };
@@ -2772,6 +2778,7 @@
27722778
4E996BF91ABBF56A00C704F1 /* userInfo */ = {
27732779
isa = PBXGroup;
27742780
children = (
2781+
4EAE068D1B78484D00179F4B /* user_info_point@2x.png */,
27752782
4E996BFA1ABBF56A00C704F1 /* n_btn_followed_both@2x.png */,
27762783
4E996BFB1ABBF56A00C704F1 /* n_btn_followed_not@2x.png */,
27772784
4E996BFC1ABBF56A00C704F1 /* n_btn_followed_yes@2x.png */,
@@ -3726,6 +3733,8 @@
37263733
4E095A811B6B24DE008DC439 /* time_clock_icon@2x.png */,
37273734
4E095A821B6B24DE008DC439 /* topic_comment_icon@2x.png */,
37283735
4E62410A1B74D65400E1533C /* search_tweet_like@2x.png */,
3736+
4EAE068F1B784E9200179F4B /* store_icon@2x.png */,
3737+
4EAE06911B7880BA00179F4B /* me_info_arrow_left@2x.png */,
37293738
);
37303739
path = Images;
37313740
sourceTree = "<group>";
@@ -4480,6 +4489,7 @@
44804489
8E8F7B2E19EF6306006BA8BD /* btn_followed_yes@2x.png in Resources */,
44814490
8E8F7B3319EF6306006BA8BD /* btn_project_add@2x.png in Resources */,
44824491
4E6383D11B32665700D98648 /* project_item_activity@2x.png in Resources */,
4492+
4EAE068E1B78484D00179F4B /* user_info_point@2x.png in Resources */,
44834493
4E9113AA1A1CB19900AC9431 /* icon_file_state_goon@2x.png in Resources */,
44844494
4EF17EDA1B3C3112003CDD2D /* intro_icon_5@3x.png in Resources */,
44854495
8E64ED8319ED0CE3006E99DA /* QBImagePickerController.strings in Resources */,
@@ -4530,6 +4540,7 @@
45304540
8E97CEBB1A0C7E26006F9AD7 /* coding_emoji_36@2x.png in Resources */,
45314541
8EA6D19F19E240C40076D59C /* tipIcon_TweetComment@2x.png in Resources */,
45324542
4E996C041ABBF56A00C704F1 /* n_btn_followed_yes@2x.png in Resources */,
4543+
4EAE06901B784E9200179F4B /* store_icon@2x.png in Resources */,
45334544
4EF818161B049C89005F974B /* addPictureBgImage@2x.png in Resources */,
45344545
4ED673281A8E12F900DF2D1A /* SVWebViewControllerActivityReport-iPad@2x.png in Resources */,
45354546
4E07D30E1A4A9F45009EDDF2 /* btn_file_reDo@2x.png in Resources */,
@@ -4629,6 +4640,7 @@
46294640
4EF17EE71B3C3112003CDD2D /* intro_tip_5@3x.png in Resources */,
46304641
8E97CEB91A0C7E26006F9AD7 /* coding_emoji_34@2x.png in Resources */,
46314642
4EF17ED81B3C3112003CDD2D /* intro_icon_4@3x.png in Resources */,
4643+
4EAE06921B7880BA00179F4B /* me_info_arrow_left@2x.png in Resources */,
46324644
4E5F39071ACBFDCD0010515D /* keyboard_photo@2x.png in Resources */,
46334645
4E0022A91B7362EF005308DE /* intro_page0_ip6@2x.png in Resources */,
46344646
4E76D4DE1A5A7B4A0094A35E /* text_clear_btn@2x.png in Resources */,

Coding_iOS/Controllers/CodeViewController.m

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,25 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations{
7070
- (void)sendRequest{
7171
[self.view beginLoading];
7272
__weak typeof(self) weakSelf = self;
73-
[[Coding_NetAPIManager sharedManager] request_CodeFile:_myCodeFile withPro:_myProject andBlock:^(id data, NSError *error) {
74-
[weakSelf.view endLoading];
75-
if (data) {
76-
weakSelf.myCodeFile = data;
77-
[weakSelf refreshCodeViewData];
78-
}
79-
[weakSelf.view configBlankPage:EaseBlankPageTypeView hasData:(data != nil) hasError:(error != nil) reloadButtonBlock:^(id sender) {
80-
[weakSelf sendRequest];
73+
if (_myCodeFile.ref.length <= 0 && [_myCodeFile.path isEqualToString:@"README"]) {
74+
[[Coding_NetAPIManager sharedManager] request_ReadMeOFProject:_myProject andBlock:^(id data, NSError *error) {
75+
[weakSelf doSomethingWithResponse:data andError:error];
8176
}];
77+
}else{
78+
[[Coding_NetAPIManager sharedManager] request_CodeFile:_myCodeFile withPro:_myProject andBlock:^(id data, NSError *error) {
79+
[weakSelf doSomethingWithResponse:data andError:error];
80+
}];
81+
}
82+
}
83+
84+
- (void)doSomethingWithResponse:(id)data andError:(NSError *)error{
85+
[self.view endLoading];
86+
if (data) {
87+
self.myCodeFile = data;
88+
[self refreshCodeViewData];
89+
}
90+
[self.view configBlankPage:EaseBlankPageTypeView hasData:(data != nil) hasError:(error != nil) reloadButtonBlock:^(id sender) {
91+
[self sendRequest];
8292
}];
8393
}
8494

Coding_iOS/Controllers/NProjectViewController/NProjectViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ - (void)gotoPro:(Project *)project{
301301
}
302302

303303
- (void)goToReadme{
304-
CodeFile *nextCodeFile = [CodeFile codeFileWithRef:@"master" andPath:@"README.md"];
304+
CodeFile *nextCodeFile = [CodeFile codeFileWithRef:@"" andPath:@"README"];
305305
CodeViewController *vc = [CodeViewController codeVCWithProject:_myProject andCodeFile:nextCodeFile];
306306
[self.navigationController pushViewController:vc animated:YES];
307307
}

Coding_iOS/Controllers/PointRecordsViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
106106
if (indexPath.row == 0) {
107107
PointRecord *record = [_curRecords.list firstObject];
108108
PointTopCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_PointTopCell forIndexPath:indexPath];
109-
cell.pointLeftStr = record.points_left.stringValue;
109+
cell.pointLeftStr = [NSString stringWithFormat:@"%.2f", record.points_left.floatValue];
110110
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:0 hasSectionLine:NO];
111111
return cell;
112112
}else{

Coding_iOS/Controllers/UserInfoViewController.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#import <APParallaxHeader/UIScrollView+APParallaxHeader.h>
3333

3434
#import "CSMyTopicVC.h"
35+
#import "PointRecordsViewController.h"
3536

3637
@interface UserInfoViewController ()<UITableViewDataSource, UITableViewDelegate>
3738
@property (strong, nonatomic) UITableView *myTableView;
@@ -139,7 +140,7 @@ - (UIView *)footerV{
139140

140141
#pragma mark Table M
141142
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
142-
return 3;
143+
return [self.curUser.global_key isEqualToString:[Login curLoginUser].global_key]? 4: 3;
143144
}
144145
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
145146
NSInteger row = 0;
@@ -149,6 +150,8 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
149150
row = 1;
150151
}else if (section == 2){
151152
row = 3;
153+
}else if (section == 3){
154+
row = 1;
152155
}
153156
return row;
154157
}
@@ -174,14 +177,16 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
174177
UserInfoIconCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_UserInfoIconCell forIndexPath:indexPath];
175178
if (indexPath.section == 1) {
176179
[cell setTitle:@"详细信息" icon:@"user_info_detail"];
177-
}else{
180+
}else if (indexPath.section == 2){
178181
if (indexPath.row == 0) {
179182
[cell setTitle:[self isMe]? @"我的项目": @"Ta的项目" icon:@"user_info_project"];
180183
}else if(indexPath.row == 1){
181184
[cell setTitle:[self isMe]? @"我的冒泡": @"Ta的冒泡" icon:@"user_info_tweet"];
182185
}else{
183186
[cell setTitle:[self isMe]? @"我的话题": @"Ta的话题" icon:@"user_info_topic"];
184187
}
188+
}else{
189+
[cell setTitle:@"我的码币" icon:@"user_info_point"];
185190
}
186191
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
187192
return cell;
@@ -226,6 +231,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
226231
}else{
227232
[self goToTopic];
228233
}
234+
}else if (indexPath.section == 3){
235+
[self goToPoint];
229236
}
230237
}
231238

@@ -288,6 +295,11 @@ - (void)goToTopic {
288295
[self.navigationController pushViewController:vc animated:YES];
289296
}
290297

298+
- (void)goToPoint{
299+
PointRecordsViewController *vc = [PointRecordsViewController new];
300+
[self.navigationController pushViewController:vc animated:YES];
301+
}
302+
291303
#pragma mark Nav
292304
- (void)settingBtnClicked:(id)sender{
293305
SettingViewController *vc = [[SettingViewController alloc] init];
1.28 KB
Loading
3.43 KB
Loading
4.13 KB
Loading

Coding_iOS/Util/Manager/Coding_NetAPIManager.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ - (void)request_PointRecords:(PointRecords *)records andBlock:(void (^)(id data,
15671567
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:[records toPath] withParams:[records toParams] withMethodType:Get andBlock:^(id data, NSError *error) {
15681568
if (data) {
15691569
data = [data valueForKey:@"data"];
1570-
PointRecords *resultA = [NSObject objectOfClass:@"" fromJSON:data];
1570+
PointRecords *resultA = [NSObject objectOfClass:@"PointRecords" fromJSON:data];
15711571
block(resultA, nil);
15721572
}else{
15731573
block(nil, error);
@@ -1834,8 +1834,11 @@ - (void)request_ReadMeOFProject:(Project *)project andBlock:(void (^)(id data, N
18341834
NSString *path = [NSString stringWithFormat:@"api/user/%@/project/%@/git/tree/%@",project.owner_user_name, project.name, defultBranch];
18351835
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:path withParams:nil withMethodType:Get andBlock:^(id data, NSError *error) {
18361836
if (data) {
1837-
NSString *readMeHtml = [[[data valueForKey:@"data"] valueForKey:@"readme"] valueForKey:@"preview"];
1838-
block(readMeHtml? readMeHtml: @"我们推荐每个项目都新建一个README文件", nil);
1837+
id resultData = [[data valueForKey:@"data"] valueForKey:@"readme"];
1838+
CodeFile_RealFile *realFile = [NSObject objectOfClass:@"CodeFile_RealFile" fromJSON:resultData];
1839+
CodeFile *rCodeFile = [CodeFile codeFileWithRef:defultBranch andPath:realFile.path];
1840+
rCodeFile.file = realFile;
1841+
block(rCodeFile, nil);
18391842
}else{
18401843
block(nil, error);
18411844
}

0 commit comments

Comments
 (0)