From 35c9020e93c62434e87f9c88270538df0861f19a Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 7 Sep 2026 11:19:06 +0800 Subject: [PATCH] 1 --- App.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/App.vue b/App.vue index 4119115..d9ad1a5 100644 --- a/App.vue +++ b/App.vue @@ -103,13 +103,15 @@ this.getAreaSize() // this.getRegistrationID() // #ifdef APP-PLUS - jpushModule.initJPushService(); - - jpushModule.setLoggerEnable(true); - plus.screen.lockOrientation("portrait-primary"); + if (jpushModule.setLoggerEnable) { + jpushModule.setLoggerEnable(true); + } + if (plus && plus.screen && plus.screen.lockOrientation) { + plus.screen.lockOrientation("portrait-primary"); + } //监听 极光推送连接状态 - this.getNotificationEnabled(); jpushModule.addConnectEventListener(result => { + console.log('JPush connect event:', JSON.stringify(result)); let connectEnable = result.connectEnable if (connectEnable == true) { setTimeout(() => { @@ -120,6 +122,7 @@ } }); jpushModule.addNotificationListener(result => { //极光推送的消息通知回调 + console.log('JPush notification event:', JSON.stringify(result)); if (jpushModule.setBadge) { jpushModule.setBadge(0); } @@ -182,6 +185,11 @@ } }); + if (jpushModule.initJPushService) { + console.log('JPush init service'); + jpushModule.initJPushService(); + } + this.getNotificationEnabled(); if (jpushModule.isPushStopped) { jpushModule.isPushStopped(res => { // code 0已停止推送 1未停止推送