Commit 7530689c by Sixong.Zhu

Merge branch 'master' into pre

parents cb1d43e3 466962ea
<template> <template>
<div <div>
class="msg-detail voice-message d-flex align-items-center" <div
:class="{ playing: playing, 'can-play': messageRealUrl }" class="msg-detail voice-message d-flex align-items-center"
@click.stop="play" :class="{ playing: playing, 'can-play': messageRealUrl }"
:style="{ width: getVoiceMessageWidth + 'px' }" @click.stop="play"
> :style="{ width: getVoiceMessageWidth + 'px' }"
<div class="d-flex align-items-center" v-if="messageRealUrl"> >
<voice-icon :loading="playing"></voice-icon> <div class="d-flex align-items-center" v-if="messageRealUrl">
<audio ref="audio" @play="onPlay" @pause="onPause"> <voice-icon :loading="playing"></voice-icon>
<source type="audio/aac" :src="messageRealUrl" /> <audio ref="audio" @play="onPlay" @pause="onPause">
</audio> <source type="audio/aac" :src="messageRealUrl" />
<span v-if="duration" class="duration text-nowrap text-hint" </audio>
>{{ durationInSecond }}s</span <span v-if="duration" class="duration text-nowrap text-hint"
> >{{ durationInSecond }}s</span
>
</div>
<i
class="el-icon-warning-outline"
v-else-if="fileFailed2Load"
title="[语音加载失败]"
></i>
</div> </div>
<i
class="el-icon-warning-outline"
v-else-if="fileFailed2Load"
title="[语音加载失败]"
></i>
<text-message v-model="value" v-if="backend" /> <text-message v-model="value" v-if="backend" />
</div> </div>
</template> </template>
...@@ -92,6 +93,9 @@ ...@@ -92,6 +93,9 @@
<style lang="less" scoped> <style lang="less" scoped>
.voice-message { .voice-message {
width: 200px; width: 200px;
background-color: #eee;
border-radius: 6px;
padding: 8px 10px;
&.can-play { &.can-play {
cursor: pointer; cursor: pointer;
...@@ -102,12 +106,6 @@ ...@@ -102,12 +106,6 @@
} }
} }
.inline-text {
position: absolute;
bottom: 0;
left: 40px;
}
.my-message { .my-message {
.voice-message { .voice-message {
> div { > div {
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
import PayMessage from "./message-item/pay-message.vue"; import PayMessage from "./message-item/pay-message.vue";
import NotifyMessage from "./message-item/notify-message.vue"; import NotifyMessage from "./message-item/notify-message.vue";
import { ChatRole } from "@/customer-service/model"; import { ChatRole } from "@/customer-service/model";
import { getUserMapping } from "../utils/user-info"; import { ChatUserInfoService, getUserMapping } from "../utils/user-info";
import Xim from "@/customer-service/xim"; import Xim from "@/customer-service/xim";
import { CustomerServiceEvent, MessageEvent } from "../event"; import { CustomerServiceEvent, MessageEvent } from "../event";
import { PayMessageBody } from "../xim/models/chat"; import { PayMessageBody } from "../xim/models/chat";
...@@ -266,6 +266,8 @@ ...@@ -266,6 +266,8 @@
private org = ""; private org = "";
private manualAllRead = false; private manualAllRead = false;
private manualReaded = 0; private manualReaded = 0;
private refetchUsername = "";
private refetchUserIcon = "";
private readerListOffset = false; private readerListOffset = false;
private defaultMessageHandledStatus = dto.MessageHandled.Default; private defaultMessageHandledStatus = dto.MessageHandled.Default;
...@@ -344,6 +346,11 @@ ...@@ -344,6 +346,11 @@
return true; return true;
} }
// 系统推送的消息,默认为客服发送
if (this.messageBody && +this.messageBody.eid === 0) {
return true;
}
if ( if (
this.backend && this.backend &&
this.messageBody && this.messageBody &&
...@@ -376,7 +383,10 @@ ...@@ -376,7 +383,10 @@
return this.getFilterUsername(t.alias_name || t.name); return this.getFilterUsername(t.alias_name || t.name);
} }
} }
return ""; if (!this.refetchUsername) {
this.refetchUsername4Message();
}
return this.refetchUsername;
} }
private getFilterUsername(name: string) { private getFilterUsername(name: string) {
...@@ -400,7 +410,7 @@ ...@@ -400,7 +410,7 @@
} }
} }
return ""; return this.refetchUserIcon;
} }
private get defaultAvatar() { private get defaultAvatar() {
...@@ -576,6 +586,17 @@ ...@@ -576,6 +586,17 @@
private openMessage(o: any) { private openMessage(o: any) {
CustomerServiceEvent.emit(this, o); CustomerServiceEvent.emit(this, o);
} }
private refetchUsername4Message() {
if (this.data && this.data.eid) {
ChatUserInfoService.getUserInfo(this.data.eid).then((r) => {
if (r) {
this.refetchUsername = r.alias_name || r.name || r.phone;
r.icon && (this.refetchUserIcon = r.icon);
}
});
}
}
} }
</script> </script>
......
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 sign in to comment