@pisell/private-materials 6.4.46 → 6.4.48
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +0 -1
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +22 -13
- package/es/components/booking/components/voucher/index.d.ts +1 -0
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/footer.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/hooks/useQuotation.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +60 -22
- package/es/components/checkout/components/AdditionalModule/index.less +1 -1
- package/es/components/checkout/components/AmountSummary/index.js +18 -14
- package/es/components/checkout/components/AmountSummary/index.less +13 -0
- package/es/components/checkout/components/CashPaymentModule/index.js +4 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +48 -44
- package/es/components/checkout/components/PaymentOptionsModule/index.less +0 -6
- package/es/components/checkout/components/PaymentResultToast/index.js +38 -8
- package/es/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/es/components/checkout/components/WalletPassModule/utils.js +6 -5
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +9 -4
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +4 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/ticketBooking/components/menuBar/index.js +3 -1
- package/es/components/ticketBooking/components/menuBar/index.less +7 -0
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/es/plus/saasLogin/utils.d.ts +5 -5
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +0 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +39 -15
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +55 -32
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +3 -3
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +0 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +8 -1
- package/lib/components/booking/components/voucher/index.d.ts +1 -0
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/forms/footer.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +48 -18
- package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
- package/lib/components/checkout/components/AmountSummary/index.js +7 -11
- package/lib/components/checkout/components/AmountSummary/index.less +13 -0
- package/lib/components/checkout/components/CashPaymentModule/index.js +3 -1
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +47 -56
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +0 -6
- package/lib/components/checkout/components/PaymentResultToast/index.js +26 -1
- package/lib/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/lib/components/checkout/components/WalletPassModule/utils.js +5 -4
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +9 -6
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +4 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/ticketBooking/components/menuBar/index.js +1 -1
- package/lib/components/ticketBooking/components/menuBar/index.less +7 -0
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/plus/saasLogin/utils.d.ts +5 -5
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +0 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +68 -37
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +51 -32
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +3 -3
- package/package.json +12 -12
@@ -1,14 +1 @@
|
|
1
|
-
|
2
|
-
interface RechargeState {
|
3
|
-
total: number;
|
4
|
-
setup?: 'menu' | 'list' | 'detail' | string;
|
5
|
-
}
|
6
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
7
|
-
state: RechargeState;
|
8
|
-
} & {
|
9
|
-
dispatch: (params: {
|
10
|
-
type: string;
|
11
|
-
payload: any;
|
12
|
-
}) => void;
|
13
|
-
}>;
|
14
|
-
export {};
|
1
|
+
export declare const Provider: any, Context: any;
|
@@ -1,13 +1 @@
|
|
1
|
-
|
2
|
-
interface RechargeState {
|
3
|
-
total: number;
|
4
|
-
}
|
5
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
6
|
-
state: RechargeState;
|
7
|
-
} & {
|
8
|
-
dispatch: (params: {
|
9
|
-
type: string;
|
10
|
-
payload: any;
|
11
|
-
}) => void;
|
12
|
-
}>;
|
13
|
-
export {};
|
1
|
+
export declare const Provider: any, Context: any;
|
@@ -1,29 +1 @@
|
|
1
|
-
|
2
|
-
interface RechargeState {
|
3
|
-
selectedGiftOptionId: string | null;
|
4
|
-
cardList: Array<{
|
5
|
-
id: string;
|
6
|
-
name: string;
|
7
|
-
price: number;
|
8
|
-
}>;
|
9
|
-
selectedItem: {
|
10
|
-
id?: string;
|
11
|
-
gift_price?: number;
|
12
|
-
price?: number;
|
13
|
-
name?: string;
|
14
|
-
variant_id?: string;
|
15
|
-
};
|
16
|
-
productId?: string;
|
17
|
-
detailId?: string;
|
18
|
-
total: string | number;
|
19
|
-
rechargeModalOpen: boolean;
|
20
|
-
}
|
21
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
22
|
-
state: RechargeState;
|
23
|
-
} & {
|
24
|
-
dispatch: (params: {
|
25
|
-
type: string;
|
26
|
-
payload: any;
|
27
|
-
}) => void;
|
28
|
-
}>;
|
29
|
-
export {};
|
1
|
+
export declare const Provider: any, Context: any;
|
@@ -1,13 +1 @@
|
|
1
|
-
|
2
|
-
interface RechargeState {
|
3
|
-
total: 0;
|
4
|
-
}
|
5
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
6
|
-
state: RechargeState;
|
7
|
-
} & {
|
8
|
-
dispatch: (params: {
|
9
|
-
type: string;
|
10
|
-
payload: any;
|
11
|
-
}) => void;
|
12
|
-
}>;
|
13
|
-
export {};
|
1
|
+
export declare const Provider: any, Context: any;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { IWalletListItemProps } from './serve';
|
3
2
|
export interface WalletCardItemProps {
|
4
3
|
id: string;
|
@@ -27,11 +26,4 @@ export interface WalletListProps {
|
|
27
26
|
currentSearchListItemCode?: string;
|
28
27
|
[key: string]: any;
|
29
28
|
}
|
30
|
-
export declare const Provider:
|
31
|
-
global_wallet: WalletListProps;
|
32
|
-
} & {
|
33
|
-
dispatch: (params: {
|
34
|
-
type: string;
|
35
|
-
payload: any;
|
36
|
-
}) => void;
|
37
|
-
}>;
|
29
|
+
export declare const Provider: any, Context: any;
|
@@ -5,13 +5,13 @@ export declare const mergeData: (locales: any, props: SaasLoginProps) => {
|
|
5
5
|
width?: number | undefined;
|
6
6
|
height?: number | undefined;
|
7
7
|
};
|
8
|
-
logoPosition: "
|
8
|
+
logoPosition: "left" | "right" | "center";
|
9
9
|
welcomeMessage: any;
|
10
|
-
welcomeMessageAlign: "
|
10
|
+
welcomeMessageAlign: "left" | "right" | "center";
|
11
11
|
title: any;
|
12
|
-
titleAlign: "
|
12
|
+
titleAlign: "left" | "right" | "center";
|
13
13
|
subtitle: any;
|
14
|
-
subtitleAlign: "
|
14
|
+
subtitleAlign: "left" | "right" | "center";
|
15
15
|
emailLabel: any;
|
16
16
|
emailPlaceholder: any;
|
17
17
|
passwordLabel: any;
|
@@ -19,7 +19,7 @@ export declare const mergeData: (locales: any, props: SaasLoginProps) => {
|
|
19
19
|
buttonText: any;
|
20
20
|
registerText: any;
|
21
21
|
registerLinkText: any;
|
22
|
-
registerAlign: "
|
22
|
+
registerAlign: "left" | "right" | "center";
|
23
23
|
showLogo?: boolean | undefined;
|
24
24
|
showWelcomeMessage?: boolean | undefined;
|
25
25
|
showTitle?: boolean | undefined;
|
@@ -21,12 +21,14 @@ import { useControllableValue } from 'ahooks';
|
|
21
21
|
import { merge, omit } from 'lodash';
|
22
22
|
//@ts-ignore
|
23
23
|
import { locales } from '@pisell/utils';
|
24
|
-
import {
|
24
|
+
import { VirtualInput } from '@pisell/materials';
|
25
25
|
import Shortcuts from "../shortcuts";
|
26
26
|
import CashKeyboardSimple from "./CashKeyboardSimple";
|
27
27
|
import { setKeyboardTheme } from "../../utils";
|
28
28
|
import "./index.less";
|
29
29
|
import Decimal from 'decimal.js';
|
30
|
+
import { AutoResizeText } from '@pisell/materials';
|
31
|
+
import { formatAmountWithOptions } from '@pisell/utils';
|
30
32
|
var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
31
33
|
var _mergedDisplayField$b, _mergedDisplayField$c, _mergedDisplayField$c2;
|
32
34
|
var amountSymbol = props.amountSymbol,
|
@@ -230,32 +232,49 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
230
232
|
className: "pisell-cash-keyboard-intact-container-top-label"
|
231
233
|
}, mergedDisplayField.balanceDue.label), /*#__PURE__*/React.createElement("div", {
|
232
234
|
className: "pisell-cash-keyboard-intact-container-top-value"
|
233
|
-
}, /*#__PURE__*/React.createElement(
|
234
|
-
|
235
|
+
}, /*#__PURE__*/React.createElement(AutoResizeText, {
|
236
|
+
minFontSizePx: 10,
|
237
|
+
maxFontSizePx: 14,
|
238
|
+
fontSizePrecisionPx: 0.5
|
239
|
+
}, formatAmountWithOptions(originalValue || '', amountSymbol, {
|
240
|
+
precision: 2,
|
235
241
|
hideDecimalForWholeNumbers: false,
|
236
|
-
|
237
|
-
}))), ((_mergedDisplayField$c = mergedDisplayField.cashReceived) === null || _mergedDisplayField$c === void 0 ? void 0 : _mergedDisplayField$c.visible) && /*#__PURE__*/React.createElement(
|
238
|
-
|
239
|
-
focused: true,
|
240
|
-
wrapperStyle: _objectSpread(_objectSpread({}, getGridStyle(1)), {}, {
|
242
|
+
showCurrencySymbol: true
|
243
|
+
})))), ((_mergedDisplayField$c = mergedDisplayField.cashReceived) === null || _mergedDisplayField$c === void 0 ? void 0 : _mergedDisplayField$c.visible) && /*#__PURE__*/React.createElement("div", {
|
244
|
+
style: _objectSpread(_objectSpread({}, getGridStyle(1)), {}, {
|
241
245
|
padding: '6px 16px',
|
242
246
|
borderRadius: '8px',
|
243
247
|
backgroundColor: 'white',
|
244
248
|
boxShadow: '0px 1px 2px rgba(16, 24, 40, 0.06)',
|
245
249
|
overflow: 'hidden',
|
246
|
-
maxWidth: 188
|
250
|
+
maxWidth: 188,
|
251
|
+
cursor: 'pointer'
|
247
252
|
}),
|
253
|
+
onClick: function onClick() {
|
254
|
+
setIsShowModal(true);
|
255
|
+
}
|
256
|
+
}, /*#__PURE__*/React.createElement(VirtualInput, {
|
257
|
+
showCursor: false,
|
258
|
+
focused: true,
|
259
|
+
wrapperStyle: {
|
260
|
+
width: '100%'
|
261
|
+
},
|
248
262
|
topContent: /*#__PURE__*/React.createElement("div", {
|
249
263
|
style: {
|
250
264
|
fontSize: '14px',
|
251
265
|
color: '#667085'
|
252
266
|
}
|
253
267
|
}, mergedDisplayField.cashReceived.label),
|
254
|
-
value: internalValue ? /*#__PURE__*/React.createElement(
|
268
|
+
value: internalValue ? /*#__PURE__*/React.createElement(AutoResizeText, {
|
269
|
+
minFontSizePx: 10,
|
270
|
+
maxFontSizePx: 14,
|
271
|
+
fontSizePrecisionPx: 0.5
|
272
|
+
}, formatAmountWithOptions(internalValue || '', amountSymbol, {
|
255
273
|
value: internalValue,
|
256
274
|
hideDecimalForWholeNumbers: false,
|
257
|
-
precision: 2
|
258
|
-
|
275
|
+
precision: 2,
|
276
|
+
showCurrencySymbol: true
|
277
|
+
})) : '',
|
259
278
|
height: 30,
|
260
279
|
fontSize: 20,
|
261
280
|
placeholder: placeholder,
|
@@ -266,7 +285,7 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
266
285
|
background: 'transparent',
|
267
286
|
width: '100%'
|
268
287
|
}
|
269
|
-
}), ((_mergedDisplayField$c2 = mergedDisplayField.changeDue) === null || _mergedDisplayField$c2 === void 0 ? void 0 : _mergedDisplayField$c2.visible) && /*#__PURE__*/React.createElement("div", {
|
288
|
+
})), ((_mergedDisplayField$c2 = mergedDisplayField.changeDue) === null || _mergedDisplayField$c2 === void 0 ? void 0 : _mergedDisplayField$c2.visible) && /*#__PURE__*/React.createElement("div", {
|
270
289
|
className: "pisell-cash-keyboard-intact-container-top",
|
271
290
|
style: _objectSpread(_objectSpread({}, getGridStyle(2)), {}, {
|
272
291
|
overflow: 'hidden'
|
@@ -275,11 +294,16 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
275
294
|
className: "pisell-cash-keyboard-intact-container-top-label"
|
276
295
|
}, mergedDisplayField.changeDue.label), /*#__PURE__*/React.createElement("div", {
|
277
296
|
className: "pisell-cash-keyboard-intact-container-top-value"
|
278
|
-
}, /*#__PURE__*/React.createElement(
|
297
|
+
}, /*#__PURE__*/React.createElement(AutoResizeText, {
|
298
|
+
minFontSizePx: 10,
|
299
|
+
maxFontSizePx: 14,
|
300
|
+
fontSizePrecisionPx: 0.5
|
301
|
+
}, formatAmountWithOptions(hiddenChangeDue ? 0 : changeDue, amountSymbol, {
|
279
302
|
value: hiddenChangeDue ? 0 : changeDue,
|
303
|
+
showCurrencySymbol: true,
|
280
304
|
hideDecimalForWholeNumbers: false,
|
281
305
|
precision: 2
|
282
|
-
})))), /*#__PURE__*/React.createElement(Shortcuts, {
|
306
|
+
}))))), /*#__PURE__*/React.createElement(Shortcuts, {
|
283
307
|
presets: getDefaultPresets(),
|
284
308
|
onChange: setInternalValue,
|
285
309
|
disabled: disabled
|
@@ -29,6 +29,11 @@ import { setKeyboardTheme } from "../../utils";
|
|
29
29
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
30
30
|
import localeTexts from "./locales";
|
31
31
|
import "./index.less";
|
32
|
+
var TIP_COLORS = {
|
33
|
+
positive: '#CA8504',
|
34
|
+
negative: '#1570EF',
|
35
|
+
overflow: '#D92D20'
|
36
|
+
};
|
32
37
|
|
33
38
|
/**
|
34
39
|
* originalValue: 当前订单原始值
|
@@ -120,10 +125,16 @@ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
|
|
120
125
|
}
|
121
126
|
return discountAmount.toNumber();
|
122
127
|
}, [updateMode, discountMode, internalValue, discountValue, originalValue]);
|
123
|
-
var
|
124
|
-
var
|
125
|
-
|
126
|
-
|
128
|
+
var isDiscountOverflow = useMemo(function () {
|
129
|
+
var _original = new Decimal(originalValue || 0);
|
130
|
+
if (updateMode === 'priceOverride') {
|
131
|
+
return new Decimal(internalValue || 0).greaterThan(_original);
|
132
|
+
}
|
133
|
+
if (discountMode === 'amount') {
|
134
|
+
return new Decimal(discountValue || 0).greaterThan(_original);
|
135
|
+
}
|
136
|
+
return false;
|
137
|
+
}, [updateMode, discountMode, internalValue, discountValue, originalValue]);
|
127
138
|
var payableAmount = useMemo(function () {
|
128
139
|
return new Decimal(originalValue || 0).minus(discountAmount).toNumber();
|
129
140
|
}, [originalValue, discountAmount]);
|
@@ -134,7 +145,7 @@ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
|
|
134
145
|
return;
|
135
146
|
}
|
136
147
|
// 折扣模式、或一口价有限额,则进行折扣值的校验
|
137
|
-
if (
|
148
|
+
if (isDiscountOverflow) {
|
138
149
|
return;
|
139
150
|
}
|
140
151
|
onEnter === null || onEnter === void 0 || onEnter(String(discountAmount));
|
@@ -155,7 +166,9 @@ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
|
|
155
166
|
var rightItems = useRightItems({
|
156
167
|
rightItemsStyle: {
|
157
168
|
doneButtonStyle: {
|
158
|
-
boxShadow: '0px 0px 1px #898A8D'
|
169
|
+
boxShadow: '0px 0px 1px #898A8D',
|
170
|
+
cursor: updateMode !== 'priceOverride' && isDiscountOverflow ? 'not-allowed' : undefined,
|
171
|
+
backgroundColor: updateMode !== 'priceOverride' && isDiscountOverflow ? '#D0D5DD' : undefined
|
159
172
|
}
|
160
173
|
},
|
161
174
|
doneText: doneText || locales.getText('discount-keyboard-done'),
|
@@ -182,39 +195,46 @@ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
|
|
182
195
|
}
|
183
196
|
}, [amountSymbol, updateMode, discountMode]);
|
184
197
|
var renderBottomContent = function renderBottomContent() {
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
198
|
+
// 没改价,则为空
|
199
|
+
if (new Decimal(discountAmount).equals(0)) {
|
200
|
+
return /*#__PURE__*/React.createElement("div", null, "\xA0");
|
201
|
+
}
|
202
|
+
if (updateMode === 'priceOverride' || discountMode === 'percentage') {
|
203
|
+
var color;
|
204
|
+
var sign = '';
|
205
|
+
// 折扣为正值, 展示为负
|
206
|
+
if (new Decimal(discountAmount).greaterThan(0)) {
|
207
|
+
color = TIP_COLORS.negative;
|
208
|
+
sign = '-';
|
209
|
+
} else {
|
210
|
+
sign = '+';
|
211
|
+
color = TIP_COLORS.positive;
|
212
|
+
}
|
213
|
+
var style = {
|
214
|
+
color: color
|
215
|
+
};
|
216
|
+
return /*#__PURE__*/React.createElement("div", {
|
217
|
+
style: style,
|
218
|
+
className: "ellipsis"
|
219
|
+
}, /*#__PURE__*/React.createElement("span", null, sign, /*#__PURE__*/React.createElement(PisellText.Amount, {
|
220
|
+
hideDecimalForWholeNumbers: false,
|
221
|
+
precision: 2,
|
222
|
+
value: Math.abs(discountAmount)
|
223
|
+
})));
|
224
|
+
}
|
225
|
+
return /*#__PURE__*/React.createElement("div", {
|
226
|
+
style: {
|
227
|
+
color: isDiscountOverflow ? TIP_COLORS.overflow : ''
|
228
|
+
},
|
191
229
|
className: "ellipsis"
|
192
230
|
}, locales.getText('discount-keyboard-max-discount'), ":", ' ', /*#__PURE__*/React.createElement(PisellText.Amount, {
|
193
231
|
hideDecimalForWholeNumbers: false,
|
194
232
|
precision: 2,
|
195
233
|
value: originalValue
|
196
234
|
}));
|
197
|
-
var _discountText = /*#__PURE__*/React.createElement("div", {
|
198
|
-
style: style,
|
199
|
-
className: "ellipsis"
|
200
|
-
}, locales.getText('discount-keyboard-discount-amount'), ":", ' ', /*#__PURE__*/React.createElement("span", null, sign, /*#__PURE__*/React.createElement(PisellText.Amount, {
|
201
|
-
hideDecimalForWholeNumbers: false,
|
202
|
-
precision: 2,
|
203
|
-
value: Math.abs(discountAmount)
|
204
|
-
})));
|
205
|
-
if (updateMode === 'priceOverride') {
|
206
|
-
if (isFirstInput) {
|
207
|
-
return _maxDiscount;
|
208
|
-
} else {
|
209
|
-
return _discountText;
|
210
|
-
}
|
211
|
-
}
|
212
|
-
if (updateMode === 'discount' && discountMode === 'amount') {
|
213
|
-
return _maxDiscount;
|
214
|
-
}
|
215
|
-
return _discountText;
|
216
235
|
};
|
217
236
|
var customDisplay = function customDisplay() {
|
237
|
+
var _color = updateMode === 'discount' && discountMode === 'amount' && isDiscountOverflow ? TIP_COLORS.overflow : undefined;
|
218
238
|
return /*#__PURE__*/React.createElement("div", {
|
219
239
|
style: {
|
220
240
|
display: 'flex',
|
@@ -231,6 +251,9 @@ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
|
|
231
251
|
flex: '2',
|
232
252
|
overflow: 'hidden'
|
233
253
|
},
|
254
|
+
style: {
|
255
|
+
color: _color
|
256
|
+
},
|
234
257
|
placeholder: placeholder,
|
235
258
|
bottomContent: renderBottomContent()
|
236
259
|
}), /*#__PURE__*/React.createElement("div", {
|
@@ -277,7 +300,7 @@ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
|
|
277
300
|
}
|
278
301
|
}, locales.getText('discount-keyboard-payable')), /*#__PURE__*/React.createElement("div", {
|
279
302
|
style: {
|
280
|
-
color:
|
303
|
+
color: '#475467',
|
281
304
|
fontSize: 14,
|
282
305
|
fontWeight: 700,
|
283
306
|
wordWrap: 'break-word'
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
'discount-keyboard-discount': 'Discount',
|
6
6
|
'discount-keyboard-amount': 'Amount',
|
7
7
|
'discount-keyboard-percentage': 'Percentage',
|
8
|
-
'discount-keyboard-max-discount': 'Max
|
8
|
+
'discount-keyboard-max-discount': 'Max',
|
9
9
|
'discount-keyboard-discount-amount': 'Discount Amount',
|
10
10
|
'discount-keyboard-total': 'Total',
|
11
11
|
'discount-keyboard-payable': 'Payable',
|
@@ -19,7 +19,7 @@ export default {
|
|
19
19
|
'discount-keyboard-discount': '折扣',
|
20
20
|
'discount-keyboard-amount': '金额',
|
21
21
|
'discount-keyboard-percentage': '百分比',
|
22
|
-
'discount-keyboard-max-discount': '
|
22
|
+
'discount-keyboard-max-discount': '最高',
|
23
23
|
'discount-keyboard-discount-amount': '折扣金额',
|
24
24
|
'discount-keyboard-total': '待支付金额',
|
25
25
|
'discount-keyboard-payable': '需支付金额',
|
@@ -33,7 +33,7 @@ export default {
|
|
33
33
|
'discount-keyboard-discount': '折扣',
|
34
34
|
'discount-keyboard-amount': '金額',
|
35
35
|
'discount-keyboard-percentage': '百分比',
|
36
|
-
'discount-keyboard-max-discount': '
|
36
|
+
'discount-keyboard-max-discount': '最高',
|
37
37
|
'discount-keyboard-discount-amount': '折扣金額',
|
38
38
|
'discount-keyboard-total': '待支付金額',
|
39
39
|
'discount-keyboard-payable': '需支付金額',
|
@@ -1,10 +1 @@
|
|
1
|
-
|
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
|
+
export declare const Provider: any, Context: any;
|
@@ -613,8 +613,8 @@ var Footer = (props) => {
|
|
613
613
|
if (noSubmit) {
|
614
614
|
return values;
|
615
615
|
}
|
616
|
+
const checkout = pisellos.getModule("checkout");
|
616
617
|
if (editOrderId) {
|
617
|
-
const checkout = pisellos.getModule("checkout");
|
618
618
|
const subtotal_info = {
|
619
619
|
subTotalList: (0, import_lodash.cloneDeep)(subTotalList),
|
620
620
|
orderTotalList: (0, import_lodash.cloneDeep)(orderTotalList),
|
@@ -635,6 +635,13 @@ var Footer = (props) => {
|
|
635
635
|
}
|
636
636
|
return;
|
637
637
|
}
|
638
|
+
if (type === "save") {
|
639
|
+
const isNeedDeposit = checkout.checkIsNeedDepositAsync(values.bookings, values.relation_products);
|
640
|
+
if (isNeedDeposit == null ? void 0 : isNeedDeposit.hasDeposit) {
|
641
|
+
values.is_deposit = 1;
|
642
|
+
values.deposit_amount = isNeedDeposit == null ? void 0 : isNeedDeposit.total;
|
643
|
+
}
|
644
|
+
}
|
638
645
|
let api = state.bookingId ? editApi : createApi;
|
639
646
|
(0, import_utils4.sendWarningLog)({
|
640
647
|
title: "saveBooking",
|
@@ -1,10 +1 @@
|
|
1
|
-
|
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
|
+
export declare const Provider: any, Context: any;
|
@@ -1,14 +1,5 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { FormState } from '../model';
|
3
1
|
export declare const walkInData: {
|
4
2
|
id: number;
|
5
3
|
nickname: string;
|
6
4
|
};
|
7
|
-
export declare const Provider:
|
8
|
-
state: FormState;
|
9
|
-
} & {
|
10
|
-
dispatch: (params: {
|
11
|
-
type: string;
|
12
|
-
payload: any;
|
13
|
-
}) => void;
|
14
|
-
}>;
|
5
|
+
export declare const Provider: any, Context: any;
|
@@ -248,4 +248,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
248
248
|
* @Author: WangHan
|
249
249
|
* @Date: 2024-12-24 11:32
|
250
250
|
*/
|
251
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
251
|
+
export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
|