Commit 7714d7aa authored by David黄金龙's avatar David黄金龙

1、删除不使用的代码

2、处理 我的  tab的逻辑
parent 735690cf
......@@ -22,7 +22,6 @@
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.swift */; };
043F0AB22BC781F5006CB887 /* YHMessageSessionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043F0AB12BC781F5006CB887 /* YHMessageSessionCell.swift */; };
043F0AB42BC7B80F006CB887 /* YHTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043F0AB32BC7B80F006CB887 /* YHTestViewController.swift */; };
043F0AB62BC7CE1B006CB887 /* YHInformationFillVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043F0AB52BC7CE1B006CB887 /* YHInformationFillVC.swift */; };
043F0AB82BC7CE5C006CB887 /* YHInformationFillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043F0AB72BC7CE5C006CB887 /* YHInformationFillCell.swift */; };
044413F72BC2786200784A14 /* YHHomeWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413F62BC2786200784A14 /* YHHomeWebViewController.swift */; };
......@@ -463,7 +462,6 @@
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileMethodTableViewCell.swift; sourceTree = "<group>"; };
0435FA822BA2DEB100024EAE /* YHCardButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardButton.swift; sourceTree = "<group>"; };
043F0AB12BC781F5006CB887 /* YHMessageSessionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = YHMessageSessionCell.swift; path = galaxy/Classes/Base/C/YHMessageSessionCell.swift; sourceTree = SOURCE_ROOT; };
043F0AB32BC7B80F006CB887 /* YHTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTestViewController.swift; sourceTree = "<group>"; };
043F0AB52BC7CE1B006CB887 /* YHInformationFillVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationFillVC.swift; sourceTree = "<group>"; };
043F0AB72BC7CE5C006CB887 /* YHInformationFillCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = YHInformationFillCell.swift; path = "galaxy/Classes/Modules/Message(消息)/C/YHInformationFillCell.swift"; sourceTree = SOURCE_ROOT; };
044413F62BC2786200784A14 /* YHHomeWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebViewController.swift; sourceTree = "<group>"; };
......@@ -2147,7 +2145,6 @@
isa = PBXGroup;
children = (
A5ACE9202B4564F7002C94D2 /* YHBaseViewController.swift */,
043F0AB32BC7B80F006CB887 /* YHTestViewController.swift */,
A5ACE9212B4564F7002C94D2 /* YHNavigationController.swift */,
A5ACE9222B4564F7002C94D2 /* YHTabBarViewController.swift */,
A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */,
......@@ -2604,7 +2601,6 @@
045EEE842B9F171A0022A143 /* YHPreviewBasiceInformationViewController.swift in Sources */,
A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */,
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */,
043F0AB42BC7B80F006CB887 /* YHTestViewController.swift in Sources */,
048B2A4D2BC7DAE800A93BF0 /* YHMyLikeViewModel.swift in Sources */,
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */,
045EEECD2B9F171A0022A143 /* YHScoreDataModel.swift in Sources */,
......
//
// YHTestViewController.swift
// galaxy
//
// Created by edy on 2024/4/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHTestViewController: YHBaseViewController {
lazy var nameLabel: UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor(hex:0x121A26)
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_M(ofSize:15)
nameLabel.numberOfLines = 0
return nameLabel
}()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
view.addSubview(nameLabel)
nameLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview()
}
YHHUD.show(.progress(message: "加载中..."))
JPUSHService.registrationIDCompletionHandler {
resCode, registrationID in
YHHUD.hide()
YHLoginManager.shared.userModel?.registerId = registrationID ?? ""
var info = "deviceToken: \n" + (YHLoginManager.shared.userModel?.deviceToken ?? "")
info += "\nregisterId: \n" + (YHLoginManager.shared.userModel?.registerId ?? "")
DispatchQueue.main.async {
self.nameLabel.text = info
}
}
}
}
......@@ -52,7 +52,7 @@ extension YHHomePageViewModel {
var params: [String : Any] = ["page": curPageIndex,
"page_size": page_Size]
if firstPageFlag {
params = ["page": curPageIndex,
params = ["page": 1,
"page_size": page_Size]
} else {
params = ["page": curPageIndex + 1,
......
......@@ -41,7 +41,7 @@ struct PersonalModuleItem {
class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
let viewModel: YHMyLikeViewModel = YHMyLikeViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.grouped)
if #available(iOS 11.0, *) {
......@@ -62,17 +62,18 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
lazy var items: [PersonalModuleItem] = {
let version = "app版本号:" + UIDevice.appVersion() + "_" + UIDevice.appBuild()
return [
PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem(icon: "mine_item_progress", title: "我的进度".local, type:.myProgress),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
PersonalModuleItem(icon: "mine_item_recommend", title: "推荐有礼".local, type:.recommend),
PersonalModuleItem(icon: "mine_item_poster", title: "我的海报".local, type:.myPoster),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay),
PersonalModuleItem(icon: "mine_item_appoint", title: version, type:.appointGalaxyBay),
]
var arrData = [
PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay),
PersonalModuleItem(icon: "mine_item_appoint", title: version, type:.appointGalaxyBay),
]
return arrData
}()
lazy var headerView: YHUserInfoHeaderView = {
......@@ -128,7 +129,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
}
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
initView()
......@@ -206,62 +207,54 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return
} else {
let vc = YHTestViewController()
self.navigationController?.pushViewController(vc)
YHHUD.flash(message: "已登录: 功能完善中...")
}
return
let item: PersonalModuleItem = items[indexPath.row];
// 预览文件预研 杜宇todo
if item.title == "我的消息" {
} else if item.title == "我的进度" {
} else if item.title == "积分中心" {
} else if item.title == "推荐有理" {
let item: PersonalModuleItem = items[indexPath.row]
switch item.type {
case .myMessage://我的消息
printLog("我的消息")
goTabBarBy(tabType: .message)
case .scoreCenter:////积分中心
printLog("积分中心")
if let param = YHLoginManager.shared.userModel?.token,param.count>5 {
printLog(param)
var token : String = param
//待h5端同学提供
var url = "https:www.baidu.com"
var addtionString = randomAlphanumericString(6)//随机6个字母或者数字
let indexToInsert = token.index(token.startIndex, offsetBy: 6) //插入位置,这里以第六个字符后面为例
// token.insert(addtionString, at: indexToInsert) //for test hjl
}
case .myTestCode://我的测评码
printLog("我的测评码")
} else if item.title == "我的海报" {
let vc = YHHomeWebViewController()
vc.url = "https://upload.cdn.galaxy-immi.com/sell/product/images/page-1686138671996.png"
self.navigationController?.pushViewController(vc)
} else if item.title == "我的测评码" {
case .appointGalaxyBay://预约银河湾
printLog("预约银河湾")
let vc = YHHomeWebViewController()
vc.url = "https://upload.cdn.galaxy-immi.com/sell/product/images/page-1686138671996.png"
self.navigationController?.pushViewController(vc)
default:
printLog("不需要响应")
}
// if item.title == "关于我们" {
// let vc = YHAboutUsViewController()
// self.navigationController?.pushViewController(vc)
//
// } else if item.title == "我的设置" {
//
// let account = "duyu"
// let token = "123456"
// let vc = ConversationController()
// self.navigationController?.pushViewController(vc)
//
// IMKitClient.instance.loginIM(account, token) { error in
// if let err = error {
// print("login error in app : ", err.localizedDescription)
// }else {
// let _ = NEAtMessageManager.instance
//
// }
// }
//
//
//
// } else {
// let vc = YHLoginViewController()
// self.navigationController?.pushViewController(vc)
// }
}
}
extension YHMyViewController {
func randomAlphanumericString(_ length: Int) -> String {
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let randomString = (0..<length).map{ _ in String(letters.randomElement()!) }.reduce("", +)
return randomString
}
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
updateUserUI()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment