From f4170cfe7dbd5c7f2008233d9d16618ffec44064 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 27 Feb 2026 10:18:58 +0800
Subject: [PATCH] Merge branch 'master' of http://139.196.74.78:10010/r/jagzwxm/ja_web

---
 uniapps/work-app/src/hooks/useGlobalWS.js                  |   16 +++++-----------
 uniapps/work-app/src/subPackages/voiceCallDetail/index.vue |    9 +++++++++
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/uniapps/work-app/src/hooks/useGlobalWS.js b/uniapps/work-app/src/hooks/useGlobalWS.js
index 892c22e..bdc3c91 100644
--- a/uniapps/work-app/src/hooks/useGlobalWS.js
+++ b/uniapps/work-app/src/hooks/useGlobalWS.js
@@ -35,6 +35,7 @@
 
 	// 消息处理
   function messageHandler(payload) {
+
     // 先尝试直接处理消息(适用于mobile-web-view的voiceCallDetail页面的消息格式)
     const t = (payload.type || '').toString()
     callStatus.value = t
@@ -42,7 +43,7 @@
     if (t === 'call') {
       console.log('📞 全局收到来电 call,来自', payload.from)
       // 触发震动
-      triggerVibration();
+      // triggerVibration();
       // 构建来电参数
       const callParams = {
         peerUid: payload.from,
@@ -57,13 +58,12 @@
       // #endif
       // 转义参数以便在URL中传递
       const encodedParams = encodeURIComponent(JSON.stringify(callParams));
-
       try {
         // 优先使用uni-app的导航API(适用于同应用内跳转)
         if (typeof uni !== 'undefined' && uni.navigateTo) {
-          uni.navigateTo({
-            url: `/subPackages/voiceCallDetail/index?voiceparams=${encodedParams}`,
-          });
+            uni.navigateTo({
+              url: `/subPackages/voiceCallDetail/index?voiceparams=${encodedParams}`,
+            });
         } else {
           console.error('无法跳转到语音通话页面:当前环境不支持导航');
         }
@@ -71,12 +71,6 @@
         console.error('跳转到语音通话页面失败:', error);
       }
       return
-    }
-    // 通话接听或结束时,取消来电通知
-    if (t === 'accept' || t === 'reject' || t === 'hangup' || t === 'cancel') {
-      // #ifdef APP-PLUS
-      cancelIncomingCallNotification()
-      // #endif
     }
   }
 
diff --git a/uniapps/work-app/src/subPackages/voiceCallDetail/index.vue b/uniapps/work-app/src/subPackages/voiceCallDetail/index.vue
index a1a3606..83a7dbd 100644
--- a/uniapps/work-app/src/subPackages/voiceCallDetail/index.vue
+++ b/uniapps/work-app/src/subPackages/voiceCallDetail/index.vue
@@ -11,6 +11,8 @@
 import { useUserStore } from "@/store/index.js"
 import { getWebViewUrl } from "@/utils/index.js";
 import { onLoad } from "@dcloudio/uni-app";
+import {cancelIncomingCallNotification } from '@/uni_modules/lgh-dialog'
+
 const userStore = useUserStore()
 const userParams = userStore?.userInfo ? JSON.stringify(userStore.userInfo) : '{}'
 const sWebViewRef = ref(null);
@@ -84,6 +86,13 @@
 	}
 }
 
+// 监听离开
+onUnload(() => {
+	// #ifdef APP-PLUS
+	cancelIncomingCallNotification()
+	// #endif
+})
+
 </script>
 
 <style lang="scss" scoped>

--
Gitblit v1.9.3