Commit 0fdc7cff4cd02a1636c96e5e2ec3424791313dd6

Authored by liushiyu
1 parent 5caacf8a

创建登陆界面

Showing 30 changed files with 549 additions and 7 deletions
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 # platform :ios, '9.0' 2 # platform :ios, '9.0'
3 source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' 3 source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
4 #source 'https://github.com/CocoaPods/Specs.git' 4 #source 'https://github.com/CocoaPods/Specs.git'
5 -#source 'https://cdn.cocoapods.org' 5 +source 'https://cdn.cocoapods.org'
6 6
7 source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git' 7 source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git'
8 source 'http://bj.gitlab.cnlive.com/DSIOSTeam/DSSpecRepos.git' 8 source 'http://bj.gitlab.cnlive.com/DSIOSTeam/DSSpecRepos.git'
@@ -14,10 +14,14 @@ target 'metaCode' do @@ -14,10 +14,14 @@ target 'metaCode' do
14 pod 'YYCategories' 14 pod 'YYCategories'
15 15
16 # Pods for metaCode 16 # Pods for metaCode
17 - 17 + #网络请求基础库
18 pod 'AFNetworking' 18 pod 'AFNetworking'
19 #基础请求组件库 19 #基础请求组件库
20 pod 'CNLiveRequestBastKit' 20 pod 'CNLiveRequestBastKit'
  21 + #键盘管理库
  22 + pod 'IQKeyboardManagerSwift'
  23 + #布局文件
  24 + pod 'SnapKit'
21 25
22 target 'metaCodeTests' do 26 target 'metaCodeTests' do
23 inherit! :search_paths 27 inherit! :search_paths
metaCode.xcodeproj/project.pbxproj
@@ -11,6 +11,8 @@ @@ -11,6 +11,8 @@
11 1DD2808DF02C120276F99F4D /* Pods_metaCode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1C55A719CFEE073C06D37CE /* Pods_metaCode.framework */; }; 11 1DD2808DF02C120276F99F4D /* Pods_metaCode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1C55A719CFEE073C06D37CE /* Pods_metaCode.framework */; };
12 790D01822A2D88FC00C5978D /* CNLiveConfigMacro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D01812A2D88FC00C5978D /* CNLiveConfigMacro.swift */; }; 12 790D01822A2D88FC00C5978D /* CNLiveConfigMacro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D01812A2D88FC00C5978D /* CNLiveConfigMacro.swift */; };
13 790D01852A2D89E100C5978D /* CNHexColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D01842A2D89E100C5978D /* CNHexColor.swift */; }; 13 790D01852A2D89E100C5978D /* CNHexColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D01842A2D89E100C5978D /* CNHexColor.swift */; };
  14 + 790D018B2A2D8B3300C5978D /* CNLiveLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D018A2A2D8B3300C5978D /* CNLiveLoginViewController.swift */; };
  15 + 790D01912A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D01902A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift */; };
14 796398932A260C0100D045EB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963988C2A260C0100D045EB /* ViewController.swift */; }; 16 796398932A260C0100D045EB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963988C2A260C0100D045EB /* ViewController.swift */; };
15 796398942A260C0100D045EB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963988D2A260C0100D045EB /* AppDelegate.swift */; }; 17 796398942A260C0100D045EB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963988D2A260C0100D045EB /* AppDelegate.swift */; };
16 7963989D2A260E6200D045EB /* CNLiveBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */; }; 18 7963989D2A260E6200D045EB /* CNLiveBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */; };
@@ -62,6 +64,8 @@ @@ -62,6 +64,8 @@
62 721865F548C997EFAE525B6F /* Pods-metaCode-metaCodeUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-metaCode-metaCodeUITests.release.xcconfig"; path = "Target Support Files/Pods-metaCode-metaCodeUITests/Pods-metaCode-metaCodeUITests.release.xcconfig"; sourceTree = "<group>"; }; 64 721865F548C997EFAE525B6F /* Pods-metaCode-metaCodeUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-metaCode-metaCodeUITests.release.xcconfig"; path = "Target Support Files/Pods-metaCode-metaCodeUITests/Pods-metaCode-metaCodeUITests.release.xcconfig"; sourceTree = "<group>"; };
63 790D01812A2D88FC00C5978D /* CNLiveConfigMacro.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNLiveConfigMacro.swift; sourceTree = "<group>"; }; 65 790D01812A2D88FC00C5978D /* CNLiveConfigMacro.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNLiveConfigMacro.swift; sourceTree = "<group>"; };
64 790D01842A2D89E100C5978D /* CNHexColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNHexColor.swift; sourceTree = "<group>"; }; 66 790D01842A2D89E100C5978D /* CNHexColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNHexColor.swift; sourceTree = "<group>"; };
  67 + 790D018A2A2D8B3300C5978D /* CNLiveLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveLoginViewController.swift; sourceTree = "<group>"; };
  68 + 790D01902A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveConfigFontMacro.swift; sourceTree = "<group>"; };
65 7963988C2A260C0100D045EB /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 69 7963988C2A260C0100D045EB /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
66 7963988D2A260C0100D045EB /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 70 7963988D2A260C0100D045EB /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
67 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNLiveBaseViewController.swift; sourceTree = "<group>"; }; 71 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNLiveBaseViewController.swift; sourceTree = "<group>"; };
@@ -144,6 +148,77 @@ @@ -144,6 +148,77 @@
144 path = Extensions; 148 path = Extensions;
145 sourceTree = "<group>"; 149 sourceTree = "<group>";
146 }; 150 };
  151 + 790D01862A2D8A7000C5978D /* MinePage */ = {
  152 + isa = PBXGroup;
  153 + children = (
  154 + 790D01892A2D8A9600C5978D /* Controller */,
  155 + 790D01872A2D8A9600C5978D /* View */,
  156 + 790D01882A2D8A9600C5978D /* ViewModel */,
  157 + );
  158 + path = MinePage;
  159 + sourceTree = "<group>";
  160 + };
  161 + 790D01872A2D8A9600C5978D /* View */ = {
  162 + isa = PBXGroup;
  163 + children = (
  164 + );
  165 + path = View;
  166 + sourceTree = "<group>";
  167 + };
  168 + 790D01882A2D8A9600C5978D /* ViewModel */ = {
  169 + isa = PBXGroup;
  170 + children = (
  171 + );
  172 + path = ViewModel;
  173 + sourceTree = "<group>";
  174 + };
  175 + 790D01892A2D8A9600C5978D /* Controller */ = {
  176 + isa = PBXGroup;
  177 + children = (
  178 + );
  179 + path = Controller;
  180 + sourceTree = "<group>";
  181 + };
  182 + 790D018C2A2D8C9A00C5978D /* LoginPage */ = {
  183 + isa = PBXGroup;
  184 + children = (
  185 + 790D01942A2DB9EF00C5978D /* View */,
  186 + 790D018D2A2D8C9A00C5978D /* ViewModel */,
  187 + 790D018E2A2D8C9A00C5978D /* Controller */,
  188 + 790D018F2A2D8C9A00C5978D /* Model */,
  189 + );
  190 + path = LoginPage;
  191 + sourceTree = "<group>";
  192 + };
  193 + 790D018D2A2D8C9A00C5978D /* ViewModel */ = {
  194 + isa = PBXGroup;
  195 + children = (
  196 + );
  197 + path = ViewModel;
  198 + sourceTree = "<group>";
  199 + };
  200 + 790D018E2A2D8C9A00C5978D /* Controller */ = {
  201 + isa = PBXGroup;
  202 + children = (
  203 + 790D018A2A2D8B3300C5978D /* CNLiveLoginViewController.swift */,
  204 + );
  205 + path = Controller;
  206 + sourceTree = "<group>";
  207 + };
  208 + 790D018F2A2D8C9A00C5978D /* Model */ = {
  209 + isa = PBXGroup;
  210 + children = (
  211 + );
  212 + path = Model;
  213 + sourceTree = "<group>";
  214 + };
  215 + 790D01942A2DB9EF00C5978D /* View */ = {
  216 + isa = PBXGroup;
  217 + children = (
  218 + );
  219 + path = View;
  220 + sourceTree = "<group>";
  221 + };
147 7963988A2A260B3300D045EB /* Classes */ = { 222 7963988A2A260B3300D045EB /* Classes */ = {
148 isa = PBXGroup; 223 isa = PBXGroup;
149 children = ( 224 children = (
@@ -192,6 +267,8 @@ @@ -192,6 +267,8 @@
192 796398902A260C0100D045EB /* Main */ = { 267 796398902A260C0100D045EB /* Main */ = {
193 isa = PBXGroup; 268 isa = PBXGroup;
194 children = ( 269 children = (
  270 + 790D018C2A2D8C9A00C5978D /* LoginPage */,
  271 + 790D01862A2D8A7000C5978D /* MinePage */,
195 7CD675212A26F844008354C1 /* HomePage */, 272 7CD675212A26F844008354C1 /* HomePage */,
196 ); 273 );
197 path = Main; 274 path = Main;
@@ -209,6 +286,7 @@ @@ -209,6 +286,7 @@
209 isa = PBXGroup; 286 isa = PBXGroup;
210 children = ( 287 children = (
211 790D01812A2D88FC00C5978D /* CNLiveConfigMacro.swift */, 288 790D01812A2D88FC00C5978D /* CNLiveConfigMacro.swift */,
  289 + 790D01902A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift */,
212 ); 290 );
213 path = Config; 291 path = Config;
214 sourceTree = "<group>"; 292 sourceTree = "<group>";
@@ -584,7 +662,9 @@ @@ -584,7 +662,9 @@
584 79A68C4A2A26E6CE00DC3B43 /* (null) in Sources */, 662 79A68C4A2A26E6CE00DC3B43 /* (null) in Sources */,
585 790D01852A2D89E100C5978D /* CNHexColor.swift in Sources */, 663 790D01852A2D89E100C5978D /* CNHexColor.swift in Sources */,
586 796398932A260C0100D045EB /* ViewController.swift in Sources */, 664 796398932A260C0100D045EB /* ViewController.swift in Sources */,
  665 + 790D018B2A2D8B3300C5978D /* CNLiveLoginViewController.swift in Sources */,
587 7CD675422A2740F8008354C1 /* CNCustomIndexView.swift in Sources */, 666 7CD675422A2740F8008354C1 /* CNCustomIndexView.swift in Sources */,
  667 + 790D01912A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift in Sources */,
588 7CD6753F2A2740B0008354C1 /* CNTopCollectMoneyRemindView.swift in Sources */, 668 7CD6753F2A2740B0008354C1 /* CNTopCollectMoneyRemindView.swift in Sources */,
589 7CD6753C2A2740B0008354C1 /* CNBottomPayMoneyRemindView.swift in Sources */, 669 7CD6753C2A2740B0008354C1 /* CNBottomPayMoneyRemindView.swift in Sources */,
590 79A68C4C2A26EA6000DC3B43 /* (null) in Sources */, 670 79A68C4C2A26EA6000DC3B43 /* (null) in Sources */,
metaCode/Classes/Config/CNLiveConfigFontMacro.swift 0 → 100644
  1 +//
  2 +// CNLiveConfigFontMacro.swift
  3 +// metaCode
  4 +//
  5 +// Created by open on 2023/6/5.
  6 +//
  7 +
  8 +import Foundation
  9 +
  10 +// MARK: - 字体设置
  11 +
  12 +/// 设置字体大小
  13 +func Font(_ size:CGFloat) -> UIFont {
  14 + return UIFont.systemFont(ofSize: size)
  15 +}
  16 +/// 设置粗体字字号
  17 +func BoldFont(_ size:CGFloat) -> UIFont {
  18 + return UIFont.boldSystemFont(ofSize: size)
  19 +}
  20 +
  21 +/// 设置自适应字体大小
  22 +func Font_Fit(_ size:CGFloat) -> UIFont {
  23 + return UIFont.systemFont(ofSize: size * FontFit)
  24 +}
  25 +/// 设置自适应粗体字字号
  26 +func BoldFont_Fit(_ size:CGFloat) -> UIFont {
  27 + return UIFont.boldSystemFont(ofSize: size * FontFit)
  28 +}
  29 +
  30 +/// 根据屏幕自适应字体参数 16 * FontFit
  31 +let FontFit = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height) / 375
  32 +
  33 +/// 系统默认字体
  34 +func SystemFont(_ size: CGFloat) -> UIFont {
  35 + return .systemFont(ofSize: size)
  36 +}
  37 +/// 系统默认字体
  38 +func SystemFontBold(_ size: CGFloat) -> UIFont {
  39 + return .boldSystemFont(ofSize: size)
  40 +}
  41 +
  42 +/// 系统默认自适应字体
  43 +func SystemFont_Fit(_ size: CGFloat) -> UIFont {
  44 + return .systemFont(ofSize: size * FontFit)
  45 +}
  46 +/// 系统默认自适应字体
  47 +func SystemFontBold_Fit(_ size: CGFloat) -> UIFont {
  48 + return .boldSystemFont(ofSize: size * FontFit)
  49 +}
  50 +
  51 +// MARK: - 常用系统字体大小
  52 +
  53 +let Font_10 = Font(10)
  54 +let Font_11 = Font(11)
  55 +let Font_12 = Font(12)
  56 +let Font_13 = Font(13)
  57 +let Font_14 = Font(14)
  58 +let Font_15 = Font(15)
  59 +let Font_16 = Font(16)
  60 +let Font_17 = Font(17)
  61 +let Font_18 = Font(18)
  62 +let Font_19 = Font(19)
  63 +let Font_20 = Font(20)
  64 +let Font_25 = Font(25)
  65 +let Font_30 = Font(30)
  66 +
  67 +// MARK: - 常用系统自适应字体大小
  68 +
  69 +let Font_10_Fit = Font(10 * FontFit)
  70 +let Font_11_Fit = Font(11 * FontFit)
  71 +let Font_12_Fit = Font(12 * FontFit)
  72 +let Font_13_Fit = Font(13 * FontFit)
  73 +let Font_14_Fit = Font(14 * FontFit)
  74 +let Font_15_Fit = Font(15 * FontFit)
  75 +let Font_16_Fit = Font(16 * FontFit)
  76 +let Font_17_Fit = Font(17 * FontFit)
  77 +let Font_18_Fit = Font(18 * FontFit)
  78 +let Font_19_Fit = Font(19 * FontFit)
  79 +let Font_20_Fit = Font(20 * FontFit)
  80 +let Font_25_Fit = Font(25 * FontFit)
  81 +let Font_30_Fit = Font(30 * FontFit)
  82 +
  83 +// MARK: - 常用粗体系统字体大小
  84 +
  85 +let BoldFont_10 = BoldFont(10)
  86 +let BoldFont_11 = BoldFont(11)
  87 +let BoldFont_12 = BoldFont(12)
  88 +let BoldFont_13 = BoldFont(13)
  89 +let BoldFont_14 = BoldFont(14)
  90 +let BoldFont_15 = BoldFont(15)
  91 +let BoldFont_16 = BoldFont(16)
  92 +let BoldFont_17 = BoldFont(17)
  93 +let BoldFont_18 = BoldFont(18)
  94 +let BoldFont_19 = BoldFont(19)
  95 +let BoldFont_20 = BoldFont(20)
  96 +let BoldFont_25 = BoldFont(25)
  97 +let BoldFont_30 = BoldFont(30)
  98 +
  99 +// MARK: - 常用粗体系统自适应字体大小
  100 +
  101 +let BoldFont_10_Fit = BoldFont(10 * FontFit)
  102 +let BoldFont_11_Fit = BoldFont(11 * FontFit)
  103 +let BoldFont_12_Fit = BoldFont(12 * FontFit)
  104 +let BoldFont_13_Fit = BoldFont(13 * FontFit)
  105 +let BoldFont_14_Fit = BoldFont(14 * FontFit)
  106 +let BoldFont_15_Fit = BoldFont(15 * FontFit)
  107 +let BoldFont_16_Fit = BoldFont(16 * FontFit)
  108 +let BoldFont_17_Fit = BoldFont(17 * FontFit)
  109 +let BoldFont_18_Fit = BoldFont(18 * FontFit)
  110 +let BoldFont_19_Fit = BoldFont(19 * FontFit)
  111 +let BoldFont_20_Fit = BoldFont(20 * FontFit)
  112 +let BoldFont_25_Fit = BoldFont(25 * FontFit)
  113 +let BoldFont_30_Fit = BoldFont(30 * FontFit)
metaCode/Classes/Constant/CNLiveConstant.swift
@@ -20,3 +20,6 @@ let KNavigationHeight = (KStatusBarHeight + 44) @@ -20,3 +20,6 @@ let KNavigationHeight = (KStatusBarHeight + 44)
20 let KTabBarHeight = (KStatusBarHeight == 44 ? 83 : 49) 20 let KTabBarHeight = (KStatusBarHeight == 44 ? 83 : 49)
21 21
22 22
  23 +
  24 +
  25 +
metaCode/Classes/Main/LoginPage/Controller/CNLiveLoginViewController.swift 0 → 100644
  1 +//
  2 +// CNLiveLoginViewController.swift
  3 +// metaCode
  4 +//
  5 +// Created by open on 2023/6/5.
  6 +//
  7 +
  8 +import Foundation
  9 +import UIKit
  10 +import SnapKit
  11 +
  12 +class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate {
  13 +
  14 +
  15 + lazy var headerView : UIImageView = {
  16 + let headerView = UIImageView()
  17 + headerView.backgroundColor = .white
  18 + headerView.contentMode = .scaleAspectFit
  19 + headerView.image = UIImage(named: "Login_page_header_icon")
  20 + return headerView
  21 + }()
  22 +
  23 + var phoneText = UITextField()//手机号
  24 + var veriText = UITextField()//验证码
  25 +
  26 + override func viewDidLoad() {
  27 + super.viewDidLoad()
  28 +
  29 + //添加主视图
  30 + self.view.addSubview(self.headerView)
  31 + self.headerView.snp.makeConstraints { make in
  32 + make.centerX.equalTo(self.view)
  33 + make.top.left.right.equalTo(self.view)
  34 + make.height.equalTo(250.0)
  35 + }
  36 +
  37 + self.setupPhoneView()
  38 + self.setupVeriCodeView()
  39 + self.setupLoginButtonView()
  40 + }
  41 +
  42 + deinit {
  43 + print("已经销毁了")
  44 + }
  45 +
  46 +
  47 + func setupPhoneView() {
  48 +
  49 + let phoneV = UIView.init()
  50 + phoneV.backgroundColor = .white
  51 + self.view.addSubview(phoneV)
  52 + phoneV.snp.makeConstraints { make in
  53 + make.left.right.equalTo(self.view)
  54 + make.top.equalTo(self.headerView.snp.bottom).offset(10)
  55 + make.height.equalTo(50)
  56 + }
  57 +
  58 + let areaButton = UIButton(type: .custom)
  59 + areaButton.backgroundColor = .white
  60 + areaButton.setTitle("+86", for: .normal)
  61 + areaButton.setTitle("+86", for: .highlighted)
  62 + areaButton.titleLabel?.font = BoldFont_16_Fit
  63 + areaButton.setTitleColor(HexColor("#333333"), for: .normal)
  64 + areaButton.setTitleColor(HexColor("#333333"), for: .highlighted)
  65 + areaButton.addTarget(self, action: #selector(changeCityNumberMothod), for: .touchUpInside)
  66 + phoneV.addSubview(areaButton)
  67 + areaButton.snp.makeConstraints { make in
  68 + make.centerY.equalTo(phoneV)
  69 + make.left.equalTo(phoneV.left).offset(40)
  70 + make.width.lessThanOrEqualTo(45)
  71 + }
  72 +
  73 + let v_line = UILabel.init()
  74 + v_line.backgroundColor = HexColor("#EBEBEB")
  75 + phoneV.addSubview(v_line)
  76 + v_line.snp.makeConstraints { make in
  77 + make.centerY.equalTo(phoneV)
  78 + make.left.equalTo(areaButton.snp.right).offset(10)
  79 + make.width.equalTo(1)
  80 + make.height.equalTo(areaButton.snp.height).multipliedBy(0.35)
  81 + }
  82 +
  83 + let h_line = UILabel.init()
  84 + h_line.backgroundColor = HexColor("#EBEBEB")
  85 + phoneV.addSubview(h_line)
  86 + h_line.snp.makeConstraints { make in
  87 + make.left.equalTo(phoneV.left).offset(40)
  88 + make.right.equalTo(phoneV.right).offset(-40)
  89 + make.height.equalTo(v_line.snp.width)
  90 + make.bottom.equalTo(phoneV.snp.bottom).offset(-1)
  91 + }
  92 +
  93 + self.phoneText = UITextField.init()
  94 + self.phoneText.backgroundColor = .white
  95 + self.phoneText.placeholder = "输入手机号"
  96 + self.phoneText.font = BoldFont_16_Fit
  97 + self.phoneText.keyboardType = .numberPad
  98 + self.phoneText.clearButtonMode = .whileEditing
  99 + phoneV.addSubview(self.phoneText)
  100 + self.phoneText.snp.makeConstraints { make in
  101 + make.centerY.equalTo(phoneV)
  102 + make.left.equalTo(areaButton.snp.right).offset(21)
  103 + make.height.equalTo(areaButton.snp.height)
  104 + make.right.equalTo(phoneV.right).offset(-40)
  105 + }
  106 + }
  107 +
  108 + func setupVeriCodeView() {
  109 +
  110 + let verView = UIView.init()
  111 + verView.backgroundColor = .white
  112 + self.view.addSubview(verView)
  113 + verView.snp.makeConstraints { make in
  114 + make.left.right.equalTo(self.view)
  115 + make.top.equalTo(self.headerView.snp.bottom).offset(70)
  116 + make.height.equalTo(50)
  117 + }
  118 +
  119 + let h_line = UILabel.init()
  120 + h_line.backgroundColor = HexColor("#EBEBEB")
  121 + verView.addSubview(h_line)
  122 + h_line.snp.makeConstraints { make in
  123 + make.left.equalTo(verView.left).offset(40)
  124 + make.right.equalTo(verView.right).offset(-40)
  125 + make.height.equalTo(1)
  126 + make.bottom.equalTo(verView.snp.bottom).offset(-1)
  127 + }
  128 +
  129 + let codeButton = UIButton(type: .custom)
  130 + codeButton.backgroundColor = .white
  131 + codeButton.setTitle("获取验证码", for: .normal)
  132 + codeButton.setTitle("获取验证码", for: .highlighted)
  133 + codeButton.titleLabel?.font = Font_16_Fit
  134 + codeButton.setTitleColor(HexColor("#0066FE"), for: .normal)
  135 + codeButton.setTitleColor(HexColor("#0066FE"), for: .highlighted)
  136 + codeButton.addTarget(self, action: #selector(changeCityNumberMothod), for: .touchUpInside)
  137 + verView.addSubview(codeButton)
  138 + codeButton.snp.makeConstraints { make in
  139 + make.centerY.equalTo(verView)
  140 + make.right.equalTo(verView.snp.right).offset(-40)
  141 + make.width.lessThanOrEqualTo(90)
  142 + }
  143 +
  144 + self.veriText = UITextField.init()
  145 + self.veriText.backgroundColor = .white
  146 + self.veriText.placeholder = "输入验证码"
  147 + self.veriText.font = BoldFont_16_Fit
  148 + self.veriText.keyboardType = .numberPad
  149 + self.veriText.clearButtonMode = .whileEditing
  150 + verView.addSubview(self.veriText)
  151 + self.veriText.snp.makeConstraints { make in
  152 + make.centerY.equalTo(verView)
  153 + make.right.equalTo(codeButton.snp.left).offset(-20)
  154 + make.height.equalTo(codeButton.snp.height)
  155 + make.left.equalTo(verView.snp.left).offset(40)
  156 + }
  157 +
  158 + let tipLabel = UILabel.init()
  159 + tipLabel.text = "未注册的手机号验证后自动为您创建元码账户"
  160 + tipLabel.textColor = HexColor("#464646")
  161 + tipLabel.textAlignment = .left
  162 + tipLabel.font = Font_11_Fit
  163 + self.view.addSubview(tipLabel)
  164 + tipLabel.snp.makeConstraints { make in
  165 + make.centerX.equalTo(self.view)
  166 + make.left.right.equalTo(self.view).offset(40)
  167 + make.top.equalTo(verView.snp.bottom).offset(10)
  168 + }
  169 + }
  170 +
  171 + func setupLoginButtonView() {
  172 +
  173 + let selectButton = UIButton(type: .custom)
  174 + selectButton.backgroundColor = .white
  175 + selectButton.setImage(UIImage(named: "Login_body_choose_btn_nomal"), for: .normal)
  176 + selectButton.setImage(UIImage(named: "Login_body_choose_btn_nomal"), for: .highlighted)
  177 + selectButton.setImage(UIImage(named: "Login_body_choose_btn_select"), for: .selected)
  178 + selectButton.contentMode = .scaleAspectFill
  179 + selectButton.addTarget(self, action: #selector(changeSelectBtnMothod), for: .touchUpInside)
  180 + view.addSubview(selectButton)
  181 + selectButton.snp.makeConstraints { make in
  182 + make.bottom.equalTo(view.snp.bottom).offset(-50)
  183 + make.left.equalTo(view.snp.left).offset(30)
  184 + make.hei.equalTo(15)
  185 + }
  186 +
  187 + let attributedString = NSMutableAttributedString(string: "我已阅读并同意《APP用户服务协议》《个人信息保护政策》",
  188 + attributes: [.foregroundColor: HexColor("#999999") as Any, .font: Font_10])
  189 + let p_Range = NSRange(attributedString.string.range(of: "《APP用户服务协议》")!, in: attributedString.string)
  190 + attributedString.addAttribute(.link, value: "delegate://", range: p_Range)
  191 + let i_Range = NSRange(attributedString.string.range(of: "《个人信息保护政策》")!, in: attributedString.string)
  192 + attributedString.addAttribute(.link, value: "info://", range: i_Range)
  193 + let textView: UITextView = UITextView.init()
  194 + textView.backgroundColor = .white
  195 + textView.isEditable = false
  196 + textView.isScrollEnabled = false
  197 + textView.delegate = self
  198 + textView.attributedText = attributedString
  199 + view.addSubview(textView)
  200 + textView.snp.makeConstraints { make in
  201 + make.centerY.equalTo(selectButton)
  202 + make.left.equalTo(selectButton.snp.right)
  203 + make.right.equalTo(view.snp.right).offset(-30)
  204 + }
  205 +
  206 + let loginButton = UIButton(type: .custom)
  207 +// loginButton.
  208 +
  209 +
  210 + }
  211 +}
  212 +
  213 +extension CNLiveLoginViewController {
  214 +
  215 + @objc func changeCityNumberMothod(sender : UIButton) {
  216 +
  217 + }
  218 +
  219 + @objc func sendVerifiCodeMothod(sender : UIButton) {
  220 +
  221 + }
  222 +
  223 + @objc func changeSelectBtnMothod(sender : UIButton) {
  224 +// sender.isSelected =
  225 + }
  226 +}
  227 +
  228 +extension CNLiveLoginViewController {
  229 + func textView(_ textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
  230 + return false
  231 + }
  232 + func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
  233 + if URL.absoluteString == "delegate://" {
  234 + print("《APP用户服务协议》")
  235 + return false
  236 + }else{
  237 + print("《个人信息保护政策》")
  238 + return false
  239 + }
  240 + }
  241 +}
metaCode/Classes/Other/AppDelegate.swift
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 7
8 import UIKit 8 import UIKit
9 import CNLiveRequestBastKit 9 import CNLiveRequestBastKit
10 - 10 +import IQKeyboardManagerSwift
11 11
12 @main 12 @main
13 class AppDelegate: UIResponder, UIApplicationDelegate { 13 class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -19,10 +19,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -19,10 +19,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
19 // Override point for customization after application launch. 19 // Override point for customization after application launch.
20 window = UIWindow.init(frame: UIScreen.main.bounds) 20 window = UIWindow.init(frame: UIScreen.main.bounds)
21 window?.backgroundColor = UIColor.white 21 window?.backgroundColor = UIColor.white
22 - window?.rootViewController = CNMetaCodeHomePageController.init() 22 + window?.rootViewController = CNLiveLoginViewController.init()
23 window?.makeKeyAndVisible() 23 window?.makeKeyAndVisible()
24 24
25 25
  26 + AppDelegate_configRequestManager()
  27 + AppDelegate_configIQKeyboardManager()
  28 +
  29 + return true
  30 + }
  31 +
  32 + // MARK: - 键盘处理
  33 + func AppDelegate_configIQKeyboardManager() {
  34 + IQKeyboardManager.shared.enable = true
  35 + IQKeyboardManager.shared.enableAutoToolbar = true //工具条
  36 + IQKeyboardManager.shared.shouldResignOnTouchOutside = true //点击背景收回键盘
  37 + IQKeyboardManager.shared.toolbarDoneBarButtonItemText = "完成"
  38 + // IQKeyboardManager.shared.preventShowingBottomBlankSpace = true
  39 + // IQKeyboardManager.shared.preventShowingBottomBlankSpace = false
  40 + IQKeyboardManager.shared.toolbarTintColor = .lightGray
  41 + IQKeyboardManager.shared.keyboardDistanceFromTextField = 5.0
  42 + }
  43 +
  44 + // MARK: - 网络请求通用参数
  45 + func AppDelegate_configRequestManager() {
26 let kAppBundleID = Bundle.main.bundleIdentifier ?? "" 46 let kAppBundleID = Bundle.main.bundleIdentifier ?? ""
27 let uuid : String = UIDevice.current.identifierForVendor?.uuidString.replacingOccurrences(of: "-", with: "") ?? "" 47 let uuid : String = UIDevice.current.identifierForVendor?.uuidString.replacingOccurrences(of: "-", with: "") ?? ""
28 let ver : String = Bundle.main.infoDictionary?["CFBundleVersion"] as! String 48 let ver : String = Bundle.main.infoDictionary?["CFBundleVersion"] as! String
@@ -32,9 +52,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -32,9 +52,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
32 CNLiveNetworking.setupSignKey("ae3a7ad3e4b9beb7cfe2078db648ebb89aa249ca2e82ac") 52 CNLiveNetworking.setupSignKey("ae3a7ad3e4b9beb7cfe2078db648ebb89aa249ca2e82ac")
33 CNLiveNetworking.setAllowRequestDefaultArgument(true) 53 CNLiveNetworking.setAllowRequestDefaultArgument(true)
34 CNLiveNetworking.setResponseSerializerType(.JSON) 54 CNLiveNetworking.setResponseSerializerType(.JSON)
35 -  
36 -  
37 - return true  
38 } 55 }
39 56
40 57
metaCode/Supporting Files/Assets.xcassets/HomePage/Contents.json 0 → 100644
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
metaCode/Supporting Files/Assets.xcassets/homePage_backViewImage.imageset/4671683516653_.pic.jpg renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_backViewImage.imageset/4671683516653_.pic.jpg

82.2 KB

metaCode/Supporting Files/Assets.xcassets/homePage_backViewImage.imageset/Contents.json renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_backViewImage.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/homePage_homePage_down.imageset/4491683252485_.pic.jpg renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_homePage_down.imageset/4491683252485_.pic.jpg

5.25 KB

metaCode/Supporting Files/Assets.xcassets/homePage_homePage_down.imageset/Contents.json renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_homePage_down.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/homePage_mainView_front.imageset/4621683513846_.pic.jpg renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_mainView_front.imageset/4621683513846_.pic.jpg

56.9 KB

metaCode/Supporting Files/Assets.xcassets/homePage_mainView_front.imageset/Contents.json renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_mainView_front.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/homePage_payMoneyImage.imageset/4651683514228_.pic.jpg renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_payMoneyImage.imageset/4651683514228_.pic.jpg

52.1 KB

metaCode/Supporting Files/Assets.xcassets/homePage_payMoneyImage.imageset/Contents.json renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_payMoneyImage.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/homePage_topImage.imageset/4771683609542_.pic.jpg renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_topImage.imageset/4771683609542_.pic.jpg

230 KB

metaCode/Supporting Files/Assets.xcassets/homePage_topImage.imageset/Contents.json renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_topImage.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/homePage_zhongguorenming_bank.imageset/4431683250159_.pic.jpg renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_zhongguorenming_bank.imageset/4431683250159_.pic.jpg

79.4 KB

metaCode/Supporting Files/Assets.xcassets/homePage_zhongguorenming_bank.imageset/Contents.json renamed to metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_zhongguorenming_bank.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/LoginPage/Contents.json 0 → 100644
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_body_choose_btn_nomal.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Login_body_choose_btn_nomal@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Login_body_choose_btn_nomal@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_body_choose_btn_nomal.imageset/Login_body_choose_btn_nomal@2x.png 0 → 100644

582 Bytes

metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_body_choose_btn_nomal.imageset/Login_body_choose_btn_nomal@3x.png 0 → 100644

1000 Bytes

metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_body_choose_btn_select.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Login_body_choose_btn_select@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Login_body_choose_btn_select@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_body_choose_btn_select.imageset/Login_body_choose_btn_select@2x.png 0 → 100644

650 Bytes

metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_body_choose_btn_select.imageset/Login_body_choose_btn_select@3x.png 0 → 100644

1.11 KB

metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_page_header_icon.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Login_page_header_icon@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Login_page_header_icon@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_page_header_icon.imageset/Login_page_header_icon@2x.png 0 → 100644

115 KB

metaCode/Supporting Files/Assets.xcassets/LoginPage/Login_page_header_icon.imageset/Login_page_header_icon@3x.png 0 → 100644

409 KB

metaCode/Supporting Files/Assets.xcassets/MinePage/Contents.json 0 → 100644
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}