@pisell/private-materials 6.8.76 → 6.8.77
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/checkout/PaymentModal.js +32 -8
- package/es/components/checkout/components/PaymentOptionsModule/index.js +1 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/app.js +0 -5
- package/es/components/eftposPay/component/fail/failCustom.js +12 -16
- package/es/components/eftposPay/component/fail/index.js +5 -12
- package/es/components/eftposPay/const.d.ts +1 -6
- package/es/components/eftposPay/const.js +0 -3
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -3
- package/es/components/eftposPay/hooks.js +0 -12
- package/es/components/eftposPay/index.js +1 -5
- package/es/components/eftposPay/locales.d.ts +0 -36
- package/es/components/eftposPay/locales.js +3 -42
- package/es/components/eftposPay/manufacturer.d.ts +0 -1
- package/es/components/eftposPay/manufacturer.js +0 -5
- package/es/components/eftposPay/pay.js +2 -6
- package/es/components/eftposPay/store/index.d.ts +5 -12
- package/es/components/kioskSkuDetail/index.d.ts +0 -3
- package/es/components/kioskSkuDetail/index.js +173 -266
- package/es/components/kioskSkuDetail/index.less +7 -49
- package/es/components/kioskSkuDetail/locales.d.ts +0 -6
- package/es/components/kioskSkuDetail/locales.js +3 -9
- package/es/components/pay/toB/components/EFTPOS/index.js +1 -8
- package/es/components/pay/toB/types/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentList/serve.js +0 -14
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -7
- package/es/plus/skuOptionsSelection/components/VariantCard/index.js +1 -1
- package/es/plus/skuOptionsSelection/locales.d.ts +0 -3
- package/es/plus/skuOptionsSelection/locales.js +0 -3
- package/es/pro/Login2.0/components/LoginCodeInput.js +3 -36
- package/es/pro/Login2.0/steps/CodeInput.js +7 -37
- package/lib/components/checkout/PaymentModal.js +41 -24
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +1 -2
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/app.js +0 -5
- package/lib/components/eftposPay/component/fail/failCustom.js +9 -15
- package/lib/components/eftposPay/component/fail/index.js +1 -4
- package/lib/components/eftposPay/const.d.ts +1 -6
- package/lib/components/eftposPay/const.js +0 -3
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -3
- package/lib/components/eftposPay/hooks.js +0 -16
- package/lib/components/eftposPay/index.js +1 -5
- package/lib/components/eftposPay/locales.d.ts +0 -36
- package/lib/components/eftposPay/locales.js +3 -42
- package/lib/components/eftposPay/manufacturer.d.ts +0 -1
- package/lib/components/eftposPay/manufacturer.js +0 -7
- package/lib/components/eftposPay/pay.js +2 -3
- package/lib/components/eftposPay/store/index.d.ts +5 -12
- package/lib/components/kioskSkuDetail/index.d.ts +0 -3
- package/lib/components/kioskSkuDetail/index.js +113 -180
- package/lib/components/kioskSkuDetail/index.less +7 -49
- package/lib/components/kioskSkuDetail/locales.d.ts +0 -6
- package/lib/components/kioskSkuDetail/locales.js +3 -9
- package/lib/components/pay/toB/components/EFTPOS/index.js +1 -8
- package/lib/components/pay/toB/types/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentList/serve.js +0 -15
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -7
- package/lib/plus/skuOptionsSelection/components/VariantCard/index.js +0 -2
- package/lib/plus/skuOptionsSelection/locales.d.ts +0 -3
- package/lib/plus/skuOptionsSelection/locales.js +0 -3
- package/lib/pro/Login2.0/components/LoginCodeInput.js +4 -26
- package/lib/pro/Login2.0/steps/CodeInput.js +5 -27
- package/lowcode/kiosk-sku-detail/meta.ts +94 -229
- package/package.json +8 -2
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +0 -7
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.js +0 -120
- package/es/components/eftposPay/aggregatePayment/index.d.ts +0 -3
- package/es/components/eftposPay/aggregatePayment/index.js +0 -3
- package/es/components/eftposPay/aggregatePayment/service.d.ts +0 -24
- package/es/components/eftposPay/aggregatePayment/service.js +0 -69
- package/es/components/eftposPay/aggregatePayment/types.d.ts +0 -106
- package/es/components/eftposPay/aggregatePayment/types.js +0 -65
- package/es/components/eftposPay/aggregatePayment/utils/logs.d.ts +0 -110
- package/es/components/eftposPay/aggregatePayment/utils/logs.js +0 -371
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +0 -139
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +0 -1138
- package/es/components/eftposPay/huifu/Action.d.ts +0 -8
- package/es/components/eftposPay/huifu/Action.js +0 -146
- package/es/components/eftposPay/huifu/const.d.ts +0 -5
- package/es/components/eftposPay/huifu/const.js +0 -70
- package/es/components/eftposPay/huifu/hooks.d.ts +0 -25
- package/es/components/eftposPay/huifu/hooks.js +0 -184
- package/es/components/eftposPay/huifu/index.d.ts +0 -5
- package/es/components/eftposPay/huifu/index.js +0 -196
- package/es/components/eftposPay/huifu/index.less +0 -180
- package/es/components/eftposPay/huifu/types.d.ts +0 -14
- package/es/components/eftposPay/huifu/types.js +0 -1
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +0 -7
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.js +0 -133
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +0 -3
- package/lib/components/eftposPay/aggregatePayment/index.js +0 -42
- package/lib/components/eftposPay/aggregatePayment/service.d.ts +0 -24
- package/lib/components/eftposPay/aggregatePayment/service.js +0 -81
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +0 -106
- package/lib/components/eftposPay/aggregatePayment/types.js +0 -74
- package/lib/components/eftposPay/aggregatePayment/utils/logs.d.ts +0 -110
- package/lib/components/eftposPay/aggregatePayment/utils/logs.js +0 -294
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +0 -139
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +0 -752
- package/lib/components/eftposPay/huifu/Action.d.ts +0 -8
- package/lib/components/eftposPay/huifu/Action.js +0 -174
- package/lib/components/eftposPay/huifu/const.d.ts +0 -5
- package/lib/components/eftposPay/huifu/const.js +0 -86
- package/lib/components/eftposPay/huifu/hooks.d.ts +0 -25
- package/lib/components/eftposPay/huifu/hooks.js +0 -186
- package/lib/components/eftposPay/huifu/index.d.ts +0 -5
- package/lib/components/eftposPay/huifu/index.js +0 -200
- package/lib/components/eftposPay/huifu/index.less +0 -180
- package/lib/components/eftposPay/huifu/types.d.ts +0 -14
- package/lib/components/eftposPay/huifu/types.js +0 -17
|
@@ -99,14 +99,10 @@ var eftposPay_default = (props) => {
|
|
|
99
99
|
if (props.source === import_const.RestoreEumn.Restore) {
|
|
100
100
|
return props.params;
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
return (0, import_manufacturer.getInitState)(
|
|
103
103
|
props.type,
|
|
104
104
|
props.params ? { mode, ...props.params, symbol: current } : { mode, symbol: current }
|
|
105
105
|
);
|
|
106
|
-
return {
|
|
107
|
-
...initState,
|
|
108
|
-
originalParams: props.params || void 0
|
|
109
|
-
};
|
|
110
106
|
}, [mode, props.params, props.type, symbol]);
|
|
111
107
|
const stateRef = (0, import_react.useRef)(state);
|
|
112
108
|
(0, import_react.useEffect)(() => {
|
|
@@ -107,18 +107,6 @@ declare const _default: {
|
|
|
107
107
|
'page.eftpos-pay.text.not.connected': string;
|
|
108
108
|
'page.eftpos-pay.text.tyro-btn': (key: string) => string;
|
|
109
109
|
'page.eftpos-pay.text.tyro': (key: string) => string;
|
|
110
|
-
'page.eftpos-pay.text.huifu.scan.title': string;
|
|
111
|
-
'page.eftpos-pay.text.huifu.scan.gun.connected': string;
|
|
112
|
-
'page.eftpos-pay.text.huifu.scan.gun.connected-desc': string;
|
|
113
|
-
'page.eftpos-pay.text.huifu.scan.gun.not-connected': string;
|
|
114
|
-
'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': string;
|
|
115
|
-
'page.eftpos-pay.text.huifu.scan.camera-title': string;
|
|
116
|
-
'page.eftpos-pay.text.huifu.scan.camera-desc': string;
|
|
117
|
-
'page.eftpos-pay.text.huifu.scan.input-title': string;
|
|
118
|
-
'page.eftpos-pay.text.huifu.scan.input-placeholder': string;
|
|
119
|
-
'page.eftpos-pay.text.huifu.scan.input-tip': string;
|
|
120
|
-
'page.eftpos-pay.text.huifu.scan.cancel': string;
|
|
121
|
-
'page.eftpos-pay.text.huifu.scan.confirm': string;
|
|
122
110
|
};
|
|
123
111
|
'zh-CN': {
|
|
124
112
|
'page.eftpos-pay.text.loading': (mode: string) => string;
|
|
@@ -228,18 +216,6 @@ declare const _default: {
|
|
|
228
216
|
'page.eftpos-pay.text.not.connected': string;
|
|
229
217
|
'page.eftpos-pay.text.tyro-btn': (key: string) => string;
|
|
230
218
|
'page.eftpos-pay.text.tyro': (key: string) => string | string[];
|
|
231
|
-
'page.eftpos-pay.text.huifu.scan.title': string;
|
|
232
|
-
'page.eftpos-pay.text.huifu.scan.gun.connected': string;
|
|
233
|
-
'page.eftpos-pay.text.huifu.scan.gun.connected-desc': string;
|
|
234
|
-
'page.eftpos-pay.text.huifu.scan.gun.not-connected': string;
|
|
235
|
-
'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': string;
|
|
236
|
-
'page.eftpos-pay.text.huifu.scan.camera-title': string;
|
|
237
|
-
'page.eftpos-pay.text.huifu.scan.camera-desc': string;
|
|
238
|
-
'page.eftpos-pay.text.huifu.scan.input-title': string;
|
|
239
|
-
'page.eftpos-pay.text.huifu.scan.input-placeholder': string;
|
|
240
|
-
'page.eftpos-pay.text.huifu.scan.input-tip': string;
|
|
241
|
-
'page.eftpos-pay.text.huifu.scan.cancel': string;
|
|
242
|
-
'page.eftpos-pay.text.huifu.scan.confirm': string;
|
|
243
219
|
};
|
|
244
220
|
'zh-HK': {
|
|
245
221
|
'page.eftpos-pay.text.loading': (mode: string) => string;
|
|
@@ -349,18 +325,6 @@ declare const _default: {
|
|
|
349
325
|
'page.eftpos-pay.text.not.connected': string;
|
|
350
326
|
'page.eftpos-pay.text.tyro-btn': (key: string) => string;
|
|
351
327
|
'page.eftpos-pay.text.tyro': (key: string) => string | string[];
|
|
352
|
-
'page.eftpos-pay.text.huifu.scan.title': string;
|
|
353
|
-
'page.eftpos-pay.text.huifu.scan.gun.connected': string;
|
|
354
|
-
'page.eftpos-pay.text.huifu.scan.gun.connected-desc': string;
|
|
355
|
-
'page.eftpos-pay.text.huifu.scan.gun.not-connected': string;
|
|
356
|
-
'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': string;
|
|
357
|
-
'page.eftpos-pay.text.huifu.scan.camera-title': string;
|
|
358
|
-
'page.eftpos-pay.text.huifu.scan.camera-desc': string;
|
|
359
|
-
'page.eftpos-pay.text.huifu.scan.input-title': string;
|
|
360
|
-
'page.eftpos-pay.text.huifu.scan.input-placeholder': string;
|
|
361
|
-
'page.eftpos-pay.text.huifu.scan.input-tip': string;
|
|
362
|
-
'page.eftpos-pay.text.huifu.scan.cancel': string;
|
|
363
|
-
'page.eftpos-pay.text.huifu.scan.confirm': string;
|
|
364
328
|
};
|
|
365
329
|
};
|
|
366
330
|
export default _default;
|
|
@@ -135,20 +135,7 @@ var locales_default = {
|
|
|
135
135
|
},
|
|
136
136
|
"page.eftpos-pay.text.tyro": (key) => {
|
|
137
137
|
return key;
|
|
138
|
-
}
|
|
139
|
-
// 汇付天下定制文案
|
|
140
|
-
"page.eftpos-pay.text.huifu.scan.title": "Scan to Pay (Alipay · WeChat Pay · UnionPay)",
|
|
141
|
-
"page.eftpos-pay.text.huifu.scan.gun.connected": "Scanner Connected",
|
|
142
|
-
"page.eftpos-pay.text.huifu.scan.gun.connected-desc": "Scan the customer’s payment code to collect payment",
|
|
143
|
-
"page.eftpos-pay.text.huifu.scan.gun.not-connected": "Scanner Not Connected",
|
|
144
|
-
"page.eftpos-pay.text.huifu.scan.gun.not-connected-desc": "Connect the scanner to scan the customer’s payment code",
|
|
145
|
-
"page.eftpos-pay.text.huifu.scan.camera-title": "Click to use the camera",
|
|
146
|
-
"page.eftpos-pay.text.huifu.scan.camera-desc": "Align the customer’s payment code within the frame",
|
|
147
|
-
"page.eftpos-pay.text.huifu.scan.input-title": "Or enter the payment code manually",
|
|
148
|
-
"page.eftpos-pay.text.huifu.scan.input-placeholder": "Enter payment code",
|
|
149
|
-
"page.eftpos-pay.text.huifu.scan.input-tip": "Tip: The payment code is 18 digits",
|
|
150
|
-
"page.eftpos-pay.text.huifu.scan.cancel": "Cancel",
|
|
151
|
-
"page.eftpos-pay.text.huifu.scan.confirm": "Confirm Payment"
|
|
138
|
+
}
|
|
152
139
|
},
|
|
153
140
|
"zh-CN": {
|
|
154
141
|
"page.eftpos-pay.text.loading": (mode) => `${mode === "pay" || mode === "fullPay" ? "支付" : "退款"}进行中...`,
|
|
@@ -415,20 +402,7 @@ var locales_default = {
|
|
|
415
402
|
return "请使用以下选项之一回答此问题";
|
|
416
403
|
}
|
|
417
404
|
return key;
|
|
418
|
-
}
|
|
419
|
-
// 汇付天下定制文案
|
|
420
|
-
"page.eftpos-pay.text.huifu.scan.title": "扫码支付(支付宝 · 微信支付 · 银联)",
|
|
421
|
-
"page.eftpos-pay.text.huifu.scan.gun.connected": "扫码枪已连接",
|
|
422
|
-
"page.eftpos-pay.text.huifu.scan.gun.connected-desc": "直接扫描消费者付款码即可",
|
|
423
|
-
"page.eftpos-pay.text.huifu.scan.gun.not-connected": "未连接扫码枪",
|
|
424
|
-
"page.eftpos-pay.text.huifu.scan.gun.not-connected-desc": "连接扫码枪后可直接扫码消费者付款码",
|
|
425
|
-
"page.eftpos-pay.text.huifu.scan.camera-title": "点击可使用设备摄像头",
|
|
426
|
-
"page.eftpos-pay.text.huifu.scan.camera-desc": "将消费者付款码对准扫描框",
|
|
427
|
-
"page.eftpos-pay.text.huifu.scan.input-title": "或手动输入付款码",
|
|
428
|
-
"page.eftpos-pay.text.huifu.scan.input-placeholder": "请输入",
|
|
429
|
-
"page.eftpos-pay.text.huifu.scan.input-tip": "提示:付款码为18位数字",
|
|
430
|
-
"page.eftpos-pay.text.huifu.scan.cancel": "取消",
|
|
431
|
-
"page.eftpos-pay.text.huifu.scan.confirm": "确认支付"
|
|
405
|
+
}
|
|
432
406
|
},
|
|
433
407
|
"zh-HK": {
|
|
434
408
|
"page.eftpos-pay.text.loading": (mode) => `${mode === "pay" || mode === "fullPay" ? "支付" : "退款"}進行中...`,
|
|
@@ -695,19 +669,6 @@ var locales_default = {
|
|
|
695
669
|
return "請使用以下選項之一回答此問題";
|
|
696
670
|
}
|
|
697
671
|
return key;
|
|
698
|
-
}
|
|
699
|
-
// 汇付天下定制文案
|
|
700
|
-
"page.eftpos-pay.text.huifu.scan.title": "掃碼支付(支付寶 · 微信支付 · 銀聯)",
|
|
701
|
-
"page.eftpos-pay.text.huifu.scan.gun.connected": "掃碼槍已連接",
|
|
702
|
-
"page.eftpos-pay.text.huifu.scan.gun.connected-desc": "直接掃描消費者付款碼即可",
|
|
703
|
-
"page.eftpos-pay.text.huifu.scan.gun.not-connected": "未連接掃碼槍",
|
|
704
|
-
"page.eftpos-pay.text.huifu.scan.gun.not-connected-desc": "連接掃碼槍後可直接掃碼消費者付款碼",
|
|
705
|
-
"page.eftpos-pay.text.huifu.scan.camera-title": "點擊可使用設備攝像頭",
|
|
706
|
-
"page.eftpos-pay.text.huifu.scan.camera-desc": "將消費者付款碼對準掃描框",
|
|
707
|
-
"page.eftpos-pay.text.huifu.scan.input-title": "或手動輸入付款碼",
|
|
708
|
-
"page.eftpos-pay.text.huifu.scan.input-placeholder": "請輸入",
|
|
709
|
-
"page.eftpos-pay.text.huifu.scan.input-tip": "提示:付款碼為18位數字",
|
|
710
|
-
"page.eftpos-pay.text.huifu.scan.cancel": "取消",
|
|
711
|
-
"page.eftpos-pay.text.huifu.scan.confirm": "確認支付"
|
|
672
|
+
}
|
|
712
673
|
}
|
|
713
674
|
};
|
|
@@ -4,5 +4,4 @@ export { default as Payo } from './payo';
|
|
|
4
4
|
export { default as Windcave } from './windcave/windcave';
|
|
5
5
|
export { default as Tyro } from './tyro';
|
|
6
6
|
export { default as Linkly } from './linkly';
|
|
7
|
-
export { default as Huifu } from './huifu';
|
|
8
7
|
export declare const getInitState: (type: string, params?: any) => State;
|
|
@@ -29,7 +29,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/eftposPay/manufacturer.tsx
|
|
30
30
|
var manufacturer_exports = {};
|
|
31
31
|
__export(manufacturer_exports, {
|
|
32
|
-
Huifu: () => import_huifu.default,
|
|
33
32
|
Linkly: () => import_linkly.default,
|
|
34
33
|
Payo: () => import_payo.default,
|
|
35
34
|
Tyro: () => import_tyro.default,
|
|
@@ -43,15 +42,12 @@ var import_const2 = __toESM(require("./payo/const"));
|
|
|
43
42
|
var import_const3 = __toESM(require("./tyro/const"));
|
|
44
43
|
var import_const4 = __toESM(require("./windcave/const"));
|
|
45
44
|
var import_const5 = __toESM(require("./linkly/const"));
|
|
46
|
-
var import_const6 = __toESM(require("./huifu/const"));
|
|
47
45
|
var import_helper = require("./helper");
|
|
48
46
|
var import_payo = __toESM(require("./payo"));
|
|
49
47
|
var import_windcave = __toESM(require("./windcave/windcave"));
|
|
50
48
|
var import_tyro = __toESM(require("./tyro"));
|
|
51
49
|
var import_linkly = __toESM(require("./linkly"));
|
|
52
|
-
var import_huifu = __toESM(require("./huifu"));
|
|
53
50
|
var getInitState = (type, params) => {
|
|
54
|
-
console.log("type = ", type);
|
|
55
51
|
switch (type) {
|
|
56
52
|
case import_const.EftposEnum.Payo:
|
|
57
53
|
return (0, import_const2.default)(params);
|
|
@@ -61,15 +57,12 @@ var getInitState = (type, params) => {
|
|
|
61
57
|
return (0, import_const3.default)(params);
|
|
62
58
|
case import_const.EftposEnum.Linkly:
|
|
63
59
|
return (0, import_const5.default)(params);
|
|
64
|
-
case import_const.EftposEnum.Huifu:
|
|
65
|
-
return (0, import_const6.default)(params);
|
|
66
60
|
default:
|
|
67
61
|
throw new Error("未知的厂商类型");
|
|
68
62
|
}
|
|
69
63
|
};
|
|
70
64
|
// Annotate the CommonJS export names for ESM import in node:
|
|
71
65
|
0 && (module.exports = {
|
|
72
|
-
Huifu,
|
|
73
66
|
Linkly,
|
|
74
67
|
Payo,
|
|
75
68
|
Tyro,
|
|
@@ -152,7 +152,7 @@ var Pay = ({
|
|
|
152
152
|
className: `pisell-lowcode__eft-pay-box ${className}`,
|
|
153
153
|
style: data.type === "step" ? {} : { display: "none" }
|
|
154
154
|
},
|
|
155
|
-
|
|
155
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
156
156
|
import_header.default,
|
|
157
157
|
{
|
|
158
158
|
status: data.status,
|
|
@@ -180,8 +180,7 @@ var Pay = ({
|
|
|
180
180
|
formatAmount
|
|
181
181
|
}
|
|
182
182
|
) : null,
|
|
183
|
-
data.eftpos === "linkly" ? /* @__PURE__ */ import_react.default.createElement(import_manufacturer.Linkly, { key: data.key, api, onChange }) : null
|
|
184
|
-
data.eftpos === "huifu" ? /* @__PURE__ */ import_react.default.createElement(import_manufacturer.Huifu, { key: data.key, onChange, isNativeApp: isMobile }) : null
|
|
183
|
+
data.eftpos === "linkly" ? /* @__PURE__ */ import_react.default.createElement(import_manufacturer.Linkly, { key: data.key, api, onChange }) : null
|
|
185
184
|
) : null, data.type === import_const.PayRouteEnum.Unset && Comm ? /* @__PURE__ */ import_react.default.createElement(
|
|
186
185
|
Comm,
|
|
187
186
|
{
|
|
@@ -91,10 +91,6 @@ export declare type State = {
|
|
|
91
91
|
};
|
|
92
92
|
backup?: Omit<State, 'backup'>;
|
|
93
93
|
client: ClientEnum;
|
|
94
|
-
/** 原始参数 - 用于 retry 时完整恢复 */
|
|
95
|
-
originalParams?: {
|
|
96
|
-
[key: string]: unknown;
|
|
97
|
-
};
|
|
98
94
|
};
|
|
99
95
|
export declare type Action = {
|
|
100
96
|
type: EActionTypes;
|
|
@@ -178,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
|
178
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
179
175
|
type: EActionTypes;
|
|
180
176
|
payload: {
|
|
181
|
-
status: "loading" | "
|
|
177
|
+
status: "loading" | "warn" | "fail" | "success" | "question";
|
|
182
178
|
};
|
|
183
179
|
};
|
|
184
180
|
/**
|
|
@@ -299,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
299
295
|
name?: string | undefined;
|
|
300
296
|
symbol?: string | undefined;
|
|
301
297
|
amount?: string | number | undefined;
|
|
302
|
-
mode?: "
|
|
298
|
+
mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
|
|
303
299
|
order_id?: string | number | undefined;
|
|
304
|
-
eftpos?: "
|
|
305
|
-
action?: "
|
|
300
|
+
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
|
|
301
|
+
action?: "pay" | "amount" | "deviceList" | undefined;
|
|
306
302
|
key?: number | undefined;
|
|
307
303
|
step?: number | undefined;
|
|
308
304
|
title?: string | undefined;
|
|
@@ -312,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
312
308
|
net?: boolean | undefined;
|
|
313
309
|
component?: string | undefined;
|
|
314
310
|
form?: string | undefined;
|
|
315
|
-
status?: "loading" | "
|
|
311
|
+
status?: "loading" | "warn" | "fail" | "success" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
316
312
|
warn?: string | undefined;
|
|
317
313
|
steps?: {
|
|
318
314
|
/** 用于重置当前步骤 */
|
|
@@ -348,9 +344,6 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
348
344
|
} | undefined;
|
|
349
345
|
backup?: Omit<State, "backup"> | undefined;
|
|
350
346
|
client?: ClientEnum | undefined;
|
|
351
|
-
originalParams?: {
|
|
352
|
-
[key: string]: unknown;
|
|
353
|
-
} | undefined;
|
|
354
347
|
};
|
|
355
348
|
};
|
|
356
349
|
export declare function reducers(state: State, action: Action): State;
|
|
@@ -9,9 +9,6 @@ import './index.less';
|
|
|
9
9
|
*/
|
|
10
10
|
declare function KioskSkuDetail(props: KioskSkuDetailProps): React.JSX.Element;
|
|
11
11
|
export default KioskSkuDetail;
|
|
12
|
-
/**
|
|
13
|
-
* @description 从原生回调 payload 中提取 productId
|
|
14
|
-
*/
|
|
15
12
|
export interface KioskSkuDetailProps {
|
|
16
13
|
/** 商品 id(可选:目前默认从 URL 读取,props 仅作为兜底以兼容老用法) */
|
|
17
14
|
productId?: number | string;
|
|
@@ -39,6 +39,7 @@ var import_materials = require("@pisell/materials");
|
|
|
39
39
|
var import_dayjs = __toESM(require("dayjs"));
|
|
40
40
|
var import_utils = require("@pisell/utils");
|
|
41
41
|
var import_skuOptionsSelection = __toESM(require("../../plus/skuOptionsSelection"));
|
|
42
|
+
var import_pisellNumberSelector = __toESM(require("../../pro/pisellNumberSelector"));
|
|
42
43
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
43
44
|
var import_serve = require("../booking/info/service/serve");
|
|
44
45
|
var import_locales = __toESM(require("./locales"));
|
|
@@ -46,21 +47,41 @@ var import_index = require("./index.less");
|
|
|
46
47
|
var import_utils2 = require("../booking/utils");
|
|
47
48
|
function KioskSkuDetail(props) {
|
|
48
49
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
49
|
-
const { className, style, onAddToCart } = props;
|
|
50
|
+
const { className, style, onBack, onAddToCart } = props;
|
|
50
51
|
const productIdFromUrl = (0, import_react.useMemo)(() => {
|
|
51
52
|
return getQueryFirstMatch({ keys: ["productId", "product_id", "id"] });
|
|
52
53
|
}, []);
|
|
53
|
-
const
|
|
54
|
+
const resolvedProductId = productIdFromUrl ?? props.productId;
|
|
54
55
|
const scheduleDate = (0, import_react.useMemo)(() => (0, import_dayjs.default)().format("YYYY-MM-DD"), []);
|
|
55
|
-
const stageScale = useDesignStageScale({ designWidth: 1080, designHeight: 1800 });
|
|
56
56
|
const context = (0, import_useEngineContext.default)();
|
|
57
57
|
const { interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
58
58
|
import_utils.locales.init(import_locales.default, ((_c = (_b = context == null ? void 0 : context.engine) == null ? void 0 : _b.props) == null ? void 0 : _c.locale) || "en");
|
|
59
59
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
60
|
-
const { store, getData
|
|
60
|
+
const { store, getData } = ((_d = context.appHelper) == null ? void 0 : _d.utils) || {};
|
|
61
61
|
const state = (_e = store == null ? void 0 : store.getState) == null ? void 0 : _e.call(store);
|
|
62
62
|
const symbol = ((_h = (_g = (_f = store == null ? void 0 : store.getState) == null ? void 0 : _f.call(store)) == null ? void 0 : _g.global) == null ? void 0 : _h.symbol) || "$";
|
|
63
63
|
const currency_code = ((_k = (_j = (_i = store == null ? void 0 : store.getState) == null ? void 0 : _i.call(store)) == null ? void 0 : _j.global) == null ? void 0 : _k.currency_code) || "AUD";
|
|
64
|
+
(0, import_react.useEffect)(() => {
|
|
65
|
+
var _a2, _b2;
|
|
66
|
+
(_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
|
|
67
|
+
module: "tickets",
|
|
68
|
+
key: "page_load"
|
|
69
|
+
});
|
|
70
|
+
interaction.utils.mountFunction(
|
|
71
|
+
"tickets",
|
|
72
|
+
"restore_buy_wallet_pass",
|
|
73
|
+
(data) => {
|
|
74
|
+
console.log("重置状态", data);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
interaction.utils.mountFunction(
|
|
78
|
+
"tickets",
|
|
79
|
+
"edit_buy_wallet_pass",
|
|
80
|
+
(data) => {
|
|
81
|
+
console.log("编辑状态", data);
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}, []);
|
|
64
85
|
const [isLoading, setIsLoading] = (0, import_react.useState)(false);
|
|
65
86
|
const [errorText, setErrorText] = (0, import_react.useState)(null);
|
|
66
87
|
const [productData, setProductData] = (0, import_react.useState)(null);
|
|
@@ -77,130 +98,47 @@ function KioskSkuDetail(props) {
|
|
|
77
98
|
bundle: [],
|
|
78
99
|
option: []
|
|
79
100
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
99
|
-
}, []);
|
|
100
|
-
const loadByProductId = (0, import_react.useCallback)(async (productId, options = {}) => {
|
|
101
|
-
console.log("准备 load", productId);
|
|
102
|
-
if (productId === null || typeof productId === "undefined" || productId === "") return;
|
|
103
|
-
const reqId = ++requestSeqRef.current;
|
|
104
|
-
setIsLoading(true);
|
|
105
|
-
setErrorText(null);
|
|
106
|
-
try {
|
|
107
|
-
const open_deposit = (getData == null ? void 0 : getData("bookingv2_deposit")) || 0;
|
|
108
|
-
const params = { open_deposit };
|
|
109
|
-
params.schedule_date = scheduleDate;
|
|
110
|
-
const res = await (0, import_serve.getProductDetail)(String(productId), params);
|
|
111
|
-
console.log("详情接口");
|
|
112
|
-
console.log(JSON.stringify(res));
|
|
113
|
-
const apiData = ((res == null ? void 0 : res.id) ? res : res == null ? void 0 : res.data) || {};
|
|
114
|
-
if (reqId !== requestSeqRef.current) return;
|
|
115
|
-
setProductData(apiData);
|
|
116
|
-
console.log("已设置 productData");
|
|
117
|
-
const normalizedProductId = Number(
|
|
118
|
-
(apiData == null ? void 0 : apiData.product_id) || (apiData == null ? void 0 : apiData.id) || productId || 0
|
|
119
|
-
);
|
|
120
|
-
const minNumUnit = Number((apiData == null ? void 0 : apiData.min_num_unit) || 1);
|
|
121
|
-
if (options.shouldInitQuantity !== false) {
|
|
101
|
+
(0, import_react.useEffect)(() => {
|
|
102
|
+
let isCancelled = false;
|
|
103
|
+
async function load() {
|
|
104
|
+
if (!resolvedProductId) return;
|
|
105
|
+
setIsLoading(true);
|
|
106
|
+
setErrorText(null);
|
|
107
|
+
try {
|
|
108
|
+
const open_deposit = (getData == null ? void 0 : getData("bookingv2_deposit")) || 0;
|
|
109
|
+
const params = { open_deposit };
|
|
110
|
+
params.schedule_date = scheduleDate;
|
|
111
|
+
const res = await (0, import_serve.getProductDetail)(String(resolvedProductId), params);
|
|
112
|
+
const apiData = (res == null ? void 0 : res.data) || {};
|
|
113
|
+
if (isCancelled) return;
|
|
114
|
+
setProductData(apiData);
|
|
115
|
+
const normalizedProductId = Number(
|
|
116
|
+
(apiData == null ? void 0 : apiData.product_id) || (apiData == null ? void 0 : apiData.id) || resolvedProductId || 0
|
|
117
|
+
);
|
|
118
|
+
const minNumUnit = Number((apiData == null ? void 0 : apiData.min_num_unit) || 1);
|
|
122
119
|
setQuantity(minNumUnit > 0 ? minNumUnit : 1);
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const initialSkuValue = {
|
|
130
|
-
product_id: normalizedProductId,
|
|
131
|
-
product_variant_id: defaultVariantId,
|
|
132
|
-
bundle: [],
|
|
133
|
-
option: []
|
|
134
|
-
};
|
|
135
|
-
if (options.shouldInitSku !== false) {
|
|
120
|
+
const initialSkuValue = {
|
|
121
|
+
product_id: normalizedProductId,
|
|
122
|
+
product_variant_id: 0,
|
|
123
|
+
bundle: [],
|
|
124
|
+
option: []
|
|
125
|
+
};
|
|
136
126
|
setSkuValue(initialSkuValue);
|
|
137
127
|
setSkuDefaultValue(initialSkuValue);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
128
|
+
} catch (error) {
|
|
129
|
+
console.error(error);
|
|
130
|
+
if (isCancelled) return;
|
|
131
|
+
setErrorText("Failed to load product detail");
|
|
132
|
+
} finally {
|
|
133
|
+
if (isCancelled) return;
|
|
134
|
+
setIsLoading(false);
|
|
144
135
|
}
|
|
145
|
-
} catch (error) {
|
|
146
|
-
console.error(error);
|
|
147
|
-
setErrorText("Failed to load product detail");
|
|
148
|
-
} finally {
|
|
149
|
-
if (reqId !== requestSeqRef.current) return;
|
|
150
|
-
setIsLoading(false);
|
|
151
136
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
(_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
|
|
158
|
-
module: "wallet_pass",
|
|
159
|
-
key: "page_load"
|
|
160
|
-
});
|
|
161
|
-
(_d2 = (_c2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c2.mountFunction) == null ? void 0 : _d2.call(
|
|
162
|
-
_c2,
|
|
163
|
-
"wallet_pass",
|
|
164
|
-
"restore_buy_wallet_pass",
|
|
165
|
-
(id) => {
|
|
166
|
-
console.log("重置状态", id);
|
|
167
|
-
console.log("宽", window.innerWidth);
|
|
168
|
-
console.log("高", window.innerHeight);
|
|
169
|
-
console.log("设备像素比", window.devicePixelRatio);
|
|
170
|
-
resetForInit();
|
|
171
|
-
if (id || id === 0) loadRef.current(id);
|
|
172
|
-
setIsEdit(false);
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
(_f2 = (_e2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _e2.mountFunction) == null ? void 0 : _f2.call(
|
|
176
|
-
_e2,
|
|
177
|
-
"wallet_pass",
|
|
178
|
-
"edit_buy_wallet_pass",
|
|
179
|
-
(data) => {
|
|
180
|
-
console.log("编辑状态", data);
|
|
181
|
-
const productData2 = JSON.parse(data);
|
|
182
|
-
setProductData(productData2.productDetail);
|
|
183
|
-
loadRef.current(productData2.productDetail.id, {
|
|
184
|
-
shouldInitSku: false,
|
|
185
|
-
shouldInitQuantity: false
|
|
186
|
-
});
|
|
187
|
-
setSkuValue({
|
|
188
|
-
product_id: productData2.productDetail.id,
|
|
189
|
-
product_variant_id: Number(productData2.variantId),
|
|
190
|
-
bundle: [],
|
|
191
|
-
option: []
|
|
192
|
-
});
|
|
193
|
-
setSkuDefaultValue({
|
|
194
|
-
product_id: productData2.productDetail.id,
|
|
195
|
-
product_variant_id: Number(productData2.variantId),
|
|
196
|
-
bundle: [],
|
|
197
|
-
option: []
|
|
198
|
-
});
|
|
199
|
-
setIsEdit(true);
|
|
200
|
-
}
|
|
201
|
-
);
|
|
202
|
-
if (initialProductId || initialProductId === 0) loadRef.current(initialProductId);
|
|
203
|
-
}, []);
|
|
137
|
+
load();
|
|
138
|
+
return () => {
|
|
139
|
+
isCancelled = true;
|
|
140
|
+
};
|
|
141
|
+
}, [getData, resolvedProductId, scheduleDate]);
|
|
204
142
|
const coverUrl = (0, import_react.useMemo)(() => {
|
|
205
143
|
return (productData == null ? void 0 : productData.cover) || (productData == null ? void 0 : productData.image) || "";
|
|
206
144
|
}, [productData]);
|
|
@@ -244,51 +182,55 @@ function KioskSkuDetail(props) {
|
|
|
244
182
|
return `${priceSign}${symbol}${deTotal.abs().toNumber().toFixed(2)}`;
|
|
245
183
|
}, [itemTotal, symbol]);
|
|
246
184
|
const handleAddToCart = () => {
|
|
247
|
-
var _a2;
|
|
248
185
|
if (!productData) return;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
186
|
+
const productBundle = [];
|
|
187
|
+
skuValue.bundle.forEach((item) => {
|
|
188
|
+
if (!item.num || item.num < 1) return;
|
|
189
|
+
let targetBundleData;
|
|
190
|
+
let bundle_group_id;
|
|
191
|
+
for (let i = 0; i < productData.bundle_group.length; i++) {
|
|
192
|
+
const { id, bundle_item = [] } = productData.bundle_group[i];
|
|
193
|
+
for (let j = 0; j < bundle_item.length; j++) {
|
|
194
|
+
if (item.id === bundle_item[j].bundle_product_id) {
|
|
195
|
+
bundle_group_id = id;
|
|
196
|
+
targetBundleData = bundle_item[j];
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
productBundle.push({
|
|
202
|
+
bundle_group_id,
|
|
203
|
+
bundle_id: targetBundleData.id,
|
|
204
|
+
bundle_product_id: item.id,
|
|
205
|
+
bundle_variant_id: targetBundleData.bundle_variant_id,
|
|
206
|
+
num: item.num,
|
|
207
|
+
extension_id: targetBundleData.extension_id,
|
|
208
|
+
extension_type: targetBundleData.extension_type
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
productData.option_group = [];
|
|
212
|
+
productData.variant_group = [];
|
|
255
213
|
const obj = {
|
|
256
214
|
productDetail: productData,
|
|
257
215
|
quantity,
|
|
258
|
-
variantId: skuValue.product_variant_id,
|
|
259
216
|
pricePerUnit: unitPrice,
|
|
260
|
-
|
|
217
|
+
bundlePrice: productData.price,
|
|
218
|
+
productBundle
|
|
261
219
|
};
|
|
262
220
|
interaction.utils.postMessageToApp({
|
|
263
|
-
module: "
|
|
221
|
+
module: "tickets",
|
|
264
222
|
key: "buy_wallet_pass",
|
|
265
223
|
data: {
|
|
266
224
|
// 把洗好的数据放这里
|
|
267
|
-
productData: obj
|
|
268
|
-
isEdit
|
|
225
|
+
productData: [obj]
|
|
269
226
|
}
|
|
270
227
|
});
|
|
271
228
|
};
|
|
272
|
-
|
|
273
|
-
interaction.utils.postMessageToApp({
|
|
274
|
-
module: "wallet_pass",
|
|
275
|
-
key: "back"
|
|
276
|
-
});
|
|
277
|
-
};
|
|
278
|
-
const stageStyle = (0, import_react.useMemo)(() => {
|
|
279
|
-
return {
|
|
280
|
-
...style || {},
|
|
281
|
-
width: 1080,
|
|
282
|
-
height: 1800,
|
|
283
|
-
transform: `translateX(-50%) scale(${stageScale})`,
|
|
284
|
-
transformOrigin: "top center"
|
|
285
|
-
};
|
|
286
|
-
}, [stageScale, style]);
|
|
287
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail-viewport" }, /* @__PURE__ */ import_react.default.createElement(
|
|
229
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
288
230
|
"div",
|
|
289
231
|
{
|
|
290
232
|
className: (0, import_classnames.default)("pisell-kiosk-sku-detail", className),
|
|
291
|
-
style
|
|
233
|
+
style
|
|
292
234
|
},
|
|
293
235
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__hero" }, coverUrl ? /* @__PURE__ */ import_react.default.createElement(
|
|
294
236
|
"img",
|
|
@@ -304,10 +246,9 @@ function KioskSkuDetail(props) {
|
|
|
304
246
|
__html: descriptionText
|
|
305
247
|
}
|
|
306
248
|
}
|
|
307
|
-
)), !!priceRangeText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__price-range" }, priceRangeText, " ", currency_code), !!errorText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__error" }, errorText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__options-card" }, productData
|
|
249
|
+
)), !!priceRangeText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__price-range" }, priceRangeText, " ", currency_code), !!errorText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__error" }, errorText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__options-card" }, productData ? /* @__PURE__ */ import_react.default.createElement(
|
|
308
250
|
import_skuOptionsSelection.default,
|
|
309
251
|
{
|
|
310
|
-
ref: skuOptionsSelectionRef,
|
|
311
252
|
dataSource: productData,
|
|
312
253
|
value: skuDefaultValue,
|
|
313
254
|
skuCardConfig: {
|
|
@@ -332,7 +273,22 @@ function KioskSkuDetail(props) {
|
|
|
332
273
|
onClick: onBack
|
|
333
274
|
},
|
|
334
275
|
import_utils.locales.getText("pisell2.text.kiosk.sku.detail.btn.back")
|
|
335
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__footer-center" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__item-total" }, import_utils.locales.getText("pisell2.text.kiosk.sku.detail.item.total"), ":", " ", itemTotalText)
|
|
276
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__footer-center" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__item-total" }, import_utils.locales.getText("pisell2.text.kiosk.sku.detail.item.total"), ":", " ", itemTotalText), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__qty" }, /* @__PURE__ */ import_react.default.createElement(
|
|
277
|
+
import_pisellNumberSelector.default,
|
|
278
|
+
{
|
|
279
|
+
value: quantity,
|
|
280
|
+
width: "140px",
|
|
281
|
+
onChange: (v) => {
|
|
282
|
+
if (!v) return;
|
|
283
|
+
setQuantity(v);
|
|
284
|
+
},
|
|
285
|
+
min: 1,
|
|
286
|
+
max: 99999,
|
|
287
|
+
step: 1,
|
|
288
|
+
size: "large",
|
|
289
|
+
enablePriceAdjust: false
|
|
290
|
+
}
|
|
291
|
+
))), /* @__PURE__ */ import_react.default.createElement(
|
|
336
292
|
import_materials.Button,
|
|
337
293
|
{
|
|
338
294
|
type: "primary",
|
|
@@ -341,11 +297,9 @@ function KioskSkuDetail(props) {
|
|
|
341
297
|
onClick: handleAddToCart,
|
|
342
298
|
disabled: !productData || isLoading
|
|
343
299
|
},
|
|
344
|
-
import_utils.locales.getText(
|
|
345
|
-
isEdit ? "pisell2.text.kiosk.sku.detail.btn.update" : "pisell2.text.kiosk.sku.detail.btn.add.to.cart"
|
|
346
|
-
)
|
|
300
|
+
import_utils.locales.getText("pisell2.text.kiosk.sku.detail.btn.add.to.cart")
|
|
347
301
|
))
|
|
348
|
-
)
|
|
302
|
+
);
|
|
349
303
|
}
|
|
350
304
|
var kioskSkuDetail_default = KioskSkuDetail;
|
|
351
305
|
function getQueryFirstMatch(params) {
|
|
@@ -370,24 +324,3 @@ function getQueryFirstMatch(params) {
|
|
|
370
324
|
if (queryIndex === -1) return null;
|
|
371
325
|
return tryRead(hash.slice(queryIndex + 1));
|
|
372
326
|
}
|
|
373
|
-
function useDesignStageScale(params) {
|
|
374
|
-
const designWidth = params.designWidth;
|
|
375
|
-
const designHeight = params.designHeight;
|
|
376
|
-
const [scale, setScale] = (0, import_react.useState)(1);
|
|
377
|
-
(0, import_react.useEffect)(() => {
|
|
378
|
-
const update = () => {
|
|
379
|
-
const viewportWidth = window.innerWidth || designWidth;
|
|
380
|
-
const viewportHeight = window.innerHeight || designHeight;
|
|
381
|
-
const nextScale = Math.min(
|
|
382
|
-
viewportWidth / designWidth,
|
|
383
|
-
viewportHeight / designHeight,
|
|
384
|
-
1
|
|
385
|
-
);
|
|
386
|
-
setScale(nextScale);
|
|
387
|
-
};
|
|
388
|
-
update();
|
|
389
|
-
window.addEventListener("resize", update);
|
|
390
|
-
return () => window.removeEventListener("resize", update);
|
|
391
|
-
}, [designHeight, designWidth]);
|
|
392
|
-
return scale;
|
|
393
|
-
}
|