fix: lints

This commit is contained in:
xingyu4j
2025-11-02 12:32:36 +08:00
parent 2d51c652b2
commit c1777ffda0
9 changed files with 102 additions and 89 deletions

View File

@@ -1,4 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
defineOptions({ name: 'CardTitle' });
// TODO @jawe from xingyuhttps://gitee.com/yudaocode/yudao-ui-admin-vben/pulls/243/files#diff_note_47350213这个组件没有必要直接用antdv card 的slot去做就行了只有这一个地方用没有必要单独写一个组件 // TODO @jawe from xingyuhttps://gitee.com/yudaocode/yudao-ui-admin-vben/pulls/243/files#diff_note_47350213这个组件没有必要直接用antdv card 的slot去做就行了只有这一个地方用没有必要单独写一个组件
defineProps({ defineProps({
title: { title: {
@@ -6,10 +8,6 @@ defineProps({
required: true, required: true,
}, },
}); });
defineComponent({
name: 'CardTitle',
});
</script> </script>
<template> <template>

View File

@@ -3,12 +3,16 @@ import type { MallKefuConversationApi } from '#/api/mall/promotion/kefu/conversa
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { confirm } from '@vben/common-ui';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { formatPast, jsonParse } from '@vben/utils'; import { formatPast, jsonParse } from '@vben/utils';
import { Avatar, Badge, message } from 'ant-design-vue'; import { Avatar, Badge, Layout, message } from 'ant-design-vue';
import * as KeFuConversationApi from '#/api/mall/promotion/kefu/conversation'; import {
deleteConversation,
updateConversationPinned,
} from '#/api/mall/promotion/kefu/conversation';
import { useMallKefuStore } from '#/store/mall/kefu'; import { useMallKefuStore } from '#/store/mall/kefu';
import { KeFuMessageContentTypeEnum } from './tools/constants'; import { KeFuMessageContentTypeEnum } from './tools/constants';
@@ -108,27 +112,29 @@ function closeRightMenu() {
} }
/** 置顶会话 */ /** 置顶会话 */
async function updateConversationPinned(adminPinned: boolean) { async function updateConversationPinnedFn(pinned: boolean) {
// 1. 会话置顶/取消置顶 // 1. 会话置顶/取消置顶
await KeFuConversationApi.updateConversationPinned({ await updateConversationPinned({
id: rightClickConversation.value.id, id: rightClickConversation.value.id,
adminPinned, pinned,
}); });
message.success(adminPinned ? '置顶成功' : '取消置顶成功'); message.success(pinned ? '置顶成功' : '取消置顶成功');
// 2. 关闭右键菜单,更新会话列表 // 2. 关闭右键菜单,更新会话列表
closeRightMenu(); closeRightMenu();
await kefuStore.updateConversation(rightClickConversation.value.id); await kefuStore.updateConversation(rightClickConversation.value.id);
} }
/** 删除会话 */ /** 删除会话 */
async function deleteConversation() { async function deleteConversationFn() {
// 1. 删除会话 // 1. 删除会话
// TODO @jave使用全局的 confirm这样 ele 和 antd 可以相对复用; confirm({
await message.confirm('您确定要删除该会话吗?'); content: '您确定要删除该会话吗?',
await KeFuConversationApi.deleteConversation(rightClickConversation.value.id); }).then(async () => {
// 2. 关闭右键菜单,更新会话列表 await deleteConversation(rightClickConversation.value.id);
closeRightMenu(); // 2. 关闭右键菜单,更新会话列表
kefuStore.deleteConversation(rightClickConversation.value.id); closeRightMenu();
kefuStore.deleteConversation(rightClickConversation.value.id);
});
} }
/** 监听右键菜单的显示状态,添加点击事件监听器 */ /** 监听右键菜单的显示状态,添加点击事件监听器 */
@@ -154,7 +160,7 @@ onBeforeUnmount(() => {
</script> </script>
<template> <template>
<a-layout-sider class="kefu h-full pt-[5px]" width="260px"> <Layout.Sider class="kefu h-full pt-[5px]" width="260px">
<div class="color-[#999] my-[10px] font-bold"> <div class="color-[#999] my-[10px] font-bold">
会话记录({{ kefuStore.getConversationList.length }}) 会话记录({{ kefuStore.getConversationList.length }})
</div> </div>
@@ -206,7 +212,7 @@ onBeforeUnmount(() => {
<li <li
v-show="!rightClickConversation.adminPinned" v-show="!rightClickConversation.adminPinned"
class="flex items-center" class="flex items-center"
@click.stop="updateConversationPinned(true)" @click.stop="updateConversationPinnedFn(true)"
> >
<IconifyIcon class="mr-[5px]" icon="ep:top" /> <IconifyIcon class="mr-[5px]" icon="ep:top" />
置顶会话 置顶会话
@@ -214,12 +220,12 @@ onBeforeUnmount(() => {
<li <li
v-show="rightClickConversation.adminPinned" v-show="rightClickConversation.adminPinned"
class="flex items-center" class="flex items-center"
@click.stop="updateConversationPinned(false)" @click.stop="updateConversationPinnedFn(false)"
> >
<IconifyIcon class="mr-[5px]" icon="ep:bottom" /> <IconifyIcon class="mr-[5px]" icon="ep:bottom" />
取消置顶 取消置顶
</li> </li>
<li class="flex items-center" @click.stop="deleteConversation"> <li class="flex items-center" @click.stop="deleteConversationFn">
<IconifyIcon class="mr-[5px]" color="red" icon="ep:delete" /> <IconifyIcon class="mr-[5px]" color="red" icon="ep:delete" />
删除会话 删除会话
</li> </li>
@@ -228,7 +234,7 @@ onBeforeUnmount(() => {
取消 取消
</li> </li>
</ul> </ul>
</a-layout-sider> </Layout.Sider>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -14,11 +14,22 @@ import { formatDate, isEmpty, jsonParse } from '@vben/utils';
import { vScroll } from '@vueuse/components'; import { vScroll } from '@vueuse/components';
import { useDebounceFn, useScroll } from '@vueuse/core'; import { useDebounceFn, useScroll } from '@vueuse/core';
import { Avatar, Empty, Image, notification } from 'ant-design-vue'; // 添加 Empty 组件导入 import {
Avatar,
Empty,
Image,
Layout,
notification,
Textarea,
} from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime'; import relativeTime from 'dayjs/plugin/relativeTime';
import * as KeFuMessageApi from '#/api/mall/promotion/kefu/message'; import {
getKeFuMessageList,
sendKeFuMessage,
updateKeFuMessageReadStatus,
} from '#/api/mall/promotion/kefu/message';
import { useMallKefuStore } from '#/store/mall/kefu'; import { useMallKefuStore } from '#/store/mall/kefu';
import MessageItem from './message/MessageItem.vue'; import MessageItem from './message/MessageItem.vue';
@@ -56,18 +67,18 @@ const getMessageContent = computed(
/** 获得消息列表 */ /** 获得消息列表 */
// TODO @javeidea 的 linter 报错,处理下; // TODO @javeidea 的 linter 报错,处理下;
async function getMessageList() { async function getMessageList() {
const res = await KeFuMessageApi.getKeFuMessageList(queryParams); const res: any = await getKeFuMessageList(queryParams as any);
if (isEmpty(res)) { if (isEmpty(res)) {
// 当返回的是空列表说明没有消息或者已经查询完了历史消息 // 当返回的是空列表说明没有消息或者已经查询完了历史消息
skipGetMessageList.value = true; skipGetMessageList.value = true;
return; return;
} }
queryParams.createTime = formatDate(res.at(-1).createTime) as any; queryParams.createTime = formatDate((res as any).at(-1).createTime) as any;
// 情况一:加载最新消息 // 情况一:加载最新消息
if (queryParams.createTime) { if (queryParams.createTime) {
// 情况二:加载历史消息 // 情况二:加载历史消息
for (const item of res) { for (const item of res as any) {
pushMessage(item); pushMessage(item);
} }
} else { } else {
@@ -184,7 +195,7 @@ async function handleSendMessage(event: any) {
/** 真正发送消息 【共用】*/ /** 真正发送消息 【共用】*/
async function sendMessage(msg: MallKefuMessageApi.MessageSend) { async function sendMessage(msg: MallKefuMessageApi.MessageSend) {
// 发送消息 // 发送消息
await KeFuMessageApi.sendKeFuMessage(msg); await sendKeFuMessage(msg);
message.value = ''; message.value = '';
// 加载消息列表 // 加载消息列表
await refreshMessageList(); await refreshMessageList();
@@ -211,7 +222,7 @@ async function scrollToBottom() {
// scrollbarRef.value!.setScrollTop(innerRef.value!.clientHeight) // scrollbarRef.value!.setScrollTop(innerRef.value!.clientHeight)
showNewMessageTip.value = false; showNewMessageTip.value = false;
// 2.2 消息已读 // 2.2 消息已读
await KeFuMessageApi.updateKeFuMessageReadStatus(conversation.value.id); await updateKeFuMessageReadStatus(conversation.value.id);
} }
/** 查看新消息 */ /** 查看新消息 */
@@ -268,11 +279,11 @@ function showTime(item: MallKefuMessageApi.Message, index: number) {
</script> </script>
<template> <template>
<a-layout v-if="showKeFuMessageList" class="kefu"> <Layout v-if="showKeFuMessageList()" class="kefu">
<a-layout-header class="kefu-header"> <Layout.Header class="kefu-header">
<div class="kefu-title">{{ conversation.userNickname }}</div> <div class="kefu-title">{{ conversation.userNickname }}</div>
</a-layout-header> </Layout.Header>
<a-layout-content class="kefu-content"> <Layout.Content class="kefu-content">
<div <div
ref="scrollbarRef" ref="scrollbarRef"
class="flex h-full overflow-y-auto" class="flex h-full overflow-y-auto"
@@ -396,8 +407,8 @@ function showTime(item: MallKefuMessageApi.Message, index: number) {
<span>有新消息</span> <span>有新消息</span>
<IconifyIcon class="ml-5px" icon="ep:bottom" /> <IconifyIcon class="ml-5px" icon="ep:bottom" />
</div> </div>
</a-layout-content> </Layout.Content>
<a-layout-footer class="kefu-footer"> <Layout.Footer class="kefu-footer">
<div class="chat-tools flex items-center"> <div class="chat-tools flex items-center">
<EmojiSelectPopover @select-emoji="handleEmojiSelect" /> <EmojiSelectPopover @select-emoji="handleEmojiSelect" />
<PictureSelectUpload <PictureSelectUpload
@@ -405,20 +416,20 @@ function showTime(item: MallKefuMessageApi.Message, index: number) {
@send-picture="handleSendPicture" @send-picture="handleSendPicture"
/> />
</div> </div>
<a-textarea <Textarea
v-model:value="message" v-model:value="message"
:rows="6" :rows="6"
placeholder="输入消息Enter发送Shift+Enter换行" placeholder="输入消息Enter发送Shift+Enter换行"
style="border-style: none" style="border-style: none"
@keyup.enter.prevent="handleSendMessage" @keyup.enter.prevent="handleSendMessage"
/> />
</a-layout-footer> </Layout.Footer>
</a-layout> </Layout>
<a-layout v-else class="kefu"> <Layout v-else class="kefu">
<a-layout-content> <Layout.Content>
<Empty description="请选择左侧的一个会话后开始" class="mt-[50px]" /> <Empty description="请选择左侧的一个会话后开始" class="mt-[50px]" />
</a-layout-content> </Layout.Content>
</a-layout> </Layout>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -1,6 +1,8 @@
<!-- 右侧信息会员信息 + 最近浏览 + 交易订单 --> <!-- 右侧信息会员信息 + 最近浏览 + 交易订单 -->
<script lang="ts" setup> <script lang="ts" setup>
import type { MallKefuConversationApi } from '#/api/mall/promotion/kefu/conversation'; import type { MallKefuConversationApi } from '#/api/mall/promotion/kefu/conversation';
import type { MemberUserApi } from '#/api/member/user';
import type { PayWalletApi } from '#/api/pay/wallet/balance';
import { computed, nextTick, ref } from 'vue'; import { computed, nextTick, ref } from 'vue';
@@ -9,11 +11,10 @@ import { isEmpty } from '@vben/utils';
// TODO @jawedebounce 是不是还是需要的哈;应该有 2 处需要;可以微信沟通哈; // TODO @jawedebounce 是不是还是需要的哈;应该有 2 处需要;可以微信沟通哈;
// import { debounce } from 'lodash-es' // import { debounce } from 'lodash-es'
import { useDebounceFn } from '@vueuse/core'; import { useDebounceFn } from '@vueuse/core';
import { Card, Empty, message } from 'ant-design-vue'; import { Card, Empty, Layout, message } from 'ant-design-vue';
import * as UserApi from '#/api/member/user'; import { getUser } from '#/api/member/user';
import * as WalletApi from '#/api/pay/wallet/balance'; import { getWallet } from '#/api/pay/wallet/balance';
import { CardTitle } from '#/components/card-title';
import AccountInfo from '#/views/member/user/detail/modules/account-info.vue'; import AccountInfo from '#/views/member/user/detail/modules/account-info.vue';
import BasicInfo from '#/views/member/user/detail/modules/basic-info.vue'; import BasicInfo from '#/views/member/user/detail/modules/basic-info.vue';
@@ -91,12 +92,12 @@ async function initHistory(val: MallKefuConversationApi.Conversation) {
defineExpose({ initHistory }); defineExpose({ initHistory });
/** 处理消息列表滚动事件(debounce 限流) */ /** 处理消息列表滚动事件(debounce 限流) */
const scrollbarRef = ref<InstanceType>(); const scrollbarRef = ref<InstanceType<any>>();
const handleScroll = useDebounceFn(() => { const handleScroll = useDebounceFn(async () => {
const wrap = scrollbarRef.value?.wrapRef; const wrap = scrollbarRef.value?.wrapRef;
// 触底重置 // 触底重置
if (Math.abs(wrap!.scrollHeight - wrap!.clientHeight - wrap!.scrollTop) < 1) { if (Math.abs(wrap!.scrollHeight - wrap!.clientHeight - wrap!.scrollTop) < 1) {
loadMore(); await loadMore();
} }
}, 200); }, 200);
@@ -106,8 +107,8 @@ const WALLET_INIT_DATA = {
balance: 0, balance: 0,
totalExpense: 0, totalExpense: 0,
totalRecharge: 0, totalRecharge: 0,
} as WalletApi.WalletVO; // 钱包初始化数据 } as PayWalletApi.Wallet; // 钱包初始化数据
const wallet = ref<WalletApi.WalletVO>(WALLET_INIT_DATA); // 钱包信息 const wallet = ref<PayWalletApi.Wallet>(WALLET_INIT_DATA); // 钱包信息
async function getUserWallet() { async function getUserWallet() {
if (!conversation.value.userId) { if (!conversation.value.userId) {
@@ -115,21 +116,21 @@ async function getUserWallet() {
return; return;
} }
wallet.value = wallet.value =
(await WalletApi.getWallet({ userId: conversation.value.userId })) || (await getWallet({ userId: conversation.value.userId })) ||
WALLET_INIT_DATA; WALLET_INIT_DATA;
} }
/** 获得用户 */ /** 获得用户 */
const loading = ref(true); // 加载中 const loading = ref(true); // 加载中
const user = ref<UserApi.UserVO>({} as UserApi.UserVO); const user = ref<MemberUserApi.User>({} as MemberUserApi.User);
async function getUserData() { async function getUserData() {
loading.value = true; loading.value = true;
try { try {
const res = await UserApi.getUser(conversation.value.userId); const res = await getUser(conversation.value.userId);
if (res) { if (res) {
user.value = res; user.value = res;
} else { } else {
user.value = {} as UserApi.UserVO; user.value = {} as MemberUserApi.User;
message.error('会员不存在!'); message.error('会员不存在!');
} }
} finally { } finally {
@@ -140,8 +141,8 @@ async function getUserData() {
<template> <template>
<!-- TODO @javefrom xingyua- 换成大写的方式另外组件没有进行导入其他页面也有这个问题 --> <!-- TODO @javefrom xingyua- 换成大写的方式另外组件没有进行导入其他页面也有这个问题 -->
<a-layout class="kefu"> <Layout class="kefu">
<a-layout-header class="kefu-header"> <Layout.Header class="kefu-header">
<div <div
:class="{ 'kefu-header-item-activation': tabActivation('会员信息') }" :class="{ 'kefu-header-item-activation': tabActivation('会员信息') }"
class="kefu-header-item flex cursor-pointer items-center justify-center" class="kefu-header-item flex cursor-pointer items-center justify-center"
@@ -163,13 +164,13 @@ async function getUserData() {
> >
交易订单 交易订单
</div> </div>
</a-layout-header> </Layout.Header>
<a-layout-content class="kefu-content p-10px!"> <Layout.Content class="kefu-content p-10px!">
<div v-if="!isEmpty(conversation)" v-loading="loading"> <div v-if="!isEmpty(conversation)" v-loading="loading">
<!-- 基本信息 --> <!-- 基本信息 -->
<BasicInfo v-if="activeTab === '会员信息'" :user="user" mode="kefu"> <BasicInfo v-if="activeTab === '会员信息'" :user="user" mode="kefu">
<template #header> <template #title>
<CardTitle title="基本信息" /> <span class="text-sm font-bold">基本信息</span>
</template> </template>
</BasicInfo> </BasicInfo>
<!-- 账户信息 --> <!-- 账户信息 -->
@@ -178,8 +179,8 @@ async function getUserData() {
class="mt-10px h-full" class="mt-10px h-full"
shadow="never" shadow="never"
> >
<template #header> <template #title>
<CardTitle title="账户信息" /> <span class="text-sm font-bold">账户信息</span>
</template> </template>
<AccountInfo :column="1" :user="user" :wallet="wallet" /> <AccountInfo :column="1" :user="user" :wallet="wallet" />
</Card> </Card>
@@ -203,8 +204,8 @@ async function getUserData() {
description="请选择左侧的一个会话后开始" description="请选择左侧的一个会话后开始"
class="mt-[50px]" class="mt-[50px]"
/> />
</a-layout-content> </Layout.Content>
</a-layout> </Layout>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -43,13 +43,9 @@ function openDetail(spuId: number) {
</script> </script>
<template> <template>
<div <div class="product-warp cursor-pointer" @click.stop="openDetail(spuId)">
class="product-warp"
style="cursor: pointer"
@click.stop="openDetail(spuId)"
>
<!-- 左侧商品图片--> <!-- 左侧商品图片-->
<div class="product-warp-left mr-[24px]"> <div class="product-warp-left mr-6">
<Image <Image
:initial-index="0" :initial-index="0"
:preview-src-list="[picUrl]" :preview-src-list="[picUrl]"
@@ -63,8 +59,8 @@ function openDetail(spuId: number) {
<!-- 右侧商品信息 --> <!-- 右侧商品信息 -->
<div class="product-warp-right"> <div class="product-warp-right">
<div class="description">{{ title }}</div> <div class="description">{{ title }}</div>
<div class="my-[5px]"> <div class="my-1">
<span class="mr-[20px]">库存: {{ stock || 0 }}</span> <span class="mr-5">库存: {{ stock || 0 }}</span>
<span>销量: {{ salesCount || 0 }}</span> <span>销量: {{ salesCount || 0 }}</span>
</div> </div>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">

View File

@@ -6,16 +6,15 @@ import { computed } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { List } from 'ant-design-vue'; import { List, Popover } from 'ant-design-vue';
import { useEmoji } from './emoji'; import { useEmoji } from './emoji';
defineOptions({ name: 'EmojiSelectPopover' }); defineOptions({ name: 'EmojiSelectPopover' });
/** 选择 emoji 表情 */ /** 选择 emoji 表情 */
// TODO @jawe这里有 linter 告警,看看要不要处理下;
const emits = defineEmits<{ const emits = defineEmits<{
(e: 'selectEmoji', v: Emoji); (e: 'selectEmoji', v: Emoji): void;
}>(); }>();
const { getEmojiList } = useEmoji(); const { getEmojiList } = useEmoji();
const emojiList = computed(() => getEmojiList()); const emojiList = computed(() => getEmojiList());
@@ -27,7 +26,7 @@ function handleSelect(item: Emoji) {
</script> </script>
<template> <template>
<a-popover :width="500" placement="top" trigger="click"> <Popover :width="500" placement="top" trigger="click">
<template #content> <template #content>
<List height="300px"> <List height="300px">
<ul class="ml-2 flex flex-wrap px-2"> <ul class="ml-2 flex flex-wrap px-2">
@@ -42,15 +41,15 @@ function handleSelect(item: Emoji) {
class="icon-item w-1/10 mr-2 mt-1 flex cursor-pointer items-center justify-center border border-solid p-2" class="icon-item w-1/10 mr-2 mt-1 flex cursor-pointer items-center justify-center border border-solid p-2"
@click="handleSelect(item)" @click="handleSelect(item)"
> >
<img :src="item.url" class="h-[24px] w-[24px]" /> <img :src="item.url" class="h-6 w-6" />
</li> </li>
</ul> </ul>
</List> </List>
</template> </template>
<IconifyIcon <IconifyIcon
:size="30" :size="30"
class="ml-[10px] cursor-pointer" class="ml-2.5 cursor-pointer"
icon="twemoji:grinning-face" icon="twemoji:grinning-face"
/> />
</a-popover> </Popover>
</template> </template>

View File

@@ -2,7 +2,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import * as FileApi from '#/api/infra/file'; import { uploadFile } from '#/api/infra/file';
import Picture from '#/views/mall/promotion/kefu/asserts/picture.svg'; import Picture from '#/views/mall/promotion/kefu/asserts/picture.svg';
defineOptions({ name: 'PictureSelectUpload' }); defineOptions({ name: 'PictureSelectUpload' });
@@ -17,7 +17,7 @@ async function selectAndUpload() {
message.success('图片发送中请稍等。。。'); message.success('图片发送中请稍等。。。');
// TODO @jawe直接使用 updateFile不通过 FileApi。vben 这里的规范; // TODO @jawe直接使用 updateFile不通过 FileApi。vben 这里的规范;
// TODO @jawe这里的上传看看能不能替换成 export function useUpload(directory?: string) {;它支持前端直传,更统一; // TODO @jawe这里的上传看看能不能替换成 export function useUpload(directory?: string) {;它支持前端直传,更统一;
const res = await FileApi.updateFile({ file: files[0].file }); const res = await uploadFile({ file: files[0].file });
emits('sendPicture', res.data); emits('sendPicture', res.data);
} }

View File

@@ -65,7 +65,7 @@ export const useEmoji = () => {
const initStaticEmoji = async () => { const initStaticEmoji = async () => {
const pathList = import.meta.glob('../../asserts/*.{png,jpg,jpeg,svg}'); const pathList = import.meta.glob('../../asserts/*.{png,jpg,jpeg,svg}');
for (const path in pathList) { for (const path in pathList) {
const imageModule: any = await pathList[path](); const imageModule: any = await pathList[path]?.();
emojiPathList.value.push({ path, src: imageModule.default }); emojiPathList.value.push({ path, src: imageModule.default });
} }
}; };

View File

@@ -1,11 +1,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { MallKefuConversationApi } from '#/api/mall/promotion/kefu/conversation';
import { defineOptions, onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { defineOptions, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { Page } from '@vben/common-ui'; import { Page } from '@vben/common-ui';
import { useAccessStore } from '@vben/stores'; import { useAccessStore } from '@vben/stores';
import { useWebSocket } from '@vueuse/core'; import { useWebSocket } from '@vueuse/core';
import { message } from 'ant-design-vue'; import { Layout, message } from 'ant-design-vue';
import { useMallKefuStore } from '#/store/mall/kefu'; import { useMallKefuStore } from '#/store/mall/kefu';
@@ -81,10 +83,10 @@ watch(
const keFuChatBoxRef = ref<InstanceType<typeof KeFuMessageList>>(); const keFuChatBoxRef = ref<InstanceType<typeof KeFuMessageList>>();
const memberInfoRef = ref<InstanceType<typeof MemberInfo>>(); const memberInfoRef = ref<InstanceType<typeof MemberInfo>>();
// TODO @jawe这里没导入 // TODO @jawe这里没导入
const handleChange = (conversation: KeFuConversationRespVO) => { function handleChange(conversation: MallKefuConversationApi.Conversation) {
keFuChatBoxRef.value?.getNewMessageList(conversation); keFuChatBoxRef.value?.getNewMessageList(conversation as any);
memberInfoRef.value?.initHistory(conversation); memberInfoRef.value?.initHistory(conversation);
}; }
const keFuConversationRef = ref<InstanceType<typeof KeFuConversationList>>(); const keFuConversationRef = ref<InstanceType<typeof KeFuConversationList>>();
/** 初始化 */ /** 初始化 */
@@ -107,14 +109,14 @@ onBeforeUnmount(() => {
<template> <template>
<Page> <Page>
<!-- TODO @jawestyle 使用 tailwindcssAI 友好 --> <!-- TODO @jawestyle 使用 tailwindcssAI 友好 -->
<a-layout-content class="kefu-layout hrow"> <Layout.Content class="kefu-layout hrow">
<!-- 会话列表 --> <!-- 会话列表 -->
<KeFuConversationList ref="keFuConversationRef" @change="handleChange" /> <KeFuConversationList ref="keFuConversationRef" @change="handleChange" />
<!-- 会话详情选中会话的消息列表 --> <!-- 会话详情选中会话的消息列表 -->
<KeFuMessageList ref="keFuChatBoxRef" /> <KeFuMessageList ref="keFuChatBoxRef" />
<!-- 会员信息选中会话的会员信息 --> <!-- 会员信息选中会话的会员信息 -->
<MemberInfo ref="memberInfoRef" /> <MemberInfo ref="memberInfoRef" />
</a-layout-content> </Layout.Content>
</Page> </Page>
</template> </template>