Commit a33fdcc0 by zhousil

福利宝客服

parent 5552f710
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
@Component({ components: {} }) @Component({ components: {} })
export default class Index extends BaseMessage { export default class Index extends BaseMessage {
private readonly emptyText = " "; protected readonly emptyText = " ";
} }
</script> </script>
......
<template>
<div
class="msg-detail inline-text"
v-html="messageBody.msg.text || emptyText"
></div>
</template>
<script lang="ts"> <script lang="ts">
import { Component } from "vue-property-decorator"; import { Component } from "vue-property-decorator";
import BaseMessage from "./index"; import MyWelfareMessage from "@/customer-service/components/message-item/my-welfare-message.vue";
import Chat from "@/customer-service/xim/index"; import Chat from "@/customer-service/xim/index";
@Component({ components: {} }) @Component({ components: {} })
export default class Index extends BaseMessage { export default class Index extends MyWelfareMessage {
private readonly emptyText = " ";
mounted() { mounted() {
if (Chat.isBackend()) { if (Chat.isBackend()) {
this.backEndPlan(); this.backEndPlan();
......
<template>
<div
class="msg-detail inline-text"
v-html="format2Link(messageBody.msg.text || emptyText)"
></div>
</template>
<script lang="ts"> <script lang="ts">
import { replaceText2Link } from "@/customer-service/utils";
import xim from "@/customer-service/xim";
import { Component } from "vue-property-decorator"; import { Component } from "vue-property-decorator";
import BaseMessage from "./index"; import TextMessage from "@/customer-service/components/message-item/text-message.vue";
@Component({ components: {} }) @Component({ components: {} })
export default class Index extends BaseMessage { export default class Index extends TextMessage {}
private readonly emptyText = " ";
private 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> </script>
<style lang="less" scoped> <style lang="less" scoped>
.content-chat .chat-room-con .message-template .my-message.msg-detail{ .chat-room-con .message-template .my-message.msg-detail {
background: #f5f5f5 !important; background-color: #f5f5f5 !important;
&::after{ &::after {
border: 0; border: 0;
} }
} }
.inline-text { .inline-text {
display: inline-block; display: inline-block;
white-space: pre-wrap; white-space: pre-wrap;
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
<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, 'my-message flex-row-reverse': isMyMessage && !isQuestionAnswerMessage,
'justify-content-center': isWithdrawMessage, 'justify-content-center': isWithdrawMessage,
'offset-bottom': matchKeywords, 'offset-bottom': matchKeywords,
'question-answer-message': isQuestionAnswerMessage,
}" }"
> >
<div class="msg-content" :class="{ 'algin-left': !isMyMessage }"> <div class="msg-content" :class="{ 'algin-left': !isMyMessage }">
...@@ -466,19 +465,6 @@ ...@@ -466,19 +465,6 @@
word-break: break-all; word-break: break-all;
} }
} }
&.question-answer-message {
flex-direction: row;
.msg-content {
text-align: left;
}
.msg-name {
margin-left: 0 !important;
text-align: left;
}
.content-avatar {
justify-content: flex-start !important;
}
}
&.offset-bottom { &.offset-bottom {
margin-bottom: 30px; margin-bottom: 30px;
} }
......
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