uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改

This commit is contained in:
2025-10-21 10:44:31 +08:00
parent 5d98b7efc2
commit 5f3a307fec
395 changed files with 31264 additions and 2477 deletions

View File

@@ -201,7 +201,7 @@
></u-image>
</view>
<text class="name u-m-l-16 no-wrap"> {{ item.name }} </text>
<template v-if="item.type == 'points' && !disabledPointsUse">
<template v-if="item.type == 'points' && !pointObj.disabled">
<text
class="u-p-l-6"
style="color: #666; max-width: 400rpx; font-size: 10px"
@@ -227,8 +227,8 @@
<template v-else>
<text
class="favorable_right_text red"
v-if="disabledCouponUse"
>{{ disabledCouponReason }}</text
v-if="couponObj.disabled"
>{{ couponObj.disabledReason }}</text
>
<text
class="favorable_right_text red"
@@ -239,7 +239,7 @@
>暂无可用优惠券</text
>
</template>
<template v-if="!disabledCouponUse">
<template v-if="!couponObj.disabled">
<up-icon
name="arrow-right"
color="#575B66"
@@ -268,10 +268,10 @@
v-if="item.type == 'points'"
>
<text
v-if="disabledPointsUse"
v-if="pointObj.disabled"
class="u-p-l-6 red"
style="max-width: 400rpx; font-size: 24rpx"
>{{ disabledPointsUseReason }}</text
style="max-width: 440rpx; font-size: 24rpx"
>{{ pointObj.disabledReason }}</text
>
<template
v-else-if="
@@ -290,7 +290,7 @@
<template v-else>
<view
v-if="maxPointDiscount > 0 && !disabledPointsUse"
v-if="maxPointDiscount > 0 && !pointObj.disabled"
class="u-flex u-col-center"
>
<view class="round"></view>
@@ -517,13 +517,67 @@ const discountActivityRes = ref(null);
const discountActivity = ref(null);
//备份当前使用的满减活动的门槛满减
let back_discountActivity = null;
//禁止使用优惠券
const disabledCouponUse = ref(false);
const disabledCouponReason = ref("");
//禁止使用积分
const disabledPointsUse = ref(false);
//禁止使用积分原因
const disabledPointsUseReason = ref("");
const couponObj = computed(() => {
const obj = {
disabled: false,
disabledReason: "",
};
const freeDineConfig = props.orderVIP.freeDineConfig;
if (props.isBwc && freeDineConfig.enable) {
//使用了霸王餐
if (!freeDineConfig.withCoupon) {
obj.disabled = true;
obj.disabledReason = "霸王餐与优惠券不可同时使用";
}
}
//使用了满减活动
const res = discountActivityRes.value;
if (discountActivity.value && res) {
if (!res.couponShare) {
obj.disabled = true;
obj.disabledReason = "当前满减活动不可与其他优惠共享";
}
}
if (obj.disabled) {
cartStore.backendCoupons = [];
}
return obj;
});
const pointObj = computed(() => {
const obj = {
disabled: false,
disabledReason: "",
};
const freeDineConfig = props.orderVIP.freeDineConfig;
if (props.isBwc && freeDineConfig.enable) {
//使用了霸王餐
if (!freeDineConfig.withPoints) {
obj.disabled = true;
obj.disabledReason = "霸王餐与积分不可同时使用";
}
}
//使用了满减活动
const res = discountActivityRes.value;
if (discountActivity.value && res) {
if (!res.pointsShare) {
obj.disabled = true;
obj.disabledReason = "当前满减活动不可与积分同享";
}
}
//积分抵扣不足
if (pointsRes && !pointsRes.usable) {
obj.disabledReason = pointsRes.unusableReason || "积分抵扣不足或不可用";
}
if (obj.disabled) {
cartStore.setUserPoints(0);
}
return obj;
});
// 监听送餐/打包切换
const tabClick = (item, index) => {
@@ -534,10 +588,7 @@ const tabClick = (item, index) => {
};
cartStore.setDinnerType(tebtypeList[is_type.value].val);
// 操作优惠卷
const dataprocessing = (data) => {
favorablelist.value[1].value = data;
};
// 清空
const bwcclear = () => {
@@ -556,20 +607,19 @@ const goUrl = (item) => {
switch (item.type) {
case "coupon":
if (disabledCouponUse.value) {
if (couponObj.value.disabled) {
return uni.showToast({
title: disabledCouponReason.value,
title: couponObj.value.disabledReason,
icon: "none",
});
}
emits("learcoupons", "coupon");
uni.pro.navigateTo("/pages/order/coupon", {});
break;
case "points":
if (disabledPointsUse.value) {
if (pointObj.value.disabled) {
return uni.showToast({
title: disabledPointsUseReason.value,
title: pointObj.value.disabledReason,
icon: "none",
});
}
@@ -598,31 +648,36 @@ const maxPointDiscount = ref(0);
//积分可抵扣最大金额
const maxMoney = computed(() => {
return (
cartStore.orderCostSummary.finalPayAmount +
cartStore.orderCostSummary.orderOriginFinalPayAmount +
cartStore.orderCostSummary.pointDeductionAmount
);
});
async function getMaxPointsDiscount() {
if (!props.orderVIP.id) {
return;
}
let res = await APImemberPointscalcUsablePoints({
shopUserId: props.orderVIP.id,
orderAmount: maxMoney.value,
});
if(res){
if (res) {
cartStore.setPointDeductionRule(
res.equivalentPoints,
res.maxDeductionAmount
res.equivalentPoints || 0,
res.maxDeductionAmount || 0
);
}
Object.assign(pointsRes, res);
maxPointDiscount.value = res.maxDeductionAmount;
maxPointDiscount.value = res.maxDeductionAmount || 0;
console.log("积分可抵扣最大金额", maxPointDiscount.value);
console.log("是否可以用积分", usePoints.value);
if (usePoints.value) {
if (usePoints.value && res.usable) {
console.log("积分抵扣金额", res.maxDeductionAmount);
cartStore.setUserPoints(res.maxUsablePoints || 0);
}
if (!res.usable) {
cartStore.setUserPoints(0);
}
}
watch(
() => maxMoney.value,
@@ -680,7 +735,6 @@ const copyHandle = (e) => {
// 将方法暴露给父组件
defineExpose({
dataprocessing,
getCalcUsablePoints,
bwcclear,
IntegralInputclose,
@@ -746,8 +800,7 @@ const originalPrice = computed(() => {
-cartStore.orderCostSummary.newUserDiscount +
cartStore.orderCostSummary.packFee +
cartStore.orderCostSummary.seatFee;
console.log("originalPrice", originalPrice);
return originalPrice;
return originalPrice <= 0 ? 0 : originalPrice;
});
watch(
@@ -766,28 +819,9 @@ watch(
if (newval) {
discountActivity.value = null;
cartStore.fullReductionActivities = [];
if (!freeDineConfig.withCoupon) {
disabledCouponUse.value = true;
disabledCouponReason.value = "霸王餐与优惠券不可同时使用";
cartStore.setCoupons([]);
} else {
disabledCouponUse.value = false;
disabledCouponReason.value = "";
}
if (!freeDineConfig.withPoints) {
disabledPointsUse.value = true;
disabledPointsUseReason.value = "霸王餐与积分不可同时使用";
usePoints.value = false;
cartStore.setUserPoints(0);
} else {
disabledPointsUse.value = false;
disabledPointsUseReason.value = "";
}
usePoints.value = false;
cartStore.setUserPoints(0);
} else {
disabledPointsUse.value = false;
disabledPointsUseReason.value = "";
disabledCouponUse.value = false;
disabledCouponReason.value = "";
if (back_discountActivity) {
calcDiscountActivity();
}
@@ -824,17 +858,7 @@ function calcDiscountActivity() {
return;
}
console.log("当前满减门槛", discountActivity.value);
if (!res.couponShare) {
disabledCouponUse.value = true;
cartStore.backendCoupons = [];
disabledCouponReason.value = "当前满减活动不可与其他优惠共享";
}
//不与积分同享
if (!res.pointsShare && discountActivity.value) {
disabledPointsUse.value = true;
disabledPointsUseReason.value = "当前满减活动不与积分同享";
cartStore.setUserPoints(0);
}
if (discountActivity.value) {
cartStore.fullReductionActivities = [discountActivityRes.value];
}

View File

@@ -77,7 +77,6 @@
:ordershopUserInfo="ordershopUserInfo"
@istype="istype"
@clickPointsamount="clickPointsamount"
@learcoupons="learcoupons"
:isBwc="isBwc"
>
</orderInfo>
@@ -106,9 +105,15 @@
</rechargeFree>
<!-- 充值享优惠 -->
<view v-if="!showFreeDine && (listinfo.status == 'unpaid' || !listinfo.id)">
<view
v-if="
!showFreeDine &&
(listinfo.status == 'unpaid' || !listinfo.id) &&
cartStore.orderCostSummary.finalPayAmount > 0
"
>
<ChargeVue
@updateChargeSel="updateChargeSel"
@updateChargeSel="(e) => updateChargeSel(e)"
@updateRechargeId="updateRechargeId"
v-if="listinfo.status == 'unpaid' || !listinfo.id"
></ChargeVue>
@@ -120,6 +125,7 @@
@groupChange="groupChange"
:disablePayType="disablePayType"
:changeFreeenable="isBwc"
v-model="paymentmethod"
v-if="listinfo.status == 'unpaid' || !listinfo.id"
>
</paymentMethodes>
@@ -160,7 +166,7 @@
shape="circle"
v-if="listinfo.id && listinfo.status == 'unpaid'"
plain
@tap="cancelOrder"
@tap="cancelOrder()"
:custom-style="customStyle"
>
<view class="u-flex u-flex-y-center">
@@ -200,7 +206,7 @@
</template>
</view>
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders, 1000)">
{{ paymentmethod.paymentBtnText }}
{{ paymentmethod.name }}
</view>
<!-- <view class="fixedview_tows" @tap="$u.debounce(APIputuserorderclick,1000)">
取消订单
@@ -212,34 +218,19 @@
<payPassword
ref="payPasswordref"
:isShow="ispws"
@inputComplete="accountPayevent"
@inputComplete="(e) => accountPayevent(e)"
@close="ispws = false"
/>
<!-- 私域引流配置 -->
<OrderFinshModal v-if="showDrainage"></OrderFinshModal>
<OrderFinshModal v-model="showDrainage" ></OrderFinshModal>
</view>
</template>
<script setup>
import { back } from "@/utils/uniapp.js";
import { onLoad } from "@dcloudio/uni-app";
import { BigNumber } from "bignumber.js";
import ChargeVue from "./components/charge.vue";
import { pay } from "@/utils/pay.js";
import Drainage from "@/components/drainage.vue";
import * as drainageConfigApi from "@/common/api/market/drainageConfig.js";
import OrderFinshModal from "@/components/order-finish-modal.vue";
function onback() {
closeSocket();
back();
}
const customStyle = {
width: "180rpx",
height: "70rpx",
background: "FFFFFF",
"border-radius": "106rpx",
border: "2rpx solid #E8AD7B",
};
import _ from "lodash";
import {
ref,
@@ -247,12 +238,12 @@ import {
computed,
onMounted,
onUnmounted,
watchEffect,
nextTick,
watch,
onBeforeMount,
onBeforeUnmount,
} from "vue";
import { getTableInfo } from "@/common/api/shop/index.js";
import {
APIgetOrderById,
@@ -269,9 +260,21 @@ import {
import { useCartsStore } from "@/stores/carts.js";
import { useWebSocket } from "@/stores/carts-websocket.js";
function onback() {
closeSocket();
console.log("返回");
back();
}
const customStyle = {
width: "180rpx",
height: "70rpx",
background: "FFFFFF",
"border-radius": "106rpx",
border: "2rpx solid #E8AD7B",
};
const cartStore = useCartsStore();
const disablePayType = ref([]);
//充值相关
const rechargeItem = ref({
id: "",
@@ -285,32 +288,6 @@ function updateRechargeId(e) {
function updateChargeSel(newval) {
rechargeItem.value = newval;
console.log("updateChargeSel", newval);
//充值并付款时只能微信支付
if (newval && newval.id) {
disablePayType.value = ["余额支付"];
paymentMethodref.value.groupChanges(2);
return;
}
console.log("orderVIP.value.amount", orderVIP.value.amount);
if (!orderVIP.value.amount) {
disablePayType.value = ["余额支付"];
if (paymentMethodref.value) {
paymentMethodref.value.groupChanges(2);
}
return;
}
if (orderVIP.value.amount < newval) {
disablePayType.value = ["余额支付"];
if (paymentMethodref.value) {
paymentMethodref.value.groupChanges(2);
}
return;
}
if (cartStore.orderCostSummary.orderOriginFinalPayAmount <= 0) {
disablePayType.value = ["微信支付"];
} else {
disablePayType.value = [];
}
}
async function onMessage(Message) {
@@ -386,7 +363,6 @@ function youhuiReset() {
listinfo.pointsNum = 0;
listinfo.pointsDiscountAmount = 0;
listinfo.Productroll = 0;
uniqueIds.value = [];
try {
orderInfoAfterRef.value?.IntegralInputclose();
} catch {}
@@ -437,7 +413,6 @@ const listinfo = reactive({
packFeess: 0,
totalPrices: 0,
Seatcharge: 0,
pointsNum: 0,
id: null,
});
@@ -544,82 +519,17 @@ function getOrderInfoAfterCalcInit(res) {
// },1000)
}
// 监听价格算法
watchEffect(async () => {
if (listinfo.combinedArray.length > 0 || cartStore.carts.length > 0) {
// 打包费packFeess 计算购物车商品费用totalPrices 餐位费Seatcharge
// try {
let historyOrderPackFee = is_type.value != 0 ? listinfo.packFeess : 0;
let nowCartPackFee = is_type.value != 0 ? cartStore.totalPackFee * 1 : 0;
let seatFee = is_type.value == 0 ? listinfo.Seatcharge : 0;
let sum =
cartStore.totalPackFee * 1 +
historyOrderPackFee +
listinfo.totalPrices +
seatFee;
listinfo.originAmount = Math.round(sum * 100) / 100;
// 打包费packFeess 计算购物车商品费用totalPrices 餐位费Seatcharge 商品卷Productroll 优惠卷coupondiscountAmount 积分listinfo.pointsDiscountAmount
let sums =
nowCartPackFee +
historyOrderPackFee +
listinfo.totalPrices +
seatFee -
(listinfo.Productroll || 0) -
(listinfo.coupondiscountAmount || 0) -
(listinfo.pointsDiscountAmount || 0);
listinfo.totalCost = Math.round(sums * 100) / 100;
// 总价格
// console.log(listinfo.combinedArray, listinfo.packFeess, listinfo.totalPrices, listinfo
// .Seatcharge, listinfo.Productroll, listinfo.coupondiscountAmount, sums) // 霸王餐
// console.log(orderVIP.value.freeDineConfig.enable, changeFreeenable.value)
if (orderVIP.value.freeDineConfig.enable && isBwc.value) {
listinfo.totalCost = (
parseFloat(listinfo.totalCost) *
parseFloat(orderVIP.value.freeDineConfig.rechargeTimes)
).toFixed(2);
}
// 积分
if (
listinfo.totalCost &&
(listinfo.status == "unpaid" || !listinfo.id) &&
orderVIP.value.id
) {
uni.$u.debounce(memberPointscalcUsablePoints, 500);
}
// } catch (error) {
// //TODO handle the exception
// }
}
});
const changeFree = (e) => {
if (JSON.stringify(e) == "{}") {
return;
}
isBwc.value = e;
cartStore.isFreeDine = e;
if (e) {
disablePayType.value = ["余额支付"];
} else {
disablePayType.value = [];
}
orderInfoAfterRef.value.bwcclear();
uniqueIds.value = []; // 筛选出商品卷的id
listinfo.coupondiscountAmount = 0; // 优惠卷减去的金额
listinfo.pointsNum = 0; // 商品卷总价价格
// 商品价格
// listinfo.totalPrices = cartStore.getTotalTotalPrices(
// listinfo.combinedArray,
// isBwc.value
// );
console.log("changeFree", e);
// 支付方式切换
// #ifdef MP-WEIXIN
paymentMethodref.value.groupChanges(2);
// #endif
// #ifdef MP-ALIPAY
paymentMethodref.value.groupChanges(3);
// #endif
};
@@ -637,71 +547,35 @@ const saveImage = (url) => {
//
const paymentMethodref = ref(null);
// 支付方式切换
const paymentmethod = reactive({
radiovalue: 2,
paymentBtnText: "微信支付",
const paymentmethod = ref({});
// 支付方式
// #ifdef MP-WEIXIN
paymentmethod.value = {
name: "微信支付",
type: 2,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
payType: "wechatPay",
});
};
// #endif
// #ifdef MP-ALIPAY
paymentmethod.value = {
name: "支付宝支付",
type: 3,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png",
payType: "aliPay",
};
// #endif
const groupChange = async (e) => {
if (e == 5) {
return;
}
console.log("groupChange", e);
paymentmethod.radiovalue = e.type;
paymentmethod.paymentBtnText = e.name;
paymentmethod.payType = e.payType;
paymentmethod.value = e;
};
// 操作下单时候
const orderInfoAfterRef = ref(null);
// 商品卷的id储存
const uniqueIds = ref([]);
// 这是优惠卷传的值
const handleReturnData = async (data) => {
// 这是优惠卷
if (data.typeOrder == 1) {
if (data.item) {
// 优惠卷减去的金额
listinfo.coupondiscountAmount = data.item.discountAmount;
uniqueIds.value.push(data.item.id);
orderInfoAfterRef.value.dataprocessing(data);
}
} else {
// 筛选出商品卷的id
// 商品卷总价价格
// uniqueIds.value = [...uniqueIds.value, ...new Set(data.map(item => item.id))]
uniqueIds.value = [...uniqueIds.value, ...data.map((item) => item.id)];
console.log(uniqueIds.value);
listinfo.Productroll = cartStore.getTotalProductroll(data).value;
// TODO handle the exception
let res = {
Productroll: listinfo.Productroll,
uniqueIds: uniqueIds.value.length,
};
orderInfoAfterRef.value.dataprocessing(res);
}
};
const learcoupons = (data) => {
if (data == "product") {
uniqueIds.value = []; // 筛选出商品卷的id
listinfo.coupondiscountAmount = 0; // 优惠卷减去的金额
listinfo.Productroll = 0; // 商品卷总价价格
listinfo.pointsNum = 0; // 积分总价格
} else {
// 每次点击优惠卷删除优惠卷里的id
if (listinfo.coupondiscountAmount != 0) {
uniqueIds.value.pop();
}
listinfo.coupondiscountAmount = 0; // 优惠卷减去的金额
}
};
//取消订单
const cancelOrder = async () => {
uni.showModal({
@@ -821,7 +695,9 @@ function returnPayParams() {
cartStore.orderCostSummary.productCouponDeduction, //商品优惠券抵扣金额
otherCouponDiscountAmount: cartStore.orderCostSummary.fullCouponDeduction, //其他优惠券抵扣金额
couponList: cartStore.backendCoupons.map((v) => v.id), //用户使用的卡券
orderAmount:isBwc.value? cartStore.orderCostSummary.orderOriginFinalPayAmount: cartStore.orderCostSummary.finalPayAmount, // 最终订单金额
orderAmount: isBwc.value
? cartStore.orderCostSummary.orderOriginFinalPayAmount
: cartStore.orderCostSummary.finalPayAmount, // 最终订单金额
roundAmount: 0, //抹零金额 减免多少钱
pointsDiscountAmount: cartStore.orderCostSummary.pointDeductionAmount, //积分抵扣金额(tb_points_basic_setting表)
pointsNum: cartStore.orderCostSummary.pointUsed, //(扣除各类折扣 enable_deduction后使用)
@@ -837,7 +713,7 @@ function returnPayParams() {
return {
isBwc: isBwc.value,
checkOrderPay,
payType: paymentmethod.payType,
payType: paymentmethod.value.payType,
buyerRemark: "",
returnUrl: "",
rechargeId: rechargeId.value,
@@ -926,7 +802,7 @@ const istoricalorders = async () => {
// * 去支付
const goToPay = async (payParams) => {
console.log("goToPay:payParams", payParams);
// 余额支付
if (payParams.payType == "accountPay") {
if (orderVIP.value.payPwd == "") {
@@ -1035,22 +911,7 @@ const goToPay = async (payParams) => {
orderorderInfo();
};
//002-获取订单可用积分及抵扣金额(支付页面使用)
const memberPointscalcUsablePoints = async () => {
let res = await APImemberPointscalcUsablePoints({
shopUserId: orderVIP.value.id,
orderAmount: listinfo.totalCost,
});
console.log('获取订单可用积分及抵扣金额(支付页面使用)')
if(res){
cartStore.setPointDeductionRule(
res.equivalentPoints,
res.maxDeductionAmount
);
}
orderInfoAfterRef.value?.getCalcUsablePoints(res);
};
//
const clickPointsamount = (Pointsamount) => {
listinfo.pointsDiscountAmount = Pointsamount.pointsDiscountAmount;
@@ -1060,6 +921,10 @@ const clickPointsamount = (Pointsamount) => {
const payPasswordref = ref(null);
// 余额支付
const accountPayevent = async (pwd) => {
console.log("账户支付", pwd);
if (JSON.stringify(pwd) === "{}") {
return;
}
const payParams = returnPayParams();
ispws.value = false;
payParams.checkOrderPay.userId = uni.cache.get("userInfo").id;
@@ -1079,46 +944,8 @@ const accountPayevent = async (pwd) => {
}
orderorderInfo();
};
watch(
() => cartStore.orderCostSummary.orderOriginFinalPayAmount,
(newval) => {
console.log("orderOriginFinalPayAmount", newval);
if (newval <= 0) {
disablePayType.value = ["微信支付"];
paymentMethodref.value.groupChanges(1);
}
if (
newval <= 0 ||
newval < orderVIP.value.freeDineConfig.rechargeThreshold
) {
isBwc.value = false;
showFreeDine.value = false;
return;
}
disablePayType.value = [];
if (
(listinfo.status == "unpaid" || !listinfo.id) &&
orderVIP.value.freeDineConfig.enable &&
newval >= orderVIP.value.freeDineConfig.rechargeThreshold
) {
showFreeDine.value = true;
}
},
{
immediate: true,
}
);
watch(
() => isBwc.value,
(newval) => {
cartStore.isFreeDine = newval;
}
);
onBeforeUnmount(() => {
uni.$off("returnData", handleReturnData);
clearTimeout(backtimer);
clearInterval(payStatusTimer);
closeSocket();
@@ -1153,7 +980,6 @@ onShow(() => {
uni.$off("selCoupon");
uni.$on("selCoupon", function (data) {
console.log("selCoupon", data);
orderInfoAfterRef.value.dataprocessing(_.cloneDeep(data));
cartStore.setCoupons(_.cloneDeep(data));
});
});
@@ -1161,6 +987,7 @@ let options = {};
// 跳转到加菜页面
function toJiacai() {
console.log("跳转到加菜页面");
back();
return;
uni.navigateTo({
@@ -1200,6 +1027,7 @@ const navTitle = computed(() => {
//支付成功后的处理
function paySucessCallback() {
console.log("paySucessCallback");
showDrainage.value = true;
}
@@ -1208,6 +1036,8 @@ const drainageConfig = ref({});
//私域引流弹窗
const showDrainage = ref(false);
async function init(opt) {
await storeuser.actionsproductqueryProduct();
console.log("init");
cartStore.clearOrderConfig();
Object.assign(options, opt);
@@ -1216,7 +1046,6 @@ async function init(opt) {
if (options.shopId) {
// 每次进来全局更新shopId
uni.cache.set("shopId", options.shopId, 30);
uni.$on("returnData", handleReturnData);
}
//如果已经生成订单,根据历史订信息设置相关配置
if (options.orderId) {
@@ -1242,7 +1071,6 @@ async function init(opt) {
}
await cartStore.goodsInit();
// * 获取会员信息
await storeuser.actionsproductqueryProduct();
await nextTick();
orderVIP.value = uni.cache.get("orderVIP");
@@ -1257,6 +1085,78 @@ async function init(opt) {
onLoad((opt) => {
init(opt);
});
watch(
() => cartStore.orderCostSummary.orderOriginFinalPayAmount,
(newval) => {
if (
!orderVIP.value.freeDineConfig ||
!orderVIP.value.freeDineConfig.enable
) {
//未开始霸王餐后面代码不执行
isBwc.value = false;
showFreeDine.value = false;
return;
}
const bwc_fullaniunt_money =
newval + cartStore.orderCostSummary.fullReduction.actualAmount;
if (
bwc_fullaniunt_money <= 0 ||
bwc_fullaniunt_money < orderVIP.value.freeDineConfig.rechargeThreshold
) {
isBwc.value = false;
showFreeDine.value = false;
return;
}
if (
(listinfo.status == "unpaid" || !listinfo.id) &&
orderVIP.value.freeDineConfig.enable &&
bwc_fullaniunt_money >= orderVIP.value.freeDineConfig.rechargeThreshold
) {
showFreeDine.value = true;
}
},
{
immediate: true,
}
);
watch(
() => isBwc.value,
(newval) => {
cartStore.isFreeDine = newval;
}
);
const disablePayType = computed(() => {
const arr = new Set([]);
if (isBwc.value) {
if (cartStore.orderCostSummary.orderOriginFinalPayAmount <= 0) {
arr.add("微信支付");
} else {
arr.add("余额支付");
}
}
//充值并付款时只能微信支付
if (rechargeItem.value.id) {
arr.add("余额支付");
}
if (!orderVIP.value.amount) {
arr.add("余额支付");
}
if (
orderVIP.value.amount < cartStore.orderCostSummary.orderOriginFinalPayAmount
) {
arr.add("余额支付");
}
if (cartStore.orderCostSummary.orderOriginFinalPayAmount <= 0) {
arr.add("微信支付");
}
return Array.from(arr);
});
</script>
<style lang="scss">

File diff suppressed because it is too large Load Diff