From 105c228fe0b94a372084e7c53270b90eee2171fc Mon Sep 17 00:00:00 2001
From: lmx <824295981@qq.com>
Date: Sat, 7 Feb 2026 12:52:36 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9F=B3=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E9=80=9A=E8=AF=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/room/incom.vue | 751 ++++++++++++++++++++++++-------------------
pages/room/room.nvue | 88 ++++-
2 files changed, 507 insertions(+), 332 deletions(-)
diff --git a/pages/room/incom.vue b/pages/room/incom.vue
index fc2668c..0c88030 100644
--- a/pages/room/incom.vue
+++ b/pages/room/incom.vue
@@ -1,379 +1,472 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- {{ callerInfo?.nick || callerInfo?.userID }}
-
-
- {{ callState === 'call' ? '呼叫中,等待对方接受邀请...' : '对话中...' }}
-
- {{ mediaType === 'audio' ? "语音通话" : "视频通话" }}
-
+
+
+
+
+
+
+ {{ formattedTime }}
+
+
+
-
-
-
-
-
-
- {{ callState === 'call' || callState == 'dialogue' ? "挂断" : "拒绝" }}
-
+
+
+
+
+
+
+
+
+
+ {{ callerInfo?.nick || callerInfo?.userID }}
+
+
+ {{ callState === 'call' ? '呼叫中,等待对方接受邀请...' : callState === 'answer' ? '等待接听...' : '对话中...' }}
+
+ {{ mediaType === 'audio' ? "语音通话" : "视频通话" }}
+
-
-
-
-
- 接听
-
-
-
+
+
+
+
+
+
+
+
+ {{ isMicMuted ? '开启' : '静音' }}
+
+
+
+
+
+
+
+ {{ callState === 'call' || callState == 'dialogue' ? "挂断" : "拒绝" }}
+
+
+
+
+
+
+
+ 接听
+
+
+
+
+
+
+
+
+ 扬声器
+
+
+
+ 100% {
+ box-shadow: 0 0 0 0 rgba(26, 173, 25, 0);
+ }
+ }
+
+ /* 响应式调整 */
+ @media (max-height: 600px) {
+ .incoming-controls {
+ padding: 40rpx 30rpx 80rpx !important;
+ }
+ }
+
\ No newline at end of file
diff --git a/pages/room/room.nvue b/pages/room/room.nvue
index c939d28..553ad14 100644
--- a/pages/room/room.nvue
+++ b/pages/room/room.nvue
@@ -1,5 +1,15 @@
+
+
+
+
+
+
+ {{ formattedTime }}
+
+
+
@@ -111,7 +121,11 @@
ruddyVal: 0,
buffingVal: 0,
brightnessVal: 5,
- isChecked: false
+ isChecked: false,
+ formattedTime: "00:00",
+ callState: "123",
+ callDuration: 0,
+ timer: null
}
},
onLoad: function () {
@@ -150,6 +164,7 @@
},
onUnload() {
call.hangup()
+ this.stopTimer()
},
onHide() {
const session = call.getCurrentCallSession()
@@ -158,8 +173,31 @@
}
uni.$off('OnCallDisconnected')
uni.$off('OnCallConnected')
+ this.stopTimer()
},
methods: {
+ /** 开始通话计时 */
+ startTimer(){
+ this.stopTimer() // 先停止之前的计时器
+ this.timer = setInterval(() => {
+ this.callDuration++
+ this.formatTime()
+ }, 1000)
+ },
+
+ /** 停止通话计时 */
+ stopTimer(){
+ if (this.timer) {
+ clearInterval(this.timer)
+ this.timer = null
+ }
+ },
+ /** 格式化时间显示 */
+ formatTime(){
+ const minutes = Math.floor(this.callDuration / 60)
+ const seconds = this.callDuration % 60
+ this.formattedTime = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`
+ },
changeMediaType() {
if (this.mediaTypeCur == 'video') {
this.mediaTypeCur = 'audio'
@@ -369,6 +407,8 @@
},
processCallSession(){
+ this.callState = "dialogue"
+ this.startTimer()
// call.enableSpeaker(true)
this.mediaTypeCur = this.mediaType
this.currentCallSession = call.getCurrentCallSession()
@@ -473,7 +513,49 @@
}
-