优化代课下单优惠券选择
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<span class="sale_price">¥{{ item.time_discount_price }}</span>
|
||||
</div>
|
||||
<div class="limit_wrap" v-else>
|
||||
<template v-if="cartStore.useVipPrice">
|
||||
<template v-if="cartStore.useVipPrice && item.lowPrice !== item.lowMemberPrice">
|
||||
<span class="o_price">¥{{ item.lowPrice }}</span>
|
||||
<span>¥{{ item.lowMemberPrice }}</span>
|
||||
</template>
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
<div class="order-box">
|
||||
<div class="left">
|
||||
<div class="user bg-fff u-p-20">
|
||||
<div class="userinfo" v-if="user.id" @click="chooseUser">
|
||||
<el-avatar class="avatar" :size="50" />
|
||||
<div class="userinfo" v-if="carts.vipUser.id" @click="chooseUser">
|
||||
<el-avatar :src="carts.vipUser.headImg" class="avatar" :size="50" />
|
||||
<div class="u-m-l-12">
|
||||
<p>
|
||||
<span class="name u-font-16">{{ user.nickName }}</span>
|
||||
<span class="vip" v-if="user.isVip">VIP{{ user.isVip }}</span>
|
||||
<span class="name u-font-16">{{ carts.vipUser.nickName }}</span>
|
||||
<span class="vip" v-if="carts.vipUser.isVip">VIP{{ carts.vipUser.memberLevelName }}</span>
|
||||
</p>
|
||||
<p class="u-font-14 color-666 u-m-t-10">
|
||||
<span class="money">余额:{{ user.amount }}</span>
|
||||
<span class="score u-m-l-10">积分:{{ user.accountPoints }}</span>
|
||||
<span class="money">余额:{{ carts.vipUser.amount }}</span>
|
||||
<span class="score u-m-l-10">积分:{{ carts.vipUser.accountPoints }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -27,7 +27,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="user.id">
|
||||
<template v-if="carts.vipUser.id">
|
||||
<div class="score">
|
||||
<div class="u-flex u-col-center u-m-t-10">
|
||||
<span class="u-font-14 font-bold u-m-r-20">积分抵扣</span>
|
||||
@@ -213,7 +213,7 @@
|
||||
<!-- 打折 -->
|
||||
<discount ref="refDiscount" @confirm="discountConfirm"></discount>
|
||||
<!-- 优惠券 -->
|
||||
<popup-coupon ref="refCoupon" :user="user" @confirm="refCouponConfirm"></popup-coupon>
|
||||
<popup-coupon ref="refCoupon" :user="carts.vipUser" @confirm="refCouponConfirm"></popup-coupon>
|
||||
<!-- 挂账 -->
|
||||
<chooseGuaZahng ref="refGuaZhang" :payMoney="currentpayMoney" @confirm="refGuaZhangConfirm"></chooseGuaZahng>
|
||||
</div>
|
||||
@@ -413,11 +413,11 @@ watch(
|
||||
);
|
||||
|
||||
async function pointsInit() {
|
||||
if (!props.user.id) {
|
||||
if (!carts.vipUser.id) {
|
||||
return;
|
||||
}
|
||||
const res = await PointsApi.calcOrderUsablePoints({
|
||||
shopUserId: props.user.id,
|
||||
shopUserId: carts.vipUser.id,
|
||||
orderAmount: scoreMaxMoney.value,
|
||||
});
|
||||
pointsRes.value = res;
|
||||
@@ -486,10 +486,10 @@ function changePayType(i) {
|
||||
const newCustomerDiscount = ref(null)
|
||||
async function getConsumeDiscountAjax() {
|
||||
try {
|
||||
if (props.user.id) {
|
||||
if (carts.vipUser.id) {
|
||||
newCustomerDiscount.value = await limitTimeDiscountApi.getConsumeDiscount({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
shopUserId: props.user.id,
|
||||
shopUserId: carts.vipUser.id,
|
||||
orderId: props.orderInfo.id
|
||||
})
|
||||
console.log('根据用户id获取新客立减金额,返回null代表不可用', newCustomerDiscount.value);
|
||||
@@ -509,7 +509,7 @@ function returnPayParams() {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
authCode: authCode,
|
||||
checkOrderPay: {
|
||||
vipPrice: shopUser.userInfo.isMemberPrice && props.user.id && props.user.isVip ? 1 : 0,
|
||||
vipPrice: shopUser.userInfo.isMemberPrice && carts.vipUser.id && carts.vipUser.isVip ? 1 : 0,
|
||||
orderId: props.orderInfo.id,
|
||||
// discountRatio: (checkOrderPay.discount / 100).toFixed(2),
|
||||
discountRatio: 0,
|
||||
@@ -525,7 +525,7 @@ function returnPayParams() {
|
||||
discountActAmount: carts.orderCostSummary.fullReduction.actualAmount, // 满减活动金额
|
||||
discountActId: carts.orderCostSummary.fullReduction.usedThreshold !== undefined ? carts.orderCostSummary.fullReduction.usedThreshold.activityId : '', // 满减活动id
|
||||
couponList: carts.coupons.map((v) => v.id),
|
||||
userId: props.user.userId || "",
|
||||
userId: carts.vipUser.userId || "",
|
||||
allPack: carts.dinnerType == "take-out" ? 1 : 0,
|
||||
limitRate: carts.limitDiscountRes,
|
||||
newCustomerDiscountId: newCustomerDiscount.value !== null ? newCustomerDiscount.value.id : '', // 新客立减Id
|
||||
@@ -574,7 +574,7 @@ function nowPayClick(payType) {
|
||||
return;
|
||||
}
|
||||
if (payType == "member-account") {
|
||||
if (!props.user.id) {
|
||||
if (!carts.vipUser.id) {
|
||||
return ElMessage.error("请先选择会员");
|
||||
}
|
||||
payOrder(payType);
|
||||
@@ -622,7 +622,7 @@ async function payOrder(payType, isScan, guazhangren) {
|
||||
res = await payApi.vipPay({
|
||||
...returnPayParams(),
|
||||
payType: "userPay",
|
||||
shopUserId: props.user.id,
|
||||
shopUserId: carts.vipUser.id,
|
||||
});
|
||||
}
|
||||
if (payType == "arrears") {
|
||||
|
||||
Reference in New Issue
Block a user