From e3c1676523b672f55deb7dbea82aa1bfa31bce4a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 15 Dec 2025 19:44:11 +0800 Subject: [PATCH] =?UTF-8?q?review=EF=BC=9A=E3=80=90antd/ele=E3=80=91?= =?UTF-8?q?=E3=80=90mall=E3=80=91=E5=95=86=E5=93=81=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/spu/components/spu-showcase.vue | 4 +-- .../src/views/mall/product/spu/form/index.vue | 1 + .../modules/product-property-add-form.vue | 1 - .../web-ele/src/api/mall/product/spu/index.ts | 7 ----- apps/web-ele/src/store/mall/kefu.ts | 28 +++++++++++++------ .../spu/components/sku-table-select.vue | 1 + .../spu/components/spu-and-sku-list.vue | 2 +- .../product/spu/components/spu-showcase.vue | 2 ++ .../src/views/mall/product/spu/form/index.vue | 3 +- .../modules/product-property-add-form.vue | 1 - .../mall/trade/delivery/pickUpOrder/data.ts | 4 ++- .../mall/trade/delivery/pickUpOrder/index.vue | 1 + 12 files changed, 32 insertions(+), 23 deletions(-) diff --git a/apps/web-antd/src/views/mall/product/spu/components/spu-showcase.vue b/apps/web-antd/src/views/mall/product/spu/components/spu-showcase.vue index 01dcab3ae..1c508cc7e 100644 --- a/apps/web-antd/src/views/mall/product/spu/components/spu-showcase.vue +++ b/apps/web-antd/src/views/mall/product/spu/components/spu-showcase.vue @@ -110,7 +110,7 @@ function emitSpuChange() { class="h-full w-full rounded-lg object-cover" /> - + - + diff --git a/apps/web-antd/src/views/mall/product/spu/form/index.vue b/apps/web-antd/src/views/mall/product/spu/form/index.vue index 7048776bb..c2f5e3061 100644 --- a/apps/web-antd/src/views/mall/product/spu/form/index.vue +++ b/apps/web-antd/src/views/mall/product/spu/form/index.vue @@ -32,6 +32,7 @@ const spuId = ref(); const { params, name } = useRoute(); const { closeCurrentTab } = useTabs(); const activeTabName = ref('info'); +// TODO @puhui999:这个要不要类似 ele 里,直接写到 html 里? const tabList = ref([ { key: 'info', diff --git a/apps/web-antd/src/views/mall/product/spu/form/modules/product-property-add-form.vue b/apps/web-antd/src/views/mall/product/spu/form/modules/product-property-add-form.vue index f6b4f0548..f34a8d194 100644 --- a/apps/web-antd/src/views/mall/product/spu/form/modules/product-property-add-form.vue +++ b/apps/web-antd/src/views/mall/product/spu/form/modules/product-property-add-form.vue @@ -130,7 +130,6 @@ const [Modal, modalApi] = useVbenModal({ await modalApi.close(); emit('success'); }, - async onOpenChange(isOpen: boolean) { if (!isOpen) { return; diff --git a/apps/web-ele/src/api/mall/product/spu/index.ts b/apps/web-ele/src/api/mall/product/spu/index.ts index 4b37151c6..0c9f4ce94 100644 --- a/apps/web-ele/src/api/mall/product/spu/index.ts +++ b/apps/web-ele/src/api/mall/product/spu/index.ts @@ -62,13 +62,6 @@ export namespace MallSpuApi { valueName?: string; // 属性值名称 } - // TODO @puhui999:这个还要么? - /** 优惠券模板 */ - export interface GiveCouponTemplate { - id?: number; // 优惠券编号 - name?: string; // 优惠券名称 - } - /** 商品状态更新请求 */ export interface SpuStatusUpdateReqVO { id: number; // 商品编号 diff --git a/apps/web-ele/src/store/mall/kefu.ts b/apps/web-ele/src/store/mall/kefu.ts index b9197d3e6..c30087375 100644 --- a/apps/web-ele/src/store/mall/kefu.ts +++ b/apps/web-ele/src/store/mall/kefu.ts @@ -5,7 +5,10 @@ import { isEmpty } from '@vben/utils'; import { acceptHMRUpdate, defineStore } from 'pinia'; -import * as KeFuConversationApi from '#/api/mall/promotion/kefu/conversation'; +import { + getConversation, + getConversationList, +} from '#/api/mall/promotion/kefu/conversation'; interface MallKefuInfoVO { conversationList: MallKefuConversationApi.Conversation[]; // 会话列表 @@ -41,9 +44,7 @@ export const useMallKefuStore = defineStore('mall-kefu', { // ======================= 会话相关 ======================= /** 加载会话缓存列表 */ async setConversationList() { - // TODO @jave:idea linter 告警,修复下; - // TODO @jave:不使用 KeFuConversationApi.,直接用 getConversationList - this.conversationList = await KeFuConversationApi.getConversationList(); + this.conversationList = await getConversationList(); this.conversationSort(); }, /** 更新会话缓存已读 */ @@ -51,8 +52,11 @@ export const useMallKefuStore = defineStore('mall-kefu', { if (isEmpty(this.conversationList)) { return; } - const conversation = this.conversationList.find( - (item) => item.id === conversationId, + const conversationList = this + .conversationList as MallKefuConversationApi.Conversation[]; + const conversation = conversationList.find( + (item: MallKefuConversationApi.Conversation) => + item.id === conversationId, ); conversation && (conversation.adminUnreadMessageCount = 0); }, @@ -62,10 +66,16 @@ export const useMallKefuStore = defineStore('mall-kefu', { return; } - const conversation = - await KeFuConversationApi.getConversation(conversationId); + const conversation = await getConversation(conversationId); this.deleteConversation(conversationId); - conversation && this.conversationList.push(conversation); + if (conversation && this.conversationList) { + const conversationList = this + .conversationList as MallKefuConversationApi.Conversation[]; + this.conversationList = [ + ...conversationList, + conversation as MallKefuConversationApi.Conversation, + ]; + } this.conversationSort(); }, /** 删除会话缓存 */ diff --git a/apps/web-ele/src/views/mall/product/spu/components/sku-table-select.vue b/apps/web-ele/src/views/mall/product/spu/components/sku-table-select.vue index efb3b0311..015345392 100644 --- a/apps/web-ele/src/views/mall/product/spu/components/sku-table-select.vue +++ b/apps/web-ele/src/views/mall/product/spu/components/sku-table-select.vue @@ -31,6 +31,7 @@ function handleRadioChange() { } } +// TODO @puhui999:这里的代码风格,对齐 antd 的;可以使用 idea 对比两个文件哈; const [Grid, gridApi] = useVbenVxeGrid({ gridOptions: { columns: useSkuGridColumns(), diff --git a/apps/web-ele/src/views/mall/product/spu/components/spu-and-sku-list.vue b/apps/web-ele/src/views/mall/product/spu/components/spu-and-sku-list.vue index edf1dd8cb..4f0369a3e 100644 --- a/apps/web-ele/src/views/mall/product/spu/components/spu-and-sku-list.vue +++ b/apps/web-ele/src/views/mall/product/spu/components/spu-and-sku-list.vue @@ -127,7 +127,7 @@ watch( - +