@pisell/private-materials 6.3.11 → 6.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +27 -3
- package/es/components/appointmentBooking/components/Content/index.js +1 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.js +10 -0
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +1 -1
- package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -1
- package/es/components/booking/hooks/useQuotation.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- 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 +1 -1
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +34 -8
- package/es/components/eventBooking/components/progressBar/index.js +20 -0
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +20 -7
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.js +12 -2
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +31 -24
- package/es/components/pay/toC/utils.d.ts +1 -1
- package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/es/components/wallet/Detail/index.js +2 -2
- package/es/components/wallet/components/WalletCard.js +3 -2
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +22 -2
- package/lib/components/appointmentBooking/components/Content/index.js +1 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.js +6 -0
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +1 -1
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -1
- package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/notes/addNote/index.d.ts +1 -0
- 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 +1 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +30 -8
- package/lib/components/eventBooking/components/progressBar/index.js +18 -0
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +11 -7
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.js +9 -2
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +6 -2
- package/lib/components/pay/toC/utils.d.ts +1 -1
- package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/lib/components/wallet/Detail/index.js +3 -3
- package/lib/components/wallet/components/WalletCard.js +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ var Text = Typography.Text;
|
|
|
30
30
|
dayjs.extend(timezone);
|
|
31
31
|
dayjs.extend(utc);
|
|
32
32
|
var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
33
|
-
var _context$appHelper, _utils$getStore, _dvaStore$core, _context$appHelper2, _store$getState, _detail$machinecode_c;
|
|
33
|
+
var _context$appHelper, _utils$getStore, _dvaStore$core, _context$appHelper2, _store$getState, _utils$interaction, _utils$interaction$is, _detail$machinecode_c;
|
|
34
34
|
var _props$detail = props.detail,
|
|
35
35
|
detail = _props$detail === void 0 ? {} : _props$detail,
|
|
36
36
|
_props$buttonGroupLis = props.buttonGroupList,
|
|
@@ -1002,7 +1002,7 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1002
1002
|
return /*#__PURE__*/React.createElement("div", {
|
|
1003
1003
|
className: "wallet-detail".concat(platform === 'h5' ? ' wallet-detail-h5' : ' wallet-detail-pc', " ").concat(className || ''),
|
|
1004
1004
|
ref: detailWrapperRef
|
|
1005
|
-
}, (platform === 'h5' || showWalletBar) && /*#__PURE__*/React.createElement("div", {
|
|
1005
|
+
}, (platform === 'h5' || showWalletBar) && !(utils !== null && utils !== void 0 && (_utils$interaction = utils.interaction) !== null && _utils$interaction !== void 0 && (_utils$interaction = _utils$interaction.utils) !== null && _utils$interaction !== void 0 && (_utils$interaction$is = _utils$interaction.isAppEnv) !== null && _utils$interaction$is !== void 0 && _utils$interaction$is.call(_utils$interaction)) && /*#__PURE__*/React.createElement("div", {
|
|
1006
1006
|
className: "wallet-detail-header"
|
|
1007
1007
|
}, /*#__PURE__*/React.createElement(WalletBar, {
|
|
1008
1008
|
setup: "detail",
|
|
@@ -62,8 +62,9 @@ var WalletCard = function WalletCard(_ref) {
|
|
|
62
62
|
disabled: isDisabled,
|
|
63
63
|
showDisabledReason: isDisabled,
|
|
64
64
|
disabledReason: disabledReason,
|
|
65
|
-
|
|
66
|
-
marginBottom: 16
|
|
65
|
+
style: {
|
|
66
|
+
marginBottom: 16,
|
|
67
|
+
width: '100%'
|
|
67
68
|
},
|
|
68
69
|
showBalanceSymbol: !['point_card', 'good_pass'].includes(tag),
|
|
69
70
|
active: isActive,
|
|
@@ -43,9 +43,11 @@ var import_utils3 = require("./utils");
|
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
44
|
var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
45
45
|
var _a, _b;
|
|
46
|
+
const hasSubscribedRef = (0, import_react.useRef)(false);
|
|
46
47
|
const context = (0, import_useEngineContext.default)();
|
|
47
48
|
const config = ((_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.config) || {};
|
|
48
49
|
const utils = (0, import_hooks.contextUtils)();
|
|
50
|
+
const { pubsub } = context.appHelper.utils;
|
|
49
51
|
const { appointmentBooking, summary, isAgreeDepositPolicy, setLoading } = (0, import_context.useAppointmentBookingContext)();
|
|
50
52
|
const { isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
51
53
|
const goPaymentFinish = (order_id, amount) => {
|
|
@@ -141,10 +143,28 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
141
143
|
}, 50);
|
|
142
144
|
}
|
|
143
145
|
};
|
|
146
|
+
const handleSubmit = () => {
|
|
147
|
+
var _a2, _b2, _c, _d;
|
|
148
|
+
if ((_b2 = (_a2 = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _a2.isGuestUser) == null ? void 0 : _b2.call(_a2)) {
|
|
149
|
+
if (!hasSubscribedRef.current) {
|
|
150
|
+
pubsub.subscribe("bind.guest.user", handleNext);
|
|
151
|
+
hasSubscribedRef.current = true;
|
|
152
|
+
}
|
|
153
|
+
(_d = (_c = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _c.openRegisterModal) == null ? void 0 : _d.call(_c, true);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
handleNext();
|
|
157
|
+
};
|
|
158
|
+
(0, import_react.useEffect)(() => {
|
|
159
|
+
return () => {
|
|
160
|
+
pubsub.unsubscribe("bind.guest.user", handleNext);
|
|
161
|
+
hasSubscribedRef.current = false;
|
|
162
|
+
};
|
|
163
|
+
}, []);
|
|
144
164
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
145
|
-
next:
|
|
165
|
+
next: handleSubmit
|
|
146
166
|
}));
|
|
147
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext:
|
|
167
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleSubmit }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
|
|
148
168
|
"img",
|
|
149
169
|
{
|
|
150
170
|
src: `${config == null ? void 0 : config.awsStatic}/checkout_confirm.png`,
|
|
@@ -100,7 +100,7 @@ var Layout = () => {
|
|
|
100
100
|
};
|
|
101
101
|
pubsub.subscribe("pisell1.login.success", handleLoginSuccess);
|
|
102
102
|
return () => {
|
|
103
|
-
pubsub.unsubscribe("pisell1.login.success");
|
|
103
|
+
pubsub.unsubscribe("pisell1.login.success", handleLoginSuccess);
|
|
104
104
|
};
|
|
105
105
|
}, []);
|
|
106
106
|
(0, import_react.useEffect)(() => {
|
|
@@ -55,6 +55,12 @@ var AppointmentBooking = () => {
|
|
|
55
55
|
if (!data.length) {
|
|
56
56
|
const currentUser = (0, import_utils2.formatCurrentUser)(utils);
|
|
57
57
|
appointmentBooking.addAccounts([currentUser]);
|
|
58
|
+
} else if (data.length >= 1) {
|
|
59
|
+
const meAccount = data == null ? void 0 : data.find((d) => !(d == null ? void 0 : d.isGuest));
|
|
60
|
+
const currentUser = (0, import_utils2.formatCurrentUser)(utils);
|
|
61
|
+
if (currentUser && meAccount.id !== currentUser.id) {
|
|
62
|
+
appointmentBooking.setLoginAccount(meAccount.id, currentUser);
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
});
|
|
60
66
|
}, []);
|
|
@@ -308,7 +308,7 @@ var formatBookings = (data, values) => {
|
|
|
308
308
|
if (isEvent) {
|
|
309
309
|
list = list.filter((d) => {
|
|
310
310
|
var _a;
|
|
311
|
-
return (_a = d._extend) == null ? void 0 : _a.holder_id;
|
|
311
|
+
return ((_a = d._extend) == null ? void 0 : _a.holder_id) && !(0, import_utils4.isNormalProductByDurationSchedule)(d);
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
if (!isDay && !isEvent) {
|
|
@@ -9,7 +9,7 @@ import { PosProps } from './const';
|
|
|
9
9
|
*/
|
|
10
10
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
11
11
|
className?: string | undefined;
|
|
12
|
-
onChange?: ((status: "success" | "page" | "
|
|
12
|
+
onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
|
13
13
|
[keys: string]: unknown;
|
|
14
14
|
} | undefined, other?: any) => void) | undefined;
|
|
15
15
|
onClose: () => void;
|
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
12
12
|
api: PayProps['api'];
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
onChange?: ((status: "success" | "page" | "
|
|
14
|
+
onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
|
15
15
|
[keys: string]: unknown;
|
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
|
17
17
|
onClose: () => void;
|
|
@@ -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<"stripe" | "payo" | "tyro" | "windcave" | "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" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "
|
|
300
|
+
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -45,7 +45,8 @@ var import_useEngineContext = __toESM(require("../../../../../../hooks/useEngine
|
|
|
45
45
|
var import_index = require("./index.less");
|
|
46
46
|
var import_utils3 = require("../../../../../appointmentBooking/utils");
|
|
47
47
|
var ContinueButton = () => {
|
|
48
|
-
var _a, _b;
|
|
48
|
+
var _a, _b, _c, _d, _e;
|
|
49
|
+
const hasSubscribedRef = (0, import_react.useRef)(false);
|
|
49
50
|
const { data } = (0, import_Sales.useSales)();
|
|
50
51
|
const { onHolderOpen } = (0, import_Sales.useHolder)();
|
|
51
52
|
const { checkHolder, onCloseCart, cartData, getWithoutCartItemsHolderNames } = (0, import_Sales.useCart)();
|
|
@@ -64,14 +65,17 @@ var ContinueButton = () => {
|
|
|
64
65
|
const [openEmptyHolder, setOpenEmptyHolder] = (0, import_react.useState)(false);
|
|
65
66
|
const { setData, removeSessionStorage } = (0, import_Sales.useSales)();
|
|
66
67
|
const context = (0, import_useEngineContext.default)();
|
|
67
|
-
const
|
|
68
|
+
const config = ((_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.config) || {};
|
|
69
|
+
const utils = ((_c = context == null ? void 0 : context.appHelper) == null ? void 0 : _c.utils) || {};
|
|
70
|
+
const { pubsub } = context.appHelper.utils;
|
|
71
|
+
const { store, action, getStore } = ((_d = context.appHelper) == null ? void 0 : _d.utils) || {};
|
|
68
72
|
const handleCheckout = async () => {
|
|
69
73
|
const params = (0, import_utils2.getFormParams)(data);
|
|
70
74
|
action == null ? void 0 : action({
|
|
71
75
|
type: "pisell1.goProductForm",
|
|
72
76
|
data: params,
|
|
73
77
|
callback: async (e) => {
|
|
74
|
-
var _a2, _b2,
|
|
78
|
+
var _a2, _b2, _c2;
|
|
75
79
|
if ((e == null ? void 0 : e.type) === "close") {
|
|
76
80
|
return;
|
|
77
81
|
}
|
|
@@ -88,7 +92,7 @@ var ContinueButton = () => {
|
|
|
88
92
|
removeSessionStorage();
|
|
89
93
|
} else {
|
|
90
94
|
(0, import_materials.PisellToast)({
|
|
91
|
-
content: ((
|
|
95
|
+
content: ((_c2 = result == null ? void 0 : result.err) == null ? void 0 : _c2.message) || ""
|
|
92
96
|
});
|
|
93
97
|
}
|
|
94
98
|
}
|
|
@@ -234,13 +238,13 @@ var ContinueButton = () => {
|
|
|
234
238
|
handleNextStep();
|
|
235
239
|
};
|
|
236
240
|
const handleContinue = async () => {
|
|
237
|
-
var _a2, _b2,
|
|
241
|
+
var _a2, _b2, _c2;
|
|
238
242
|
if (isLastStep) {
|
|
239
243
|
const value = (0, import_utils2.formatValues)({
|
|
240
244
|
state: data,
|
|
241
245
|
platform: (_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.constants) == null ? void 0 : _b2.platform
|
|
242
246
|
});
|
|
243
|
-
if ((deposit == null ? void 0 : deposit.hasDeposit) && ((
|
|
247
|
+
if ((deposit == null ? void 0 : deposit.hasDeposit) && ((_c2 = deposit == null ? void 0 : deposit.protocols) == null ? void 0 : _c2.length) > 0 && !isAgreeDepositPolicy) {
|
|
244
248
|
(0, import_utils3.Toast)(import_utils.locales.getText("pisell2.appointment.deposit.agree.policy"));
|
|
245
249
|
return;
|
|
246
250
|
}
|
|
@@ -270,6 +274,24 @@ var ContinueButton = () => {
|
|
|
270
274
|
}
|
|
271
275
|
handleHolder();
|
|
272
276
|
};
|
|
277
|
+
const handleSubmit = () => {
|
|
278
|
+
var _a2, _b2, _c2, _d2;
|
|
279
|
+
if ((_b2 = (_a2 = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _a2.isGuestUser) == null ? void 0 : _b2.call(_a2)) {
|
|
280
|
+
if (!hasSubscribedRef.current) {
|
|
281
|
+
pubsub.subscribe("bind.guest.user", handleContinue);
|
|
282
|
+
hasSubscribedRef.current = true;
|
|
283
|
+
}
|
|
284
|
+
(_d2 = (_c2 = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _c2.openRegisterModal) == null ? void 0 : _d2.call(_c2, true);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
handleContinue();
|
|
288
|
+
};
|
|
289
|
+
(0, import_react.useEffect)(() => {
|
|
290
|
+
return () => {
|
|
291
|
+
pubsub.unsubscribe("bind.guest.user", handleContinue);
|
|
292
|
+
hasSubscribedRef.current = false;
|
|
293
|
+
};
|
|
294
|
+
}, []);
|
|
273
295
|
const continueText = (0, import_react.useMemo)(() => {
|
|
274
296
|
if (isLastStep) {
|
|
275
297
|
return import_utils.locales.getText("pisell2.event.checkout");
|
|
@@ -289,10 +311,10 @@ var ContinueButton = () => {
|
|
|
289
311
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
290
312
|
import_materials.Button,
|
|
291
313
|
{
|
|
292
|
-
disabled: !((
|
|
314
|
+
disabled: !((_e = cartData == null ? void 0 : cartData.cartItems) == null ? void 0 : _e.length),
|
|
293
315
|
size: "large",
|
|
294
316
|
type: "primary",
|
|
295
|
-
onClick: () => handleContinue(),
|
|
317
|
+
onClick: () => isLastStep ? handleSubmit() : handleContinue(),
|
|
296
318
|
loading: confirmLoading
|
|
297
319
|
},
|
|
298
320
|
continueText
|
|
@@ -64,6 +64,24 @@ var ProgressBar = ({
|
|
|
64
64
|
const handleOk = () => {
|
|
65
65
|
var _a2, _b;
|
|
66
66
|
if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
|
|
67
|
+
const url = window.location.href;
|
|
68
|
+
if (url.includes("isByTabbar")) {
|
|
69
|
+
removeSessionStorage == null ? void 0 : removeSessionStorage();
|
|
70
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
71
|
+
urlParams.delete("cacheId");
|
|
72
|
+
setOpen(false);
|
|
73
|
+
interaction.utils.postMessageToApp({
|
|
74
|
+
module: "global",
|
|
75
|
+
key: "openNative",
|
|
76
|
+
data: {
|
|
77
|
+
link: {
|
|
78
|
+
page: "home"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
window.location.href = window.location.pathname + "?" + urlParams.toString();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
67
85
|
interaction.utils.postMessageToApp({
|
|
68
86
|
module: "global",
|
|
69
87
|
key: "paymentResultAction",
|
|
@@ -41,30 +41,34 @@ var import_payGroup = require("../../payGroup");
|
|
|
41
41
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
42
42
|
var import_utils2 = require("../../utils");
|
|
43
43
|
var GooglePay = (props, ref) => {
|
|
44
|
-
var _a;
|
|
44
|
+
var _a, _b;
|
|
45
45
|
const { state } = (0, import_react.useContext)(import_model.Context);
|
|
46
46
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
47
47
|
const context = (0, import_useEngineContext.default)();
|
|
48
48
|
const { config } = ((_a = context.appHelper) == null ? void 0 : _a.constants) || {};
|
|
49
|
+
const { interaction } = (_b = context.appHelper) == null ? void 0 : _b.utils;
|
|
49
50
|
const init = async ({ payGroup }) => {
|
|
50
|
-
var _a2,
|
|
51
|
-
setOpen(true);
|
|
51
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
52
52
|
const utils = context.appHelper.utils || {};
|
|
53
|
-
const dvaStore = (
|
|
53
|
+
const dvaStore = (_b2 = (_a2 = utils == null ? void 0 : utils.getStore) == null ? void 0 : _a2.call(utils)) == null ? void 0 : _b2.getState();
|
|
54
54
|
const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
|
|
55
|
+
if (((_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.isAppEnv) == null ? void 0 : _d.call(_c)) && ((_f = (_e = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _e.isAndroid_ios) == null ? void 0 : _f.call(_e)) === "android") {
|
|
56
|
+
return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "google_pay", values, interaction });
|
|
57
|
+
}
|
|
58
|
+
setOpen(true);
|
|
55
59
|
if (!values) {
|
|
56
60
|
setOpen(false);
|
|
57
61
|
return;
|
|
58
62
|
}
|
|
59
63
|
try {
|
|
60
|
-
const locale = ((
|
|
61
|
-
const shopId = (
|
|
64
|
+
const locale = ((_g = dvaStore.core) == null ? void 0 : _g.translateLocale) || "en";
|
|
65
|
+
const shopId = (_j = (_i = (_h = dvaStore.core) == null ? void 0 : _h.core) == null ? void 0 : _i.shop) == null ? void 0 : _j.id;
|
|
62
66
|
const currentURL = window.location.href;
|
|
63
67
|
const linkElement = document.createElement("a");
|
|
64
68
|
linkElement.href = currentURL;
|
|
65
69
|
const shop_domain = linkElement.hostname;
|
|
66
70
|
const _href = `${config.pay}${(0, import_utils2.formatFranchiseeRoute)(
|
|
67
|
-
`/google-pay?order_id=${(
|
|
71
|
+
`/google-pay?order_id=${(_k = state.payGroup) == null ? void 0 : _k.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}`,
|
|
68
72
|
state.history
|
|
69
73
|
)}`;
|
|
70
74
|
window.location.href = _href;
|
|
@@ -10,6 +10,7 @@ export interface WalletPassListProps {
|
|
|
10
10
|
walletSetting: {
|
|
11
11
|
name: string;
|
|
12
12
|
};
|
|
13
|
+
onChangeDebounce?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare type WalletPassListRef = {
|
|
15
16
|
init: (params: MachineCodeListParams, formatList?: (val: WalletPassDataType[]) => WalletPassDataType[]) => void;
|
|
@@ -41,7 +41,7 @@ var import_utils2 = require("../utils");
|
|
|
41
41
|
var import_index = require("./index.less");
|
|
42
42
|
var WalletPassList = (0, import_react.forwardRef)(
|
|
43
43
|
(props, ref) => {
|
|
44
|
-
const { title, onChange, data: propsData, value, walletSetting } = props;
|
|
44
|
+
const { title, onChange, data: propsData, value, walletSetting, onLoadingChange, loading: propsLoading, onChangeDebounce } = props;
|
|
45
45
|
const [data, setData] = (0, import_react.useState)(
|
|
46
46
|
propsData || []
|
|
47
47
|
);
|
|
@@ -51,6 +51,9 @@ var WalletPassList = (0, import_react.forwardRef)(
|
|
|
51
51
|
setData(propsData);
|
|
52
52
|
}
|
|
53
53
|
}, [propsData]);
|
|
54
|
+
(0, import_react.useEffect)(() => {
|
|
55
|
+
setLoading(!!propsLoading);
|
|
56
|
+
}, [propsLoading]);
|
|
54
57
|
const getList = async (params, formatList) => {
|
|
55
58
|
setLoading(true);
|
|
56
59
|
try {
|
|
@@ -70,6 +73,9 @@ var WalletPassList = (0, import_react.forwardRef)(
|
|
|
70
73
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
71
74
|
init
|
|
72
75
|
}));
|
|
76
|
+
(0, import_react.useEffect)(() => {
|
|
77
|
+
onLoadingChange == null ? void 0 : onLoadingChange(loading);
|
|
78
|
+
}, [loading]);
|
|
73
79
|
const { availableList, disabledList } = (0, import_react.useMemo)(() => {
|
|
74
80
|
const _disabledList = [];
|
|
75
81
|
const _availableList = [];
|
|
@@ -111,7 +117,8 @@ var WalletPassList = (0, import_react.forwardRef)(
|
|
|
111
117
|
value,
|
|
112
118
|
onChange: handleChange,
|
|
113
119
|
showEmpty: data.length === 0,
|
|
114
|
-
empty
|
|
120
|
+
empty,
|
|
121
|
+
onChangeDebounce
|
|
115
122
|
}
|
|
116
123
|
), !!disabledList.length && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-walletPass-list-disabled" }, import_utils.locales.getText("tocPay.text.walletPassDisabled")), /* @__PURE__ */ import_react.default.createElement(
|
|
117
124
|
import_materials.PisellCardList,
|
|
@@ -48,6 +48,7 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
|
|
|
48
48
|
var _a;
|
|
49
49
|
const { onWalletPassChange, walletPass, walletSetting } = props;
|
|
50
50
|
const [currentWalletPass, setCurrentWalletPass] = (0, import_react.useState)(walletPass);
|
|
51
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
51
52
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
52
53
|
const [searchOpen, setSearchOpen] = (0, import_react.useState)(false);
|
|
53
54
|
const [addList, setAddList] = (0, import_react.useState)([]);
|
|
@@ -281,7 +282,9 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
|
|
|
281
282
|
data: otherCustomerWalletPassList,
|
|
282
283
|
title: import_utils.locales.getText("tocPay.text.couponCodesAdded"),
|
|
283
284
|
onChange: handleOtherChange,
|
|
284
|
-
value: selectValue
|
|
285
|
+
value: selectValue,
|
|
286
|
+
loading,
|
|
287
|
+
onChangeDebounce: true
|
|
285
288
|
}
|
|
286
289
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
287
290
|
import_List.default,
|
|
@@ -290,7 +293,8 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
|
|
|
290
293
|
title: walletSetting.name,
|
|
291
294
|
onChange: handleCurrentChange,
|
|
292
295
|
ref: listRef,
|
|
293
|
-
value: selectValue
|
|
296
|
+
value: selectValue,
|
|
297
|
+
onLoadingChange: setLoading
|
|
294
298
|
}
|
|
295
299
|
))
|
|
296
300
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -51,7 +51,7 @@ export declare const formatFranchiseeRoute: (url: string, history?: any) => stri
|
|
|
51
51
|
export declare const getAvailableMaxAmount: (data: WalletPassDataType) => string;
|
|
52
52
|
export declare const clientPayment: (params: {
|
|
53
53
|
order_id: number;
|
|
54
|
-
type: "aliPay" | "wxPay";
|
|
54
|
+
type: "aliPay" | "wxPay" | 'google_pay';
|
|
55
55
|
values: any;
|
|
56
56
|
interaction?: any;
|
|
57
57
|
}) => void;
|
|
@@ -50,7 +50,7 @@ var { Text } = import_materials2.Typography;
|
|
|
50
50
|
import_dayjs.default.extend(import_timezone.default);
|
|
51
51
|
import_dayjs.default.extend(import_utc.default);
|
|
52
52
|
var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
53
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
54
54
|
const {
|
|
55
55
|
detail = {},
|
|
56
56
|
buttonGroupList = [[]],
|
|
@@ -659,7 +659,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
|
659
659
|
className: `wallet-detail${platform === "h5" ? " wallet-detail-h5" : " wallet-detail-pc"} ${className || ""}`,
|
|
660
660
|
ref: detailWrapperRef
|
|
661
661
|
},
|
|
662
|
-
(platform === "h5" || showWalletBar) && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-header" }, /* @__PURE__ */ import_react.default.createElement(import_components.WalletBar, { setup: "detail", onBack: handleBack })),
|
|
662
|
+
(platform === "h5" || showWalletBar) && !((_l = (_k = (_j = utils == null ? void 0 : utils.interaction) == null ? void 0 : _j.utils) == null ? void 0 : _k.isAppEnv) == null ? void 0 : _l.call(_k)) && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-header" }, /* @__PURE__ */ import_react.default.createElement(import_components.WalletBar, { setup: "detail", onBack: handleBack })),
|
|
663
663
|
/* @__PURE__ */ import_react.default.createElement(
|
|
664
664
|
"div",
|
|
665
665
|
{
|
|
@@ -751,7 +751,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
|
751
751
|
step: "detail",
|
|
752
752
|
addWalletLoading,
|
|
753
753
|
onAppleWalletClick: tag === "gift_card" ? addWalletCard : void 0,
|
|
754
|
-
onRechargeClick: tag === "gift_card" && ((
|
|
754
|
+
onRechargeClick: tag === "gift_card" && ((_m = detail == null ? void 0 : detail.machinecode_config) == null ? void 0 : _m.hide_recharge) === 0 ? handleRecharge : void 0,
|
|
755
755
|
platform,
|
|
756
756
|
isIOS: (0, import_utils.isIos)()
|
|
757
757
|
}
|
|
@@ -73,7 +73,7 @@ var WalletCard = ({
|
|
|
73
73
|
disabled: isDisabled,
|
|
74
74
|
showDisabledReason: isDisabled,
|
|
75
75
|
disabledReason,
|
|
76
|
-
|
|
76
|
+
style: { marginBottom: 16, width: "100%" },
|
|
77
77
|
showBalanceSymbol: !["point_card", "good_pass"].includes(tag),
|
|
78
78
|
active: isActive,
|
|
79
79
|
name: product_title,
|