@pisell/private-materials 3.0.23 → 3.0.25
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 +4 -4
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.js +4 -4
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/index.js +28 -5
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/footer/index.js +20 -2
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/index.js +6 -3
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/index.js +28 -3
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/footer/index.js +18 -5
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/index.js +6 -3
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +3 -3
|
@@ -39,6 +39,7 @@ import { formatProductBundle } from "../components/footer/utils";
|
|
|
39
39
|
import { formatProductListByCategory, getProductTotalPrice } from "../utils";
|
|
40
40
|
import { locales, getUniqueId } from "@pisell/utils";
|
|
41
41
|
import "./index.less";
|
|
42
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
42
43
|
export var formatProducts = function formatProducts(values) {
|
|
43
44
|
var arr = [];
|
|
44
45
|
arr = values.map(function (item) {
|
|
@@ -109,7 +110,7 @@ var formatProductValues = function formatProductValues(data) {
|
|
|
109
110
|
});
|
|
110
111
|
};
|
|
111
112
|
var Addons = Provider(function (props) {
|
|
112
|
-
var _state$addons2, _state$addons4;
|
|
113
|
+
var _context$appHelper, _state$addons2, _state$addons4;
|
|
113
114
|
var globalState = props.globalState;
|
|
114
115
|
var _useContext = useContext(Context),
|
|
115
116
|
state = _useContext.state,
|
|
@@ -122,6 +123,10 @@ var Addons = Provider(function (props) {
|
|
|
122
123
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
123
124
|
search = _useState4[0],
|
|
124
125
|
setSearch = _useState4[1];
|
|
126
|
+
var context = useEngineContext();
|
|
127
|
+
var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
128
|
+
isTerminal = _ref.isTerminal,
|
|
129
|
+
interaction = _ref.interaction;
|
|
125
130
|
useEffect(function () {
|
|
126
131
|
dispatch({
|
|
127
132
|
type: "setState",
|
|
@@ -154,6 +159,14 @@ var Addons = Provider(function (props) {
|
|
|
154
159
|
init();
|
|
155
160
|
}
|
|
156
161
|
}, [state.bookingDetail]);
|
|
162
|
+
useEffect(function () {
|
|
163
|
+
if (isTerminal !== null && isTerminal !== void 0 && isTerminal()) {
|
|
164
|
+
var _interaction$utils;
|
|
165
|
+
interaction === null || interaction === void 0 ? void 0 : (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 ? void 0 : _interaction$utils.mountFunction("booking", "refreshBookingDetailAddons", function () {
|
|
166
|
+
init();
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}, [state]);
|
|
157
170
|
|
|
158
171
|
/**
|
|
159
172
|
* @title: 通过订单id 获取addons
|
|
@@ -163,7 +176,7 @@ var Addons = Provider(function (props) {
|
|
|
163
176
|
* @Date: 2024-01-30 16:35
|
|
164
177
|
*/
|
|
165
178
|
var getAddonsByOrderId = /*#__PURE__*/function () {
|
|
166
|
-
var
|
|
179
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
167
180
|
var data;
|
|
168
181
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
169
182
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -189,7 +202,7 @@ var Addons = Provider(function (props) {
|
|
|
189
202
|
}, _callee);
|
|
190
203
|
}));
|
|
191
204
|
return function getAddonsByOrderId() {
|
|
192
|
-
return
|
|
205
|
+
return _ref2.apply(this, arguments);
|
|
193
206
|
};
|
|
194
207
|
}();
|
|
195
208
|
|
|
@@ -201,7 +214,7 @@ var Addons = Provider(function (props) {
|
|
|
201
214
|
* @Date: 2024-01-30 16:36
|
|
202
215
|
*/
|
|
203
216
|
var getProducts = /*#__PURE__*/function () {
|
|
204
|
-
var
|
|
217
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
205
218
|
var data;
|
|
206
219
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
207
220
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -234,7 +247,7 @@ var Addons = Provider(function (props) {
|
|
|
234
247
|
}, _callee2);
|
|
235
248
|
}));
|
|
236
249
|
return function getProducts() {
|
|
237
|
-
return
|
|
250
|
+
return _ref3.apply(this, arguments);
|
|
238
251
|
};
|
|
239
252
|
}();
|
|
240
253
|
|
|
@@ -374,6 +387,16 @@ var Addons = Provider(function (props) {
|
|
|
374
387
|
* @Date: 2024-01-30 16:40
|
|
375
388
|
*/
|
|
376
389
|
var handleOpenAdd = function handleOpenAdd() {
|
|
390
|
+
if (isTerminal !== null && isTerminal !== void 0 && isTerminal()) {
|
|
391
|
+
var _interaction$utils2, _interaction$utils2$p;
|
|
392
|
+
return interaction === null || interaction === void 0 ? void 0 : (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 ? void 0 : (_interaction$utils2$p = _interaction$utils2.postMessageToApp) === null || _interaction$utils2$p === void 0 ? void 0 : _interaction$utils2$p.call(_interaction$utils2, {
|
|
393
|
+
module: "booking",
|
|
394
|
+
key: "edit_order",
|
|
395
|
+
data: {
|
|
396
|
+
order_id: state.bookingId
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
}
|
|
377
400
|
setSearch("");
|
|
378
401
|
dispatch({
|
|
379
402
|
type: "setAddons",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -28,6 +28,7 @@ import { formatValues } from "./utils";
|
|
|
28
28
|
import { getSumTotal, is_price_include_tax } from "./amount";
|
|
29
29
|
import FooterMenus from "./FooterMenus";
|
|
30
30
|
import "./index.less";
|
|
31
|
+
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* @title: 底部
|
|
@@ -38,7 +39,7 @@ import "./index.less";
|
|
|
38
39
|
* @Date: 2024-01-30 16:51
|
|
39
40
|
*/
|
|
40
41
|
var Footer = function Footer(props) {
|
|
41
|
-
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$addons2, _state$addons4, _state$bookingDetail3;
|
|
42
|
+
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$addons2, _state$addons4, _state$bookingDetail3;
|
|
42
43
|
var state = props.state,
|
|
43
44
|
buttons = props.buttons,
|
|
44
45
|
dispatch = props.dispatch,
|
|
@@ -58,6 +59,10 @@ var Footer = function Footer(props) {
|
|
|
58
59
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
60
|
checkoutLoading = _useState6[0],
|
|
60
61
|
setCheckoutLoading = _useState6[1];
|
|
62
|
+
var context = useEngineContext();
|
|
63
|
+
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
|
64
|
+
isTerminal = _context$appHelper$ut.isTerminal,
|
|
65
|
+
interaction = _context$appHelper$ut.interaction;
|
|
61
66
|
|
|
62
67
|
// board 配置
|
|
63
68
|
var params = useMemo(function () {
|
|
@@ -148,9 +153,22 @@ var Footer = function Footer(props) {
|
|
|
148
153
|
*/
|
|
149
154
|
var goCheckout = /*#__PURE__*/function () {
|
|
150
155
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(order_id) {
|
|
156
|
+
var _interaction$utils, _interaction$utils$po;
|
|
151
157
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
152
158
|
while (1) switch (_context.prev = _context.next) {
|
|
153
159
|
case 0:
|
|
160
|
+
if (!(isTerminal !== null && isTerminal !== void 0 && isTerminal())) {
|
|
161
|
+
_context.next = 2;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
return _context.abrupt("return", interaction === null || interaction === void 0 ? void 0 : (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 ? void 0 : (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 ? void 0 : _interaction$utils$po.call(_interaction$utils, {
|
|
165
|
+
module: 'booking',
|
|
166
|
+
key: 'booking_checkout',
|
|
167
|
+
data: {
|
|
168
|
+
order_id: order_id
|
|
169
|
+
}
|
|
170
|
+
}));
|
|
171
|
+
case 2:
|
|
154
172
|
state.action({
|
|
155
173
|
type: "pisell1.handlePayment",
|
|
156
174
|
data: {
|
|
@@ -160,7 +178,7 @@ var Footer = function Footer(props) {
|
|
|
160
178
|
state === null || state === void 0 ? void 0 : state.callback();
|
|
161
179
|
}
|
|
162
180
|
});
|
|
163
|
-
case
|
|
181
|
+
case 3:
|
|
164
182
|
case "end":
|
|
165
183
|
return _context.stop();
|
|
166
184
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => JSX.Element;
|
|
2
2
|
export default Booking;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
2
|
export declare const walkInData: {
|
|
4
3
|
id: number;
|
|
5
4
|
nickname: string;
|
|
6
5
|
};
|
|
7
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
8
7
|
state: FormState;
|
|
9
8
|
} & {
|
|
10
9
|
dispatch: (params: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -87,7 +86,7 @@ export declare const walkInData: {
|
|
|
87
86
|
id: number;
|
|
88
87
|
nickname: string;
|
|
89
88
|
};
|
|
90
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
89
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
91
90
|
state: FormState;
|
|
92
91
|
} & {
|
|
93
92
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -80,10 +80,13 @@ var Payments = Provider(function (props) {
|
|
|
80
80
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
81
81
|
refundAmount = _useState6[0],
|
|
82
82
|
setRefundAmount = _useState6[1];
|
|
83
|
+
var init = function init() {
|
|
84
|
+
getPayments();
|
|
85
|
+
getRefundInfo();
|
|
86
|
+
};
|
|
83
87
|
useEffect(function () {
|
|
84
88
|
if (!!state.bookingId) {
|
|
85
|
-
|
|
86
|
-
getRefundInfo();
|
|
89
|
+
init();
|
|
87
90
|
state.action({
|
|
88
91
|
type: "pisell1.registerPlugin",
|
|
89
92
|
data: {
|
|
@@ -91,7 +94,7 @@ var Payments = Provider(function (props) {
|
|
|
91
94
|
}
|
|
92
95
|
});
|
|
93
96
|
}
|
|
94
|
-
}, [state.bookingId]);
|
|
97
|
+
}, [state.bookingId, state.refresh]);
|
|
95
98
|
var getRefundInfo = /*#__PURE__*/function () {
|
|
96
99
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
97
100
|
var res;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,7 +68,7 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
71
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
73
72
|
state: FormState;
|
|
74
73
|
} & {
|
|
75
74
|
dispatch: (params: {
|
|
@@ -47,6 +47,7 @@ var import_utils = require("../components/footer/utils");
|
|
|
47
47
|
var import_utils2 = require("../utils");
|
|
48
48
|
var import_utils3 = require("@pisell/utils");
|
|
49
49
|
var import_index = require("./index.less");
|
|
50
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
50
51
|
var formatProducts = (values) => {
|
|
51
52
|
let arr = [];
|
|
52
53
|
arr = values.map((item) => {
|
|
@@ -118,11 +119,13 @@ var formatProductValues = (data) => {
|
|
|
118
119
|
});
|
|
119
120
|
};
|
|
120
121
|
var Addons = (0, import_model.Provider)((props) => {
|
|
121
|
-
var _a, _b;
|
|
122
|
+
var _a, _b, _c;
|
|
122
123
|
const { globalState } = props;
|
|
123
124
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
124
125
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
125
126
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
127
|
+
const context = (0, import_useEngineContext.default)();
|
|
128
|
+
const { isTerminal, interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
126
129
|
(0, import_react.useEffect)(() => {
|
|
127
130
|
dispatch({
|
|
128
131
|
type: "setState",
|
|
@@ -148,6 +151,18 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
148
151
|
init();
|
|
149
152
|
}
|
|
150
153
|
}, [state.bookingDetail]);
|
|
154
|
+
(0, import_react.useEffect)(() => {
|
|
155
|
+
var _a2;
|
|
156
|
+
if (isTerminal == null ? void 0 : isTerminal()) {
|
|
157
|
+
(_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.mountFunction(
|
|
158
|
+
"booking",
|
|
159
|
+
"refreshBookingDetailAddons",
|
|
160
|
+
() => {
|
|
161
|
+
init();
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
}, [state]);
|
|
151
166
|
const getAddonsByOrderId = async () => {
|
|
152
167
|
setLoading(true);
|
|
153
168
|
let data = await state.apis.getAddonsByOrderId();
|
|
@@ -271,12 +286,22 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
271
286
|
_list,
|
|
272
287
|
search ? (item) => isIncludes(item.title) : void 0
|
|
273
288
|
);
|
|
274
|
-
}, [search, (
|
|
289
|
+
}, [search, (_b = state.addons) == null ? void 0 : _b.originData]);
|
|
275
290
|
const isEdit = (0, import_react.useMemo)(() => {
|
|
276
291
|
var _a2;
|
|
277
292
|
return (_a2 = state == null ? void 0 : state.addons) == null ? void 0 : _a2.edit;
|
|
278
|
-
}, [(
|
|
293
|
+
}, [(_c = state == null ? void 0 : state.addons) == null ? void 0 : _c.edit]);
|
|
279
294
|
const handleOpenAdd = () => {
|
|
295
|
+
var _a2, _b2;
|
|
296
|
+
if (isTerminal == null ? void 0 : isTerminal()) {
|
|
297
|
+
return (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
|
|
298
|
+
module: "booking",
|
|
299
|
+
key: "edit_order",
|
|
300
|
+
data: {
|
|
301
|
+
order_id: state.bookingId
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
280
305
|
setSearch("");
|
|
281
306
|
dispatch({
|
|
282
307
|
type: "setAddons",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -43,23 +43,26 @@ var import_utils2 = require("./utils");
|
|
|
43
43
|
var import_amount = require("./amount");
|
|
44
44
|
var import_FooterMenus = __toESM(require("./FooterMenus"));
|
|
45
45
|
var import_index = require("./index.less");
|
|
46
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
46
47
|
var Footer = (props) => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f;
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
48
49
|
const { state, buttons, dispatch, source } = props;
|
|
49
50
|
const [showDetail, setShowDetail] = (0, import_react.useState)(false);
|
|
50
51
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
51
52
|
const [checkoutLoading, setCheckoutLoading] = (0, import_react.useState)(false);
|
|
53
|
+
const context = (0, import_useEngineContext.default)();
|
|
54
|
+
const { isTerminal, interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
52
55
|
const params = (0, import_react.useMemo)(() => {
|
|
53
56
|
var _a2, _b2, _c2;
|
|
54
57
|
return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.appointment_subject) || {};
|
|
55
|
-
}, [(
|
|
58
|
+
}, [(_d = (_c = (_b = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject]);
|
|
56
59
|
const addonsEdit = (0, import_react.useMemo)(() => {
|
|
57
60
|
var _a2;
|
|
58
61
|
if ((_a2 = state.addons) == null ? void 0 : _a2.edit) {
|
|
59
62
|
return true;
|
|
60
63
|
}
|
|
61
64
|
return false;
|
|
62
|
-
}, [(
|
|
65
|
+
}, [(_e = state.addons) == null ? void 0 : _e.edit]);
|
|
63
66
|
const infoEdit = (0, import_react.useMemo)(() => {
|
|
64
67
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
65
68
|
if (!state.bookingId) {
|
|
@@ -108,6 +111,16 @@ var Footer = (props) => {
|
|
|
108
111
|
return false;
|
|
109
112
|
}, [state, params]);
|
|
110
113
|
const goCheckout = async (order_id) => {
|
|
114
|
+
var _a2, _b2;
|
|
115
|
+
if (isTerminal == null ? void 0 : isTerminal()) {
|
|
116
|
+
return (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
|
|
117
|
+
module: "booking",
|
|
118
|
+
key: "booking_checkout",
|
|
119
|
+
data: {
|
|
120
|
+
order_id
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
111
124
|
state.action({
|
|
112
125
|
type: "pisell1.handlePayment",
|
|
113
126
|
data: {
|
|
@@ -392,7 +405,7 @@ var Footer = (props) => {
|
|
|
392
405
|
}
|
|
393
406
|
}
|
|
394
407
|
return false;
|
|
395
|
-
}, [state.bookingId, state.bookingDetail, (
|
|
408
|
+
}, [state.bookingId, state.bookingDetail, (_f = state.addons) == null ? void 0 : _f.load, state.renderType]);
|
|
396
409
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { title: false, round: true, loading: showFooter, active: true }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-total" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-total" }, totalText), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-arrears" }, arrearsText)), /* @__PURE__ */ import_react.default.createElement(
|
|
397
410
|
"span",
|
|
398
411
|
{
|
|
@@ -420,7 +433,7 @@ var Footer = (props) => {
|
|
|
420
433
|
},
|
|
421
434
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item-border" }),
|
|
422
435
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-label" }, import_utils.locales.getText("pisell1.text.subtotal")), /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-value" }, (0, import_utils.formatAmount)(total.productAmount, 2, (state == null ? void 0 : state.amountSymbol) || "$"))),
|
|
423
|
-
(((
|
|
436
|
+
(((_g = state.bookingDetail) == null ? void 0 : _g.surcharge) || []).map((d) => {
|
|
424
437
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item", key: d.id }, /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-label" }, d.name[state.locale]), /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-value" }, (0, import_utils.formatAmount)(d.amount, 2, (state == null ? void 0 : state.amountSymbol) || "$")));
|
|
425
438
|
}),
|
|
426
439
|
state.bookingId ? /* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item-label" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, import_utils.locales.getText("pisell1.text.tax")), /* @__PURE__ */ import_react.default.createElement("div", { className: "", style: { fontSize: 14 } }, taxText)), /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-value" }, (0, import_utils.formatAmount)(total.tax, 2, (state == null ? void 0 : state.amountSymbol) || "$"))) : null,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => JSX.Element;
|
|
2
2
|
export default Booking;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
2
|
export declare const walkInData: {
|
|
4
3
|
id: number;
|
|
5
4
|
nickname: string;
|
|
6
5
|
};
|
|
7
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
8
7
|
state: FormState;
|
|
9
8
|
} & {
|
|
10
9
|
dispatch: (params: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -87,7 +86,7 @@ export declare const walkInData: {
|
|
|
87
86
|
id: number;
|
|
88
87
|
nickname: string;
|
|
89
88
|
};
|
|
90
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
89
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
91
90
|
state: FormState;
|
|
92
91
|
} & {
|
|
93
92
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -66,10 +66,13 @@ var Payments = (0, import_model.Provider)((props) => {
|
|
|
66
66
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
67
67
|
const [paymentList, setPaymentList] = (0, import_react.useState)([]);
|
|
68
68
|
const [refundAmount, setRefundAmount] = (0, import_react.useState)();
|
|
69
|
+
const init = () => {
|
|
70
|
+
getPayments();
|
|
71
|
+
getRefundInfo();
|
|
72
|
+
};
|
|
69
73
|
(0, import_react.useEffect)(() => {
|
|
70
74
|
if (!!state.bookingId) {
|
|
71
|
-
|
|
72
|
-
getRefundInfo();
|
|
75
|
+
init();
|
|
73
76
|
state.action({
|
|
74
77
|
type: "pisell1.registerPlugin",
|
|
75
78
|
data: {
|
|
@@ -77,7 +80,7 @@ var Payments = (0, import_model.Provider)((props) => {
|
|
|
77
80
|
}
|
|
78
81
|
});
|
|
79
82
|
}
|
|
80
|
-
}, [state.bookingId]);
|
|
83
|
+
}, [state.bookingId, state.refresh]);
|
|
81
84
|
const getRefundInfo = async () => {
|
|
82
85
|
const res = await state.apis.getRefundInfo();
|
|
83
86
|
setRefundAmount(res.total_refund_amount);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,7 +68,7 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
71
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
73
72
|
state: FormState;
|
|
74
73
|
} & {
|
|
75
74
|
dispatch: (params: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.25",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"ahooks": "^3.7.6",
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
|
-
"@pisell/date-picker": "1.0.68",
|
|
62
61
|
"@pisell/utils": "1.0.23",
|
|
63
|
-
"@pisell/icon": "0.0.8"
|
|
62
|
+
"@pisell/icon": "0.0.8",
|
|
63
|
+
"@pisell/date-picker": "1.0.68"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"react": "^18.0.0",
|