添加了h5地址的获取方式 项目中key的获取

This commit is contained in:
fengshuo
2021-09-13 14:22:51 +08:00
parent 8b127baa51
commit fd6248ab1a
17 changed files with 230 additions and 74 deletions

View File

@@ -63,6 +63,9 @@
E81C279326EB394D0031E639 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C279226EB394D0031E639 /* LoginForgetPasswordViewController.m */; }; E81C279326EB394D0031E639 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C279226EB394D0031E639 /* LoginForgetPasswordViewController.m */; };
E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C279526EB39CC0031E639 /* LoginForgetPasswordPresent.m */; }; E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C279526EB39CC0031E639 /* LoginForgetPasswordPresent.m */; };
E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E81C279726EB39E10031E639 /* LoginForgetPasswordProtocol.h */; }; E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E81C279726EB39E10031E639 /* LoginForgetPasswordProtocol.h */; };
E81C279D26EEEC620031E639 /* XPConstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C279C26EEEC620031E639 /* XPConstant.m */; };
E81C27A026EEF83D0031E639 /* XPHtmlUrl.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C279F26EEF83D0031E639 /* XPHtmlUrl.m */; };
E81C27A226EF23490031E639 /* XPEnum.h in Sources */ = {isa = PBXBuildFile; fileRef = E81C27A126EF23370031E639 /* XPEnum.h */; };
E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308826E89BE000B90D4F /* LoginPhoneViewController.m */; }; E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308826E89BE000B90D4F /* LoginPhoneViewController.m */; };
E872308D26E89DAA00B90D4F /* LoginInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308C26E89DAA00B90D4F /* LoginInputView.m */; }; E872308D26E89DAA00B90D4F /* LoginInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308C26E89DAA00B90D4F /* LoginInputView.m */; };
E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872309226E8D31500B90D4F /* LoginVerifCodeView.m */; }; E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872309226E8D31500B90D4F /* LoginVerifCodeView.m */; };
@@ -188,6 +191,12 @@
E81C279426EB39CC0031E639 /* LoginForgetPasswordPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginForgetPasswordPresent.h; sourceTree = "<group>"; }; E81C279426EB39CC0031E639 /* LoginForgetPasswordPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginForgetPasswordPresent.h; sourceTree = "<group>"; };
E81C279526EB39CC0031E639 /* LoginForgetPasswordPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginForgetPasswordPresent.m; sourceTree = "<group>"; }; E81C279526EB39CC0031E639 /* LoginForgetPasswordPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginForgetPasswordPresent.m; sourceTree = "<group>"; };
E81C279726EB39E10031E639 /* LoginForgetPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginForgetPasswordProtocol.h; sourceTree = "<group>"; }; E81C279726EB39E10031E639 /* LoginForgetPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginForgetPasswordProtocol.h; sourceTree = "<group>"; };
E81C279A26EB65560031E639 /* XPMacro.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMacro.h; sourceTree = "<group>"; };
E81C279B26EEEC620031E639 /* XPConstant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPConstant.h; sourceTree = "<group>"; };
E81C279C26EEEC620031E639 /* XPConstant.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPConstant.m; sourceTree = "<group>"; };
E81C279E26EEF83D0031E639 /* XPHtmlUrl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHtmlUrl.h; sourceTree = "<group>"; };
E81C279F26EEF83D0031E639 /* XPHtmlUrl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHtmlUrl.m; sourceTree = "<group>"; };
E81C27A126EF23370031E639 /* XPEnum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPEnum.h; sourceTree = "<group>"; };
E872308726E89BE000B90D4F /* LoginPhoneViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPhoneViewController.h; sourceTree = "<group>"; }; E872308726E89BE000B90D4F /* LoginPhoneViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPhoneViewController.h; sourceTree = "<group>"; };
E872308826E89BE000B90D4F /* LoginPhoneViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPhoneViewController.m; sourceTree = "<group>"; }; E872308826E89BE000B90D4F /* LoginPhoneViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPhoneViewController.m; sourceTree = "<group>"; };
E872308B26E89DAA00B90D4F /* LoginInputView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginInputView.h; sourceTree = "<group>"; }; E872308B26E89DAA00B90D4F /* LoginInputView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginInputView.h; sourceTree = "<group>"; };
@@ -263,6 +272,7 @@
189DD52B26DE255300AB55B1 /* xplan-ios */ = { 189DD52B26DE255300AB55B1 /* xplan-ios */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E81C279926EB64BA0031E639 /* Global */,
189DD56B26DF5B0900AB55B1 /* Base */, 189DD56B26DF5B0900AB55B1 /* Base */,
189DD56126DE45F800AB55B1 /* Main */, 189DD56126DE45F800AB55B1 /* Main */,
189DD52C26DE255300AB55B1 /* AppDelegate.h */, 189DD52C26DE255300AB55B1 /* AppDelegate.h */,
@@ -569,6 +579,19 @@
path = Security; path = Security;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
E81C279926EB64BA0031E639 /* Global */ = {
isa = PBXGroup;
children = (
E81C279A26EB65560031E639 /* XPMacro.h */,
E81C279B26EEEC620031E639 /* XPConstant.h */,
E81C279C26EEEC620031E639 /* XPConstant.m */,
E81C279E26EEF83D0031E639 /* XPHtmlUrl.h */,
E81C279F26EEF83D0031E639 /* XPHtmlUrl.m */,
E81C27A126EF23370031E639 /* XPEnum.h */,
);
path = Global;
sourceTree = "<group>";
};
E872308A26E89D5100B90D4F /* CustomView */ = { E872308A26E89D5100B90D4F /* CustomView */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -722,6 +745,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
E81C27A226EF23490031E639 /* XPEnum.h in Sources */,
E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */, E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */,
E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */, E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */,
E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */, E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */,
@@ -731,6 +755,7 @@
E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */, E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */,
E8B825B726E9A7D8009E8E9F /* BaseObject.m in Sources */, E8B825B726E9A7D8009E8E9F /* BaseObject.m in Sources */,
189DD53426DE255300AB55B1 /* TabbarViewController.m in Sources */, 189DD53426DE255300AB55B1 /* TabbarViewController.m in Sources */,
E81C279D26EEEC620031E639 /* XPConstant.m in Sources */,
187EEEFE26E8A82C002833B2 /* NSObject+AutoCoding.m in Sources */, 187EEEFE26E8A82C002833B2 /* NSObject+AutoCoding.m in Sources */,
189DD55A26DE39D200AB55B1 /* BaseMvpPresenter.m in Sources */, 189DD55A26DE39D200AB55B1 /* BaseMvpPresenter.m in Sources */,
189DD6FF26E20E5900AB55B1 /* HttpRequestHelper.m in Sources */, 189DD6FF26E20E5900AB55B1 /* HttpRequestHelper.m in Sources */,
@@ -742,6 +767,7 @@
9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */, 9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */,
189DD54B26DE338800AB55B1 /* BaseViewController.m in Sources */, 189DD54B26DE338800AB55B1 /* BaseViewController.m in Sources */,
E81C279026EB314D0031E639 /* LoginForgetEditView.m in Sources */, E81C279026EB314D0031E639 /* LoginForgetEditView.m in Sources */,
E81C27A026EEF83D0031E639 /* XPHtmlUrl.m in Sources */,
18E7B1B726E8B2D10064BC9B /* Api+Main.m in Sources */, 18E7B1B726E8B2D10064BC9B /* Api+Main.m in Sources */,
E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */, E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */,
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */, 18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,

View File

@@ -14,44 +14,6 @@
#define AppName ([[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]) #define AppName ([[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"])
//iPhoneX系列设备(刘海屏设备)
#define iPhoneXSeries \
({BOOL isPhoneXSeries = NO;\
if (@available(iOS 11.0, *)) {\
isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneXSeries);})
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
/// 默认主题色
#define ThemeDefaultColor UIColorFromRGB(0x248CFE)
/// 页面背景色
#define ThemeBackgroundColor UIColorFromRGB(0x1C1B22)
/// 字体默认颜色
#define ThemeTextColor UIColorFromRGB(0xC6C6E9)
/// 字体默认颜色
#define ThemeTextSecondColor UIColorFromRGB(0x4F516A)
/// 按钮渐变色 start
#define ThemeButtonGradientStartColor UIColorFromRGB(0x218EFF)
/// 按钮渐变色 end
#define ThemeButtonGradientEndColor UIColorFromRGB(0x7727E4)
/// Tabbar 未选中
#define ThemeTabbarNormalColor UIColorFromRGB(0x555574)
/// Tabbar 选中
#define ThemeTabbarSelectedColor UIColorFromRGB(0x248CFE)
/// Tabbar 背景色
#define ThemeTabbarBackgroundColor UIColorFromRGB(0x2A2A39)
#define KScreenWidth [[UIScreen mainScreen] bounds].size.width
#define KScreenHeight [[UIScreen mainScreen] bounds].size.height
#define statusbarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
#define kStatusBarHeight statusbarHeight
#define kSafeAreaBottomHeight (iPhoneXSeries ? 34 : 0)
#define kSafeAreaTopHeight (iPhoneXSeries ? 24 : 0)
#define kNavigationHeight (kStatusBarHeight + 44)
#define kTabBarHeight (iPhoneXSeries ? 49.0+34.0 : 49.0)
#ifdef DEBUG #ifdef DEBUG
#define NSLog(fmt,...) NSLog((@"%s [Line %d]" fmt),__PRETTY_FUNCTION__,__LINE__,##__VA_ARGS__) #define NSLog(fmt,...) NSLog((@"%s [Line %d]" fmt),__PRETTY_FUNCTION__,__LINE__,##__VA_ARGS__)
#else #else

View File

@@ -6,6 +6,8 @@
// //
#import "BaseNavigationController.h" #import "BaseNavigationController.h"
///Tool
#import "ThemeColor.h"
@interface BaseNavigationController () @interface BaseNavigationController ()
@@ -25,7 +27,7 @@
- (void)themeConfig { - (void)themeConfig {
self.navigationBar.shadowImage = [[UIImage alloc] init]; self.navigationBar.shadowImage = [[UIImage alloc] init];
self.navigationBar.barTintColor = ThemeBackgroundColor; self.navigationBar.barTintColor = [ThemeColor appBackgroundColor];
self.navigationBar.tintColor = [UIColor whiteColor]; self.navigationBar.tintColor = [UIColor whiteColor];
self.navigationBar.translucent = NO; self.navigationBar.translucent = NO;

View File

@@ -6,6 +6,8 @@
// //
#import "BaseViewController.h" #import "BaseViewController.h"
///Tool
#import "ThemeColor.h"
@interface BaseViewController () @interface BaseViewController ()
@@ -19,7 +21,7 @@
} }
- (void)themeConfig { - (void)themeConfig {
self.view.backgroundColor = ThemeBackgroundColor; self.view.backgroundColor = [ThemeColor appBackgroundColor];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
} }

View File

@@ -38,6 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (UIColor *)disableButtonBackColor; + (UIColor *)disableButtonBackColor;
/// 按钮不可点击文字颜色 #4F516A /// 按钮不可点击文字颜色 #4F516A
+ (UIColor *)disableButtonTextColor; + (UIColor *)disableButtonTextColor;
///tabbar 没有点击的时候颜色555574
+ (UIColor *)tabbarNormalColor;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -7,6 +7,7 @@
#import "ThemeColor.h" #import "ThemeColor.h"
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
@implementation ThemeColor @implementation ThemeColor
/// #248CFE /// #248CFE
@@ -65,5 +66,9 @@
+ (UIColor *)disableButtonTextColor { + (UIColor *)disableButtonTextColor {
return UIColorFromRGB(0x4F516A); return UIColorFromRGB(0x4F516A);
} }
///tabbar 555574
+ (UIColor *)tabbarNormalColor {
return UIColorFromRGB(0x555574);
}
@end @end

View File

@@ -0,0 +1,24 @@
//
// XPConstant.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/13.
//
///一些项目中所用到的key
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPConstant : NSObject
typedef NS_ENUM(NSUInteger, KeyType) {
KeyType_PasswordEncode,///密码des 加密的
KeyType_NTESQuickLoginBusinessId,///玩意易盾 快捷登录 id
};
/// 获取当前项目中所用到的 type 所对应的valu的值 type 类型
NSString * const KeyWithType(KeyType type);
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
//
// XPConstant.m
// xplan-ios
//
// Created by on 2021/9/13.
//
#import "XPConstant.h"
@implementation XPConstant
///
NSString * const KeyWithType(KeyType type) {
BOOL isRelease = YES;
NSDictionary * dic = @{
///
@(YES):@{
@(KeyType_PasswordEncode): @"1ea53d260ecf11e7b56e00163e046a26",
@(KeyType_NTESQuickLoginBusinessId): @"09c1214706c34f4798d3f05d86148608"
},
///
@(NO):@{
@(KeyType_PasswordEncode): @"1ea53d260ecf11e7b56e00163e046a26",
@(KeyType_NTESQuickLoginBusinessId): @"09c1214706c34f4798d3f05d86148608"
}
};
NSDictionary * enviroDic = [dic objectForKey:@(isRelease)];
return [enviroDic objectForKey:@(type)];
}
@end

17
xplan-ios/Global/XPEnum.h Normal file
View File

@@ -0,0 +1,17 @@
//
// XPEnum.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/13.
//
///放置一些全局的枚举
#ifndef XPEnum_h
#define XPEnum_h
typedef NS_ENUM(NSUInteger, ThirdLoginType) {
ThirdLoginType_WeChat,///微信
ThirdLoginType_QQ,///QQ
ThirdLoginType_Apple,///苹果登录
};
#endif /* XPEnum_h */

View File

@@ -0,0 +1,23 @@
//
// XPHtmlUrl.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/13.
//
///放置h5的链接地址
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPHtmlUrl : NSObject
typedef NS_ENUM(NSUInteger, URLType) {
kPrivacyURL,///隐私政策
kUserProtocalURL, ///用户协议
};
NSString * const URLWithType(URLType type);
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,23 @@
//
// XPHtmlUrl.m
// xplan-ios
//
// Created by on 2021/9/13.
//
#import "XPHtmlUrl.h"
@implementation XPHtmlUrl
NSString * const URLWithType(URLType type) {
NSString * prefix = @"yinyou";
NSDictionary * dic = @{
@(kPrivacyURL): @"modules/rule/privacy-wap.html",
@(kUserProtocalURL) : @"modules/rule/protocol.html"
};
NSString * url = [dic objectForKey:@(type)];
return [NSString stringWithFormat:@"%@/%@",prefix, url];
}
@end

View File

@@ -0,0 +1,28 @@
//
// XPMacro.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/10.
//
///一些宏
#ifndef XPMacro_h
#define XPMacro_h
//iPhoneX系列设备(刘海屏设备)
#define iPhoneXSeries \
({BOOL isPhoneXSeries = NO;\
if (@available(iOS 11.0, *)) {\
isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneXSeries);})
#define KScreenWidth [[UIScreen mainScreen] bounds].size.width
#define KScreenHeight [[UIScreen mainScreen] bounds].size.height
#define statusbarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
#define kStatusBarHeight statusbarHeight
#define kSafeAreaBottomHeight (iPhoneXSeries ? 34 : 0)
#define kSafeAreaTopHeight (iPhoneXSeries ? 24 : 0)
#define kNavigationHeight (kStatusBarHeight + 44)
#define kTabBarHeight (iPhoneXSeries ? 49.0+34.0 : 49.0)
#endif /* XPMacro_h */

View File

@@ -11,6 +11,7 @@
///Tool ///Tool
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "DESEncrypt.h" #import "DESEncrypt.h"
#import "XPConstant.h"
///Api ///Api
#import "Api+Login.h" #import "Api+Login.h"
///Presenter ///Presenter
@@ -43,7 +44,7 @@
/// @param newPwd /// @param newPwd
/// @param smsCode /// @param smsCode
- (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode { - (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:@"1ea53d260ecf11e7b56e00163e046a26"]; NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
[Api resetPasswordWithPhone:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api resetPasswordWithPhone:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] resetPasswrodSuccess]; [[self getView] resetPasswrodSuccess];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {

View File

@@ -11,6 +11,7 @@
///Tool ///Tool
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "DESEncrypt.h" #import "DESEncrypt.h"
#import "XPConstant.h"
///Model ///Model
#import "AccountModel.h" #import "AccountModel.h"
///Protocol ///Protocol
@@ -27,7 +28,7 @@
/// @param phone /// @param phone
/// @param password /// @param password
- (void)loginWithPhone:(NSString *)phone password:(NSString *)password { - (void)loginWithPhone:(NSString *)phone password:(NSString *)password {
NSString * desPassword = [DESEncrypt encryptUseDES:password key:@"1ea53d260ecf11e7b56e00163e046a26"]; NSString * desPassword = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyType_PasswordEncode)];
[Api loginWithPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api loginWithPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
AccountModel * accountModel = [AccountModel modelWithDictionary:data.data]; AccountModel * accountModel = [AccountModel modelWithDictionary:data.data];
if (accountModel && accountModel.access_token.length > 0) { if (accountModel && accountModel.access_token.length > 0) {

View File

@@ -195,7 +195,7 @@
_cutdownLabel = [[UILabel alloc] init]; _cutdownLabel = [[UILabel alloc] init];
_cutdownLabel.textAlignment = NSTextAlignmentCenter; _cutdownLabel.textAlignment = NSTextAlignmentCenter;
_cutdownLabel.font = [UIFont boldSystemFontOfSize:11]; _cutdownLabel.font = [UIFont boldSystemFontOfSize:11];
_cutdownLabel.textColor = ThemeTextColor; _cutdownLabel.textColor = [ThemeColor mainTextColor];
_cutdownLabel.hidden = NO; _cutdownLabel.hidden = NO;
} }
return _cutdownLabel; return _cutdownLabel;

View File

@@ -6,23 +6,24 @@
// //
#import "LoginViewController.h" #import "LoginViewController.h"
#import "LoginPresenter.h" ///Third
#import "LoginProtocol.h"
#import "UIImage+Utils.h"
#import "GCDHelper.h"
#import "XCHUDTool.h"
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <ReactiveObjC.h> #import <ReactiveObjC.h>
#import <YYText.h> #import <YYText.h>
#import <NTESQuickPass/NTESQuickPass.h> #import <NTESQuickPass/NTESQuickPass.h>
///Tool
#import "UIImage+Utils.h"
#import "GCDHelper.h"
#import "XCHUDTool.h"
#import "XPMacro.h"
#import "ThemeColor.h"
#import "XPConstant.h"
///Present
#import "LoginPresenter.h"
#import "LoginProtocol.h"
///VC
#import "LoginPhoneViewController.h" #import "LoginPhoneViewController.h"
//
#ifdef DEBUG
NSString *businessID = @"09c1214706c34f4798d3f05d86148608";
#else
NSString *businessID = @"09c1214706c34f4798d3f05d86148608";
#endif
typedef NS_ENUM(NSUInteger, XYLoginType) { typedef NS_ENUM(NSUInteger, XYLoginType) {
XYLoginTypeUnknow = 0, // XYLoginTypeUnknow = 0, //
@@ -87,7 +88,7 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
if (!_titleLabel) { if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init]; _titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:11]; _titleLabel.font = [UIFont systemFontOfSize:11];
_titleLabel.textColor = ThemeTextColor; _titleLabel.textColor = [ThemeColor mainTextColor];
_titleLabel.textAlignment = NSTextAlignmentCenter; _titleLabel.textAlignment = NSTextAlignmentCenter;
} }
return _titleLabel; return _titleLabel;
@@ -305,7 +306,7 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
return; return;
} }
[qlManager registerWithBusinessID:businessID timeout:3*1000 configURL:nil extData:nil completion:^(NSDictionary * _Nullable params, BOOL regSuccess) { [qlManager registerWithBusinessID:KeyWithType(KeyType_NTESQuickLoginBusinessId) timeout:3*1000 configURL:nil extData:nil completion:^(NSDictionary * _Nullable params, BOOL regSuccess) {
@strongify(self) @strongify(self)
if (!regSuccess) { if (!regSuccess) {
dispatch_main_sync_safe(^{ dispatch_main_sync_safe(^{
@@ -378,7 +379,7 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
}else { // }else { //
CMModel.logoImg = [UIImage imageNamed:@"login_ct_mobile"]; CMModel.logoImg = [UIImage imageNamed:@"login_ct_mobile"];
} }
CMModel.backgroundColor = ThemeBackgroundColor; CMModel.backgroundColor = [ThemeColor appBackgroundColor];
CMModel.logoWidth = 95; CMModel.logoWidth = 95;
CMModel.logoHeight = 95; CMModel.logoHeight = 95;
@@ -388,14 +389,14 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
CMModel.navTextFont = [UIFont boldSystemFontOfSize:18]; CMModel.navTextFont = [UIFont boldSystemFontOfSize:18];
CMModel.navReturnImg = [UIImage imageNamed:@"common_nav_back"]; CMModel.navReturnImg = [UIImage imageNamed:@"common_nav_back"];
CMModel.navBgColor = ThemeBackgroundColor; CMModel.navBgColor = [ThemeColor appBackgroundColor];
CMModel.logBtnHeight = 45; CMModel.logBtnHeight = 45;
CMModel.logBtnRadius = 45.f / 2; CMModel.logBtnRadius = 45.f / 2;
CMModel.logBtnOffsetTopY= 260; CMModel.logBtnOffsetTopY= 260;
CMModel.logBtnOriginLeft = 52; CMModel.logBtnOriginLeft = 52;
CMModel.logBtnOriginRight = 52; CMModel.logBtnOriginRight = 52;
CMModel.logBtnUsableBGColor = ThemeDefaultColor; CMModel.logBtnUsableBGColor = [ThemeColor appMainColor];
CMModel.logBtnText = @"本机号码一键登录"; CMModel.logBtnText = @"本机号码一键登录";
CMModel.logBtnTextColor = UIColor.whiteColor; CMModel.logBtnTextColor = UIColor.whiteColor;
CMModel.logBtnTextFont = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium]; CMModel.logBtnTextFont = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
@@ -409,11 +410,11 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
CMModel.checkedImg = [UIImage imageNamed:@"common_checkbox_checked"]; CMModel.checkedImg = [UIImage imageNamed:@"common_checkbox_checked"];
CMModel.checkboxWH = 20; CMModel.checkboxWH = 20;
CMModel.privacyColor = ThemeTextColor; CMModel.privacyColor = [ThemeColor mainTextColor];
CMModel.appPrivacyText = @"登录即代表同意《默认》,并授权音游获取本机号码。"; CMModel.appPrivacyText = @"登录即代表同意《默认》,并授权音游获取本机号码。";
CMModel.privacyState = YES; CMModel.privacyState = YES;
CMModel.privacyFont = [UIFont systemFontOfSize:12]; CMModel.privacyFont = [UIFont systemFontOfSize:12];
CMModel.protocolColor = ThemeDefaultColor; CMModel.protocolColor = [ThemeColor appMainColor];
CMModel.backActionBlock = ^{ // CMModel.backActionBlock = ^{ //
[XCHUDTool hideHUD]; [XCHUDTool hideHUD];
@@ -435,7 +436,7 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
_titleLabel = [[UILabel alloc] init]; _titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18]; _titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
_titleLabel.text = AppName; _titleLabel.text = AppName;
_titleLabel.textColor = ThemeTextColor; _titleLabel.textColor = [ThemeColor mainTextColor];
} }
return _titleLabel; return _titleLabel;
} }
@@ -445,7 +446,7 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
_subTitleLabel = [[UILabel alloc] init]; _subTitleLabel = [[UILabel alloc] init];
_subTitleLabel.font = [UIFont systemFontOfSize:13]; _subTitleLabel.font = [UIFont systemFontOfSize:13];
_subTitleLabel.text = @"来音游打游戏,争夺更多赏金!"; _subTitleLabel.text = @"来音游打游戏,争夺更多赏金!";
_subTitleLabel.textColor = ThemeTextColor; _subTitleLabel.textColor = [ThemeColor secondTextColor];
_subTitleLabel.textAlignment = NSTextAlignmentLeft; _subTitleLabel.textAlignment = NSTextAlignmentLeft;
} }
return _subTitleLabel; return _subTitleLabel;
@@ -459,7 +460,7 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
[_loginButton setTitle:@"本机号码一键登录" forState:UIControlStateNormal]; [_loginButton setTitle:@"本机号码一键登录" forState:UIControlStateNormal];
_loginButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium]; _loginButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
[_loginButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; [_loginButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
UIImage *image = [UIImage gradientColorImageFromColors:@[ThemeButtonGradientStartColor,ThemeButtonGradientEndColor] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)]; UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor],[ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 52 * 2, 45)];
[_loginButton setBackgroundImage:image forState:UIControlStateNormal]; [_loginButton setBackgroundImage:image forState:UIControlStateNormal];
} }
return _loginButton; return _loginButton;
@@ -488,9 +489,9 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
- (NSMutableAttributedString *)privacyAttributedStr{ - (NSMutableAttributedString *)privacyAttributedStr{
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"登录即代表同意"]; NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"登录即代表同意"];
attString.yy_color = ThemeTextColor; attString.yy_color = [ThemeColor mainTextColor];
NSString *userString = @"《用户服务协议》"; NSString *userString = @"《用户服务协议》";
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:ThemeDefaultColor}]; NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:[ThemeColor appMainColor]}];
@weakify(self) @weakify(self)
[userAttString yy_setTextHighlightRange:NSMakeRange(0, userAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { [userAttString yy_setTextHighlightRange:NSMakeRange(0, userAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
@strongify(self); @strongify(self);
@@ -499,9 +500,9 @@ typedef NS_ENUM(NSInteger,XYThirdLoginType) {
} longPressAction:nil]; } longPressAction:nil];
NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:@"和"]; NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:@"和"];
andString.yy_color = ThemeTextColor; andString.yy_color = [ThemeColor mainTextColor];
NSString *protocolString = @"《隐私政策》"; NSString *protocolString = @"《隐私政策》";
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:ThemeDefaultColor}]; NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:[ThemeColor appMainColor]}];
[privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { [privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
@strongify(self); @strongify(self);
// //

View File

@@ -5,13 +5,21 @@
// Created by zu on 2021/8/31. // Created by zu on 2021/8/31.
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
///Third
#import <flutter_boost/FlutterBoost.h>
///Tool
#import "XPMacro.h"
#import "ThemeColor.h"
#import "UIImage+Utils.h"
///VC
#import "TabbarViewController.h" #import "TabbarViewController.h"
#import "BaseViewController.h" #import "BaseViewController.h"
#import "UIImage+Utils.h"
#import "LoginViewController.h" #import "LoginViewController.h"
///Present
#import "MainPresenter.h" #import "MainPresenter.h"
#import "MainProtocol.h" #import "MainProtocol.h"
#import <flutter_boost/FlutterBoost.h>
@interface TabbarViewController () <BaseMvpProtocol, MainProtocol> @interface TabbarViewController () <BaseMvpProtocol, MainProtocol>
@@ -55,10 +63,10 @@
} }
- (void)configTheme { - (void)configTheme {
[[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:ThemeTabbarBackgroundColor size:CGSizeMake(KScreenWidth, kTabBarHeight)]]; [[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:[ThemeColor appCellBackgroundColor] size:CGSizeMake(KScreenWidth, kTabBarHeight)]];
[[UITabBar appearance] setShadowImage:[[UIImage alloc]init]]; [[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];
if (@available(iOS 10.0, *)) { if (@available(iOS 10.0, *)) {
[[UITabBar appearance] setUnselectedItemTintColor:ThemeTabbarNormalColor]; [[UITabBar appearance] setUnselectedItemTintColor:[ThemeColor tabbarNormalColor]];
} }
} }
@@ -87,8 +95,8 @@
itemVc.title = title; itemVc.title = title;
itemVc.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; itemVc.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:ThemeTabbarSelectedColor} forState:UIControlStateSelected]; [itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[ThemeColor appMainColor]} forState:UIControlStateSelected];
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:ThemeTabbarNormalColor} forState:UIControlStateNormal]; [itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[ThemeColor tabbarNormalColor]} forState:UIControlStateNormal];
} }
@end @end