|
@@ -0,0 +1,152 @@
|
|
|
+//
|
|
|
+// AS_ForgotC.m
|
|
|
+// Asteria
|
|
|
+//
|
|
|
+// Created by 王猛 on 2023/5/22.
|
|
|
+//
|
|
|
+
|
|
|
+#import "AS_ForgotC.h"
|
|
|
+#import "EamilTFmatchV.h"
|
|
|
+
|
|
|
+
|
|
|
+@interface AS_ForgotC ()
|
|
|
+@property (nonatomic, strong) UIScrollView *scrollview;
|
|
|
+@property (nonatomic, strong) EamilTFmatchV *xxx_emailTFV;
|
|
|
+@property (nonatomic, strong) UIButton *xxx_sureBtn;
|
|
|
+
|
|
|
+@end
|
|
|
+
|
|
|
+@implementation AS_ForgotC
|
|
|
+
|
|
|
+- (void)viewDidLoad {
|
|
|
+ [super viewDidLoad];
|
|
|
+ // Do any additional setup after loading the view.
|
|
|
+ self.customNavBar.hidden = YES;
|
|
|
+ self.navigationController.navigationBar.hidden = YES;
|
|
|
+}
|
|
|
+- (void)initSubviews{
|
|
|
+ [super initSubviews];
|
|
|
+ [self.view addSubview:self.scrollview];
|
|
|
+ UIView *topNavV = [self logNavView];
|
|
|
+ [self.scrollview addSubview:topNavV];
|
|
|
+
|
|
|
+ UILabel *titileLab = [UILabel new];
|
|
|
+ titileLab.text = @"RETRIEVE YOUR PASSWORD";
|
|
|
+ titileLab.font = [UIFont boldSystemFontOfSize:16];
|
|
|
+ titileLab.textAlignment = NSTextAlignmentCenter;
|
|
|
+ titileLab.textColor = [UIColor colorWithHexString:@"#000000"];
|
|
|
+ [self.scrollview addSubview:titileLab];
|
|
|
+ titileLab.frame = CGRectMake(20, CGRectGetMaxY(topNavV.frame)+50, KScreenWidth-40, 20);
|
|
|
+
|
|
|
+ YYLabel *detailLab = [YYLabel new];
|
|
|
+ detailLab.text = @"If You Forgotten Your Password, Please Enter Your Registered Email Address.\n\n\n You’ll Receive A Link To Reset Your Password.";
|
|
|
+ detailLab.textAlignment = NSTextAlignmentCenter;
|
|
|
+ detailLab.font = [UIFont systemFontOfSize:14];
|
|
|
+ detailLab.numberOfLines = 0;
|
|
|
+ [self.scrollview addSubview:detailLab];
|
|
|
+ detailLab.frame = CGRectMake(36, CGRectGetMaxY(titileLab.frame)+15, KScreenWidth-72, 100);
|
|
|
+
|
|
|
+ [self.scrollview addSubview:self.xxx_emailTFV];
|
|
|
+ self.xxx_emailTFV.mj_y = detailLab.maxY+20;
|
|
|
+
|
|
|
+ [self.scrollview addSubview:self.xxx_sureBtn];
|
|
|
+ self.xxx_sureBtn.mj_y = self.xxx_emailTFV.maxY+30;
|
|
|
+
|
|
|
+ [self.scrollview bringSubviewToFront:self.xxx_emailTFV];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+ #pragma mark - **************** handle ****************
|
|
|
+-(void)handle_closeEvent{
|
|
|
+ [self.navigationController popViewControllerAnimated:YES];
|
|
|
+
|
|
|
+}
|
|
|
+-(void)action_submitClick:(UIButton *)btn{
|
|
|
+ if (![Current_normalTool xxx_isValidateEmail:self.xxx_emailTFV.xxx_emailTF.text]) {
|
|
|
+ [self.view makeToast:@"Please prvide an email address." duration:2 position:CSToastPositionCenter];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ [self reqNet_forgotPassWord];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+-(void)reqNet_forgotPassWord{
|
|
|
+ NSString *url = [NSString stringWithFormat:@"%@%@",Formal_Server,@"login/forgotPassword"];
|
|
|
+ NSMutableDictionary *paraDic = [NSMutableDictionary dictionary];
|
|
|
+ [paraDic setObject:self.xxx_emailTFV.xxx_emailTF.text forKey:@"email"];
|
|
|
+ [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
+ [PPNetworkHelper POST:url
|
|
|
+ parameters:paraDic
|
|
|
+ success:^(id responseObject) {
|
|
|
+ [MBProgressHUD hideHUDForView:self.view animated:YES];
|
|
|
+ if (RequestSuccess) {
|
|
|
+ [FTT_Helper CreateTitle:[NSString stringWithFormat:@"If there is an account associated %@ you will receive an email with a link to reset your password.",self.xxx_emailTFV.xxx_emailTF.text] message:nil Sure:@"Sure" preferredStyle:UIAlertControllerStyleAlert action:^{
|
|
|
+ [self handle_closeEvent];
|
|
|
+ } ViewController:self];
|
|
|
+ }else{
|
|
|
+ [self.view makeToast:RequestErrorMsg duration:2 position:CSToastPositionCenter];
|
|
|
+ }
|
|
|
+ } failure:^(NSError *error) {
|
|
|
+ [MBProgressHUD hideHUDForView:self.view animated:YES];
|
|
|
+ [self.view makeToast:ReqNetWorkFaild duration:2 position:CSToastPositionCenter];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+-(UIView *)logNavView{
|
|
|
+ IPhoneXHeigh
|
|
|
+ UIView *topView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, securitytop_Y)];
|
|
|
+ UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ [closeBtn setImage:[UIImage imageNamed:@"common_close"] forState:UIControlStateNormal];
|
|
|
+ [closeBtn addTarget:self action:@selector(handle_closeEvent) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ closeBtn.frame = CGRectMake(20, 44, 44, 44);
|
|
|
+ [topView addSubview:closeBtn];
|
|
|
+ UIImageView *headImg = [[UIImageView alloc]init];
|
|
|
+ UIImage *bannerImg = [UIImage imageNamed:@"common_headLogo"];
|
|
|
+ headImg.image = bannerImg ;
|
|
|
+ headImg.frame = CGRectMake((KScreenWidth- bannerImg.size.width)/2, 20 , bannerImg.size.width, bannerImg.size.height);
|
|
|
+ [topView addSubview:headImg];
|
|
|
+ closeBtn.centerY = topView.centerY;
|
|
|
+ headImg.centerY = topView.centerY;
|
|
|
+ return topView;
|
|
|
+}
|
|
|
+
|
|
|
+-(EamilTFmatchV *)xxx_emailTFV{
|
|
|
+ if (!_xxx_emailTFV) {
|
|
|
+ _xxx_emailTFV = [[EamilTFmatchV alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 50)];
|
|
|
+ _xxx_emailTFV.xxx_emailTF.placeholder = @"* Email Address";
|
|
|
+ }
|
|
|
+ return _xxx_emailTFV;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+-(UIButton *)xxx_sureBtn{
|
|
|
+ if (!_xxx_sureBtn) {
|
|
|
+ _xxx_sureBtn = [TT_ControlTool FTT_ControlToolUIButtonFrame:CGRectMake(20,0 ,KScreenWidth-40,50)
|
|
|
+ taeget:self
|
|
|
+ sel:@selector(action_submitClick:)
|
|
|
+ tag:0
|
|
|
+ AntTitle:@"SUBMIT"
|
|
|
+ titleFont:17
|
|
|
+ titleColor:[UIColor whiteColor]
|
|
|
+ andImage:nil
|
|
|
+ AndBackColor:nil
|
|
|
+ adjustsFontSizesTowidth:NO
|
|
|
+ masksToBounds:YES
|
|
|
+ conrenRadius:5
|
|
|
+ BorderColor:nil
|
|
|
+ BorderWidth:0
|
|
|
+ ContentHorizontalAligment:0];
|
|
|
+ _xxx_sureBtn.backgroundColor = ThemeColor;
|
|
|
+ }
|
|
|
+ return _xxx_sureBtn;
|
|
|
+}
|
|
|
+- (UIScrollView *)scrollview {
|
|
|
+ if (!_scrollview) {
|
|
|
+ _scrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
|
|
+ }
|
|
|
+ return _scrollview;
|
|
|
+}
|
|
|
+
|
|
|
+@end
|