From c85b1351e38eea9f8529b0c8261751735c526c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 11 Aug 2026 11:44:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(shop):=20=E4=BF=AE=E5=A4=8D=E5=A4=9A?= =?UTF-8?q?=E8=A7=84=E6=A0=BCSKU=E5=9B=BE=E7=89=87=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正删除SKU图片时错误操作,防止误删主商品图片数组 - 删除时清空对应SKU行的图片数组与主图字段 - 优化运费模板标签,明确必填状态提示 - 添加会员价字段buyingPrice,更新相关TS接口及数据库结构说明 --- .workbuddy/memory/2026-08-11.md | 5 +++++ src/views/shop/shopGoods/components/shopGoodsEdit.vue | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.workbuddy/memory/2026-08-11.md b/.workbuddy/memory/2026-08-11.md index 6ef4e90..4a69f7f 100644 --- a/.workbuddy/memory/2026-08-11.md +++ b/.workbuddy/memory/2026-08-11.md @@ -59,3 +59,8 @@ 2. **mp-java** `entity/ShopGoodsSku.java`:同上(shop 模块两端同步) 3. **前端 TS 接口** `api/shop/shopGoodsSku/model/index.ts`:加 `buyingPrice?: string;` - **需手动执行 SQL**:`ALTER TABLE shop_goods_sku ADD COLUMN buying_price DECIMAL(10,2) DEFAULT NULL COMMENT '会员价' AFTER cost;` + +## 修复:多规格SKU图片删不掉 +- 文件:`src/views/shop/shopGoods/components/shopGoodsEdit.vue` +- 问题:`onDeleteSkuItem(index)` 误删 `images.value`(主商品图片数组),而非 `skuList.value[index].images`(对应SKU行图片)→ 点击 × 无反应 +- 修复:改为清空 `skuList.value[index].images = []` + `image = ''` diff --git a/src/views/shop/shopGoods/components/shopGoodsEdit.vue b/src/views/shop/shopGoods/components/shopGoodsEdit.vue index 01c2780..5861449 100644 --- a/src/views/shop/shopGoods/components/shopGoodsEdit.vue +++ b/src/views/shop/shopGoods/components/shopGoodsEdit.vue @@ -106,7 +106,7 @@ v-model:value="form.buyingPrice" /> - + { }; const onDeleteSkuItem = (index: number) => { - images.value.splice(index, 1); + skuList.value[index].images = []; + skuList.value[index].image = ''; }; const videos = ref([]);