会话问题调整

This commit is contained in:
fan 2022-12-02 17:53:10 +08:00
parent 4dff079c60
commit 2f5444e27f
2 changed files with 9 additions and 4 deletions

View File

@ -610,6 +610,7 @@ const socket = {
commit('setSimulationWorkParam', data);
},
setConversationMessage: ({ commit }, message) => {
console.log('----------------');
commit('setConversationMessage', message);
}
}

View File

@ -95,9 +95,11 @@ export default {
this.messageList = [];
},
'$store.state.socket.conversationMessage':function (val) { // 仿
this.messageList.push(val);
const message = {...val};
this.messageList.push(message);
console.log(val, '----------');
if (val.memberId != this.myMemberId) {
this.currentAudioList.push(val);
this.currentAudioList.push(message);
if (!this.isPlay) {
this.playAllAudio();
}
@ -131,11 +133,12 @@ export default {
this.$set(this.currentMessage, 'activeAuto', true);
this.play = true;
document.querySelector('#audioPlay').onended = () => {
this.$set(this.currentMessage, 'activeAuto', false);
if (!this.currentAudioList || !this.currentAudioList.length) {
this.play = false;
} else {
this.playAllAudio();
}
this.$set(this.currentMessage, 'activeAuto', false);
this.playAllAudio();
};
});
},
@ -425,6 +428,7 @@ export default {
margin-top: 10px;
display: inline-block;
max-width: 80%;
text-align: right;
}
.userHeader{margin-bottom: 2px;}
.userName{font-size: 12px;display:inline-block;margin-right:10px;}