Commit 51f3e487 authored by Steven杜宇's avatar Steven杜宇

// 消息

parent ba294fdf
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; }; 0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; };
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; }; 0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.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 */; };
044413F72BC2786200784A14 /* YHHomeWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413F62BC2786200784A14 /* YHHomeWebViewController.swift */; }; 044413F72BC2786200784A14 /* YHHomeWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413F62BC2786200784A14 /* YHHomeWebViewController.swift */; };
044413F92BC279D200784A14 /* YHHomeWebBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413F82BC279D200784A14 /* YHHomeWebBottomView.swift */; }; 044413F92BC279D200784A14 /* YHHomeWebBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413F82BC279D200784A14 /* YHHomeWebBottomView.swift */; };
044413FB2BC27E6F00784A14 /* YHHomeWebBottomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413FA2BC27E6F00784A14 /* YHHomeWebBottomButton.swift */; }; 044413FB2BC27E6F00784A14 /* YHHomeWebBottomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044413FA2BC27E6F00784A14 /* YHHomeWebBottomButton.swift */; };
...@@ -452,6 +454,8 @@ ...@@ -452,6 +454,8 @@
0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView.swift; sourceTree = "<group>"; }; 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView.swift; sourceTree = "<group>"; };
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileMethodTableViewCell.swift; sourceTree = "<group>"; }; 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>"; }; 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>"; };
044413F62BC2786200784A14 /* YHHomeWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebViewController.swift; sourceTree = "<group>"; }; 044413F62BC2786200784A14 /* YHHomeWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebViewController.swift; sourceTree = "<group>"; };
044413F82BC279D200784A14 /* YHHomeWebBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebBottomView.swift; sourceTree = "<group>"; }; 044413F82BC279D200784A14 /* YHHomeWebBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebBottomView.swift; sourceTree = "<group>"; };
044413FA2BC27E6F00784A14 /* YHHomeWebBottomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebBottomButton.swift; sourceTree = "<group>"; }; 044413FA2BC27E6F00784A14 /* YHHomeWebBottomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebBottomButton.swift; sourceTree = "<group>"; };
...@@ -1744,6 +1748,7 @@ ...@@ -1744,6 +1748,7 @@
A53D38192BC23757006AE6F7 /* V */ = { A53D38192BC23757006AE6F7 /* V */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
043F0AB12BC781F5006CB887 /* YHMessageSessionCell.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2110,6 +2115,7 @@ ...@@ -2110,6 +2115,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A5ACE9202B4564F7002C94D2 /* YHBaseViewController.swift */, A5ACE9202B4564F7002C94D2 /* YHBaseViewController.swift */,
043F0AB32BC7B80F006CB887 /* YHTestViewController.swift */,
A5ACE9212B4564F7002C94D2 /* YHNavigationController.swift */, A5ACE9212B4564F7002C94D2 /* YHNavigationController.swift */,
A5ACE9222B4564F7002C94D2 /* YHTabBarViewController.swift */, A5ACE9222B4564F7002C94D2 /* YHTabBarViewController.swift */,
A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */, A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */,
...@@ -2570,6 +2576,7 @@ ...@@ -2570,6 +2576,7 @@
045EEE842B9F171A0022A143 /* YHPreviewBasiceInformationViewController.swift in Sources */, 045EEE842B9F171A0022A143 /* YHPreviewBasiceInformationViewController.swift in Sources */,
A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */, A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */,
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */, 0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */,
043F0AB42BC7B80F006CB887 /* YHTestViewController.swift in Sources */,
A5C5B32D2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift in Sources */, A5C5B32D2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift in Sources */,
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */, 04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */,
045EEECD2B9F171A0022A143 /* YHScoreDataModel.swift in Sources */, 045EEECD2B9F171A0022A143 /* YHScoreDataModel.swift in Sources */,
...@@ -2738,6 +2745,7 @@ ...@@ -2738,6 +2745,7 @@
047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */, 047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */,
045EEEF82B9F171A0022A143 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */, 045EEEF82B9F171A0022A143 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */,
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */, 0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */,
043F0AB22BC781F5006CB887 /* YHMessageSessionCell.swift in Sources */,
045EEE8B2B9F171A0022A143 /* YHPreviewMainApplicantInfoViewController.swift in Sources */, 045EEE8B2B9F171A0022A143 /* YHPreviewMainApplicantInfoViewController.swift in Sources */,
045EEE922B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemView.swift in Sources */, 045EEE922B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemView.swift in Sources */,
045EEEF92B9F171A0022A143 /* YHFormItemTitleCell.swift in Sources */, 045EEEF92B9F171A0022A143 /* YHFormItemTitleCell.swift in Sources */,
......
...@@ -41,6 +41,7 @@ extension AppDelegate: JPUSHRegisterDelegate { ...@@ -41,6 +41,7 @@ extension AppDelegate: JPUSHRegisterDelegate {
let deviceTokenStr = deviceToken.map{String(format:"%02.2hhx", arguments: [$0]) }.joined() let deviceTokenStr = deviceToken.map{String(format:"%02.2hhx", arguments: [$0]) }.joined()
print("deviceToken:\(deviceTokenStr)") print("deviceToken:\(deviceTokenStr)")
JPUSHService.registerDeviceToken(deviceToken) JPUSHService.registerDeviceToken(deviceToken)
YHLoginManager.shared.userModel?.deviceToken = deviceTokenStr
} }
//获取token 失败 //获取token 失败
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { //可选 func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { //可选
......
//
// YHMessageSessionCell.swift
// galaxy
//
// Created by edy on 2024/4/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMessageSessionCell: UITableViewCell {
static let cellReuseIdentifier = "YHMessageSessionCell"
let badgeHeight = 16.0
var iconContentView: UIView!
var iconImgView: UIImageView!
var badgeLabel: UILabel!
var nameLabel: UILabel!
var detailLabel: UILabel!
var timeLabel: UILabel!
var bottomLineView: UIView!
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = .white
iconContentView = UIView()
iconContentView.backgroundColor = UIColor(hex: 0xF4F6FA)
iconContentView.layer.cornerRadius = 22.0
contentView.addSubview(iconContentView)
iconImgView = UIImageView()
iconImgView.backgroundColor = .red
iconContentView.addSubview(iconImgView)
badgeLabel = UILabel()
badgeLabel.backgroundColor = UIColor(hex:0xF81D22)
badgeLabel.textColor = .white
badgeLabel.textAlignment = .center
badgeLabel.font = UIFont.PFSC_M(ofSize:10)
badgeLabel.layer.cornerRadius = badgeHeight/2.0
badgeLabel.clipsToBounds = true
iconContentView.addSubview(badgeLabel)
nameLabel = UILabel()
nameLabel.textColor = UIColor(hex:0x121A26)
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_M(ofSize:15)
contentView.addSubview(nameLabel)
detailLabel = UILabel()
detailLabel.textColor = UIColor(hex:0x121A26, alpha: 0.5)
detailLabel.textAlignment = .left
detailLabel.font = UIFont.PFSC_R(ofSize:12)
contentView.addSubview(detailLabel)
timeLabel = UILabel()
timeLabel.textColor = UIColor(hex:0x121A26, alpha: 0.3)
timeLabel.textAlignment = .right
timeLabel.font = UIFont.PFSC_R(ofSize:11)
timeLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
timeLabel.setContentHuggingPriority(.required, for: .horizontal)
contentView.addSubview(timeLabel)
bottomLineView = UIView()
bottomLineView.backgroundColor = UIColor(hex: 0xF0F3F7)
contentView.addSubview(bottomLineView)
badgeLabel.text = "5"
nameLabel.text = "资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写资料填写"
detailLabel.text = "尊敬的用户,您好~很高兴通知您进行资料填写列尊敬的用户,您好~很高兴通知您进行资料填写列尊敬的用户,您好~很高兴通知您进行资料填写列"
timeLabel.text = "2024-01-01"
iconContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.size.equalTo(CGSize(width: 44, height: 44))
make.centerY.equalToSuperview()
}
iconImgView.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 21, height: 21))
make.center.equalToSuperview()
}
badgeLabel.snp.makeConstraints { make in
make.width.equalTo(badgeHeight)
make.height.equalTo(badgeHeight)
make.top.equalToSuperview().offset(-4)
make.left.equalTo(iconContentView.snp.right).offset(-12)
}
nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconContentView.snp.right).offset(16)
make.right.equalTo(timeLabel.snp.left).offset(-20)
make.top.equalTo(iconContentView)
make.height.equalTo(20)
}
detailLabel.snp.makeConstraints { make in
make.left.equalTo(nameLabel)
make.right.equalTo(timeLabel)
make.top.equalTo(nameLabel.snp.bottom).offset(2)
make.height.equalTo(17)
}
timeLabel.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-20)
make.top.equalTo(nameLabel)
make.height.equalTo(15)
}
bottomLineView.snp.makeConstraints { make in
make.left.right.equalTo(detailLabel)
make.height.equalTo(1)
make.bottom.equalToSuperview()
}
}
}
//
// 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
}
}
}
}
...@@ -16,6 +16,10 @@ struct YHUserModel: SmartCodable { ...@@ -16,6 +16,10 @@ struct YHUserModel: SmartCodable {
var headpic: String? var headpic: String?
var sex: Int? var sex: Int?
var token: String? var token: String?
var deviceToken: String = ""
var pushUserId: String = ""
var registerId: String = ""
} }
...@@ -9,16 +9,82 @@ ...@@ -9,16 +9,82 @@
import UIKit import UIKit
class YHMsgViewController: YHBaseViewController { class YHMsgViewController: YHBaseViewController {
var msgArr:[String] = ["","","",""]
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 1.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .white
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHMessageSessionCell.self, forCellReuseIdentifier: YHMessageSessionCell.cellReuseIdentifier)
return tableView
}()
// lazy var navBar:UIView = {
// let bar = UIView(frame: CGRect(x: 0, y: k_Height_StatusBar, width: KScreenWidth, height: k_Height_NavContentBar))
//
// return bar
// }()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
initView() setupUI()
}
func setupUI() {
gk_backStyle = .white
gk_navTitle = "消息"
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
}
} }
} }
extension YHMsgViewController { extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func initView() {
gk_backStyle = .white func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
gk_navTitle = "消息中心" return msgArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMessageSessionCell.cellReuseIdentifier, for: indexPath) as! YHMessageSessionCell
cell.backgroundColor = .red
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 76.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
} }
} }
...@@ -60,7 +60,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -60,7 +60,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
lazy var items: [PersonalModuleItem] = { lazy var items: [PersonalModuleItem] = {
let version = "app版本号:" + UIDevice.appVersion() + "_" + UIDevice.appBuild() let version = "app版本号:" + UIDevice.appVersion() + "_" + UIDevice.appBuild()
return [PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage), return [PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem(icon: "mine_item_progress", title: "我的进度".local, type:.myProgress), PersonalModuleItem(icon: "mine_item_progress", title: "我的进度".local, type:.myProgress),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter), PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
...@@ -204,6 +204,9 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -204,6 +204,9 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
self.navigationController?.present(vc, animated: true) self.navigationController?.present(vc, animated: true)
return return
} else { } else {
let vc = YHTestViewController()
self.navigationController?.pushViewController(vc)
YHHUD.flash(message: "已登录: 功能完善中...") YHHUD.flash(message: "已登录: 功能完善中...")
} }
return return
......
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