优化新客立减不生效的问题
This commit is contained in:
@@ -15,9 +15,9 @@
|
|||||||
<div class="t2">
|
<div class="t2">
|
||||||
<span>商品原价:¥{{ goodsStore.cartInfo.costSummary.goodsRealAmount || 0 }}</span>
|
<span>商品原价:¥{{ goodsStore.cartInfo.costSummary.goodsRealAmount || 0 }}</span>
|
||||||
<span>餐位费:¥{{ formatDecimal(goodsStore.cartInfo.costSummary.seatFee || 0)
|
<span>餐位费:¥{{ formatDecimal(goodsStore.cartInfo.costSummary.seatFee || 0)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span>打包费:¥{{ formatDecimal(goodsStore.cartInfo.costSummary.packFee || 0)
|
<span>打包费:¥{{ formatDecimal(goodsStore.cartInfo.costSummary.packFee || 0)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span>优惠:¥{{ formatDecimal(goodsStore.cartInfo.costSummary.totalDiscountAmount || 0) }}</span>
|
<span>优惠:¥{{ formatDecimal(goodsStore.cartInfo.costSummary.totalDiscountAmount || 0) }}</span>
|
||||||
<!-- <span v-if="goodsStore.cartInfo.costSummary.goodsDiscountAmount">
|
<!-- <span v-if="goodsStore.cartInfo.costSummary.goodsDiscountAmount">
|
||||||
<span>折扣:{{ goodsStore.cartInfo.costSummary.goodsDiscountAmount }}</span>
|
<span>折扣:{{ goodsStore.cartInfo.costSummary.goodsDiscountAmount }}</span>
|
||||||
@@ -123,8 +123,8 @@
|
|||||||
:total="Number(buyerTable.total)" v-model:current-page="buyerTable.page" @current-change="getBuyerList" />
|
:total="Number(buyerTable.total)" v-model:current-page="buyerTable.page" @current-change="getBuyerList" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="showCoupon"
|
<el-dialog v-model="showCoupon"
|
||||||
:title="`添加优惠(商品原价:¥${formatDecimal(goodsStore.cartInfo.costSummary.goodsRealAmount || 0)})`" top="5vh" width="80%"
|
:title="`添加优惠(商品原价:¥${formatDecimal(goodsStore.cartInfo.costSummary.goodsRealAmount || 0)})`" top="5vh"
|
||||||
@open="couponDialogOpen">
|
width="80%" @open="couponDialogOpen">
|
||||||
<div class="coupom_dialog">
|
<div class="coupom_dialog">
|
||||||
<el-form ref="couponFormRef" :model="couponForm" label-width="100" label-position="left">
|
<el-form ref="couponFormRef" :model="couponForm" label-width="100" label-position="left">
|
||||||
<el-form-item label="选择用户">
|
<el-form-item label="选择用户">
|
||||||
@@ -463,8 +463,8 @@ function upadatePayData() {
|
|||||||
userId: goodsStore.vipUserInfo.userId || '',
|
userId: goodsStore.vipUserInfo.userId || '',
|
||||||
allPack: goodsStore.allSelected,
|
allPack: goodsStore.allSelected,
|
||||||
limitRate: goodsStore.limitDiscountRes,
|
limitRate: goodsStore.limitDiscountRes,
|
||||||
newCustomerDiscountId: goodsStore.newCustomerDiscount !== null ? goodsStore.newCustomerDiscount.id : '', // 新客立减Id
|
newCustomerDiscountId: goodsStore.newUserDiscount !== null ? goodsStore.newUserDiscount.id : goodsStore.newUserDiscount !== null ? goodsStore.newUserDiscount.id : '', // 新客立减Id
|
||||||
newCustomerDiscountAmount: goodsStore.newCustomerDiscount !== null ? goodsStore.newCustomerDiscount.amount : 0, // 新客立减金额
|
newCustomerDiscountAmount: goodsStore.newUserDiscount !== null ? goodsStore.newUserDiscount.amount : 0, // 新客立减金额
|
||||||
vipDiscountAmount: goodsStore.cartInfo.costSummary.vipDiscountAmount, // 超级会员折扣
|
vipDiscountAmount: goodsStore.cartInfo.costSummary.vipDiscountAmount, // 超级会员折扣
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ export const useGoods = defineStore("goods", {
|
|||||||
cartOrderItem: "",
|
cartOrderItem: "",
|
||||||
pendingList: useStorage.get("pendingList") || [],
|
pendingList: useStorage.get("pendingList") || [],
|
||||||
fullReductionActivities: '', // 满减活动配置信息
|
fullReductionActivities: '', // 满减活动配置信息
|
||||||
limitDiscountRes: '', // 限时折扣
|
limitDiscountRes: null, // 限时折扣
|
||||||
newCustomerDiscount: '' // 新客立减
|
newUserDiscount: null // 新客立减
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
// 选择会员
|
// 选择会员
|
||||||
@@ -404,7 +404,7 @@ export const useGoods = defineStore("goods", {
|
|||||||
|
|
||||||
// 新客立减
|
// 新客立减
|
||||||
if (this.vipUserInfo.id) {
|
if (this.vipUserInfo.id) {
|
||||||
this.newCustomerDiscount = await getDiscountByUserId({
|
this.newUserDiscount = await getDiscountByUserId({
|
||||||
shopId: store.shopInfo.id,
|
shopId: store.shopInfo.id,
|
||||||
shopUserId: this.vipUserInfo.id,
|
shopUserId: this.vipUserInfo.id,
|
||||||
orderId: this.orderListInfo.id || ''
|
orderId: this.orderListInfo.id || ''
|
||||||
@@ -858,7 +858,7 @@ export const useGoods = defineStore("goods", {
|
|||||||
pointsPerYuan: 0, // 积分换算规律
|
pointsPerYuan: 0, // 积分换算规律
|
||||||
maxDeductionAmount: 0, // 最大抵扣
|
maxDeductionAmount: 0, // 最大抵扣
|
||||||
userPoints: 0, // 使用积分数量
|
userPoints: 0, // 使用积分数量
|
||||||
newUserDiscount: 0, // 新客立减
|
newUserDiscount: this.newUserDiscount, // 新客立减
|
||||||
fixedAmount: 0, // 商家减免
|
fixedAmount: 0, // 商家减免
|
||||||
backendCoupons: [], // 已选择的优惠券
|
backendCoupons: [], // 已选择的优惠券
|
||||||
};
|
};
|
||||||
@@ -929,8 +929,10 @@ export const useGoods = defineStore("goods", {
|
|||||||
fixedAmount: options.fixedAmount,
|
fixedAmount: options.fixedAmount,
|
||||||
});
|
});
|
||||||
|
|
||||||
//新客立减
|
|
||||||
const newUserDiscount = ref(options.newUserDiscount);
|
console.log('this.newUserDiscount', this.newUserDiscount);
|
||||||
|
|
||||||
|
|
||||||
// 订单额外配置
|
// 订单额外配置
|
||||||
const orderExtraConfig = computed(() => ({
|
const orderExtraConfig = computed(() => ({
|
||||||
// 引用扩展后的商家减免配置
|
// 引用扩展后的商家减免配置
|
||||||
@@ -946,7 +948,7 @@ export const useGoods = defineStore("goods", {
|
|||||||
currentDinnerType: dinnerType.value,
|
currentDinnerType: dinnerType.value,
|
||||||
limitTimeDiscount: this.limitDiscountRes,
|
limitTimeDiscount: this.limitDiscountRes,
|
||||||
shopUserInfo: this.vipUserInfo,
|
shopUserInfo: this.vipUserInfo,
|
||||||
newUserDiscount: newUserDiscount.value,
|
newUserDiscount: this.newUserDiscount !== null ? this.newUserDiscount.amount : '', //新客立减
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 营销活动列表
|
// 营销活动列表
|
||||||
|
|||||||
Reference in New Issue
Block a user