Commit 31531649 by Sixong.Zhu

Merge branch 'release' of…

Merge branch 'release' of http://gitlab.corp.qinqinxiaobao.com:9880/uniplat/customer-service into release
parents 362709e0 959df9bb
......@@ -7,6 +7,10 @@ export function parserMessage(type: string, rawMsg: string) {
const msg = JSON.parse(rawMsg);
return msg.text;
}
if (type === MessageType.Action) {
const msg = JSON.parse(rawMsg);
return msg.text;
}
if (type === MessageType.Image) {
return `[图片]`;
}
......
<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
......@@ -133,6 +133,7 @@
import AudioMessage from "./message-item/audio-message.vue";
import VideoMessage from "./message-item/video-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 xim from "./../xim";
......@@ -146,6 +147,7 @@
[dto.MessageType.Text, "text-message"],
[dto.MessageType.Withdraw, "withdraw-message"],
[dto.MessageType.GeneralOrderMsg, "text-message"],
[dto.MessageType.Action, "action-message"],
]);
@Component({
......@@ -158,6 +160,7 @@
VideoMessage,
TextMessage,
WithdrawMessage,
ActionMessage,
},
})
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