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
921ffcf6
Commit
921ffcf6
authored
Apr 16, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 消息
parent
3adbc068
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
2 deletions
+46
-2
YHMessageSessionCell.swift
.../Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
+15
-1
YHMsgViewModel.swift
...alaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
+31
-1
No files found.
galaxy/galaxy/Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
View file @
921ffcf6
...
...
@@ -47,8 +47,22 @@ class YHMessageSessionCell: UITableViewCell {
}
else
{
self
.
nameLabel
.
text
=
""
}
self
.
badgeLabel
.
isHidden
=
model
.
unreadCount
<=
0
let
unreadCountText
=
(
model
.
unreadCount
<
100
?
String
(
model
.
unreadCount
)
:
"99+"
)
self
.
badgeLabel
.
text
=
unreadCountText
self
.
badgeLabel
.
snp
.
updateConstraints
{
make
in
var
width
=
badgeHeight
if
unreadCountText
.
count
<
2
{
// 个位数
width
=
badgeHeight
}
else
if
unreadCountText
.
count
==
2
{
// 两位数
width
=
22.0
}
else
if
unreadCountText
.
count
>=
3
{
// 三位数
width
=
30.0
}
make
.
width
.
equalTo
(
width
)
}
self
.
badgeLabel
.
text
=
(
model
.
unreadCount
<
100
?
String
(
model
.
unreadCount
)
:
"99+"
)
self
.
detailLabel
.
text
=
model
.
lastMessage
self
.
timeLabel
.
text
=
formatTimestamp
(
Double
(
model
.
lastMessageTime
))
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
View file @
921ffcf6
...
...
@@ -19,7 +19,37 @@ class YHMsgViewModel: NSObject {
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Message
.
unreadMsgList
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
json
,
code
in
let
dic
=
json
.
data
var
dic
=
json
.
data
var
json
=
json
json
.
code
=
200
dic
=
[
"information"
:
[
"unread_count"
:
0
,
"last_message"
:
"阿法守法所发生的法师打发"
,
"last_message_time"
:
1586507545
,
"type"
:
0
],
"certificate"
:
[
"unread_count"
:
3
,
"last_message"
:
"发生发顺丰大声道发生大发萨法沙发沙发沙发沙发阿斯顿发生发顺丰阿凡达放大第三方"
,
"last_message_time"
:
1586507545
,
"type"
:
0
],
"draft"
:
[
"unread_count"
:
100
,
"last_message"
:
"发生发顺丰大声道发生大发"
,
"last_message_time"
:
1712737945
,
"type"
:
0
],
"signature"
:
[
"unread_count"
:
87
,
"last_message"
:
"发生发"
,
"last_message_time"
:
1713236425
,
"type"
:
0
]
]
printLog
(
"model 是 ==>
\(
json
)
"
)
if
json
.
code
==
200
{
guard
let
result
=
YHMsgListModel
.
deserialize
(
dict
:
dic
as?
Dictionary
)
else
{
...
...
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