|
|
@@ -363,8 +363,8 @@ const handleConfirmPay = async () => {
|
|
|
uni.showToast({ title: '请先登录', icon: 'none' });
|
|
|
return;
|
|
|
}
|
|
|
- const priceAmount = Number(orderInfo.value.payAmount ?? 0) || 0;
|
|
|
- if (priceAmount <= 0) {
|
|
|
+ const payAmountVal = Math.round((Number(orderInfo.value.payAmount ?? 0) || 0) * 100) / 100;
|
|
|
+ if (payAmountVal <= 0) {
|
|
|
uni.showToast({ title: '订单金额异常', icon: 'none' });
|
|
|
return;
|
|
|
}
|
|
|
@@ -373,7 +373,7 @@ const handleConfirmPay = async () => {
|
|
|
uni.showToast({ title: '缺少订单号', icon: 'none' });
|
|
|
return;
|
|
|
}
|
|
|
- const price = Math.round(priceAmount * 100);
|
|
|
+ const price = Math.round(payAmountVal * 100);
|
|
|
uni.showLoading({ title: '拉起支付...' });
|
|
|
try {
|
|
|
const storeId = orderInfo.value.storeId || uni.getStorageSync('currentStoreId') || '';
|
|
|
@@ -385,6 +385,8 @@ const handleConfirmPay = async () => {
|
|
|
: selectedCouponId.value != null && selectedCouponId.value !== ''
|
|
|
? String(selectedCouponId.value)
|
|
|
: '';
|
|
|
+ const tablewareFeeVal = Number(orderInfo.value.utensilFee) || 0;
|
|
|
+ const discountAmountVal = Number(orderInfo.value.discountAmount) || 0;
|
|
|
const res = await diningApi.PostOrderPay({
|
|
|
orderNo,
|
|
|
payer: openid,
|
|
|
@@ -392,7 +394,10 @@ const handleConfirmPay = async () => {
|
|
|
subject: '订单支付',
|
|
|
storeId: storeId || undefined,
|
|
|
couponId: couponIdVal || undefined,
|
|
|
- payerId: payerId ? String(payerId) : undefined
|
|
|
+ payerId: payerId ? String(payerId) : undefined,
|
|
|
+ tablewareFee: tablewareFeeVal,
|
|
|
+ discountAmount: discountAmountVal,
|
|
|
+ payAmount: payAmountVal
|
|
|
});
|
|
|
uni.hideLoading();
|
|
|
uni.requestPayment({
|