@pisell/private-materials 3.0.151 → 3.0.152
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +12 -12
- package/es/components/booking/components/footer/index.js +48 -33
- package/es/components/booking/components/footer/utils.js +35 -4
- package/es/components/booking/index.js +1 -1
- package/es/components/booking/info/index.d.ts +4 -12
- package/es/components/booking/info/index.js +12 -122
- package/es/components/booking/info/main.d.ts +12 -0
- package/es/components/booking/info/main.js +124 -0
- package/es/components/booking/info/model.js +0 -1
- package/es/components/booking/info/service/addTimeModal/index.js +4 -4
- package/es/components/booking/info/utils.d.ts +1 -0
- package/es/components/booking/info/utils.js +7 -0
- package/es/components/booking/info2/index.d.ts +12 -0
- package/es/components/booking/info2/index.js +216 -0
- package/es/components/booking/info2/serve.d.ts +6 -0
- package/es/components/booking/info2/serve.js +79 -0
- package/es/components/booking/info2/service/actions/index.d.ts +6 -0
- package/es/components/booking/info2/service/actions/index.js +86 -0
- package/es/components/booking/info2/service/addService/index.d.ts +6 -0
- package/es/components/booking/info2/service/addService/index.js +404 -0
- package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/es/components/booking/info2/service/addService/mock.js +332 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/es/components/booking/info2/service/addService/utils.js +510 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
- package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/es/components/booking/info2/service/addTimeModal/serve.js +73 -0
- package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
- package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
- package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
- package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
- package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/es/components/booking/info2/service/editService/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/index.js +617 -0
- package/es/components/booking/info2/service/editService/index.less +99 -0
- package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/es/components/booking/info2/service/editService/utils.js +37 -0
- package/es/components/booking/info2/service/index.d.ts +4 -0
- package/es/components/booking/info2/service/index.js +55 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/es/components/booking/info2/service/serviceItem/index.js +176 -0
- package/es/components/booking/info2/service/serviceItem/index.less +125 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/es/components/booking/info2/service/serviceList/index.js +106 -0
- package/es/components/booking/info2/service/serviceList/index.less +0 -0
- package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/es/components/booking/info2/utilsByBooking.js +349 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +12 -3
- package/es/components/booking/materiels/resources/index.d.ts +2 -2
- package/es/components/booking/materiels/resources/index.js +11 -11
- package/es/components/booking/mock.d.ts +1 -0
- package/es/components/booking/mock.js +66 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/index.d.ts +1 -1
- package/es/components/index.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/components/booking/components/footer/index.js +28 -5
- package/lib/components/booking/components/footer/utils.js +29 -4
- package/lib/components/booking/index.js +2 -2
- package/lib/components/booking/info/index.d.ts +4 -12
- package/lib/components/booking/info/index.js +14 -115
- package/lib/components/booking/info/main.d.ts +12 -0
- package/lib/components/booking/info/main.js +152 -0
- package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info/utils.d.ts +1 -0
- package/lib/components/booking/info/utils.js +9 -0
- package/lib/components/booking/info2/index.d.ts +12 -0
- package/lib/components/booking/info2/index.js +202 -0
- package/lib/components/booking/info2/serve.d.ts +6 -0
- package/lib/components/booking/info2/serve.js +53 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
- package/lib/components/booking/info2/service/actions/index.js +102 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
- package/lib/components/booking/info2/service/addService/index.js +356 -0
- package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/lib/components/booking/info2/service/addService/mock.js +398 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/lib/components/booking/info2/service/addService/utils.js +377 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
- package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
- package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/index.js +483 -0
- package/lib/components/booking/info2/service/editService/index.less +99 -0
- package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/lib/components/booking/info2/service/editService/utils.js +0 -0
- package/lib/components/booking/info2/service/index.d.ts +4 -0
- package/lib/components/booking/info2/service/index.js +75 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
- package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/lib/components/booking/info2/service/serviceList/index.js +130 -0
- package/lib/components/booking/info2/service/serviceList/index.less +0 -0
- package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/lib/components/booking/info2/utilsByBooking.js +257 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/materiels/resources/index.d.ts +2 -2
- package/lib/components/booking/mock.d.ts +1 -0
- package/lib/components/booking/mock.js +67 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/index.js +3 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/booking/info2/index.tsx
|
|
30
|
+
var info2_exports = {};
|
|
31
|
+
__export(info2_exports, {
|
|
32
|
+
default: () => info2_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(info2_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_model = require("../info/model");
|
|
37
|
+
var import_client = __toESM(require("../info/client"));
|
|
38
|
+
var import_service = __toESM(require("./service"));
|
|
39
|
+
var import_pet = __toESM(require("../info/pet"));
|
|
40
|
+
var import_date = __toESM(require("../info/date"));
|
|
41
|
+
var import_footer = __toESM(require("../components/footer"));
|
|
42
|
+
var import_tabPane = __toESM(require("../components/tabPane"));
|
|
43
|
+
var import_addNote = __toESM(require("../notes/addNote"));
|
|
44
|
+
var import_header = __toESM(require("../info/header"));
|
|
45
|
+
var import_locales = __toESM(require("../locales"));
|
|
46
|
+
var import_utils = require("@pisell/utils");
|
|
47
|
+
var import_utils2 = require("../utils");
|
|
48
|
+
var import_utilsByBooking = require("./utilsByBooking");
|
|
49
|
+
var import_utilsByBooking2 = require("./utilsByBooking");
|
|
50
|
+
var import_serve = require("./serve");
|
|
51
|
+
var import_date2 = require("../info/date");
|
|
52
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
53
|
+
var import_notes = __toESM(require("../info/notes"));
|
|
54
|
+
var import_info = require("../info/index.less");
|
|
55
|
+
var defaultModules = {
|
|
56
|
+
client: 1,
|
|
57
|
+
date: 1,
|
|
58
|
+
service: 1,
|
|
59
|
+
holder: 1,
|
|
60
|
+
note: 1
|
|
61
|
+
};
|
|
62
|
+
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
63
|
+
var Info = (0, import_model.Provider)((props) => {
|
|
64
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
65
|
+
const { style, globalState, modules = defaultModules, slot } = props;
|
|
66
|
+
const modal = (0, import_react.useContext)(import_model.Context);
|
|
67
|
+
const context = (0, import_useEngineContext.default)();
|
|
68
|
+
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
69
|
+
const params = (0, import_react.useMemo)(() => {
|
|
70
|
+
var _a2, _b2, _c2, _d2;
|
|
71
|
+
return ((_d2 = (_c2 = (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.bookingConfig) == null ? void 0 : _b2.config) == null ? void 0 : _c2.basic) == null ? void 0 : _d2.appointment_subject) || {};
|
|
72
|
+
}, [(_d = (_c = (_b = (_a = modal.state) == null ? void 0 : _a.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject]);
|
|
73
|
+
(0, import_react.useEffect)(() => {
|
|
74
|
+
document.body.id = "body";
|
|
75
|
+
if (props.setState) {
|
|
76
|
+
props.setState({
|
|
77
|
+
bookingFunctions: {
|
|
78
|
+
formatResource: import_utilsByBooking.formatResource,
|
|
79
|
+
getErrorList: import_utilsByBooking2.getErrorList,
|
|
80
|
+
sliceDayIntoFiveMinutes: import_utils2.sliceDayIntoFiveMinutes,
|
|
81
|
+
findNextDuration: import_utils2.findNextDuration,
|
|
82
|
+
flexibleObj: import_utils2.flexibleObj,
|
|
83
|
+
updateServiceDate: import_date2.updateServiceDate
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}, []);
|
|
88
|
+
(0, import_react.useEffect)(() => {
|
|
89
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m;
|
|
90
|
+
const isFranchisee = (_d2 = (_c2 = (_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.utils) == null ? void 0 : _b2.businessUtils) == null ? void 0 : _c2.getAppByModal) == null ? void 0 : _d2.call(_c2, "franchisee");
|
|
91
|
+
modal.dispatch({
|
|
92
|
+
type: "setState",
|
|
93
|
+
payload: {
|
|
94
|
+
setGlobalState: props.setGlobalState,
|
|
95
|
+
...globalState,
|
|
96
|
+
isTerminal: (_g2 = (_f2 = (_e2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _e2.utils) == null ? void 0 : _f2.isTerminal) == null ? void 0 : _g2.call(_f2),
|
|
97
|
+
isFranchisee,
|
|
98
|
+
timezone: (_m = (_l2 = (_k2 = (_j2 = (_i2 = (_h2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _h2.utils) == null ? void 0 : _i2.store) == null ? void 0 : _j2.getState()) == null ? void 0 : _k2.global) == null ? void 0 : _l2.globalConfig) == null ? void 0 : _m.timezone
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}, [globalState]);
|
|
102
|
+
const addNote = (e) => {
|
|
103
|
+
modal.dispatch({
|
|
104
|
+
type: "setNotes",
|
|
105
|
+
payload: {
|
|
106
|
+
orderNote: e,
|
|
107
|
+
edit: true
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
const header = (0, import_react.useMemo)(() => {
|
|
112
|
+
if ((globalState == null ? void 0 : globalState.renderType) === "eventBooking") {
|
|
113
|
+
return import_utils.locales.getText("pisell2.text.enroll.detail");
|
|
114
|
+
}
|
|
115
|
+
return (globalState == null ? void 0 : globalState.bookingId) ? /* @__PURE__ */ import_react.default.createElement(import_header.default, { state: modal.state, dispatch: modal.dispatch }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "", style: { height: 0 } });
|
|
116
|
+
}, [
|
|
117
|
+
globalState == null ? void 0 : globalState.bookingId,
|
|
118
|
+
modal.state,
|
|
119
|
+
modal.dispatch,
|
|
120
|
+
globalState == null ? void 0 : globalState.renderType
|
|
121
|
+
]);
|
|
122
|
+
const notes = (0, import_react.useMemo)(() => {
|
|
123
|
+
var _a2, _b2;
|
|
124
|
+
if (!modules.note) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
|
|
128
|
+
}, [
|
|
129
|
+
modules.note,
|
|
130
|
+
globalState == null ? void 0 : globalState.bookingId,
|
|
131
|
+
globalState.render,
|
|
132
|
+
(_f = (_e = modal.state) == null ? void 0 : _e.notes) == null ? void 0 : _f.orderNote
|
|
133
|
+
]);
|
|
134
|
+
const currentDate = (0, import_react.useMemo)(() => {
|
|
135
|
+
var _a2, _b2;
|
|
136
|
+
if ((_b2 = (_a2 = modal.state) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value) {
|
|
137
|
+
return modal.state.date.value.format("YYYY-MM-DD");
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}, [(_i = (_h = (_g = modal.state) == null ? void 0 : _g.date) == null ? void 0 : _h.value) == null ? void 0 : _i.format("YYYY-MM-DD")]);
|
|
141
|
+
const getResourcesData = async () => {
|
|
142
|
+
let bookingResourceList = localStorage.getItem("bookingResourceList");
|
|
143
|
+
let timeoutNumber = 0;
|
|
144
|
+
if (bookingResourceList) {
|
|
145
|
+
bookingResourceList = JSON.parse(bookingResourceList);
|
|
146
|
+
if ((bookingResourceList == null ? void 0 : bookingResourceList.date) === currentDate) {
|
|
147
|
+
timeoutNumber = 200;
|
|
148
|
+
modal.dispatch({
|
|
149
|
+
type: "setService",
|
|
150
|
+
payload: {
|
|
151
|
+
resourcesOrigin: bookingResourceList.list || [],
|
|
152
|
+
resourcesOriginMap: bookingResourceList.listMap
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
setTimeout(async () => {
|
|
159
|
+
let data = await (0, import_serve.getResourceList)({
|
|
160
|
+
date: currentDate
|
|
161
|
+
});
|
|
162
|
+
data.date = currentDate;
|
|
163
|
+
localStorage.setItem("bookingResourceList", JSON.stringify(data));
|
|
164
|
+
modal.dispatch({
|
|
165
|
+
type: "setService",
|
|
166
|
+
payload: {
|
|
167
|
+
resourcesOrigin: data.list || [],
|
|
168
|
+
resourcesOriginMap: data.listMap
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}, timeoutNumber);
|
|
172
|
+
} catch (err) {
|
|
173
|
+
console.log(err, "err");
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
(0, import_react.useEffect)(() => {
|
|
177
|
+
if (currentDate) {
|
|
178
|
+
getResourcesData();
|
|
179
|
+
}
|
|
180
|
+
}, [currentDate]);
|
|
181
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!modal.state.setGlobalState ? /* @__PURE__ */ import_react.default.createElement(
|
|
182
|
+
import_tabPane.default,
|
|
183
|
+
{
|
|
184
|
+
style,
|
|
185
|
+
header,
|
|
186
|
+
footer: /* @__PURE__ */ import_react.default.createElement(
|
|
187
|
+
import_footer.default,
|
|
188
|
+
{
|
|
189
|
+
state: modal.state,
|
|
190
|
+
dispatch: modal.dispatch,
|
|
191
|
+
source: "info"
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
style: {
|
|
195
|
+
height: ((_k = (_j = context == null ? void 0 : context.appHelper) == null ? void 0 : _j.utils) == null ? void 0 : _k.isMobile) ? "100%" : "100vh"
|
|
196
|
+
},
|
|
197
|
+
bodyClassName: "booking-info-warp"
|
|
198
|
+
},
|
|
199
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_l = modal.state) == null ? void 0 : _l.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, modules.service ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, modal.state.date.value ? /* @__PURE__ */ import_react.default.createElement(import_service.default, null) : null) : null, notes, slot ? slot : null)
|
|
200
|
+
) : null);
|
|
201
|
+
});
|
|
202
|
+
var info2_default = Info;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/booking/info2/serve.ts
|
|
20
|
+
var serve_exports = {};
|
|
21
|
+
__export(serve_exports, {
|
|
22
|
+
createBookings: () => createBookings,
|
|
23
|
+
editBookings: () => editBookings,
|
|
24
|
+
getResourceList: () => getResourceList
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(serve_exports);
|
|
27
|
+
var import_utils = require("../utils");
|
|
28
|
+
var import_mock = require("../mock");
|
|
29
|
+
var getResourceList = async (params) => {
|
|
30
|
+
let { data } = await import_utils.request.getRequest().get(`/shop/schedule/resource/list`, params);
|
|
31
|
+
const resourceList = (data || {}).concat([(0, import_mock.getNoResource2)({})]);
|
|
32
|
+
return {
|
|
33
|
+
list: resourceList,
|
|
34
|
+
listMap: resourceList.reduce((prev, item) => {
|
|
35
|
+
prev[item.id] = item;
|
|
36
|
+
return prev;
|
|
37
|
+
}, {})
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
var createBookings = async (params) => {
|
|
41
|
+
let { data } = await import_utils.request.getRequest().post(`/shop/v1.1/order/appointment`, params);
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
var editBookings = async (params, id) => {
|
|
45
|
+
let { data } = await import_utils.request.getRequest().put(`/shop/v1.1/order/appointment/${id}`, params);
|
|
46
|
+
return data;
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
createBookings,
|
|
51
|
+
editBookings,
|
|
52
|
+
getResourceList
|
|
53
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/booking/info2/service/actions/index.tsx
|
|
30
|
+
var actions_exports = {};
|
|
31
|
+
__export(actions_exports, {
|
|
32
|
+
default: () => actions_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(actions_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_model = require("../../../info/model");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_utils = require("../../../utils");
|
|
39
|
+
var import_utils2 = require("../addTimeModal/utils");
|
|
40
|
+
var import_utils3 = require("../../service/addService/utils");
|
|
41
|
+
var import_actions = require("../../../info/service/actions/index.less");
|
|
42
|
+
var import_utils4 = require("@pisell/utils");
|
|
43
|
+
var Actions = ({ currentService }) => {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
46
|
+
const appointment_card = (0, import_react.useMemo)(() => {
|
|
47
|
+
var _a2, _b2, _c;
|
|
48
|
+
return ((_c = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.information_tab) == null ? void 0 : _c.appointment_card) || {
|
|
49
|
+
quick_time: 1
|
|
50
|
+
};
|
|
51
|
+
}, [(_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.information_tab]);
|
|
52
|
+
const onAddTime = () => {
|
|
53
|
+
let cacheItem = (0, import_utils3.getProductExtend)({
|
|
54
|
+
cacheItem: { ...currentService, new: 0 },
|
|
55
|
+
state
|
|
56
|
+
});
|
|
57
|
+
dispatch({
|
|
58
|
+
type: "setService",
|
|
59
|
+
payload: {
|
|
60
|
+
addTimeModal: true,
|
|
61
|
+
cacheItem
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const addTimeProducts = (0, import_react.useMemo)(() => {
|
|
66
|
+
return (state.addTimeProducts || []).some(
|
|
67
|
+
(item) => (0, import_utils2.isUsableProduct)(item.add_time, currentService)
|
|
68
|
+
);
|
|
69
|
+
}, [state.addTimeProducts, currentService]);
|
|
70
|
+
const showAddTimeButton = (0, import_react.useMemo)(() => {
|
|
71
|
+
if (state.renderType === "eventBooking") {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (state.disabledEdit) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
if (appointment_card.quick_time !== 1) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
if ((0, import_utils.getIsEdit)(state)) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (!addTimeProducts) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}, [state, appointment_card.quick_time, addTimeProducts]);
|
|
88
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "actions-wrap" }, showAddTimeButton && /* @__PURE__ */ import_react.default.createElement(
|
|
89
|
+
import_antd.Button,
|
|
90
|
+
{
|
|
91
|
+
className: "action-item",
|
|
92
|
+
size: "large",
|
|
93
|
+
onClick: (e) => {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
onAddTime();
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
import_utils4.locales.getText("page.booking.text.add-time")
|
|
100
|
+
));
|
|
101
|
+
};
|
|
102
|
+
var actions_default = Actions;
|