@pisell/private-materials 3.0.32 → 3.0.34
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/render/default/view.js +3 -3
- package/build/lowcode/view.js +2 -2
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/index.js +8 -4
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/TabProduct/index.d.ts +1 -1
- package/es/components/booking/components/TabProduct/index.js +2 -2
- package/es/components/booking/components/TabProduct/productItem/index.js +14 -4
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -1
- package/es/components/booking/components/footer/FooterMenus/index.js +3 -3
- package/es/components/booking/components/footer/index.js +7 -6
- 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/index.js +8 -7
- 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/info/service/addService/index.js +7 -3
- package/es/components/booking/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/index.js +4 -3
- 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/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 +6 -4
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -1
- package/lib/components/booking/components/TabProduct/index.js +2 -2
- package/lib/components/booking/components/TabProduct/productItem/index.js +19 -3
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -1
- package/lib/components/booking/components/footer/FooterMenus/index.js +3 -3
- package/lib/components/booking/components/footer/index.js +7 -2
- 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/index.js +1 -0
- 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/info/service/addService/index.js +6 -3
- package/lib/components/booking/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/index.js +6 -5
- 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/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
|
@@ -232,7 +232,8 @@ var Addons = Provider(function (props) {
|
|
|
232
232
|
// include_option: "no",
|
|
233
233
|
// include_variant: "no",
|
|
234
234
|
open_quotation: 1,
|
|
235
|
-
with_schedule: 0
|
|
235
|
+
with_schedule: 0,
|
|
236
|
+
with_count: ["bundleGroup", "optionGroup"]
|
|
236
237
|
});
|
|
237
238
|
case 2:
|
|
238
239
|
data = _context2.sent;
|
|
@@ -261,8 +262,11 @@ var Addons = Provider(function (props) {
|
|
|
261
262
|
* @Author: zhiwei.Wang
|
|
262
263
|
* @Date: 2024-01-30 16:36
|
|
263
264
|
*/
|
|
264
|
-
var handleAddProduct = function handleAddProduct(item) {
|
|
265
|
+
var handleAddProduct = function handleAddProduct(item, type) {
|
|
265
266
|
var _list = _toConsumableArray(state.addons.value);
|
|
267
|
+
|
|
268
|
+
// 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
|
|
269
|
+
var isEject = type === "detail" || item.option_group_count > 0 || item.bundle_group_count > 0 || item.variant_count > 0;
|
|
266
270
|
state.action({
|
|
267
271
|
type: "pisell1.handleOpenProductModal",
|
|
268
272
|
data: {
|
|
@@ -273,7 +277,8 @@ var Addons = Provider(function (props) {
|
|
|
273
277
|
session: false,
|
|
274
278
|
variant: false,
|
|
275
279
|
package: true
|
|
276
|
-
}
|
|
280
|
+
},
|
|
281
|
+
is_eject: isEject
|
|
277
282
|
},
|
|
278
283
|
callback: function callback(e) {
|
|
279
284
|
var product = _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -444,7 +449,6 @@ var Addons = Provider(function (props) {
|
|
|
444
449
|
});
|
|
445
450
|
}, [state, _footer]);
|
|
446
451
|
var editProductDetail = function editProductDetail(item) {
|
|
447
|
-
console.log("item._extend.other", item._extend.other);
|
|
448
452
|
state.action({
|
|
449
453
|
type: "pisell1.handleOpenProductModal",
|
|
450
454
|
data: {
|
|
@@ -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: {
|
|
@@ -3,7 +3,7 @@ import "./index.less";
|
|
|
3
3
|
interface TabProductProps {
|
|
4
4
|
list: any[];
|
|
5
5
|
amountSymbol: string;
|
|
6
|
-
onChange: (item: any) => void;
|
|
6
|
+
onChange: (item: any, type: "select" | "detail") => void;
|
|
7
7
|
scrollDom?: string;
|
|
8
8
|
}
|
|
9
9
|
declare const TabProduct: (props: TabProductProps) => React.JSX.Element;
|
|
@@ -99,8 +99,8 @@ var TabProduct = function TabProduct(props) {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
-
var onProductClick = function onProductClick(productDetail) {
|
|
103
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(productDetail);
|
|
102
|
+
var onProductClick = function onProductClick(productDetail, type) {
|
|
103
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(productDetail, type);
|
|
104
104
|
};
|
|
105
105
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
106
106
|
className: "booking-tab-product"
|
|
@@ -13,15 +13,25 @@ var ProductItem = function ProductItem(_ref) {
|
|
|
13
13
|
style: style,
|
|
14
14
|
className: classNames("server-product", className),
|
|
15
15
|
onClick: function onClick() {
|
|
16
|
-
_onClick(item);
|
|
16
|
+
_onClick(item, "select");
|
|
17
17
|
}
|
|
18
18
|
}, item.cover ? /*#__PURE__*/React.createElement("img", {
|
|
19
19
|
src: image.ali(item.cover, 100),
|
|
20
|
-
className: "server-product-cover"
|
|
20
|
+
className: "server-product-cover",
|
|
21
|
+
onClick: function onClick(e) {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
e.stopPropagation();
|
|
24
|
+
_onClick(item, "detail");
|
|
25
|
+
}
|
|
21
26
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
22
27
|
className: "server-product-content"
|
|
23
|
-
}, /*#__PURE__*/React.createElement("
|
|
24
|
-
className: "server-product-title"
|
|
28
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
29
|
+
className: "server-product-title",
|
|
30
|
+
onClick: function onClick(e) {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
e.stopPropagation();
|
|
33
|
+
_onClick(item, "detail");
|
|
34
|
+
}
|
|
25
35
|
}, item.title), /*#__PURE__*/React.createElement("div", {
|
|
26
36
|
className: "server-product-time"
|
|
27
37
|
}, getDiscountTime(item.service_times)), /*#__PURE__*/React.createElement("div", {
|
|
@@ -4,17 +4,17 @@ import "./index.less";
|
|
|
4
4
|
import { locales } from "@pisell/utils";
|
|
5
5
|
var FooterMenus = function FooterMenus(_ref) {
|
|
6
6
|
var state = _ref.state,
|
|
7
|
-
|
|
7
|
+
source = _ref.source;
|
|
8
8
|
var items = useMemo(function () {
|
|
9
9
|
var list = [];
|
|
10
|
-
if (state.bookingId && state.renderType !==
|
|
10
|
+
if (source === "info" && state.bookingId && state.renderType !== "eventBooking") {
|
|
11
11
|
list.push({
|
|
12
12
|
label: locales.getText("pisell2.text.rebook"),
|
|
13
13
|
key: "rebook"
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
return list;
|
|
17
|
-
}, [state]);
|
|
17
|
+
}, [state, source]);
|
|
18
18
|
var handleRebook = function handleRebook() {
|
|
19
19
|
var _state$onRebook;
|
|
20
20
|
(_state$onRebook = state.onRebook) === null || _state$onRebook === void 0 ? void 0 : _state$onRebook.call(state);
|
|
@@ -162,8 +162,8 @@ var Footer = function Footer(props) {
|
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
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:
|
|
166
|
-
key:
|
|
165
|
+
module: "booking",
|
|
166
|
+
key: "booking_checkout",
|
|
167
167
|
data: {
|
|
168
168
|
order_id: order_id
|
|
169
169
|
}
|
|
@@ -285,8 +285,8 @@ var Footer = function Footer(props) {
|
|
|
285
285
|
// 区分loading, 是点击的checkout 还是save
|
|
286
286
|
_setLoading = type === "checkout" ? setCheckoutLoading : setLoading;
|
|
287
287
|
_setLoading(true);
|
|
288
|
-
editApi = state.renderType ===
|
|
289
|
-
createApi = state.renderType ===
|
|
288
|
+
editApi = state.renderType === "eventBooking" ? state.apis.editEventBooking : state.apis.editBooking;
|
|
289
|
+
createApi = state.renderType === "eventBooking" ? state.apis.createEventBooking : state.apis.createBooking;
|
|
290
290
|
saveOtherValue = {};
|
|
291
291
|
if (!(type === "save")) {
|
|
292
292
|
_context4.next = 13;
|
|
@@ -659,7 +659,7 @@ var Footer = function Footer(props) {
|
|
|
659
659
|
if (!state.bookingDetail) {
|
|
660
660
|
return true;
|
|
661
661
|
}
|
|
662
|
-
if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load) && state.renderType !==
|
|
662
|
+
if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load) && state.renderType !== "eventBooking") {
|
|
663
663
|
return true;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
@@ -763,7 +763,8 @@ var Footer = function Footer(props) {
|
|
|
763
763
|
className: "pisell-lowcode__booking-footer-buttons"
|
|
764
764
|
}, /*#__PURE__*/React.createElement(FooterMenus, {
|
|
765
765
|
state: state,
|
|
766
|
-
dispatch: dispatch
|
|
766
|
+
dispatch: dispatch,
|
|
767
|
+
source: source
|
|
767
768
|
}), _buttons));
|
|
768
769
|
};
|
|
769
770
|
export default Footer;
|
|
@@ -144,15 +144,16 @@ var Forms = Provider(function (props) {
|
|
|
144
144
|
});
|
|
145
145
|
case 4:
|
|
146
146
|
data = _context3.sent;
|
|
147
|
+
data = data || [];
|
|
147
148
|
if (params.type === "form") {
|
|
148
149
|
// 去除预约主体
|
|
149
150
|
data = data.filter(function (d) {
|
|
150
151
|
return d.form_id !== (params === null || params === void 0 ? void 0 : params.form_id);
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
|
-
_context3.next =
|
|
154
|
+
_context3.next = 9;
|
|
154
155
|
return getFormData(data);
|
|
155
|
-
case
|
|
156
|
+
case 9:
|
|
156
157
|
formData = _context3.sent;
|
|
157
158
|
dispatch({
|
|
158
159
|
type: "setForm",
|
|
@@ -162,18 +163,18 @@ var Forms = Provider(function (props) {
|
|
|
162
163
|
}
|
|
163
164
|
});
|
|
164
165
|
setLoading(false);
|
|
165
|
-
_context3.next =
|
|
166
|
+
_context3.next = 18;
|
|
166
167
|
break;
|
|
167
|
-
case
|
|
168
|
-
_context3.prev =
|
|
168
|
+
case 14:
|
|
169
|
+
_context3.prev = 14;
|
|
169
170
|
_context3.t0 = _context3["catch"](1);
|
|
170
171
|
setLoading(false);
|
|
171
172
|
console.log("form_error", _context3.t0);
|
|
172
|
-
case
|
|
173
|
+
case 18:
|
|
173
174
|
case "end":
|
|
174
175
|
return _context3.stop();
|
|
175
176
|
}
|
|
176
|
-
}, _callee3, null, [[1,
|
|
177
|
+
}, _callee3, null, [[1, 14]]);
|
|
177
178
|
}));
|
|
178
179
|
return function geForms() {
|
|
179
180
|
return _ref3.apply(this, arguments);
|
|
@@ -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: {
|
|
@@ -149,7 +149,8 @@ var Info = function Info() {
|
|
|
149
149
|
// include_variant: "no",
|
|
150
150
|
ids: state.renderType === "eventBooking" ? (_state$eventOtherPara = state.eventOtherParams) === null || _state$eventOtherPara === void 0 ? void 0 : _state$eventOtherPara.productIds : undefined,
|
|
151
151
|
open_quotation: 1,
|
|
152
|
-
with_schedule: 1
|
|
152
|
+
with_schedule: 1,
|
|
153
|
+
with_count: ["bundleGroup", "optionGroup"]
|
|
153
154
|
});
|
|
154
155
|
case 3:
|
|
155
156
|
data = _context2.sent;
|
|
@@ -180,7 +181,9 @@ var Info = function Info() {
|
|
|
180
181
|
}
|
|
181
182
|
});
|
|
182
183
|
};
|
|
183
|
-
var handleSelectProduct = function handleSelectProduct(item) {
|
|
184
|
+
var handleSelectProduct = function handleSelectProduct(item, type) {
|
|
185
|
+
// 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
|
|
186
|
+
var isEject = type === "detail" || item.option_group_count > 0 || item.bundle_group_count > 0 || item.variant_count > 0;
|
|
184
187
|
state.action({
|
|
185
188
|
type: "pisell1.handleOpenProductModal",
|
|
186
189
|
data: {
|
|
@@ -191,7 +194,8 @@ var Info = function Info() {
|
|
|
191
194
|
session: false,
|
|
192
195
|
variant: false,
|
|
193
196
|
package: true
|
|
194
|
-
}
|
|
197
|
+
},
|
|
198
|
+
is_eject: isEject ? 1 : 0
|
|
195
199
|
},
|
|
196
200
|
callback: function callback(e) {
|
|
197
201
|
var cacheItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -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: {
|
|
@@ -25,7 +25,7 @@ import EmptyBooking from "../components/emptyBooking";
|
|
|
25
25
|
import "./index.less";
|
|
26
26
|
import { locales } from "@pisell/utils";
|
|
27
27
|
var Notes = Provider(function (props) {
|
|
28
|
-
var _modal$state4, _modal$state4$notes, _modal$state5;
|
|
28
|
+
var _modal$state4, _modal$state4$notes, _modal$state5, _modal$state$bookingD3, _modal$state$bookingD4;
|
|
29
29
|
var globalState = props.globalState;
|
|
30
30
|
var modal = useContext(Context);
|
|
31
31
|
var _useState = useState(false),
|
|
@@ -34,6 +34,7 @@ var Notes = Provider(function (props) {
|
|
|
34
34
|
setInternalLoading = _useState2[1];
|
|
35
35
|
var getNotes = /*#__PURE__*/function () {
|
|
36
36
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37
|
+
var _modal$state$bookingD, _modal$state$bookingD2;
|
|
37
38
|
var data;
|
|
38
39
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
40
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -41,7 +42,7 @@ var Notes = Provider(function (props) {
|
|
|
41
42
|
setInternalLoading(true);
|
|
42
43
|
_context.next = 3;
|
|
43
44
|
return modal.state.apis.getNotesByOrder({
|
|
44
|
-
schedule_event_id: modal.state.
|
|
45
|
+
schedule_event_id: (_modal$state$bookingD = modal.state.bookingDetail) === null || _modal$state$bookingD === void 0 ? void 0 : (_modal$state$bookingD2 = _modal$state$bookingD.bookings) === null || _modal$state$bookingD2 === void 0 ? void 0 : _modal$state$bookingD2.id,
|
|
45
46
|
skip: 1,
|
|
46
47
|
num: 99
|
|
47
48
|
});
|
|
@@ -174,7 +175,7 @@ var Notes = Provider(function (props) {
|
|
|
174
175
|
notes: ((_modal$state5 = modal.state) === null || _modal$state5 === void 0 ? void 0 : _modal$state5.notes.internalNotes) || [],
|
|
175
176
|
isEdit: true,
|
|
176
177
|
apis: modal.state.apis,
|
|
177
|
-
bookingId: modal.state.
|
|
178
|
+
bookingId: (_modal$state$bookingD3 = modal.state.bookingDetail) === null || _modal$state$bookingD3 === void 0 ? void 0 : (_modal$state$bookingD4 = _modal$state$bookingD3.bookings) === null || _modal$state$bookingD4 === void 0 ? void 0 : _modal$state$bookingD4.id,
|
|
178
179
|
onChange: function onChange(e, type, noteType) {
|
|
179
180
|
noteChange({
|
|
180
181
|
note: e,
|
|
@@ -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,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: {
|
|
@@ -192,7 +192,8 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
192
192
|
// include_option: "no",
|
|
193
193
|
// include_variant: "no",
|
|
194
194
|
open_quotation: 1,
|
|
195
|
-
with_schedule: 0
|
|
195
|
+
with_schedule: 0,
|
|
196
|
+
with_count: ["bundleGroup", "optionGroup"]
|
|
196
197
|
});
|
|
197
198
|
dispatch({
|
|
198
199
|
type: "setAddons",
|
|
@@ -201,8 +202,9 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
201
202
|
}
|
|
202
203
|
});
|
|
203
204
|
};
|
|
204
|
-
const handleAddProduct = (item) => {
|
|
205
|
+
const handleAddProduct = (item, type) => {
|
|
205
206
|
let _list = [...state.addons.value];
|
|
207
|
+
const isEject = type === "detail" || item.option_group_count > 0 || item.bundle_group_count > 0 || item.variant_count > 0;
|
|
206
208
|
state.action({
|
|
207
209
|
type: "pisell1.handleOpenProductModal",
|
|
208
210
|
data: {
|
|
@@ -213,7 +215,8 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
213
215
|
session: false,
|
|
214
216
|
variant: false,
|
|
215
217
|
package: true
|
|
216
|
-
}
|
|
218
|
+
},
|
|
219
|
+
is_eject: isEject
|
|
217
220
|
},
|
|
218
221
|
callback: (e) => {
|
|
219
222
|
let product = {
|
|
@@ -338,7 +341,6 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
338
341
|
return /* @__PURE__ */ import_react.default.createElement(import_footer.default, { state, buttons: _footer, source: "addons" });
|
|
339
342
|
}, [state, _footer]);
|
|
340
343
|
const editProductDetail = (item) => {
|
|
341
|
-
console.log("item._extend.other", item._extend.other);
|
|
342
344
|
state.action({
|
|
343
345
|
type: "pisell1.handleOpenProductModal",
|
|
344
346
|
data: {
|
|
@@ -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: {
|
|
@@ -3,7 +3,7 @@ import "./index.less";
|
|
|
3
3
|
interface TabProductProps {
|
|
4
4
|
list: any[];
|
|
5
5
|
amountSymbol: string;
|
|
6
|
-
onChange: (item: any) => void;
|
|
6
|
+
onChange: (item: any, type: "select" | "detail") => void;
|
|
7
7
|
scrollDom?: string;
|
|
8
8
|
}
|
|
9
9
|
declare const TabProduct: (props: TabProductProps) => React.JSX.Element;
|
|
@@ -85,8 +85,8 @@ var TabProduct = (props) => {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
const onProductClick = (productDetail) => {
|
|
89
|
-
onChange == null ? void 0 : onChange(productDetail);
|
|
88
|
+
const onProductClick = (productDetail, type) => {
|
|
89
|
+
onChange == null ? void 0 : onChange(productDetail, type);
|
|
90
90
|
};
|
|
91
91
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-tab-product" }, /* @__PURE__ */ import_react.default.createElement(
|
|
92
92
|
"div",
|
|
@@ -50,17 +50,33 @@ var ProductItem = ({
|
|
|
50
50
|
style,
|
|
51
51
|
className: (0, import_classnames.default)("server-product", className),
|
|
52
52
|
onClick: () => {
|
|
53
|
-
onClick(item);
|
|
53
|
+
onClick(item, "select");
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
item.cover ? /* @__PURE__ */ import_react.default.createElement(
|
|
57
57
|
"img",
|
|
58
58
|
{
|
|
59
59
|
src: import_utils.image.ali(item.cover, 100),
|
|
60
|
-
className: "server-product-cover"
|
|
60
|
+
className: "server-product-cover",
|
|
61
|
+
onClick: (e) => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
onClick(item, "detail");
|
|
65
|
+
}
|
|
61
66
|
}
|
|
62
67
|
) : null,
|
|
63
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-content" }, /* @__PURE__ */ import_react.default.createElement(
|
|
68
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-content" }, /* @__PURE__ */ import_react.default.createElement(
|
|
69
|
+
"span",
|
|
70
|
+
{
|
|
71
|
+
className: "server-product-title",
|
|
72
|
+
onClick: (e) => {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
onClick(item, "detail");
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
item.title
|
|
79
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, (0, import_utils2.getDiscountTime)(item.service_times)), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-price" }, (0, import_utils.formatAmount)(item.price, 2, amountSymbol)))
|
|
64
80
|
);
|
|
65
81
|
};
|
|
66
82
|
var productItem_default = ProductItem;
|
|
@@ -36,17 +36,17 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_menuButton = __toESM(require("../../../components/menuButton"));
|
|
37
37
|
var import_index = require("./index.less");
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
|
-
var FooterMenus = ({ state,
|
|
39
|
+
var FooterMenus = ({ state, source }) => {
|
|
40
40
|
const items = (0, import_react.useMemo)(() => {
|
|
41
41
|
let list = [];
|
|
42
|
-
if (state.bookingId && state.renderType !== "eventBooking") {
|
|
42
|
+
if (source === "info" && state.bookingId && state.renderType !== "eventBooking") {
|
|
43
43
|
list.push({
|
|
44
44
|
label: import_utils.locales.getText("pisell2.text.rebook"),
|
|
45
45
|
key: "rebook"
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
return list;
|
|
49
|
-
}, [state]);
|
|
49
|
+
}, [state, source]);
|
|
50
50
|
const handleRebook = () => {
|
|
51
51
|
var _a;
|
|
52
52
|
(_a = state.onRebook) == null ? void 0 : _a.call(state);
|
|
@@ -405,7 +405,12 @@ var Footer = (props) => {
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
return false;
|
|
408
|
-
}, [
|
|
408
|
+
}, [
|
|
409
|
+
state.bookingId,
|
|
410
|
+
state.bookingDetail,
|
|
411
|
+
(_f = state.addons) == null ? void 0 : _f.load,
|
|
412
|
+
state.renderType
|
|
413
|
+
]);
|
|
409
414
|
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(
|
|
410
415
|
"span",
|
|
411
416
|
{
|
|
@@ -458,6 +463,6 @@ var Footer = (props) => {
|
|
|
458
463
|
2,
|
|
459
464
|
(state == null ? void 0 : state.amountSymbol) || "$"
|
|
460
465
|
))) : null) : null
|
|
461
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-buttons" }, /* @__PURE__ */ import_react.default.createElement(import_FooterMenus.default, { state, dispatch }), _buttons));
|
|
466
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-buttons" }, /* @__PURE__ */ import_react.default.createElement(import_FooterMenus.default, { state, dispatch, source }), _buttons));
|
|
462
467
|
};
|
|
463
468
|
var footer_default = Footer;
|
|
@@ -98,6 +98,7 @@ var Forms = (0, import_model.Provider)((props) => {
|
|
|
98
98
|
relation_id: state.bookingDetail.bookings.id
|
|
99
99
|
// _config: { useCache: true },
|
|
100
100
|
});
|
|
101
|
+
data = data || [];
|
|
101
102
|
if (params.type === "form") {
|
|
102
103
|
data = data.filter((d) => d.form_id !== (params == null ? void 0 : params.form_id));
|
|
103
104
|
}
|
|
@@ -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;
|