YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
-PODFILE CHECKSUM: 1a65ab16135db79404233b4f7274d8bc175702fd
+PODFILE CHECKSUM: f323e3f6f056168efd0723b2cefc34a0a50bde82
COCOAPODS: 1.16.2
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ShenYin/Pods-ShenYin-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
- inputPaths = (
- );
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ShenYin/Pods-ShenYin-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
- outputPaths = (
- );
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ShenYin/Pods-ShenYin-frameworks.sh\"\n";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "ShenYin/ShenYin-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
--- /dev/null
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "密码不可见@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "密码不可见@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
--- /dev/null
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "icon_可见@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "icon_可见@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
{
"images" : [
{
- "filename" : "Group 334.png",
"idiom" : "universal",
"scale" : "1x"
},
{
- "filename" : "Group 334@2x.png",
+ "filename" : "Group 1255@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Group 334@3x.png",
+ "filename" : "Group 1255@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
--- /dev/null
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
--- /dev/null
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "Group_2077@2x(1).png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "Group_2077@3x(1).png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
--- /dev/null
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "WX20250822-154739@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
App.shared.window = window
setConfig()
-// window?.rootViewController = UINavigationController(rootViewController: HistoryRecordShareVC())
+// window?.rootViewController = UINavigationController(rootViewController: SetAccountVC())
window?.rootViewController = BaseTC()
}
}
}
+ var value:String?{
+ if let str = text,str.isNotEmpty{
+ return str
+ }
+ return nil
+ }
+
/// SwifterSwift: Check if text field is empty.
var isEmpty: Bool {
return text?.isEmpty == true
self.layer.masksToBounds = YES;
self.label = [[UILabel alloc]initWithFrame:self.bounds];
- self.label.text = @"获取验证码";
+ self.label.text = @"点击获取";
self.label.font = [UIFont systemFontOfSize:14];
self.label.textColor = [UIColor blueColor];
self.label.textAlignment = NSTextAlignmentCenter;
self.tabBar.backgroundColor = .white
view.backgroundColor = .color(.bgColor)
- self.selectedIndex = 0
+ self.selectedIndex = 2
}
}
}
}
+
+
+
+extension BaseCollectionViewCell: YCCollectionCellInitProtocol { }
+
+class BaseCollectionViewCell: UICollectionViewCell {
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+ backgroundColor = .clear
+ }
+
+ override func awakeFromNib() {
+ super.awakeFromNib()
+ backgroundColor = .clear
+ }
+
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+
+ // 通过类名获取
+ static func reuseID()-> String{
+ return String(describing: Self.classForCoder())
+ }
+
+ // 从xib 中获取
+ static func cellForNib()-> UINib{
+ return UINib.init(nibName: String(describing: Self.classForCoder()), bundle: nil)
+ }
+}
--- /dev/null
+//
+// AccountSetVC.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/25.
+//
+
+import UIKit
+class AccountSetVC: BaseVC{
+ let tableView = UITableView(frame: .zero, style: .plain)
+ let list:[(title:String,list:[CustomCellType])] = [("登录方式",[.account,.phone,.email,.thirdLogin]),]
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ // Do any additional setup after loading the view.
+ }
+ override func setupViews() {
+ self.navBar.title = "账号设置"
+ tableView.do { v in
+ v.backgroundColor = .color(.bgColor)
+ v.delegate = self
+ v.dataSource = self
+ v.rowHeight = 52
+ v.sectionHeaderHeight = 52
+ v.separatorStyle = .none
+ v.register(UserInfoCell.self, forCellReuseIdentifier: CustomCell1.reuseID)
+ v.register(UserInfoImageCell.self, forCellReuseIdentifier: UserInfoImageCell.reuseID)
+ v.register(UserInfoSectionHeader.self, forHeaderFooterViewReuseIdentifier: UserInfoSectionHeader.reuseID)
+ }
+
+
+
+ view.addSubview(tableView)
+ }
+ override func setupLayout() {
+ tableView.snp.makeConstraints { make in
+ make.left.right.bottom.equalToSuperview()
+ make.top.equalTo(kNavBtm)
+ }
+ }
+}
+
+extension AccountSetVC:UITableViewDelegate,UITableViewDataSource {
+ func numberOfSections(in tableView: UITableView) -> Int {
+ return list.count
+ }
+ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+ return list[section].list.count
+ }
+ func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+ let view = UserInfoSectionHeader.header(withTableView: tableView)
+ view.titleLabel.text = list[section].title
+ return view
+ }
+ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+ let cell = CustomCell1.cell(withTableView: tableView, indexPath: indexPath)
+ let list = list[indexPath.section].list
+ cell.type = list[indexPath.row]
+ let rect = CGRect(x: 0, y: 0, width: kScreenWid - 36, height: 52)
+ if indexPath.row == 0 {
+ cell.bgView.yc.setCorners(withRoundedRect: rect, roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 8, height: 8))
+ }
+ else if indexPath.row == list.count - 1{
+ cell.bgView.yc.setCorners(withRoundedRect: rect, roundingCorners: [.bottomLeft,.bottomRight], cornerRadii: CGSize(width: 8, height: 8))
+ }
+ else{
+ cell.bgView.yc.setCorners(withRoundedRect: rect, roundingCorners: [.allCorners], cornerRadii: CGSize(width: 0, height: 0))
+ }
+ return cell
+ }
+ func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+ let data = list[indexPath.section].list[indexPath.row]
+
+ }
+}
+
+extension AccountSetVC{
+ @objc func logoutAction(){
+
+ }
+}
import UIKit
-class LoginVC:BaseVC{
- let bgView = UIImageView()
+class ForgetVC:BaseVC{
+
let tipsLabel = UILabel()
- let phoneView = PhoneView()
+ let bgView = UIView()
+ let titleLabel = UILabel()
+ let phoneView = CustomInputView()
let codeView = CodeView()
+ let pwdView = PasswordView()
let loginBtn = CustomButton()
- let registerBtn = CustomButton()
let agreeView = AgreeView()
override func viewDidLoad() {
super.viewDidLoad()
}
override func setupViews(){
- self.navBar.title = "账号登录"
-// view.backgroundColor = .rgb(0x11131E)
- bgView.image = UIImage(named: "login_cover")
+ self.navBar.title = ""
+ view.backgroundColor = .color(.bgColor)
tipsLabel.do { v in
v.numberOfLines = 0
- v.font = .bold(18)
+ v.font = .medium(22)
v.textColor = .rgb(0x121212)
- let text = "您好,\n欢迎使用Joy Audio"
+ let text = "您好, \n欢迎使用DeepChords"
let stype = NSMutableParagraphStyle()
stype.lineSpacing = 10
let attrString = NSMutableAttributedString(string: text)
v.attributedText = attrString
}
+ bgView.do { v in
+ v.backgroundColor = .white
+ v.yc.setCorners(withRoundedRect: CGRect(x: 0, y: 0, width: kScreenWid, height: kScreenHei - 244), roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 50, height: 50))
+ }
+ titleLabel.do { v in
+ v.text = "忘记密码"
+ v.font = .medium(18)
+ v.textColor = .hexString("#121212")
+ }
phoneView.do { v in
v.textField.text = "13480939445"
}
codeView.do { v in
v.codeButton.addTarget(self, action: #selector(codeButtonAction), for: .touchUpInside)
}
+ pwdView.do { v in
+ v.textField.placeholder = "请输入密码"
+ }
+ loginBtn.set(title: "确认",style: .theme1, target: self, action: #selector(loginAction))
+ agreeView.isHidden = true
+ view.addSubviews([tipsLabel,bgView])
+ bgView.addSubviews([titleLabel,phoneView,codeView,pwdView,loginBtn,agreeView])
- loginBtn.set(title: "登录",style: .theme1, target: self, action: #selector(loginAction))
- registerBtn.set(title: "注册", style: .theme2,target: self, action: #selector(registerAction))
-
- view.addSubviews([bgView,tipsLabel,phoneView,codeView,loginBtn,registerBtn,agreeView])
- navBar.backgroundColor = .clear
- view.bringSubviewToFront(navBar)
}
override func setupLayout(){
- bgView.snp.makeConstraints { make in
- make.edges.equalToSuperview()
- }
tipsLabel.snp.makeConstraints { make in
- make.left.equalToSuperview().inset(20)
- make.top.equalTo(kNavBtm + 40)
+ make.left.equalToSuperview().inset(28)
+ make.top.equalTo(kNavBtm + 20)
make.centerX.equalToSuperview()
}
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(244)
+ make.bottom.equalToSuperview()
+ }
+
+ titleLabel.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(34)
+ make.left.right.equalToSuperview().inset(36)
+ }
phoneView.snp.makeConstraints { make in
- make.top.equalTo(tipsLabel.snp.bottom).offset(60)
+ make.top.equalToSuperview().offset(82)
make.left.right.equalToSuperview().inset(36)
}
codeView.snp.makeConstraints { make in
- make.top.equalTo(phoneView.snp.bottom).offset(10)
+ make.top.equalTo(phoneView.snp.bottom).offset(20)
make.left.right.equalToSuperview().inset(36)
}
- loginBtn.snp.makeConstraints { make in
- make.top.equalTo(codeView.snp.bottom).offset(54)
- make.left.right.equalToSuperview().inset(51)
- make.height.equalTo(55)
+ pwdView.snp.makeConstraints { make in
+ make.top.equalTo(codeView.snp.bottom).offset(20)
+ make.left.right.equalToSuperview().inset(36)
}
- registerBtn.snp.makeConstraints { make in
- make.top.equalTo(loginBtn.snp.bottom).offset(20)
+ loginBtn.snp.makeConstraints { make in
+ make.top.equalTo(pwdView.snp.bottom).offset(54)
make.left.right.equalToSuperview().inset(51)
make.height.equalTo(55)
}
make.height.equalTo(30)
}
}
-
+
}
-extension LoginVC{
+extension ForgetVC{
@objc func codeButtonAction(){
- guard let text = phoneView.textField.text else{
+ guard let text = phoneView.textField.value else{
YLprogressHUD.showAutoHiden("请输入正确的手机号码")
return
}
}
}
@objc func registerAction(){
-
+ App.shared.goToPage(RegisterVC())
}
@objc func loginAction(){
guard let pohne = phoneView.textField.text else{
--- /dev/null
+//
+// LoginVC.swift
+// ShenYin
+//
+// Created by liangshi on 2025/7/30.
+//
+
+import UIKit
+
+class LoginVC:BaseVC{
+
+ let tipsLabel = UILabel()
+ let bgView = UIView()
+ let titleLabel = UILabel()
+ let phoneView = CustomInputView()
+ let pwdView = PasswordView()
+ let loginBtn = CustomButton()
+ let registerBtn = CustomButton()
+ let forgetBtn = UIButton()
+ let agreeView = AgreeView()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ }
+ override func setupViews(){
+// self.navBar.title = ""
+// navBar.isHidden = true
+ view.backgroundColor = .color(.bgColor)
+ tipsLabel.do { v in
+ v.numberOfLines = 0
+ v.font = .medium(22)
+ v.textColor = .rgb(0x121212)
+ let text = "您好, \n欢迎使用DeepChords"
+ let stype = NSMutableParagraphStyle()
+ stype.lineSpacing = 10
+ let attrString = NSMutableAttributedString(string: text)
+ let attr: [NSAttributedString.Key : Any] = [.font: UIFont.medium(22),.paragraphStyle:stype]
+ attrString.addAttributes(attr, range: NSRange(location: 0, length: attrString.length))
+ v.attributedText = attrString
+ }
+
+ bgView.do { v in
+ v.backgroundColor = .white
+ v.yc.setCorners(withRoundedRect: CGRect(x: 0, y: 0, width: kScreenWid, height: kScreenHei - 244), roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 50, height: 50))
+ }
+ titleLabel.do { v in
+ v.text = "用户登录"
+ v.font = .medium(18)
+ v.textColor = .hexString("#121212")
+ }
+ phoneView.do { v in
+// v.textField.text = "13480939445"
+ }
+ pwdView.do { v in
+ v.textField.placeholder = "请输入密码"
+ }
+
+ loginBtn.set(title: "登录",style: .theme1, target: self, action: #selector(loginAction))
+ registerBtn.set(title: "注册", style: .theme2,target: self, action: #selector(registerAction))
+ forgetBtn.do { v in
+ v.setTitle("忘记密码", for: .normal)
+ v.titleLabel?.font = .regular(12)
+ v.setTitleColor(.hexString("#666666"), for: .normal)
+ v.addTarget(self, action: #selector(forgetAction), for: .touchUpInside)
+ }
+ view.addSubviews([tipsLabel,bgView])
+ bgView.addSubviews([titleLabel,phoneView,pwdView,loginBtn,registerBtn,agreeView,forgetBtn])
+
+ }
+ override func setupLayout(){
+ tipsLabel.snp.makeConstraints { make in
+ make.left.equalToSuperview().inset(28)
+ make.top.equalTo(kNavBtm + 20)
+ make.centerX.equalToSuperview()
+ }
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(244)
+ make.bottom.equalToSuperview()
+ }
+
+ titleLabel.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(34)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ phoneView.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(82)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ pwdView.snp.makeConstraints { make in
+ make.top.equalTo(phoneView.snp.bottom).offset(20)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ loginBtn.snp.makeConstraints { make in
+ make.top.equalTo(pwdView.snp.bottom).offset(54)
+ make.left.right.equalToSuperview().inset(51)
+ make.height.equalTo(55)
+ }
+ registerBtn.snp.makeConstraints { make in
+ make.top.equalTo(loginBtn.snp.bottom).offset(20)
+ make.left.right.equalToSuperview().inset(51)
+ make.height.equalTo(55)
+ }
+ agreeView.snp.makeConstraints { make in
+ make.bottom.equalToSuperview().inset(62)
+ make.centerX.equalToSuperview()
+ make.height.equalTo(30)
+ }
+ forgetBtn.snp.makeConstraints { make in
+ make.right.equalTo(pwdView.snp.right)
+ make.width.equalTo(55)
+ make.height.equalTo(50)
+ make.top.equalTo(pwdView.snp.bottom)
+ }
+ }
+
+}
+
+extension LoginVC{
+ @objc func forgetAction(){
+ App.shared.goToPage(ForgetVC())
+ }
+
+ @objc func registerAction(){
+ App.shared.goToPage(RegisterVC())
+ }
+ @objc func loginAction(){
+ guard let phone = phoneView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入正确的手机号码")
+ return
+ }
+ guard let code = pwdView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入密码")
+ return
+ }
+ YLprogressHUD.showLoading()
+ LoginVM.login(phone: phone, code: code) {[weak self] result in
+ if result.isSuccess{
+ YLprogressHUD.showSuccess {
+ self?.view.window?.rootViewController = BaseTC()
+ }
+ }
+ YLprogressHUD.showAutoHiden(result.msg)
+ }
+ }
+}
--- /dev/null
+//
+// LoginVC.swift
+// ShenYin
+//
+// Created by liangshi on 2025/7/30.
+//
+
+import UIKit
+
+class RegisterVC:BaseVC{
+
+ let tipsLabel = UILabel()
+ let bgView = UIView()
+ let titleLabel = UILabel()
+ let phoneView = CustomInputView()
+ let codeView = CodeView()
+ let pwdView = PasswordView()
+ let pwdView2 = PasswordView()
+ let loginBtn = CustomButton()
+ let registerBtn = CustomButton()
+ let agreeView = AgreeView()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ }
+ override func setupViews(){
+ self.navBar.title = ""
+ view.backgroundColor = .color(.bgColor)
+ tipsLabel.do { v in
+ v.numberOfLines = 0
+ v.font = .medium(22)
+ v.textColor = .rgb(0x121212)
+ let text = "您好, \n欢迎使用DeepChords"
+ let stype = NSMutableParagraphStyle()
+ stype.lineSpacing = 10
+ let attrString = NSMutableAttributedString(string: text)
+ let attr: [NSAttributedString.Key : Any] = [.font: UIFont.medium(22),.paragraphStyle:stype]
+ attrString.addAttributes(attr, range: NSRange(location: 0, length: attrString.length))
+ v.attributedText = attrString
+ }
+
+ bgView.do { v in
+ v.backgroundColor = .white
+ v.yc.setCorners(withRoundedRect: CGRect(x: 0, y: 0, width: kScreenWid, height: kScreenHei - 244), roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 50, height: 50))
+ }
+ titleLabel.do { v in
+ v.text = "用户注册"
+ v.font = .medium(18)
+ v.textColor = .hexString("#121212")
+ }
+ phoneView.do { v in
+ v.textField.text = "13480939445"
+ }
+ codeView.do { v in
+ v.codeButton.addTarget(self, action: #selector(codeButtonAction), for: .touchUpInside)
+ }
+ pwdView.do { v in
+ v.textField.placeholder = "请输入密码"
+ }
+ pwdView2.do { v in
+ v.textField.placeholder = "请确认密码"
+ }
+ registerBtn.set(title: "注册",style: .theme1, target: self, action: #selector(registerAction))
+ loginBtn.set(title: "登录",style: .theme2, target: self, action: #selector(loginAction))
+ agreeView.isHidden = true
+ view.addSubviews([tipsLabel,bgView])
+ bgView.addSubviews([titleLabel,phoneView,codeView,pwdView,pwdView2,loginBtn,registerBtn,agreeView])
+
+ }
+ override func setupLayout(){
+ tipsLabel.snp.makeConstraints { make in
+ make.left.equalToSuperview().inset(28)
+ make.top.equalTo(kNavBtm + 20)
+ make.centerX.equalToSuperview()
+ }
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(244)
+ make.bottom.equalToSuperview()
+ }
+
+ titleLabel.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(34)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ phoneView.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(82)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ codeView.snp.makeConstraints { make in
+ make.top.equalTo(phoneView.snp.bottom).offset(20)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ pwdView.snp.makeConstraints { make in
+ make.top.equalTo(codeView.snp.bottom).offset(20)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ pwdView2.snp.makeConstraints { make in
+ make.top.equalTo(pwdView.snp.bottom).offset(20)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ registerBtn.snp.makeConstraints { make in
+ make.top.equalTo(pwdView2.snp.bottom).offset(54)
+ make.left.right.equalToSuperview().inset(51)
+ make.height.equalTo(55)
+ }
+ loginBtn.snp.makeConstraints { make in
+ make.top.equalTo(registerBtn.snp.bottom).offset(20)
+ make.left.right.equalToSuperview().inset(51)
+ make.height.equalTo(55)
+ }
+ agreeView.snp.makeConstraints { make in
+ make.bottom.equalToSuperview().inset(62)
+ make.centerX.equalToSuperview()
+ make.height.equalTo(30)
+ }
+ }
+
+}
+
+extension RegisterVC{
+ @objc func codeButtonAction(){
+ guard let text = phoneView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入正确的手机号码")
+ return
+ }
+ YLprogressHUD.showLoading()
+ LoginVM.sendCode(phone: text) { [weak self] (model) in
+ if model.isSuccess{
+ self?.codeView.codeButton.start()
+ }
+ YLprogressHUD.showAutoHiden(model.msg)
+ }
+ }
+ @objc func registerAction(){
+ guard let phone = phoneView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入正确的手机号码")
+ return
+ }
+ guard let code = codeView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入验证码")
+ return
+ }
+ guard let pwd = pwdView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入密码")
+ return
+ }
+ guard let pwd2 = pwdView2.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入确认密码")
+ return
+ }
+ YLprogressHUD.showLoading()
+// LoginVM.login(phone: pohne, code: code) {[weak self] result in
+// if result.isSuccess{
+// YLprogressHUD.showSuccess {
+// self?.view.window?.rootViewController = BaseTC()
+// }
+// }
+// YLprogressHUD.showAutoHiden(result.msg)
+// }
+ }
+ @objc func loginAction(){
+ App.shared.goToPage(LoginVC())
+// guard let pohne = phoneView.textField.text else{
+// YLprogressHUD.showAutoHiden("请输入正确的手机号码")
+// return
+// }
+// guard let code = codeView.textField.text else{
+// YLprogressHUD.showAutoHiden("请输入正确的验证码")
+// return
+// }
+ }
+}
--- /dev/null
+//
+// SetAccountVC.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/25.
+//
+
+import UIKit
+
+class SetAccountVC:BaseVC{
+
+ let titleLabel = UILabel()
+ let phoneView = CodeView()
+ let loginBtn = CustomButton()
+ var phone = "+86 134****4811"
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ }
+ override func setupViews(){
+ self.navBar.title = "账号设置"
+ view.backgroundColor = .color(.bgColor)
+
+ titleLabel.do { v in
+ v.text = "请使用安全手机\(phone)获取验证码短信"
+ v.font = .medium(18)
+ v.textColor = .hexString("#121212")
+ v.numberOfLines = 0
+ }
+ phoneView.do { v in
+
+ }
+ loginBtn.set(title: "确定",style: .theme1, target: self, action: #selector(loginAction))
+ view.addSubviews([titleLabel,phoneView,loginBtn])
+
+ }
+ override func setupLayout(){
+
+ titleLabel.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(kNavBtm + 30)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ phoneView.snp.makeConstraints { make in
+ make.top.equalTo(titleLabel.snp.bottom).offset(16)
+ make.left.right.equalToSuperview().inset(36)
+ }
+
+ loginBtn.snp.makeConstraints { make in
+ make.top.equalTo(phoneView.snp.bottom).offset(40)
+ make.left.right.equalToSuperview().inset(51)
+ make.height.equalTo(55)
+ }
+
+ }
+
+}
+
+extension SetAccountVC{
+
+ @objc func loginAction(){
+ guard let pwd1 = phoneView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入验证码")
+ return
+ }
+ // YLprogressHUD.showLoading()
+ // LoginVM.login(phone: phone, code: code) {[weak self] result in
+ // if result.isSuccess{
+ // YLprogressHUD.showSuccess {
+ // self?.view.window?.rootViewController = BaseTC()
+ // }
+ // }
+ // YLprogressHUD.showAutoHiden(result.msg)
+ // }
+ }
+}
--- /dev/null
+//
+// SetEmailVC.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/25.
+//
+
+import UIKit
+
+class SetEmailVC:BaseVC{
+
+ let titleLabel = UILabel()
+ let phoneView = CustomInputView()
+ let loginBtn = CustomButton()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ }
+ override func setupViews(){
+ self.navBar.title = "修改安全邮箱"
+ view.backgroundColor = .color(.bgColor)
+
+ titleLabel.do { v in
+ v.text = "请输入新的安全邮箱地址"
+ v.font = .medium(18)
+ v.textColor = .hexString("#121212")
+ }
+ phoneView.do { v in
+ v.textField.placeholder = "请输入邮箱地址"
+ }
+ loginBtn.set(title: "下一步",style: .theme1, target: self, action: #selector(loginAction))
+ view.addSubviews([titleLabel,phoneView,loginBtn])
+
+ }
+ override func setupLayout(){
+
+ titleLabel.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(kNavBtm + 30)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ phoneView.snp.makeConstraints { make in
+ make.top.equalTo(titleLabel.snp.bottom).offset(16)
+ make.left.right.equalToSuperview().inset(36)
+ }
+
+ loginBtn.snp.makeConstraints { make in
+ make.top.equalTo(phoneView.snp.bottom).offset(40)
+ make.left.right.equalToSuperview().inset(51)
+ make.height.equalTo(55)
+ }
+
+ }
+
+}
+
+extension SetEmailVC{
+
+ @objc func loginAction(){
+ guard let pwd1 = phoneView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入邮箱地址")
+ return
+ }
+ // YLprogressHUD.showLoading()
+ // LoginVM.login(phone: phone, code: code) {[weak self] result in
+ // if result.isSuccess{
+ // YLprogressHUD.showSuccess {
+ // self?.view.window?.rootViewController = BaseTC()
+ // }
+ // }
+ // YLprogressHUD.showAutoHiden(result.msg)
+ // }
+ }
+}
--- /dev/null
+//
+// SetPwdVC.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/25.
+//
+
+import UIKit
+
+class SetPwdVC:BaseVC{
+
+ let titleLabel = UILabel()
+ let pwdView1 = PasswordView()
+ let pwdView2 = PasswordView()
+ let loginBtn = CustomButton()
+ let desLabel = UILabel()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ }
+ override func setupViews(){
+ self.navBar.title = "设置密码"
+ view.backgroundColor = .color(.bgColor)
+
+ titleLabel.do { v in
+ v.text = "新密码"
+ v.font = .medium(18)
+ v.textColor = .hexString("#121212")
+ }
+ pwdView1.do { v in
+ v.textField.placeholder = "请输入密码"
+ }
+ pwdView2.do { v in
+ v.textField.placeholder = "请输入确认密码"
+ }
+ desLabel.do { v in
+ v.text = "密码长度8-16位,数字、字母、字符至少包含两种"
+ v.font = .regular(12)
+ v.textColor = .hexString("#999999")
+ }
+ loginBtn.set(title: "确定",style: .theme1, target: self, action: #selector(loginAction))
+ view.addSubviews([titleLabel,pwdView1,pwdView2,loginBtn,desLabel])
+
+ }
+ override func setupLayout(){
+
+ titleLabel.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(kNavBtm + 30)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ pwdView1.snp.makeConstraints { make in
+ make.top.equalTo(titleLabel.snp.bottom).offset(16)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ pwdView2.snp.makeConstraints { make in
+ make.top.equalTo(pwdView1.snp.bottom).offset(20)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ loginBtn.snp.makeConstraints { make in
+ make.top.equalTo(pwdView2.snp.bottom).offset(74)
+ make.left.right.equalToSuperview().inset(51)
+ make.height.equalTo(55)
+ }
+ desLabel.snp.makeConstraints { make in
+ make.top.equalTo(pwdView2.snp.bottom).offset(14)
+ make.centerX.equalToSuperview()
+ }
+ }
+
+}
+
+extension SetPwdVC{
+
+ @objc func loginAction(){
+ guard let pwd1 = pwdView1.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入密码")
+ return
+ }
+ guard let pwd2 = pwdView2.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入确认密码")
+ return
+ }
+// YLprogressHUD.showLoading()
+// LoginVM.login(phone: phone, code: code) {[weak self] result in
+// if result.isSuccess{
+// YLprogressHUD.showSuccess {
+// self?.view.window?.rootViewController = BaseTC()
+// }
+// }
+// YLprogressHUD.showAutoHiden(result.msg)
+// }
+ }
+}
--- /dev/null
+//
+// SetPhoneVC.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/25.
+//
+
+import UIKit
+
+class SetPhoneVC:BaseVC{
+
+ let titleLabel = UILabel()
+ let phoneView = CustomInputView()
+ let loginBtn = CustomButton()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ }
+ override func setupViews(){
+ self.navBar.title = "修改安全手机"
+ view.backgroundColor = .color(.bgColor)
+
+ titleLabel.do { v in
+ v.text = "请输入新的安全手机号码"
+ v.font = .medium(18)
+ v.textColor = .hexString("#121212")
+ }
+ phoneView.do { v in
+
+ }
+ loginBtn.set(title: "下一步",style: .theme1, target: self, action: #selector(loginAction))
+ view.addSubviews([titleLabel,phoneView,loginBtn])
+
+ }
+ override func setupLayout(){
+
+ titleLabel.snp.makeConstraints { make in
+ make.top.equalToSuperview().offset(kNavBtm + 30)
+ make.left.right.equalToSuperview().inset(36)
+ }
+ phoneView.snp.makeConstraints { make in
+ make.top.equalTo(titleLabel.snp.bottom).offset(16)
+ make.left.right.equalToSuperview().inset(36)
+ }
+
+ loginBtn.snp.makeConstraints { make in
+ make.top.equalTo(phoneView.snp.bottom).offset(40)
+ make.left.right.equalToSuperview().inset(51)
+ make.height.equalTo(55)
+ }
+
+ }
+
+}
+
+extension SetPhoneVC{
+
+ @objc func loginAction(){
+ guard let pwd1 = phoneView.textField.value else{
+ YLprogressHUD.showAutoHiden("请输入密码")
+ return
+ }
+ // YLprogressHUD.showLoading()
+ // LoginVM.login(phone: phone, code: code) {[weak self] result in
+ // if result.isSuccess{
+ // YLprogressHUD.showSuccess {
+ // self?.view.window?.rootViewController = BaseTC()
+ // }
+ // }
+ // YLprogressHUD.showAutoHiden(result.msg)
+ // }
+ }
+}
+++ /dev/null
-//
-// ForgetVC.swift
-// ShenYin
-//
-// Created by liangshi on 2025/8/11.
-//
-
-import UIKit
-
-class ForgetVC:BaseVC{
- let bgView = UIImageView()
- let logoView = UIImageView()
- let phoneView = PhoneView()
- let codeView = CodeView()
- let btn = CustomButton()
- let agreeView = AgreeView()
-
- override func viewDidLoad() {
- super.viewDidLoad()
- }
- override func setupViews(){
- self.navBar.title = "账号登录"
- // view.backgroundColor = .rgb(0x11131E)
- bgView.image = UIImage(named: "login_cover")
- logoView.image = UIImage(named: "login_logo")
-
- phoneView.do { v in
- v.textField.text = "13480939445"
- }
- codeView.do { v in
- v.codeButton.addTarget(self, action: #selector(codeButtonAction), for: .touchUpInside)
- }
-
- btn.set(title: "登录", target: self, action: #selector(loginAction))
-
- view.addSubviews([bgView,logoView,phoneView,codeView,btn,agreeView])
- navBar.backgroundColor = .clear
- view.bringSubviewToFront(navBar)
- }
- override func setupLayout(){
- bgView.snp.makeConstraints { make in
- make.edges.equalToSuperview()
- }
- logoView.snp.makeConstraints { make in
- make.width.equalTo(203)
- make.height.equalTo(86)
- make.top.equalTo(kNavBtm + 40)
- make.centerX.equalToSuperview()
- }
- phoneView.snp.makeConstraints { make in
- make.top.equalTo(logoView.snp.bottom).offset(60)
- make.left.right.equalToSuperview().inset(15)
- }
- codeView.snp.makeConstraints { make in
- make.top.equalTo(phoneView.snp.bottom).offset(10)
- make.left.right.equalToSuperview().inset(15)
- }
- btn.snp.makeConstraints { make in
- make.top.equalTo(codeView.snp.bottom).offset(30)
- make.left.right.equalToSuperview().inset(15)
- make.height.equalTo(52)
- }
- agreeView.snp.makeConstraints { make in
- make.bottom.equalToSuperview().inset(62)
- make.centerX.equalToSuperview()
- make.height.equalTo(30)
- }
- }
-
-}
-
-extension ForgetVC{
- @objc func codeButtonAction(){
- guard let text = phoneView.textField.text else{
- YLprogressHUD.showAutoHiden("请输入正确的手机号码")
- return
- }
- YLprogressHUD.showLoading()
- LoginVM.sendCode(phone: text) { [weak self] (model) in
- if model.isSuccess{
- self?.codeView.codeButton.start()
- }
- YLprogressHUD.showAutoHiden(model.msg)
- }
- }
- @objc func loginAction(){
- guard let pohne = phoneView.textField.text else{
- YLprogressHUD.showAutoHiden("请输入正确的手机号码")
- return
- }
- guard let code = codeView.textField.text else{
- YLprogressHUD.showAutoHiden("请输入正确的验证码")
- return
- }
- YLprogressHUD.showLoading()
- LoginVM.login(phone: pohne, code: code) {[weak self] result in
- if result.isSuccess{
- YLprogressHUD.showSuccess {
- self?.view.window?.rootViewController = BaseTC()
- }
- }
- YLprogressHUD.showAutoHiden(result.msg)
- }
- }
-}
+++ /dev/null
-//
-// RegisterVC.swift
-// ShenYin
-//
-// Created by liangshi on 2025/8/11.
-//
-
-import UIKit
-
-class RegisterVC:BaseVC{
- let bgView = UIImageView()
- let logoView = UIImageView()
- let phoneView = PhoneView()
- let codeView = CodeView()
- let btn = CustomButton()
- let agreeView = AgreeView()
-
- override func viewDidLoad() {
- super.viewDidLoad()
- }
- override func setupViews(){
- self.navBar.title = "账号登录"
- // view.backgroundColor = .rgb(0x11131E)
- bgView.image = UIImage(named: "login_cover")
- logoView.image = UIImage(named: "login_logo")
-
- phoneView.do { v in
- v.textField.text = "13480939445"
- }
- codeView.do { v in
- v.codeButton.addTarget(self, action: #selector(codeButtonAction), for: .touchUpInside)
- }
-
- btn.set(title: "登录", target: self, action: #selector(loginAction))
-
- view.addSubviews([bgView,logoView,phoneView,codeView,btn,agreeView])
- navBar.backgroundColor = .clear
- view.bringSubviewToFront(navBar)
- }
- override func setupLayout(){
- bgView.snp.makeConstraints { make in
- make.edges.equalToSuperview()
- }
- logoView.snp.makeConstraints { make in
- make.width.equalTo(203)
- make.height.equalTo(86)
- make.top.equalTo(kNavBtm + 40)
- make.centerX.equalToSuperview()
- }
- phoneView.snp.makeConstraints { make in
- make.top.equalTo(logoView.snp.bottom).offset(60)
- make.left.right.equalToSuperview().inset(15)
- }
- codeView.snp.makeConstraints { make in
- make.top.equalTo(phoneView.snp.bottom).offset(10)
- make.left.right.equalToSuperview().inset(15)
- }
- btn.snp.makeConstraints { make in
- make.top.equalTo(codeView.snp.bottom).offset(30)
- make.left.right.equalToSuperview().inset(15)
- make.height.equalTo(52)
- }
- agreeView.snp.makeConstraints { make in
- make.bottom.equalToSuperview().inset(62)
- make.centerX.equalToSuperview()
- make.height.equalTo(30)
- }
- }
-
-}
-
-extension RegisterVC{
- @objc func codeButtonAction(){
- guard let text = phoneView.textField.text else{
- YLprogressHUD.showAutoHiden("请输入正确的手机号码")
- return
- }
- YLprogressHUD.showLoading()
- LoginVM.sendCode(phone: text) { [weak self] (model) in
- if model.isSuccess{
- self?.codeView.codeButton.start()
- }
- YLprogressHUD.showAutoHiden(model.msg)
- }
- }
- @objc func loginAction(){
- guard let pohne = phoneView.textField.text else{
- YLprogressHUD.showAutoHiden("请输入正确的手机号码")
- return
- }
- guard let code = codeView.textField.text else{
- YLprogressHUD.showAutoHiden("请输入正确的验证码")
- return
- }
- YLprogressHUD.showLoading()
- LoginVM.login(phone: pohne, code: code) {[weak self] result in
- if result.isSuccess{
- YLprogressHUD.showSuccess {
- self?.view.window?.rootViewController = BaseTC()
- }
- }
- YLprogressHUD.showAutoHiden(result.msg)
- }
- }
-}
let agreeBtn = UIButton()
let agreeTitle = UILabel()
let agreeValue = UILabel()
+ let andlabel = UILabel()
+ let useValue = UILabel()
override func setupViews() {
agreeBtn.do { (v) in
+ v.isSelected = true
v.contentMode = .center
v.setImage(UIImage(named: "select_normal"), for: .normal)
v.setImage(UIImage(named: "select_selected"), for: .selected)
v.addTarget(self, action: #selector(agreeBtnAction), for: .touchUpInside)
}
agreeTitle.do { (v) in
- v.textColor = .black.withAlphaComponent(0.8)
- v.font = .medium(14)
+ v.textColor = .hexString("#666666")
+ v.font = .regular(12)
v.textAlignment = .left
- v.text = "ç\99»å½\95å\8d³ä»£è¡¨同意"
+ v.text = "ç\99»å½\95å¹¶同意"
}
agreeValue.do { (v) in
- v.textColor = .color(.theme)
- v.font = .medium(14)
+ v.textColor = .hexString("#121212")
+ v.font = .regular(12)
v.textAlignment = .left
- v.text = " 《用户协议》"
- v.add(target: self, action: #selector(agreementButtonAction))
+ v.text = "《隐私权政策》"
+ v.add(target: self, action: #selector(agreementAction))
}
- addSubviews([agreeBtn,agreeTitle,agreeValue])
+ andlabel.do { (v) in
+ v.textColor = .hexString("#666666")
+ v.font = .regular(12)
+ v.textAlignment = .left
+ v.text = " 和 "
+ }
+ useValue.do { (v) in
+ v.textColor = .hexString("#121212")
+ v.font = .regular(12)
+ v.textAlignment = .left
+ v.text = "《用户协议》"
+ v.add(target: self, action: #selector(useAction))
+ }
+ addSubviews([agreeBtn,agreeTitle,agreeValue,andlabel,useValue])
}
override func setupLayout() {
agreeBtn.snp.makeConstraints { (m) in
agreeValue.snp.makeConstraints { (m) in
m.left.equalTo(agreeTitle.snp.right)
m.centerY.equalTo(agreeBtn)
+ }
+ andlabel.snp.makeConstraints { (m) in
+ m.left.equalTo(agreeValue.snp.right)
+ m.centerY.equalTo(agreeBtn)
+ }
+ useValue.snp.makeConstraints { (m) in
+ m.left.equalTo(andlabel.snp.right)
+ m.centerY.equalTo(agreeBtn)
m.right.equalToSuperview()
}
}
@objc func agreeBtnAction(){
agreeBtn.isSelected = !agreeBtn.isSelected
}
- @objc func agreementButtonAction(){
+ @objc func agreementAction(){
+
+ }
+ @objc func useAction(){
}
+
}
extension UILabel{
import UIKit
class CodeView: BaseView {
- let label = UILabel()
let inputBgView = UIView()
let textField = UITextField()
let codeButton = YLTimerButton()
override func setupViews() {
- backgroundColor = .clear
-
- label.do { v in
- v.text = "验证码"
- v.font = .medium(12)
- v.textColor = .black.withAlphaComponent(0.8)
- }
+// backgroundColor = .red
textField.do { v in
v.textColor = .black
v.keyboardType = .phonePad
+ v.placeholder = "请输入验证码"
}
codeButton.do { (v) in
v.maxCount = 20
v.label.textColor = .color(.theme)
- v.backgroundColor = UIColor.black.withAlphaComponent(0.04)
- v.layer.cornerRadius = 8
- v.layer.masksToBounds = true
+ v.backgroundColor = .clear
+ v.addLine(height: 22)
}
inputBgView.backgroundColor = .rgb(0xF3F4F8)
inputBgView.layer.cornerRadius = 12
inputBgView.layer.masksToBounds = true
- addSubviews([label,inputBgView])
+
+
+ addSubviews([inputBgView])
inputBgView.addSubviews([textField,codeButton])
}
override func setupLayout() {
- label.snp.makeConstraints { make in
- make.left.right.equalToSuperview().inset(15)
- make.top.equalToSuperview()
- make.height.equalTo(30)
- }
inputBgView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
- make.top.equalToSuperview().inset(30)
- make.height.equalTo(52)
+ make.top.equalToSuperview()
+ make.height.equalTo(50)
make.bottom.equalToSuperview()
}
textField.snp.makeConstraints { make in
}
}
+
+
+extension UIView{
+ func addLine(height:Float){
+ let line = UIView()
+ line.backgroundColor = .hexString("#D4D4D4")
+ addSubview(line)
+ line.snp.makeConstraints { make in
+ make.height.equalTo(height)
+ make.width.equalTo(2)
+ make.left.equalToSuperview()
+ make.centerY.equalToSuperview()
+ }
+ }
+}
// Created by liangshi on 2025/7/30.
//
import UIKit
-class PhoneView: BaseView {
- let label = UILabel()
+class CustomInputView: BaseView {
let inputBgView = UIView()
let textField = UITextField()
override func setupViews() {
- backgroundColor = .clear
-
- label.do { v in
- v.text = "手机号"
- v.font = .medium(12)
- v.textColor = .black.withAlphaComponent(0.8)
- }
+// backgroundColor = .red
+
textField.do { v in
v.textColor = .black
v.keyboardType = .phonePad
+ v.placeholder = "请输入手机号码"
}
inputBgView.backgroundColor = .rgb(0xF3F4F8)
inputBgView.layer.cornerRadius = 10
inputBgView.layer.masksToBounds = true
-
- addSubviews([label,inputBgView])
+ addSubviews([inputBgView])
inputBgView.addSubview(textField)
}
override func setupLayout() {
- label.snp.makeConstraints { make in
- make.left.right.equalToSuperview().inset(15)
- make.top.equalToSuperview()
- make.height.equalTo(30)
- }
+
inputBgView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
- make.top.equalToSuperview().inset(30)
- make.height.equalTo(52)
+ make.top.equalToSuperview()
+ make.height.equalTo(50)
make.bottom.equalToSuperview()
}
textField.snp.makeConstraints { make in
- make.left.right.equalToSuperview().inset(15)
+ make.left.right.equalToSuperview().inset(20)
make.top.bottom.equalToSuperview()
}
}
--- /dev/null
+//
+// PasswordView.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/25.
+//
+
+import UIKit
+class PasswordView: BaseView {
+ let inputBgView = UIView()
+ let textField = UITextField()
+ let btn = UIButton(type: .custom)
+ override func setupViews() {
+ // backgroundColor = .red
+
+ textField.do { v in
+ v.textColor = .black
+ v.keyboardType = .phonePad
+ v.placeholder = "请输入密码"
+ v.isSecureTextEntry = true
+ }
+
+
+ btn.setImage(UIImage(named: "pwd_close"), for: .normal)
+ btn.setImage(UIImage(named: "pwd_open"), for: .selected)
+ btn.addTarget(self, action: #selector(btnAction), for: .touchUpInside)
+ btn.frame = CGRect(x: 0, y: 0, width: 26, height: 26)
+ textField.rightView = btn
+ textField.rightViewMode = .always
+
+ inputBgView.backgroundColor = .rgb(0xF3F4F8)
+ inputBgView.layer.cornerRadius = 10
+ inputBgView.layer.masksToBounds = true
+ addSubviews([inputBgView])
+ inputBgView.addSubview(textField)
+ }
+ override func setupLayout() {
+
+ inputBgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview()
+ make.height.equalTo(50)
+ make.bottom.equalToSuperview()
+ }
+ textField.snp.makeConstraints { make in
+ make.left.right.equalToSuperview().inset(20)
+ make.top.bottom.equalToSuperview()
+ }
+ }
+ @objc func btnAction(){
+ btn.isSelected = !btn.isSelected
+ textField.isSecureTextEntry = !btn.isSelected
+ }
+}
}
@objc func setAction(){
- let vc = UserInfoVC()
+ let vc = AccountSetVC()
let topVC = App.shared.topVC()
topVC?.navigationController?.pushViewController(vc, animated: true)
}
--- /dev/null
+//
+// CustomCell1.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/25.
+//
+public enum CustomCellType: Int {
+ case avatar
+ case nickName
+ case gender
+ case area
+
+
+ case account
+ case phone
+ case email
+ case thirdLogin
+
+ case deregister
+
+ var title:String{
+ switch self {
+ case .avatar:
+ return "头像"
+ case .nickName:
+ return "昵称"
+ case .gender:
+ return "性别"
+ case .area:
+ return "国家与地区"
+
+ case .account:
+ return "账号密码"
+ case .phone:
+ return "安全手机"
+ case .email:
+ return "安全邮箱"
+ case .thirdLogin:
+ return "第三方账号"
+
+
+ case .deregister:
+ return "注销账号"
+ }
+ }
+
+}
+
+
+class CustomCell1: BaseTableViewCell {
+ let bgView = UIView()
+ let titleLabel = UILabel()
+ let nextIcon = UIImageView()
+
+ var type:CustomCellType = .area{
+ didSet{
+ titleLabel.text = type.title
+ }
+ }
+
+
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+ super.init(style: style, reuseIdentifier: reuseIdentifier)
+ }
+
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+ override func setupViews() {
+ contentView.addSubview(bgView)
+ bgView.addSubviews([titleLabel,nextIcon])
+
+ backgroundColor = .rgb(0xF7F7F7)
+ contentView.backgroundColor = .clear
+ selectionStyle = .none
+ bgView.do { v in
+ v.backgroundColor = UIColor.white
+ }
+ titleLabel.do { (v) in
+ v.textColor = .rgb(0x121212)
+ v.font = .bold(14)
+ v.textAlignment = .left
+ }
+
+ nextIcon.image = UIImage(named: "arrow_next")
+ }
+
+ override func setupLayout() {
+ bgView.snp.makeConstraints { (m) in
+ m.left.right.equalToSuperview().inset(18)
+ m.top.equalToSuperview()
+ m.bottom.equalToSuperview()
+ }
+ titleLabel.snp.makeConstraints { (m) in
+ m.centerY.equalToSuperview()
+ m.left.equalToSuperview().offset(16)
+ m.height.equalToSuperview()
+ }
+ nextIcon.snp.makeConstraints { (m) in
+ m.width.equalTo(8)
+ m.height.equalTo(12)
+ m.right.equalToSuperview().inset(15)
+ m.centerY.equalToSuperview()
+ }
+ }
+}
case avatar
case nickName
case gender
+ case area
+
+
+ case account
case phone
- case password
+ case email
+ case thirdLogin
+
case deregister
var title:String{
return "昵称"
case .gender:
return "性别"
+ case .area:
+ return "国家与地区"
+
+ case .account:
+ return "账号密码"
case .phone:
- return "手机号"
- case .password:
- return "密码"
+ return "安全手机"
+ case .email:
+ return "安全邮箱"
+ case .thirdLogin:
+ return "第三方账号"
+
+
case .deregister:
return "注销账号"
}
+////
+//// UserInfoVC.swift
+//// ShenYin
+////
+//// Created by liangshi on 2025/7/30.
+////
//
-// UserInfoVC.swift
-// ShenYin
+//import UIKit
+//class UserInfoVC: BaseVC{
+// let tableView = UITableView(frame: .zero, style: .plain)
+// let list:[(title:String,list:[UserInfoCellType])] = [("编辑资料",[.avatar,.nickName,.gender]),("账号与安全",[.phone,.password,.deregister])]
+//
+// override func viewDidLoad() {
+// super.viewDidLoad()
+// // Do any additional setup after loading the view.
+// }
+// override func setupViews() {
+// self.navBar.title = "用户信息"
+// tableView.do { v in
+// v.backgroundColor = .color(.bgColor)
+// v.delegate = self
+// v.dataSource = self
+// v.estimatedRowHeight = 52
+// v.sectionHeaderHeight = 52
+// v.sectionFooterHeight = 0.1
+// v.register(UserInfoCell.self, forCellReuseIdentifier: UserInfoCell.reuseID)
+// v.register(UserInfoImageCell.self, forCellReuseIdentifier: UserInfoImageCell.reuseID)
+//
+// v.register(UserInfoSectionHeader.self, forHeaderFooterViewReuseIdentifier: UserInfoSectionHeader.reuseID)
+// v.register(BaseTableViewSetionHeader.self, forHeaderFooterViewReuseIdentifier: BaseTableViewSetionHeader.reuseID)
+// }
+//
+// let footView = UIView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 200))
+// let btn = CustomButton(frame: CGRect(x: 15, y: 80, width: kScreenWid - 30, height: 52))
+// btn.set(title: "退出登录", target: self, action: #selector(logoutAction))
+// footView.addSubview(btn)
+// tableView.tableFooterView = footView
+//
+// view.addSubview(tableView)
+// }
+// override func setupLayout() {
+// tableView.snp.makeConstraints { make in
+// make.left.right.bottom.equalToSuperview()
+// make.top.equalTo(kNavBtm)
+// }
+// }
+//}
//
-// Created by liangshi on 2025/7/30.
+//extension UserInfoVC:UITableViewDelegate,UITableViewDataSource {
+// func numberOfSections(in tableView: UITableView) -> Int {
+// return list.count
+// }
+// func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+// return list[section].list.count
+// }
+// func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+// let view = UserInfoSectionHeader.header(withTableView: tableView)
+// view.titleLabel.text = list[section].title
+// return view
+// }
+// func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+// let type = list[indexPath.section].list[indexPath.row]
+// if type == .avatar {
+// let cell = UserInfoImageCell.cell(withTableView: tableView, indexPath: indexPath)
+// return cell
+// }
+// else{
+// let cell = UserInfoCell.cell(withTableView: tableView, indexPath: indexPath)
+// cell.type = type
+// return cell
+// }
+// }
+// func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+// let data = list[indexPath.section].list[indexPath.row]
+//
+// }
+//}
//
-
-import UIKit
-class UserInfoVC: BaseVC{
- let tableView = UITableView(frame: .zero, style: .plain)
- let list:[(title:String,list:[UserInfoCellType])] = [("编辑资料",[.avatar,.nickName,.gender]),("账号与安全",[.phone,.password,.deregister])]
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view.
- }
- override func setupViews() {
- self.navBar.title = "用户信息"
- tableView.do { v in
- v.backgroundColor = .color(.bgColor)
- v.delegate = self
- v.dataSource = self
- v.estimatedRowHeight = 52
- v.sectionHeaderHeight = 52
- v.sectionFooterHeight = 0.1
- v.register(UserInfoCell.self, forCellReuseIdentifier: UserInfoCell.reuseID)
- v.register(UserInfoImageCell.self, forCellReuseIdentifier: UserInfoImageCell.reuseID)
-
- v.register(UserInfoSectionHeader.self, forHeaderFooterViewReuseIdentifier: UserInfoSectionHeader.reuseID)
- v.register(BaseTableViewSetionHeader.self, forHeaderFooterViewReuseIdentifier: BaseTableViewSetionHeader.reuseID)
- }
-
- let footView = UIView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 200))
- let btn = CustomButton(frame: CGRect(x: 15, y: 80, width: kScreenWid - 30, height: 52))
- btn.set(title: "退出登录", target: self, action: #selector(logoutAction))
- footView.addSubview(btn)
- tableView.tableFooterView = footView
-
- view.addSubview(tableView)
- }
- override func setupLayout() {
- tableView.snp.makeConstraints { make in
- make.left.right.bottom.equalToSuperview()
- make.top.equalTo(kNavBtm)
- }
- }
-}
-
-extension UserInfoVC:UITableViewDelegate,UITableViewDataSource {
- func numberOfSections(in tableView: UITableView) -> Int {
- return list.count
- }
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return list[section].list.count
- }
- func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
- let view = UserInfoSectionHeader.header(withTableView: tableView)
- view.titleLabel.text = list[section].title
- return view
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let type = list[indexPath.section].list[indexPath.row]
- if type == .avatar {
- let cell = UserInfoImageCell.cell(withTableView: tableView, indexPath: indexPath)
- return cell
- }
- else{
- let cell = UserInfoCell.cell(withTableView: tableView, indexPath: indexPath)
- cell.type = type
- return cell
- }
- }
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- let data = list[indexPath.section].list[indexPath.row]
-
- }
-}
-
-extension UserInfoVC{
- @objc func logoutAction(){
-
- }
-}
+//extension UserInfoVC{
+// @objc func logoutAction(){
+//
+// }
+//}
+++ /dev/null
-//
-// Untitled.swift
-// ShenYin
-//
-// Created by liangshi on 2025/8/6.
-//
-
-import UIKit
-import JXSegmentedView
-import MJRefresh
-
-public enum MessageListType:Int {
- case all = 0
- case school = 1
- case studycar = 2
- case exam = 3
- case system = 4
-
- var name:String{
- switch self {
- case .all:
- return "全部"
- case .studycar:
- return "学车提醒"
- case .school:
- return "驾校通知"
- case .system:
- return "系统提醒"
- case .exam:
- return "考试通知"
- }
- }
- var icon: UIImage? {
- switch self {
- case .all: return UIImage(named: "message_exam")
- case .studycar: return UIImage(named: "message_oclock")
- case .school: return UIImage(named: "message_notice")
- case .system: return UIImage(named: "message_exam")
- case .exam: return UIImage(named: "message_exam")
- }
- }
-}
-
-
-final class MessageListView: BaseView {
- private let tableView = UITableView(frame: .zero, style: .plain)
- init(selectType type:MessageListType){
- super.init(frame: .zero)
-// setupLayout()
-// setupStyle()
- // tableView.mj_header?.beginRefreshing()
- }
-
- override init(frame: CGRect) {
- super.init(frame: frame)
- }
- override func setupViews() {
-
- }
- override func setupLayout() {
-
- }
-
- @MainActor required init?(coder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
-}
-
-extension MessageListView: JXSegmentedListContainerViewListDelegate {
- func listView() -> UIView {
- return self
- }
-}
-extension UIColor {
- static func random() -> UIColor {
- let red = CGFloat.random(in: 0...1)
- let green = CGFloat.random(in: 0...1)
- let blue = CGFloat.random(in: 0...1)
- return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
- }
-}
--- /dev/null
+//
+// SleepCell.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/22.
+//
+
+import UIKit
+
+class SleepCell: BaseCollectionViewCell {
+ let bgView = UIView()
+ let imgV = UIImageView()
+ let playImgV = UIImageView()
+ let titleLab = UILabel()
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+ contentView.addSubview(bgView)
+ bgView.addSubview(imgV)
+ bgView.addSubview(titleLab)
+ bgView.addSubview(playImgV)
+
+ bgView.yc.setCornerRadius(12)
+ bgView.clipsToBounds = true
+ bgView.backgroundColor = .white
+ bgView.snp.makeConstraints { make in
+ make.edges.equalToSuperview()
+ }
+ imgV.snp.makeConstraints { (make) in
+ make.edges.equalToSuperview()
+ }
+
+ titleLab.snp.makeConstraints { (make) in
+ make.left.equalToSuperview().inset(12)
+ make.bottom.equalToSuperview().inset(18)
+ }
+ playImgV.snp.makeConstraints { (make) in
+ make.size.equalTo(34)
+ make.right.equalToSuperview().inset(14)
+ make.bottom.equalToSuperview().inset(18)
+ }
+
+ titleLab.textColor = .white
+ titleLab.font = .medium(16)
+ titleLab.text = "微光"
+
+ imgV.image = UIImage(named: "sleep_demo")
+ playImgV.image = UIImage(named: "play_icon")
+
+
+ }
+
+
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+}
--- /dev/null
+//
+// Untitled.swift
+// ShenYin
+//
+// Created by liangshi on 2025/8/6.
+//
+
+import UIKit
+import JXSegmentedView
+import MJRefresh
+
+public enum SleepListType:Int {
+ case all = 0
+ case school = 1
+ case studycar = 2
+ case exam = 3
+ case system = 4
+
+ var name:String{
+ switch self {
+ case .all:
+ return "全部"
+ case .studycar:
+ return "学车提醒"
+ case .school:
+ return "驾校通知"
+ case .system:
+ return "系统提醒"
+ case .exam:
+ return "考试通知"
+ }
+ }
+ var icon: UIImage? {
+ switch self {
+ case .all: return UIImage(named: "message_exam")
+ case .studycar: return UIImage(named: "message_oclock")
+ case .school: return UIImage(named: "message_notice")
+ case .system: return UIImage(named: "message_exam")
+ case .exam: return UIImage(named: "message_exam")
+ }
+ }
+}
+
+
+ class SleepListView: BaseView,UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout {
+ private var collectionView:UICollectionView!
+
+ init(selectType type:SleepListType){
+ super.init(frame: .zero)
+// setupLayout()
+// setupStyle()
+ // tableView.mj_header?.beginRefreshing()
+ }
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+ }
+ override func setupViews() {
+ let layout = UICollectionViewFlowLayout()
+ // layout.minimumInteritemSpacing = 10.fitR
+ layout.minimumLineSpacing = 18
+ layout.itemSize = CGSize(width: (kScreenWid-54)/2, height: (kScreenWid-54)/2)
+ collectionView = UICollectionView(frame: CGRect.zero, collectionViewLayout: layout)
+ addSubview(collectionView)
+
+ collectionView.do { (v) in
+ v.dataSource = self
+ v.delegate = self
+ v.backgroundColor = .clear
+ v.bounces = true
+ v.contentInset = UIEdgeInsets(top: 0, left: 18, bottom: 0, right: 18)
+ v.register(SleepCell.self, forCellWithReuseIdentifier: SleepCell.reuseID)
+// v.register(VipHeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier:VipHeaderView.reuseID )
+// v.register(VipSectionHeader.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier:VipSectionHeader.reuseID )
+ }
+ }
+ override func setupLayout() {
+
+
+ collectionView.snp.makeConstraints { (m) in
+ m.top.equalToSuperview().inset(10)
+ m.left.right.bottom.equalToSuperview()
+ }
+ }
+
+ @MainActor required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+
+ func numberOfSections(in collectionView: UICollectionView) -> Int {
+ return 1
+ }
+ func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+ return 30
+ }
+// func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView{
+// if indexPath.section == 0 {
+// let header = VipHeaderView.header(with: collectionView, indexPath: indexPath)
+// header.banner.config(list: vm.bannerList)
+// return header
+// }
+// else{
+// let header = VipSectionHeader.header(with: collectionView, indexPath: indexPath)
+// return header
+// }
+// }
+
+// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
+// if section == 0 {
+// return CGSize(width: kScreenWid, height: 320.fitR)
+// }
+// else{
+// return CGSize(width: kScreenWid, height: 50.fitR)
+// }
+// }
+
+ func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+ let cell = SleepCell.cell(withCollectionView: collectionView, indexPath: indexPath)
+// cell.model = self.vm.cellList[indexPath.row]
+ return cell
+ }
+
+
+
+}
+
+extension SleepListView: JXSegmentedListContainerViewListDelegate {
+ func listView() -> UIView {
+ return self
+ }
+}
+extension UIColor {
+ static func random() -> UIColor {
+ let red = CGFloat.random(in: 0...1)
+ let green = CGFloat.random(in: 0...1)
+ let blue = CGFloat.random(in: 0...1)
+ return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
+ }
+}
import JXSegmentedView
class SleepVC: BaseVC {
- private var titles = [MessageListType.all,MessageListType.school,MessageListType.studycar,MessageListType.exam]
+ private var titles = [SleepListType.all,SleepListType.school,SleepListType.studycar,SleepListType.exam]
private let segmentedDataSource = JXSegmentedTitleDataSource()
private let segmentedView = JXSegmentedView()
private lazy var listContainerView: JXSegmentedListContainerView! = {
view.addSubview(segmentedView)
view.addSubview(listContainerView)
- navBar.title = "消息"
+ navBar.title = "白噪音"
view.backgroundColor = .color(.bgColor)
segmentedView.do { (v) in
- segmentedDataSource.titleNormalColor = .rgb(0xB3B3B3)
- segmentedDataSource.titleSelectedColor = .color(.primary)
+ segmentedDataSource.titleNormalColor = .hexString("#999999")
+ segmentedDataSource.titleSelectedColor = .hexString("#121212")
segmentedDataSource.titleNormalFont = .regular(14)
- segmentedDataSource.titleSelectedFont = .medium(14)
+ segmentedDataSource.titleSelectedFont = .bold(16)
segmentedDataSource.isTitleZoomEnabled = true
segmentedDataSource.titleSelectedZoomScale = 1
segmentedDataSource.isTitleStrokeWidthEnabled = true
segmentedDataSource.isItemSpacingAverageEnabled = true
segmentedDataSource.isTitleColorGradientEnabled = true
segmentedDataSource.titles = titles.map{"\($0.name)"}
- segmentedView.backgroundColor = .white
+ segmentedView.backgroundColor = .clear
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
- indicator.indicatorWidth = 30.fitR
- indicator.height = 4.fitR
+ indicator.indicatorWidth = 20
+ indicator.height = 6
indicator.indicatorColor = .color(.theme)
segmentedView.indicators = [indicator]
}
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
- let dele = MessageListView(selectType: titles[index])
+ let dele = SleepListView(selectType: titles[index])
// dele.popToRoot = { [unowned self] in
// navigationController?.popToRootViewController(animated: true)
// }
end
+post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ if target.name == 'HandyJSON'
+ target.build_configurations.each do |config|
+ # 解决归档时的优化级别冲突
+ config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
+ end
+ end
+ end
+end