余尚辉 1 month ago
parent
commit
386636cbcc
5 changed files with 21 additions and 17 deletions
  1. BIN
      .DS_Store
  2. 1 1
      html/hs-cti.es6.umd.prod.js
  3. 2 2
      index.html
  4. 6 4
      src/layout/components/HeaderGroup/index.vue
  5. 12 10
      src/layout/index.vue

BIN
.DS_Store


File diff suppressed because it is too large
+ 1 - 1
html/hs-cti.es6.umd.prod.js


+ 2 - 2
index.html

@@ -9,8 +9,8 @@
 
   <script type="text/javascript" src="https://static.fuxicarbon.com/hs-cti/socket.io.min.js"></script>
   <script type="text/javascript" src="https://static.fuxicarbon.com/hs-cti/SIP.min.js"></script>
-  <script src="https://static.fuxicarbon.com/hs-cti/hs-cti.es6.umd.prod.v4.js" type="text/javascript"></script>
-  <!-- <script type="text/javascript" src="./hs-cti.es6.umd.prod.js"></script> -->
+  <script src="https://static.fuxicarbon.com/hs-cti/hs-cti.es6.umd.prod.v4.js?v1=1" type="text/javascript"></script>
+  <!-- <script type="text/javascript" src="./html/hs-cti.es6.umd.prod.js"></script> -->
   <link rel="icon" href="/favicon.ico">
   <title>佳木斯智能语音客服</title>
   <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->

+ 6 - 4
src/layout/components/HeaderGroup/index.vue

@@ -44,16 +44,18 @@ const handlePopoverItem = async ({ state, label }) => {
     workbenchApi.getSeatsByUser({ userId: userStore.id }).then(async({ data }) => {
       if (!data) return;
       await useVoice.HS_CTI_INSTANCE(data.outId); 
-      await voiceStore.getAgentStatus();
-        // console.log( "坐席状态 下", voiceStore.AGENTSTATUS );
-        // console.log( "系统状态 下", voiceStore.HSCTIERRORCODE );
-        // if ( !([100001, 100002].includes( Number(voiceStore.HSCTIERRORCODE)) ) ) {
+      setTimeout(async() => {
+        await voiceStore.getAgentStatus();
+          // console.log( "坐席状态 下", voiceStore.AGENTSTATUS );
+          // console.log( "系统状态 下", voiceStore.HSCTIERRORCODE );
+          // if ( !([100001, 100002].includes( Number(voiceStore.HSCTIERRORCODE)) ) ) {
         if ( voiceStore.AGENTSTATUS != 0 ) {
           state ? await voiceStore.setIdle() : await voiceStore.setBusy();
           proxy.$modal[state ? 'msgSuccess' : 'msgWarning']('当前坐席状态: ' + label);
         } else {
           voiceStore.systemState = false;
         }
+      }, 1000);
     })
   } else {
     /**

+ 12 - 10
src/layout/index.vue

@@ -32,18 +32,20 @@ const init = () => {
         // console.log("系统状态", useVoice.HSCTIERRORCODE);
         // 目前先只考虑 100001 100002 错误码 处理
         
-        if ( [100001, 100002].includes( Number(useVoice.HSCTIERRORCODE) ) ) {
-          // 有错误
-          useVoice.systemState = false;
-        } else {
-          // 正常
-          await useVoice.getAgentStatus();
-          if ( voiceStatus && [1, 2].includes( Number(useVoice.AGENTSTATUS) )) {
-            voiceStatus === 'busy' ? useVoice.setBusy() : useVoice.setIdle();
+       setTimeout(async () => {
+          if ( [100001, 100002].includes( Number(useVoice.HSCTIERRORCODE) ) ) {
+            // 有错误
+            useVoice.systemState = false;
           } else {
-            useVoice.setIdle();
+            // 正常
+            await useVoice.getAgentStatus();
+            if ( voiceStatus && [1, 2].includes( Number(useVoice.AGENTSTATUS) )) {
+              voiceStatus === 'busy' ? useVoice.setBusy() : useVoice.setIdle();
+            } else {
+              useVoice.setIdle();
+            }
           }
-        }
+       }, 1000);
     })
 }
 

Some files were not shown because too many files changed in this diff