优化提交
This commit is contained in:
@@ -10,7 +10,12 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXChirldModeViewController : QXBaseViewController
|
||||
/// 0 = 设置1 , 1 = 设置2 ,2 = 退出
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
/// 密码
|
||||
@property (nonatomic,strong)NSString *password;
|
||||
|
||||
@property (nonatomic,assign)BOOL isRoot;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#import "QXChirldModeViewController.h"
|
||||
#import "QXPasswordView.h"
|
||||
#import "QXChirldViewController.h"
|
||||
#import "AppDelegate.h"
|
||||
@interface QXChirldModeViewController ()<QXPasswordViewDelegate>
|
||||
@property (nonatomic,strong)QXPasswordView * passwordView;
|
||||
@end
|
||||
@@ -27,7 +29,12 @@
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.passwordView = [[QXPasswordView alloc] init];
|
||||
self.passwordView.type = QXPasswordViewTypeChirldMode;
|
||||
if (self.type == 1) {
|
||||
self.passwordView.type = QXPasswordViewTypeChirldModeTwice;
|
||||
}else{
|
||||
self.passwordView.type = QXPasswordViewTypeChirldMode;
|
||||
}
|
||||
|
||||
self.passwordView.delegate = self;
|
||||
[self.view addSubview:self.passwordView];
|
||||
[self.passwordView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -38,7 +45,35 @@
|
||||
}
|
||||
|
||||
-(void)inputFinished:(NSString *)password{
|
||||
|
||||
if (self.type == 0) {
|
||||
QXChirldModeViewController *vc = [[QXChirldModeViewController alloc] init];
|
||||
vc.type = 1;
|
||||
vc.password = password;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else if (self.type == 1) {
|
||||
if ([self.password isEqualToString:password]) {
|
||||
QXChirldViewController *vc = [[QXChirldViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:password forKey:kChirldLocalPassword];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}else{
|
||||
showToast(@"两次密码输入不一致");
|
||||
}
|
||||
}else if (self.type == 2) {
|
||||
NSString *localPassword = [[NSUserDefaults standardUserDefaults] objectForKey:kChirldLocalPassword];
|
||||
if (![localPassword isEqualToString:password]) {
|
||||
showToast(@"密码错误");
|
||||
}else{
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kChirldLocalPassword];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
if (self.isRoot) {
|
||||
AppDelegate *appdelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||
[appdelegate changeRootViewControllerIsTabbar];
|
||||
}else{
|
||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#import <TencentCloudHuiyanSDKFace/WBFaceVerifyCustomerService.h>
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXRealNameFinishedViewController.h"
|
||||
#import "QXAlertView.h"
|
||||
|
||||
@interface QXRealNameViewController ()<WBFaceVerifyCustomerServiceDelegate>
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@@ -259,6 +260,7 @@
|
||||
weakSelf.realNamedict = dict;
|
||||
[weakSelf startFace];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
hideLoadingInView(self.view);
|
||||
showToast(msg);
|
||||
}];
|
||||
|
||||
@@ -305,13 +307,26 @@
|
||||
-(void)wbfaceVerifyCustomerServiceDidFinishedWithFaceVerifyResult:(WBFaceVerifyResult *)faceVerifyResult{
|
||||
if (faceVerifyResult.isSuccess) {
|
||||
QXLOG(@"人脸核验通过");
|
||||
[self authSuccess];
|
||||
MJWeakSelf
|
||||
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
||||
al.type = QXAlertViewTypeNoCancel;
|
||||
al.title = @"温馨提示";
|
||||
al.message = @"恭喜您获得内测资格,将获得10万金币";
|
||||
al.commitBlock = ^{
|
||||
[weakSelf authSuccess];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
|
||||
/// 通知服务端实名验证结果
|
||||
[QXMineNetwork postRealNameResultWithOrderNo:faceVerifyResult.orderNo successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}else{
|
||||
showToast(@"实名认证失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ static NSInteger maxClickCount = 6;
|
||||
-(void)initSubViews{
|
||||
NSArray *section1 = @[
|
||||
// QXText(@"消息通知"),
|
||||
QXText(@"未成年人模式"),
|
||||
// QXText(@"未成年人模式"),
|
||||
QXText(@"黑名单"),
|
||||
QXText(@"设置密码"),
|
||||
QXText(@"手机绑定"),
|
||||
@@ -54,7 +54,7 @@ static NSInteger maxClickCount = 6;
|
||||
];
|
||||
self.cellTypeDict = @{
|
||||
// QXText(@"消息通知"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"未成年人模式"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
// QXText(@"未成年人模式"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"黑名单"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"设置密码"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"手机绑定"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
@@ -67,7 +67,7 @@ static NSInteger maxClickCount = 6;
|
||||
|
||||
self.controllerDict = @{
|
||||
QXText(@"消息通知"):@"QXNoticeSwitchViewController",
|
||||
QXText(@"未成年人模式"):@"QXChirldModeViewController",
|
||||
// QXText(@"未成年人模式"):@"QXChirldModeViewController",
|
||||
QXText(@"黑名单"):@"QXBlackListlViewController",
|
||||
QXText(@"设置密码"):@"QXSetPwdViewController",
|
||||
QXText(@"手机绑定"):@"QXBindMobileViewController",
|
||||
|
||||
Reference in New Issue
Block a user