Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
81b21452
Commit
81b21452
authored
Apr 17, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 消息
parent
bd833687
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
83 additions
and
34 deletions
+83
-34
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+4
-4
YHTabBarViewController.swift
galaxy/galaxy/Classes/Base/C/YHTabBarViewController.swift
+8
-3
YHMessageDetailListVC.swift
...Classes/Modules/Message(消息)/C/YHMessageDetailListVC.swift
+16
-14
YHMessageListVC.swift
...alaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
+2
-0
YHDetailMessageCell.swift
...y/Classes/Modules/Message(消息)/V/YHDetailMessageCell.swift
+2
-5
YHMsgViewModel.swift
...alaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
+1
-1
YHMyViewController.swift
...alaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
+28
-5
YHPersonalCenterCell.swift
...axy/Classes/Modules/Mine(我的)/V/YHPersonalCenterCell.swift
+19
-2
YhConstant.swift
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
+3
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
81b21452
...
...
@@ -18,7 +18,7 @@
04174D772BCD5B74000BA46D
/* YHMessageDetailListVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D6E2BCD5B74000BA46D
/* YHMessageDetailListVC.swift */
;
};
04174D782BCD5B74000BA46D
/* YHMessageListVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D6F2BCD5B74000BA46D
/* YHMessageListVC.swift */
;
};
04174D792BCD5B74000BA46D
/* YHMessageSessionCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D712BCD5B74000BA46D
/* YHMessageSessionCell.swift */
;
};
04174D7A2BCD5B74000BA46D
/* YH
InformationFillCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D722BCD5B74000BA46D
/* YHInformationFill
Cell.swift */
;
};
04174D7A2BCD5B74000BA46D
/* YH
DetailMessageCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D722BCD5B74000BA46D
/* YHDetailMessage
Cell.swift */
;
};
0425E63D2BA9345200A5E763
/* YHSchemeTableViewCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E63C2BA9345200A5E763
/* YHSchemeTableViewCell.swift */
;
};
0425E6402BA9357D00A5E763
/* YHScemeItemModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E63F2BA9357D00A5E763
/* YHScemeItemModel.swift */
;
};
0425E6422BA95B1B00A5E763
/* YHSchemeTableFooterView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E6412BA95B1B00A5E763
/* YHSchemeTableFooterView.swift */
;
};
...
...
@@ -467,7 +467,7 @@
04174D6E2BCD5B74000BA46D
/* YHMessageDetailListVC.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMessageDetailListVC.swift
;
sourceTree
=
"<group>"
;
};
04174D6F2BCD5B74000BA46D
/* YHMessageListVC.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMessageListVC.swift
;
sourceTree
=
"<group>"
;
};
04174D712BCD5B74000BA46D
/* YHMessageSessionCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMessageSessionCell.swift
;
sourceTree
=
"<group>"
;
};
04174D722BCD5B74000BA46D
/* YH
InformationFillCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHInformationFill
Cell.swift
;
sourceTree
=
"<group>"
;
};
04174D722BCD5B74000BA46D
/* YH
DetailMessageCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHDetailMessage
Cell.swift
;
sourceTree
=
"<group>"
;
};
0425E63C2BA9345200A5E763
/* YHSchemeTableViewCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSchemeTableViewCell.swift
;
sourceTree
=
"<group>"
;
};
0425E63F2BA9357D00A5E763
/* YHScemeItemModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHScemeItemModel.swift
;
sourceTree
=
"<group>"
;
};
0425E6412BA95B1B00A5E763
/* YHSchemeTableFooterView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSchemeTableFooterView.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -968,7 +968,7 @@
isa
=
PBXGroup
;
children
=
(
04174D712BCD5B74000BA46D
/* YHMessageSessionCell.swift */
,
04174D722BCD5B74000BA46D
/* YH
InformationFill
Cell.swift */
,
04174D722BCD5B74000BA46D
/* YH
DetailMessage
Cell.swift */
,
);
path
=
V
;
sourceTree
=
"<group>"
;
...
...
@@ -2861,7 +2861,7 @@
A5ACE9352B4564F7002C94D2
/* YHNetRequest.swift in Sources */
,
A5FD63CB2B63D6C300D1D9DA
/* YHInformationFillTipsCell.swift in Sources */
,
045EEF1F2B9F171A0022A143
/* YHDatePickView.swift in Sources */
,
04174D7A2BCD5B74000BA46D
/* YH
InformationFill
Cell.swift in Sources */
,
04174D7A2BCD5B74000BA46D
/* YH
DetailMessage
Cell.swift in Sources */
,
045EEE972B9F171A0022A143
/* YHPreviewInfoWorkExpView.swift in Sources */
,
044414012BC3979800784A14
/* YHServerHKLifeViewController.swift in Sources */
,
04D5C5662B8ED92600190021
/* YHBaseModel.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Base/C/YHTabBarViewController.swift
View file @
81b21452
...
...
@@ -20,6 +20,9 @@ class YHTabBarViewController: ESTabBarController {
super
.
viewDidLoad
()
handleTabBarLine
()
addObservers
()
if
YHLoginManager
.
shared
.
isLogin
()
{
getTotalUnreadMsgCount
()
}
}
func
addObservers
()
{
...
...
@@ -27,6 +30,7 @@ class YHTabBarViewController: ESTabBarController {
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
logoutSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
clearAllUnreadMsg
)
,
name
:
YhConstant
.
YhNotification
.
didMarkAllMessagesReadedNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
switchToMsgTab
)
,
name
:
YhConstant
.
YhNotification
.
didSwithToMsgTabNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
getTotalUnreadMsgCount
)
,
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgTotalCountNotification
,
object
:
nil
)
}
}
...
...
@@ -65,11 +69,12 @@ extension YHTabBarViewController {
}
}
func
getTotalUnreadMsgCount
()
{
self
.
viewModel
.
requestTotalUnreadMsgCount
{
// 请求未读消息总数
@objc
func
getTotalUnreadMsgCount
()
{
self
.
viewModel
.
requestTotalUnreadMsgCount
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
!
success
{
return
}
DispatchQueue
.
main
.
async
{
if
let
vcs
=
self
.
viewControllers
,
let
msgListVC
=
vcs
[
safe
:
2
]
{
let
count
=
self
.
viewModel
.
unreadTotalCount
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHMessageDetailListVC.swift
View file @
81b21452
...
...
@@ -54,7 +54,7 @@ class YHMessageDetailListVC: YHBaseViewController {
tableView
.
backgroundColor
=
UIColor
(
hex
:
0xF8F8F8
)
tableView
.
backgroundView
=
emptyDataTipsView
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YH
InformationFillCell
.
self
,
forCellReuseIdentifier
:
YHInformationFill
Cell
.
cellReuseIdentifier
)
tableView
.
register
(
YH
DetailMessageCell
.
self
,
forCellReuseIdentifier
:
YHDetailMessage
Cell
.
cellReuseIdentifier
)
return
tableView
}()
...
...
@@ -123,7 +123,9 @@ class YHMessageDetailListVC: YHBaseViewController {
emptyDataTipsView
.
isHidden
=
msgArr
.
count
>
0
self
.
tableView
.
reloadData
{
[
weak
self
]
in
self
?
.
addUpAppearUnreadMessages
()
guard
let
self
=
self
else
{
return
}
self
.
addUpAppearUnreadMessages
()
self
.
markAppearMessagsReaded
()
}
}
}
...
...
@@ -163,10 +165,8 @@ class YHMessageDetailListVC: YHBaseViewController {
}
}
if
msgIds
.
count
<=
0
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
"标记已读中..."
))
self
.
viewModel
.
readMessages
(
type
:
self
.
type
,
msgIds
:
msgIds
,
isAllRead
:
false
)
{
[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
if
success
{
for
msgItem
in
resultArr
{
...
...
@@ -175,15 +175,13 @@ class YHMessageDetailListVC: YHBaseViewController {
self
.
tableView
.
reloadData
()
return
}
var
msg
=
"标记已读失败"
if
let
error
=
error
{
if
error
.
errorMsg
.
count
>
0
{
msg
=
error
.
errorMsg
}
}
YHHUD
.
flash
(
message
:
msg
)
// var msg = "标记已读失败"
// if let error = error {
// if error.errorMsg.count > 0 {
// msg = error.errorMsg
// }
// }
// YHHUD.flash(message: msg)
}
}
}
...
...
@@ -196,7 +194,11 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHInformationFillCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHInformationFillCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHDetailMessageCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHDetailMessageCell
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
msgArr
.
count
{
let
item
=
msgArr
[
indexPath
.
row
]
cell
.
updateModel
(
item
)
}
return
cell
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
View file @
81b21452
...
...
@@ -91,6 +91,8 @@ class YHMessageListVC: YHBaseViewController {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
getUnreadMsgList
()
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgTotalCountNotification
,
object
:
nil
)
}
func
setupUI
()
{
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/V/YH
InformationFill
Cell.swift
→
galaxy/galaxy/Classes/Modules/Message(消息)/V/YH
DetailMessage
Cell.swift
View file @
81b21452
...
...
@@ -9,9 +9,9 @@
import
UIKit
import
AttributedString
class
YH
InformationFill
Cell
:
UITableViewCell
{
class
YH
DetailMessage
Cell
:
UITableViewCell
{
static
let
cellReuseIdentifier
=
"YH
InformationFill
Cell"
static
let
cellReuseIdentifier
=
"YH
DetailMessage
Cell"
static
let
unreadPointWidth
=
6.0
var
whiteView
:
UIView
!
...
...
@@ -94,7 +94,6 @@ class YHInformationFillCell: UITableViewCell {
unreadPointView
.
clipsToBounds
=
true
whiteView
.
addSubview
(
unreadPointView
)
detailLabel
=
UILabel
()
detailLabel
.
textAlignment
=
.
left
detailLabel
.
numberOfLines
=
0
...
...
@@ -153,8 +152,6 @@ class YHInformationFillCell: UITableViewCell {
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
52
)
}
updateModel
()
}
@objc
func
didBottomBtnClicked
()
{
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
View file @
81b21452
...
...
@@ -146,7 +146,7 @@ class YHMsgViewModel: NSObject {
func
requestTotalUnreadMsgCount
(
_
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Message
.
unreadTotalCountApi
let
_
=
YHNetRequest
.
pos
tRequest
(
url
:
strUrl
)
{
let
_
=
YHNetRequest
.
ge
tRequest
(
url
:
strUrl
)
{
json
,
code
in
let
dic
=
json
.
data
as?
[
String
:
Any
]
printLog
(
"model 是 ==>
\(
json
)
"
)
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
View file @
81b21452
...
...
@@ -27,10 +27,12 @@ enum YHPersonalModuleItemType: Int {
case
aboutUs
}
struct
PersonalModuleItem
{
class
PersonalModuleItem
{
var
icon
:
String
?
var
title
:
String
var
type
:
YHPersonalModuleItemType
=
.
none
var
isShowRedPoint
:
Bool
=
false
init
(
icon
:
String
?
=
nil
,
title
:
String
,
type
:
YHPersonalModuleItemType
)
{
self
.
icon
=
icon
self
.
title
=
title
...
...
@@ -40,8 +42,9 @@ struct PersonalModuleItem {
class
YHMyViewController
:
YHBaseViewController
,
ConstraintRelatableTarget
{
let
viewModel
:
YHMyLikeViewModel
=
YHMyLikeViewModel
()
let
likeViewModel
:
YHMyLikeViewModel
=
YHMyLikeViewModel
()
let
msgViewModel
:
YHMsgViewModel
=
YHMsgViewModel
()
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
...
...
@@ -144,6 +147,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
requestLikeCollectionCount
()
getTotalUnreadMsgCount
()
}
@objc
func
clickBtn
()
{
...
...
@@ -179,10 +183,29 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
func
requestLikeCollectionCount
()
{
self
.
viewModel
.
getLikeCollectionRecentScanCountInfo
{
self
.
likeViewModel
.
getLikeCollectionRecentScanCountInfo
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
headerView
.
updateLikeCollectCount
(
self
.
likeViewModel
.
likeCollectCountInfo
)
}
}
// 请求未读消息总数
func
getTotalUnreadMsgCount
()
{
self
.
msgViewModel
.
requestTotalUnreadMsgCount
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
headerView
.
updateLikeCollectCount
(
self
.
viewModel
.
likeCollectCountInfo
)
if
!
success
{
return
}
DispatchQueue
.
main
.
async
{
let
count
=
self
.
msgViewModel
.
unreadTotalCount
for
item
in
self
.
items
{
if
item
.
type
==
.
myMessage
{
item
.
isShowRedPoint
=
count
>
0
break
}
}
self
.
tableView
.
reloadData
()
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/V/YHPersonalCenterCell.swift
View file @
81b21452
...
...
@@ -11,7 +11,8 @@ import SnapKit
class
YHPersonalCenterCell
:
UITableViewCell
{
static
let
cellReuseIdentifier
=
"YHPersonalCenterCell"
static
let
redPointWidth
=
6.0
lazy
var
iconImgView
:
UIImageView
=
{
let
icon
=
UIImageView
(
image
:
UIImage
(
named
:
"mine_manager"
))
return
icon
...
...
@@ -25,6 +26,14 @@ class YHPersonalCenterCell: UITableViewCell {
return
label
}()
lazy
var
redPointView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
UIColor
(
hex
:
0xF81D22
)
view
.
layer
.
cornerRadius
=
Self
.
redPointWidth
/
2.0
view
.
clipsToBounds
=
true
return
view
}()
lazy
var
arrowImgView
:
UIImageView
=
{
let
arrowImgView
=
UIImageView
(
image
:
UIImage
(
named
:
"mine_arrow_right"
))
return
arrowImgView
...
...
@@ -46,6 +55,7 @@ class YHPersonalCenterCell: UITableViewCell {
iconImgView
.
image
=
nil
}
titleLabel
.
text
=
item
.
title
;
redPointView
.
isHidden
=
!
item
.
isShowRedPoint
}
func
setupUI
()
{
...
...
@@ -56,6 +66,7 @@ class YHPersonalCenterCell: UITableViewCell {
contentView
.
addSubview
(
iconImgView
)
contentView
.
addSubview
(
titleLabel
)
contentView
.
addSubview
(
arrowImgView
)
contentView
.
addSubview
(
redPointView
)
iconImgView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
contentView
.
snp
.
left
)
.
offset
(
27
)
...
...
@@ -66,7 +77,13 @@ class YHPersonalCenterCell: UITableViewCell {
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
(
contentView
)
make
.
left
.
equalTo
(
iconImgView
.
snp
.
right
)
.
offset
(
10
)
make
.
right
.
equalTo
(
arrowImgView
.
snp
.
left
)
.
offset
(
-
20
)
make
.
right
.
equalTo
(
redPointView
.
snp
.
left
)
.
offset
(
-
5
)
}
redPointView
.
snp
.
makeConstraints
{
make
in
make
.
width
.
height
.
equalTo
(
Self
.
redPointWidth
)
make
.
centerY
.
equalToSuperview
()
make
.
right
.
equalTo
(
arrowImgView
.
snp
.
left
)
.
offset
(
-
5
)
}
arrowImgView
.
snp
.
makeConstraints
{
make
in
...
...
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
View file @
81b21452
...
...
@@ -202,5 +202,8 @@ extension YhConstant {
// 自动转换到消息tab
public
static
let
didSwithToMsgTabNotification
=
Notification
.
Name
(
rawValue
:
"com.yinhe.msgPage.switch"
)
// 请求消息未读总数通知
public
static
let
didRequestUnreadMsgTotalCountNotification
=
Notification
.
Name
(
rawValue
:
"com.yinhe.msgPage.unreadMsgTotal"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment