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
8259c128
Commit
8259c128
authored
May 23, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 资讯
parent
9ba596b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
20 deletions
+63
-20
Applegate(JPush).swift
galaxy/galaxy/Applegate(JPush).swift
+11
-0
YHGalaxyNewsListViewController.swift
...odules/Message(消息)/C/YHGalaxyNewsListViewController.swift
+52
-20
No files found.
galaxy/galaxy/Applegate(JPush).swift
View file @
8259c128
...
...
@@ -118,6 +118,17 @@ extension AppDelegate: JPUSHRegisterDelegate {
YHLoginManager
.
shared
.
needJumpToMsgTabFlag
=
true
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.25
,
execute
:
{
goToMessagePage
()
if
let
msgType
=
userInfo
[
"msg_type"
]
as?
Int
,
msgType
==
YHMessageType
.
article
.
rawValue
{
let
model
=
YHNewsModel
()
model
.
article_id
=
userInfo
[
"article_id"
]
as?
Int
??
0
model
.
news_type
=
userInfo
[
"news_type"
]
as?
Int
??
0
model
.
cover_img
=
userInfo
[
"cover_img"
]
as?
String
??
""
model
.
url
=
userInfo
[
"url"
]
as?
String
??
""
model
.
media_url
=
userInfo
[
"media_url"
]
as?
String
??
""
model
.
media_transcode_url
=
userInfo
[
"media_transcode_url"
]
as?
String
??
""
YHGalaxyNewsListViewController
.
enterDetail
(
model
)
}
})
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHGalaxyNewsListViewController.swift
View file @
8259c128
...
...
@@ -100,9 +100,7 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
self
.
tableView
.
footer
?
.
alpha
=
1
}
self
.
tableView
.
reloadData
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
}
self
.
tableView
.
reloadData
()
}
}
...
...
@@ -128,7 +126,55 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
YHHUD
.
flash
(
message
:
msg
)
}
}
func
markRead
(
model
:
YHNewsModel
)
{
if
let
id
=
Int
(
model
.
id
)
{
self
.
viewModel
.
readMessages
(
type
:
self
.
type
,
msgIds
:
[
id
],
isAllRead
:
false
)
{
[
weak
self
]
success
,
_
in
guard
let
self
=
self
else
{
return
}
if
success
{
for
msgItem
in
newsArr
{
if
msgItem
.
article_id
==
model
.
article_id
,
msgItem
.
id
==
model
.
id
{
msgItem
.
is_read
=
true
break
}
}
self
.
tableView
.
reloadData
()
return
}
}
}
}
static
func
enterDetail
(
_
item
:
YHNewsModel
)
{
if
item
.
news_type
==
2
{
// 图文
let
vc
=
YHHomeWebViewController
()
vc
.
url
=
YHBaseUrlManager
.
shared
.
curH5URL
()
+
"articleDetail.html"
+
"?id=
\(
item
.
id
)
"
vc
.
id
=
Int
(
item
.
id
)
??
0
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
)
return
}
else
if
item
.
news_type
==
1
{
// 视频
if
!
item
.
media_url
.
isEmpty
,
let
url
=
URL
(
string
:
item
.
media_url
)
{
let
vc
=
YHVideoPlayerVC
()
if
!
item
.
media_transcode_url
.
isEmpty
{
vc
.
url
=
item
.
media_transcode_url
}
else
{
vc
.
url
=
item
.
media_url
}
vc
.
id
=
Int
(
item
.
id
)
??
0
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
)
}
return
}
else
if
item
.
news_type
==
4
{
// 纯网页
let
vc
=
YHWebViewViewController
()
vc
.
url
=
item
.
url
vc
.
navTitle
=
item
.
title
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
extension
YHGalaxyNewsListViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
@@ -154,22 +200,8 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
newsArr
.
count
{
let
item
=
newsArr
[
indexPath
.
row
]
if
let
id
=
Int
(
item
.
id
)
{
self
.
viewModel
.
readMessages
(
type
:
self
.
type
,
msgIds
:
[
id
],
isAllRead
:
false
)
{
[
weak
self
]
success
,
_
in
guard
let
self
=
self
else
{
return
}
if
success
{
for
msgItem
in
newsArr
{
if
msgItem
.
article_id
==
item
.
article_id
,
msgItem
.
id
==
item
.
id
{
msgItem
.
is_read
=
true
break
}
}
self
.
tableView
.
reloadData
()
return
}
}
}
Self
.
enterDetail
(
item
)
}
}
...
...
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