uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const back=()=>{
|
||||
console.log('back');
|
||||
console.log('调用返回方法back');
|
||||
try {
|
||||
const arr= getCurrentPages()
|
||||
if(arr.length>=2){
|
||||
|
||||
Reference in New Issue
Block a user