|
|
|
@ -114,14 +114,14 @@ |
|
|
|
|
|
|
|
jpushModule.setLoggerEnable(true); |
|
|
|
plus.screen.lockOrientation("portrait-primary"); |
|
|
|
|
|
|
|
//监听 极光推送连接状态 |
|
|
|
this.getNotificationEnabled(); |
|
|
|
jpushModule.addConnectEventListener(result => { |
|
|
|
let connectEnable = result.connectEnable |
|
|
|
if (connectEnable == true) { |
|
|
|
|
|
|
|
this.getRegistrationID() |
|
|
|
setTimeout(() => { |
|
|
|
this.getRegistrationID(); |
|
|
|
}, 1000); |
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
@ -138,7 +138,7 @@ |
|
|
|
} else { |
|
|
|
this.handlePushClick(result.android.inAppExtras); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
//用户收到了通知消息 |
|
|
|
if (result.notificationEventType == 'notificationArrived') { |
|
|
|
@ -308,7 +308,7 @@ |
|
|
|
audio.src = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/a6bdf5b02fc249ac924e8da277ac5bfc.mp3'; |
|
|
|
} |
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
|
|
audio.play(); |
|
|
|
audio.onEnded(function(res) { |
|
|
|
audio = null; |
|
|
|
@ -325,19 +325,15 @@ |
|
|
|
this.globalData.pageHeight = this.globalData.windowHeight |
|
|
|
this.globalData.safeAreaBottom = res.screenHeight - res.safeArea.bottom |
|
|
|
this.globalData.pageHeight = this.globalData.windowHeight + 44 + this.globalData.top |
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
var weixin = uni.getMenuButtonBoundingClientRect(); |
|
|
|
this.globalData.top = weixin.top |
|
|
|
this.globalData.menuButtonWidth = weixin.width |
|
|
|
this.globalData.menuButtonLeft = weixin.left |
|
|
|
this.globalData.menuButtonHeight = weixin.height |
|
|
|
// #endif |
|
|
|
|
|
|
|
}, |
|
|
|
getRegistrationID() { //获取registerID |
|
|
|
jpushModule.getRegistrationID(result => { |
|
|
|
let registerID = result.registerID |
|
|
|
this.globalData.registrationID = registerID |
|
|
|
uni.setStorageSync("registerID", registerID) |
|
|
|
if (result && result.registerID) { |
|
|
|
this.globalData.registrationID = registerID |
|
|
|
uni.setStorageSync("registerID", registerID) |
|
|
|
} |
|
|
|
// uni.setStorageSync("signPerson", result.signPerson) |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -387,7 +383,7 @@ |
|
|
|
if (res.confirm) { |
|
|
|
var Intent = plus.android.importClass('android.content.Intent'); |
|
|
|
var Build = plus.android.importClass("android.os.Build"); |
|
|
|
|
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= 26) { |
|
|
|
var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS'); |
|
|
|
intent.putExtra('android.provider.extra.APP_PACKAGE', pkName); |
|
|
|
|