tianyi 1 day ago
parent
commit
7839b29e99
  1. 26
      App.vue

26
App.vue

@ -114,14 +114,14 @@
jpushModule.setLoggerEnable(true); jpushModule.setLoggerEnable(true);
plus.screen.lockOrientation("portrait-primary"); plus.screen.lockOrientation("portrait-primary");
// //
this.getNotificationEnabled(); this.getNotificationEnabled();
jpushModule.addConnectEventListener(result => { jpushModule.addConnectEventListener(result => {
let connectEnable = result.connectEnable let connectEnable = result.connectEnable
if (connectEnable == true) { if (connectEnable == true) {
setTimeout(() => {
this.getRegistrationID() this.getRegistrationID();
}, 1000);
} else { } else {
} }
@ -138,7 +138,7 @@
} else { } else {
this.handlePushClick(result.android.inAppExtras); this.handlePushClick(result.android.inAppExtras);
} }
} }
// //
if (result.notificationEventType == 'notificationArrived') { if (result.notificationEventType == 'notificationArrived') {
@ -308,7 +308,7 @@
audio.src = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/a6bdf5b02fc249ac924e8da277ac5bfc.mp3'; audio.src = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/a6bdf5b02fc249ac924e8da277ac5bfc.mp3';
} }
// #endif // #endif
audio.play(); audio.play();
audio.onEnded(function(res) { audio.onEnded(function(res) {
audio = null; audio = null;
@ -325,19 +325,15 @@
this.globalData.pageHeight = this.globalData.windowHeight this.globalData.pageHeight = this.globalData.windowHeight
this.globalData.safeAreaBottom = res.screenHeight - res.safeArea.bottom this.globalData.safeAreaBottom = res.screenHeight - res.safeArea.bottom
this.globalData.pageHeight = this.globalData.windowHeight + 44 + this.globalData.top 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 getRegistrationID() { //registerID
jpushModule.getRegistrationID(result => { jpushModule.getRegistrationID(result => {
let registerID = result.registerID let registerID = result.registerID
this.globalData.registrationID = registerID if (result && result.registerID) {
uni.setStorageSync("registerID", registerID) this.globalData.registrationID = registerID
uni.setStorageSync("registerID", registerID)
}
// uni.setStorageSync("signPerson", result.signPerson) // uni.setStorageSync("signPerson", result.signPerson)
}) })
}, },
@ -387,7 +383,7 @@
if (res.confirm) { if (res.confirm) {
var Intent = plus.android.importClass('android.content.Intent'); var Intent = plus.android.importClass('android.content.Intent');
var Build = plus.android.importClass("android.os.Build"); var Build = plus.android.importClass("android.os.Build");
if (Build.VERSION.SDK_INT >= 26) { if (Build.VERSION.SDK_INT >= 26) {
var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS'); var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
intent.putExtra('android.provider.extra.APP_PACKAGE', pkName); intent.putExtra('android.provider.extra.APP_PACKAGE', pkName);

Loading…
Cancel
Save