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

@@ -825,20 +825,7 @@ export function selectOptimalThreshold(
});
if (!validThresholds.length) return undefined;
// 第三步选择最优阈值优先级1.满金额最小 → 2.减免金额最大)
// const sortValidThresholds = validThresholds.sort((a, b) => {
// const aFull = new BigNumber(a.fullAmount || 0);
// const bFull = new BigNumber(b.fullAmount || 0);
// const aDiscount = new BigNumber(a.discountAmount || 0);
// const bDiscount = new BigNumber(b.discountAmount || 0);
// // 先比满金额越小越优先满1减10 比 满100减20 更优)
// if (!aFull.isEqualTo(bFull)) {
// return aFull.comparedTo(bFull) || 0; // Ensure a number is always returned
// }
// // 再比减免金额:越大越优先
// return bDiscount.comparedTo(aDiscount) || 0; // Ensure a number is always returned
// })
// 找到抵扣金额最大的门槛项
const maxDiscountThreshold = validThresholds.reduce(
(maxItem, currentItem) => {
@@ -980,12 +967,15 @@ export function calcTotalPackFee(
for (const goods of goodsList) {
const packNumber = goods.packNumber ? goods.packNumber * 1 : 0;
let availableNum = Math.max(0, goods.number - (goods.returnNum || 0));
availableNum = Math.min(availableNum, packNumber);
if (availableNum === 0) continue;
// 计算单个商品打包数量外卖全打包堂食按配置称重商品≤1
let packNum = availableNum;
let packNum = Math.min(availableNum, packNumber);
if(dinnerType === "take-out"){
packNum=availableNum
}
if (goods.product_type === GoodsType.WEIGHT) {
packNum = Math.min(packNum, 1);
}
@@ -1212,6 +1202,7 @@ export function calculateOrderCostSummary(
//使用霸王餐
if (isFreeDine && freeDineConfig && freeDineConfig.enable) {
console.log("使用霸王餐");
fullReductionAmount=0;
//不与优惠券同享
if (!freeDineConfig.withCoupon) {
couponDeductionAmount = 0;

View File

@@ -1,5 +1,5 @@
export const back=()=>{
console.log('back');
console.log('调用返回方法back');
try {
const arr= getCurrentPages()
if(arr.length>=2){