订单结算修改,增加限时折扣
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -45,62 +45,66 @@
|
||||
</view>
|
||||
|
||||
<view class="card">
|
||||
<orderItemVue
|
||||
<!-- <orderItemVue
|
||||
:useVipPrice="useVipPrice"
|
||||
v-if="nowCarts.length"
|
||||
:nowCarts="nowCarts"
|
||||
:limitDiscount="cartStore.limitTimeDiscount"
|
||||
></orderItemVue> -->
|
||||
<orderItemVue
|
||||
:useVipPrice="useVipPrice"
|
||||
v-if="cartStore.allGoods.length"
|
||||
:nowCarts="cartStore.allGoods"
|
||||
:limitDiscount="cartStore.limitTimeDiscount"
|
||||
></orderItemVue>
|
||||
<!-- 订单头部 -->
|
||||
<view
|
||||
class="card_item"
|
||||
v-for="(value, key) in listinfo.detailMap"
|
||||
:key="key"
|
||||
>
|
||||
<!-- <view class="head">
|
||||
<view class="head_left">
|
||||
<text class="placeNum" v-if="key!=0">第{{key}}次下单</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 订单详情 -->
|
||||
<view class="shop-info">
|
||||
<view class="item" v-for="item in value" :key="item.id">
|
||||
<view class="cover">
|
||||
<up-image
|
||||
width="76"
|
||||
height="76"
|
||||
radius="16"
|
||||
:src="item.productImg"
|
||||
v-if="item.productId != -999"
|
||||
></up-image>
|
||||
<up-image
|
||||
width="76"
|
||||
height="76"
|
||||
radius="16"
|
||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||
mode="heightFix"
|
||||
v-else
|
||||
></up-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="productName">{{ item.productName }}</text>
|
||||
<text class="productSkuName" v-if="item.skuName">{{
|
||||
item.skuName
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="price">
|
||||
<view class="priceAmount">
|
||||
<text v-if="isBwc">{{ item.price }}</text>
|
||||
<text v-else>
|
||||
¥{{
|
||||
useVipPrice ? item.memberPrice || item.price : item.price
|
||||
}}
|
||||
</text>
|
||||
<template v-if="false">
|
||||
<view
|
||||
class="card_item"
|
||||
v-for="(value, key) in listinfo.detailMap"
|
||||
:key="key"
|
||||
>
|
||||
<view class="shop-info">
|
||||
<view class="item" v-for="item in value" :key="item.id">
|
||||
<view class="cover">
|
||||
<up-image
|
||||
width="76"
|
||||
height="76"
|
||||
radius="6"
|
||||
:src="item.productImg"
|
||||
v-if="item.productId != -999"
|
||||
></up-image>
|
||||
<up-image
|
||||
width="76"
|
||||
height="76"
|
||||
radius="6"
|
||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||
mode="heightFix"
|
||||
v-else
|
||||
></up-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="productName">{{ item.productName }}</text>
|
||||
<text class="productSkuName" v-if="item.skuName">{{
|
||||
item.skuName
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="price">
|
||||
<view class="priceAmount">
|
||||
<text v-if="isBwc">{{ item.price }}</text>
|
||||
<text v-else>
|
||||
¥{{
|
||||
useVipPrice
|
||||
? item.memberPrice || item.price
|
||||
: item.price
|
||||
}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="num">x{{ item.num }}</view>
|
||||
</view>
|
||||
<view class="num">x{{ item.num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view
|
||||
class="total-wrap u-m-t-30"
|
||||
@@ -154,7 +158,7 @@
|
||||
"
|
||||
>
|
||||
<view class="u-m-t-40 u-p-l-20 u-p-r-20">
|
||||
<view class="youhui-item" v-if="discountActivity">
|
||||
<view class="youhui-item" v-if="cartStore.orderCostSummary.fullReduction.actualAmount">
|
||||
<view class="u-flex align-center">
|
||||
<image
|
||||
src="/static/icon/coup.png"
|
||||
@@ -165,13 +169,13 @@
|
||||
</view>
|
||||
|
||||
<view class="red font-12 u-flex align-center"
|
||||
>-¥{{ discountActivity.discountAmount }}</view
|
||||
>-¥{{ cartStore.orderCostSummary.fullReduction.actualAmount }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="youhui-item" v-if="newUserDiscount">
|
||||
<view class="u-flex align-center">
|
||||
<image
|
||||
src="/static/icon/coup.png"
|
||||
src="/static/icon/newUserDiscount.png"
|
||||
bgColor="#fff"
|
||||
style="width: 40rpx; height: 34rpx"
|
||||
></image>
|
||||
@@ -304,7 +308,10 @@
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cell-item column" v-if="listinfo.discountInfo">
|
||||
<view
|
||||
class="cell-item column"
|
||||
v-if="listinfo.discountInfo && listinfo.discountInfo != '{}'"
|
||||
>
|
||||
<view class="label">优惠折扣</view>
|
||||
<view class="val column">
|
||||
<view
|
||||
@@ -387,6 +394,7 @@ import {
|
||||
defineExpose,
|
||||
toRaw,
|
||||
onMounted,
|
||||
provide,
|
||||
nextTick,
|
||||
} from "vue";
|
||||
import { returnHasCouponCanUse } from "@/utils/coupon.js";
|
||||
@@ -588,8 +596,6 @@ const tabClick = (item, index) => {
|
||||
};
|
||||
cartStore.setDinnerType(tebtypeList[is_type.value].val);
|
||||
|
||||
|
||||
|
||||
// 清空
|
||||
const bwcclear = () => {
|
||||
IntegralInputclose();
|
||||
@@ -833,16 +839,13 @@ function calcDiscountActivity() {
|
||||
const res = discountActivityRes.value;
|
||||
const user = uni.cache.get("shopUserInfo");
|
||||
|
||||
//不与会员同享
|
||||
if (!res.vipPriceShare && user.isVip) {
|
||||
return;
|
||||
}
|
||||
console.log("calcDiscountActivity:originalPrice", originalPrice.value);
|
||||
const usedFullReductionActivityFullAmount=cartStore.orderCostSummary.fullReduction.usedFullReductionActivityFullAmount;
|
||||
console.log("usedFullReductionActivityFullAmount", usedFullReductionActivityFullAmount);
|
||||
|
||||
if (res && res.thresholds && res.thresholds.length > 0) {
|
||||
const canUseThresholds = res.thresholds
|
||||
.filter((v) => {
|
||||
return originalPrice.value >= v.fullAmount;
|
||||
return usedFullReductionActivityFullAmount >= v.fullAmount;
|
||||
})
|
||||
.sort((a, b) => {
|
||||
return b.discountAmount - a.discountAmount;
|
||||
@@ -859,9 +862,7 @@ function calcDiscountActivity() {
|
||||
}
|
||||
console.log("当前满减门槛", discountActivity.value);
|
||||
|
||||
if (discountActivity.value) {
|
||||
cartStore.fullReductionActivities = [discountActivityRes.value];
|
||||
}
|
||||
|
||||
}
|
||||
async function getDiscountActivity() {
|
||||
const res = await discountActivityApi.config({
|
||||
@@ -871,6 +872,8 @@ async function getDiscountActivity() {
|
||||
return;
|
||||
}
|
||||
discountActivityRes.value = res;
|
||||
cartStore.fullReductionActivities = [res];
|
||||
|
||||
calcDiscountActivity();
|
||||
}
|
||||
onMounted(async () => {
|
||||
@@ -1174,6 +1177,7 @@ onMounted(async () => {
|
||||
display: flex;
|
||||
|
||||
.cover {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.info {
|
||||
@@ -1561,4 +1565,19 @@ onMounted(async () => {
|
||||
.align-center {
|
||||
align-items: center;
|
||||
}
|
||||
.limitDiscount {
|
||||
background-color: #cc5617;
|
||||
padding: 2rpx 10rpx;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
border-radius: 20rpx 0rpx 20rpx 0rpx;
|
||||
z-index: 9;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user