|
|
@@ -82,10 +82,12 @@
|
|
|
<view class="info-item-label">菜品总价</view>
|
|
|
<view class="info-item-value">¥{{ formatPrice(foodSubtotalForDisplay) }}</view>
|
|
|
</view>
|
|
|
+ <!-- 本版本不参与服务费
|
|
|
<view class="info-item">
|
|
|
<view class="info-item-label">服务费</view>
|
|
|
<view class="info-item-value">¥{{ formatPrice(orderInfo.serviceFee ?? 0) }}</view>
|
|
|
</view>
|
|
|
+ -->
|
|
|
<view class="info-item info-item--coupon info-item--clickable" @click="onCouponRowClick">
|
|
|
<view class="info-item-label">优惠券</view>
|
|
|
<view class="info-item-value coupon-value">
|
|
|
@@ -189,10 +191,10 @@ function adjustDiners(delta) {
|
|
|
if (next < MIN_DINERS || next > MAX_DINERS) return;
|
|
|
orderInfo.value.diners = String(next);
|
|
|
uni.setStorageSync('currentDiners', String(next));
|
|
|
- // 仅当接口判定为「按人数计费」(feeType === 1) 时,改人数才重新估算服务费
|
|
|
- if (Number(estimateFeeType.value) === 1) {
|
|
|
- fetchServiceFeeEstimate().catch((err) => console.warn('按人数重算服务费失败:', err));
|
|
|
- }
|
|
|
+ // 本版本不参与服务费(恢复按人数重算时取消注释)
|
|
|
+ // if (Number(estimateFeeType.value) === 1) {
|
|
|
+ // fetchServiceFeeEstimate().catch((err) => console.warn('按人数重算服务费失败:', err));
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
// 展示用菜品小计:有明细时与行成交价一致;否则用接口 dishTotal 或 totalAmount − 服务费
|
|
|
@@ -350,9 +352,14 @@ function parseEstimateFeeType(res) {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 调用 /store/dining/service-fee/estimate,更新服务费与 estimateFeeType
|
|
|
+ * 服务费估算(本版本关闭:不参与服务费)
|
|
|
*/
|
|
|
async function fetchServiceFeeEstimate() {
|
|
|
+ orderInfo.value.serviceFee = 0;
|
|
|
+ estimateFeeType.value = null;
|
|
|
+ recalcDiscountAfterServiceFeeChange();
|
|
|
+ updateCheckoutPayAmount();
|
|
|
+ /* 原 /store/dining/service-fee/estimate 逻辑(恢复时整段移出注释)
|
|
|
const storeId = orderInfo.value.storeId || uni.getStorageSync('currentStoreId') || '';
|
|
|
const tableId = getTableIdForServiceFeeEstimate();
|
|
|
if (!storeId || !tableId) return;
|
|
|
@@ -380,6 +387,7 @@ async function fetchServiceFeeEstimate() {
|
|
|
} catch (e) {
|
|
|
console.warn('结算页服务费估算失败:', e);
|
|
|
}
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
function formatPrice(price) {
|
|
|
@@ -497,13 +505,15 @@ const fetchOrderDetail = async () => {
|
|
|
orderInfo.value.nominalValue = raw?.nominalValue ?? null;
|
|
|
orderInfo.value.discountAmount = Number(raw?.discountAmount ?? raw?.couponAmount ?? raw?.couponDiscount ?? 0) || 0;
|
|
|
orderInfo.value.payAmount = Number(raw?.payAmount ?? raw?.totalAmount ?? raw?.totalPrice ?? 0) || 0;
|
|
|
- orderInfo.value.serviceFee =
|
|
|
- Number(raw?.serviceFee ?? raw?.serviceCharge ?? raw?.tablewareFee ?? 0) || 0;
|
|
|
+ // 本版本不参与服务费:不从订单拉取服务费
|
|
|
+ // orderInfo.value.serviceFee =
|
|
|
+ // Number(raw?.serviceFee ?? raw?.serviceCharge ?? raw?.tablewareFee ?? 0) || 0;
|
|
|
+ orderInfo.value.serviceFee = 0;
|
|
|
const list = raw?.orderItemList ?? raw?.orderItems ?? raw?.items ?? raw?.detailList ?? [];
|
|
|
foodList.value = (Array.isArray(list) ? list : []).map(normalizeOrderItem);
|
|
|
selectedCouponId.value = orderInfo.value.couponId != null && orderInfo.value.couponId !== '' ? String(orderInfo.value.couponId) : null;
|
|
|
updateCheckoutPayAmount();
|
|
|
- await fetchServiceFeeEstimate();
|
|
|
+ await fetchServiceFeeEstimate(); // 本版为 no-op(不参与服务费)
|
|
|
} catch (err) {
|
|
|
console.error('获取订单详情失败:', err);
|
|
|
uni.showToast({ title: '加载失败', icon: 'none' });
|
|
|
@@ -545,7 +555,7 @@ const handleConfirmPay = async () => {
|
|
|
? String(selectedCouponId.value)
|
|
|
: '';
|
|
|
const discountAmountVal = Number(orderInfo.value.discountAmount) || 0;
|
|
|
- const serviceFeeVal = Math.round((Number(orderInfo.value.serviceFee ?? 0) || 0) * 100) / 100;
|
|
|
+ // const serviceFeeVal = Math.round((Number(orderInfo.value.serviceFee ?? 0) || 0) * 100) / 100;
|
|
|
const res = await diningApi.PostOrderPay({
|
|
|
orderNo,
|
|
|
payer: openid,
|
|
|
@@ -555,8 +565,8 @@ const handleConfirmPay = async () => {
|
|
|
couponId: couponIdVal || undefined,
|
|
|
payerId: payerId ? String(payerId) : undefined,
|
|
|
discountAmount: discountAmountVal,
|
|
|
- payAmount: payAmountVal,
|
|
|
- serviceFee: serviceFeeVal
|
|
|
+ payAmount: payAmountVal
|
|
|
+ // serviceFee: serviceFeeVal // 本版本不参与服务费
|
|
|
});
|
|
|
uni.hideLoading();
|
|
|
uni.requestPayment({
|