Skip to content

Commit 80db869

Browse files
committed
version 5.1
1 parent fffafc6 commit 80db869

30 files changed

+376
-99
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,8 @@
13881388
B1C871BB1EB338FD003DACF0 /* project_tag_btn@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B1C871B81EB338FD003DACF0 /* project_tag_btn@3x.png */; };
13891389
B1C871BC1EB338FD003DACF0 /* project_tag_icon@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B1C871B91EB338FD003DACF0 /* project_tag_icon@3x.png */; };
13901390
B1C871BE1EB33B37003DACF0 /* task_icon_arrow@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B1C871BD1EB33B37003DACF0 /* task_icon_arrow@3x.png */; };
1391+
B1CB8DD22047F1D200872197 /* button_tip_notice@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B1CB8DD02047F1D000872197 /* button_tip_notice@2x.png */; };
1392+
B1CB8DD32047F1D200872197 /* button_tip_notice@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B1CB8DD12047F1D100872197 /* button_tip_notice@3x.png */; };
13911393
B93D904B1ACBA3110057A6EE /* ProjectDeleteAlertControllerVisualStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = B93D904A1ACBA3110057A6EE /* ProjectDeleteAlertControllerVisualStyle.m */; };
13921394
B94C1B691AC945D30000C271 /* NewProjectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B94C1B681AC945D30000C271 /* NewProjectViewController.m */; };
13931395
B94C1B6B1AC945FB0000C271 /* NewProject.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B94C1B6A1AC945FB0000C271 /* NewProject.storyboard */; };
@@ -3464,6 +3466,8 @@
34643466
B1C871B81EB338FD003DACF0 /* project_tag_btn@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "project_tag_btn@3x.png"; sourceTree = "<group>"; };
34653467
B1C871B91EB338FD003DACF0 /* project_tag_icon@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "project_tag_icon@3x.png"; sourceTree = "<group>"; };
34663468
B1C871BD1EB33B37003DACF0 /* task_icon_arrow@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "task_icon_arrow@3x.png"; sourceTree = "<group>"; };
3469+
B1CB8DD02047F1D000872197 /* button_tip_notice@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_tip_notice@2x.png"; sourceTree = "<group>"; };
3470+
B1CB8DD12047F1D100872197 /* button_tip_notice@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_tip_notice@3x.png"; sourceTree = "<group>"; };
34673471
B93D90491ACBA3110057A6EE /* ProjectDeleteAlertControllerVisualStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectDeleteAlertControllerVisualStyle.h; sourceTree = "<group>"; };
34683472
B93D904A1ACBA3110057A6EE /* ProjectDeleteAlertControllerVisualStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectDeleteAlertControllerVisualStyle.m; sourceTree = "<group>"; };
34693473
B94C1B671AC945D30000C271 /* NewProjectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewProjectViewController.h; sourceTree = "<group>"; };
@@ -5842,6 +5846,8 @@
58425846
B12B64201FF33DFE00ACFDCC /* button_red_close@3x.png */,
58435847
B12B64251FF33E0000ACFDCC /* button_tip_close@2x.png */,
58445848
B12B64221FF33DFF00ACFDCC /* button_tip_close@3x.png */,
5849+
B1CB8DD02047F1D000872197 /* button_tip_notice@2x.png */,
5850+
B1CB8DD12047F1D100872197 /* button_tip_notice@3x.png */,
58455851
B12B64231FF33DFF00ACFDCC /* upgrade_success@2x.png */,
58465852
B12B64241FF33E0000ACFDCC /* upgrade_success@3x.png */,
58475853
B11DC7BE20245727004E76A9 /* button_terminal@2x.png */,
@@ -7212,8 +7218,10 @@
72127218
4E996C041ABBF56A00C704F1 /* n_btn_followed_yes@2x.png in Resources */,
72137219
4EAE06901B784E9200179F4B /* store_icon@2x.png in Resources */,
72147220
B14689C31EE100B200B01371 /* vip_4_75@3x.png in Resources */,
7221+
B1CB8DD22047F1D200872197 /* button_tip_notice@2x.png in Resources */,
72157222
4EF818161B049C89005F974B /* addPictureBgImage@2x.png in Resources */,
72167223
13FB5D501CA17A6400EE127C /* PRReviewer@3x.png in Resources */,
7224+
B1CB8DD32047F1D200872197 /* button_tip_notice@3x.png in Resources */,
72177225
4EB52F0F1C74691B00B5EBEA /* password_look@2x.png in Resources */,
72187226
4ED673281A8E12F900DF2D1A /* SVWebViewControllerActivityReport-iPad@2x.png in Resources */,
72197227
13FB5D4B1CA17A6400EE127C /* PointLikeHead@3x.png in Resources */,
@@ -7847,7 +7855,6 @@
78477855
"${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle",
78487856
"${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle",
78497857
"${PODS_ROOT}/evernote-cloud-sdk-ios/ENSDKResources.bundle",
7850-
"${PODS_ROOT}/iVersion/iVersion/iVersion.bundle",
78517858
);
78527859
name = "[CP] Copy Pods Resources";
78537860
outputPaths = (

Coding_iOS/Coding_iOS-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>5.0</string>
20+
<string>5.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleURLTypes</key>
@@ -37,7 +37,7 @@
3737
</dict>
3838
</array>
3939
<key>CFBundleVersion</key>
40-
<string>5.0.201802130930</string>
40+
<string>5.1.201803071530</string>
4141
<key>ITSAppUsesNonExemptEncryption</key>
4242
<false/>
4343
<key>LSApplicationQueriesSchemes</key>

Coding_iOS/Controllers/CodeViewController.m

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ - (void)rightNavBtnClicked{
161161
[actionTitles removeObjectAtIndex:0];
162162
}
163163
__weak typeof(self) weakSelf = self;
164-
[[UIActionSheet bk_actionSheetCustomWithTitle:nil buttonTitles:actionTitles destructiveTitle:nil cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
164+
[[UIActionSheet bk_actionSheetCustomWithTitle:nil buttonTitles:actionTitles destructiveTitle:@"删除文件" cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
165165
[weakSelf actionSheetClicked:sheet index:index];
166166
}] showInView:self.view];
167167
}
@@ -176,9 +176,24 @@ - (void)actionSheetClicked:(UIActionSheet *)sheet index:(NSInteger)index{
176176
[self goToCommitsVC];
177177
}else if (index == 2){
178178
[self popOut];
179+
}else if (index == 3){
180+
[self deleteBtnClicked];
179181
}
180182
}
181183

184+
- (void)deleteBtnClicked{
185+
[NSObject showHUDQueryStr:@"正在删除..."];
186+
[[Coding_NetAPIManager sharedManager] request_DeleteCodeFile:_myCodeFile withPro:_myProject andBlock:^(id data, NSError *error) {
187+
[NSObject hideHUDQuery];
188+
if (data) {
189+
// if (self.savedSucessBlock) {
190+
// self.savedSucessBlock();
191+
// }
192+
[self.navigationController popViewControllerAnimated:YES];
193+
}
194+
}];
195+
}
196+
182197
- (void)goToEditVC{
183198
__weak typeof(self) weakSelf = self;
184199

Coding_iOS/Controllers/Login/CannotLoginViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ - (void)changeBaseURLTip{
8989
NSString *newBaseURLStr = alertCtrl.textFields[0].text;
9090
if ([newBaseURLStr.uppercaseString isEqualToString:@"S"]) {
9191
newBaseURLStr = @"http://coding.codingprod.net/";
92+
}else if ([newBaseURLStr.uppercaseString isEqualToString:@"T"]){
93+
newBaseURLStr = @"http://coding.t.codingprod.net/";
9294
}
9395
[NSObject changeBaseURLStrTo:newBaseURLStr];
9496
}];

Coding_iOS/Controllers/MeSetting/SettingViewController.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,15 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
6868

6969
}else{
7070
cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TitleValueMore forIndexPath:indexPath];
71-
[(TitleValueMoreCell *)cell setTitleStr:@"清除缓存" valueStr:[self p_diskCacheSizeStr]];
71+
[(TitleValueMoreCell *)cell setTitleStr:@"清除缓存" valueStr:@"--"];
72+
__weak typeof(self) weakSelf = self;
73+
__weak typeof(cell) weakCell = cell;
74+
dispatch_async(dispatch_get_global_queue(0, 0), ^{
75+
NSString *diskCacheSizeStr = [weakSelf p_diskCacheSizeStr];
76+
dispatch_async(dispatch_get_main_queue(), ^{
77+
((UILabel *)[weakCell valueForKey:@"valueLabel"]).text = diskCacheSizeStr;
78+
});
79+
});
7280
}
7381
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
7482
return cell;

Coding_iOS/Controllers/ProjectListViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111

1212
@interface ProjectListViewController : Project_RootViewController
1313
@property (strong, nonatomic) User *curUser;
14-
@property (assign, nonatomic) BOOL isFromMeRoot;
14+
@property (assign, nonatomic) BOOL isFromMeRoot, isForPrivateProjects;
1515
@end

Coding_iOS/Controllers/ProjectListViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ - (void)configSegmentItems{
4646
}
4747

4848
- (Projects *)projectsWithIndex:(NSUInteger)index{
49-
return [Projects projectsWithType:_isFromMeRoot? ProjectsTypeCreated:(index + ProjectsTypeTaProject) andUser:self.curUser];
49+
return [Projects projectsWithType:_isFromMeRoot? _isForPrivateProjects? ProjectsTypeCreatedPrivate: ProjectsTypeCreatedPublic:(index + ProjectsTypeTaProject) andUser:self.curUser];
5050
}
5151

5252
@end

Coding_iOS/Controllers/RootControllers/Me_RootViewController.m

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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];
-82 Bytes
Loading
-190 Bytes
Loading

0 commit comments

Comments
 (0)