Commit 960a9dc8 by zhousil

福利宝客服

parent a33fdcc0
<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 PurchasePlanMessage from "@/customer-service/components/message-item/purchase-plan-message.vue";
import Chat from "@/customer-service/xim/index";
@Component({ components: {} }) @Component({ components: {} })
export default class Index extends BaseMessage { export default class Index extends PurchasePlanMessage {
protected readonly emptyText = " "; protected openPlanUrl(e: any) {
if (Chat.isBackend()) {
return;
}
this.planTargetUrl = "/my-benefit-detail/";
window.open(
`${this.planTargetUrl}${e.target.attributes["plan-id"].value}`,
"_blank"
);
}
} }
</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 MyWelfareMessage from "@/customer-service/components/message-item/my-welfare-message.vue"; import BaseMessage from "./index";
import Chat from "@/customer-service/xim/index"; import Chat from "@/customer-service/xim/index";
@Component({ components: {} }) @Component({ components: {} })
export default class Index extends MyWelfareMessage { export default class Index extends BaseMessage {
mounted() { protected readonly emptyText = " ";
if (Chat.isBackend()) { protected planDom: HTMLElement | null = null;
this.backEndPlan(); protected planTargetUrl = "";
}
public mounted() {
this.planDom = this.$el?.querySelector(".plan-welfare-title");
this.listenPlan();
}
public beforeDestroy() {
this.planDom?.removeEventListener("click", this.openPlanUrl);
}
protected listenPlan() {
this.planDom?.addEventListener("click", this.openPlanUrl);
} }
private backEndPlan() { protected openPlanUrl(e: any) {
const productTitleDom = document.getElementsByClassName( if (Chat.isBackend()) {
"plan-welfare-title" this.planTargetUrl =
) as any; "/福利宝.福利宝管理端.采购管理/detail/w_plan/key/";
if (productTitleDom) { } else {
// 遍历注册点击事件 this.planTargetUrl = "/my-plan-walfare-detail/";
productTitleDom.forEach((item: HTMLElement) => { }
item.onclick = (e: any) => { window.open(
// 我的福利在后台没找到位置 `${this.planTargetUrl}${e.target.attributes["plan-id"].value}`,
if (e.target.attributes["data-type"].value === "plan") { "_blank"
window.open( );
`/福利宝.福利宝管理端.采购管理/detail/w_plan/key/${e.target.attributes["data-id"].value}`,
"_blank"
);
}
};
});
}
} }
} }
</script> </script>
......
...@@ -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,
}" }"
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
class="content-avatar d-flex align-items-start" class="content-avatar d-flex align-items-start"
:class="{ :class="{
'justify-content-end': isMyMessage, 'justify-content-end': isMyMessage,
'cs-flex-direction': chatRole !== 'default', 'cs-flex-direction': !isMyMessage,
}" }"
> >
<component <component
...@@ -33,11 +34,15 @@ ...@@ -33,11 +34,15 @@
@open="openFile" @open="openFile"
/> />
<avatar <avatar
v-if="(avatar || showHostAvatar) && !isQuestionAnswerMessage && !isWithdrawMessage" v-if="
(avatar || showHostAvatar) &&
!isQuestionAnswerMessage &&
!isWithdrawMessage
"
:src=" :src="
chatRole === 'default' chatRole === 'admin' || chatRole === 'customer-service'
? avatar ? require('../imgs/default-host-avatar.svg')
: require('../imgs/default-host-avatar.svg') : avatar
" "
shape="circle" shape="circle"
/> />
...@@ -314,6 +319,10 @@ ...@@ -314,6 +319,10 @@
const t = this.chatMembers.find((i) => i.eid === this.data.eid); const t = this.chatMembers.find((i) => i.eid === this.data.eid);
if (t?.type === ChatRole.Default) { if (t?.type === ChatRole.Default) {
return "default"; return "default";
} else if (t?.type === ChatRole.Admin) {
return "admin";
} else if (t?.type === ChatRole.CustomerService) {
return "customer-service";
} }
} }
return ""; return "";
......
...@@ -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",
QuestionAnswer ="question_answer" 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