Skip to content

Commit f5b46ff

Browse files
committed
服务条款(NJKWebViewProgress不支持本地资源加载进度,拎出来改改改)
1 parent 3100a64 commit f5b46ff

11 files changed

Lines changed: 898 additions & 53 deletions

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@
130130
4EACB4411A2C448F0097ABB3 /* button_file_move_unable@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EACB43E1A2C448F0097ABB3 /* button_file_move_unable@2x.png */; };
131131
4EACB4431A2C45300097ABB3 /* button_file_download_enable.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EACB4421A2C45300097ABB3 /* button_file_download_enable.png */; };
132132
4EACB4461A2C60110097ABB3 /* ProjectActivities.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EACB4451A2C60110097ABB3 /* ProjectActivities.m */; };
133+
4EBB62461A6F46F80045DAEF /* service_terms.html in Resources */ = {isa = PBXBuildFile; fileRef = 4EBB62451A6F46F80045DAEF /* service_terms.html */; };
134+
4EBB624C1A6F526C0045DAEF /* NJKWebViewProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EBB62491A6F526C0045DAEF /* NJKWebViewProgress.m */; };
135+
4EBB624D1A6F526C0045DAEF /* NJKWebViewProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EBB624B1A6F526C0045DAEF /* NJKWebViewProgressView.m */; };
133136
4EBD0C661A1F2011004B4284 /* nav_project_file@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EBD0C651A1F2011004B4284 /* nav_project_file@2x.png */; };
134137
4EBDA87C1A6640340035ED96 /* UIActionSheet+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EBDA87B1A6640340035ED96 /* UIActionSheet+Common.m */; };
135138
4EC5AD921A258DF8006FA97C /* icon_file_cell_delete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EC5AD8F1A258DF8006FA97C /* icon_file_cell_delete@2x.png */; };
@@ -709,6 +712,11 @@
709712
4EACB4421A2C45300097ABB3 /* button_file_download_enable.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = button_file_download_enable.png; sourceTree = "<group>"; };
710713
4EACB4441A2C60110097ABB3 /* ProjectActivities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectActivities.h; sourceTree = "<group>"; };
711714
4EACB4451A2C60110097ABB3 /* ProjectActivities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectActivities.m; sourceTree = "<group>"; };
715+
4EBB62451A6F46F80045DAEF /* service_terms.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = service_terms.html; sourceTree = "<group>"; };
716+
4EBB62481A6F526C0045DAEF /* NJKWebViewProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJKWebViewProgress.h; sourceTree = "<group>"; };
717+
4EBB62491A6F526C0045DAEF /* NJKWebViewProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJKWebViewProgress.m; sourceTree = "<group>"; };
718+
4EBB624A1A6F526C0045DAEF /* NJKWebViewProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJKWebViewProgressView.h; sourceTree = "<group>"; };
719+
4EBB624B1A6F526C0045DAEF /* NJKWebViewProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJKWebViewProgressView.m; sourceTree = "<group>"; };
712720
4EBD0C651A1F2011004B4284 /* nav_project_file@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "nav_project_file@2x.png"; sourceTree = "<group>"; };
713721
4EBDA87A1A6640340035ED96 /* UIActionSheet+Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIActionSheet+Common.h"; sourceTree = "<group>"; };
714722
4EBDA87B1A6640340035ED96 /* UIActionSheet+Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIActionSheet+Common.m"; sourceTree = "<group>"; };
@@ -1588,6 +1596,17 @@
15881596
path = ODRefreshControl;
15891597
sourceTree = "<group>";
15901598
};
1599+
4EBB62471A6F526C0045DAEF /* NJKWebViewProgress */ = {
1600+
isa = PBXGroup;
1601+
children = (
1602+
4EBB62481A6F526C0045DAEF /* NJKWebViewProgress.h */,
1603+
4EBB62491A6F526C0045DAEF /* NJKWebViewProgress.m */,
1604+
4EBB624A1A6F526C0045DAEF /* NJKWebViewProgressView.h */,
1605+
4EBB624B1A6F526C0045DAEF /* NJKWebViewProgressView.m */,
1606+
);
1607+
path = NJKWebViewProgress;
1608+
sourceTree = "<group>";
1609+
};
15911610
4EC5AD8E1A258DF8006FA97C /* icon_file_cell_edit */ = {
15921611
isa = PBXGroup;
15931612
children = (
@@ -2336,6 +2355,7 @@
23362355
8EA6CFFA19E240C40076D59C /* Resources */ = {
23372356
isa = PBXGroup;
23382357
children = (
2358+
4EBB62451A6F46F80045DAEF /* service_terms.html */,
23392359
8E7612EF1A08A4EB005BE797 /* markdown.html */,
23402360
8E7612F01A08A4EB005BE797 /* code.html */,
23412361
8EABE3C919F1211D00A17784 /* topic.html */,
@@ -2397,6 +2417,7 @@
23972417
8EA6D03E19E240C40076D59C /* Vendor */ = {
23982418
isa = PBXGroup;
23992419
children = (
2420+
4EBB62471A6F526C0045DAEF /* NJKWebViewProgress */,
24002421
4EA7F1561A6D192B00A046BD /* ODRefreshControl */,
24012422
4EA7F1381A6D192B00A046BD /* SDWebImage */,
24022423
4EDD8F4C1A36F42200E9E232 /* XGPush */,
@@ -2854,6 +2875,7 @@
28542875
8E97CE991A0C7E26006F9AD7 /* coding_emoji_02@2x.png in Resources */,
28552876
8EA6D17719E240C40076D59C /* placeholder_monkey_round_33@2x.png in Resources */,
28562877
8E97CEB51A0C7E26006F9AD7 /* coding_emoji_30@2x.png in Resources */,
2878+
4EBB62461A6F46F80045DAEF /* service_terms.html in Resources */,
28572879
8E97CEB31A0C7E26006F9AD7 /* coding_emoji_28@2x.png in Resources */,
28582880
8EA6D17A19E240C40076D59C /* placeholder_monkey_round_50@2x.png in Resources */,
28592881
8EA6D15919E240C40076D59C /* AppIcon120x120.png in Resources */,
@@ -3000,6 +3022,7 @@
30003022
8E1C3E0E19E8DFE300EF3032 /* UserInfoViewController.m in Sources */,
30013023
8E1C3E0A19E8DFE300EF3032 /* SettingAccountViewController.m in Sources */,
30023024
4E8765681A22E5B40090CFB9 /* SWTableViewCell.m in Sources */,
3025+
4EBB624D1A6F526C0045DAEF /* NJKWebViewProgressView.m in Sources */,
30033026
4ECE8ADA1A3943E80021E29C /* NSDate+Common.m in Sources */,
30043027
8EA6D20A19E240C40076D59C /* RDVTabBar.m in Sources */,
30053028
8E1C3DF019E7D58A00EF3032 /* DistancePickerView.m in Sources */,
@@ -3151,6 +3174,7 @@
31513174
4ECE8ADE1A3943E80021E29C /* NSString+Common.m in Sources */,
31523175
4ECE8B081A3947300021E29C /* BasicPreviewItem.m in Sources */,
31533176
4EA7F15A1A6D192B00A046BD /* SDImageCache.m in Sources */,
3177+
4EBB624C1A6F526C0045DAEF /* NJKWebViewProgress.m in Sources */,
31543178
8EA6D13C19E240C40076D59C /* Tweet_RootViewController.m in Sources */,
31553179
4ECE8B051A3946C10021E29C /* WebContentManager.m in Sources */,
31563180
8EA6D1F819E240C40076D59C /* MJPhotoBrowser.m in Sources */,

Coding_iOS/Controllers/Login/RegisterViewController.m

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@
1414
#import "Coding_NetAPIManager.h"
1515
#import "AppDelegate.h"
1616
#import "UIUnderlinedButton.h"
17-
18-
#import "StartImagesManager.h"
19-
#import <NYXImagesKit/NYXImagesKit.h>
20-
#import <UIImage+BlurredFrame/UIImage+BlurredFrame.h>
2117
#import "TPKeyboardAvoidingTableView.h"
22-
18+
#import "WebViewController.h"
2319

2420
@interface RegisterViewController ()<UITableViewDataSource, UITableViewDelegate>
2521
@property (assign, nonatomic) BOOL captchaNeeded;
@@ -59,30 +55,6 @@ - (void)loadView{
5955
self.myTableView.tableHeaderView = [self customHeaderView];
6056
}
6157

62-
- (UIImageView *)bgBlurredView{
63-
if (!_bgBlurredView) {
64-
//背景图片
65-
UIImageView *bgView = [[UIImageView alloc] initWithFrame:kScreen_Bounds];
66-
bgView.contentMode = UIViewContentModeScaleAspectFill;
67-
UIImage *bgImage = [[StartImagesManager shareManager] curImage].image;
68-
69-
CGSize bgImageSize = bgImage.size, bgViewSize = [bgView doubleSizeOfFrame];
70-
if (bgImageSize.width > bgViewSize.width && bgImageSize.height > bgViewSize.height) {
71-
bgImage = [bgImage scaleToSize:[bgView doubleSizeOfFrame] usingMode:NYXResizeModeAspectFill];
72-
}
73-
bgImage = [bgImage applyLightEffectAtFrame:CGRectMake(0, 0, bgImage.size.width, bgImage.size.height)];
74-
bgView.image = bgImage;
75-
//黑色遮罩
76-
UIColor *blackColor = [UIColor blackColor];
77-
[bgView addGradientLayerWithColors:@[(id)[blackColor colorWithAlphaComponent:0.3].CGColor,
78-
(id)[blackColor colorWithAlphaComponent:0.3].CGColor]
79-
locations:nil
80-
startPoint:CGPointMake(0.5, 0.0) endPoint:CGPointMake(0.5, 1.0)];
81-
_bgBlurredView = bgView;
82-
}
83-
return _bgBlurredView;
84-
}
85-
8658
- (void)refreshCaptchaNeeded{
8759
__weak typeof(self) weakSelf = self;
8860
[[Coding_NetAPIManager sharedManager] request_CaptchaNeededWithPath:@"api/captcha/register" andBlock:^(id data, NSError *error) {
@@ -187,13 +159,13 @@ - (UIView *)customFooterView{
187159
_registerBtn = [UIButton buttonWithStyle:StrapSuccessStyle andTitle:@"立即体验" andFrame:CGRectMake(18, 20, kScreen_Width-18*2, 45) target:self action:@selector(sendRegister)];
188160
[footerV addSubview:_registerBtn];
189161

190-
// UIUnderlinedButton *activateBtn = [UIUnderlinedButton buttonWithTitle:@"已经注册?重发激活邮件" andFont:[UIFont systemFontOfSize:14] andColor:[UIColor colorWithHexString:@"0x3bbd79"]];
191-
// CGRect frame = activateBtn.frame;
192-
// frame.origin.y = CGRectGetMaxY(_registerBtn.frame) +12;
193-
// frame.origin.x = (kScreen_Width -frame.size.width)/2;
194-
// activateBtn.frame = frame;
195-
// [activateBtn addTarget:self action:@selector(reActivate) forControlEvents:UIControlEventTouchUpInside];
196-
// [footerV addSubview:activateBtn];
162+
UIUnderlinedButton *lineBtn = [UIUnderlinedButton buttonWithTitle:@"服务条款" andFont:[UIFont systemFontOfSize:14] andColor:[UIColor colorWithHexString:@"0x3bbd79"]];
163+
CGRect frame = lineBtn.frame;
164+
frame.origin.y = CGRectGetMaxY(_registerBtn.frame) +12;
165+
frame.origin.x = (kScreen_Width -frame.size.width)/2;
166+
lineBtn.frame = frame;
167+
[lineBtn addTarget:self action:@selector(lineBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
168+
[footerV addSubview:lineBtn];
197169

198170

199171
RAC(self, registerBtn.enabled) = [RACSignal combineLatest:@[RACObserve(self, myRegister.email), RACObserve(self, myRegister.global_key), RACObserve(self, myRegister.j_captcha), RACObserve(self, captchaNeeded)] reduce:^id(NSString *email, NSString *global_key, NSString *j_captcha, NSNumber *captchaNeeded){
@@ -237,8 +209,10 @@ - (void)sendRegister{
237209
}];
238210
}
239211

240-
- (void)reActivate{
241-
DebugLog(@"reActivate");
212+
- (void)lineBtnClicked:(id)sender{
213+
NSString *pathForServiceterms = [[NSBundle mainBundle] pathForResource:@"service_terms" ofType:@"html"];
214+
WebViewController *vc = [WebViewController webVCWithUrlStr:pathForServiceterms];
215+
[self.navigationController pushViewController:vc animated:YES];
242216
}
243217

244218

Coding_iOS/Controllers/WebViewController.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88

99
#import "WebViewController.h"
10-
#import <NJKWebViewProgress/NJKWebViewProgress.h>
11-
#import <NJKWebViewProgress/NJKWebViewProgressView.h>
10+
#import "NJKWebViewProgress.h"
11+
#import "NJKWebViewProgressView.h"
1212

1313
@interface WebViewController ()<NJKWebViewProgressDelegate, UIWebViewDelegate>
1414
@property (strong, nonatomic) UIWebView *myWebView;
@@ -163,11 +163,11 @@ - (BOOL)canAndGoOutWithLinkStr:(NSString *)linkStr{
163163
#pragma M Data
164164
- (void)loadCurUrl{
165165
NSURL *curUrl;
166-
if (![self.curUrlStr hasPrefix:@"/"]) {
166+
// if (![self.curUrlStr hasPrefix:@"/"]) {
167167
curUrl = [NSURL URLWithString:self.curUrlStr];
168-
}else{
169-
curUrl = [NSURL URLWithString:self.curUrlStr relativeToURL:[NSURL URLWithString:kNetPath_Code_Base]];
170-
}
168+
// }else{
169+
// curUrl = [NSURL URLWithString:self.curUrlStr relativeToURL:[NSURL URLWithString:kNetPath_Code_Base]];
170+
// }
171171

172172
NSURLRequest *request =[NSURLRequest requestWithURL:curUrl];
173173
[_myWebView loadRequest:request];

0 commit comments

Comments
 (0)