diff --git a/GIGA.xcodeproj/project.pbxproj b/GIGA.xcodeproj/project.pbxproj index 1ff3679..b7831d7 100644 --- a/GIGA.xcodeproj/project.pbxproj +++ b/GIGA.xcodeproj/project.pbxproj @@ -1338,7 +1338,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = GIGA/GIGA.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = YYP376WR4X; GCC_PREFIX_HEADER = "$(SRCROOT)//GIGA/GIGA.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -1355,8 +1355,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "f3b84b1a-7ac9-46d1-bd63-b997256cf85b"; - PROVISIONING_PROFILE_SPECIFIER = jijiaDevelopmentProfile; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1368,8 +1368,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = GIGA/GIGA.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = YYP376WR4X; GCC_PREFIX_HEADER = "$(SRCROOT)//GIGA/GIGA.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", diff --git a/GIGA/Assets.xcassets/login/btn_meaasag.imageset/Contents.json b/GIGA/Assets.xcassets/login/btn_meaasag.imageset/Contents.json new file mode 100644 index 0000000..c454cc3 --- /dev/null +++ b/GIGA/Assets.xcassets/login/btn_meaasag.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "btn_meaasag@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "btn_meaasag@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/login/btn_meaasag.imageset/btn_meaasag@2x.png b/GIGA/Assets.xcassets/login/btn_meaasag.imageset/btn_meaasag@2x.png new file mode 100644 index 0000000..e809918 Binary files /dev/null and b/GIGA/Assets.xcassets/login/btn_meaasag.imageset/btn_meaasag@2x.png differ diff --git a/GIGA/Assets.xcassets/login/btn_meaasag.imageset/btn_meaasag@3x.png b/GIGA/Assets.xcassets/login/btn_meaasag.imageset/btn_meaasag@3x.png new file mode 100644 index 0000000..55e9d29 Binary files /dev/null and b/GIGA/Assets.xcassets/login/btn_meaasag.imageset/btn_meaasag@3x.png differ diff --git a/GIGA/Assets.xcassets/login/btn_right.imageset/Contents.json b/GIGA/Assets.xcassets/login/btn_right.imageset/Contents.json new file mode 100644 index 0000000..7d0fc11 --- /dev/null +++ b/GIGA/Assets.xcassets/login/btn_right.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "btn_right.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/login/btn_right.imageset/btn_right.png b/GIGA/Assets.xcassets/login/btn_right.imageset/btn_right.png new file mode 100644 index 0000000..bb6384e Binary files /dev/null and b/GIGA/Assets.xcassets/login/btn_right.imageset/btn_right.png differ diff --git a/GIGA/Assets.xcassets/login/btn_turndown.imageset/Contents.json b/GIGA/Assets.xcassets/login/btn_turndown.imageset/Contents.json new file mode 100644 index 0000000..f1a2ace --- /dev/null +++ b/GIGA/Assets.xcassets/login/btn_turndown.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "btn_turndown.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/login/btn_turndown.imageset/btn_turndown.png b/GIGA/Assets.xcassets/login/btn_turndown.imageset/btn_turndown.png new file mode 100644 index 0000000..194482a Binary files /dev/null and b/GIGA/Assets.xcassets/login/btn_turndown.imageset/btn_turndown.png differ diff --git a/GIGA/Assets.xcassets/login/ic_note.imageset/Contents.json b/GIGA/Assets.xcassets/login/ic_note.imageset/Contents.json new file mode 100644 index 0000000..974a725 --- /dev/null +++ b/GIGA/Assets.xcassets/login/ic_note.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "ic_note@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "ic_note@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/login/ic_note.imageset/ic_note@2x.png b/GIGA/Assets.xcassets/login/ic_note.imageset/ic_note@2x.png new file mode 100644 index 0000000..e0537c8 Binary files /dev/null and b/GIGA/Assets.xcassets/login/ic_note.imageset/ic_note@2x.png differ diff --git a/GIGA/Assets.xcassets/login/ic_note.imageset/ic_note@3x.png b/GIGA/Assets.xcassets/login/ic_note.imageset/ic_note@3x.png new file mode 100644 index 0000000..f3b755d Binary files /dev/null and b/GIGA/Assets.xcassets/login/ic_note.imageset/ic_note@3x.png differ diff --git a/GIGA/Category/UINavigationBar+Custom.m b/GIGA/Category/UINavigationBar+Custom.m index b116ef3..a5f1ff7 100644 --- a/GIGA/Category/UINavigationBar+Custom.m +++ b/GIGA/Category/UINavigationBar+Custom.m @@ -56,9 +56,9 @@ static char overlayKey; -(void)resetBackgroundImage{ - //[self setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault]; - //[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO]; - + [self setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault]; + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO]; + } diff --git a/GIGA/Common/BaseVC/GiGaBaseNavViewController.m b/GIGA/Common/BaseVC/GiGaBaseNavViewController.m index a44be06..dd23cec 100644 --- a/GIGA/Common/BaseVC/GiGaBaseNavViewController.m +++ b/GIGA/Common/BaseVC/GiGaBaseNavViewController.m @@ -17,6 +17,7 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. + self.interactivePopGestureRecognizer.delegate = (id)self; self.view.backgroundColor = UIColor.whiteColor; } diff --git a/GIGA/Common/BaseVC/GiGaBaseViewController.m b/GIGA/Common/BaseVC/GiGaBaseViewController.m index 01703ba..092599e 100644 --- a/GIGA/Common/BaseVC/GiGaBaseViewController.m +++ b/GIGA/Common/BaseVC/GiGaBaseViewController.m @@ -9,15 +9,11 @@ #import "GiGaBaseViewController.h" #import "UIView+Toast.h" #import "GiGaNavTitileView.h" +#import "UINavigationBar+Custom.h" @interface GiGaBaseViewController () { -// UIColor *navigationBarBGColor; //导航栏背景色 -// UIColor *navigationBarTitleColor; //导航栏标题字色 -// SEL _rightBtnAction; -// SEL _refreshHeaderSelector; -// SEL _refreshFooterSelector; - + } @end @@ -27,8 +23,18 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. - [self.view addSubview:_tableView]; - //[self testNetworkStatus]; + + +} + +-(void)viewWillDisappear:(BOOL)animated{ + [super viewWillDisappear:animated]; + +} + +-(void)viewWillAppear:(BOOL)animated{ + [super viewWillAppear:animated]; + [self.navigationController.navigationBar cnSetBackgroundColor:GIGAUIColorFromRGB_A(0xD8D8D8, 0.2)]; } -(void)addNavTitile:(NSString *)title{ @@ -93,7 +99,6 @@ _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped]; } - return _tableView; } - (void)didReceiveMemoryWarning { diff --git a/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m index e6acebf..a3f6c46 100644 --- a/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m +++ b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m @@ -14,9 +14,9 @@ { if (self = [super initWithFrame:frame]) { UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)]; - label.textColor = [UIColor redColor]; + label.textColor = GIGAUIColorFromRGBA(0x777777); label.text = str; - label.font = [UIFont boldSystemFontOfSize:18.0f]; + label.font = [UIFont fontWithName:@"PingFangSC-Medium" size:18.f]; label.textAlignment = NSTextAlignmentCenter; [self addSubview:label]; } diff --git a/GIGA/Common/GiGaUserDB/GiGaUserDefault.m b/GIGA/Common/GiGaUserDB/GiGaUserDefault.m index fe0c604..09bad0d 100644 --- a/GIGA/Common/GiGaUserDB/GiGaUserDefault.m +++ b/GIGA/Common/GiGaUserDB/GiGaUserDefault.m @@ -86,6 +86,7 @@ NSString *const kGiGaToken = @"GiGatoken"; +(BOOL)isShowedAppGaurd{ BOOL showedGaurd = [UD_STADARDUD boolForKey:kShowAppGuard]; + [UD_STADARDUD synchronize]; return showedGaurd; } diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.h b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.h index 47d9c51..732e239 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.h +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.h @@ -7,7 +7,7 @@ // #import - -@interface GiGaRegistViewController : UIViewController +#import "GiGaBaseViewController.h" +@interface GiGaRegistViewController : GiGaBaseViewController @end diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m index 1b71b98..3c53419 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m @@ -33,13 +33,15 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.title = @"注册"; - _time = 60; + //self.title = @"注册"; + [self addNavTitile:@"注册"]; + _time = 60; // Do any additional setup after loading the view from its nib. [self confirmUI]; [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]; } -(void)dealloc{ @@ -50,6 +52,7 @@ } } + -(void)sendCodeBtnAction:(UIButton *)btn{ if (self.phoneNumberTextField.text == nil) { @@ -74,7 +77,7 @@ if (self->_time==0) { [self.sendCodeBtn setTitle:@"发送短信" forState:UIControlStateNormal]; - [btn setBackgroundColor:GIGAUIColorFromRGBA(0x28b9ff)]; + self->_time =60; btn.userInteractionEnabled = YES; } @@ -106,6 +109,7 @@ -(void)confirmUI{ self.useragreementLabel.highlightedTextColor = [UIColor lightGrayColor]; + self.useragreementLabel.textColor = GIGAUIColorFromRGBA(0x919191); self.useragreementLabel.delegate = self; self.useragreementLabel.enabledTextCheckingTypes= NSTextCheckingTypePhoneNumber|NSTextCheckingTypeAddress|NSTextCheckingTypeLink; self.useragreementLabel.linkAttributes = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kCTUnderlineStyleAttributeName]; @@ -114,13 +118,13 @@ NSString *text = @"已阅读并同意《用户服务协议》"; [self.useragreementLabel setText:text afterInheritingLabelAttributesAndConfiguringWithBlock:^NSMutableAttributedString *(NSMutableAttributedString *mutableAttributedString) { NSRange fontRange = [[mutableAttributedString string] rangeOfString:@"用户服务协议" options:NSCaseInsensitiveSearch]; - UIFont* sysFont = [UIFont systemFontOfSize:15]; + UIFont* sysFont = [UIFont fontWithName:@"PingFangSC-Semibold" size:10.f]; CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)sysFont.fontName, sysFont.pointSize, NULL); if (font) { [mutableAttributedString addAttribute:(NSString *)kCTFontAttributeName value:(__bridge id)font range:fontRange]; - [mutableAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(__bridge id)[[UIColor greenColor] CGColor] 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]; } return mutableAttributedString; @@ -131,6 +135,9 @@ @"SourceName":@"useragreement" } withRange:fontRange]; + self.registBtn.layer.masksToBounds = YES; + self.registBtn.layer.cornerRadius = self.registBtn.frame.size.height / 2; + } #pragma mark - TTTAttributedLabelDelegate @@ -188,10 +195,8 @@ btn.userInteractionEnabled = YES; GILog(@"注册->%@",result.message); if (result.code == 0) { - - NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text); + NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text); - }else if (result.code == GiGAErrorCode_USER_EXIST){ GIGA_ShowToast(@"用户已存在"); NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text); @@ -203,6 +208,21 @@ } +-(void)checkBtnAction:(UIButton *)btn{ + btn.selected = !btn.selected; + if (btn.selected) { + [btn setImage:[UIImage imageNamed:@"btn_turndown"] forState:UIControlStateSelected]; + + [self.registBtn setBackgroundColor:[UIColor lightGrayColor]]; + self.registBtn.userInteractionEnabled = NO; + + }else{ + [btn setImage:[UIImage imageNamed:@"btn_right"] forState:UIControlStateNormal]; + [self.registBtn setBackgroundColor:GIGARGB(0, 222, 189, 1)]; + self.registBtn.userInteractionEnabled = YES; + } +} + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib index fbad89d..60c09be 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib @@ -27,129 +27,136 @@ - - - + + - - + - - + + - + - - + + - + - + - - + + - + - + - - + + - - + + - + - - + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m index 9e185ce..d8059ed 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m @@ -49,9 +49,9 @@ NC_ADD_TARGET_NAME_OBJECT(self, @selector(WeiXinLongIn:), kWeiXinAuthrization_Success, nil) NC_ADD_TARGET_NAME_OBJECT(self, @selector(userRegistSuccsessNoti:), kUserRegistSucccess, nil) - if (![WXApi isWXAppInstalled]) { - self.weiXinLoginBtn.hidden = YES; - } +// if (![WXApi isWXAppInstalled]) { +// self.weiXinLoginBtn.hidden = YES; +// } } @@ -72,7 +72,7 @@ -(void)textFieldUI{ - //self.acountTextField.attributedPlaceholder = @""; + UIView *acountView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; UIImageView *acountViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15,9, 12, 22)]; acountViewIcon.image = [UIImage imageNamed:@"ic_number"]; @@ -83,7 +83,7 @@ // NSAttributedString *passholderText = [[NSAttributedString alloc] initWithString:@"密码" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:[UIColor redColor]}]; // self.passwordTextField.attributedPlaceholder = passholderText; UIView *passView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; - UIImageView *passViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 9, 12, 22)]; + UIImageView *passViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15,8, 12, 22)]; passViewIcon.image = [UIImage imageNamed:@"icon_key"]; [passView addSubview:passViewIcon]; self.passwordTextField.leftView = passView; @@ -91,8 +91,18 @@ self.loginBtn.layer.masksToBounds = YES; self.loginBtn.layer.cornerRadius = self.loginBtn.frame.size.height / 2; - self.weiXinLoginBtn.layer.masksToBounds = YES; - self.weiXinLoginBtn.layer.cornerRadius = self.weiXinLoginBtn.frame.size.height / 2; + NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] init]; + + NSTextAttachment *attch = [[NSTextAttachment alloc] init]; + attch.image = [UIImage imageNamed:@"ic_wechat"]; + attch.bounds = CGRectMake(0,-4, 12.9, 12.5); + NSAttributedString *imastr=[NSAttributedString attributedStringWithAttachment:attch]; + [attri appendAttributedString:imastr]; + + NSAttributedString *titleStr = [[NSAttributedString alloc] initWithString:@" 微信账号登录" attributes:@{NSFontAttributeName:[UIFont fontWithName:@"PingFangSC-Semibold" size:10],NSForegroundColorAttributeName:[UIColor colorWithRed:187/255.0 green:187/255.0 blue:187/255.0 alpha:1/1.0]}]; + + [attri appendAttributedString:titleStr]; + [self.weiXinLoginBtn setAttributedTitle:attri forState:UIControlStateNormal]; } @@ -106,6 +116,21 @@ [super viewWillAppear:animated]; [self.navigationController.navigationBar setClearNav]; } + +-(void)viewDidAppear:(BOOL)animated{ + [super viewDidAppear:animated]; + if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { + self.navigationController.interactivePopGestureRecognizer.enabled = NO; + } +} + +-(void)viewWillDisappear:(BOOL)animated{ + [super viewWillDisappear:animated]; + if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { + self.navigationController.interactivePopGestureRecognizer.enabled = YES; + } +} + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; @@ -172,7 +197,6 @@ // }]; [self.view makeToastActivity:CSToastPositionCenter]; - NSString *url = [NSString stringWithFormat:@"%@sys/v1/login",[GiGaServerConfig getMainUrl]]; [GiGaNetManager userLoginrequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) { GILog(@"%@",resDic); @@ -181,6 +205,7 @@ GILog(@"**登陆***\n code:%ld\n message:%@\n *******\n",result.code,result.message); if (result.success) { + //token [GiGaUserDefault saveToken:resDic[@"token"]]; //埋点 [MobClick endEvent:MobClick_UserLogin]; @@ -189,6 +214,8 @@ GIGA_WIndowTost(@"登录成功!"); [self dismissViewControllerAnimated:YES completion:nil]; + }else{ + GIGA_ShowToast(result.message); } }]; diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib index 26dc3d1..d59e598 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib @@ -21,7 +21,6 @@ - @@ -41,7 +40,7 @@ - + @@ -50,7 +49,7 @@ - + @@ -73,8 +72,8 @@ - - + + @@ -87,33 +86,14 @@ - - - - - - - - + + - @@ -146,20 +145,19 @@ - - + - + + - @@ -168,7 +166,6 @@ - diff --git a/GIGA/Modules/LogIn/Controller/PassWordResetVC.h b/GIGA/Modules/LogIn/Controller/PassWordResetVC.h index ad0579d..7027f0a 100644 --- a/GIGA/Modules/LogIn/Controller/PassWordResetVC.h +++ b/GIGA/Modules/LogIn/Controller/PassWordResetVC.h @@ -7,7 +7,7 @@ // #import - -@interface PassWordResetVC : UIViewController +#import "GiGaBaseViewController.h" +@interface PassWordResetVC : GiGaBaseViewController @end diff --git a/GIGA/Modules/LogIn/Controller/PassWordResetVC.m b/GIGA/Modules/LogIn/Controller/PassWordResetVC.m index f714860..a05f9a3 100644 --- a/GIGA/Modules/LogIn/Controller/PassWordResetVC.m +++ b/GIGA/Modules/LogIn/Controller/PassWordResetVC.m @@ -7,6 +7,8 @@ // #import "PassWordResetVC.h" +#import "NSTimer+Convenience.h" +#import "GiGaBaseAPiRequest.h" @interface PassWordResetVC () @property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField; @@ -15,64 +17,170 @@ @property (weak, nonatomic) IBOutlet UITextField *passNewTextField; @property (weak, nonatomic) IBOutlet UIButton *confirmBtn; - +@property(nonatomic,strong) NSTimer*timer; +@property(nonatomic) NSInteger time; @end @implementation PassWordResetVC - (void)viewDidLoad { [super viewDidLoad]; - self.title = @"重置密码"; - // Do any additional setup after loading the view from its nib. + //self.title = @"重置密码"; + [self addNavTitile:@"重置密码"]; [self confirmUI]; + _time = 60; + [self.codeSendBtn addTarget:self action:@selector(codeSendBtnAction:) forControlEvents:UIControlEventTouchUpInside]; + [self.confirmBtn addTarget:self action:@selector(confirmBtnAction:) forControlEvents:UIControlEventTouchUpInside]; } -(void)confirmUI{ UIView *phoneView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; - phoneView.backgroundColor = [UIColor redColor]; - UIImageView *phoneIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, 16, 18)]; - phoneIcon.image = [UIImage imageNamed:@""]; + + UIImageView *phoneIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 9, 12, 22)]; + phoneIcon.image = [UIImage imageNamed:@"ic_number"]; [phoneView addSubview:phoneIcon]; self.phoneNumberTextField.leftView = phoneView; self.phoneNumberTextField.leftViewMode = UITextFieldViewModeAlways; UIView *codeView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; - codeView.backgroundColor = [UIColor redColor]; - UIImageView *codeIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, 16, 18)]; - codeIcon.image = [UIImage imageNamed:@""]; + + UIImageView *codeIcon = [[UIImageView alloc] initWithFrame:CGRectMake(11,13.5, 18, 13)]; + codeIcon.image = [UIImage imageNamed:@"ic_note"]; [codeView addSubview:codeIcon]; self.codeTextField.leftView = codeView; self.codeTextField.leftViewMode = UITextFieldViewModeAlways; - [self.passNewTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKey:@"_placeholderLabel.textColor"]; + UIView *passView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; - passView.backgroundColor = [UIColor redColor]; - UIImageView *passIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, 16, 18)]; - passIcon.image = [UIImage imageNamed:@""]; + UIImageView *passIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15,10, 12, 22)]; + passIcon.image = [UIImage imageNamed:@"icon_key"]; [passView addSubview:passIcon]; self.passNewTextField.leftView = passView; self.passNewTextField.leftViewMode = UITextFieldViewModeAlways; - self.confirmBtn.layer.masksToBounds = YES; self.confirmBtn.layer.cornerRadius = self.confirmBtn.frame.size.height / 2; } +#pragma mark - 发送短信 +//短信发送 +-(void)codeSendBtnAction:(UIButton *)btn{ + if (self.phoneNumberTextField.text.length == 0) { + GIGA_ShowToast(@"请输入手机号"); + return; + } + if (![GiGaHelper isPhoneNumber:self.phoneNumberTextField.text]) { + GIGA_ShowToast(@"请输入正确手机号"); + return; + } + btn.userInteractionEnabled = NO; + + [self startTimer:btn]; + [self requstCode:btn]; +} +//计时 +-(void)startTimer:(UIButton *)btn{ + + if (_time>0) { + _timer = [NSTimer scheduledTimerWithTimeInterval:1 count:60 callback:^{ + NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)self->_time]; + [btn setTitle:timeStr forState:UIControlStateNormal]; + self->_time--; + + if (self->_time==0) { + [self.codeSendBtn setTitle:@"发送验证码" forState:UIControlStateNormal]; + self->_time =60; + btn.userInteractionEnabled = YES; + } + + }]; + [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes]; + } +} + +//获取验证码请求 +-(void)requstCode:(UIButton *)btn{ + + if (self.phoneNumberTextField.text.length == 0) { + GIGA_ShowToast(@"请输入手机号"); + return; + } + if (![GiGaHelper isPhoneNumber:self.phoneNumberTextField.text]) { + GIGA_ShowToast(@"请输入正确手机号"); + return; + } + + [self.view makeToastActivity:CSToastPositionCenter]; + NSDictionary *params = @{@"mobile":self.phoneNumberTextField.text}; + GiGaBaseAPiRequest *requst = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/retrievesendcode" method:RequestPostMethod parms:params]; + [requst requstDataWithResult:^(GiGaAPIResult *result) { + btn.userInteractionEnabled = YES; + [self.view hideToastActivity]; + GIGA_ShowToast(result.message); + + }]; + +} + +#pragma mark - 确认 +-(void)confirmBtnAction:(UIButton *)btn{ + + if (self.phoneNumberTextField.text.length == 0) { + GIGA_ShowToast(@"请输入手机号"); + return; + } + if (![GiGaHelper isPhoneNumber:self.phoneNumberTextField.text]) { + GIGA_ShowToast(@"请输入正确手机号"); + return; + } + + if (self.codeTextField.text.length == 0) { + GIGA_ShowToast(@"请输入验证码"); + return; + } + + if (self.passNewTextField.text.length == 0) { + GIGA_ShowToast(@"请输入新密码"); + return; + } + if (!(self.passNewTextField.text.length >= 6 && self.passNewTextField.text.length <= 20)) { + GIGA_ShowToast(@"请输入6~20位新密码"); + return; + } + btn.userInteractionEnabled = NO; + [self.view makeToastActivity:CSToastPositionCenter]; + NSDictionary *params = @{ + @"username":self.phoneNumberTextField.text, + @"password":self.passNewTextField.text, + @"verifiedCode":self.codeTextField.text + + }; + GiGaBaseAPiRequest *requst = [GiGaBaseAPiRequest initWithRequestPath:@"sys/v1/retrievepwd" method:RequestPostMethod parms:params]; + [requst requstDataWithResult:^(GiGaAPIResult *result) { + [self.view hideToastActivity]; + btn.userInteractionEnabled = YES; + if (result.success) { + GIGA_WIndowTost(result.message); + [self.navigationController popViewControllerAnimated:YES]; + } + + }]; +} + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. +-(void)dealloc{ + if (_timer) { + [_timer unfireTimer]; + [_timer invalidate]; + _timer = nil; + + } } -*/ @end diff --git a/GIGA/Modules/LogIn/Controller/PassWordResetVC.xib b/GIGA/Modules/LogIn/Controller/PassWordResetVC.xib index 237a769..3d6f52a 100644 --- a/GIGA/Modules/LogIn/Controller/PassWordResetVC.xib +++ b/GIGA/Modules/LogIn/Controller/PassWordResetVC.xib @@ -25,103 +25,107 @@ - + - + - - + + - - + + - + - + - + - - + + - - + + - + - - + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Mask/Controller/GiGaAppGaurdVC.m b/GIGA/Modules/Mask/Controller/GiGaAppGaurdVC.m index 9a0c049..0e0f39f 100644 --- a/GIGA/Modules/Mask/Controller/GiGaAppGaurdVC.m +++ b/GIGA/Modules/Mask/Controller/GiGaAppGaurdVC.m @@ -39,7 +39,6 @@ make.centerX.mas_equalTo(self.view.mas_centerX); make.top.mas_equalTo(self.view.mas_top).offset(200); }]; - dismisBtn.layer.masksToBounds = YES; dismisBtn.layer.cornerRadius = 15; @@ -47,7 +46,6 @@ -(void)dismisBtnAction{ - [self dismissViewControllerAnimated:YES completion:^{ NC_POST_NAME_OBJECT(APP_GUARD_DISSMISS, nil); }]; @@ -58,14 +56,4 @@ // Dispose of any resources that can be recreated. } -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ - @end diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m index d100cbd..6879e2e 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m @@ -35,10 +35,10 @@ //@property (nonatomic,strong) GiGaFlyingCommitInputView *commitInputView; @property(nonatomic,strong) UIImageView *maskImageView; @property(nonatomic,strong) UIImageView *faceView; -@property(nonatomic,strong) UIDynamicAnimator *animator; -@property(nonatomic,strong) UIAttachmentBehavior *attachmentBehavior; +//@property(nonatomic,strong) UIDynamicAnimator *animator; +//@property(nonatomic,strong) UIAttachmentBehavior *attachmentBehavior; @property(nonatomic) CGPoint attachPoint; -@property(nonatomic) UISnapBehavior *snapBehavior; +//@property(nonatomic) UISnapBehavior *snapBehavior; @end @@ -167,11 +167,31 @@ -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; + +} + +-(void)viewDidAppear:(BOOL)animated{ + [super viewDidAppear:animated]; + if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { + self.navigationController.interactivePopGestureRecognizer.enabled = NO; + } + + BOOL showAppGaurd = [GiGaUserDefault isShowedAppGaurd]; + if (showAppGaurd == NO) { + [self showAPPappGaurdView]; + } +} +-(void)viewWillDisappear:(BOOL)animated{ + [super viewWillDisappear:animated]; + if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { + self.navigationController.interactivePopGestureRecognizer.enabled = YES; + } } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. + [self setUpNav]; [self initUI]; [self addNotify]; @@ -185,7 +205,7 @@ [self.view bringSubviewToFront:self.maskImageView]; [self.view addSubview:self.countLabel]; - self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; + //self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; //face [self.faceView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -361,7 +381,6 @@ if (isUserLogin) { - //GIGA_ShowToast(@"userLogin!"); GiGaQuestionVC *questionVC = [[GiGaQuestionVC alloc] init]; [self.navigationController pushViewController:questionVC animated:YES]; @@ -372,15 +391,7 @@ } } --(void)viewDidAppear:(BOOL)animated{ - [super viewDidAppear:animated]; - - BOOL showAppGaurd = [GiGaUserDefault isShowedAppGaurd]; - - if (!showAppGaurd) { - [self showAPPappGaurdView]; - } -} + -(void)addNotify{ @@ -405,7 +416,7 @@ -(void)appGauardViewDissmiss{ //出现新手引导 BOOL isshowGaurd = [GiGaUserDefault isShowedGaurd]; - if (!isshowGaurd) { + if (isshowGaurd == NO) { NSLog(@"%d",(int)isshowGaurd ); [self showUserGaurdView]; } @@ -434,6 +445,7 @@ #pragma mark App引导页 -(void)showAPPappGaurdView{ + GiGaAppGaurdVC *gaurdVC = [[GiGaAppGaurdVC alloc] init]; [self presentViewController:gaurdVC animated:YES completion:nil]; }