Procházet zdrojové kódy

1.登录页面 逻辑处理中

huangxiaodong před 5 měsíci
rodič
revize
2046f88ded

+ 12 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -894,6 +894,10 @@
 		6BB573372C8076F500713351 /* nasBackupsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BB573332C8076E000713351 /* nasBackupsManager.m */; };
 		6BB852282C4F7FE600570BF6 /* playingAudioGif.gif in Resources */ = {isa = PBXBuildFile; fileRef = 6BB852272C4F7FE500570BF6 /* playingAudioGif.gif */; };
 		6BB852292C4F7FE600570BF6 /* playingAudioGif.gif in Resources */ = {isa = PBXBuildFile; fileRef = 6BB852272C4F7FE500570BF6 /* playingAudioGif.gif */; };
+		6BBAE9432D38A20400C0F41B /* LoginType1ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBAE9422D38A20400C0F41B /* LoginType1ViewController.m */; };
+		6BBAE9442D38A20400C0F41B /* LoginType1ViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BBAE9412D38A20400C0F41B /* LoginType1ViewController.h */; };
+		6BBAE9452D38A20400C0F41B /* LoginType1ViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BBAE9412D38A20400C0F41B /* LoginType1ViewController.h */; };
+		6BBAE9462D38A20400C0F41B /* LoginType1ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBAE9422D38A20400C0F41B /* LoginType1ViewController.m */; };
 		6BBB35D92AE7645200E4A59B /* RunInBackground.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 6BBB35D62AE7645200E4A59B /* RunInBackground.mp3 */; };
 		6BBB35DD2AE76AD800E4A59B /* AudioSessionObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BBB35DB2AE76AD800E4A59B /* AudioSessionObject.h */; };
 		6BBB35DE2AE76AD800E4A59B /* AudioSessionObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBB35DC2AE76AD800E4A59B /* AudioSessionObject.m */; };
@@ -2118,6 +2122,8 @@
 		6BB573322C8076E000713351 /* nasBackupsManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nasBackupsManager.h; sourceTree = "<group>"; };
 		6BB573332C8076E000713351 /* nasBackupsManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = nasBackupsManager.m; sourceTree = "<group>"; };
 		6BB852272C4F7FE500570BF6 /* playingAudioGif.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = playingAudioGif.gif; sourceTree = "<group>"; };
+		6BBAE9412D38A20400C0F41B /* LoginType1ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginType1ViewController.h; sourceTree = "<group>"; };
+		6BBAE9422D38A20400C0F41B /* LoginType1ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginType1ViewController.m; sourceTree = "<group>"; };
 		6BBB35D62AE7645200E4A59B /* RunInBackground.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = RunInBackground.mp3; sourceTree = "<group>"; };
 		6BBB35DB2AE76AD800E4A59B /* AudioSessionObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSessionObject.h; sourceTree = "<group>"; };
 		6BBB35DC2AE76AD800E4A59B /* AudioSessionObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AudioSessionObject.m; sourceTree = "<group>"; };
@@ -2506,6 +2512,8 @@
 				6BFF268B2AF8E1C600FCB4F7 /* forgetPwdViewController.m */,
 				6BFF26972AFA16D900FCB4F7 /* forgetSecretKeyViewController.h */,
 				6BFF26982AFA16DA00FCB4F7 /* forgetSecretKeyViewController.m */,
+				6BBAE9412D38A20400C0F41B /* LoginType1ViewController.h */,
+				6BBAE9422D38A20400C0F41B /* LoginType1ViewController.m */,
 			);
 			path = Guide;
 			sourceTree = "<group>";
@@ -4246,6 +4254,7 @@
 				6B2C1E462C070ADE00FDCF82 /* ZFSmallFloatControlView.h in Headers */,
 				6BF558C02C4515B500701854 /* audioPlayListManager.h in Headers */,
 				6B2C1E1C2C070ADE00FDCF82 /* ZFAVPlayerManager.h in Headers */,
+				6BBAE9442D38A20400C0F41B /* LoginType1ViewController.h in Headers */,
 				6B8FF6C12B05B24D00800981 /* uploadFileRecordCell.h in Headers */,
 				6B3E7A892C8A9FFA00B032C4 /* pingManager.h in Headers */,
 				6B45C5082B5FA2DD007E6911 /* diskListTableCell.h in Headers */,
@@ -4541,6 +4550,7 @@
 				6B2C1E472C070ADE00FDCF82 /* ZFSmallFloatControlView.h in Headers */,
 				6BF558C22C4515B500701854 /* audioPlayListManager.h in Headers */,
 				6B2C1E1D2C070ADE00FDCF82 /* ZFAVPlayerManager.h in Headers */,
+				6BBAE9452D38A20400C0F41B /* LoginType1ViewController.h in Headers */,
 				6BD506E22B9576A4006E7CB0 /* uploadFileRecordCell.h in Headers */,
 				6B3E7A8B2C8A9FFB00B032C4 /* pingManager.h in Headers */,
 				6BD506E32B9576A4006E7CB0 /* diskListTableCell.h in Headers */,
@@ -5271,6 +5281,7 @@
 				6BD507842B9576A4006E7CB0 /* privacyModeViewController.m in Sources */,
 				6BD507852B9576A4006E7CB0 /* AFHTTPSessionManager.m in Sources */,
 				6BD507862B9576A4006E7CB0 /* AFNetworkReachabilityManager.m in Sources */,
+				6BBAE9462D38A20400C0F41B /* LoginType1ViewController.m in Sources */,
 				6BD507872B9576A4006E7CB0 /* uploadFileDataModel.m in Sources */,
 				6BD507882B9576A4006E7CB0 /* UITextField+SPExtension.m in Sources */,
 				6BD507892B9576A4006E7CB0 /* CustomerWebViewController.m in Sources */,
@@ -5648,6 +5659,7 @@
 				6B2170922B15BAE700656670 /* privacyModeViewController.m in Sources */,
 				183AE6552A8A2CF000B11CB0 /* AFHTTPSessionManager.m in Sources */,
 				183AE6582A8A2CF000B11CB0 /* AFNetworkReachabilityManager.m in Sources */,
+				6BBAE9432D38A20400C0F41B /* LoginType1ViewController.m in Sources */,
 				6B05828A2B045E0B00D37290 /* uploadFileDataModel.m in Sources */,
 				18E557322A3C6151005CC84B /* UITextField+SPExtension.m in Sources */,
 				184C8AD12A94980D00F26650 /* CustomerWebViewController.m in Sources */,

+ 3 - 1
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -62,6 +62,7 @@
 #import "UpgradeInfoModel.h"
 #import "imageVersionUpdateDoneView.h"
 #import "imageVersionUpdateFailView.h"
+#import "LoginType1ViewController.h"
 
 @interface SceneDelegate ()<SetUsePWDViewControllerDelegate,GuideViewControllerDelegate,UITabBarControllerDelegate>
 {
@@ -178,7 +179,8 @@
         [HWDataManager setBoolWithKey:Const_last_file_show value:YES];
         
         /*扫码界面*/
-        TipsQRCodeViewController *qrCodeVC = [[TipsQRCodeViewController alloc] init];
+        //TipsQRCodeViewController *qrCodeVC = [[TipsQRCodeViewController alloc] init];
+        LoginType1ViewController *qrCodeVC = [[LoginType1ViewController alloc] init];
         BaseNavigationController *qrCodeVCNav = [[BaseNavigationController alloc] initWithRootViewController:qrCodeVC];
         self.window.rootViewController = qrCodeVCNav;
         

+ 22 - 0
创维盒子/双子星云手机/Assets.xcassets/Login/login_scan.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "login_scan@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "login_scan@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

binární
创维盒子/双子星云手机/Assets.xcassets/Login/login_scan.imageset/login_scan@2x.png


binární
创维盒子/双子星云手机/Assets.xcassets/Login/login_scan.imageset/login_scan@3x.png


+ 16 - 0
创维盒子/双子星云手机/Class/Guide/LoginType1ViewController.h

@@ -0,0 +1,16 @@
+//
+//  LoginType1ViewController.h
+//  双子星云手机
+//
+//  Created by xd h on 2025/1/16.
+//
+
+#import "BaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface LoginType1ViewController : BaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 268 - 0
创维盒子/双子星云手机/Class/Guide/LoginType1ViewController.m

@@ -0,0 +1,268 @@
+//
+//  LoginType1ViewController.m
+//  双子星云手机
+//
+//  Created by xd h on 2025/1/16.
+//
+
+#import "LoginType1ViewController.h"
+
+@interface LoginType1ViewController ()<UITextViewDelegate,UITextFieldDelegate>
+@property(nonatomic,strong) UITextField *accountTF;
+@property(nonatomic,strong) UIButton *loginOkBut;
+@property(nonatomic,strong) UIButton *protocolSelectBut;//协议按钮
+@property(nonatomic,strong) CAGradientLayer *gradientLayer;
+@end
+
+@implementation LoginType1ViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self drawAnyView];
+}
+
+
+- (void)drawAnyView{
+    [self.navigationBar setHidden:YES];
+    [self.toolBar setHidden:YES];
+    
+    [self initBaseUIFun];
+}
+
+- (void)initBaseUIFun
+{
+    self.view.backgroundColor = [UIColor whiteColor];
+    
+    UIImageView *logoImageV = [UIImageView new];
+    logoImageV.image = [UIImage imageNamed:@"PrivateX_icon"];
+    [self.view addSubview:logoImageV];
+    
+    [logoImageV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(64);
+        make.height.mas_equalTo(64);
+        make.centerX.mas_equalTo(0);
+        make.top.mas_equalTo(180);
+    }];
+    
+    //背景
+    UIView *bgView = [UIView new];
+    bgView.backgroundColor = [UIColor hwColor:@"#F5F7FA"];
+    bgView.layer.cornerRadius = 8;
+    [self.view addSubview:bgView];
+    
+    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(20);
+        make.right.mas_equalTo(-20);
+        make.height.mas_equalTo(50);
+        make.top.equalTo(logoImageV.mas_bottom).offset(80);
+    }];
+    
+    NSString *curTitle = NSLocalizedString(@"input_your_account",nil);
+    UILabel *tipLabel = [[UILabel alloc] init];
+    tipLabel.text = curTitle;
+    tipLabel.textColor = [UIColor hwColor:@"#999999"];
+    tipLabel.font = [UIFont systemFontOfSize:14.0];
+    [bgView addSubview:tipLabel];
+    
+    [tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.height.mas_equalTo(30);
+        make.centerY.mas_equalTo(0);
+    }];
+    
+    UIButton *scanBut = [[UIButton alloc] init];
+    [scanBut setImage:[UIImage imageNamed:@"login_scan"] forState:UIControlStateNormal];
+    [bgView addSubview:scanBut];
+    //scanBut.backgroundColor = [UIColor greenColor];
+    
+    [scanBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(0);
+        make.width.mas_equalTo(50);
+        make.height.mas_equalTo(50);
+        make.top.mas_equalTo(0);
+    }];
+    
+    _accountTF = [[UITextField alloc] init];
+    _accountTF.textColor = [UIColor blackColor];
+    _accountTF.font = [UIFont systemFontOfSize:12];
+    _accountTF.delegate = self;
+    //_accountTF.keyboardType = UIKeyboardTypeDecimalPad;
+    [bgView addSubview:_accountTF];
+    
+    [_accountTF mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(tipLabel.mas_right).offset(5);
+        make.right.equalTo(scanBut.mas_left).offset(0);
+        make.height.mas_equalTo(50);
+        make.top.mas_equalTo(0);
+    }];
+    
+    _loginOkBut = [[UIButton alloc] init];
+    
+    _gradientLayer = [CAGradientLayer layer];
+    _gradientLayer.frame = CGRectMake(0, 0, (SCREEN_W - 20*2), 50);
+    _gradientLayer.colors = @[(__bridge NSString *)[UIColor hwColor:@"#0CDEFD" alpha:0.5].CGColor, (__bridge NSString *)[UIColor hwColor:@"#058DFB" alpha:0.5].CGColor];
+    _gradientLayer.locations = @[@(0), @(1.0f)];
+    _gradientLayer.startPoint = CGPointMake(0, 0.5);
+    _gradientLayer.endPoint = CGPointMake(0.97, 0.5);
+    [_loginOkBut.layer addSublayer:_gradientLayer];
+    
+    [_loginOkBut setTitle:NSLocalizedString(@"login_type1_but_title",nil) forState:UIControlStateNormal];
+    _loginOkBut.titleLabel.font = [UIFont systemFontOfSize:16.0];
+    [_loginOkBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    _loginOkBut.layer.cornerRadius = 8;
+    _loginOkBut.layer.masksToBounds = YES;
+    _loginOkBut.enabled = NO;
+    _loginOkBut.tag = 1;
+    [_loginOkBut addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view  addSubview:_loginOkBut];
+    
+    
+    [_loginOkBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(50);
+        make.left.mas_equalTo(20);
+        make.right.mas_equalTo(-20);
+        make.top.mas_equalTo(bgView.mas_bottom).offset(42);
+    }];
+    
+    //协议
+    _protocolSelectBut = [[UIButton alloc] init];
+    [_protocolSelectBut setImage:[UIImage imageNamed:@"common_un_check_24"] forState:UIControlStateNormal];
+    [_protocolSelectBut setImage:[UIImage imageNamed:@"common_did_check_24"] forState:UIControlStateSelected];
+    [_protocolSelectBut addTarget:self action:@selector(didClickProtocolButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:_protocolSelectBut];
+    
+    [_protocolSelectBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(20);
+        make.width.mas_equalTo(30);
+        make.height.mas_equalTo(30);
+        make.top.equalTo(_loginOkBut.mas_bottom).offset(15);
+    }];
+    
+    UITextView *contentTV = [[UITextView alloc] init];
+    contentTV.backgroundColor = [UIColor whiteColor];
+    contentTV.textColor = [UIColor hwColor:@"#999999"];
+    contentTV.delegate = self;
+    contentTV.editable = NO;        //必须禁止输入,否则点击将弹出输入键盘
+    contentTV.scrollEnabled = NO;
+    [self.view addSubview:contentTV];
+    //contentTV.backgroundColor = [UIColor greenColor];
+    
+    [contentTV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(60);
+        make.left.equalTo(_protocolSelectBut.mas_right).offset(0);
+        make.right.mas_equalTo(-20);
+        make.top.equalTo(_protocolSelectBut.mas_top).offset(-2);
+    }];
+    
+    // 创建长按手势识别器
+    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress)];
+    // 设置长按手势的最小按压时间
+    longPress.minimumPressDuration = 0.5; // 2
+    // 将手势识别器添加到视图上
+    [contentTV addGestureRecognizer:longPress];
+
+    NSString *title1 = NSLocalizedString(@"login_protocol_tip_1",nil);
+    NSString *title2 = NSLocalizedString(@"login_protocol_tip_2",nil);
+    NSString *title3 = NSLocalizedString(@"login_protocol_tip_3",nil);
+    NSString *title4 = NSLocalizedString(@"login_protocol_tip_4",nil);
+    NSString *title5 = NSLocalizedString(@"login_protocol_tip_5",nil);
+    
+    
+    NSString *fullTitle = [[NSString alloc] initWithFormat:@"%@%@%@%@%@",title1,title2,title3,title4,title5];
+    
+    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:fullTitle];
+    NSRange redRange = NSMakeRange([fullTitle rangeOfString:title2].location, [fullTitle rangeOfString:title2].length);
+    UIColor *noteColor =[UIColor hwColor:@"#13B2EB" alpha:1.0];
+    [attrStr addAttribute:NSForegroundColorAttributeName value:noteColor range:redRange];
+    
+    NSRange redRange4 = NSMakeRange([fullTitle rangeOfString:title4].location, [fullTitle rangeOfString:title4].length);
+    [attrStr addAttribute:NSForegroundColorAttributeName value:noteColor range:redRange4];
+    
+    [attrStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14.0] range:NSMakeRange(0, attrStr.length)];
+    
+    // 设置段落样式以实现水平中间对齐
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    paragraphStyle.alignment = NSTextAlignmentLeft; // 水平中间对齐
+    [attrStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attrStr.length)];
+      
+      
+    
+    [attrStr addAttribute:NSLinkAttributeName
+                                   value:@"didclick1://"
+                                   range:redRange];
+    
+    [attrStr addAttribute:NSLinkAttributeName
+                                   value:@"didclick2://"
+                                   range:redRange4];
+    
+    contentTV.attributedText = attrStr;
+    
+}
+
+#pragma mark ---- textView Delegate ----
+- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction
+{
+    
+    if([[URL scheme] isEqualToString:@"didclick1"]){
+        
+//        if(_didClickButtonFun){
+//            _didClickButtonFun(10);
+//        }
+        return NO;
+    }
+    
+    return YES;
+    
+}
+
+#pragma mark 拦截长按事件
+- (void)longPress{
+    HLog(@"拦截长按事件")
+}
+
+#pragma mark - UITextFieldDelegate Methods
+ 
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+    // 在这里处理文本输入事件
+    //NSString *currentText = textField.text;
+    //NSString *updatedText = [currentText stringByReplacingCharactersInRange:range withString:string];
+    
+    // 打印更新后的文本
+    //NSLog(@"Updated Text: %@", updatedText);
+    
+    [self checkLoginButCanClickFun];
+    return YES;
+}
+
+#pragma mark 点击登录
+- (void)didClickButtonFun:(UIButton*)but
+{
+
+}
+
+#pragma mark 点击协议
+- (void)didClickProtocolButtonFun:(UIButton*)but
+{
+    _protocolSelectBut.selected = !_protocolSelectBut.selected;
+    [self checkLoginButCanClickFun];
+}
+
+#pragma mark 检测登录按钮是否可用
+- (void)checkLoginButCanClickFun
+{
+    if(_protocolSelectBut.selected && _accountTF.text.length > 0){
+        if (!_loginOkBut.enabled) {
+            _loginOkBut.enabled = YES;
+            _gradientLayer.colors = @[(__bridge NSString *)[UIColor hwColor:@"#0CDEFD" alpha:1.0].CGColor, (__bridge NSString *)[UIColor hwColor:@"#058DFB" alpha:1.0].CGColor];
+        }
+    }
+    else{
+        if(_loginOkBut.enabled){
+            _loginOkBut.enabled = NO;
+            _gradientLayer.colors = @[(__bridge NSString *)[UIColor hwColor:@"#0CDEFD" alpha:0.5].CGColor, (__bridge NSString *)[UIColor hwColor:@"#058DFB" alpha:0.5].CGColor];
+        }
+    }
+}
+@end

+ 10 - 0
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -651,3 +651,13 @@
 "image_version_update_fail_title"   = "设备升级异常";
 "image_version_update_fail_tip1"   = "1、请检查您的盒子与手机网络连接是否正常。\n2、您可以尝试断电重启盒子来进行升级,并在升级完成后确认是否成功。\n3、如果仍未能成功升级,请提供设备的序列号";
 "image_version_update_fail_tip2"   = "并联系我们的客服团队获取帮助";
+
+//1.4.4 (1.4.5)
+"input_your_account"   = "请输入您的账号";
+"login_type1_but_title"   = "登录/注册";
+"login_protocol_tip_1"   = "我已阅读并同意";
+"login_protocol_tip_2"   = "《用户协议》";
+"login_protocol_tip_3"   = "和";
+"login_protocol_tip_4"   = "《隐秘政策》";
+"login_protocol_tip_5"   = "相关条款内容";
+