报备推送
This commit is contained in:
@@ -51,6 +51,16 @@ open class GroupData {
|
||||
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? {
|
||||
if let broadcastKeywords = (userInfo?[pushNoti_broadcastKeywords_key] as? String),broadcastKeywords.isEmpty == false {
|
||||
|
||||
@@ -19,6 +19,7 @@ open class PushNotiCommonTool : NSObject {
|
||||
let commonView = PushNotiCommonView()
|
||||
var userOrderId : Int?
|
||||
var taskOrderId : Int?
|
||||
var taskCode : String?
|
||||
if let dict = GROUP.parserAlertToDictionary(userInfo: userInfo) {
|
||||
if let title = dict[pushNoti_title_key] {
|
||||
commonView.titleLabel.text = title
|
||||
@@ -26,11 +27,14 @@ open class PushNotiCommonTool : NSObject {
|
||||
if let body = dict[pushNoti_body_key] {
|
||||
commonView.contentLabel.text = body
|
||||
}
|
||||
if let orderId = dict[pushNoti_orderId_key] {
|
||||
userOrderId = Int(orderId)
|
||||
if let _userOrderId = dict[pushNoti_userOrderId_key] {
|
||||
userOrderId = Int(_userOrderId)
|
||||
}
|
||||
if let taskId = dict[pushNoti_orderId_key] {
|
||||
taskOrderId = Int(taskId)
|
||||
if let _taskOrderId = dict[pushNoti_taskOrderId_key] {
|
||||
taskOrderId = Int(_taskOrderId)
|
||||
}
|
||||
if let _taskCode = dict[pushNoti_taskCode_key] {
|
||||
taskCode = _taskCode
|
||||
}
|
||||
}
|
||||
if let cancel = (userInfo?[pushNoti_cancelButtonText_key] as? String) {
|
||||
@@ -59,6 +63,13 @@ open class PushNotiCommonTool : NSObject {
|
||||
ENTRY.dismiss(name: pushNotiCommonViewEntry) {
|
||||
// 停止声音播放
|
||||
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)
|
||||
|
||||
@@ -30,9 +30,9 @@ public let pushNoti_confirmButtonText_key = "confirmButtonText"
|
||||
|
||||
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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user