@pisell/private-materials 3.3.0 → 3.3.1
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/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +20 -6
- package/es/components/appointmentBooking/components/Date/index.js +1 -1
- package/es/components/wallet/components/WalletCard.js +1 -1
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +8 -0
- package/lib/components/appointmentBooking/components/Date/index.js +1 -1
- package/lib/components/wallet/components/WalletCard.js +1 -1
- package/package.json +2 -2
|
@@ -18,6 +18,7 @@ import { locales } from '@pisell/utils';
|
|
|
18
18
|
import { Button } from '@pisell/materials';
|
|
19
19
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
20
20
|
import { useAppointmentBookingLogin, useAppointmentBookingResource, useAppointmentBookingAccount, useShopDiscount, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBooking } from "../../../hooks";
|
|
21
|
+
import { PisellToast } from '@pisell/materials';
|
|
21
22
|
import { useAppointmentBookingContext } from "../../../context";
|
|
22
23
|
import { formatCarts, hasResourceFormId, Toast } from "../../../utils";
|
|
23
24
|
import { checkLogin, checkHolder, checkResource, handleContinueStep } from "../utils";
|
|
@@ -286,7 +287,7 @@ var ContinueButton = function ContinueButton(_ref) {
|
|
|
286
287
|
*/
|
|
287
288
|
var handleContinue = /*#__PURE__*/function () {
|
|
288
289
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
289
|
-
var _currentStep$step2, key, index, loginOk;
|
|
290
|
+
var _currentStep$step2, key, index, loginOk, selected;
|
|
290
291
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
291
292
|
while (1) switch (_context3.prev = _context3.next) {
|
|
292
293
|
case 0:
|
|
@@ -313,6 +314,19 @@ var ContinueButton = function ContinueButton(_ref) {
|
|
|
313
314
|
}
|
|
314
315
|
return _context3.abrupt("return");
|
|
315
316
|
case 11:
|
|
317
|
+
_context3.next = 13;
|
|
318
|
+
return appointmentBooking.getDateRange();
|
|
319
|
+
case 13:
|
|
320
|
+
selected = _context3.sent;
|
|
321
|
+
if (selected !== null && selected !== void 0 && selected.length) {
|
|
322
|
+
_context3.next = 17;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
PisellToast({
|
|
326
|
+
content: locales.getText('pisell2.appointment.no.available.time')
|
|
327
|
+
});
|
|
328
|
+
return _context3.abrupt("return");
|
|
329
|
+
case 17:
|
|
316
330
|
handleContinueStep(key, {
|
|
317
331
|
handleCheckResource: handleCheckResource,
|
|
318
332
|
currentStep: currentStep,
|
|
@@ -334,17 +348,17 @@ var ContinueButton = function ContinueButton(_ref) {
|
|
|
334
348
|
onIsErrorResource: onIsErrorResource,
|
|
335
349
|
stepList: stepList
|
|
336
350
|
});
|
|
337
|
-
_context3.next =
|
|
351
|
+
_context3.next = 23;
|
|
338
352
|
break;
|
|
339
|
-
case
|
|
340
|
-
_context3.prev =
|
|
353
|
+
case 20:
|
|
354
|
+
_context3.prev = 20;
|
|
341
355
|
_context3.t0 = _context3["catch"](0);
|
|
342
356
|
console.log(_context3.t0, 'handleContinue_error');
|
|
343
|
-
case
|
|
357
|
+
case 23:
|
|
344
358
|
case "end":
|
|
345
359
|
return _context3.stop();
|
|
346
360
|
}
|
|
347
|
-
}, _callee3, null, [[0,
|
|
361
|
+
}, _callee3, null, [[0, 20]]);
|
|
348
362
|
}));
|
|
349
363
|
return function handleContinue() {
|
|
350
364
|
return _ref5.apply(this, arguments);
|
|
@@ -199,7 +199,7 @@ var CalendarDate = function CalendarDate(props) {
|
|
|
199
199
|
return d.status === 'available';
|
|
200
200
|
});
|
|
201
201
|
if (firstAvailableDate) {
|
|
202
|
-
setCurrentDate(firstAvailableDate.date);
|
|
202
|
+
setCurrentDate(firstAvailableDate === null || firstAvailableDate === void 0 ? void 0 : firstAvailableDate.date);
|
|
203
203
|
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
@@ -37,6 +37,7 @@ var import_utils = require("@pisell/utils");
|
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
|
38
38
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
39
39
|
var import_hooks = require("../../../hooks");
|
|
40
|
+
var import_materials2 = require("@pisell/materials");
|
|
40
41
|
var import_context = require("../../../context");
|
|
41
42
|
var import_utils2 = require("../../../utils");
|
|
42
43
|
var import_utils3 = require("../utils");
|
|
@@ -187,6 +188,13 @@ var ContinueButton = ({
|
|
|
187
188
|
if (!loginOk) return;
|
|
188
189
|
if (handleCheckAccount()) return;
|
|
189
190
|
}
|
|
191
|
+
const selected = await appointmentBooking.getDateRange();
|
|
192
|
+
if (!(selected == null ? void 0 : selected.length)) {
|
|
193
|
+
(0, import_materials2.PisellToast)({
|
|
194
|
+
content: import_utils.locales.getText("pisell2.appointment.no.available.time")
|
|
195
|
+
});
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
190
198
|
(0, import_utils3.handleContinueStep)(key, {
|
|
191
199
|
handleCheckResource,
|
|
192
200
|
currentStep,
|
|
@@ -127,7 +127,7 @@ var CalendarDate = (props) => {
|
|
|
127
127
|
(d) => d.status === "available"
|
|
128
128
|
);
|
|
129
129
|
if (firstAvailableDate) {
|
|
130
|
-
setCurrentDate(firstAvailableDate.date);
|
|
130
|
+
setCurrentDate(firstAvailableDate == null ? void 0 : firstAvailableDate.date);
|
|
131
131
|
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
132
132
|
}
|
|
133
133
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "1.0.42",
|
|
63
|
-
"@pisell/materials": "3.3.
|
|
63
|
+
"@pisell/materials": "3.3.1",
|
|
64
64
|
"@pisell/icon": "0.0.11",
|
|
65
65
|
"@pisell/date-picker": "3.0.2"
|
|
66
66
|
},
|