报备推送

This commit is contained in:
ddisfriend
2025-06-24 17:40:25 +08:00
parent 53c935e764
commit cb2faafb37
3 changed files with 27 additions and 6 deletions

View File

@@ -51,6 +51,16 @@ open class GroupData {
return false return false
} }
//
func isReportIndexPushNotification(userInfo:[AnyHashable:Any]?) -> Bool {
if let userInfo {
if let dict = parserAlertToDictionary(userInfo: userInfo), dict[pushNoti_pushType_key] == "10" {
return true
}
}
return false
}
// //
func parserBroadcastToString(userInfo:[AnyHashable:Any]?) -> String? { func parserBroadcastToString(userInfo:[AnyHashable:Any]?) -> String? {
if let broadcastKeywords = (userInfo?[pushNoti_broadcastKeywords_key] as? String),broadcastKeywords.isEmpty == false { if let broadcastKeywords = (userInfo?[pushNoti_broadcastKeywords_key] as? String),broadcastKeywords.isEmpty == false {

View File

@@ -19,6 +19,7 @@ open class PushNotiCommonTool : NSObject {
let commonView = PushNotiCommonView() let commonView = PushNotiCommonView()
var userOrderId : Int? var userOrderId : Int?
var taskOrderId : Int? var taskOrderId : Int?
var taskCode : String?
if let dict = GROUP.parserAlertToDictionary(userInfo: userInfo) { if let dict = GROUP.parserAlertToDictionary(userInfo: userInfo) {
if let title = dict[pushNoti_title_key] { if let title = dict[pushNoti_title_key] {
commonView.titleLabel.text = title commonView.titleLabel.text = title
@@ -26,11 +27,14 @@ open class PushNotiCommonTool : NSObject {
if let body = dict[pushNoti_body_key] { if let body = dict[pushNoti_body_key] {
commonView.contentLabel.text = body commonView.contentLabel.text = body
} }
if let orderId = dict[pushNoti_orderId_key] { if let _userOrderId = dict[pushNoti_userOrderId_key] {
userOrderId = Int(orderId) userOrderId = Int(_userOrderId)
} }
if let taskId = dict[pushNoti_orderId_key] { if let _taskOrderId = dict[pushNoti_taskOrderId_key] {
taskOrderId = Int(taskId) taskOrderId = Int(_taskOrderId)
}
if let _taskCode = dict[pushNoti_taskCode_key] {
taskCode = _taskCode
} }
} }
if let cancel = (userInfo?[pushNoti_cancelButtonText_key] as? String) { if let cancel = (userInfo?[pushNoti_cancelButtonText_key] as? String) {
@@ -59,6 +63,13 @@ open class PushNotiCommonTool : NSObject {
ENTRY.dismiss(name: pushNotiCommonViewEntry) { ENTRY.dismiss(name: pushNotiCommonViewEntry) {
// //
TOOL.stopVoice() TOOL.stopVoice()
// webview
if GROUP.isReportIndexPushNotification(userInfo: userInfo) == true {
if let supplierId = USER.supplierId,let taskCode,let userOrderId {
WEBTOOL.open(name: .reportIndex,appending: "&userOrderId=\(userOrderId)&type=1&userOrderCode=\(taskCode)&supplierId=\(supplierId)")
}
}
} }
}) })
.disposed(by: disposeBag) .disposed(by: disposeBag)

View File

@@ -30,9 +30,9 @@ public let pushNoti_confirmButtonText_key = "confirmButtonText"
public let pushNoti_cancelButtonText_key = "cancelButtonText" public let pushNoti_cancelButtonText_key = "cancelButtonText"
public let pushNoti_orderId_key = "orderId" public let pushNoti_userOrderId_key = "userOrderId"
public let pushNoti_taskId_key = "taskId" public let pushNoti_taskOrderId_key = "taskOrderId"
public let pushNoti_pushType_key = "pushType" public let pushNoti_pushType_key = "pushType"