@pisell/private-materials 6.4.5 → 6.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +4 -4
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/footer/amount.d.ts +6 -2
- package/es/components/booking/components/footer/amount.js +77 -55
- package/es/components/booking/components/footer/index.js +11 -11
- package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -1
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/footer.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/hooks/useQuotation.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/header/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/notes/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/es/components/booking/notes/addNote/index.d.ts +0 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.d.ts +1 -0
- package/es/components/checkout/PaymentModal.js +22 -19
- package/es/components/checkout/PaymentPlugin.d.ts +0 -1
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +0 -1
- package/es/components/checkout/components/WalletPassModule/components/DiscountWallet/DiscountTextMode.js +6 -1
- package/es/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +0 -1
- package/es/components/checkout/components/WalletPassModule/components/WalletPassTextMode/index.js +6 -1
- package/es/components/checkout/utils/PaymentResultToastUtils.js +2 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/linkly/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toB/components/Cache/index.d.ts +0 -1
- package/es/components/pay/toB/components/Card/index.d.ts +0 -1
- package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/es/components/pay/toB/components/Content/Footer.d.ts +0 -1
- package/es/components/pay/toB/components/Content/Header.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/es/components/taxSelect/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/menuBar/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +46 -4
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/locales.d.ts +12 -0
- package/es/components/ticketBooking/locales.js +15 -3
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/es/plus/noteModal/AddTempModal.d.ts +0 -1
- package/es/plus/saasCreateOrganization/index.d.ts +0 -1
- package/es/pro/pisellPhoneKeyboard/index.d.ts +0 -1
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/amount.d.ts +6 -2
- package/lib/components/booking/components/footer/amount.js +63 -38
- package/lib/components/booking/components/footer/index.js +2 -2
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/footer.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/hooks/useQuotation.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/header/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/notes/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/lib/components/booking/notes/addNote/index.d.ts +0 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.d.ts +1 -0
- package/lib/components/checkout/PaymentModal.js +15 -16
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -1
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +0 -1
- package/lib/components/checkout/components/WalletPassModule/components/DiscountWallet/DiscountTextMode.js +3 -1
- package/lib/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +0 -1
- package/lib/components/checkout/components/WalletPassModule/components/WalletPassTextMode/index.js +3 -1
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +2 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/linkly/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toB/components/Cache/index.d.ts +0 -1
- package/lib/components/pay/toB/components/Card/index.d.ts +0 -1
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/lib/components/pay/toB/components/Content/Footer.d.ts +0 -1
- package/lib/components/pay/toB/components/Content/Header.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/lib/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/lib/components/taxSelect/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +31 -2
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/locales.d.ts +12 -0
- package/lib/components/ticketBooking/locales.js +15 -3
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/lib/plus/noteModal/AddTempModal.d.ts +0 -1
- package/lib/plus/saasCreateOrganization/index.d.ts +0 -1
- package/lib/pro/pisellPhoneKeyboard/index.d.ts +0 -1
- package/package.json +1 -1
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
30
30
|
* @return {*}
|
31
31
|
* @Author: xiangfeng.xue
|
32
32
|
*/
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00"
|
33
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
34
34
|
/**
|
35
35
|
* 计算所有价格明细
|
36
36
|
* @param items - 购物车商品数组
|
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from "../model";
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
+
state: FormState;
|
5
|
+
} & {
|
6
|
+
dispatch: (params: {
|
7
|
+
type: string;
|
8
|
+
payload: any;
|
9
|
+
}) => void;
|
10
|
+
}>;
|
@@ -3,10 +3,14 @@ export declare const getIsPriceIncludeTax: (state: any) => any;
|
|
3
3
|
/**
|
4
4
|
* 总金额
|
5
5
|
* @param state
|
6
|
-
* @param options
|
6
|
+
* @param options isEdit: 预约信息是否发生变动
|
7
7
|
* @returns
|
8
8
|
*/
|
9
|
-
export declare const getSumTotal: (state: any,
|
9
|
+
export declare const getSumTotal: (state: any, options: {
|
10
|
+
[key: string]: any;
|
11
|
+
isEdit: boolean;
|
12
|
+
ScheduleModule: any;
|
13
|
+
}) => {
|
10
14
|
productAmount: number;
|
11
15
|
duration: string;
|
12
16
|
tax: number;
|
@@ -1,7 +1,4 @@
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
var _excluded = ["isEdit", "ScheduleModule"];
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
6
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
7
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -192,7 +189,6 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
192
189
|
// 计算原始税费(折扣前)- 单个商品
|
193
190
|
var originalTaxPerItem = getProductItemTax(_objectSpread(_objectSpread({}, item), {}, {
|
194
191
|
total: unitPrice.toNumber(),
|
195
|
-
price: item._extend.total,
|
196
192
|
quantity: 1
|
197
193
|
}), state, {
|
198
194
|
tax_rate: tax_rate,
|
@@ -222,9 +218,40 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
222
218
|
item._extend.original_tax_fee = originalTaxPerItem.toNumber();
|
223
219
|
item._extend.tax_fee = discountedTaxPerItem.toNumber();
|
224
220
|
|
221
|
+
// 注意:加时商品独立计算,不考虑主商品数量
|
222
|
+
var addTimeTotalTax = new Decimal(0);
|
223
|
+
if (Array.isArray(item._extend.relation_details)) {
|
224
|
+
var _iterator5 = _createForOfIteratorHelper(item._extend.relation_details),
|
225
|
+
_step5;
|
226
|
+
try {
|
227
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
228
|
+
var atItem = _step5.value;
|
229
|
+
// 计算单件加时商品折扣后价格
|
230
|
+
var _originTotal = new Decimal(atItem.selling_price || atItem.price || 0);
|
231
|
+
var _discountedTotal = _originTotal;
|
232
|
+
if (productExpectAmount > 0) {
|
233
|
+
_discountedTotal = _originTotal.minus(_originTotal.dividedBy(productExpectAmount).times(shopDiscount));
|
234
|
+
}
|
235
|
+
var addTimeTaxPerItem = getProductItemTax(_objectSpread(_objectSpread({}, atItem), {}, {
|
236
|
+
total: _discountedTotal,
|
237
|
+
// 可能包含原有数据,或前端临时数据
|
238
|
+
quantity: atItem.product_quantity || atItem.num || 1
|
239
|
+
}), state, {
|
240
|
+
tax_rate: tax_rate,
|
241
|
+
is_price_include_tax: is_price_include_tax
|
242
|
+
});
|
243
|
+
addTimeTotalTax = addTimeTotalTax.plus(addTimeTaxPerItem);
|
244
|
+
}
|
245
|
+
} catch (err) {
|
246
|
+
_iterator5.e(err);
|
247
|
+
} finally {
|
248
|
+
_iterator5.f();
|
249
|
+
}
|
250
|
+
}
|
251
|
+
|
225
252
|
// 累加到总税费(乘以数量)
|
226
|
-
originTax = originTax.plus(originalTaxPerItem.times(quantity));
|
227
|
-
tax = tax.plus(discountedTaxPerItem.times(quantity));
|
253
|
+
originTax = originTax.plus(originalTaxPerItem.times(quantity)).plus(addTimeTotalTax);
|
254
|
+
tax = tax.plus(discountedTaxPerItem.times(quantity)).plus(addTimeTotalTax);
|
228
255
|
}
|
229
256
|
} catch (err) {
|
230
257
|
_iterator4.e(err);
|
@@ -406,13 +433,14 @@ var isProductMatchSurchargeCondition = function isProductMatchSurchargeCondition
|
|
406
433
|
* @param options 包含 ScheduleModule 和其他附加费计算所需参数
|
407
434
|
*/
|
408
435
|
var getSurcharge = function getSurcharge(state, options) {
|
409
|
-
var
|
436
|
+
var isEdit = options.isEdit,
|
437
|
+
ScheduleModule = options.ScheduleModule,
|
410
438
|
surcharge_list = options.surcharge_list,
|
411
439
|
scheduleById = options.scheduleById;
|
412
440
|
var bookingDetail = state.bookingDetail,
|
413
441
|
bookingId = state.bookingId;
|
414
|
-
//
|
415
|
-
if (bookingId) {
|
442
|
+
// 编辑状态, 且未修改商品时直接从详情取出
|
443
|
+
if (!isEdit && bookingId) {
|
416
444
|
if (Array.isArray(bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.surcharge)) {
|
417
445
|
var _state$bookingDetail3;
|
418
446
|
return (((_state$bookingDetail3 = state.bookingDetail) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.surcharge) || []).map(function (d, index) {
|
@@ -459,52 +487,52 @@ var getSurcharge = function getSurcharge(state, options) {
|
|
459
487
|
|
460
488
|
// 检查service中符合条件的商品
|
461
489
|
if (Array.isArray(service === null || service === void 0 ? void 0 : service.value)) {
|
462
|
-
var
|
463
|
-
|
490
|
+
var _iterator6 = _createForOfIteratorHelper(service.value),
|
491
|
+
_step6;
|
464
492
|
try {
|
465
|
-
for (
|
466
|
-
var item =
|
493
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
494
|
+
var item = _step6.value;
|
467
495
|
if (isProductMatchSurchargeCondition(item, {
|
468
496
|
surchargeConfig: surchargeConfig,
|
469
497
|
scheduleById: scheduleById || {},
|
470
498
|
ScheduleModule: ScheduleModule
|
471
499
|
})) {
|
472
500
|
matchedItems.push({
|
473
|
-
total: Number(item._extend.
|
474
|
-
|
501
|
+
total: Number(item._extend.total),
|
502
|
+
addTimeTotal: getRelationDetailsTotal(item._extend.relation_details || []),
|
475
503
|
quantity: item._extend.quantity || 1
|
476
504
|
});
|
477
505
|
}
|
478
506
|
}
|
479
507
|
} catch (err) {
|
480
|
-
|
508
|
+
_iterator6.e(err);
|
481
509
|
} finally {
|
482
|
-
|
510
|
+
_iterator6.f();
|
483
511
|
}
|
484
512
|
}
|
485
513
|
|
486
514
|
// 检查addons中符合条件的商品
|
487
515
|
if (Array.isArray(addons === null || addons === void 0 ? void 0 : addons.value)) {
|
488
|
-
var
|
489
|
-
|
516
|
+
var _iterator7 = _createForOfIteratorHelper(addons.value),
|
517
|
+
_step7;
|
490
518
|
try {
|
491
|
-
for (
|
492
|
-
var _item2 =
|
519
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
520
|
+
var _item2 = _step7.value;
|
493
521
|
if (isProductMatchSurchargeCondition(_item2, {
|
494
522
|
surchargeConfig: surchargeConfig,
|
495
523
|
scheduleById: scheduleById || {},
|
496
524
|
ScheduleModule: ScheduleModule
|
497
525
|
})) {
|
498
526
|
matchedItems.push({
|
499
|
-
total: Number(_item2._extend.
|
527
|
+
total: Number(_item2._extend.total),
|
500
528
|
quantity: _item2._extend.quantity || 1
|
501
529
|
});
|
502
530
|
}
|
503
531
|
}
|
504
532
|
} catch (err) {
|
505
|
-
|
533
|
+
_iterator7.e(err);
|
506
534
|
} finally {
|
507
|
-
|
535
|
+
_iterator7.f();
|
508
536
|
}
|
509
537
|
}
|
510
538
|
var finalAmount = 0;
|
@@ -515,21 +543,22 @@ var getSurcharge = function getSurcharge(state, options) {
|
|
515
543
|
// 计算百分比附加费 - 对每个商品单独计算
|
516
544
|
if (percentage && new Decimal(percentage).gt(0)) {
|
517
545
|
var percentageRate = new Decimal(percentage);
|
518
|
-
var
|
519
|
-
|
546
|
+
var _iterator8 = _createForOfIteratorHelper(matchedItems),
|
547
|
+
_step8;
|
520
548
|
try {
|
521
|
-
for (
|
522
|
-
var _item3 =
|
549
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
550
|
+
var _item3 = _step8.value;
|
523
551
|
// 对每个商品:max(0, 价格) * 数量 * 费率
|
524
552
|
var itemPrice = new Decimal(Math.max(0, _item3.total || 0));
|
525
553
|
var itemQuantity = new Decimal(_item3.quantity || 1);
|
526
|
-
var
|
554
|
+
var addTimeTotal = new Decimal(_item3.addTimeTotal || 0);
|
555
|
+
var itemSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
|
527
556
|
configTotal = configTotal.plus(itemSurcharge);
|
528
557
|
}
|
529
558
|
} catch (err) {
|
530
|
-
|
559
|
+
_iterator8.e(err);
|
531
560
|
} finally {
|
532
|
-
|
561
|
+
_iterator8.f();
|
533
562
|
}
|
534
563
|
}
|
535
564
|
|
@@ -564,12 +593,16 @@ var getSurcharge = function getSurcharge(state, options) {
|
|
564
593
|
* @param state
|
565
594
|
* @returns
|
566
595
|
*/
|
567
|
-
var getSurchargeAmount = function getSurchargeAmount(state, surcharge) {
|
596
|
+
var getSurchargeAmount = function getSurchargeAmount(state, surcharge, options) {
|
568
597
|
var bookingDetail = state.bookingDetail,
|
569
598
|
bookingId = state.bookingId;
|
570
|
-
|
571
|
-
|
572
|
-
|
599
|
+
var isEdit = options.isEdit;
|
600
|
+
// 订单未变更过
|
601
|
+
if (!isEdit) {
|
602
|
+
// 有后端数据则直接使用后端的数据
|
603
|
+
if (bookingDetail && bookingId) {
|
604
|
+
return Number(bookingDetail.surcharge_fee);
|
605
|
+
}
|
573
606
|
}
|
574
607
|
if (!Array.isArray(surcharge)) return 0;
|
575
608
|
// 新增状态使用 getSurcharge 的返回值进行求和
|
@@ -617,7 +650,6 @@ var getExpectAmount = function getExpectAmount(_ref2) {
|
|
617
650
|
state = _ref2.state,
|
618
651
|
options = _ref2.options;
|
619
652
|
var _tax = tax;
|
620
|
-
|
621
653
|
// 如果价格含税, 则将税费改为0
|
622
654
|
if (getIsPriceIncludeTax(state) || options !== null && options !== void 0 && options.is_price_include_tax) {
|
623
655
|
_tax = 0;
|
@@ -647,15 +679,12 @@ var getSumTotalAmount = function getSumTotalAmount(_ref3) {
|
|
647
679
|
/**
|
648
680
|
* 总金额
|
649
681
|
* @param state
|
650
|
-
* @param options
|
682
|
+
* @param options isEdit: 预约信息是否发生变动
|
651
683
|
* @returns
|
652
684
|
*/
|
653
|
-
export var getSumTotal = function getSumTotal(state,
|
654
|
-
var isEdit = _ref4.isEdit,
|
655
|
-
ScheduleModule = _ref4.ScheduleModule,
|
656
|
-
rest = _objectWithoutProperties(_ref4, _excluded);
|
685
|
+
export var getSumTotal = function getSumTotal(state, options) {
|
657
686
|
// 商品总金额, 包含 商品折扣 报价单 子商品
|
658
|
-
var _getProductExpectAmou = getProductExpectAmount(state, isEdit),
|
687
|
+
var _getProductExpectAmou = getProductExpectAmount(state, options.isEdit),
|
659
688
|
productExpectAmount = _getProductExpectAmou.productExpectAmount,
|
660
689
|
duration = _getProductExpectAmou.duration;
|
661
690
|
|
@@ -669,11 +698,9 @@ export var getSumTotal = function getSumTotal(state, _ref4) {
|
|
669
698
|
var paySurchargeFee = getPaySurchargeFee(state);
|
670
699
|
|
671
700
|
// 订单附加费列表
|
672
|
-
var surcharge = getSurcharge(state,
|
673
|
-
ScheduleModule: ScheduleModule
|
674
|
-
}, rest));
|
701
|
+
var surcharge = getSurcharge(state, options);
|
675
702
|
// 订单附加费金额
|
676
|
-
var surchargeAmount = getSurchargeAmount(state, surcharge);
|
703
|
+
var surchargeAmount = getSurchargeAmount(state, surcharge, options);
|
677
704
|
|
678
705
|
// 算出整单折扣的百分比 shopDiscount / productExpectAmount
|
679
706
|
var computed = {
|
@@ -682,12 +709,11 @@ export var getSumTotal = function getSumTotal(state, _ref4) {
|
|
682
709
|
};
|
683
710
|
// 税费
|
684
711
|
var _getTax = getTax(state, _objectSpread({
|
685
|
-
isEdit: isEdit,
|
686
712
|
computed: computed
|
687
|
-
},
|
713
|
+
}, options)),
|
688
714
|
tax = _getTax.tax,
|
689
715
|
originTax = _getTax.originTax;
|
690
|
-
var taxInfo = getTaxInfo(state,
|
716
|
+
var taxInfo = getTaxInfo(state, options);
|
691
717
|
|
692
718
|
// 已付金额 (包含手续费)
|
693
719
|
var paidAmount = getPaidAmount(state);
|
@@ -705,9 +731,7 @@ export var getSumTotal = function getSumTotal(state, _ref4) {
|
|
705
731
|
surchargeAmount: surchargeAmount,
|
706
732
|
shopDiscount: shopDiscount,
|
707
733
|
state: state,
|
708
|
-
options:
|
709
|
-
isEdit: isEdit
|
710
|
-
}, rest)
|
734
|
+
options: options
|
711
735
|
});
|
712
736
|
|
713
737
|
// 订单原价(不包含整单折扣的价格)
|
@@ -717,9 +741,7 @@ export var getSumTotal = function getSumTotal(state, _ref4) {
|
|
717
741
|
surchargeAmount: surchargeAmount,
|
718
742
|
shopDiscount: 0,
|
719
743
|
state: state,
|
720
|
-
options:
|
721
|
-
isEdit: isEdit
|
722
|
-
}, rest)
|
744
|
+
options: options
|
723
745
|
});
|
724
746
|
|
725
747
|
// 总支付金额 总计
|
@@ -606,7 +606,7 @@ var Footer = function Footer(props) {
|
|
606
606
|
case 0:
|
607
607
|
isNewOrder = !state.bookingId; // 如果有编辑内容, 则先保存
|
608
608
|
if (!isEdit) {
|
609
|
-
_context4.next =
|
609
|
+
_context4.next = 25;
|
610
610
|
break;
|
611
611
|
}
|
612
612
|
if (!isDayBooking(state)) {
|
@@ -621,7 +621,7 @@ var Footer = function Footer(props) {
|
|
621
621
|
return _context4.abrupt("return");
|
622
622
|
case 6:
|
623
623
|
if (!state.isBookingTicket2) {
|
624
|
-
_context4.next =
|
624
|
+
_context4.next = 19;
|
625
625
|
break;
|
626
626
|
}
|
627
627
|
_context4.next = 9;
|
@@ -648,7 +648,6 @@ var Footer = function Footer(props) {
|
|
648
648
|
showDetail: showDetail
|
649
649
|
}
|
650
650
|
};
|
651
|
-
console.log('💳 Footer: Setting payment modal data:', modalData);
|
652
651
|
setPaymentModalData(modalData);
|
653
652
|
setIsPaymentModalOpen(true); // 打开 modal
|
654
653
|
setCheckoutLoading(false);
|
@@ -682,24 +681,24 @@ var Footer = function Footer(props) {
|
|
682
681
|
}
|
683
682
|
};
|
684
683
|
});
|
685
|
-
_context4.next =
|
684
|
+
_context4.next = 24;
|
686
685
|
break;
|
687
|
-
case
|
688
|
-
_context4.next =
|
686
|
+
case 19:
|
687
|
+
_context4.next = 21;
|
689
688
|
return handleSave({
|
690
689
|
type: 'checkout',
|
691
690
|
messageShow: !(isTerminal !== null && isTerminal !== void 0 && isTerminal())
|
692
691
|
});
|
693
|
-
case
|
692
|
+
case 21:
|
694
693
|
_res = _context4.sent;
|
695
694
|
// goCheckout2(res);
|
696
695
|
console.log(_res);
|
697
696
|
goCheckout((_res === null || _res === void 0 ? void 0 : _res.order_id) || state.bookingId, isNewOrder);
|
698
|
-
case
|
697
|
+
case 24:
|
699
698
|
return _context4.abrupt("return");
|
700
|
-
case
|
699
|
+
case 25:
|
701
700
|
return _context4.abrupt("return", goCheckout(state.bookingId, isNewOrder));
|
702
|
-
case
|
701
|
+
case 26:
|
703
702
|
case "end":
|
704
703
|
return _context4.stop();
|
705
704
|
}
|
@@ -1792,7 +1791,8 @@ var Footer = function Footer(props) {
|
|
1792
1791
|
onConfirm: handleNoteConfirm,
|
1793
1792
|
onDelete: handleNoteDelete,
|
1794
1793
|
onCancel: handleNoteCancel
|
1795
|
-
}),
|
1794
|
+
}), /*#__PURE__*/React.createElement(PaymentModal, {
|
1795
|
+
open: isPaymentModalOpen,
|
1796
1796
|
data: paymentModalData,
|
1797
1797
|
callback: paymentCallback || undefined,
|
1798
1798
|
state: state,
|
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from "../model";
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
+
state: FormState;
|
5
|
+
} & {
|
6
|
+
dispatch: (params: {
|
7
|
+
type: string;
|
8
|
+
payload: any;
|
9
|
+
}) => void;
|
10
|
+
}>;
|
@@ -1,5 +1,14 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from '../model';
|
1
3
|
export declare const walkInData: {
|
2
4
|
id: number;
|
3
5
|
nickname: string;
|
4
6
|
};
|
5
|
-
export declare const Provider: any, Context:
|
7
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
8
|
+
state: FormState;
|
9
|
+
} & {
|
10
|
+
dispatch: (params: {
|
11
|
+
type: string;
|
12
|
+
payload: any;
|
13
|
+
}) => void;
|
14
|
+
}>;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
export interface FormState {
|
2
3
|
amountSymbol: string;
|
3
4
|
apis: {
|
@@ -105,4 +106,11 @@ export declare const walkInData: {
|
|
105
106
|
id: number;
|
106
107
|
nickname: string;
|
107
108
|
};
|
108
|
-
export declare const Provider: any, Context:
|
109
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
110
|
+
state: FormState;
|
111
|
+
} & {
|
112
|
+
dispatch: (params: {
|
113
|
+
type: string;
|
114
|
+
payload: any;
|
115
|
+
}) => void;
|
116
|
+
}>;
|
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from "../model";
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
+
state: FormState;
|
5
|
+
} & {
|
6
|
+
dispatch: (params: {
|
7
|
+
type: string;
|
8
|
+
payload: any;
|
9
|
+
}) => void;
|
10
|
+
}>;
|
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from "../model";
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
+
state: FormState;
|
5
|
+
} & {
|
6
|
+
dispatch: (params: {
|
7
|
+
type: string;
|
8
|
+
payload: any;
|
9
|
+
}) => void;
|
10
|
+
}>;
|
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
165
165
|
export declare const getDuration: (duration: number | {
|
166
166
|
type: string;
|
167
167
|
value: number;
|
168
|
-
}) => number | {
|
168
|
+
}) => number | "flexible" | {
|
169
169
|
type: string;
|
170
170
|
value: number;
|
171
|
-
}
|
171
|
+
};
|
172
172
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
173
173
|
export declare const getIsEdit: (state: any) => boolean;
|
174
174
|
export {};
|