bzkf3 лет назад: 2
Родитель
Сommit
e9a4837556

+ 34 - 31
src/components/rtc-dialog/index.vue

@@ -8,9 +8,9 @@ import type { type_dyaw_xlfw_zxhd } from '~/types';
 import user, { UserRole } from '~/store/user';
 import { socketSend } from '~/utils/ws';
 
-const props = defineProps<{
-  mode: 'audio' | 'video'
-}>()
+// const props = defineProps<{
+//   mode: 'audio' | 'video'
+// }>()
 
 let dyaw_xlfw_zxhd = $ref<type_dyaw_xlfw_zxhd>()
 
@@ -22,17 +22,17 @@ const otherInfo = $computed(() => {
 })
 
 let isOpen = $ref<boolean>(false)
-let auditChatStatus = $ref<CHAT_STATUS>(CHAT_STATUS.WAITING_OTHERS_ACCEPT)
+let audioChatStatus = $ref<CHAT_STATUS>(CHAT_STATUS.WAITING_OTHERS_ACCEPT)
 
 let ws2: WebSocket;
 function handleClose() {
   isOpen = false
 }
 defineExpose({
-  open(d: type_dyaw_xlfw_zxhd) {
+  open(d: type_dyaw_xlfw_zxhd, mode: 'audio' | 'video') {
     // isOpen = true
     dyaw_xlfw_zxhd = d
-    handleAuditChatStart()
+    handleAudioChatStart()
   },
   close() {
     handleClose()
@@ -41,14 +41,14 @@ defineExpose({
     ws2 = ws
     switch (operate) {
       case CHAT_OPERATION.START:
-        auditChatStatus = CHAT_STATUS.WAITING_YOU_ACCEPT
+        audioChatStatus = CHAT_STATUS.WAITING_YOU_ACCEPT
         isOpen = true
         break;
       case CHAT_OPERATION.CANCEL:
         isOpen = false
         break;
       case CHAT_OPERATION.ACCEPT:
-        auditChatStatus = CHAT_STATUS.CHATING
+        audioChatStatus = CHAT_STATUS.CHATING
         break;
       case CHAT_OPERATION.DENY:
         isOpen = false
@@ -66,7 +66,7 @@ defineExpose({
 const LocalPlayerContainerRef = $ref<HTMLElement>()
 const RemotePlayerContainerRef = $ref<HTMLElement>()
 // ==========
-// chat audit/video
+// chat audio/video
 // ==========
 let rtcInstance: {
   client?: IAgoraRTCClient;
@@ -79,8 +79,10 @@ let rtcInstance: {
 }
 
 
-async function handleAuditChatStart() {
+async function handleAudioChatStart() {
   try {
+    await AgoraRTC.getMicrophones()
+    // await AgoraRTC.getCameras()
     let rtcOptions;
     await request({
       url: '/dyaw/xlfw_zxhd/get_rtc_token',
@@ -92,7 +94,8 @@ async function handleAuditChatStart() {
         let resp: { jgim_roomid: string; rtc_appid: string; rtc_token: string } = res.data.one_info
         rtcOptions = {
           appId: resp.rtc_appid,
-          channel: resp.jgim_roomid,
+          // channel: resp.jgim_roomid,
+          channel: dyaw_xlfw_zxhd!.dxz_id,
           token: resp.rtc_token,
           uid: user.user_id
         }
@@ -115,10 +118,10 @@ async function handleAuditChatStart() {
           }
         });
 
-        await rtcInstance.client.join(rtcOptions.appId, rtcOptions.channel, rtcOptions?.token, rtcOptions.uid);
+        await rtcInstance.client!.join(rtcOptions.appId, rtcOptions.channel, rtcOptions?.token, rtcOptions.uid);
         rtcInstance.localAudioTrack = await AgoraRTC.createMicrophoneAudioTrack();
         // rtcInstance.localVideoTrack = await AgoraRTC.createCameraVideoTrack();
-        await rtcInstance.client.publish([rtcInstance.localAudioTrack]);
+        await rtcInstance.client!.publish([rtcInstance.localAudioTrack]);
         // rtcInstance.localVideoTrack.play(LocalPlayerContainerRef as HTMLElement);
       }
     })
@@ -134,7 +137,7 @@ async function handleAuditChatStart() {
   }
 
 }
-function handleAuditChatCancel() {
+function handleAudioChatCancel() {
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
     dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
@@ -142,15 +145,15 @@ function handleAuditChatCancel() {
   })
   isOpen = false
 }
-function handleAuditChatAccept() {
+function handleAudioChatAccept() {
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
     dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
     operate: CHAT_OPERATION.ACCEPT
   })
-  auditChatStatus = CHAT_STATUS.CHATING
+  audioChatStatus = CHAT_STATUS.CHATING
 }
-function handleAuditChatDeny() {
+function handleAudioChatDeny() {
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
     dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
@@ -158,7 +161,7 @@ function handleAuditChatDeny() {
   })
   isOpen = false
 }
-function handleAuditChatEnd() {
+function handleAudioChatEnd() {
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
     dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
@@ -185,22 +188,22 @@ function handleAuditChatEnd() {
           <div>{{ otherInfo?.realname }}</div>
           <!-- <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"> -->
           <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-            v-show="auditChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT">
+            v-show="audioChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT">
             <div>正在等待对方接受邀请</div>
             <i:line-md:loading-alt-loop class="text-xl" />
           </div>
           <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-            v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT">
+            v-show="audioChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT">
             <div>邀请你语音通话...</div>
           </div>
           <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-            v-show="auditChatStatus === CHAT_STATUS.WAITING_BUSY">
+            v-show="audioChatStatus === CHAT_STATUS.WAITING_BUSY">
             <div class="text-red-500">对方忙线中请等待</div>
             <div class="text-red-500">当前排队:{{ 4 }}</div>
             <i:line-md:loading-alt-loop class="text-xl" />
           </div>
           <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-            v-show="auditChatStatus === CHAT_STATUS.CHATING">
+            v-show="audioChatStatus === CHAT_STATUS.CHATING">
             <div>正在通话中</div>
             <div>{{ '00:30' }}</div>
           </div>
@@ -210,31 +213,31 @@ function handleAuditChatEnd() {
           <div ref="RemotePlayerContainerRef"></div>
           <!--  -->
           <div class="pt-16 text-xl flex justify-around w-full">
-            <div v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
+            <div v-show="audioChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
               class="bg-green-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-              @click="handleAuditChatAccept">
+              @click="handleAudioChatAccept">
               <i:ic:baseline-phone />
             </div>
-            <div v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
+            <div v-show="audioChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
               class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-              @click="handleAuditChatDeny">
+              @click="handleAudioChatDeny">
               <i:mdi:phone-hangup />
             </div>
-            <div v-show="auditChatStatus === CHAT_STATUS.CHATING"
+            <div v-show="audioChatStatus === CHAT_STATUS.CHATING"
               class="bg-hex-efefef text-hex-272636 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
               @click="">
               <i:ant-design:audio-outlined v-show="true" />
               <i:ant-design:audio-muted-outlined v-show="false" />
             </div>
-            <div v-show="auditChatStatus === CHAT_STATUS.CHATING"
+            <div v-show="audioChatStatus === CHAT_STATUS.CHATING"
               class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-              @click="handleAuditChatEnd">
+              @click="handleAudioChatEnd">
               <i:ic:outline-close></i:ic:outline-close>
             </div>
             <div
-              v-show="auditChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT || auditChatStatus === CHAT_STATUS.WAITING_BUSY"
+              v-show="audioChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT || audioChatStatus === CHAT_STATUS.WAITING_BUSY"
               class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-              @click="handleAuditChatCancel">
+              @click="handleAudioChatCancel">
               <i:ic:outline-close></i:ic:outline-close>
             </div>
 

+ 4 - 4
src/components/tinymce-area/index.vue

@@ -18,7 +18,7 @@ const props = defineProps({
   },
 })
 
-const emits = defineEmits(['update:modelValue', 'click:audit', 'click:video'])
+const emits = defineEmits(['update:modelValue', 'click:audio', 'click:video'])
 
 const content = ref('')
 
@@ -107,8 +107,8 @@ defineExpose({
   },
 })
 
-function handleClickAuditCall() {
-  emits('click:audit')
+function handleClickAudioCall() {
+  emits('click:audio')
 }
 
 function handleClickVideoCall() {
@@ -121,7 +121,7 @@ function handleClickVideoCall() {
     <textarea :id="id" class="tinyarea w-full h-full" v-model="content"></textarea>
 
     <div class="absolute right-0 top-0 h-28px px-13px flex z-1000 text-hex-666">
-      <div @click="handleClickAuditCall"
+      <div @click="handleClickAudioCall"
         class="cursor-pointer flex_center box-content w-28px px-3px h-full  rounded-sm hover:bg-hex-cce2fa">
         <i:mingcute:phone-call-fill class=" w flex_center  h-6" />
       </div>

+ 24 - 24
src/pages/student/consult.vue

@@ -158,7 +158,7 @@ watch(
 )
 
 // ==========
-// chat audit/video
+// chat audio/video
 // ==========
 
 let rtcInstance: {
@@ -180,14 +180,14 @@ const ws2 = createSocket(
         if (socketRes.content.dxzl_stu_user_id === user.user_id) {
           switch (socketRes.content.operate) {
             case CHAT_OPERATION.START:
-              auditChatStatus = CHAT_STATUS.WAITING_YOU_ACCEPT
+              audioChatStatus = CHAT_STATUS.WAITING_YOU_ACCEPT
               ChatAudioRef!.open()
               break;
             case CHAT_OPERATION.CANCEL:
               ChatAudioRef!.close()
               break;
             case CHAT_OPERATION.ACCEPT:
-              auditChatStatus = CHAT_STATUS.CHATING
+              audioChatStatus = CHAT_STATUS.CHATING
               break;
             case CHAT_OPERATION.DENY:
               ChatAudioRef!.close()
@@ -206,12 +206,12 @@ const ws2 = createSocket(
 
 enum CHAT_STATUS { 'WAITING_YOU_ACCEPT', 'WAITING_OTHERS_ACCEPT', 'WAITING_BUSY', 'CHATING' }
 enum CHAT_OPERATION { 'START', 'CANCEL', 'ACCEPT', 'DENY', 'END' }
-let auditChatStatus = $ref<CHAT_STATUS>(CHAT_STATUS.WAITING_OTHERS_ACCEPT)
+let audioChatStatus = $ref<CHAT_STATUS>(CHAT_STATUS.WAITING_OTHERS_ACCEPT)
 
 const ChatAudioRef = $ref<typeof import("~/components/chat-dialog/index.vue")['default']>()
 const ChatVideoRef = $ref<typeof import("~/components/chat-dialog/index.vue")['default']>()
 
-function handleAuditChatStart() {
+function handleAudioChatStart() {
   ChatAudioRef!.open()
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
@@ -219,7 +219,7 @@ function handleAuditChatStart() {
     operate: CHAT_OPERATION.START
   })
 }
-function handleAuditChatCancel() {
+function handleAudioChatCancel() {
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
     dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
@@ -227,16 +227,16 @@ function handleAuditChatCancel() {
   })
   ChatAudioRef!.close()
 }
-function handleAuditChatAccept() {
+function handleAudioChatAccept() {
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
     dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
     operate: CHAT_OPERATION.ACCEPT
   })
   // ChatAudioRef!.close()
-  auditChatStatus = CHAT_STATUS.CHATING
+  audioChatStatus = CHAT_STATUS.CHATING
 }
-function handleAuditChatDeny() {
+function handleAudioChatDeny() {
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
     dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
@@ -244,7 +244,7 @@ function handleAuditChatDeny() {
   })
   ChatAudioRef!.close()
 }
-function handleAuditChatEnd() {
+function handleAudioChatEnd() {
   socketSend(ws2, {
     dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
     dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
@@ -280,7 +280,7 @@ function handleVideoChatStart() {
       <div class="bg-white h-180px p-5px flex flex-col justify-between">
         <!-- <div class="h-48px"></div>
         <el-input type="textarea"></el-input> -->
-        <tinymce-area v-model="inputValue" ref="TinyRef" @click:audit="handleAuditChatStart"
+        <tinymce-area v-model="inputValue" ref="TinyRef" @click:audio="handleAudioChatStart"
           @click:video="handleVideoChatStart"></tinymce-area>
         <div class="flex justify-end">
           <div class="bg-pink-300 text-sm text-white w-80px h-32px flex_center rounded-2xl cursor-pointer"
@@ -330,52 +330,52 @@ function handleVideoChatStart() {
       <div>{{ teacherInfo?.dxp_user_realname }}</div>
       <!-- <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"> -->
       <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-        v-show="auditChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT">
+        v-show="audioChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT">
         <div>正在等待对方接受邀请</div>
         <i:line-md:loading-alt-loop class="text-xl" />
       </div>
       <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-        v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT">
+        v-show="audioChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT">
         <div>邀请你语音通话...</div>
       </div>
       <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-        v-show="auditChatStatus === CHAT_STATUS.WAITING_BUSY">
+        v-show="audioChatStatus === CHAT_STATUS.WAITING_BUSY">
         <div class="text-red-500">对方忙线中请等待</div>
         <div class="text-red-500">当前排队:{{ 4 }}</div>
         <i:line-md:loading-alt-loop class="text-xl" />
       </div>
-      <div class="text-hex-909090 flex_center flex-col space-y-2 h-16" v-show="auditChatStatus === CHAT_STATUS.CHATING">
+      <div class="text-hex-909090 flex_center flex-col space-y-2 h-16" v-show="audioChatStatus === CHAT_STATUS.CHATING">
         <div>正在通话中</div>
         <div>{{ '00:30' }}</div>
       </div>
       <!-- </div> -->
 
       <div class="pt-16 text-xl flex justify-around w-full">
-        <div v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
+        <div v-show="audioChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
           class="bg-green-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="handleAuditChatAccept">
+          @click="handleAudioChatAccept">
           <i:ic:baseline-phone />
         </div>
-        <div v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
+        <div v-show="audioChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
           class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="handleAuditChatDeny">
+          @click="handleAudioChatDeny">
           <i:mdi:phone-hangup />
         </div>
-        <div v-show="auditChatStatus === CHAT_STATUS.CHATING"
+        <div v-show="audioChatStatus === CHAT_STATUS.CHATING"
           class="bg-hex-efefef text-hex-272636 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
           @click="">
           <i:ant-design:audio-outlined v-show="true" />
           <i:ant-design:audio-muted-outlined v-show="false" />
         </div>
-        <div v-show="auditChatStatus === CHAT_STATUS.CHATING"
+        <div v-show="audioChatStatus === CHAT_STATUS.CHATING"
           class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="handleAuditChatEnd">
+          @click="handleAudioChatEnd">
           <i:ic:outline-close></i:ic:outline-close>
         </div>
         <div
-          v-show="auditChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT || auditChatStatus === CHAT_STATUS.WAITING_BUSY"
+          v-show="audioChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT || audioChatStatus === CHAT_STATUS.WAITING_BUSY"
           class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="handleAuditChatCancel">
+          @click="handleAudioChatCancel">
           <i:ic:outline-close></i:ic:outline-close>
         </div>
 

+ 8 - 230
src/pages/teacher/consult.vue

@@ -8,6 +8,7 @@ import user from '~/store/user';
 import { createSocket, socketSend } from '~/utils/ws';
 import type { TSocketRes } from '~/utils/ws';
 import { formatTimestamp } from '~/utils/time';
+import { CHAT_STATUS, CHAT_OPERATION } from '~/types';
 let dyaw_xlfw_zxhd = $ref<type_dyaw_xlfw_zxhd | undefined>()
 let dyaw_xlfw_zxhd_list = $ref<type_dyaw_xlfw_zxhd[] | undefined>()
 
@@ -215,18 +216,10 @@ function handleQueryArchives() {
 }
 
 // ==========
-// chat audit/video
+// chat audio/video
 // ==========
-let rtcInstance: {
-  client?: IAgoraRTCClient;
-  localAudioTrack?: IMicrophoneAudioTrack;
-  localVideoTrack?: ICameraVideoTrack
-} = {
-  client: undefined,
-  localAudioTrack: undefined,
-  localVideoTrack: undefined,
-}
 
+let RtcDialogRef = $ref<typeof import("~/components/rtc-dialog/index.vue")['default']>()
 
 const ws2 = createSocket(
   { teacher: user.user_id, student: '*' },
@@ -234,180 +227,28 @@ const ws2 = createSocket(
     message(socketRes: TSocketRes<type_dyaw_xlfw_zxhd_log & { operate: CHAT_OPERATION }>) {
       if (socketRes.from_client_name.endsWith('student')) {
         // infoList.push(socketRes.content)
-        console.log('');
         if (socketRes.content.dxzl_tea_user_id === user.user_id) {
           console.log('operate:', socketRes.content.operate);
-          switch (socketRes.content.operate) {
-            case CHAT_OPERATION.START:
-              auditChatStatus = CHAT_STATUS.WAITING_YOU_ACCEPT
-              ChatAudioRef!.open()
-              break;
-            case CHAT_OPERATION.CANCEL:
-              ChatAudioRef!.close()
-              break;
-            case CHAT_OPERATION.ACCEPT:
-              auditChatStatus = CHAT_STATUS.CHATING
-              break;
-            case CHAT_OPERATION.DENY:
-              ChatAudioRef!.close()
-              break;
-            case CHAT_OPERATION.END:
-              ChatAudioRef!.close()
-              break;
-            default:
-              break;
-          }
+          RtcDialogRef!.publisher(ws2, socketRes.content.operate)
         }
       }
     }
   }
 )
 
-enum CHAT_STATUS { 'WAITING_YOU_ACCEPT', 'WAITING_OTHERS_ACCEPT', 'WAITING_BUSY', 'CHATING' }
-enum CHAT_OPERATION { 'START', 'CANCEL', 'ACCEPT', 'DENY', 'END' }
-let auditChatStatus = $ref<CHAT_STATUS>(CHAT_STATUS.WAITING_OTHERS_ACCEPT)
 
-const ChatAudioRef = $ref<typeof import("~/components/chat-dialog/index.vue")['default']>()
-const ChatVideoRef = $ref<typeof import("~/components/chat-dialog/index.vue")['default']>()
-
-
-async function handleAuditChatStart() {
-  try {
-    let rtcOptions
-    await request({
-      url: '/dyaw/xlfw_zxhd/get_rtc_token',
-      data: {
-        dxz_id: dyaw_xlfw_zxhd?.dxz_id
-      }
-    }).then(async res => {
-      if (res.code === '1') {
-        let resp: { jgim_roomid: string; rtc_appid: string; rtc_token: string } = res.data.one_info
-        rtcOptions = {
-          appId: resp.rtc_appid,
-          channel: resp.jgim_roomid,
-          token: resp.rtc_token,
-          uid: user.user_id
-        }
 
-        let client = rtcInstance.client = AgoraRTC.createClient({ mode: "rtc", codec: "vp8" });
-
-        client.on("user-published", async (user, mediaType) => {
-          // 发起订阅
-          await client.subscribe(user, mediaType);
-
-          // 如果订阅的是音频轨道
-          if (mediaType === "audio") {
-            const audioTrack = user.audioTrack;
-            // 自动播放音频
-            audioTrack?.play();
-          } else {
-            const videoTrack = user.videoTrack;
-            // 自动播放视频
-            videoTrack?.play(RemotePlayerContainerRef as HTMLElement);
-          }
-        });
+async function handleAudioChatStart() {
+  RtcDialogRef!.open(dyaw_xlfw_zxhd,'audio')
+}
 
-        await rtcInstance.client.join(rtcOptions.appId, rtcOptions.channel, rtcOptions?.token, rtcOptions.uid);
-        rtcInstance.localAudioTrack = await AgoraRTC.createMicrophoneAudioTrack();
-        // rtcInstance.localVideoTrack = await AgoraRTC.createCameraVideoTrack();
-        await rtcInstance.client.publish([rtcInstance.localAudioTrack]);
-        // rtcInstance.localVideoTrack.play(LocalPlayerContainerRef as HTMLElement);
-      }
-    })
-    ChatAudioRef!.open()
-    socketSend(ws2, {
-      dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
-      dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
-      operate: CHAT_OPERATION.START,
-      rtcOptions
-    })
-  } catch (error) {
-    console.error(error);
-  }
 
-}
-function handleAuditChatCancel() {
-  socketSend(ws2, {
-    dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
-    dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
-    operate: CHAT_OPERATION.CANCEL
-  })
-  ChatAudioRef!.close()
-}
-function handleAuditChatAccept() {
-  socketSend(ws2, {
-    dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
-    dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
-    operate: CHAT_OPERATION.ACCEPT
-  })
-  // ChatAudioRef!.close()
-  auditChatStatus = CHAT_STATUS.CHATING
-}
-function handleAuditChatDeny() {
-  socketSend(ws2, {
-    dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
-    dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
-    operate: CHAT_OPERATION.DENY
-  })
-  ChatAudioRef!.close()
-}
-function handleAuditChatEnd() {
-  socketSend(ws2, {
-    dxzl_stu_user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id,
-    dxzl_tea_user_id: dyaw_xlfw_zxhd!.dxz_tea_user_id,
-    operate: CHAT_OPERATION.END
-  })
-  ChatAudioRef!.close()
-}
 
 
-const LocalPlayerContainerRef = $ref<HTMLElement>()
-const RemotePlayerContainerRef = $ref<HTMLElement>()
 async function handleVideoChatStart() {
-  await request({
-    url: '/dyaw/xlfw_zxhd/get_rtc_token',
-    data: {
-      dxz_id: dyaw_xlfw_zxhd?.dxz_id
-    }
-  }).then(async res => {
-    if (res.code === '1') {
-      let resp: { jgim_roomid: string; rtc_appid: string; rtc_token: string } = res.data.one_info
-      const rtcOptions = {
-        appId: resp.rtc_appid,
-        channel: resp.jgim_roomid,
-        token: resp.rtc_token,
-        uid: user.user_id
-      }
-
-      let client = rtcInstance.client = AgoraRTC.createClient({ mode: "rtc", codec: "vp8" });
-
-      client.on("user-published", async (user, mediaType) => {
-        // 发起订阅
-        await client.subscribe(user, mediaType);
-
-        // 如果订阅的是音频轨道
-        if (mediaType === "audio") {
-          const audioTrack = user.audioTrack;
-          // 自动播放音频
-          audioTrack?.play();
-        } else {
-          const videoTrack = user.videoTrack;
-          // 自动播放视频
-          videoTrack?.play(RemotePlayerContainerRef as HTMLElement);
-        }
-      });
 
-      await rtcInstance.client.join(rtcOptions.appId, rtcOptions.channel, rtcOptions?.token, rtcOptions.uid);
-      rtcInstance.localAudioTrack = await AgoraRTC.createMicrophoneAudioTrack();
-      rtcInstance.localVideoTrack = await AgoraRTC.createCameraVideoTrack();
-      await rtcInstance.client.publish([rtcInstance.localAudioTrack, rtcInstance.localVideoTrack]);
-      rtcInstance.localVideoTrack.play(LocalPlayerContainerRef as HTMLElement);
-    }
-  })
-  ChatVideoRef!.open()
 }
 
-let RtcDialogRef = $ref<typeof import("~/components/rtc-dialog/index.vue")['default']>()
 </script>
 
 <template>
@@ -435,7 +276,7 @@ let RtcDialogRef = $ref<typeof import("~/components/rtc-dialog/index.vue")['defa
             :d="item"></info-item>
         </div>
         <div class="bg-white h-180px p-5px flex flex-col justify-between">
-          <tinymce-area v-model="inputValue" ref="TinyRef" @click:audit="handleAuditChatStart"
+          <tinymce-area v-model="inputValue" ref="TinyRef" @click:audio="handleAudioChatStart"
             @click:video="handleVideoChatStart"></tinymce-area>
           <div class="flex justify-end">
             <div class="bg-pink-300 text-sm text-white w-80px h-32px flex_center rounded-2xl cursor-pointer"
@@ -472,70 +313,7 @@ let RtcDialogRef = $ref<typeof import("~/components/rtc-dialog/index.vue")['defa
     </div>
   </div>
 
-  <chat-dialog ref="ChatAudioRef">
-    <div class="h-full flex_center flex-col text-light-50 space-y-4">
-      <el-avatar :size="158" :src="dyaw_xlfw_zxhd?.dxx_user_avatar"></el-avatar>
-      <div>{{ dyaw_xlfw_zxhd?.dxz_stu_user_realname }}</div>
-      <!-- <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"> -->
-      <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-        v-show="auditChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT">
-        <div>正在等待对方接受邀请</div>
-        <i:line-md:loading-alt-loop class="text-xl" />
-      </div>
-      <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-        v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT">
-        <div>邀请你语音通话...</div>
-      </div>
-      <div class="text-hex-909090 flex_center flex-col space-y-2 h-16"
-        v-show="auditChatStatus === CHAT_STATUS.WAITING_BUSY">
-        <div class="text-red-500">对方忙线中请等待</div>
-        <div class="text-red-500">当前排队:{{ 4 }}</div>
-        <i:line-md:loading-alt-loop class="text-xl" />
-      </div>
-      <div class="text-hex-909090 flex_center flex-col space-y-2 h-16" v-show="auditChatStatus === CHAT_STATUS.CHATING">
-        <div>正在通话中</div>
-        <div>{{ '00:30' }}</div>
-      </div>
-      <!-- </div> -->
-
-      <div class="pt-16 text-xl flex justify-around w-full">
-        <div v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
-          class="bg-green-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="handleAuditChatAccept">
-          <i:ic:baseline-phone />
-        </div>
-        <div v-show="auditChatStatus === CHAT_STATUS.WAITING_YOU_ACCEPT"
-          class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="handleAuditChatDeny">
-          <i:mdi:phone-hangup />
-        </div>
-        <div v-show="auditChatStatus === CHAT_STATUS.CHATING"
-          class="bg-hex-efefef text-hex-272636 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="">
-          <i:ant-design:audio-outlined v-show="true" />
-          <i:ant-design:audio-muted-outlined v-show="false" />
-        </div>
-        <div v-show="auditChatStatus === CHAT_STATUS.CHATING"
-          class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="handleAuditChatEnd">
-          <i:ic:outline-close></i:ic:outline-close>
-        </div>
-        <div
-          v-show="auditChatStatus === CHAT_STATUS.WAITING_OTHERS_ACCEPT || auditChatStatus === CHAT_STATUS.WAITING_BUSY"
-          class="bg-red-600 w-12 h-12 rounded-1 cursor-pointer flex items-center justify-around"
-          @click="handleAuditChatCancel">
-          <i:ic:outline-close></i:ic:outline-close>
-        </div>
-
-      </div>
-    </div>
-
-  </chat-dialog>
 
-  <chat-dialog>
-    <div ref="LocalPlayerContainerRef"></div>
-    <div ref="RemotePlayerContainerRef"></div>
-  </chat-dialog>
 
   <rtc-dialog ref="RtcDialogRef"></rtc-dialog>