吉安感知网项目-前端
shuishen
2026-02-27 751319f2e8c0217a22c252825fc089ae2f158762
Merge branch 'master' of http://139.196.74.78:10010/r/jagzwxm/ja_web
5 files modified
37 ■■■■■ changed files
AGENTS.md 1 ●●●● patch | view | raw | blame | history
applications/mobile-web-view/src/appPages/voiceCallDetail/index.vue 20 ●●●●● patch | view | raw | blame | history
package.json 5 ●●●●● patch | view | raw | blame | history
uniapps/work-app/src/hooks/useGlobalWS.js 1 ●●●● patch | view | raw | blame | history
uniapps/work-app/src/subPackages/voiceCallDetail/index.vue 10 ●●●●● patch | view | raw | blame | history
AGENTS.md
@@ -44,7 +44,6 @@
- 优先使用根目录工作区脚本,除非必要不要在子目录直接运行脚本。
# AI Rules / AI行为规范
- 对低风险修改,AI可自主执行,无需批准。
  AI may proceed autonomously for low-risk changes.
- 仅当修改可能影响架构、核心模块、公共接口、数据结构或安全性时,才需要请求批准。
applications/mobile-web-view/src/appPages/voiceCallDetail/index.vue
@@ -448,9 +448,7 @@
    send('accept', incomingFrom, null)
    log('✅ 已点击接听,发送 accept 给', incomingFrom)
    // 停止铃声
//     const transmitData = { data: { type: 'stopVoice' } }
// uni.postMessage(transmitData)
    state.value = 'calling'
    // 如果 offer 已经提前到达(我们暂存了),立刻 answer
@@ -458,6 +456,9 @@
        answerOffer(lastOfferSdp, incomingFrom)
        lastOfferSdp = null
    }
    // 停止
    const transmitData = { data: { sign:'closeBox' } }
    uni.postMessage(transmitData)
}
function rejectCall() {
@@ -466,11 +467,8 @@
    // 你后端没有 reject,用 busy 表示拒绝/不可接听
    send('busy', incomingFrom, null)
    log('❌ 已拒绝来电,发送 busy 给', incomingFrom)
    const transmitData = { data: { type: 'hangupVoice' } }
    const transmitData = { data: { type: 'hangupVoice',sign:'closeBox'  } }
uni.postMessage(transmitData)
    // 停止铃声
//     const transmitData = { data: { type: 'stopVoice' } }
// uni.postMessage(transmitData)
    incomingFrom = null
    acceptedByMe = false
@@ -579,7 +577,8 @@
        // 对方挂断:显示提示,延迟10秒跳转
        callEnded.value = true
        endMessage.value = '对方已挂断'
        const transmitData = { data: { type: 'hangupVoice',sign:'closeBox'  } }
        uni.postMessage(transmitData)
        // 延迟5秒后跳转页面
        endTimer.value = setTimeout(() => {
            // 返回上一页(uni-app的语音通话列表页面)
@@ -588,11 +587,10 @@
            } else {
                log('❌ uni对象不存在,无法返回上一页')
            }
            const transmitData = { data: { type: 'hangupVoice' } }
            uni.postMessage(transmitData)
            // 重置通话结束状态
            callEnded.value = false
        }, 3000)
        }, 2000)
    }
}
package.json
@@ -1,6 +1,7 @@
{
    "name": "my-monorepo",
    "private": true,
    "packageManager": "pnpm@9.0.0",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
@@ -30,6 +31,10 @@
    "keywords": [],
    "author": "",
    "license": "ISC",
    "engines": {
        "node": ">=20",
        "pnpm": ">=9"
    },
    "pnpm": {
        "overrides": {
            "@zip.js/zip.js": "2.7.34"
uniapps/work-app/src/hooks/useGlobalWS.js
@@ -21,7 +21,6 @@
      console.log('📨 useGlobalWS 收到 WebView 消息:', data)
      // 处理挂断消息
      if (data?.type === 'hangupVoice') {
        console.log('📞 收到挂断消息')
        initWS()
      }
    });
uniapps/work-app/src/subPackages/voiceCallDetail/index.vue
@@ -17,7 +17,7 @@
const userParams = userStore?.userInfo ? JSON.stringify(userStore.userInfo) : '{}'
const sWebViewRef = ref(null);
const viewUrl = ref("");
const typeSign = ref('')
// #ifdef APP-PLUS
/**
 * 请求 Android 麦克风权限
@@ -80,6 +80,14 @@
});
function onPostMessage(data) {
typeSign.value = data?.sign || ''
if(typeSign.value === 'closeBox'){
    setTimeout(() => {
    // 关闭弹窗
    cancelIncomingCallNotification()
    }, 1000)
}
    // 将WebView消息传递给全局WebSocket处理
    if (typeof uni !== 'undefined' && uni.$emit) {
        uni.$emit('webViewMessage', data);