@pisell/private-materials 6.4.26 → 6.4.28
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 +8 -8
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/booking/components/actionButtons/index.js +2 -0
- package/es/components/booking/components/footer/index.js +2 -0
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/checkout/components/WalletPassModule/utils.js +13 -2
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +3 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/ruleSetting/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -0
- package/es/components/wallet/Detail/index.js +3 -1
- package/es/components/wallet/components/WalletCard.js +8 -3
- package/es/plus/clinetSearch/Add/index.js +1 -1
- package/es/pro/pisellNumberSelector/index.d.ts +3 -0
- package/es/pro/pisellNumberSelector/index.js +8 -1
- package/es/pro/pisellNumberSelector/index.less +42 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/booking/components/actionButtons/index.js +2 -0
- package/lib/components/booking/components/footer/index.js +2 -0
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/checkout/components/WalletPassModule/utils.js +12 -5
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +3 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/ruleSetting/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -0
- package/lib/components/wallet/Detail/index.js +18 -5
- package/lib/components/wallet/components/WalletCard.js +3 -1
- package/lib/plus/clinetSearch/Add/index.js +1 -1
- package/lib/pro/pisellNumberSelector/index.d.ts +3 -0
- package/lib/pro/pisellNumberSelector/index.js +7 -2
- package/lib/pro/pisellNumberSelector/index.less +42 -0
- package/lowcode/pro-number-selector/meta.ts +134 -0
- package/package.json +12 -12
@@ -268,6 +268,8 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
268
268
|
|
269
269
|
// 清空所有内容并重置购物车
|
270
270
|
var handleClearAllAndReset = function handleClearAllAndReset() {
|
271
|
+
var _window;
|
272
|
+
(_window = window) === null || _window === void 0 || (_window = _window.shopApi) === null || _window === void 0 || (_window = _window.bookingTicket) === null || _window === void 0 || _window.clearAllCart();
|
271
273
|
clearAllScanListenersTaskQueue();
|
272
274
|
// 清空服务项目
|
273
275
|
dispatch({
|
@@ -1660,6 +1660,8 @@ var Footer = function Footer(props) {
|
|
1660
1660
|
clearAllScanListenersTaskQueue = _useScanManager2.clearAllScanListenersTaskQueue;
|
1661
1661
|
// 清空所有内容并重置购物车
|
1662
1662
|
var handleClearAllAndReset = function handleClearAllAndReset() {
|
1663
|
+
var _window7;
|
1664
|
+
(_window7 = window) === null || _window7 === void 0 || (_window7 = _window7.shopApi) === null || _window7 === void 0 || (_window7 = _window7.bookingTicket) === null || _window7 === void 0 || _window7.clearAllCart();
|
1663
1665
|
clearAllScanListenersTaskQueue();
|
1664
1666
|
// 清空服务项目
|
1665
1667
|
dispatch({
|
@@ -10,9 +10,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
10
10
|
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; }
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
12
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
13
|
+
import React from 'react';
|
13
14
|
import { formatDate, locales } from '@pisell/utils';
|
14
|
-
import { globalConfig } from "@pisell/materials";
|
15
|
+
import { globalConfig, PisellText } from "@pisell/materials";
|
15
16
|
import Decimal from 'decimal.js';
|
17
|
+
var Amount = PisellText.Amount;
|
16
18
|
// 获取walletPass可用最大金额
|
17
19
|
export var getAvailableMaxAmount = function getAvailableMaxAmount(data) {
|
18
20
|
return data.tag !== 'point_card' ? data.available_max_amount : data === null || data === void 0 ? void 0 : data.recommended_usage_amount;
|
@@ -62,7 +64,16 @@ export var formatDiscountWalletData = function formatDiscountWalletData(data) {
|
|
62
64
|
var name = "";
|
63
65
|
var storeName = "";
|
64
66
|
if (item.tag === 'product_discount_card') {
|
65
|
-
|
67
|
+
var _item$metadata;
|
68
|
+
if ((item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.discount_card_type) === "fixed_amount") {
|
69
|
+
var amountValue = item !== null && item !== void 0 && item.savedAmount ? item === null || item === void 0 ? void 0 : item.savedAmount : item.par_value;
|
70
|
+
name = /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.checkout.discount.fixed_amount'), " ", /*#__PURE__*/React.createElement(Amount, {
|
71
|
+
value: amountValue,
|
72
|
+
showCurrencySymbol: true
|
73
|
+
}));
|
74
|
+
} else {
|
75
|
+
name = locales.getText('pisell2.checkout.discount.percentage.off')(item.par_value);
|
76
|
+
}
|
66
77
|
storeName = item.product_name;
|
67
78
|
} else if (item.tag === 'good_pass') {
|
68
79
|
var _locales$getText;
|
@@ -84,6 +84,7 @@ declare const _default: {
|
|
84
84
|
'pisell2.text.walletPassPermanent': string;
|
85
85
|
'pisell2.checkout.search-section.placeholder': string;
|
86
86
|
'pisell2.checkout.discount.percentage.off': (value: string) => string;
|
87
|
+
'pisell2.checkout.discount.fixed_amount': string;
|
87
88
|
'pisell2.checkout.wallet-pass.good-pass.format': (left: number, use: number) => string;
|
88
89
|
'pisell2.checkout.client-card.tip.wallet-updated': string;
|
89
90
|
'pisell2.checkout.client-card.tip.client-changed': string;
|
@@ -291,6 +292,7 @@ declare const _default: {
|
|
291
292
|
'pisell2.payment-options.surcharge-label': string;
|
292
293
|
'pisell2.checkout.search-section.placeholder': string;
|
293
294
|
'pisell2.checkout.discount.percentage.off': (value: string) => string;
|
295
|
+
'pisell2.checkout.discount.fixed_amount': string;
|
294
296
|
'pisell2.checkout.wallet-pass.good-pass.format': (left: number, use: number) => string;
|
295
297
|
'pisell2.checkout.client-card.tip.wallet-updated': string;
|
296
298
|
'pisell2.checkout.client-card.tip.client-changed': string;
|
@@ -388,6 +390,7 @@ declare const _default: {
|
|
388
390
|
'wallet-pass-module-discount-partially-paid': string;
|
389
391
|
'pisell2.checkout.search-section.placeholder': string;
|
390
392
|
'pisell2.checkout.discount.percentage.off': (value: string) => string;
|
393
|
+
'pisell2.checkout.discount.fixed_amount': string;
|
391
394
|
'pisell2.checkout.wallet-pass.good-pass.format': (left: number, use: number) => string;
|
392
395
|
'pisell2.checkout.client-card.tip.wallet-updated': string;
|
393
396
|
'pisell2.checkout.client-card.tip.client-changed': string;
|
@@ -109,6 +109,7 @@ export default {
|
|
109
109
|
'pisell2.checkout.discount.percentage.off': function pisell2CheckoutDiscountPercentageOff(value) {
|
110
110
|
return "".concat(value, "% off");
|
111
111
|
},
|
112
|
+
'pisell2.checkout.discount.fixed_amount': "Save",
|
112
113
|
// wallet pass good pass format
|
113
114
|
'pisell2.checkout.wallet-pass.good-pass.format': function pisell2CheckoutWalletPassGoodPassFormat(left, use) {
|
114
115
|
return "Left: ".concat(left, " / Use: ").concat(use);
|
@@ -379,6 +380,7 @@ export default {
|
|
379
380
|
var discountValue = (100 - numValue) / 10;
|
380
381
|
return "".concat(discountValue, "\u6298");
|
381
382
|
},
|
383
|
+
'pisell2.checkout.discount.fixed_amount': "\u7ACB\u51CF",
|
382
384
|
// wallet pass good pass format
|
383
385
|
'pisell2.checkout.wallet-pass.good-pass.format': function pisell2CheckoutWalletPassGoodPassFormat(left, use) {
|
384
386
|
return "\u5269\u4F59: ".concat(left, " / \u4F7F\u7528: ").concat(use);
|
@@ -511,6 +513,7 @@ export default {
|
|
511
513
|
var discountValue = (100 - numValue) / 10;
|
512
514
|
return "".concat(discountValue, "\u6298");
|
513
515
|
},
|
516
|
+
'pisell2.checkout.discount.fixed_amount': "\u7ACB\u6E1B",
|
514
517
|
// wallet pass good pass format
|
515
518
|
'pisell2.checkout.wallet-pass.good-pass.format': function pisell2CheckoutWalletPassGoodPassFormat(left, use) {
|
516
519
|
return "\u5269\u9918: ".concat(left, " / \u4F7F\u7528: ").concat(use);
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
22
|
+
readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
25
25
|
};
|
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
297
297
|
amount?: string | number | undefined;
|
298
298
|
mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
|
299
299
|
order_id?: string | number | undefined;
|
300
|
-
eftpos?: "
|
300
|
+
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
302
302
|
key?: number | undefined;
|
303
303
|
step?: number | undefined;
|
@@ -311,6 +311,8 @@ var TicketBooking = function TicketBooking() {
|
|
311
311
|
}, []);
|
312
312
|
useEffect(function () {
|
313
313
|
var _store$getState, _interaction$utils, _interaction$utils2;
|
314
|
+
// bellaswonderland.mypisell.com localStorage可能满了
|
315
|
+
localStorage.removeItem('bookingResourceList');
|
314
316
|
_persistentRef.current = storage.get("drawer-booking") === 'true' ? true : isTerminal();
|
315
317
|
if (lowcodeRef) {
|
316
318
|
lowcodeRef.onReady(_this);
|
@@ -312,9 +312,11 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
312
312
|
}];
|
313
313
|
//折扣卡显示折扣字段 其他显示余额字段
|
314
314
|
if (tag === 'product_discount_card') {
|
315
|
+
var _detail$metadata;
|
316
|
+
var isFixedAmount = ((_detail$metadata = detail.metadata) === null || _detail$metadata === void 0 ? void 0 : _detail$metadata.discount_card_type) === 'fixed_amount';
|
315
317
|
data.splice(2, 0, {
|
316
318
|
label: locales.getText('page.wallet.discount'),
|
317
|
-
value: balance ? "".concat(Number(balance), "%") : ''
|
319
|
+
value: balance ? isFixedAmount ? "".concat(symbol).concat(Number(balance)) : "".concat(Number(balance), "%") : ''
|
318
320
|
});
|
319
321
|
} else if (tag === 'point_card') {
|
320
322
|
data.splice(2, 0, {
|
@@ -1,3 +1,7 @@
|
|
1
|
+
var _excluded = ["id", "tag", "product_title", "balance", "code", "encoded", "expire_date", "shop", "limit_status", "product_cover", "par_value", "unified_messages"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
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; }
|
1
5
|
import React, { useMemo } from 'react';
|
2
6
|
import { PisellWalletPassCard } from '@pisell/materials';
|
3
7
|
import { isMobile } from '@pisell/utils';
|
@@ -35,7 +39,8 @@ var WalletCard = function WalletCard(_ref) {
|
|
35
39
|
_item$par_value = item.par_value,
|
36
40
|
par_value = _item$par_value === void 0 ? '' : _item$par_value,
|
37
41
|
_item$unified_message = item.unified_messages,
|
38
|
-
unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message
|
42
|
+
unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message,
|
43
|
+
rest = _objectWithoutProperties(item, _excluded);
|
39
44
|
|
40
45
|
// 获取平台
|
41
46
|
var platform = useMemo(function () {
|
@@ -52,7 +57,7 @@ var WalletCard = function WalletCard(_ref) {
|
|
52
57
|
var isActive = id === currentId && platform === 'pc';
|
53
58
|
// 是否禁用
|
54
59
|
var isDisabled = limit_status !== 'enable';
|
55
|
-
return /*#__PURE__*/React.createElement(PisellWalletPassCard, {
|
60
|
+
return /*#__PURE__*/React.createElement(PisellWalletPassCard, _extends({}, rest, {
|
56
61
|
balanceTitle: balanceTitle,
|
57
62
|
showDetail: false,
|
58
63
|
showRedeem: false,
|
@@ -77,6 +82,6 @@ var WalletCard = function WalletCard(_ref) {
|
|
77
82
|
code: encoded,
|
78
83
|
validDate: expire_date,
|
79
84
|
onClick: onClick
|
80
|
-
});
|
85
|
+
}));
|
81
86
|
};
|
82
87
|
export default /*#__PURE__*/React.memo(WalletCard);
|
@@ -70,7 +70,7 @@ var AddClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
70
70
|
_addClient.run({
|
71
71
|
customer: _objectSpread(_objectSpread({
|
72
72
|
accepts_marketing: 0,
|
73
|
-
register_channel: '
|
73
|
+
register_channel: 'pos',
|
74
74
|
tax_exempt: 1
|
75
75
|
}, rest), {}, {
|
76
76
|
first_name: rest.first_name || '',
|
@@ -27,6 +27,10 @@ var PisellNumberSelector = function PisellNumberSelector(_ref) {
|
|
27
27
|
max = _ref$max === void 0 ? 999 : _ref$max,
|
28
28
|
_ref$step = _ref.step,
|
29
29
|
step = _ref$step === void 0 ? 1 : _ref$step,
|
30
|
+
_ref$width = _ref.width,
|
31
|
+
width = _ref$width === void 0 ? '112px' : _ref$width,
|
32
|
+
_ref$styleType = _ref.styleType,
|
33
|
+
styleType = _ref$styleType === void 0 ? 'capsule' : _ref$styleType,
|
30
34
|
_ref$disabled = _ref.disabled,
|
31
35
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
32
36
|
onChange = _ref.onChange,
|
@@ -230,7 +234,10 @@ var PisellNumberSelector = function PisellNumberSelector(_ref) {
|
|
230
234
|
onOpenChange: handleOpenChange
|
231
235
|
}, numberDisplayElement) : numberDisplayElement;
|
232
236
|
return /*#__PURE__*/React.createElement("div", {
|
233
|
-
className: classNames('pisell-number-selector-new', className, _defineProperty(_defineProperty({}, "pisell-number-selector-".concat(size), size), 'pisell-number-selector-disabled', disabled))
|
237
|
+
className: classNames('pisell-number-selector-new', className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "pisell-number-selector-".concat(size), size), 'pisell-number-selector-disabled', disabled), 'pisell-number-selector-capsule', styleType === 'capsule'), 'pisell-number-selector-separation', styleType === 'separation')),
|
238
|
+
style: {
|
239
|
+
width: width
|
240
|
+
}
|
234
241
|
}, /*#__PURE__*/React.createElement("button", {
|
235
242
|
type: "button",
|
236
243
|
className: "pisell-number-selector-btn pisell-number-selector-minus",
|
@@ -190,4 +190,46 @@
|
|
190
190
|
font-size: 16px;
|
191
191
|
color: #000;
|
192
192
|
}
|
193
|
+
}
|
194
|
+
|
195
|
+
// 分离式样式
|
196
|
+
.pisell-number-selector-separation {
|
197
|
+
background: transparent !important;
|
198
|
+
border: none;
|
199
|
+
|
200
|
+
.pisell-number-selector-btn {
|
201
|
+
background: #7F56D9;
|
202
|
+
border: 1px solid #7F56D9;
|
203
|
+
border-radius: 50%; // 圆形按钮
|
204
|
+
color: #fff;
|
205
|
+
|
206
|
+
&:hover:not(:disabled) {
|
207
|
+
background: #6A46C8; // 稍暗的紫色作为悬停状态
|
208
|
+
border-color: #6A46C8;
|
209
|
+
color: #fff;
|
210
|
+
}
|
211
|
+
|
212
|
+
&:disabled {
|
213
|
+
background: #D1D5DB;
|
214
|
+
border-color: #D1D5DB;
|
215
|
+
color: #9CA3AF;
|
216
|
+
|
217
|
+
&:hover {
|
218
|
+
background: #D1D5DB !important;
|
219
|
+
border-color: #D1D5DB !important;
|
220
|
+
color: #9CA3AF !important;
|
221
|
+
}
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
.pisell-number-selector-minus,
|
226
|
+
.pisell-number-selector-plus {
|
227
|
+
border-radius: 50%; // 保持圆形
|
228
|
+
}
|
229
|
+
|
230
|
+
.pisell-number-selector-number {
|
231
|
+
background: transparent;
|
232
|
+
border: none;
|
233
|
+
color: #000;
|
234
|
+
}
|
193
235
|
}
|
@@ -224,6 +224,8 @@ var ActionButtons = ({
|
|
224
224
|
);
|
225
225
|
};
|
226
226
|
const handleClearAllAndReset = () => {
|
227
|
+
var _a2, _b2;
|
228
|
+
(_b2 = (_a2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _a2.bookingTicket) == null ? void 0 : _b2.clearAllCart();
|
227
229
|
clearAllScanListenersTaskQueue();
|
228
230
|
dispatch({
|
229
231
|
type: "setService",
|
@@ -1197,6 +1197,8 @@ var Footer = (props) => {
|
|
1197
1197
|
});
|
1198
1198
|
const { clearAllScanListenersTaskQueue } = (0, import_useScanManager.default)();
|
1199
1199
|
const handleClearAllAndReset = () => {
|
1200
|
+
var _a2, _b2;
|
1201
|
+
(_b2 = (_a2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _a2.bookingTicket) == null ? void 0 : _b2.clearAllCart();
|
1200
1202
|
clearAllScanListenersTaskQueue();
|
1201
1203
|
dispatch({
|
1202
1204
|
type: "setService",
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
));
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
28
|
|
29
|
-
// src/components/checkout/components/WalletPassModule/utils.
|
29
|
+
// src/components/checkout/components/WalletPassModule/utils.tsx
|
30
30
|
var utils_exports = {};
|
31
31
|
__export(utils_exports, {
|
32
32
|
formatDiscountWalletData: () => formatDiscountWalletData,
|
@@ -37,9 +37,11 @@ __export(utils_exports, {
|
|
37
37
|
voucherTime: () => voucherTime
|
38
38
|
});
|
39
39
|
module.exports = __toCommonJS(utils_exports);
|
40
|
+
var import_react = __toESM(require("react"));
|
40
41
|
var import_utils = require("@pisell/utils");
|
41
42
|
var import_materials = require("@pisell/materials");
|
42
43
|
var import_decimal = __toESM(require("decimal.js"));
|
44
|
+
var Amount = import_materials.PisellText.Amount;
|
43
45
|
var getAvailableMaxAmount = (data) => {
|
44
46
|
return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
|
45
47
|
};
|
@@ -84,17 +86,22 @@ var formatMachineCodeServer2CardList = (data, selectId = [], otherProps = {}) =>
|
|
84
86
|
};
|
85
87
|
var formatDiscountWalletData = (data, selectId = []) => {
|
86
88
|
return (data || []).map((item) => {
|
87
|
-
var _a, _b;
|
89
|
+
var _a, _b, _c;
|
88
90
|
let name = "";
|
89
91
|
let storeName = "";
|
90
92
|
if (item.tag === "product_discount_card") {
|
91
|
-
|
93
|
+
if (((_a = item == null ? void 0 : item.metadata) == null ? void 0 : _a.discount_card_type) === "fixed_amount") {
|
94
|
+
const amountValue = (item == null ? void 0 : item.savedAmount) ? item == null ? void 0 : item.savedAmount : item.par_value;
|
95
|
+
name = /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.checkout.discount.fixed_amount"), " ", /* @__PURE__ */ import_react.default.createElement(Amount, { value: amountValue, showCurrencySymbol: true }));
|
96
|
+
} else {
|
97
|
+
name = import_utils.locales.getText("pisell2.checkout.discount.percentage.off")(item.par_value);
|
98
|
+
}
|
92
99
|
storeName = item.product_name;
|
93
100
|
} else if (item.tag === "good_pass") {
|
94
101
|
name = item.product_name;
|
95
102
|
const left = Number(item.balance) || 0;
|
96
103
|
const use = 1;
|
97
|
-
storeName = (
|
104
|
+
storeName = (_b = import_utils.locales.getText("pisell2.checkout.wallet-pass.good-pass.format")) == null ? void 0 : _b(left, use);
|
98
105
|
} else {
|
99
106
|
name = item.product_name;
|
100
107
|
}
|
@@ -118,7 +125,7 @@ var formatDiscountWalletData = (data, selectId = []) => {
|
|
118
125
|
disabled: item.isDisabled,
|
119
126
|
showStatus: true,
|
120
127
|
cardStatus: item.isDisabled ? "conflict" : void 0,
|
121
|
-
cover: (
|
128
|
+
cover: (_c = item.product) == null ? void 0 : _c.cover,
|
122
129
|
qrCode: item.code,
|
123
130
|
validDate: voucherTime(item, "expire_time"),
|
124
131
|
originData: item,
|
@@ -84,6 +84,7 @@ declare const _default: {
|
|
84
84
|
'pisell2.text.walletPassPermanent': string;
|
85
85
|
'pisell2.checkout.search-section.placeholder': string;
|
86
86
|
'pisell2.checkout.discount.percentage.off': (value: string) => string;
|
87
|
+
'pisell2.checkout.discount.fixed_amount': string;
|
87
88
|
'pisell2.checkout.wallet-pass.good-pass.format': (left: number, use: number) => string;
|
88
89
|
'pisell2.checkout.client-card.tip.wallet-updated': string;
|
89
90
|
'pisell2.checkout.client-card.tip.client-changed': string;
|
@@ -291,6 +292,7 @@ declare const _default: {
|
|
291
292
|
'pisell2.payment-options.surcharge-label': string;
|
292
293
|
'pisell2.checkout.search-section.placeholder': string;
|
293
294
|
'pisell2.checkout.discount.percentage.off': (value: string) => string;
|
295
|
+
'pisell2.checkout.discount.fixed_amount': string;
|
294
296
|
'pisell2.checkout.wallet-pass.good-pass.format': (left: number, use: number) => string;
|
295
297
|
'pisell2.checkout.client-card.tip.wallet-updated': string;
|
296
298
|
'pisell2.checkout.client-card.tip.client-changed': string;
|
@@ -388,6 +390,7 @@ declare const _default: {
|
|
388
390
|
'wallet-pass-module-discount-partially-paid': string;
|
389
391
|
'pisell2.checkout.search-section.placeholder': string;
|
390
392
|
'pisell2.checkout.discount.percentage.off': (value: string) => string;
|
393
|
+
'pisell2.checkout.discount.fixed_amount': string;
|
391
394
|
'pisell2.checkout.wallet-pass.good-pass.format': (left: number, use: number) => string;
|
392
395
|
'pisell2.checkout.client-card.tip.wallet-updated': string;
|
393
396
|
'pisell2.checkout.client-card.tip.client-changed': string;
|
@@ -123,6 +123,7 @@ var locales_default = {
|
|
123
123
|
"pisell2.checkout.search-section.placeholder": "WalletPass Code / Encode",
|
124
124
|
// discount formatting
|
125
125
|
"pisell2.checkout.discount.percentage.off": (value) => `${value}% off`,
|
126
|
+
"pisell2.checkout.discount.fixed_amount": `Save`,
|
126
127
|
// wallet pass good pass format
|
127
128
|
"pisell2.checkout.wallet-pass.good-pass.format": (left, use) => `Left: ${left} / Use: ${use}`,
|
128
129
|
// client card
|
@@ -378,6 +379,7 @@ var locales_default = {
|
|
378
379
|
const discountValue = (100 - numValue) / 10;
|
379
380
|
return `${discountValue}折`;
|
380
381
|
},
|
382
|
+
"pisell2.checkout.discount.fixed_amount": `立减`,
|
381
383
|
// wallet pass good pass format
|
382
384
|
"pisell2.checkout.wallet-pass.good-pass.format": (left, use) => `剩余: ${left} / 使用: ${use}`,
|
383
385
|
// client card
|
@@ -499,6 +501,7 @@ var locales_default = {
|
|
499
501
|
const discountValue = (100 - numValue) / 10;
|
500
502
|
return `${discountValue}折`;
|
501
503
|
},
|
504
|
+
"pisell2.checkout.discount.fixed_amount": `立減`,
|
502
505
|
// wallet pass good pass format
|
503
506
|
"pisell2.checkout.wallet-pass.good-pass.format": (left, use) => `剩餘: ${left} / 使用: ${use}`,
|
504
507
|
// client card
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
22
|
+
readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
25
25
|
};
|
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
297
297
|
amount?: string | number | undefined;
|
298
298
|
mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
|
299
299
|
order_id?: string | number | undefined;
|
300
|
-
eftpos?: "
|
300
|
+
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
302
302
|
key?: number | undefined;
|
303
303
|
step?: number | undefined;
|
@@ -311,6 +311,7 @@ var TicketBooking = () => {
|
|
311
311
|
}, []);
|
312
312
|
(0, import_react.useEffect)(() => {
|
313
313
|
var _a2, _b2, _c2, _d2, _e2;
|
314
|
+
localStorage.removeItem("bookingResourceList");
|
314
315
|
_persistentRef.current = storage.get(`drawer-booking`) === "true" ? true : isTerminal();
|
315
316
|
if (lowcodeRef) {
|
316
317
|
lowcodeRef.onReady(void 0);
|
@@ -67,7 +67,11 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
67
67
|
expire_date = "",
|
68
68
|
product = {}
|
69
69
|
} = detail;
|
70
|
-
const {
|
70
|
+
const {
|
71
|
+
description = "",
|
72
|
+
extension_data = [],
|
73
|
+
customer_order_behavior_count = 0
|
74
|
+
} = product || {};
|
71
75
|
const context = (0, import_useEngineContext.default)();
|
72
76
|
const [extensionData, setExtensionData] = (0, import_react.useState)([]);
|
73
77
|
const [customerOrderBehaviorCount, setCustomerOrderBehaviorCount] = (0, import_react.useState)(0);
|
@@ -154,7 +158,10 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
154
158
|
};
|
155
159
|
};
|
156
160
|
const usageRules = generateUsageRules(usageCreditsData);
|
157
|
-
const personalLimit = generatePersonalLimit(usageCreditsData, {
|
161
|
+
const personalLimit = generatePersonalLimit(usageCreditsData, {
|
162
|
+
totalOrderBehaviorCount,
|
163
|
+
customerOrderBehaviorCount
|
164
|
+
});
|
158
165
|
const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
|
159
166
|
const dvaStore = (_c = (_b = utils == null ? void 0 : utils.getStore) == null ? void 0 : _b.call(utils)) == null ? void 0 : _c.getState();
|
160
167
|
const [TimeLineData, setTimeLineData] = (0, import_react.useState)([]);
|
@@ -206,6 +213,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
206
213
|
}
|
207
214
|
};
|
208
215
|
(0, import_react.useEffect)(() => {
|
216
|
+
var _a2;
|
209
217
|
let data = [
|
210
218
|
{
|
211
219
|
label: import_utils.locales.getText("page.wallet.cardName"),
|
@@ -222,9 +230,10 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
222
230
|
}
|
223
231
|
];
|
224
232
|
if (tag === "product_discount_card") {
|
233
|
+
const isFixedAmount = ((_a2 = detail.metadata) == null ? void 0 : _a2.discount_card_type) === "fixed_amount";
|
225
234
|
data.splice(2, 0, {
|
226
235
|
label: import_utils.locales.getText("page.wallet.discount"),
|
227
|
-
value: balance ? `${Number(balance)}%` : ""
|
236
|
+
value: balance ? isFixedAmount ? `${symbol}${Number(balance)}` : `${Number(balance)}%` : ""
|
228
237
|
});
|
229
238
|
} else if (tag === "point_card") {
|
230
239
|
data.splice(2, 0, {
|
@@ -287,7 +296,9 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
287
296
|
setWeekOrderBehaviorCount(week_order_behavior_count);
|
288
297
|
setMonthOrderBehaviorCount(month_order_behavior_count);
|
289
298
|
if (Array.isArray(extension_data2) && extension_data2.length > 0) {
|
290
|
-
const usageCreditsItem = extension_data2.find(
|
299
|
+
const usageCreditsItem = extension_data2.find(
|
300
|
+
(item) => item.field_key === "usage_credits"
|
301
|
+
);
|
291
302
|
if (usageCreditsItem == null ? void 0 : usageCreditsItem.value) {
|
292
303
|
setUsageCreditsData(usageCreditsItem.value);
|
293
304
|
setShouldShowUsageRules(true);
|
@@ -388,7 +399,9 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
388
399
|
throw new Error(`HTTP error! status: ${response.status}`);
|
389
400
|
}
|
390
401
|
const passData = await response.arrayBuffer();
|
391
|
-
const blob = new Blob([passData], {
|
402
|
+
const blob = new Blob([passData], {
|
403
|
+
type: "application/vnd.apple.pkpass"
|
404
|
+
});
|
392
405
|
const downloadUrl = URL.createObjectURL(blob);
|
393
406
|
const a = document.createElement("a");
|
394
407
|
a.href = downloadUrl;
|