马宇豪
2024-07-16 f591c27b57e2418c9495bc02ae8cfff84d35bc18
App.vue
@@ -10,73 +10,71 @@
         }
      },
         onLaunch: function() {
            console.log('App Launch',jpushModule)
            jpushModule.initJPushService();
            jpushModule.setLoggerEnable(true);
            jpushModule.addConnectEventListener(result=>{
               let connectEnable = result.connectEnable
               uni.$emit('connectStatusChange',connectEnable)
            });
            //消息回调——点击通知栏消息 跳转指定页面
            jpushModule.addNotificationListener(result=>{
               if (result.notificationEventType == "notificationOpened") {
                  //判断是否登录
                  if (uni.getStorageSync('tk')) {
                     //工作通知——工作人员工作通知页
                     if (result.title.includes('工作通知')){
                        uni.switchTab({
                           url: '/pages/tabBar/notice/notice',
                        })
                     //信息审核——领导审核页
                     }else if(result.title == '您有新的信息需要审批'){
                        uni.switchTab({
                           url: '/pages/tabBar/examine/examine',
                        })
                     //审核结果——首页(后续加pc端信息发布页)
                     }else if(result.title.includes('信息审核')){
                        uni.switchTab({
                           url: '/pages/tabBar/information/information',
                        })
                     }
                  }else {
                     console.log("未登录")
                     //未登录跳转首页
                     uni.navigateTo({
                        url: '/pages/index/index',
                        complete(res) {
                           console.log(res);
                        }
                     })
                     uni.showToast({
                        icon: 'none',
                        title: '请先登录',
                        duration: 3000
                     })
                  }
               }
            });
            jpushModule.addCustomMessageListener(result=>{
               let type = result.type
               let messageType = result.messageType
               let content = result.content
               uni.showToast({
                  icon: 'none',
                  title: JSON.stringify(result),
                  duration: 3000
               })
            });
            jpushModule.addLocalNotificationListener(result=>{
               let messageID = result.messageID
               let title = result.title
               let content = result.content
               let extras = result.extras
               uni.showToast({
                  icon: 'none',
                  title: JSON.stringify(result),
                  duration: 3000
               })
            })
            // jpushModule.initJPushService();
            // jpushModule.setLoggerEnable(true);
            // jpushModule.addConnectEventListener(result=>{
            //    let connectEnable = result.connectEnable
            //    uni.$emit('connectStatusChange',connectEnable)
            // });
            // //消息回调——点击通知栏消息 跳转指定页面
            // jpushModule.addNotificationListener(result=>{
            //    if (result.notificationEventType == "notificationOpened") {
            //       //判断是否登录
            //       if (uni.getStorageSync('tk')) {
            //          //工作通知——工作人员工作通知页
            //          if (result.title.includes('工作通知')){
            //             uni.switchTab({
            //                url: '/pages/tabBar/notice/notice',
            //             })
            //          //信息审核——领导审核页
            //          }else if(result.title == '您有新的信息需要审批'){
            //             uni.switchTab({
            //                url: '/pages/tabBar/examine/examine',
            //             })
            //          //审核结果——首页(后续加pc端信息发布页)
            //          }else if(result.title.includes('信息审核')){
            //             uni.switchTab({
            //                url: '/pages/tabBar/information/information',
            //             })
            //          }
            //       }else {
            //          console.log("未登录")
            //          //未登录跳转首页
            //          uni.navigateTo({
            //             url: '/pages/index/index',
            //             complete(res) {
            //                console.log(res);
            //             }
            //          })
            //          uni.showToast({
            //             icon: 'none',
            //             title: '请先登录',
            //             duration: 3000
            //          })
            //       }
            //    }
            // });
            // jpushModule.addCustomMessageListener(result=>{
            //    let type = result.type
            //    let messageType = result.messageType
            //    let content = result.content
            //    uni.showToast({
            //       icon: 'none',
            //       title: JSON.stringify(result),
            //       duration: 3000
            //    })
            // });
            // jpushModule.addLocalNotificationListener(result=>{
            //    let messageID = result.messageID
            //    let title = result.title
            //    let content = result.content
            //    let extras = result.extras
            //    uni.showToast({
            //       icon: 'none',
            //       title: JSON.stringify(result),
            //       duration: 3000
            //    })
            // })
            
            
            
@@ -113,12 +111,12 @@
         },
         onShow: function() {
            plus.runtime.getProperty(plus.runtime.appid, wgtinfo => {
                this.version = wgtinfo.version;
                if(this.version){
                   this.getMaxVersion();
                }
                })
            // plus.runtime.getProperty(plus.runtime.appid, wgtinfo => {
            //     this.version = wgtinfo.version;
            //     if(this.version){
            //        this.getMaxVersion();
            //     }
            //     })
            console.log('App Show')
@@ -212,7 +210,7 @@
   @import '@/static/customicons.css';
   // 设置整个项目的背景色
   page {
      background-color: #f5f5f5;
      background-color: #f5f7fa;
      height: 100%;
   }