设置登录密码-消息模块需要使用
This commit is contained in:
@@ -698,6 +698,8 @@
|
||||
E8DEC9AC2764A6CD0078CB70 /* XPRoomMoreMenuCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8DEC9AB2764A6CD0078CB70 /* XPRoomMoreMenuCollectionViewCell.m */; };
|
||||
E8E20BDB281645300033B688 /* SessionInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BDA281645300033B688 /* SessionInfoViewController.m */; };
|
||||
E8E20BDE28164D3A0033B688 /* SessionNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BDD28164D3A0033B688 /* SessionNavView.m */; };
|
||||
E8E20BE2281695800033B688 /* XPMineLoginPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BE1281695800033B688 /* XPMineLoginPasswordViewController.m */; };
|
||||
E8E20BE828169BDC0033B688 /* XPMineLoginPasswordPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BE728169BDC0033B688 /* XPMineLoginPasswordPresenter.m */; };
|
||||
E8E5E18B27C332EE00F457D8 /* XPHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E18A27C332EE00F457D8 /* XPHomeViewController.m */; };
|
||||
E8E5E18E27C3331E00F457D8 /* XPHomeRecommendViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E18D27C3331E00F457D8 /* XPHomeRecommendViewController.m */; };
|
||||
E8E5E19127C369F000F457D8 /* XPHomeRecommendListView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19027C369F000F457D8 /* XPHomeRecommendListView.m */; };
|
||||
@@ -2140,6 +2142,11 @@
|
||||
E8E20BDA281645300033B688 /* SessionInfoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SessionInfoViewController.m; sourceTree = "<group>"; };
|
||||
E8E20BDC28164D3A0033B688 /* SessionNavView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionNavView.h; sourceTree = "<group>"; };
|
||||
E8E20BDD28164D3A0033B688 /* SessionNavView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SessionNavView.m; sourceTree = "<group>"; };
|
||||
E8E20BE0281695800033B688 /* XPMineLoginPasswordViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineLoginPasswordViewController.h; sourceTree = "<group>"; };
|
||||
E8E20BE1281695800033B688 /* XPMineLoginPasswordViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineLoginPasswordViewController.m; sourceTree = "<group>"; };
|
||||
E8E20BE628169BDC0033B688 /* XPMineLoginPasswordPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineLoginPasswordPresenter.h; sourceTree = "<group>"; };
|
||||
E8E20BE728169BDC0033B688 /* XPMineLoginPasswordPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineLoginPasswordPresenter.m; sourceTree = "<group>"; };
|
||||
E8E20BE928169E410033B688 /* XPMineLoginPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineLoginPasswordProtocol.h; sourceTree = "<group>"; };
|
||||
E8E5E18927C332EE00F457D8 /* XPHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeViewController.h; sourceTree = "<group>"; };
|
||||
E8E5E18A27C332EE00F457D8 /* XPHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeViewController.m; sourceTree = "<group>"; };
|
||||
E8E5E18C27C3331E00F457D8 /* XPHomeRecommendViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendViewController.h; sourceTree = "<group>"; };
|
||||
@@ -5823,6 +5830,31 @@
|
||||
path = Cell;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E8E20BDF281695430033B688 /* Setting */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8AC721126F46ADD007D6E91 /* XPMineSettingViewController.h */,
|
||||
E8AC721226F46ADD007D6E91 /* XPMineSettingViewController.m */,
|
||||
E8AC721F26F47E23007D6E91 /* XPMineAboutUsViewController.h */,
|
||||
E8AC722026F47E23007D6E91 /* XPMineAboutUsViewController.m */,
|
||||
E8AC722226F47E5E007D6E91 /* XPMineFeedbackViewController.h */,
|
||||
E8AC722326F47E5E007D6E91 /* XPMineFeedbackViewController.m */,
|
||||
E8AC722A26F49580007D6E91 /* XPMineNotificaViewController.h */,
|
||||
E8AC722B26F49580007D6E91 /* XPMineNotificaViewController.m */,
|
||||
E824543E26F58F9400BE8163 /* XPMinePayPwdViewController.h */,
|
||||
E824543F26F58F9400BE8163 /* XPMinePayPwdViewController.m */,
|
||||
E824544926F5BBB800BE8163 /* XPMineModifPayPwdViewController.h */,
|
||||
E824544A26F5BBB800BE8163 /* XPMineModifPayPwdViewController.m */,
|
||||
E824545426F5E51900BE8163 /* XPMineVerifIdentityViewController.h */,
|
||||
E824545526F5E51900BE8163 /* XPMineVerifIdentityViewController.m */,
|
||||
E824545F26F5F4E400BE8163 /* XPMineResetPayPwdViewController.h */,
|
||||
E824546026F5F4E400BE8163 /* XPMineResetPayPwdViewController.m */,
|
||||
E8E20BE0281695800033B688 /* XPMineLoginPasswordViewController.h */,
|
||||
E8E20BE1281695800033B688 /* XPMineLoginPasswordViewController.m */,
|
||||
);
|
||||
path = Setting;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E8E70D6E26F2EB1200F03460 /* Mine */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -5869,6 +5901,7 @@
|
||||
E8E70D7126F2EB4900F03460 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8E20BDF281695430033B688 /* Setting */,
|
||||
E800805227FD33950055A8AB /* Guild */,
|
||||
E896EF912771AA6C00AD2CC1 /* Friend */,
|
||||
9BC5C8EA277AFEDC007C8719 /* Noble */,
|
||||
@@ -5879,22 +5912,6 @@
|
||||
E8E70D7F26F2F39000F03460 /* SubViews */,
|
||||
E8E70D7526F2F15100F03460 /* XPMineViewController.h */,
|
||||
E8E70D7626F2F15100F03460 /* XPMineViewController.m */,
|
||||
E8AC721126F46ADD007D6E91 /* XPMineSettingViewController.h */,
|
||||
E8AC721226F46ADD007D6E91 /* XPMineSettingViewController.m */,
|
||||
E8AC721F26F47E23007D6E91 /* XPMineAboutUsViewController.h */,
|
||||
E8AC722026F47E23007D6E91 /* XPMineAboutUsViewController.m */,
|
||||
E8AC722226F47E5E007D6E91 /* XPMineFeedbackViewController.h */,
|
||||
E8AC722326F47E5E007D6E91 /* XPMineFeedbackViewController.m */,
|
||||
E8AC722A26F49580007D6E91 /* XPMineNotificaViewController.h */,
|
||||
E8AC722B26F49580007D6E91 /* XPMineNotificaViewController.m */,
|
||||
E824543E26F58F9400BE8163 /* XPMinePayPwdViewController.h */,
|
||||
E824543F26F58F9400BE8163 /* XPMinePayPwdViewController.m */,
|
||||
E824544926F5BBB800BE8163 /* XPMineModifPayPwdViewController.h */,
|
||||
E824544A26F5BBB800BE8163 /* XPMineModifPayPwdViewController.m */,
|
||||
E824545426F5E51900BE8163 /* XPMineVerifIdentityViewController.h */,
|
||||
E824545526F5E51900BE8163 /* XPMineVerifIdentityViewController.m */,
|
||||
E824545F26F5F4E400BE8163 /* XPMineResetPayPwdViewController.h */,
|
||||
E824546026F5F4E400BE8163 /* XPMineResetPayPwdViewController.m */,
|
||||
9BD9A17A27A0EE24004186FE /* XPMineVisitorViewController.h */,
|
||||
9BD9A17B27A0EE24004186FE /* XPMineVisitorViewController.m */,
|
||||
9B1B729328002099003FACE9 /* XPMineFansTeamViewController.h */,
|
||||
@@ -5929,6 +5946,8 @@
|
||||
E824545B26F5EEBA00BE8163 /* XPMineVerifIdentityPresenter.m */,
|
||||
E824546226F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.h */,
|
||||
E824546326F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.m */,
|
||||
E8E20BE628169BDC0033B688 /* XPMineLoginPasswordPresenter.h */,
|
||||
E8E20BE728169BDC0033B688 /* XPMineLoginPasswordPresenter.m */,
|
||||
E88B5CAE26FB1C6500DA9178 /* XPMineTeenagerPresenter.h */,
|
||||
E88B5CAF26FB1C6500DA9178 /* XPMineTeenagerPresenter.m */,
|
||||
E88B5CB626FB325200DA9178 /* XPMineTeenagerPwdPresenter.h */,
|
||||
@@ -5968,6 +5987,7 @@
|
||||
E824545226F5CE9C00BE8163 /* XPMineModifPayProtocol.h */,
|
||||
E824545D26F5EEFD00BE8163 /* XPMineVerifIdentityProtocol.h */,
|
||||
E824546526F5FF5100BE8163 /* XPMineResetPayPasswordProtocol.h */,
|
||||
E8E20BE928169E410033B688 /* XPMineLoginPasswordProtocol.h */,
|
||||
E88B5CB126FB1CC100DA9178 /* XPMineTeenagerProtocol.h */,
|
||||
E88B5CB926FB327500DA9178 /* XPMineTeenagerPwdProtocol.h */,
|
||||
E8EEB90226FC31CE007C6EBA /* XPMineUserInfoProtocol.h */,
|
||||
@@ -6274,6 +6294,7 @@
|
||||
9B86D886281942D200494FCD /* SocialMicroView.m in Sources */,
|
||||
E824544826F5945300BE8163 /* XPMinePayPwdProtocol.h in Sources */,
|
||||
E824543A26F5880E00BE8163 /* XPLoginVerifBindPhoneProtocol.h in Sources */,
|
||||
E8E20BE2281695800033B688 /* XPMineLoginPasswordViewController.m in Sources */,
|
||||
E824543826F5820A00BE8163 /* XPLoginVerifBindPhonePresenter.m in Sources */,
|
||||
E8B846BF26FD827900A777FE /* XPMineUserInfoAlbumViewController.m in Sources */,
|
||||
E8D48253278D8228003C1D08 /* AcrossRoomPKPanelModel.m in Sources */,
|
||||
@@ -6689,6 +6710,7 @@
|
||||
E81C1B2227705F950020D1E4 /* Api+ArrangeMic.m in Sources */,
|
||||
E800805A27FD34DE0055A8AB /* XPMineClanViewController.m in Sources */,
|
||||
E8ACEFF527C8EF0500F66D1A /* XPHomeHotRoomViewController.m in Sources */,
|
||||
E8E20BE828169BDC0033B688 /* XPMineLoginPasswordPresenter.m in Sources */,
|
||||
E81EF6DC279AB5CC00FF3EDE /* XPLittleGameRoomOpenView.m in Sources */,
|
||||
E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */,
|
||||
9B1EF3D227E81C0600554295 /* XPMineDressUpBubbleViewController.m in Sources */,
|
||||
|
@@ -23,7 +23,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic , assign) BOOL isBindPhone;
|
||||
@property (nonatomic , strong) UserExpand * userExpand;
|
||||
@property (nonatomic , assign) NSInteger erbanNo;
|
||||
@property (nonatomic , assign) BOOL isBindPasswd;
|
||||
@property (nonatomic , assign) NSInteger registerDay;
|
||||
@property (nonatomic , assign) BOOL isFirstCharge;
|
||||
@property (nonatomic , assign) BOOL hasPrettyErbanNo;
|
||||
@@ -48,6 +47,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic , assign) BOOL isBindPaymentPwd;
|
||||
@property (nonatomic , assign) BOOL isBindXCZAccount;
|
||||
@property (nonatomic , assign) BOOL isBindAlipay;
|
||||
///是否绑定了密码
|
||||
@property (nonatomic , assign) BOOL isBindPasswd;
|
||||
///相册
|
||||
@property (nonatomic, strong) NSArray<UserPhoto *> *privatePhoto;//相册
|
||||
///签名
|
||||
|
@@ -62,6 +62,19 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket;
|
||||
|
||||
/// 设置登录密码
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
+ (void)setLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd;
|
||||
|
||||
/// 修改 登录密码
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param pwd 旧密码
|
||||
+ (void)modifyLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd;
|
||||
|
||||
/// 开启关闭家长模式
|
||||
/// @param complection 完成
|
||||
/// @param password 密码
|
||||
|
@@ -63,6 +63,22 @@
|
||||
[self makeRequest:@"user/paymentPasswd/modify" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, newPasswd,oldPasswd,uid,ticket, nil];
|
||||
}
|
||||
|
||||
/// 设置登录密码
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
+ (void)setLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd {
|
||||
[self makeRequest:@"acc/pwd/set" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, nil];
|
||||
}
|
||||
|
||||
/// 修改 登录密码
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param pwd 旧密码
|
||||
+ (void)modifyLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd {
|
||||
[self makeRequest:@"acc/pwd/modify" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__, phone, newPwd, pwd, nil];
|
||||
}
|
||||
|
||||
/// 开启关闭家长模式
|
||||
/// @param completion 完成
|
||||
|
@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger, XPMineSettingItemType){
|
||||
XPMineSettingItemType_Phone, ///手机号
|
||||
XPMineSettingItemType_Pay_Password,///支付密码
|
||||
///登录密码
|
||||
XPMineSettingItemType_Login_Password,
|
||||
XPMineSettingItemType_Notification_Remind, ///通知提醒
|
||||
XPMineSettingItemType_Permission,///关于我们
|
||||
XPMineSettingItemType_Helper,///帮助
|
||||
|
25
xplan-ios/Main/Mine/Presenter/XPMineLoginPasswordPresenter.h
Normal file
25
xplan-ios/Main/Mine/Presenter/XPMineLoginPasswordPresenter.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// XPMineLoginPasswordPresenter.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineLoginPasswordPresenter : BaseMvpPresenter
|
||||
/// 设置登录密码
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 密码
|
||||
- (void)setLoginPassword:(NSString *)phone newPwd:(NSString *)newPwd;
|
||||
|
||||
/// 修改登录密码
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新密码
|
||||
/// @param pwd 旧密码
|
||||
- (void)modifyLoginPassword:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
42
xplan-ios/Main/Mine/Presenter/XPMineLoginPasswordPresenter.m
Normal file
42
xplan-ios/Main/Mine/Presenter/XPMineLoginPasswordPresenter.m
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// XPMineLoginPasswordPresenter.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import "XPMineLoginPasswordPresenter.h"
|
||||
#import "Api+Mine.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "XPConstant.h"
|
||||
#import "XPMineLoginPasswordProtocol.h"
|
||||
|
||||
@implementation XPMineLoginPasswordPresenter
|
||||
|
||||
|
||||
/// 设置登录密码
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 密码
|
||||
- (void)setLoginPassword:(NSString *)phone newPwd:(NSString *)newPwd {
|
||||
NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api setLoingPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] setLoginPasswordSuccess];
|
||||
} showLoading:YES] phone:desNewPwd newPwd:desPhone];
|
||||
}
|
||||
|
||||
|
||||
/// 修改登录密码
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新密码
|
||||
/// @param pwd 旧密码
|
||||
- (void)modifyLoginPassword:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd{
|
||||
NSString * desNewPwd = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPwd = [DESEncrypt encryptUseDES:pwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api modifyLoingPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] modifyLoginPasswordSuccess];
|
||||
}] phone:desPhone newPwd:desNewPwd pwd:desPwd];
|
||||
}
|
||||
|
||||
@end
|
@@ -26,6 +26,8 @@
|
||||
@property (nonatomic,strong) XPMineSettingItemModel *phoneItem;
|
||||
///支付密码
|
||||
@property (nonatomic,strong) XPMineSettingItemModel *payItem;
|
||||
///登录密码
|
||||
@property (nonatomic,strong) XPMineSettingItemModel *loginItem;
|
||||
///数据源
|
||||
@property (nonatomic,strong) NSArray *datasouce;
|
||||
@end
|
||||
@@ -49,6 +51,12 @@
|
||||
phoneItem.type = XPMineSettingItemType_Phone;
|
||||
self.phoneItem = phoneItem;
|
||||
|
||||
XPMineSettingItemModel * loginItem = [[XPMineSettingItemModel alloc] init];
|
||||
loginItem.title = userinfo.isBindPasswd ? @"重置密码" : @"设置密码";
|
||||
loginItem.subTitle = @"设置";
|
||||
loginItem.type = XPMineSettingItemType_Login_Password;
|
||||
self.loginItem = loginItem;
|
||||
|
||||
XPMineSettingItemModel * payItem = [[XPMineSettingItemModel alloc] init];
|
||||
payItem.title = @"支付密码";
|
||||
payItem.subTitle = userinfo.isBindPaymentPwd ? @"修改" : @"设置";
|
||||
@@ -86,7 +94,7 @@
|
||||
aboutusItem.type = XPMineSettingItemType_About_Us;
|
||||
|
||||
NSArray * oneSection = @[phoneItem];
|
||||
NSArray * twoSection = @[payItem, notificaItem];
|
||||
NSArray * twoSection = @[loginItem,payItem, notificaItem];
|
||||
NSArray * threeSection = @[privacyItem];
|
||||
NSArray * fourthSection = @[helperItem, feedbackItem, clearMemoryItem, aboutusItem];
|
||||
|
||||
|
19
xplan-ios/Main/Mine/Protocol/XPMineLoginPasswordProtocol.h
Normal file
19
xplan-ios/Main/Mine/Protocol/XPMineLoginPasswordProtocol.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// XPMineLoginPasswordProtocol.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPMineLoginPasswordProtocol <NSObject>
|
||||
|
||||
- (void)modifyLoginPasswordSuccess;
|
||||
- (void)setLoginPasswordSuccess;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// XPMineLoginPasswordViewController.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@class UserInfoModel;
|
||||
@interface XPMineLoginPasswordViewController : MvpViewController
|
||||
///
|
||||
@property (nonatomic,strong) UserInfoModel *userInfo;
|
||||
///是否是修改密码
|
||||
@property (nonatomic,assign) BOOL isModifiPwd;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,232 @@
|
||||
//
|
||||
// XPMineLoginPasswordViewController.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import "XPMineLoginPasswordViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import "UIImage+Utils.h"
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
///View
|
||||
#import "XPMineModifPayPwdView.h"
|
||||
///P
|
||||
#import "XPMineLoginPasswordPresenter.h"
|
||||
#import "XPMineLoginPasswordProtocol.h"
|
||||
///VC
|
||||
#import "XPMineSettingViewController.h"
|
||||
#import "XPMineVerifIdentityViewController.h"
|
||||
|
||||
@interface XPMineLoginPasswordViewController ()<XPMineLoginPasswordProtocol>
|
||||
///容器
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///当前的密码
|
||||
@property (nonatomic,strong) XPMineModifPayPwdView *currentPwdView;
|
||||
///新密码
|
||||
@property (nonatomic,strong) XPMineModifPayPwdView *newsPwdView;
|
||||
///检查密码
|
||||
@property (nonatomic,strong) XPMineModifPayPwdView *checkPwdView;
|
||||
///忘记密码
|
||||
@property (nonatomic, strong) UIButton *forgetButton;
|
||||
///提交
|
||||
@property (nonatomic, strong) UIButton *submitButton;
|
||||
///限制的提示
|
||||
@property (nonatomic,strong) UILabel *limitLabel;
|
||||
///旧密码
|
||||
@property (nonatomic,copy) NSString *currentPwd;
|
||||
///新密码
|
||||
@property (nonatomic,copy) NSString *newsPwd;
|
||||
///检查密码
|
||||
@property (nonatomic,copy) NSString *checkPwd;
|
||||
@end
|
||||
|
||||
@implementation XPMineLoginPasswordViewController
|
||||
|
||||
- (XPMineLoginPasswordPresenter *)createPresenter {
|
||||
return [[XPMineLoginPasswordPresenter alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.title = @"修改支付密码";
|
||||
[self.view addSubview:self.stackView];
|
||||
[self.view addSubview:self.limitLabel];
|
||||
[self.view addSubview:self.forgetButton];
|
||||
[self.view addSubview:self.submitButton];
|
||||
[self.stackView addArrangedSubview:self.currentPwdView];
|
||||
[self.stackView addArrangedSubview:self.newsPwdView];
|
||||
[self.stackView addArrangedSubview:self.checkPwdView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self.view);
|
||||
}];
|
||||
|
||||
[self.limitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.view).offset(15);
|
||||
make.top.mas_equalTo(self.stackView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.forgetButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.view).offset(-32);
|
||||
make.top.mas_equalTo(self.stackView.mas_bottom).offset(8);
|
||||
}];
|
||||
[self.submitButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.stackView.mas_bottom).offset(45);
|
||||
make.right.mas_equalTo(self.view).offset(-32);
|
||||
make.left.mas_equalTo(self.view).offset(32);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - XPMineLoginPasswordProtocol
|
||||
- (void)setLoginPasswordSuccess {
|
||||
[self showSuccessToast:@"设置成功"];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (void)modifyLoginPasswordSuccess {
|
||||
[self showSuccessToast:@"修改成功"];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)forgetButtonAction:(UIButton *)sender {
|
||||
XPMineVerifIdentityViewController * VC= [[XPMineVerifIdentityViewController alloc] init];
|
||||
VC.userInfo = self.userInfo;
|
||||
[self.navigationController pushViewController:VC animated:YES];
|
||||
}
|
||||
|
||||
- (void)submitButtonAction:(UIButton *)sender {
|
||||
if (![self.newsPwdView.contentTextField.text isEqualToString:self.checkPwdView.contentTextField.text]) {
|
||||
[self showErrorToast:@"两次输入的新密码不一致哦"];
|
||||
return;
|
||||
}
|
||||
if (self.isModifiPwd) {
|
||||
[self.presenter modifyLoginPassword:self.userInfo.phone newPwd:self.newsPwd pwd:self.currentPwd];
|
||||
} else {
|
||||
[self.presenter setLoginPassword:self.userInfo.phone newPwd:self.currentPwd];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)textFieldDidChange:(UITextField *)textfield {
|
||||
if (textfield == self.currentPwdView.contentTextField) {
|
||||
self.currentPwd = textfield.text;
|
||||
} else if (textfield == self.newsPwdView.contentTextField) {
|
||||
self.newsPwd = textfield.text;
|
||||
} else {
|
||||
self.checkPwd = textfield.text;
|
||||
}
|
||||
|
||||
if (self.isModifiPwd) {
|
||||
if (self.currentPwd.length >= 6 && self.newsPwd.length >= 6 && self.checkPwd.length >= 6) {
|
||||
self.submitButton.enabled = YES;
|
||||
} else {
|
||||
self.submitButton.enabled = NO;
|
||||
}
|
||||
} else {
|
||||
if (self.newsPwd.length >= 6 && self.checkPwd.length >= 6) {
|
||||
self.submitButton.enabled = YES;
|
||||
} else {
|
||||
self.submitButton.enabled = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setIsModifiPwd:(BOOL)isModifiPwd {
|
||||
_isModifiPwd = isModifiPwd;
|
||||
if (_isModifiPwd) {
|
||||
self.currentPwdView.hidden = NO;
|
||||
self.currentPwdView.placeholder = @"输入原密码";
|
||||
self.newsPwdView.placeholder = @"输入新密码";
|
||||
self.checkPwdView.placeholder = @"再次确认密码";
|
||||
} else {
|
||||
self.currentPwdView.hidden = YES;
|
||||
self.newsPwdView.placeholder = @"输入密码";
|
||||
self.checkPwdView.placeholder = @"再次确认密码";
|
||||
self.forgetButton.hidden = YES;
|
||||
}
|
||||
self.currentPwdView.hidden = !_isModifiPwd;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisVertical;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 0;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (XPMineModifPayPwdView *)currentPwdView {
|
||||
if (!_currentPwdView) {
|
||||
_currentPwdView = [[XPMineModifPayPwdView alloc] init];
|
||||
[_currentPwdView.contentTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
_currentPwdView.hidden = YES;
|
||||
}
|
||||
return _currentPwdView;
|
||||
}
|
||||
|
||||
- (XPMineModifPayPwdView *)newsPwdView {
|
||||
if (!_newsPwdView) {
|
||||
_newsPwdView = [[XPMineModifPayPwdView alloc] init];
|
||||
[_newsPwdView.contentTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
}
|
||||
return _newsPwdView;
|
||||
}
|
||||
|
||||
- (XPMineModifPayPwdView *)checkPwdView {
|
||||
if (!_checkPwdView) {
|
||||
_checkPwdView = [[XPMineModifPayPwdView alloc] init];
|
||||
[_checkPwdView.contentTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
}
|
||||
return _checkPwdView;
|
||||
}
|
||||
|
||||
- (UIButton *)submitButton {
|
||||
if (!_submitButton) {
|
||||
_submitButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_submitButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal];
|
||||
[_submitButton setTitleColor:[ThemeColor disableButtonTextColor] forState:UIControlStateDisabled];
|
||||
[_submitButton setTitle:@"确定" forState:UIControlStateNormal];
|
||||
_submitButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
_submitButton.layer.masksToBounds = YES;
|
||||
_submitButton.layer.cornerRadius = 45/2;
|
||||
_submitButton.enabled = YES;
|
||||
[_submitButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
[_submitButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor disableButtonColor], [ThemeColor disableButtonColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled];
|
||||
[_submitButton addTarget:self action:@selector(submitButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _submitButton;
|
||||
}
|
||||
|
||||
- (UIButton *)forgetButton {
|
||||
if (!_forgetButton) {
|
||||
_forgetButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_forgetButton setEnlargeEdgeWithTop:5 right:5 bottom:5 left:5];
|
||||
[_forgetButton setTitleColor:[ThemeColor secondTextColor] forState:UIControlStateNormal];
|
||||
[_forgetButton setTitle:@"忘记密码?" forState:UIControlStateNormal];
|
||||
_forgetButton.titleLabel.font = [UIFont systemFontOfSize:13];
|
||||
[_forgetButton addTarget:self action:@selector(forgetButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _forgetButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -32,11 +32,13 @@
|
||||
#import "XPMinePayPwdViewController.h"
|
||||
#import "XPMineModifPayPwdViewController.h"
|
||||
#import "XPPrivacyViewController.h"
|
||||
#import "XPMineLoginPasswordViewController.h"
|
||||
///不同模块的VC
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPLoginVerifBindPhoneViewController.h"
|
||||
#import "XPLoginBindPhoneResultViewController.h"
|
||||
|
||||
|
||||
@interface XPMineSettingViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineSettingProtocol>
|
||||
///
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
@@ -116,6 +118,29 @@
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XPMineSettingItemType_Login_Password:
|
||||
{
|
||||
if (!self.userInfo.isBindPhone) {
|
||||
XPLoginVerifBindPhoneViewController *vc = [[XPLoginVerifBindPhoneViewController alloc] init];
|
||||
vc.bindingPhoneNumType = XPBindingPhoneNumTypeNormal;
|
||||
vc.userInfo = _userInfo;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
return;
|
||||
}
|
||||
//支付密码
|
||||
if (self.userInfo.isBindPasswd) {
|
||||
XPMineLoginPasswordViewController *vc = [[XPMineLoginPasswordViewController alloc] init];
|
||||
vc.userInfo = self.userInfo;
|
||||
vc.isModifiPwd = YES;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
} else {
|
||||
XPMineLoginPasswordViewController *vc = [[XPMineLoginPasswordViewController alloc] init];
|
||||
vc.userInfo = self.userInfo;
|
||||
vc.isModifiPwd = NO;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XPMineSettingItemType_Notification_Remind:
|
||||
{
|
||||
XPMineNotificaViewController * notiVC = [[XPMineNotificaViewController alloc] init];
|
||||
@@ -203,15 +228,28 @@
|
||||
if (section != 0) {
|
||||
return 15;
|
||||
}
|
||||
return 0;
|
||||
return 0.01f;
|
||||
}
|
||||
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
|
||||
UIView * view = [[UIView alloc] init];
|
||||
view.frame = CGRectMake(0, 0, KScreenWidth, 15);
|
||||
view.backgroundColor = [UIColor clearColor];
|
||||
return view;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
|
||||
return 0.01f;
|
||||
}
|
||||
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
|
||||
UIView * view = [[UIView alloc] init];
|
||||
view.frame = CGRectMake(0, 0, KScreenWidth, 0.01f);
|
||||
view.backgroundColor = [UIColor clearColor];
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasource.count > 0) {
|
||||
@@ -242,7 +280,7 @@
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.showsVerticalScrollIndicator = NO;
|
@@ -41,6 +41,7 @@
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [ThemeColor appCellBackgroundColor];
|
||||
[self addSubview:self.contentTextField];
|
||||
[self addSubview:self.commandButton];
|
||||
[self addSubview:self.partLineView];
|
||||
@@ -66,7 +67,7 @@
|
||||
make.left.mas_equalTo(self).offset(5);
|
||||
make.right.mas_equalTo(self).offset(-5);
|
||||
make.bottom.mas_equalTo(self);
|
||||
make.height.mas_equalTo(1);
|
||||
make.height.mas_equalTo(0.5);
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -80,6 +81,7 @@
|
||||
- (UIView *)partLineView {
|
||||
if (!_partLineView) {
|
||||
_partLineView = [[UIView alloc] init];
|
||||
_partLineView.backgroundColor = [ThemeColor dividerColor];
|
||||
}
|
||||
return _partLineView;
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ typedef NS_ENUM(NSInteger, RoomSettingInputType) {
|
||||
|
||||
@class XPRoomSettingInputView;
|
||||
@protocol XPRoomSettingInputViewDelegate <NSObject>
|
||||
@optional
|
||||
///点击了完成
|
||||
- (void)xPRoomSettingInputView:(XPRoomSettingInputView *)view didClickConfirm:(NSString *)text type:(RoomSettingInputType)type;
|
||||
///点击了取消
|
||||
|
Reference in New Issue
Block a user