|
@@ -3,6 +3,8 @@ import { defineComponent, onUnmounted, reactive, watch } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
|
import { Howl } from 'howler'
|
|
|
import iconAudio from './images/icon-audio.png'
|
|
|
+import iconPlay from './images/icon-play.png'
|
|
|
+import iconPause from './images/icon-pause.png'
|
|
|
import { eventUnit } from '../../unit'
|
|
|
|
|
|
// 音频播放
|
|
@@ -29,17 +31,12 @@ export default defineComponent({
|
|
|
// winner: [6000, 5000]
|
|
|
// }
|
|
|
})
|
|
|
- console.log(htick)
|
|
|
+ // console.log(htick)
|
|
|
|
|
|
htick.on('load', (val: any) => {
|
|
|
- console.log('111')
|
|
|
console.log(htick.duration())
|
|
|
state.duration = Math.ceil(htick.duration())
|
|
|
})
|
|
|
- // 播放结束
|
|
|
- // htick.on('end', () => {
|
|
|
- // console.log('1')
|
|
|
- // })
|
|
|
|
|
|
eventUnit.on('unitAudioStop', () => {
|
|
|
htick.stop()
|
|
@@ -58,8 +55,9 @@ export default defineComponent({
|
|
|
</div>
|
|
|
|
|
|
{/* pause-circle */}
|
|
|
+ {/* 'play-circle' : 'pause-circle' */}
|
|
|
<Icon
|
|
|
- name={state.audioStatus === 'stopped' ? 'play-circle' : 'pause-circle'}
|
|
|
+ name={state.audioStatus === 'stopped' ? iconPause : iconPlay}
|
|
|
class={styles.audioStatus}
|
|
|
onClick={(e: any) => {
|
|
|
e.stopPropagation()
|