This commit is contained in:
YeMingfei666 2025-03-26 13:46:28 +08:00
commit 33da9d8af0
1 changed files with 8 additions and 5 deletions

View File

@ -606,7 +606,7 @@ export const useCartsStore = defineStore("carts", () => {
v[key] = skuData[key]; v[key] = skuData[key];
}); });
} else { } else {
del({ id: v.id }) // del({ id: v.id })
return false return false
} }
return !v.is_gift return !v.is_gift
@ -636,10 +636,13 @@ export const useCartsStore = defineStore("carts", () => {
return ElMessage.warning(msg.message || '该商品已存在') return ElMessage.warning(msg.message || '该商品已存在')
} }
const skuData = getProductDetails({ product_id: msg.data.product_id, sku_id: msg.data.sku_id }) const skuData = getProductDetails({ product_id: msg.data.product_id, sku_id: msg.data.sku_id })
if (skuData) {
const newGoods = { ...skuData, ...msg.data } const newGoods = { ...skuData, ...msg.data }
console.log('newGoods', newGoods) console.log('newGoods', newGoods)
list.value.push(newGoods) list.value.push(newGoods)
return ElMessage.success(msg.message || '添加成功') return ElMessage.success(msg.message || '添加成功')
}
} }
if (msg.operate_type === "manage_edit") { if (msg.operate_type === "manage_edit") {