Commit 5a016285 by 杨铁龙

新增action消息类型

parent e02e153e
<template>
<div
class="msg-detail inline-text"
v-html="format2Link(messageBody.msg.text || emptyText)"
></div>
</template>
<script lang="ts">
import { replaceText2Link } from "@/customer-service/utils";
import xim from "@/customer-service/xim";
import { Component } from "vue-property-decorator";
import BaseMessage from "./index";
@Component({ components: {} })
export default class Index extends BaseMessage {
protected readonly emptyText = " ";
protected format2Link(text: string) {
let t = replaceText2Link(text);
const keywords = xim.getMatchedTextKeywords();
for (const item of keywords) {
const r = new RegExp(item, "g");
t = t.replace(r, `<span class="highlight">${item}</span>`);
}
return t;
}
}
</script>
<style lang="less" scoped>
.inline-text {
display: inline-block;
white-space: pre-wrap;
text-align: left;
padding: 20px 30px;
color: #409eff;
/deep/ .highlight {
color: #e87005;
}
}
</style>
\ No newline at end of file
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<div <div
class="message-con d-flex align-items-center" class="message-con d-flex align-items-center"
:class="{ :class="{
'my-message flex-row-reverse': isMyMessage && !isQuestionAnswerMessage, 'my-message flex-row-reverse':
isMyMessage && !isQuestionAnswerMessage,
'justify-content-center': isWithdrawMessage, 'justify-content-center': isWithdrawMessage,
'offset-bottom': matchKeywords, 'offset-bottom': matchKeywords,
}" }"
...@@ -33,7 +34,11 @@ ...@@ -33,7 +34,11 @@
@open="openFile" @open="openFile"
/> />
<avatar <avatar
v-if="(avatar || showHostAvatar) && !isQuestionAnswerMessage && !isWithdrawMessage" v-if="
(avatar || showHostAvatar) &&
!isQuestionAnswerMessage &&
!isWithdrawMessage
"
:src=" :src="
chatRole === 'default' chatRole === 'default'
? avatar ? avatar
...@@ -133,6 +138,7 @@ ...@@ -133,6 +138,7 @@
import AudioMessage from "./message-item/audio-message.vue"; import AudioMessage from "./message-item/audio-message.vue";
import VideoMessage from "./message-item/video-message.vue"; import VideoMessage from "./message-item/video-message.vue";
import TextMessage from "./message-item/text-message.vue"; import TextMessage from "./message-item/text-message.vue";
import ActionMessage from "./message-item/action-message.vue";
import WithdrawMessage from "./message-item/withdraw-message.vue"; import WithdrawMessage from "./message-item/withdraw-message.vue";
import PurchasePlanMessage from "./message-item/purchase-plan-message.vue"; import PurchasePlanMessage from "./message-item/purchase-plan-message.vue";
import MyWelfareMessage from "./message-item/my-welfare-message.vue"; import MyWelfareMessage from "./message-item/my-welfare-message.vue";
...@@ -153,6 +159,7 @@ ...@@ -153,6 +159,7 @@
[dto.MessageType.MyPurchasePlan, "purchase-plan-message"], [dto.MessageType.MyPurchasePlan, "purchase-plan-message"],
[dto.MessageType.MyWelfare, "my-welfare-message"], [dto.MessageType.MyWelfare, "my-welfare-message"],
[dto.MessageType.QuestionAnswer, "question-answer-message"], [dto.MessageType.QuestionAnswer, "question-answer-message"],
[dto.MessageType.Action, "action-message"],
]); ]);
@Component({ @Component({
...@@ -168,6 +175,7 @@ ...@@ -168,6 +175,7 @@
PurchasePlanMessage, PurchasePlanMessage,
MyWelfareMessage, MyWelfareMessage,
QuestionAnswerMessage, QuestionAnswerMessage,
ActionMessage,
}, },
}) })
export default class Message extends Vue { export default class Message extends Vue {
......
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