居民助手
This commit is contained in:
@@ -13,12 +13,12 @@
|
||||
</div>
|
||||
<!-- <scroll-view scroll-y="true" class="scroll-Y" @scroll="scroll"> -->
|
||||
<div class="list-content">
|
||||
<div :class="item.userType == 1 ? 'item-right' : 'item-left'" v-for="(item, index) in messageList" :key="index">
|
||||
<div :class="item.userType == 1 ? 'item-left' : 'item-right'" v-for="(item, index) in messageList" :key="index">
|
||||
<div class="item" :class="'item'+index">
|
||||
<div class="img-div" v-if="item.sdkFileUrl">
|
||||
<u-icon name="play-circle" :color="item.userType == 1 ? '#fff' : '#A8ADAE'" size="52" v-if="!item.isPlay" @click="play(item.sdkFileUrl, index)"></u-icon>
|
||||
<u-icon name="pause-circle" :color="item.userType == 1 ? '#fff' : '#A8ADAE'" size="52" v-else @click="playStop(index)"></u-icon>
|
||||
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/recording-white.png" alt="" v-if="item.userType == 1">
|
||||
<u-icon name="play-circle" :color="item.userType == 0 ? '#fff' : '#A8ADAE'" size="52" v-if="!item.isPlay" @click="play(item.sdkFileUrl, index)"></u-icon>
|
||||
<u-icon name="pause-circle" :color="item.userType == 0 ? '#fff' : '#A8ADAE'" size="52" v-else @click="playStop(index)"></u-icon>
|
||||
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/recording-white.png" alt="" v-if="item.userType == 0">
|
||||
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/recording-gray.png" alt="" v-else>
|
||||
</div>
|
||||
<p>{{item.content || ''}}</p>
|
||||
@@ -215,7 +215,7 @@ export default {
|
||||
})
|
||||
},
|
||||
play(src, index) {
|
||||
innerAudioContext.stop();
|
||||
// innerAudioContext.stop();
|
||||
this.messageList.map((item) => {
|
||||
if(item.sdkFileUrl) {
|
||||
item.isPlay = false
|
||||
@@ -223,7 +223,10 @@ export default {
|
||||
})
|
||||
this.messageList[index].isPlay = true
|
||||
innerAudioContext.src = src;
|
||||
innerAudioContext.play();
|
||||
|
||||
this.$nextTick(() => {
|
||||
innerAudioContext.play();
|
||||
})
|
||||
innerAudioContext.onEnded(() => {
|
||||
this.messageList[index].isPlay = false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user