Commit fe7f9e85 authored by zhengke's avatar zhengke

修改

parent 0d5940d4
......@@ -18,7 +18,7 @@
[{{item.ChineseMean}}]
</view>
</view>
<view class="listen" @click="play">
<view class="listen" @click="play(item.FileUrl)">
<!-- <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/laba2x.png"
mode="aspectFit" class="listenIcon"></image> -->
<i class="icon_audio_default" v-if="!isPlay"></i>
......@@ -70,9 +70,13 @@
isPlay: false
})
const methods = {
play() {
innerAudioContext.src =
`https://fanyi.baidu.com/gettts?lan=jp&text=${encodeURIComponent(props.item.WordContent)}&spd=3&source=web`
play(src) {
if(src){
innerAudioContext.src=src;
}else{
innerAudioContext.src =
`https://fanyi.baidu.com/gettts?lan=jp&text=${encodeURIComponent(props.item.WordContent)}&spd=3&source=web`
}
innerAudioContext.play()
data.isPlay = true;
innerAudioContext.onEnded((e)=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment