This commit is contained in:
lianxiang
2018-09-07 20:07:55 +08:00
parent 0f09748cc8
commit dc959b8ec0
59 changed files with 758 additions and 152 deletions
@@ -14,6 +14,7 @@
#import "GiGaNetManager.h"
#import "MBProgressHUD.h"
#import "GiGaAttributedLabel.h"
#import "UINavigationBar+Custom.h"
@interface GiGaRegistViewController ()<TTTAttributedLabelDelegate>
@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField;
@@ -42,14 +43,32 @@
[self.sendCodeBtn addTarget:self action:@selector(sendCodeBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self.registBtn addTarget:self action:@selector(registBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self.checkBtn addTarget:self action:@selector(checkBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self resetBackimg];
}
-(void)resetBackimg{
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 40, 40);
[backBtn setImage:[UIImage imageNamed:@"nav_redback"] forState:UIControlStateNormal];
[backBtn setImageEdgeInsets:UIEdgeInsetsMake(0,-14, 0, 14)];
//backBtn.backgroundColor = [UIColor redColor];
[backBtn addTarget:self action:@selector(backItemAction) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
-(void)backItemAction{
[self.navigationController popViewControllerAnimated:YES];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar setClearNav];
}
-(void)dealloc{
if (_timer) {
[_timer unfireTimer];
@@ -114,8 +133,8 @@
-(void)confirmUI{
self.useragreementLabel.highlightedTextColor = [UIColor lightGrayColor];
self.useragreementLabel.textColor = GIGAUIColorFromRGBA(0x919191);
self.useragreementLabel.highlightedTextColor = GIGARGB(219, 23, 37, 1);
self.useragreementLabel.textColor = GIGARGB(145,145,145, 1);
self.useragreementLabel.delegate = self;
self.useragreementLabel.enabledTextCheckingTypes= NSTextCheckingTypePhoneNumber|NSTextCheckingTypeAddress|NSTextCheckingTypeLink;
self.useragreementLabel.linkAttributes = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kCTUnderlineStyleAttributeName];
@@ -130,7 +149,7 @@
[mutableAttributedString addAttribute:(NSString *)kCTFontAttributeName value:(__bridge id)font range:fontRange];
[mutableAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(__bridge id)[[UIColor colorWithRed:0/255.0 green:222/255.0 blue:189/255.0 alpha:1/1.0] CGColor] range:fontRange];
[mutableAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(__bridge id)[GIGARGB(219, 23, 37, 1) CGColor] range:fontRange];
}
return mutableAttributedString;
@@ -72,7 +72,7 @@
<inset key="titleEdgeInsets" minX="-77" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="5" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="发送验证码" image="btn_meaasag">
<color key="titleColor" red="0.60784313725490191" green="0.60784313725490191" blue="0.60784313725490191" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleColor" red="0.80784313725490198" green="0.19607843137254902" blue="0.19607843137254902" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Trq-bz-kQT">
@@ -91,7 +91,7 @@
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hZA-nj-Wmu">
<rect key="frame" x="84" y="437" width="207" height="41"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.70980392156862748" green="0.054901960784313725" blue="0.054901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="41" id="IZZ-Wn-zMh"/>
</constraints>
@@ -139,6 +139,7 @@
PassWordResetVC *passVC= [[PassWordResetVC alloc] init];
[self.navigationController pushViewController:passVC animated:YES];
[self.navigationController.navigationBar setBackgroundImage];
}
@@ -147,7 +148,7 @@
GiGaRegistViewController *registVC = [[GiGaRegistViewController alloc] init];
[self.navigationController pushViewController:registVC animated:YES];
}
#pragma mark 手机号登录
@@ -70,7 +70,7 @@
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<state key="normal" title="忘记密码">
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleColor" red="0.77647058823529413" green="0.062745098039215685" blue="0.062745098039215685" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="forgetPassBtn:" destination="-1" eventType="touchUpInside" id="GR3-Gw-sRB"/>
@@ -78,7 +78,7 @@
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Of-JP-gMR">
<rect key="frame" x="65" y="386" width="245" height="42"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.70980392156862748" green="0.054901960784313725" blue="0.054901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="42" id="apM-nh-gox"/>
</constraints>
@@ -129,7 +129,7 @@
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<state key="normal" title="创建账号">
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleColor" red="0.77647058823529413" green="0.062745098039215685" blue="0.062745098039215685" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
</subviews>
@@ -10,6 +10,8 @@
#import "NJKWebViewProgressView.h"
#import "NJKWebViewProgress.h"
#import "UIView+Toast.h"
#import "GiGaNavTitileView.h"
@interface GiGaWebViewController ()<UIWebViewDelegate,NJKWebViewProgressDelegate>
{
NJKWebViewProgressView *_progressView;
@@ -17,11 +19,12 @@
}
@property (weak, nonatomic) IBOutlet UIWebView *webview;
@property (nonatomic,strong) GiGaNavTitileView *navTitleView;
@end
@implementation GiGaWebViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
@@ -44,9 +47,12 @@
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar addSubview:_progressView];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[_progressView removeFromSuperview];
}
-(void)loadWeb{
@@ -85,9 +91,21 @@
#pragma mark -NJKWebViewProgressDelegate
-(void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress{
[_progressView setProgress:progress animated:YES];
self.title = [_webview stringByEvaluatingJavaScriptFromString:@"document.title"];
NSLog(@"%@",self.title);
NSString * title = [_webview stringByEvaluatingJavaScriptFromString:@"document.title"];
//or
//[self addNavTitile:title];
[self setnavTitle:title];
}
-(void)setnavTitle:(NSString *)title{
if (!_navTitleView) {
_navTitleView = [[GiGaNavTitileView alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];
self.navigationItem.titleView = _navTitleView;
//[_navTitleView setTitleColor:[UIColor yellowColor]];
}
[_navTitleView setTitleStr:title];
}
- (void)webViewDidStartLoad:(UIWebView *)webView{
@@ -24,6 +24,7 @@
@implementation PassWordResetVC
- (void)viewDidLoad {
[super viewDidLoad];
//self.title = @"重置密码";
[self addNavTitile:@"重置密码"];
@@ -31,6 +32,9 @@
_time = 60;
[self.codeSendBtn addTarget:self action:@selector(codeSendBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self.confirmBtn addTarget:self action:@selector(confirmBtnAction:) forControlEvents:UIControlEventTouchUpInside];
}
-(void)confirmUI{
@@ -65,7 +65,7 @@
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w3j-WU-gmW">
<rect key="frame" x="87" y="316" width="200" height="41"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.70980392156862748" green="0.054901960784313725" blue="0.054901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="41" id="q8T-c9-PAl"/>
</constraints>
@@ -92,7 +92,7 @@
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<inset key="titleEdgeInsets" minX="-77" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="发送验证码" image="btn_meaasag">
<color key="titleColor" red="0.60784313725490191" green="0.60784313725490191" blue="0.60784313725490191" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleColor" red="0.80784313725490198" green="0.19607843137254902" blue="0.19607843137254902" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
</subviews>