liudan 1 год назад
Родитель
Сommit
ad1f7ecaa5
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      src/pages/home/Index.jsx

+ 7 - 3
src/pages/home/Index.jsx

@@ -294,15 +294,15 @@ class Home extends React.Component {
       }
       }
     };
     };
   }
   }
-  soundPaly(src) {
+  soundPaly() {
     const isDev = import.meta.env.MODE == 'development';
     const isDev = import.meta.env.MODE == 'development';
-    if (src || isDev || this.state.voiceList.length > 0) {
+    if (isDev || (this.state.voiceList.length > 0)) {
       this.setState({
       this.setState({
         myStatus: true,
         myStatus: true,
       }, () => {
       }, () => {
         const ua = navigator.userAgent.toLowerCase();
         const ua = navigator.userAgent.toLowerCase();
         if (/android/.test(ua)) {
         if (/android/.test(ua)) {
-          window.JavaClientCall && window.JavaClientCall.mediaFilePlay(src || isDev ? 'https://np.h03.p0551.com/images/wav/eba7ea72748b33c07d55ca7c443d6146.wav' : this.state.voiceList[0]);
+          window.JavaClientCall && window.JavaClientCall.mediaFilePlay( isDev ? 'https://np.h03.p0551.com/images/wav/eba7ea72748b33c07d55ca7c443d6146.wav' : this.state.voiceList[0]);
         }
         }
       });
       });
     } else {
     } else {
@@ -402,6 +402,10 @@ class Home extends React.Component {
       colorName,
       colorName,
     });
     });
     localStorage.setItem('ZZJ-color', colorName);
     localStorage.setItem('ZZJ-color', colorName);
+    const ua = navigator.userAgent.toLowerCase();
+    if (/android/.test(ua)) {
+      window.JavaClientCall && window.JavaClientCall.mediaFilePlay('https://np.h03.p0551.com/images/wav/eba7ea72748b33c07d55ca7c443d6146.wav');
+    }
     this.soundPaly('https://np.h03.p0551.com/images/wav/eba7ea72748b33c07d55ca7c443d6146.wav');
     this.soundPaly('https://np.h03.p0551.com/images/wav/eba7ea72748b33c07d55ca7c443d6146.wav');
   };
   };
   openLogin = (cache) => {
   openLogin = (cache) => {