fix: 修复选择券死循环问题,修复赠菜nan问题
This commit is contained in:
@@ -275,6 +275,7 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
// 订单费用汇总(调用内部的 getAllGoodsList)
|
||||
const orderCostSummary = computed(() => {
|
||||
allGoods.value = getAllGoodsList();
|
||||
console.log(' allGoods.value', allGoods.value);
|
||||
const costSummary = OrderPriceCalculator.calculateOrderCostSummary(
|
||||
allGoods.value,
|
||||
dinnerType.value,
|
||||
@@ -284,6 +285,8 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
cartOrder.value,
|
||||
new Date()
|
||||
);
|
||||
console.log('costSummary', costSummary);
|
||||
|
||||
return costSummary;
|
||||
});
|
||||
|
||||
@@ -671,10 +674,14 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
}
|
||||
|
||||
if (msg.operate_type === "manage_edit") {
|
||||
const newCart = msg.data;
|
||||
const skuData = getProductDetails({ product_id: msg.data.product_id, sku_id: msg.data.sku_id });
|
||||
console.log('skuData,', skuData);
|
||||
const newCart = { ...skuData, ...msg.data };
|
||||
|
||||
const listIndex = list.value.findIndex(item => item.id === newCart.id);
|
||||
const giftIndex = giftList.value.findIndex(item => item.id === newCart.id);
|
||||
|
||||
|
||||
if (giftIndex > -1) {
|
||||
if (!newCart.is_gift) {
|
||||
giftList.value.splice(giftIndex, 1);
|
||||
|
||||
Reference in New Issue
Block a user