Commit 26880254 by zhousil

福利宝客服

parent d5023b9a
...@@ -22,5 +22,8 @@ export function parserMessage(type: string, rawMsg: string) { ...@@ -22,5 +22,8 @@ export function parserMessage(type: string, rawMsg: string) {
if (type === MessageType.MyWelfare) { if (type === MessageType.MyWelfare) {
return `[我的福利]`; return `[我的福利]`;
} }
if (type === MessageType.QuestionAnswer) {
return `[问答]`;
}
return `[系统自动回复]`; return `[系统自动回复]`;
} }
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
} }
} }
.prodoct-item { .product-item {
display: flex; display: flex;
padding: 16px 0; padding: 16px 0;
&:not(:last-child) { &:not(:last-child) {
......
...@@ -22,13 +22,16 @@ ...@@ -22,13 +22,16 @@
"plan-welfare-title" "plan-welfare-title"
) as any; ) as any;
if (productTitleDom) { if (productTitleDom) {
// 遍历注册点击事件
productTitleDom.forEach((item: HTMLElement) => { productTitleDom.forEach((item: HTMLElement) => {
item.onclick = (e: any) => { item.onclick = (e: any) => {
// 我的福利在后台没找到位置
if (e.target.attributes["data-type"].value === "plan") {
window.open( window.open(
window.location.host + `/福利宝.福利宝管理端.采购管理/detail/w_plan/key/${e.target.attributes["data-id"].value}`,
`/统一业务平台.福利宝管理.采购管理/detail/w_plan/key/${e.target.id}`,
"_blank" "_blank"
); );
}
}; };
}); });
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
'my-message flex-row-reverse': isMyMessage, 'my-message flex-row-reverse': isMyMessage,
'justify-content-center': isWithdrawMessage, 'justify-content-center': isWithdrawMessage,
'offset-bottom': matchKeywords, 'offset-bottom': matchKeywords,
'system-message': isSystemMessage, 'question-answer-message': isQuestionAnswerMessage,
}" }"
> >
<div class="msg-content" :class="{ 'algin-left': !isMyMessage }"> <div class="msg-content" :class="{ 'algin-left': !isMyMessage }">
...@@ -14,23 +14,15 @@ ...@@ -14,23 +14,15 @@
:class="{ 'algin-left': !isMyMessage }" :class="{ 'algin-left': !isMyMessage }"
v-if="!isWithdrawMessage" v-if="!isWithdrawMessage"
> >
{{ isSystemMessage ? "系统消息" : userName }} {{ isQuestionAnswerMessage ? "" : userName }}
</div> </div>
<div <div
class="content-avatar d-flex align-items-start" class="content-avatar d-flex align-items-start"
:class="{ 'justify-content-end': isMyMessage,'cs-flex-direction': chatRole!=='default' }" :class="{
'justify-content-end': isMyMessage,
'cs-flex-direction': chatRole !== 'default',
}"
> >
<!-- <img
src="../imgs/default-host-avatar.svg"
style="width: 42px"
v-if="
messageComponent &&
!chatRole &&
!isWithdrawMessage &&
!isSystemMessage
"
class="host-avatar"
/> -->
<component <component
:is="messageComponent" :is="messageComponent"
:user-name="userName" :user-name="userName"
...@@ -42,7 +34,7 @@ ...@@ -42,7 +34,7 @@
@open="openFile" @open="openFile"
/> />
<avatar <avatar
v-if="avatar && !isSystemMessage" v-if="(avatar || showHostAvatar) && !isQuestionAnswerMessage && !isWithdrawMessage"
:src=" :src="
chatRole === 'default' chatRole === 'default'
? avatar ? avatar
...@@ -145,7 +137,7 @@ ...@@ -145,7 +137,7 @@
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";
import SystemMessage from "./message-item/system-message.vue"; import QuestionAnswerMessage from "./message-item/question-answer-message.vue";
import xim from "./../xim"; import xim from "./../xim";
import { ChatRole } from "@/customer-service/model"; import { ChatRole } from "@/customer-service/model";
...@@ -161,7 +153,7 @@ ...@@ -161,7 +153,7 @@
[dto.MessageType.GeneralOrderMsg, "text-message"], [dto.MessageType.GeneralOrderMsg, "text-message"],
[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.System, "system-message"], [dto.MessageType.QuestionAnswer, "question-answer-message"],
]); ]);
@Component({ @Component({
...@@ -176,7 +168,7 @@ ...@@ -176,7 +168,7 @@
WithdrawMessage, WithdrawMessage,
PurchasePlanMessage, PurchasePlanMessage,
MyWelfareMessage, MyWelfareMessage,
SystemMessage, QuestionAnswerMessage,
}, },
}) })
export default class Message extends Vue { export default class Message extends Vue {
...@@ -235,8 +227,8 @@ ...@@ -235,8 +227,8 @@
return this.data.type === dto.MessageType.Withdraw; return this.data.type === dto.MessageType.Withdraw;
} }
private get isSystemMessage() { private get isQuestionAnswerMessage() {
return this.data.type === dto.MessageType.System; return this.data.type === dto.MessageType.QuestionAnswer;
} }
private get isAllRead() { private get isAllRead() {
...@@ -300,7 +292,6 @@ ...@@ -300,7 +292,6 @@
this.showHostAvatar = false; this.showHostAvatar = false;
} }
if (this.isSendingMessage) { if (this.isSendingMessage) {
if (avatar && this.chatMyId) { if (avatar && this.chatMyId) {
const user = avatar[this.chatMyId]; const user = avatar[this.chatMyId];
if (user && user.avatar) { if (user && user.avatar) {
...@@ -475,7 +466,7 @@ ...@@ -475,7 +466,7 @@
word-break: break-all; word-break: break-all;
} }
} }
&.system-message { &.question-answer-message {
flex-direction: row; flex-direction: row;
.msg-content { .msg-content {
text-align: left; text-align: left;
......
...@@ -100,7 +100,7 @@ export const enum MessageType { ...@@ -100,7 +100,7 @@ export const enum MessageType {
Withdraw = "withdraw", Withdraw = "withdraw",
MyPurchasePlan = "my_purchase_plan", MyPurchasePlan = "my_purchase_plan",
MyWelfare = "my_welfare", MyWelfare = "my_welfare",
System ="system" QuestionAnswer ="question_answer"
} }
export const enum MessageHandled { export const enum MessageHandled {
......
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