From 7839b29e99fb3f93d4ebc865140e78b6b3220499 Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Mon, 27 Jul 2026 18:54:15 +0800 Subject: [PATCH] 1 --- App.vue | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/App.vue b/App.vue index c3182d4..3c1bdb5 100644 --- a/App.vue +++ b/App.vue @@ -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);