From d401ac77fccfd9faa8f7d104aaedfb7a19c8ffb6 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Wed, 30 Aug 2023 11:39:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/oaHome/oaHome.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pages/oaHome/oaHome.vue b/pages/oaHome/oaHome.vue index 26ccd15..bbd39a7 100644 --- a/pages/oaHome/oaHome.vue +++ b/pages/oaHome/oaHome.vue @@ -294,6 +294,7 @@ export default { this.showToask(); // this.initOaHomeDada(); this.getOrderList(); + this.noticeFn(); // console.log(this.oaHomeData, this.oaHomeData.length==0); if (this.oaHomeData.length == 0) { this.$nextTick(() => { @@ -319,8 +320,18 @@ export default { } }, methods: { - test () { - this.$refs.globalPopup.showPopu(); + // 通知 + noticeFn () { + const audioContext = uni.createInnerAudioContext() + audioContext.src = '/static/mp3/order.mp3' + jpushModule.addNotificationListener(res => { + if (res.notificationEventType == 'notificationOpened') return + audioContext.play() + uni.vibrateLong(); + this.getOrderList() + this.$refs.globalPopup.showPopu(); + console.log("index的监听") + }) }, async getOrderList () { let id = JSON.parse(uni.getStorageSync("USER_INFO")).id || "";