diff --git a/App.vue b/App.vue
index c14e36f..7b31da1 100644
--- a/App.vue
+++ b/App.vue
@@ -1,7 +1,7 @@
+ 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 @@
}
-