From 45f516eaceb89f08151b45f6aca575f16bd485aa Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Sat, 15 Mar 2025 11:34:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=A3=E5=AE=A2?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=B6=E6=94=B6=E5=88=B0=E6=B6=88=E6=81=AF=E6=9C=AA=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/carts.ts | 26 ++++++------------- .../tool/Instead/components/goods-item.vue | 2 +- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/store/modules/carts.ts b/src/store/modules/carts.ts index de445eb..5350fd2 100644 --- a/src/store/modules/carts.ts +++ b/src/store/modules/carts.ts @@ -604,25 +604,15 @@ export const useCartsStore = defineStore("carts", () => { } if (msg.operate_type === "manage_del") { const cartId = Array.isArray(msg.data) ? msg.data[0].id : msg.data.id - if (!isSelGift.value) { - const index = list.value.findIndex((item) => item.id == cartId) - if (index > -1) { - list.value.splice(index, 1) - if (list.value.length >= 1) { - selListIndex.value = index - 1; - } - return ElMessage.success(msg.message || '删除成功') - } - } else { - const index = giftList.value.findIndex((item) => item.id == cartId) - if (index > -1) { - giftList.value.splice(index, 1) - if (giftList.value.length >= 1) { - selListIndex.value = index - 1; - } - return ElMessage.success(msg.message || '删除成功') - } + const listIndex = list.value.findIndex((item) => item.id == cartId) + if (listIndex > -1) { + list.value.splice(listIndex, 1) } + const giftIndex = giftList.value.findIndex((item) => item.id == cartId) + if (giftIndex > -1) { + giftList.value.splice(giftIndex, 1) + } + return ElMessage.success(msg.message || '删除成功') } if (msg.operate_type === "manage_cleanup") { nowCartsClear() diff --git a/src/views/tool/Instead/components/goods-item.vue b/src/views/tool/Instead/components/goods-item.vue index d1b04df..e146483 100644 --- a/src/views/tool/Instead/components/goods-item.vue +++ b/src/views/tool/Instead/components/goods-item.vue @@ -4,7 +4,7 @@
称重 - {{ item.name }} + {{ item.name }}
¥{{ item.lowPrice }}