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
31972f3c
Commit
31972f3c
authored
Jun 09, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 出行推送
parent
1334471c
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
132 additions
and
65 deletions
+132
-65
Applegate(JPush).swift
galaxy/galaxy/Applegate(JPush).swift
+60
-59
YHOrderTipsItemView.swift
...laxy/Classes/Modules/Home(首页)/V/YHOrderTipsItemView.swift
+3
-0
YHMessageDetailListVC.swift
...Classes/Modules/Message(消息)/C/YHMessageDetailListVC.swift
+29
-4
YHMessageListVC.swift
...alaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
+3
-1
YHMsgListModel.swift
...galaxy/Classes/Modules/Message(消息)/M/YHMsgListModel.swift
+7
-1
YHDetailMessageCell.swift
...y/Classes/Modules/Message(消息)/V/YHDetailMessageCell.swift
+4
-0
YHMessageSessionCell.swift
.../Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
+3
-0
YHMsgViewModel.swift
...alaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
+1
-0
Contents.json
...ets.xcassets/Message/msg_icon_gift.imageset/Contents.json
+22
-0
Frame@2x.png
...sets.xcassets/Message/msg_icon_gift.imageset/Frame@2x.png
+0
-0
Frame@3x.png
...sets.xcassets/Message/msg_icon_gift.imageset/Frame@3x.png
+0
-0
No files found.
galaxy/galaxy/Applegate(JPush).swift
View file @
31972f3c
...
...
@@ -6,14 +6,12 @@
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
AuthenticationServices
import
UIKit
extension
AppDelegate
:
JPUSHRegisterDelegate
{
// 注册JPush服务
func
registerJPushService
(
_
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
{
let
entity
:
JPUSHRegisterEntity
=
JPUSHRegisterEntity
()
entity
.
types
=
Int
(
JPAuthorizationOptions
.
alert
.
rawValue
|
JPAuthorizationOptions
.
badge
.
rawValue
|
...
...
@@ -30,13 +28,13 @@ extension AppDelegate: JPUSHRegisterDelegate {
// apsForProduction:isProduction
// advertisingIdentifier:advertisingId];
#if DEBUG
#if DEBUG
let
isProduction
=
false
#elseif TESTENV
#elseif TESTENV
let
isProduction
=
false
#else
#else
let
isProduction
=
true
#endif
#endif
JPUSHService
.
setup
(
withOption
:
launchOptions
,
appKey
:
YhConstant
.
Jpush
.
appKey
,
channel
:
"appStore"
,
...
...
@@ -45,23 +43,23 @@ extension AppDelegate: JPUSHRegisterDelegate {
// 系统获取Token
func
application
(
_
application
:
UIApplication
,
didRegisterForRemoteNotificationsWithDeviceToken
deviceToken
:
Data
)
{
let
deviceTokenStr
=
deviceToken
.
map
{
String
(
format
:
"%02.2hhx"
,
arguments
:
[
$0
])
}
.
joined
()
let
deviceTokenStr
=
deviceToken
.
map
{
String
(
format
:
"%02.2hhx"
,
arguments
:
[
$0
])
}
.
joined
()
print
(
"deviceToken:
\(
deviceTokenStr
)
"
)
JPUSHService
.
registerDeviceToken
(
deviceToken
)
YHLoginManager
.
shared
.
deviceTokenModel
.
deviceToken
=
deviceTokenStr
YHButlerServiceManager
.
shared
.
updateApnsToken
(
token
:
deviceToken
)
}
// 获取token 失败
func
application
(
_
application
:
UIApplication
,
didFailToRegisterForRemoteNotificationsWithError
error
:
Error
)
{
// 可选
print
(
"did Fail To Register For Remote Notifications With Error:
\(
error
)
"
)
#if DEBUG
#if DEBUG
YHHUD
.
flash
(
message
:
error
.
localizedDescription
)
#elseif TESTENV
#elseif TESTENV
YHHUD
.
flash
(
message
:
error
.
localizedDescription
)
#else
#endif
#else
#endif
}
// 点推送进来执行这个方法
...
...
@@ -74,7 +72,6 @@ extension AppDelegate: JPUSHRegisterDelegate {
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.25
,
execute
:
{
goToMessagePage
()
})
}
// 后台进前台
...
...
@@ -87,8 +84,7 @@ extension AppDelegate: JPUSHRegisterDelegate {
YHOSSManager
.
share
.
getOSSID
()
}
func
jpushNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
willPresent
notification
:
UNNotification
,
withCompletionHandler
completionHandler
:
((
Int
)
->
Void
))
{
func
jpushNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
willPresent
notification
:
UNNotification
,
withCompletionHandler
completionHandler
:
(
Int
)
->
Void
)
{
let
userInfo
=
notification
.
request
.
content
.
userInfo
if
notification
.
request
.
trigger
is
UNPushNotificationTrigger
{
JPUSHService
.
handleRemoteNotification
(
userInfo
)
...
...
@@ -106,7 +102,7 @@ extension AppDelegate: JPUSHRegisterDelegate {
}
}
func
jpushNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
didReceive
response
:
UNNotificationResponse
,
withCompletionHandler
completionHandler
:
(
()
->
Void
)
)
{
func
jpushNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
didReceive
response
:
UNNotificationResponse
,
withCompletionHandler
completionHandler
:
(
)
->
Void
)
{
let
userInfo
=
response
.
notification
.
request
.
content
.
userInfo
if
response
.
notification
.
request
.
trigger
is
UNPushNotificationTrigger
{
JPUSHService
.
handleRemoteNotification
(
userInfo
)
...
...
@@ -118,7 +114,8 @@ 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
{
if
let
msgType
=
userInfo
[
"msg_type"
]
as?
Int
{
if
msgType
==
YHMessageType
.
article
.
rawValue
{
let
model
=
YHNewsModel
()
let
taskId
=
userInfo
[
"task_id"
]
as?
Int
??
0
model
.
article_id
=
userInfo
[
"article_id"
]
as?
Int
??
0
...
...
@@ -130,25 +127,29 @@ extension AppDelegate: JPUSHRegisterDelegate {
printLog
(
"DDDDY:
\(
model
.
id
)
"
)
yh_newsList
.
enterDetail
(
model
)
self
.
viewModel
.
readMessage
(
taskId
:
taskId
)
{
_
,
_
in
}
return
}
if
msgType
==
YHMessageType
.
trip
.
rawValue
{
if
let
url
=
userInfo
[
"url"
]
as?
String
{
YHMessageDetailListVC
.
detailWithTripUrl
(
url
)
}
return
}
}
})
}
func
jpushNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
openSettingsFor
notification
:
UNNotification
)
{
}
func
jpushNotificationAuthorization
(
_
status
:
JPAuthorizationStatus
,
withInfo
info
:
[
AnyHashable
:
Any
]?)
{
}
}
extension
AppDelegate
{
func
handleAppleLoginUser
()
{
if
#available(iOS 13.0, *)
{
// 注意 存储用户标识信息需要使用钥匙串来存储 这里使用NSUserDefaults 做的简单示例
let
userIdentifier
=
UserDefaults
.
standard
.
value
(
forKey
:
"appleID"
)
as?
String
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHOrderTipsItemView.swift
View file @
31972f3c
...
...
@@ -52,6 +52,9 @@ class YHOrderTipsItemView: UIView {
}
else
if
msg
.
type
==
YHMessageType
.
article
.
rawValue
{
return
"银河资讯"
}
else
if
msg
.
type
==
YHMessageType
.
trip
.
rawValue
{
return
"礼品兑换提醒"
}
else
{
return
"--"
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHMessageDetailListVC.swift
View file @
31972f3c
...
...
@@ -286,6 +286,19 @@ class YHMessageDetailListVC: YHBaseViewController {
}
}
}
static
func
detailWithTripUrl
(
_
itemUrl
:
String
)
{
if
!
itemUrl
.
isEmpty
,
let
token
=
YHLoginManager
.
shared
.
userModel
?
.
token
,
token
.
count
>
5
{
var
url
=
itemUrl
+
"¶m=
\(
YHLoginManager
.
shared
.
h5Token
)
"
url
=
url
+
"&app_platform=ios"
+
"&app_version="
+
UIDevice
.
appVersion
()
printLog
(
"UURL:
\(
url
)
"
)
let
vc
=
YHH5WebViewVC
()
vc
.
url
=
url
vc
.
isFullScreenFlag
=
true
vc
.
isNeedRefreshDataFlag
=
true
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
extension
YHMessageDetailListVC
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
@@ -329,24 +342,37 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
return
}
if
self
.
type
==
YHMessageType
.
trip
.
rawValue
{
Self
.
detailWithTripUrl
(
item
.
url
)
return
}
printLog
(
"redirectPage:
\(
item
.
redirectPage
)
"
)
if
item
.
redirectPage
==
YHRedirectPage
.
serviceTab
.
rawValue
{
// 服务tab页
UIViewController
.
current
?
.
navigationController
?
.
popToRootViewController
(
animated
:
false
)
goTabBarBy
(
tabType
:
.
service
)
return
}
}
else
if
item
.
redirectPage
==
YHRedirectPage
.
lifeTab
.
rawValue
{
// 首页-生活tab
if
item
.
redirectPage
==
YHRedirectPage
.
lifeTab
.
rawValue
{
// 首页-生活tab
UIViewController
.
current
?
.
navigationController
?
.
popToRootViewController
(
animated
:
false
)
goTabBarBy
(
tabType
:
.
home
)
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didJumpToHomePageLifeTabNotification
,
object
:
nil
)
return
}
else
if
item
.
redirectPage
==
YHRedirectPage
.
newsTab
.
rawValue
{
// 首页-资讯tab
}
if
item
.
redirectPage
==
YHRedirectPage
.
newsTab
.
rawValue
{
// 首页-资讯tab
UIViewController
.
current
?
.
navigationController
?
.
popToRootViewController
(
animated
:
false
)
goTabBarBy
(
tabType
:
.
home
)
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didJumpToHomePageNewsTabNotification
,
object
:
nil
)
return
}
else
{
}
// 处理订单相关逻辑
if
let
orderId
=
Int
(
item
.
orderId
)
{
printLog
(
"orderId:
\(
orderId
)
"
)
self
.
requestOrderStatus
(
orderId
:
orderId
)
{
...
...
@@ -361,7 +387,6 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
}
}
}
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
1.0
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
View file @
31972f3c
...
...
@@ -269,7 +269,9 @@ class YHMessageListVC: YHBaseViewController {
}
}
emptyDataTipsView
.
isHidden
=
msgArr
.
count
>
0
// 礼品兑换通知
self
.
msgArr
.
append
(
self
.
viewModel
.
msgList
.
trip
)
self
.
emptyDataTipsView
.
isHidden
=
self
.
msgArr
.
count
>
0
self
.
tableView
.
reloadData
()
didRefreshYinHeManagerUnreadMsg
()
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/M/YHMsgListModel.swift
View file @
31972f3c
...
...
@@ -21,6 +21,7 @@ enum YHMessageType: Int {
case
renewal
=
8
// 身份续签
case
business
=
9
// 商务
case
article
=
10
// 资讯
case
trip
=
11
// 礼物
case
yinheManager
=
9527
// 银河管家
}
...
...
@@ -77,6 +78,9 @@ class YHMessageInfoModel: SmartCodable {
}
else
if
type
==
YHMessageType
.
article
.
rawValue
{
return
"银河资讯"
}
else
if
type
==
YHMessageType
.
trip
.
rawValue
{
return
"礼品兑换提醒"
}
return
""
}
...
...
@@ -93,6 +97,7 @@ class YHMsgListModel: SmartCodable {
var
renewal
:
YHMessageInfoModel
=
YHMessageInfoModel
()
var
business
:
YHMessageInfoModel
=
YHMessageInfoModel
()
var
article
:
YHMessageInfoModel
=
YHMessageInfoModel
()
var
trip
:
YHMessageInfoModel
=
YHMessageInfoModel
()
required
init
()
{
self
.
information
.
type
=
YHMessageType
.
infoFill
.
rawValue
...
...
@@ -105,10 +110,11 @@ class YHMsgListModel: SmartCodable {
self
.
renewal
.
type
=
YHMessageType
.
renewal
.
rawValue
self
.
business
.
type
=
YHMessageType
.
business
.
rawValue
self
.
article
.
type
=
YHMessageType
.
article
.
rawValue
self
.
trip
.
type
=
YHMessageType
.
trip
.
rawValue
}
enum
CodingKeys
:
String
,
CodingKey
{
case
information
,
certificate
,
draft
,
signature
,
approval
,
renewal
,
business
,
article
case
information
,
certificate
,
draft
,
signature
,
approval
,
renewal
,
business
,
article
,
trip
case
dataSubmission
=
"data_submission"
case
goToHK
=
"go_to_hk"
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/V/YHDetailMessageCell.swift
View file @
31972f3c
...
...
@@ -70,6 +70,10 @@ class YHDetailMessageCell: UITableViewCell {
}
else
if
type
==
YHMessageType
.
business
.
rawValue
{
bottomBtn
.
setTitle
(
""
.
local
,
for
:
.
normal
)
lineView
.
isHidden
=
true
}
else
if
type
==
YHMessageType
.
trip
.
rawValue
{
bottomBtn
.
setTitle
(
"去查看"
.
local
,
for
:
.
normal
)
}
var
bottomBtnHeight
=
(
type
==
YHMessageType
.
business
.
rawValue
)
?
0.0
:
52.0
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
View file @
31972f3c
...
...
@@ -69,6 +69,9 @@ class YHMessageSessionCell: UITableViewCell {
self
.
iconImgView
.
image
=
UIImage
(
named
:
"msg_icon_news"
)
self
.
iconContentView
.
backgroundColor
=
UIColor
(
hex
:
0xF0F5FF
)
}
else
if
model
.
type
==
YHMessageType
.
trip
.
rawValue
{
self
.
iconImgView
.
image
=
UIImage
(
named
:
"msg_icon_gift"
)
}
self
.
badgeLabel
.
isHidden
=
model
.
unreadCount
<=
0
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
View file @
31972f3c
...
...
@@ -45,6 +45,7 @@ class YHMsgViewModel: NSObject {
self
.
msgList
.
renewal
.
type
=
YHMessageType
.
renewal
.
rawValue
self
.
msgList
.
business
.
type
=
YHMessageType
.
business
.
rawValue
self
.
msgList
.
article
.
type
=
YHMessageType
.
article
.
rawValue
self
.
msgList
.
trip
.
type
=
YHMessageType
.
trip
.
rawValue
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
...
...
galaxy/galaxy/Res/Assets.xcassets/Message/msg_icon_gift.imageset/Contents.json
0 → 100644
View file @
31972f3c
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Frame@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"Frame@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Message/msg_icon_gift.imageset/Frame@2x.png
0 → 100644
View file @
31972f3c
740 Bytes
galaxy/galaxy/Res/Assets.xcassets/Message/msg_icon_gift.imageset/Frame@3x.png
0 → 100644
View file @
31972f3c
1 KB
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