@pisell/private-materials 3.2.31 → 3.2.32
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 +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/Sales/Event/index.js +7 -7
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -40
- package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -5
- package/es/components/appointmentBooking/components/Content/index.less +4 -0
- package/es/components/appointmentBooking/components/Header/index.js +56 -21
- package/es/components/appointmentBooking/components/Services/index.js +11 -3
- package/es/components/appointmentBooking/components/Services/index.less +1 -1
- package/es/components/appointmentBooking/context.d.ts +2 -2
- package/es/components/appointmentBooking/context.js +1 -1
- package/es/components/appointmentBooking/hooks.d.ts +13 -1
- package/es/components/appointmentBooking/hooks.js +83 -0
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/addons/model.js +5 -5
- package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
- package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +3 -5
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +2 -3
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +2 -4
- package/es/components/booking/info2/service/editService/index.js +11 -4
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/addNote/index.js +1 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/payo/config.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/listComponent/index.js +5 -5
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/server.js +2 -2
- package/es/components/ruleSetting/index.d.ts +0 -1
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/components/ticketBooking/data.d.ts +0 -0
- package/es/components/ticketBooking/data.js +82 -0
- package/es/components/ticketBooking/index.d.ts +3 -0
- package/es/components/ticketBooking/index.js +6 -0
- package/es/components/wallet/Detail/index.js +1 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/components/WalletCard.js +1 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/hooks/useComponents.js +1 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/Sales/Event/index.js +1 -5
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +19 -7
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -7
- package/lib/components/appointmentBooking/components/Content/index.less +4 -0
- package/lib/components/appointmentBooking/components/Header/index.js +10 -1
- package/lib/components/appointmentBooking/components/Services/index.js +10 -1
- package/lib/components/appointmentBooking/components/Services/index.less +1 -1
- package/lib/components/appointmentBooking/context.d.ts +2 -2
- package/lib/components/appointmentBooking/context.js +1 -1
- package/lib/components/appointmentBooking/hooks.d.ts +13 -1
- package/lib/components/appointmentBooking/hooks.js +38 -0
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +5 -7
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/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/addTimeModal/index.js +3 -4
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +1 -2
- package/lib/components/booking/info2/service/editService/index.js +11 -4
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/payo/config.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/ruleSetting/index.d.ts +0 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/ticketBooking/data.d.ts +0 -0
- package/lib/components/ticketBooking/data.js +0 -0
- package/lib/components/ticketBooking/index.d.ts +3 -0
- package/lib/components/ticketBooking/index.js +28 -0
- package/lib/components/wallet/Detail/index.js +1 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/components/WalletCard.js +1 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -87,13 +87,13 @@ export var EventProvider = function EventProvider(_ref) {
|
|
|
87
87
|
setEventData({
|
|
88
88
|
currentEventItem: eventItem
|
|
89
89
|
});
|
|
90
|
-
if (currentCartItem) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
// if (currentCartItem) {
|
|
91
|
+
// updateCurrentCartItem({ eventItem: eventItem });
|
|
92
|
+
// } else {
|
|
93
|
+
// createCartItemFromEvent(eventItem);
|
|
94
|
+
// }
|
|
95
|
+
// 每次添加商品时都需要直接创建购物车,防止第一步创建的购物车数据和缓存数据冲突
|
|
96
|
+
createCartItemFromEvent(eventItem);
|
|
97
97
|
};
|
|
98
98
|
var contextValue = {
|
|
99
99
|
eventData: eventData,
|
|
@@ -12,12 +12,12 @@ import React, { useMemo, useState } from 'react';
|
|
|
12
12
|
import { locales } from '@pisell/utils';
|
|
13
13
|
import { Button, PisellToast } from '@pisell/materials';
|
|
14
14
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
15
|
-
import { useAppointmentBookingLogin, useAppointmentBookingResource, useAppointmentBookingAccount, useShopDiscount } from "../../../hooks";
|
|
15
|
+
import { useAppointmentBookingLogin, useAppointmentBookingResource, useAppointmentBookingAccount, useShopDiscount, useIsSkipResourceStep, useAppointmentBookingStep } from "../../../hooks";
|
|
16
16
|
import { useAppointmentBookingContext } from "../../../context";
|
|
17
17
|
import { formatCustomer, isEmptyCartsResourceId } from "../../../utils";
|
|
18
18
|
import "./index.less";
|
|
19
19
|
var ContinueButton = function ContinueButton() {
|
|
20
|
-
var _currentStep$
|
|
20
|
+
var _currentStep$step;
|
|
21
21
|
var context = useEngineContext();
|
|
22
22
|
var utils = context.appHelper.utils || {};
|
|
23
23
|
var _useState = useState(false),
|
|
@@ -39,27 +39,16 @@ var ContinueButton = function ContinueButton() {
|
|
|
39
39
|
summary = _useAppointmentBookin3.summary;
|
|
40
40
|
var _useAppointmentBookin4 = useAppointmentBookingResource(),
|
|
41
41
|
getResourceTimeSlot = _useAppointmentBookin4.getResourceTimeSlot,
|
|
42
|
-
getResourceList = _useAppointmentBookin4.getResourceList
|
|
42
|
+
getResourceList = _useAppointmentBookin4.getResourceList,
|
|
43
|
+
autoSelectAllProductResources = _useAppointmentBookin4.autoSelectAllProductResources;
|
|
44
|
+
var _useIsSkipResourceSte = useIsSkipResourceStep(),
|
|
45
|
+
checkSkipResourceStep = _useIsSkipResourceSte.checkSkipResourceStep;
|
|
46
|
+
var _useAppointmentBookin5 = useAppointmentBookingStep(),
|
|
47
|
+
getStepIndex = _useAppointmentBookin5.getStepIndex;
|
|
43
48
|
var disabled = useMemo(function () {
|
|
44
|
-
var _currentStep$step;
|
|
45
|
-
var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
46
49
|
if (!carts.length) return true;
|
|
47
|
-
|
|
48
|
-
// 选择资源部分需要判断是否有不可用的资源
|
|
49
|
-
// if (
|
|
50
|
-
// key === 'select-resource' &&
|
|
51
|
-
// resourceOtherParams?.errorList?.length > 0
|
|
52
|
-
// ) {
|
|
53
|
-
// return true;
|
|
54
|
-
// }
|
|
55
|
-
|
|
56
|
-
// 如果是选择服务页面,则判断是否账户下有空的购物车
|
|
57
|
-
// if (key === 'select-service' && isEmptyGuest(carts, accountLists)) {
|
|
58
|
-
// return true;
|
|
59
|
-
// }
|
|
60
|
-
|
|
61
50
|
return false;
|
|
62
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$
|
|
51
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key, carts, accountLists, resourceOtherParams === null || resourceOtherParams === void 0 ? void 0 : resourceOtherParams.errorList]);
|
|
63
52
|
|
|
64
53
|
/**
|
|
65
54
|
* @title: 清空数据
|
|
@@ -83,7 +72,7 @@ var ContinueButton = function ContinueButton() {
|
|
|
83
72
|
*/
|
|
84
73
|
var handleNextStep = /*#__PURE__*/function () {
|
|
85
74
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
86
|
-
var _currentStep$
|
|
75
|
+
var _currentStep$step2;
|
|
87
76
|
var res, _ref2, order_id, total_amount, freeResult, _utils$history, url;
|
|
88
77
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
89
78
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -137,21 +126,11 @@ var ContinueButton = function ContinueButton() {
|
|
|
137
126
|
case 23:
|
|
138
127
|
return _context.abrupt("return");
|
|
139
128
|
case 24:
|
|
140
|
-
if ((currentStep === null || currentStep === void 0 || (_currentStep$
|
|
129
|
+
if ((currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === 'select-resource') {
|
|
141
130
|
getResourceTimeSlot();
|
|
142
131
|
}
|
|
143
|
-
if ((currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key) === 'select-time') {
|
|
144
|
-
// getResourceTimeSlot('resources');
|
|
145
|
-
// const { errorList } =
|
|
146
|
-
// await appointmentBooking.autoSelectAllProductResources(
|
|
147
|
-
// 'sites',
|
|
148
|
-
// selectedTime
|
|
149
|
-
// );
|
|
150
|
-
// const result = await appointmentBooking.submitTimeSlot(selectedTime);
|
|
151
|
-
// console.log(errorList, result, 'wh9896788');
|
|
152
|
-
}
|
|
153
132
|
return _context.abrupt("return", appointmentBooking.next());
|
|
154
|
-
case
|
|
133
|
+
case 26:
|
|
155
134
|
case "end":
|
|
156
135
|
return _context.stop();
|
|
157
136
|
}
|
|
@@ -171,13 +150,13 @@ var ContinueButton = function ContinueButton() {
|
|
|
171
150
|
*/
|
|
172
151
|
var handleContinue = /*#__PURE__*/function () {
|
|
173
152
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
174
|
-
var _currentStep$
|
|
175
|
-
var key;
|
|
153
|
+
var _currentStep$step3;
|
|
154
|
+
var key, skipResourceStep, index;
|
|
176
155
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
177
156
|
while (1) switch (_context2.prev = _context2.next) {
|
|
178
157
|
case 0:
|
|
179
|
-
key = currentStep === null || currentStep === void 0 || (_currentStep$
|
|
180
|
-
console.log(currentStep, isLastStep, isLogin, 'wh9896788222');
|
|
158
|
+
key = currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key;
|
|
159
|
+
console.log(currentStep, isLastStep, isLogin, accountLists, 'wh9896788222');
|
|
181
160
|
// 如果当前是确认信息页面,则到结算页面
|
|
182
161
|
if (!isLastStep) {
|
|
183
162
|
_context2.next = 5;
|
|
@@ -202,17 +181,35 @@ var ContinueButton = function ContinueButton() {
|
|
|
202
181
|
}
|
|
203
182
|
}));
|
|
204
183
|
case 5:
|
|
184
|
+
if (!(key === 'select-date')) {
|
|
185
|
+
_context2.next = 15;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
_context2.next = 8;
|
|
189
|
+
return checkSkipResourceStep();
|
|
190
|
+
case 8:
|
|
191
|
+
skipResourceStep = _context2.sent;
|
|
192
|
+
if (!skipResourceStep) {
|
|
193
|
+
_context2.next = 15;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
index = getStepIndex('next', 2);
|
|
197
|
+
getResourceList();
|
|
198
|
+
autoSelectAllProductResources();
|
|
199
|
+
appointmentBooking.gotoStep(index);
|
|
200
|
+
return _context2.abrupt("return");
|
|
201
|
+
case 15:
|
|
205
202
|
if (!(key === 'select-resource' && isEmptyCartsResourceId(carts))) {
|
|
206
|
-
_context2.next =
|
|
203
|
+
_context2.next = 18;
|
|
207
204
|
break;
|
|
208
205
|
}
|
|
209
206
|
PisellToast({
|
|
210
207
|
content: locales.getText('pisell2.appointment.no.available.time')
|
|
211
208
|
});
|
|
212
209
|
return _context2.abrupt("return");
|
|
213
|
-
case
|
|
210
|
+
case 18:
|
|
214
211
|
handleNextStep();
|
|
215
|
-
case
|
|
212
|
+
case 19:
|
|
216
213
|
case "end":
|
|
217
214
|
return _context2.stop();
|
|
218
215
|
}
|
|
@@ -17,7 +17,7 @@ import Total from "./Total";
|
|
|
17
17
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
18
18
|
import "./index.less";
|
|
19
19
|
var CartItem = function CartItem(_ref) {
|
|
20
|
-
var _context$appHelper, _currentStep$step, _currentStep$step2;
|
|
20
|
+
var _context$appHelper, _businessUtils$getApp, _currentStep$step, _currentStep$step2;
|
|
21
21
|
var onConfirm = _ref.onConfirm;
|
|
22
22
|
var appointmentBooking = useAppointmentBooking();
|
|
23
23
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
@@ -45,10 +45,8 @@ var CartItem = function CartItem(_ref) {
|
|
|
45
45
|
}, [accountLists]);
|
|
46
46
|
|
|
47
47
|
// 是否安装商品券应用
|
|
48
|
-
var hasGoodPassApp =
|
|
49
|
-
|
|
50
|
-
return !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp = businessUtils.getAppByModal) !== null && _businessUtils$getApp !== void 0 && _businessUtils$getApp.call(businessUtils, 'goodpass'));
|
|
51
|
-
}, []);
|
|
48
|
+
var hasGoodPassApp = !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp = businessUtils.getAppByModal) !== null && _businessUtils$getApp !== void 0 && _businessUtils$getApp.call(businessUtils, 'goodpass'));
|
|
49
|
+
console.log('has goodpass app:', hasGoodPassApp);
|
|
52
50
|
var handleClickCard = function handleClickCard(e, type, val) {
|
|
53
51
|
// 更改备注
|
|
54
52
|
if (type === 'note') {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
1
5
|
import React, { useMemo } from 'react';
|
|
2
6
|
import { locales } from '@pisell/utils';
|
|
3
7
|
import ProgressBar from "../../../eventBooking/components/progressBar";
|
|
4
8
|
import { useAppointmentBookingContext } from "../../context";
|
|
5
|
-
import { useShopDiscount } from "../../hooks";
|
|
9
|
+
import { useShopDiscount, useIsSkipResourceStep, useAppointmentBookingStep } from "../../hooks";
|
|
6
10
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
7
11
|
import "./index.less";
|
|
8
12
|
var Header = function Header() {
|
|
@@ -14,6 +18,10 @@ var Header = function Header() {
|
|
|
14
18
|
setTimes = _useAppointmentBookin.setTimes;
|
|
15
19
|
var shopDiscount = useShopDiscount();
|
|
16
20
|
var context = useEngineContext();
|
|
21
|
+
var _useIsSkipResourceSte = useIsSkipResourceStep(),
|
|
22
|
+
checkSkipResourceStep = _useIsSkipResourceSte.checkSkipResourceStep;
|
|
23
|
+
var _useAppointmentBookin2 = useAppointmentBookingStep(),
|
|
24
|
+
getStepIndex = _useAppointmentBookin2.getStepIndex;
|
|
17
25
|
|
|
18
26
|
/**
|
|
19
27
|
* @title: 获取资源名称
|
|
@@ -43,28 +51,55 @@ var Header = function Header() {
|
|
|
43
51
|
* @Author: WangHan
|
|
44
52
|
* @Date: 2025-01-18 22:28
|
|
45
53
|
*/
|
|
46
|
-
var handleBack = function
|
|
47
|
-
var
|
|
48
|
-
|
|
54
|
+
var handleBack = /*#__PURE__*/function () {
|
|
55
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
56
|
+
var _currentStep$step4;
|
|
57
|
+
var key, types, skipResourceStep, index;
|
|
58
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
59
|
+
while (1) switch (_context.prev = _context.next) {
|
|
60
|
+
case 0:
|
|
61
|
+
key = currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key; // 删除缓存
|
|
62
|
+
types = {
|
|
63
|
+
'select-time': 'time',
|
|
64
|
+
'select-resource': 'resource'
|
|
65
|
+
};
|
|
66
|
+
if (types[key]) {
|
|
67
|
+
appointmentBooking.deleteCartItemInfo(types[key]);
|
|
68
|
+
}
|
|
49
69
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
// 清空选中的日期
|
|
71
|
+
if (key === 'select-date') {
|
|
72
|
+
appointmentBooking.clearDateRange();
|
|
73
|
+
}
|
|
74
|
+
if (!(key === 'select-time')) {
|
|
75
|
+
_context.next = 14;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
setTimes([]);
|
|
79
|
+
_context.next = 8;
|
|
80
|
+
return checkSkipResourceStep();
|
|
81
|
+
case 8:
|
|
82
|
+
skipResourceStep = _context.sent;
|
|
83
|
+
if (!skipResourceStep) {
|
|
84
|
+
_context.next = 14;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
appointmentBooking.deleteCartItemInfo('resource');
|
|
88
|
+
index = getStepIndex('prev', 2);
|
|
89
|
+
appointmentBooking.gotoStep(index);
|
|
90
|
+
return _context.abrupt("return");
|
|
91
|
+
case 14:
|
|
92
|
+
appointmentBooking.back();
|
|
93
|
+
case 15:
|
|
94
|
+
case "end":
|
|
95
|
+
return _context.stop();
|
|
96
|
+
}
|
|
97
|
+
}, _callee);
|
|
98
|
+
}));
|
|
99
|
+
return function handleBack() {
|
|
100
|
+
return _ref.apply(this, arguments);
|
|
54
101
|
};
|
|
55
|
-
|
|
56
|
-
appointmentBooking.deleteCartItemInfo(types[key]);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// 清空选中的日期
|
|
60
|
-
if (key === 'select-date') {
|
|
61
|
-
appointmentBooking.clearDateRange();
|
|
62
|
-
}
|
|
63
|
-
if (key === 'select-time') {
|
|
64
|
-
setTimes([]);
|
|
65
|
-
}
|
|
66
|
-
appointmentBooking.back();
|
|
67
|
-
};
|
|
102
|
+
}();
|
|
68
103
|
|
|
69
104
|
/**
|
|
70
105
|
* @title: 关闭页面
|
|
@@ -11,9 +11,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import React, { useRef, useState, useMemo, useEffect } from 'react';
|
|
14
|
-
import { Input } from 'antd';
|
|
14
|
+
import { Input, Skeleton } from 'antd';
|
|
15
15
|
import SearchLg from '@pisell/icon/es/SearchLg';
|
|
16
|
-
import { locales } from '@pisell/utils';
|
|
16
|
+
import { locales, isMobile } from '@pisell/utils';
|
|
17
17
|
import { PisellEmpty, PisellToast } from '@pisell/materials';
|
|
18
18
|
import TabProduct from "../../../booking/components/TabProduct";
|
|
19
19
|
import { formatProductListByCategory } from "../../../booking/utils";
|
|
@@ -39,6 +39,8 @@ var Services = function Services() {
|
|
|
39
39
|
productModuleParams = _ref2.productModuleParams;
|
|
40
40
|
appointmentBooking.loadProducts(productModuleParams).then(function (res) {
|
|
41
41
|
setProducts(res || []);
|
|
42
|
+
}).catch(function () {
|
|
43
|
+
setProducts([]);
|
|
42
44
|
});
|
|
43
45
|
}, []);
|
|
44
46
|
var handleSelectProduct = function handleSelectProduct(item) {
|
|
@@ -93,7 +95,13 @@ var Services = function Services() {
|
|
|
93
95
|
onChange: function onChange(e) {
|
|
94
96
|
setSearch(e.target.value);
|
|
95
97
|
}
|
|
96
|
-
})),
|
|
98
|
+
})), !products ? /*#__PURE__*/React.createElement(Skeleton, {
|
|
99
|
+
loading: true,
|
|
100
|
+
active: true,
|
|
101
|
+
style: {
|
|
102
|
+
padding: isMobile() ? '20px' : 0
|
|
103
|
+
}
|
|
104
|
+
}) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React.createElement(TabProduct, {
|
|
97
105
|
list: renderList,
|
|
98
106
|
amountSymbol: '$',
|
|
99
107
|
onChange: handleSelectProduct,
|
|
@@ -5,10 +5,10 @@ interface AppointmentBookingContextType {
|
|
|
5
5
|
resources: any[];
|
|
6
6
|
setTimes: (times: any[]) => void;
|
|
7
7
|
setResources: (lists: any[]) => void;
|
|
8
|
-
products: any
|
|
8
|
+
products: any;
|
|
9
9
|
carts: any[];
|
|
10
10
|
summary: any;
|
|
11
|
-
setProducts: (val: any
|
|
11
|
+
setProducts: (val: any) => void;
|
|
12
12
|
setCarts: (val: any[]) => void;
|
|
13
13
|
setSummary: (val: any) => void;
|
|
14
14
|
currentStep: any;
|
|
@@ -13,7 +13,7 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
13
13
|
var children = _ref.children;
|
|
14
14
|
var appointmentBooking = useAppointmentBooking();
|
|
15
15
|
// 商品列表
|
|
16
|
-
var _useState = useState(
|
|
16
|
+
var _useState = useState(),
|
|
17
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
18
|
products = _useState2[0],
|
|
19
19
|
setProducts = _useState2[1];
|
|
@@ -7,7 +7,9 @@ export declare const useShopDiscount: () => any;
|
|
|
7
7
|
* @Author: WangHan
|
|
8
8
|
* @Date: 2025-04-15 11:11
|
|
9
9
|
*/
|
|
10
|
-
export declare const useAppointmentBookingStep: () =>
|
|
10
|
+
export declare const useAppointmentBookingStep: () => {
|
|
11
|
+
getStepIndex: (type: string, skipNumber?: number) => any;
|
|
12
|
+
};
|
|
11
13
|
/**
|
|
12
14
|
* @title: 获取商品数据
|
|
13
15
|
* @description:
|
|
@@ -62,3 +64,13 @@ export declare const useAppointmentBookingResource: () => {
|
|
|
62
64
|
};
|
|
63
65
|
autoSelectAllProductResources: (index?: number) => Promise<any>;
|
|
64
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* @title: 是否跳过资源选择步骤
|
|
69
|
+
* @description:
|
|
70
|
+
* @return {*}
|
|
71
|
+
* @Author: WangHan
|
|
72
|
+
* @Date: 2025-04-21 11:47
|
|
73
|
+
*/
|
|
74
|
+
export declare const useIsSkipResourceStep: () => {
|
|
75
|
+
checkSkipResourceStep: () => Promise<boolean>;
|
|
76
|
+
};
|
|
@@ -42,6 +42,8 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
42
42
|
setCurrentStep = _useAppointmentBookin.setCurrentStep,
|
|
43
43
|
setIsLastStep = _useAppointmentBookin.setIsLastStep;
|
|
44
44
|
var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
|
|
45
|
+
|
|
46
|
+
// 判断是否是最后一步
|
|
45
47
|
var getCurrentAndLastStep = function getCurrentAndLastStep() {
|
|
46
48
|
var _currentStep = appointmentBooking.getCurrentStep();
|
|
47
49
|
setCurrentStep(_currentStep);
|
|
@@ -68,6 +70,24 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
68
70
|
};
|
|
69
71
|
}());
|
|
70
72
|
}, []);
|
|
73
|
+
|
|
74
|
+
// 设置步骤
|
|
75
|
+
var getStepIndex = function getStepIndex(type) {
|
|
76
|
+
var skipNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
77
|
+
var currentStep = appointmentBooking.getCurrentStep();
|
|
78
|
+
var index = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) || 1;
|
|
79
|
+
if (type === 'next') {
|
|
80
|
+
var nextIndex = index + skipNumber;
|
|
81
|
+
return nextIndex + 1 > stepList.length ? stepList.length - 1 : nextIndex;
|
|
82
|
+
}
|
|
83
|
+
if (type === 'prev') {
|
|
84
|
+
var prevIndex = index - skipNumber;
|
|
85
|
+
return prevIndex < 1 ? 1 : prevIndex;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
getStepIndex: getStepIndex
|
|
90
|
+
};
|
|
71
91
|
};
|
|
72
92
|
|
|
73
93
|
/**
|
|
@@ -335,4 +355,67 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
335
355
|
getResourceList: getResourceList,
|
|
336
356
|
autoSelectAllProductResources: autoSelectAllProductResources
|
|
337
357
|
};
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* @title: 是否跳过资源选择步骤
|
|
362
|
+
* @description:
|
|
363
|
+
* @return {*}
|
|
364
|
+
* @Author: WangHan
|
|
365
|
+
* @Date: 2025-04-21 11:47
|
|
366
|
+
*/
|
|
367
|
+
export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
368
|
+
var _useAppointmentBookin5 = useAppointmentBookingAccount(),
|
|
369
|
+
accountLists = _useAppointmentBookin5.accountLists;
|
|
370
|
+
var _useAppointmentBookin6 = useAppointmentBookingResource(),
|
|
371
|
+
getResourceList = _useAppointmentBookin6.getResourceList,
|
|
372
|
+
autoSelectAllProductResources = _useAppointmentBookin6.autoSelectAllProductResources;
|
|
373
|
+
var checkSkipResourceStep = /*#__PURE__*/function () {
|
|
374
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
375
|
+
var _res$errorList, _resources$, res, _getResourceList3, resources;
|
|
376
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
377
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
378
|
+
case 0:
|
|
379
|
+
_context8.prev = 0;
|
|
380
|
+
if (!((accountLists === null || accountLists === void 0 ? void 0 : accountLists.length) === 1)) {
|
|
381
|
+
_context8.next = 13;
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
_context8.next = 4;
|
|
385
|
+
return autoSelectAllProductResources();
|
|
386
|
+
case 4:
|
|
387
|
+
res = _context8.sent;
|
|
388
|
+
_getResourceList3 = getResourceList(), resources = _getResourceList3.resources; // 如果分配成功,并且只有一个资源则跳过资源选择步骤,默认选中该资源
|
|
389
|
+
if (!(!(res !== null && res !== void 0 && (_res$errorList = res.errorList) !== null && _res$errorList !== void 0 && _res$errorList.length) && (resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.renderList) === null || _resources$ === void 0 ? void 0 : _resources$.length) === 1)) {
|
|
390
|
+
_context8.next = 10;
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
return _context8.abrupt("return", true);
|
|
394
|
+
case 10:
|
|
395
|
+
return _context8.abrupt("return", false);
|
|
396
|
+
case 11:
|
|
397
|
+
_context8.next = 14;
|
|
398
|
+
break;
|
|
399
|
+
case 13:
|
|
400
|
+
return _context8.abrupt("return", false);
|
|
401
|
+
case 14:
|
|
402
|
+
_context8.next = 19;
|
|
403
|
+
break;
|
|
404
|
+
case 16:
|
|
405
|
+
_context8.prev = 16;
|
|
406
|
+
_context8.t0 = _context8["catch"](0);
|
|
407
|
+
return _context8.abrupt("return", false);
|
|
408
|
+
case 19:
|
|
409
|
+
case "end":
|
|
410
|
+
return _context8.stop();
|
|
411
|
+
}
|
|
412
|
+
}, _callee8, null, [[0, 16]]);
|
|
413
|
+
}));
|
|
414
|
+
return function checkSkipResourceStep() {
|
|
415
|
+
return _ref10.apply(this, arguments);
|
|
416
|
+
};
|
|
417
|
+
}();
|
|
418
|
+
return {
|
|
419
|
+
checkSkipResourceStep: checkSkipResourceStep
|
|
420
|
+
};
|
|
338
421
|
};
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import { miniRedux } from "@pisell/utils";
|
|
8
8
|
var defaultState = {};
|
|
9
9
|
var _miniRedux = miniRedux({
|
|
@@ -6,7 +6,7 @@ import CollapsibleList from "../../collapsibleList";
|
|
|
6
6
|
import { renderBundles } from "../../collapsibleList/utils";
|
|
7
7
|
import "./index.less";
|
|
8
8
|
var SelectProductItem = function SelectProductItem(_ref) {
|
|
9
|
-
var _item$_extend, _item$_extend2;
|
|
9
|
+
var _item$_extend, _item$_extend$other, _item$_extend2, _item$_extend2$other;
|
|
10
10
|
var item = _ref.item,
|
|
11
11
|
_onClick = _ref.onClick,
|
|
12
12
|
onChangeQuantity = _ref.onChangeQuantity,
|
|
@@ -28,7 +28,7 @@ var SelectProductItem = function SelectProductItem(_ref) {
|
|
|
28
28
|
style: style,
|
|
29
29
|
className: classNames("server-select-product", className),
|
|
30
30
|
onClick: function onClick() {
|
|
31
|
-
_onClick === null || _onClick === void 0
|
|
31
|
+
_onClick === null || _onClick === void 0 ? void 0 : _onClick(item);
|
|
32
32
|
}
|
|
33
33
|
}, item.cover ? /*#__PURE__*/React.createElement("img", {
|
|
34
34
|
src: image.ali(item.cover, 100),
|
|
@@ -39,11 +39,11 @@ var SelectProductItem = function SelectProductItem(_ref) {
|
|
|
39
39
|
className: "server-select-product-title"
|
|
40
40
|
}, item.title), /*#__PURE__*/React.createElement("div", {
|
|
41
41
|
className: "server-select-product-subtitle"
|
|
42
|
-
}, item.subtitle || ""), (((_item$_extend = item._extend) === null || _item$_extend === void 0
|
|
42
|
+
}, item.subtitle || ""), (((_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : (_item$_extend$other = _item$_extend.other) === null || _item$_extend$other === void 0 ? void 0 : _item$_extend$other.bundle) || []).length ? /*#__PURE__*/React.createElement(CollapsibleList, {
|
|
43
43
|
style: {
|
|
44
44
|
width: "100%"
|
|
45
45
|
},
|
|
46
|
-
list: ((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0
|
|
46
|
+
list: ((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : (_item$_extend2$other = _item$_extend2.other) === null || _item$_extend2$other === void 0 ? void 0 : _item$_extend2$other.bundle) || [],
|
|
47
47
|
renderItem: function renderItem(item) {
|
|
48
48
|
return renderBundles(item, amountSymbol);
|
|
49
49
|
}
|
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useMemo, useState, useEffect, forwardRef, useImperativeHandle } from "react";
|
|
8
8
|
import classNames from "classnames";
|
|
@@ -13,10 +13,6 @@ import "./index.less";
|
|
|
13
13
|
|
|
14
14
|
// tabs 子组件定义
|
|
15
15
|
|
|
16
|
-
// 定义主键类型
|
|
17
|
-
|
|
18
|
-
// Tabs 可传递的参数
|
|
19
|
-
|
|
20
16
|
var Tabs = function Tabs(_ref, ref) {
|
|
21
17
|
var renderTab = _ref.renderTab,
|
|
22
18
|
rowKey = _ref.rowKey,
|
|
@@ -29,7 +29,7 @@ var BrowserSelect = function BrowserSelect(props) {
|
|
|
29
29
|
onChange: function onChange(e) {
|
|
30
30
|
var _resetProps$onChange;
|
|
31
31
|
e.persist();
|
|
32
|
-
(_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0
|
|
32
|
+
(_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0 ? void 0 : _resetProps$onChange.call(resetProps, e);
|
|
33
33
|
}
|
|
34
34
|
}), _options);
|
|
35
35
|
};
|