From 277d6652893fcc10fb6827b62ef16fe2910a525c Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期五, 15 十二月 2023 16:58:25 +0800 Subject: [PATCH] 强制更新功能 --- App.vue | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/App.vue b/App.vue index 6922043..2216b6d 100644 --- a/App.vue +++ b/App.vue @@ -3,6 +3,13 @@ var jpushModule = uni.requireNativePlugin("JG-JPush") export default { onLaunch: function() { + //#ifdef APP-PLUS + plus.runtime.getProperty(plus.runtime.appid, wgtinfo => { + uni.setStorageSync('version', wgtinfo.version) + console.log("version",wgtinfo.version) + }) + //#endif + console.log('App Launch',jpushModule) jpushModule.initJPushService(); jpushModule.setLoggerEnable(true); @@ -12,36 +19,27 @@ }); //消息回调——点击通知栏消息 跳转指定页面 jpushModule.addNotificationListener(result=>{ - console.log(result) if (result.notificationEventType == "notificationOpened") { //判断是否登录 if (uni.getStorageSync('tk')) { //工作通知——工作人员工作通知页 if (result.title.includes('工作通知')){ - uni.navigateTo({ + uni.switchTab({ url: '/pages/tabBar/notice/notice', - complete(res) { - console.log(res); - } }) //信息审核——领导审核页 }else if(result.title == '您有新的信息需要审批'){ - uni.navigateTo({ + uni.switchTab({ url: '/pages/tabBar/examine/examine', - complete(res) { - console.log(res); - } }) //审核结果——首页(后续加pc端信息发布页) }else if(result.title.includes('信息审核')){ - uni.navigateTo({ + uni.switchTab({ url: '/pages/tabBar/information/information', - complete(res) { - console.log(res); - } }) } }else { + console.log("未登录") //未登录跳转首页 uni.navigateTo({ url: '/pages/index/index', @@ -80,6 +78,8 @@ }) + + // jpushModule.addGeofenceListener(result => { // let code = result.code // let type = result.type @@ -115,7 +115,7 @@ console.log('App Show') }, onHide: function() { - jpushModule.initJPushService(); + // jpushModule.initJPushService(); console.log('App Hide') } } @@ -131,6 +131,7 @@ // 设置整个项目的背景色 page { background-color: #f5f5f5; + height: 100%; } /* #endif */ -- Gitblit v1.9.2