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
f60c05e1
Commit
f60c05e1
authored
May 24, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 消息
parent
94bd366b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
9 deletions
+26
-9
Applegate(JPush).swift
galaxy/galaxy/Applegate(JPush).swift
+3
-2
YHGalaxyNewsListViewController.swift
...odules/Message(消息)/C/YHGalaxyNewsListViewController.swift
+21
-5
YHGalaxyNewsCell.swift
...laxy/Classes/Modules/Message(消息)/V/YHGalaxyNewsCell.swift
+1
-1
YHMsgViewModel.swift
...alaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
+1
-1
No files found.
galaxy/galaxy/Applegate(JPush).swift
View file @
f60c05e1
...
@@ -120,14 +120,15 @@ extension AppDelegate: JPUSHRegisterDelegate {
...
@@ -120,14 +120,15 @@ extension AppDelegate: JPUSHRegisterDelegate {
goToMessagePage
()
goToMessagePage
()
if
let
msgType
=
userInfo
[
"msg_type"
]
as?
Int
,
msgType
==
YHMessageType
.
article
.
rawValue
{
if
let
msgType
=
userInfo
[
"msg_type"
]
as?
Int
,
msgType
==
YHMessageType
.
article
.
rawValue
{
let
model
=
YHNewsModel
()
let
model
=
YHNewsModel
()
model
.
id
=
userInfo
[
"msg_id"
]
as?
String
??
""
model
.
article_id
=
userInfo
[
"article_id"
]
as?
Int
??
0
model
.
article_id
=
userInfo
[
"article_id"
]
as?
Int
??
0
model
.
news_type
=
userInfo
[
"news_type"
]
as?
Int
??
0
model
.
news_type
=
userInfo
[
"news_type"
]
as?
Int
??
0
model
.
cover_img
=
userInfo
[
"cover_img"
]
as?
String
??
""
model
.
cover_img
=
userInfo
[
"cover_img"
]
as?
String
??
""
model
.
url
=
userInfo
[
"url"
]
as?
String
??
""
model
.
url
=
userInfo
[
"url"
]
as?
String
??
""
model
.
media_url
=
userInfo
[
"media_url"
]
as?
String
??
""
model
.
media_url
=
userInfo
[
"media_url"
]
as?
String
??
""
model
.
media_transcode_url
=
userInfo
[
"media_transcode_url"
]
as?
String
??
""
model
.
media_transcode_url
=
userInfo
[
"media_transcode_url"
]
as?
String
??
""
YHGalaxyNewsListViewController
.
enterDetail
(
model
)
yh_newsList
.
enterDetail
(
model
)
yh_newsList
.
markRead
(
model
)
}
}
})
})
}
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHGalaxyNewsListViewController.swift
View file @
f60c05e1
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
import
UIKit
import
UIKit
let
yh_newsList
=
YHGalaxyNewsListViewController
()
class
YHGalaxyNewsListViewController
:
YHBaseViewController
{
class
YHGalaxyNewsListViewController
:
YHBaseViewController
{
let
type
:
Int
=
YHMessageType
.
article
.
rawValue
let
type
:
Int
=
YHMessageType
.
article
.
rawValue
...
@@ -32,6 +34,10 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
...
@@ -32,6 +34,10 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
tableView
.
backgroundView
=
emptyDataTipsView
tableView
.
backgroundView
=
emptyDataTipsView
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHGalaxyNewsCell
.
self
,
forCellReuseIdentifier
:
YHGalaxyNewsCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHGalaxyNewsCell
.
self
,
forCellReuseIdentifier
:
YHGalaxyNewsCell
.
cellReuseIdentifier
)
tableView
.
es
.
addYHPullToRefresh
{
self
.
getMsgList
(
more
:
false
)
}
tableView
.
es
.
addInfiniteScrolling
{
tableView
.
es
.
addInfiniteScrolling
{
self
.
getMsgList
(
more
:
true
)
self
.
getMsgList
(
more
:
true
)
}
}
...
@@ -58,6 +64,7 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
...
@@ -58,6 +64,7 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
view
.
backgroundColor
=
.
init
(
hex
:
0xF8F9FB
)
view
.
backgroundColor
=
.
init
(
hex
:
0xF8F9FB
)
view
.
addSubview
(
tableView
)
view
.
addSubview
(
tableView
)
tableView
.
snp
.
makeConstraints
{
make
in
tableView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
...
@@ -78,12 +85,19 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
...
@@ -78,12 +85,19 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
func
getMsgList
(
more
:
Bool
=
false
)
{
func
getMsgList
(
more
:
Bool
=
false
)
{
if
isLastPage
{
if
isLastPage
{
if
more
{
tableView
.
es
.
stopLoadingMore
()
tableView
.
es
.
stopLoadingMore
()
}
else
{
tableView
.
es
.
stopPullToRefresh
()
}
self
.
tableView
.
es
.
noticeNoMoreData
()
self
.
tableView
.
footer
?
.
isHidden
=
false
return
return
}
}
if
more
{
if
more
{
currentPage
+=
1
currentPage
+=
1
}
else
{
}
else
{
currentPage
=
1
currentPage
=
1
}
}
...
@@ -94,11 +108,14 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
...
@@ -94,11 +108,14 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
newsArr
.
append
(
contentsOf
:
self
.
viewModel
.
newsDetailList
)
newsArr
.
append
(
contentsOf
:
self
.
viewModel
.
newsDetailList
)
emptyDataTipsView
.
isHidden
=
newsArr
.
count
>
0
emptyDataTipsView
.
isHidden
=
newsArr
.
count
>
0
self
.
isLastPage
=
isLastPage
self
.
isLastPage
=
isLastPage
if
more
{
tableView
.
es
.
stopLoadingMore
()
tableView
.
es
.
stopLoadingMore
()
}
else
{
tableView
.
es
.
stopPullToRefresh
()
}
if
isLastPage
{
if
isLastPage
{
self
.
tableView
.
es
.
noticeNoMoreData
()
self
.
tableView
.
es
.
noticeNoMoreData
()
self
.
tableView
.
footer
?
.
alpha
=
1
self
.
tableView
.
footer
?
.
isHidden
=
false
}
}
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
}
}
...
@@ -128,7 +145,6 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
...
@@ -128,7 +145,6 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
}
}
func
markRead
(
_
model
:
YHNewsModel
)
{
func
markRead
(
_
model
:
YHNewsModel
)
{
if
let
id
=
Int
(
model
.
id
)
{
if
let
id
=
Int
(
model
.
id
)
{
self
.
viewModel
.
readMessages
(
type
:
self
.
type
,
msgIds
:
[
id
],
isAllRead
:
false
)
{
[
weak
self
]
success
,
_
in
self
.
viewModel
.
readMessages
(
type
:
self
.
type
,
msgIds
:
[
id
],
isAllRead
:
false
)
{
[
weak
self
]
success
,
_
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
@@ -146,7 +162,7 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
...
@@ -146,7 +162,7 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
}
}
}
}
static
func
enterDetail
(
_
item
:
YHNewsModel
)
{
func
enterDetail
(
_
item
:
YHNewsModel
)
{
if
item
.
news_type
==
2
{
// 图文
if
item
.
news_type
==
2
{
// 图文
let
vc
=
YHHomeWebViewController
()
let
vc
=
YHHomeWebViewController
()
vc
.
url
=
YHBaseUrlManager
.
shared
.
curH5URL
()
+
"articleDetail.html"
+
"?id=
\(
item
.
article_id
)
"
vc
.
url
=
YHBaseUrlManager
.
shared
.
curH5URL
()
+
"articleDetail.html"
+
"?id=
\(
item
.
article_id
)
"
...
@@ -199,7 +215,7 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
...
@@ -199,7 +215,7 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
newsArr
.
count
{
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
newsArr
.
count
{
let
item
=
newsArr
[
indexPath
.
row
]
let
item
=
newsArr
[
indexPath
.
row
]
S
elf
.
enterDetail
(
item
)
s
elf
.
enterDetail
(
item
)
self
.
markRead
(
item
)
self
.
markRead
(
item
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/V/YHGalaxyNewsCell.swift
View file @
f60c05e1
...
@@ -82,7 +82,7 @@ class YHGalaxyNewsCell: UITableViewCell {
...
@@ -82,7 +82,7 @@ class YHGalaxyNewsCell: UITableViewCell {
func
updateModel
(
_
model
:
YHNewsModel
)
{
func
updateModel
(
_
model
:
YHNewsModel
)
{
timeLabel
.
text
=
formatTimestamp
(
Double
(
model
.
time
))
timeLabel
.
text
=
formatTimestamp
(
Double
(
model
.
time
))
coverImgV
.
sd_setImage
(
with
:
URL
(
string
:
model
.
cover_img
),
placeholderImage
:
UIImage
(
named
:
""
))
coverImgV
.
sd_setImage
(
with
:
URL
(
string
:
model
.
cover_img
),
placeholderImage
:
UIImage
(
named
:
"
msg_news_cover_default
"
))
titleLabel
.
text
=
model
.
title
titleLabel
.
text
=
model
.
title
descLabel
.
text
=
model
.
content
descLabel
.
text
=
model
.
content
redPointView
.
isHidden
=
model
.
is_read
redPointView
.
isHidden
=
model
.
is_read
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
View file @
f60c05e1
...
@@ -219,7 +219,7 @@ class YHMsgViewModel: NSObject {
...
@@ -219,7 +219,7 @@ class YHMsgViewModel: NSObject {
for
item
in
arr
{
for
item
in
arr
{
self
.
newsDetailList
.
append
(
item
)
self
.
newsDetailList
.
append
(
item
)
}
}
let
currentPage
=
(
self
.
newsDetailList
.
count
+
k
MsgPageSize
-
1
)
/
kMsg
PageSize
let
currentPage
=
(
self
.
newsDetailList
.
count
+
k
NewsPageSize
-
1
)
/
kNews
PageSize
callBackBlock
(
true
,
currentPage
==
totalPage
)
callBackBlock
(
true
,
currentPage
==
totalPage
)
}
}
...
...
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