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
93273d9b
Commit
93273d9b
authored
Apr 18, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 消息
parent
9e74dc90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
38 deletions
+48
-38
YHMessageListVC.swift
...alaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
+35
-25
YHMessageSessionCell.swift
.../Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
+13
-13
No files found.
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
View file @
93273d9b
...
...
@@ -32,32 +32,31 @@ class YHMessageListVC: YHBaseViewController {
return
tableView
}()
lazy
var
navBar
:
YHCustomNavigationBar
=
{
let
bar
=
YHCustomNavigationBar
.
navBar
()
bar
.
backButton
.
isHidden
=
true
bar
.
backgroundColor
=
.
white
bar
.
title
=
"消息"
bar
.
showRightButtonType
(
.
clean
)
bar
.
backBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
lazy
var
navBar
:
UIView
=
{
let
bar
=
UIView
()
let
titleLabel
=
UILabel
()
titleLabel
.
textColor
=
UIColor
(
hex
:
0x121A26
)
titleLabel
.
textAlignment
=
.
left
titleLabel
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
21
)
titleLabel
.
text
=
"消息"
bar
.
addSubview
(
titleLabel
)
let
cleanBtn
=
UIButton
()
cleanBtn
.
setImage
(
UIImage
(
named
:
"msg_clean"
),
for
:
.
normal
)
cleanBtn
.
YH_clickEdgeInsets
=
UIEdgeInsets
(
top
:
20
,
left
:
20
,
bottom
:
20
,
right
:
20
)
cleanBtn
.
addTarget
(
self
,
action
:
#selector(
didCleanButtonClicked
)
,
for
:
.
touchUpInside
)
bar
.
addSubview
(
cleanBtn
)
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
bottom
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
20
)
make
.
right
.
equalTo
(
cleanBtn
.
snp
.
left
)
.
offset
(
-
20
)
}
bar
.
rightBtnClick
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
bar
.
rightBtnClick
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
let
unreadMessages
=
self
.
msgArr
.
filter
{
$0
.
unreadCount
>
0
}
if
unreadMessages
.
count
<=
0
{
YHHUD
.
flash
(
message
:
"暂无未读消息~"
)
return
}
YHCommonAlertView
.
show
(
"清除未读"
,
"确定要清除所有未读提示吗?"
,
"取消"
,
"确认"
)
{
self
.
markAllMsgsRead
()
}
}
cleanBtn
.
snp
.
makeConstraints
{
make
in
make
.
width
.
height
.
equalTo
(
24
)
make
.
centerY
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
}
return
bar
}()
...
...
@@ -140,6 +139,17 @@ class YHMessageListVC: YHBaseViewController {
}
@objc
func
didCleanButtonClicked
()
{
let
unreadMessages
=
self
.
msgArr
.
filter
{
$0
.
unreadCount
>
0
}
if
unreadMessages
.
count
<=
0
{
YHHUD
.
flash
(
message
:
"暂无未读消息~"
)
return
}
YHCommonAlertView
.
show
(
"清除未读"
,
"确定要清除所有未读提示吗?"
,
"取消"
,
"确认"
)
{
self
.
markAllMsgsRead
()
}
}
@objc
func
getUnreadMsgList
()
{
self
.
viewModel
.
getUnreadMsgList
{
[
weak
self
]
success
,
error
in
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
View file @
93273d9b
...
...
@@ -18,7 +18,7 @@ class YHMessageSessionCell: UITableViewCell {
var
badgeLabel
:
UILabel
!
var
nameLabel
:
UILabel
!
var
detailLabel
:
UILabel
!
var
timeLabel
:
UILabel
!
//
var timeLabel: UILabel!
var
bottomLineView
:
UIView
!
required
init
?(
coder
:
NSCoder
)
{
...
...
@@ -64,7 +64,7 @@ class YHMessageSessionCell: UITableViewCell {
}
self
.
detailLabel
.
text
=
!
model
.
lastMessage
.
isEmpty
?
model
.
lastMessage
:
"暂无消息"
.
local
self
.
timeLabel
.
text
=
formatTimestamp
(
Double
(
model
.
lastMessageTime
))
//
self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime))
}
func
formatTimestamp
(
_
timestamp
:
TimeInterval
)
->
String
{
...
...
@@ -126,12 +126,12 @@ class YHMessageSessionCell: UITableViewCell {
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
)
//
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
()
...
...
@@ -169,11 +169,11 @@ class YHMessageSessionCell: UITableViewCell {
make
.
height
.
equalTo
(
17
)
}
timeLabel
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
top
.
equalTo
(
nameLabel
)
make
.
height
.
equalTo
(
15
)
}
//
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
)
...
...
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