fix: 修复购物车订单计算报错问题
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
BackendCoupon,
|
||||
ActivityConfig,
|
||||
OrderExtraConfig, MerchantReductionConfig, MerchantReductionType,
|
||||
GoodsType,
|
||||
GoodsType, FullReductionActivity
|
||||
} from "@/utils/goods";
|
||||
|
||||
const shopUser = useUserStoreHook();
|
||||
@@ -217,7 +217,7 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
})
|
||||
//使用积分数量
|
||||
const userPoints = ref(0);
|
||||
const testFullReductionActivity = {
|
||||
const testFullReductionActivity: FullReductionActivity = {
|
||||
"id": 231,
|
||||
"shopId": 26,
|
||||
"status": 2, // 2=进行中
|
||||
@@ -229,8 +229,8 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
"useType": "dine,pickup,deliv,express", // 支持所有就餐类型
|
||||
"useDays": "周一,周二,周三,周四,周五,周六,周日", // 全周期
|
||||
"useTimeType": "all", // 全时段
|
||||
"useStartTime": null,
|
||||
"useEndTime": null,
|
||||
"useStartTime": '',
|
||||
"useEndTime": '',
|
||||
"couponShare": 0, // 与优惠券不同享
|
||||
"discountShare": 0, // 与限时折扣不同享
|
||||
"vipPriceShare": 0, // 与会员价不同享
|
||||
@@ -242,7 +242,7 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
"discountAmount": 10 // 减10元
|
||||
}
|
||||
],
|
||||
"isDel": false
|
||||
"isDel": false,
|
||||
};
|
||||
// 订单额外配置(现在依赖响应式的 merchantReduction)
|
||||
const orderExtraConfig = computed<OrderExtraConfig>(() => ({
|
||||
@@ -255,7 +255,9 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
userPoints: userPoints.value,
|
||||
isMember: useVipPrice.value,
|
||||
memberDiscountRate: shopUser.userInfo.memberDiscountRate || 1,
|
||||
fullReductionActivities: [testFullReductionActivity]
|
||||
fullReductionActivities: [testFullReductionActivity],
|
||||
currentDinnerType: dinnerType.value
|
||||
|
||||
}));
|
||||
|
||||
// 营销活动列表
|
||||
@@ -304,6 +306,7 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
const orderCostSummary = computed(() => {
|
||||
allGoods.value = getAllGoodsList();
|
||||
console.log(' allGoods.value', allGoods.value);
|
||||
console.log(' orderExtraConfig.value', orderExtraConfig.value);
|
||||
const costSummary = OrderPriceCalculator.calculateOrderCostSummary(
|
||||
allGoods.value,
|
||||
dinnerType.value,
|
||||
|
||||
Reference in New Issue
Block a user