|
@@ -808,8 +808,10 @@ Page({ |
|
@@ -808,8 +808,10 @@ Page({ |
|
808
|
}
|
808
|
}
|
|
809
|
})
|
809
|
})
|
|
810
|
}
|
810
|
}
|
|
|
|
811
|
+ let finalList = list.filter(i=>{return i.checked})
|
|
811
|
this.setData({
|
812
|
this.setData({
|
|
812
|
- couponArr: list
|
813
|
+ couponArr: list,
|
|
|
|
814
|
+ finalList
|
|
813
|
})
|
815
|
})
|
|
814
|
},
|
816
|
},
|
|
815
|
// 输入金额
|
817
|
// 输入金额
|
|
@@ -947,12 +949,14 @@ Page({ |
|
@@ -947,12 +949,14 @@ Page({ |
|
947
|
sellerid: this.data.seller.sid,
|
949
|
sellerid: this.data.seller.sid,
|
|
948
|
price: this.data.inputValue,
|
950
|
price: this.data.inputValue,
|
|
949
|
phone: this.data.purePhoneNumber,
|
951
|
phone: this.data.purePhoneNumber,
|
|
950
|
- recharge_balance: this.data.balancePay * 1,
|
|
|
|
951
|
}
|
952
|
}
|
|
952
|
if (str) {
|
953
|
if (str) {
|
|
953
|
obj.activity_id = str;
|
954
|
obj.activity_id = str;
|
|
954
|
}
|
955
|
}
|
|
955
|
let consumeDiscount = this.data.consumeDiscount * 1
|
956
|
let consumeDiscount = this.data.consumeDiscount * 1
|
|
|
|
957
|
+ if (this.data.balancePay * 1 > 0) {
|
|
|
|
958
|
+ obj.recharge_balance = this.data.balancePay;
|
|
|
|
959
|
+ }
|
|
956
|
if (consumeDiscount > 0) {
|
960
|
if (consumeDiscount > 0) {
|
|
957
|
obj.consume = this.data.consumeDiscount;
|
961
|
obj.consume = this.data.consumeDiscount;
|
|
958
|
}
|
962
|
}
|
|
@@ -976,6 +980,9 @@ Page({ |
|
@@ -976,6 +980,9 @@ Page({ |
|
976
|
return false
|
980
|
return false
|
|
977
|
}
|
981
|
}
|
|
978
|
// 微信支付
|
982
|
// 微信支付
|
|
|
|
983
|
+ if (this.data.balancePay) {
|
|
|
|
984
|
+ params.recharge_balance = this.data.balancePay;
|
|
|
|
985
|
+ }
|
|
979
|
App.PayOnline.CombineTransactionsByNewActivity(params).then(res => {
|
986
|
App.PayOnline.CombineTransactionsByNewActivity(params).then(res => {
|
|
980
|
console.log('付款信息', res.data);
|
987
|
console.log('付款信息', res.data);
|
|
981
|
if (res.ret != '200') {
|
988
|
if (res.ret != '200') {
|
|
@@ -1080,7 +1087,7 @@ Page({ |
|
@@ -1080,7 +1087,7 @@ Page({ |
|
1080
|
priceSum = parseFloat(priceSum)
|
1087
|
priceSum = parseFloat(priceSum)
|
|
1081
|
// 按百分比 is_ratio 1按比例 0按阶梯 ladder_data
|
1088
|
// 按百分比 is_ratio 1按比例 0按阶梯 ladder_data
|
|
1082
|
if (data.is_ratio == '1' && data.ratio_data) {
|
1089
|
if (data.is_ratio == '1' && data.ratio_data) {
|
|
1083
|
- totalConsumePrice = priceSum * (data.ratio_data / 100).toFixed(2);
|
1090
|
+ totalConsumePrice = priceSum * (data.ratio_data / 100).toFixed(1);
|
|
1084
|
console.log('送消费金百分比----', totalConsumePrice);
|
1091
|
console.log('送消费金百分比----', totalConsumePrice);
|
|
1085
|
}
|
1092
|
}
|
|
1086
|
// 阶梯
|
1093
|
// 阶梯
|
|
@@ -1090,7 +1097,7 @@ Page({ |
|
@@ -1090,7 +1097,7 @@ Page({ |
|
1090
|
}
|
1097
|
}
|
|
1091
|
if (totalConsumePrice > 0) this.getConsumeFun(totalConsumePrice)
|
1098
|
if (totalConsumePrice > 0) this.getConsumeFun(totalConsumePrice)
|
|
1092
|
this.setData({
|
1099
|
this.setData({
|
|
1093
|
- totalConsumePrice: (totalConsumePrice * 1).toFixed(2)
|
1100
|
+ totalConsumePrice: (totalConsumePrice * 1).toFixed(1)
|
|
1094
|
})
|
1101
|
})
|
|
1095
|
}
|
1102
|
}
|
|
1096
|
},
|
1103
|
},
|
|
@@ -1250,18 +1257,18 @@ Page({ |
|
@@ -1250,18 +1257,18 @@ Page({ |
|
1250
|
continue;
|
1257
|
continue;
|
|
1251
|
}
|
1258
|
}
|
|
1252
|
// 如果剩余金额足够,选择券
|
1259
|
// 如果剩余金额足够,选择券
|
|
1253
|
- if (remainingPrice >= couponDesc) {
|
1260
|
+ if (remainingPrice > couponDesc || remainingPrice == couponDesc) {
|
|
1254
|
// 计算实际使用的张数,不能超过 kyNum
|
1261
|
// 计算实际使用的张数,不能超过 kyNum
|
|
1255
|
let usedCount = Math.min(kyNum, 1); // 假设每次只使用一张
|
1262
|
let usedCount = Math.min(kyNum, 1); // 假设每次只使用一张
|
|
1256
|
let potentialDiscount = couponDesc * usedCount; // 计算潜在的优惠金额
|
1263
|
let potentialDiscount = couponDesc * usedCount; // 计算潜在的优惠金额
|
|
1257
|
- if (totalDiscount + potentialDiscount <= amount) {// 检查总优惠金额是否会超过总金额
|
1264
|
+ if ((totalDiscount + potentialDiscount < amount) || (totalDiscount + potentialDiscount == amount)) {// 检查总优惠金额是否会超过总金额
|
|
1258
|
list1.push(coupon);
|
1265
|
list1.push(coupon);
|
|
1259
|
remainingPrice -= couponPrice * usedCount; // 减去价格
|
1266
|
remainingPrice -= couponPrice * usedCount; // 减去价格
|
|
1260
|
totalDiscount += potentialDiscount; // 计算优惠金额
|
1267
|
totalDiscount += potentialDiscount; // 计算优惠金额
|
|
1261
|
}
|
1268
|
}
|
|
1262
|
}
|
1269
|
}
|
|
1263
|
// 如果剩余金额已经小于等于 0,停止选择
|
1270
|
// 如果剩余金额已经小于等于 0,停止选择
|
|
1264
|
- if (remainingPrice <= 0) break;
|
1271
|
+ if (remainingPrice < 0 || remainingPrice == 0) break;
|
|
1265
|
}
|
1272
|
}
|
|
1266
|
// 遍历有效优惠券,寻找不可叠加的优惠券
|
1273
|
// 遍历有效优惠券,寻找不可叠加的优惠券
|
|
1267
|
let maxNonStackableValue = 0
|
1274
|
let maxNonStackableValue = 0
|
|
@@ -1271,7 +1278,7 @@ Page({ |
|
@@ -1271,7 +1278,7 @@ Page({ |
|
1271
|
// 计算实际支付金额
|
1278
|
// 计算实际支付金额
|
|
1272
|
const finalAmount = amount - discountAmount;
|
1279
|
const finalAmount = amount - discountAmount;
|
|
1273
|
// 确保实际支付金额不小于0,并且是最优惠的
|
1280
|
// 确保实际支付金额不小于0,并且是最优惠的
|
|
1274
|
- if (finalAmount >= 0) {
|
1281
|
+ if (finalAmount > 0 || finalAmount == 0) {
|
|
1275
|
if (maxNonStackableValue<discountAmount) {
|
1282
|
if (maxNonStackableValue<discountAmount) {
|
|
1276
|
maxNonStackableValue = discountAmount
|
1283
|
maxNonStackableValue = discountAmount
|
|
1277
|
list2=[{...coupon}]
|
1284
|
list2=[{...coupon}]
|