修复限时折扣会员价下单
This commit is contained in:
@@ -76,7 +76,7 @@ export const useCartsStore = defineStore("carts", () => {
|
|||||||
is_temporary: !!item.is_temporary,
|
is_temporary: !!item.is_temporary,
|
||||||
is_gift: !!item.is_gift,
|
is_gift: !!item.is_gift,
|
||||||
returnNum: item.returnNum || 0,
|
returnNum: item.returnNum || 0,
|
||||||
memberPrice: item.is_time_discount == 1 ? item.limitDiscountPrice : (item.memberPrice || 0),
|
memberPrice: item.memberPrice,
|
||||||
discountSaleAmount: item.discount_sale_amount || 0,
|
discountSaleAmount: item.discount_sale_amount || 0,
|
||||||
packFee: item.packFee || 0,
|
packFee: item.packFee || 0,
|
||||||
packNumber: item.pack_number || 0,
|
packNumber: item.pack_number || 0,
|
||||||
@@ -115,12 +115,16 @@ export const useCartsStore = defineStore("carts", () => {
|
|||||||
// ------------------------------ 2. Store 内部原有响应式变量 ------------------------------
|
// ------------------------------ 2. Store 内部原有响应式变量 ------------------------------
|
||||||
// 选择用户
|
// 选择用户
|
||||||
const vipUser = ref<{ id?: string | number, isVip?: boolean }>({});
|
const vipUser = ref<{ id?: string | number, isVip?: boolean }>({});
|
||||||
function changeUser(user: any) {
|
async function changeUser(user: any) {
|
||||||
vipUser.value = {
|
vipUser.value = {
|
||||||
...user,
|
...user,
|
||||||
isMemberPrice: shopUser.userInfo.isMemberPrice
|
isMemberPrice: shopUser.userInfo.isMemberPrice
|
||||||
};
|
};
|
||||||
getGoods({})
|
await getGoods({})
|
||||||
|
allGoods.value = getAllGoodsList()
|
||||||
|
|
||||||
|
console.log('选择用户后刷新所有订单购物车数据====', allGoods.value);
|
||||||
|
|
||||||
payParamsInit()
|
payParamsInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,12 +396,9 @@ export const useCartsStore = defineStore("carts", () => {
|
|||||||
coupons.value = cps;
|
coupons.value = cps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 优惠券列表
|
// 优惠券列表
|
||||||
const coupons = ref<BackendCoupon[]>([]);
|
const coupons = ref<BackendCoupon[]>([]);
|
||||||
|
|
||||||
|
|
||||||
// 商品加入购物车顺序
|
// 商品加入购物车顺序
|
||||||
const cartOrder = ref<Record<string, number>>({});
|
const cartOrder = ref<Record<string, number>>({});
|
||||||
let allGoods = ref<BaseCartItem[]>([]);
|
let allGoods = ref<BaseCartItem[]>([]);
|
||||||
@@ -420,7 +421,6 @@ export const useCartsStore = defineStore("carts", () => {
|
|||||||
return costSummary;
|
return costSummary;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// 赠菜总价(调用内部的 getAllGoodsList)
|
// 赠菜总价(调用内部的 getAllGoodsList)
|
||||||
const giftMoney = computed(() => {
|
const giftMoney = computed(() => {
|
||||||
const allGoods = getAllGoodsList();
|
const allGoods = getAllGoodsList();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
:src="item.coverImg + '?x-oss-process=image/resize,m_lfit,w_100,h_100'" fit="cover"></el-image>
|
:src="item.coverImg + '?x-oss-process=image/resize,m_lfit,w_100,h_100'" fit="cover"></el-image>
|
||||||
<div class="info" @click="itemClick">
|
<div class="info" @click="itemClick">
|
||||||
<div class="dot" v-if="item.isLimitDiscount">限时折扣</div>
|
<div class="dot" v-if="item.isLimitDiscount">限时折扣</div>
|
||||||
|
<div class="dot" v-if="cartStore.useVipPrice">会员价</div>
|
||||||
<div class="btm">
|
<div class="btm">
|
||||||
<div class="name u-flex u-flex-wrap">
|
<div class="name u-flex u-flex-wrap">
|
||||||
<span class="weight" v-if="item.type == 'weight'">称重</span>
|
<span class="weight" v-if="item.type == 'weight'">称重</span>
|
||||||
@@ -13,7 +14,15 @@
|
|||||||
<span class="o_price">¥{{ item.lowPrice }}</span>
|
<span class="o_price">¥{{ item.lowPrice }}</span>
|
||||||
<span class="sale_price">¥{{ item.limitDiscountPrice }}</span>
|
<span class="sale_price">¥{{ item.limitDiscountPrice }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>¥{{ item.lowPrice }}</div>
|
<div class="limit_wrap" v-else>
|
||||||
|
<template v-if="cartStore.useVipPrice">
|
||||||
|
<span class="o_price">¥{{ item.lowPrice }}</span>
|
||||||
|
<span>¥{{ item.lowMemberPrice }}</span>
|
||||||
|
</template>
|
||||||
|
<template>
|
||||||
|
¥{{ item.lowPrice }}
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="status" v-if="
|
<div class="status" v-if="
|
||||||
@@ -38,6 +47,10 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import { useCartsStore } from '@/store/modules/carts'
|
||||||
|
|
||||||
|
const cartStore = useCartsStore()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -526,6 +526,7 @@ function returnPayParams() {
|
|||||||
limitRate: carts.limitDiscountRes,
|
limitRate: carts.limitDiscountRes,
|
||||||
newCustomerDiscountId: newCustomerDiscount.value !== null ? newCustomerDiscount.value.id : '', // 新客立减Id
|
newCustomerDiscountId: newCustomerDiscount.value !== null ? newCustomerDiscount.value.id : '', // 新客立减Id
|
||||||
newCustomerDiscountAmount: newCustomerDiscount.value !== null ? newCustomerDiscount.value.amount : 0, // 新客立减金额
|
newCustomerDiscountAmount: newCustomerDiscount.value !== null ? newCustomerDiscount.value.amount : 0, // 新客立减金额
|
||||||
|
vipDiscountAmount: carts.orderCostSummary.vipDiscountAmount, // 超级会员折扣
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user