Browse Source

去掉测试代码

liudan 2 days ago
parent
commit
659d951f02
1 changed files with 11 additions and 8 deletions
  1. 11 8
      src/pages/home/Index.jsx

+ 11 - 8
src/pages/home/Index.jsx

@@ -6,7 +6,7 @@ import OperateScreen from '@pages/operateScreen/Index.jsx';
 import FingerprintJS from '@fingerprintjs/fingerprintjs';
 import { initSocket } from '@api/index.js';
 import { AntOutline, SetOutline } from 'antd-mobile-icons';
-
+import { Toast } from 'antd-mobile';
 // // 安卓相关处理
 
 window.webGetDeviceId = function (callback) {
@@ -293,6 +293,10 @@ class Home extends React.Component {
         domAudio.load();
         domAudio.play();
         const mes = () => {
+          Toast.show({
+            duration: 10000,
+            content: '播放完成',
+          });
           const { voiceSrc } = this.state;
           voiceSrc.splice(0, 1);
           const newArr = voiceSrc;
@@ -300,20 +304,19 @@ class Home extends React.Component {
             isPlay: false,
             voiceSrc: newArr,
           }, () => {
-            console.log(newArr);
             if (newArr.length > 0) {
               playVioce(newArr[0]);
             }
             domAudio.removeEventListener('ended', mes);
           });
         };
-        domAudio.addEventListener('ende2d', mes);
+        domAudio.addEventListener('ended', mes);
         // 10s看是否播放结束
-        setTimeout(() => {
-          if (this.state.isPlay) {
-            mes();
-          }
-        }, 10000);
+        // setTimeout(() => {
+        //   if (this.state.isPlay) {
+        //     mes();
+        //   }
+        // }, 10000);
       });
     };
   };