订单结算修改,增加限时折扣

This commit is contained in:
2025-10-24 16:13:40 +08:00
parent 5aa469a7b7
commit 26532150b5
36 changed files with 4989 additions and 1885 deletions

View File

@@ -260,7 +260,7 @@ const getCouponPopupAjax = async () => {
try {
const shopId = uni.cache.get("shopId");
const res = await birthdayGiftApi.config({ shopId });
if (res.length) {
if (res&&res.length) {
// 处理有效期格式(固定有效期规则)
allCoupons.value = res.map((item) => {
if (item.validType === "fixed") {

View File

@@ -0,0 +1,56 @@
<template>
<text v-if="limitDiscount && limitDiscount.id" class="limit-price">
{{ returnPrice() }}
</text>
<text v-else>
<text v-if="shopInfo.isMemberPrice == 1 && shopUserInfo.isVip == 1" class="memberPrice">
{{ cart.memberPrice || cart.salePrice }}
</text>
<text v-else class="salePrice">{{ cart.salePrice }}</text>
</text>
</template>
<script setup>
import BigNumber from "bignumber.js";
import * as orderUtils from "@/utils/order-utils.js";
function returnPrice(){
return orderUtils.returnPrice({
goods:props.cart,
shopInfo:props.shopInfo,
limitTimeDiscountRes:props.limitDiscount,
shopUserInfo:props.shopUserInfo,
idKey:props.idKey
})
}
const props = defineProps({
//购物车
cart: {
type: Object,
default: () => {},
},
idKey:{
type: String,
default: 'id',
},
//限时折扣
limitDiscount: {
type: Object,
default: () => {},
},
//店铺用户信息
shopUserInfo: {
type: Object,
default: () => {},
},
//店铺信息
shopInfo: {
type: Object,
default: () => {},
},
});
</script>
<style scoped lang="scss"></style>

View File

@@ -51,7 +51,6 @@ const wechatAcQrcode = ref("");
const userinfo = uni.cache.get("userInfo") || {};
const codeVal = ref(userinfo.wechatAcQrcode || "");
function qrcodeResult(e) {
console.log("qrcodeResult", e);
wechatAcQrcode.value = e;
}
</script>

View File

@@ -1,6 +1,5 @@
<template>
<view>
<up-popup :show="show" bgColor="transparent" mode="center" @close="close">
<view class="container">
<view class="content">
@@ -32,7 +31,7 @@
<script setup>
import _ from "lodash";
import dayjs from "dayjs";
import { onMounted, ref } from "vue";
import { onMounted, ref, watch } from "vue";
import { string } from "../uni_modules/uview-plus/libs/function/test";
const bgUrl = ref(
@@ -65,7 +64,7 @@ function init() {
show.value = true;
}
}
watch(() => props.wechatAcQrcode, init);
onMounted(() => {
init();
});

View File

@@ -37,14 +37,7 @@ const userinfo = uni.cache.get("userInfo") || {};
const codeVal = ref(userinfo.wechatAcQrcode || "");
console.log("codeVal", codeVal.value);
function qrcodeResult(e) {
console.log("qrcodeResult", e);
wechatAcQrcode.value = e;
}
</script>
<style lang="scss">
.qrcode {
position: fixed;
transform: translateX(200vw, 200vh);
}
</style>

View File

@@ -162,12 +162,10 @@ const radiovalue = defineModel({
watch(
() => props.disablePayType,
(newval) => {
console.log('禁止支付方式', newval);
const canUsePayType = paymentMethodList.value.filter((item) => {
return !newval.includes(item.name);
});
console.log('可用支付方式', canUsePayType);
if (canUsePayType.find((v) => v.type == radiovalue.value.type)) {
return;
}

View File

@@ -28,7 +28,6 @@ onMounted(() => {
});
const emit = defineEmits(["generate"]);
function qrcodeResult(e) {
console.log(e);
emit("generate", e.img.tempFilePath);
}
</script>
@@ -37,8 +36,10 @@ function qrcodeResult(e) {
.qrcode-box {
position: relative;
overflow: hidden;
left: -400px;
width: 1px;
height: 1px;
opacity: 0;
z-index: -1;
}
</style>