From d641d7c493edd3705e8fad9c6476461e9bb1de8e Mon Sep 17 00:00:00 2001 From: mac Date: Mon, 8 Jun 2026 15:55:24 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B8=85=E7=90=86=E6=AD=BB=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=20CartBar/CartPopup=20=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=20cart.js=20=E4=B8=AD=20price=20=E5=86=97?= =?UTF-8?q?=E4=BD=99=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/CartBar.vue | 25 ------------------- components/CartPopup.vue | 63 ------------------------------------------------ stores/cart.js | 3 +-- 3 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 components/CartBar.vue delete mode 100644 components/CartPopup.vue diff --git a/components/CartBar.vue b/components/CartBar.vue deleted file mode 100644 index 4f95b05..0000000 --- a/components/CartBar.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/components/CartPopup.vue b/components/CartPopup.vue deleted file mode 100644 index d320f58..0000000 --- a/components/CartPopup.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - diff --git a/stores/cart.js b/stores/cart.js index 03cd68e..9c069c8 100644 --- a/stores/cart.js +++ b/stores/cart.js @@ -5,7 +5,6 @@ export const useCartStore = defineStore('cart', () => { const items = ref([]) const totalCount = computed(() => items.value.reduce((s, i) => s + i.qty, 0)) - const totalAmount = computed(() => items.value.reduce((s, i) => s + i.product.price * i.qty, 0)) function addItem(product, qty = 1) { const exist = items.value.find(i => i.product.id === product.id) @@ -32,5 +31,5 @@ export const useCartStore = defineStore('cart', () => { items.value = [] } - return { items, totalCount, totalAmount, addItem, removeItem, updateQty, clearCart } + return { items, totalCount, addItem, removeItem, updateQty, clearCart } })