fix(shop): 修复多规格SKU图片删除问题
- 修正删除SKU图片时错误操作,防止误删主商品图片数组 - 删除时清空对应SKU行的图片数组与主图字段 - 优化运费模板标签,明确必填状态提示 - 添加会员价字段buyingPrice,更新相关TS接口及数据库结构说明
This commit is contained in:
@@ -59,3 +59,8 @@
|
|||||||
2. **mp-java** `entity/ShopGoodsSku.java`:同上(shop 模块两端同步)
|
2. **mp-java** `entity/ShopGoodsSku.java`:同上(shop 模块两端同步)
|
||||||
3. **前端 TS 接口** `api/shop/shopGoodsSku/model/index.ts`:加 `buyingPrice?: string;`
|
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;`
|
- **需手动执行 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 = ''`
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
v-model:value="form.buyingPrice"
|
v-model:value="form.buyingPrice"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label="form.canExpress === 1 ? '运费模板' : '运费模板'" v-if="!merchantId" :required="form.canExpress === 1">
|
<a-form-item :label="form.canExpress === 1 ? '运费模板(必填)' : '运费模板'" v-if="!merchantId" :required="form.canExpress === 1">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="form.expressTemplateId"
|
v-model:value="form.expressTemplateId"
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
@@ -1518,7 +1518,8 @@ const chooseSkuImage = (data: FileRecord) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onDeleteSkuItem = (index: number) => {
|
const onDeleteSkuItem = (index: number) => {
|
||||||
images.value.splice(index, 1);
|
skuList.value[index].images = [];
|
||||||
|
skuList.value[index].image = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const videos = ref<ItemType[]>([]);
|
const videos = ref<ItemType[]>([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user