Browse Source

测试代码

liudan 1 day ago
parent
commit
56076ede3d
2 changed files with 3 additions and 4 deletions
  1. 3 0
      src/components/login/Index.jsx
  2. 0 4
      src/pages/home/Index.jsx

+ 3 - 0
src/components/login/Index.jsx

@@ -1,6 +1,7 @@
 import React from 'react';
 import { Input, Form, Modal, Selector, Toast } from 'antd-mobile';
 const formRef = React.createRef();
+import audioSrc from './../../assets/mp3.wav';
 /**
  * @刘丹: 登录公用
  */
@@ -234,6 +235,8 @@ class Login extends React.Component {
             </Form.Item>
           </>}
           </Form>
+          <audio controls src={audioSrc}></audio>
+          <video controls src={audioSrc}></video>
         </>}
       >
       </Modal>

+ 0 - 4
src/pages/home/Index.jsx

@@ -270,9 +270,6 @@ class Home extends React.Component {
         this.initVoice('/mp3.wav');
       }, 2950);
     };
-    document.querySelector('#test').onclick = () => {
-      this.soundPaly2(audioSrc);
-    };
     //test();
   }
   soundPaly2(src) {
@@ -571,7 +568,6 @@ class Home extends React.Component {
           onClick={this.openLogin}
           style={{color: this.state.colorName == 'dark-bg' ? '#fff' : '#0D2764', marginLeft: '10px'}}
         />
-        <button id="test"> 测 </button>
         </span>
         <audio controls id="audio"
           style={{ position: 'fixed', left: '-1000px', top: '100px' }}