From c355194aba68c991fd69a32431a4e8f97d1ec887 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=94=B0=E9=A6=99=E7=90=AA?= <624506849@qq.com>
Date: Thu, 9 Jul 2026 17:58:01 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81?=
=?UTF-8?q?=E8=AF=A6=E6=83=85=E4=B8=8E=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=20-=20=E6=9B=B4=E6=96=B0=20ShowGoods.vue=20=E5=92=8C?=
=?UTF-8?q?=20ShowGoodsDetail.vue=20=E4=B8=AD=E7=9A=84=E6=8C=89=E9=92=AE?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8?=
=?UTF-8?q?=20goods-action-btn=20=E7=B1=BB=E3=80=82=20-=20=E5=9C=A8=20Cart?=
=?UTF-8?q?.vue=20=E4=B8=AD=E5=AE=9E=E7=8E=B0=E5=95=86=E5=93=81=E6=94=B6?=
=?UTF-8?q?=E8=97=8F=E7=8A=B6=E6=80=81=E7=9A=84=E5=90=8C=E6=AD=A5=E4=B8=8E?=
=?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E4=BC=98=E5=8C=96=E6=94=B6=E8=97=8F?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=9A=84=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C?=
=?UTF-8?q?=E3=80=82=20-=20=E8=B0=83=E6=95=B4=20GoodsDetail.vue=20?=
=?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=BA=97=E9=93=BA=E6=94=B6=E8=97=8F=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E6=A0=B7=E5=BC=8F=EF=BC=8C=E6=8F=90=E5=8D=87=E8=A7=86?=
=?UTF-8?q?=E8=A7=89=E4=B8=80=E8=87=B4=E6=80=A7=E3=80=82=20-=20=E5=9C=A8?=
=?UTF-8?q?=E5=A4=9A=E4=B8=AA=E8=AF=84=E4=BB=B7=E7=BB=84=E4=BB=B6=E4=B8=AD?=
=?UTF-8?q?=E5=BC=95=E5=85=A5=E4=B8=BB=E9=A2=98=E8=89=B2=EF=BC=8C=E5=A2=9E?=
=?UTF-8?q?=E5=BC=BA=E8=AF=84=E5=88=86=E7=BB=84=E4=BB=B6=E7=9A=84=E8=A7=86?=
=?UTF-8?q?=E8=A7=89=E6=95=88=E6=9E=9C=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/components/goodsDetail/ShowGoods.vue | 28 ++++++-
.../goodsDetail/ShowGoodsDetail.vue | 16 +++-
buyer/src/pages/Cart.vue | 79 +++++++++++++++++--
buyer/src/pages/GoodsDetail.vue | 19 ++++-
.../home/memberCenter/evaluation/AddEval.vue | 17 +++-
.../memberCenter/evaluation/EvalDetail.vue | 18 +++--
buyer/src/pages/home/orderCenter/Complain.vue | 4 +
.../src/components/editor/upload-image.vue | 55 ++++++++++---
.../src/components/lili/upload-pic-input.vue | 1 +
.../src/views/goods/goods-manage/brand.vue | 17 ++--
.../shrinkable-menu/shrinkable-menu.vue | 4 +-
.../src/views/sys/oss-manage/ossManage.vue | 6 +-
.../shrinkable-menu/shrinkable-menu.vue | 4 +-
.../views/shop/hotzone/assets/styles/main.css | 4 +-
.../views/shop/hotzone/components/Zone.vue | 2 +
15 files changed, 222 insertions(+), 52 deletions(-)
diff --git a/buyer/src/components/goodsDetail/ShowGoods.vue b/buyer/src/components/goodsDetail/ShowGoods.vue
index 719d6ce5..74cc4f6c 100644
--- a/buyer/src/components/goodsDetail/ShowGoods.vue
+++ b/buyer/src/components/goodsDetail/ShowGoods.vue
@@ -278,7 +278,7 @@
加入购物车
*:last-child {
margin-right: 0;
}
+
+ .goods-action-btn {
+ background-color: #ff475d !important;
+ border-color: #ff475d !important;
+ color: #fff !important;
+
+ &:hover,
+ &:focus {
+ background-color: #e63e52 !important;
+ border-color: #e63e52 !important;
+ color: #fff !important;
+ }
+
+ &.is-disabled,
+ &.is-disabled:hover,
+ &.is-disabled:focus {
+ background-color: #ff475d !important;
+ border-color: #ff475d !important;
+ color: #fff !important;
+ opacity: 0.5;
+ }
+ }
}
.goodsConfig {
@@ -1003,7 +1025,7 @@ export default {
&.is-collected {
.collect-icon {
- color: #ffc107;
+ color: $theme_color;
}
}
}
diff --git a/buyer/src/components/goodsDetail/ShowGoodsDetail.vue b/buyer/src/components/goodsDetail/ShowGoodsDetail.vue
index 0e6c7cc4..0e325bb0 100644
--- a/buyer/src/components/goodsDetail/ShowGoodsDetail.vue
+++ b/buyer/src/components/goodsDetail/ShowGoodsDetail.vue
@@ -38,7 +38,13 @@
@@ -288,16 +289,69 @@ export default {
});
window.open(routeUrl.href, "_blank");
},
- // 收藏商品
- collectGoods(id) {
+ // 同步购物车商品收藏状态
+ async syncCartCollectionStatus() {
+ if (!this.Cookies.getItem("userInfo") || !this.cartList.length) return;
+ const skuIds = [];
+ this.cartList.forEach((shop) => {
+ (shop.skuList || []).forEach((goods) => {
+ goods.isCollected = false;
+ if (goods.goodsSku && goods.goodsSku.id) {
+ skuIds.push(goods.goodsSku.id);
+ }
+ });
+ });
+ const uniqueSkuIds = [...new Set(skuIds)];
+ await Promise.all(
+ uniqueSkuIds.map(async (skuId) => {
+ try {
+ const res = await APIMember.isCollection("GOODS", skuId);
+ if (res.success && res.result) {
+ this.cartList.forEach((shop) => {
+ (shop.skuList || []).forEach((goods) => {
+ if (goods.goodsSku && goods.goodsSku.id === skuId) {
+ goods.isCollected = true;
+ }
+ });
+ });
+ }
+ } catch (e) {
+ // 单个查询失败不影响其他商品
+ }
+ })
+ );
+ this.$forceUpdate();
+ },
+ // 收藏 / 取消收藏商品
+ handleCollect(goods) {
+ const skuId = goods.goodsSku && goods.goodsSku.id;
+ if (!skuId) return;
+ if (goods.isCollected) {
+ Modal.confirm({
+ title: "取消收藏",
+ content: "确定取消收藏该商品吗?",
+ onOk: () => {
+ return APIMember.cancelCollect("GOODS", skuId).then((res) => {
+ if (res.success) {
+ goods.isCollected = false;
+ Message.success("取消收藏成功");
+ this.$forceUpdate();
+ }
+ });
+ },
+ onCancel: () => {},
+ });
+ return;
+ }
Modal.confirm({
title: "收藏",
content: "商品收藏后可在个人中心我的收藏查看",
onOk: () => {
- APIMember.collectGoods("GOODS", id).then((res) => {
+ return APIMember.collectGoods("GOODS", skuId).then((res) => {
if (res.success) {
+ goods.isCollected = true;
Message.success("收藏商品成功");
- this.getCartList();
+ this.$forceUpdate();
}
});
},
@@ -425,6 +479,7 @@ export default {
}
this.$forceUpdate();
this.allChecked = allChecked;
+ this.syncCartCollectionStatus();
}
} catch (error) {
this.loading = false;
@@ -878,6 +933,18 @@ export default {
border-color: #e55a15 !important;
color: #fff !important;
}
+
+ &.is-collected {
+ background-color: $theme_color !important;
+ border-color: $theme_color !important;
+
+ &:hover,
+ &:focus {
+ background-color: $theme_color !important;
+ border-color: $theme_color !important;
+ opacity: 0.9;
+ }
+ }
}