@pisell/private-materials 3.2.21 → 3.2.23
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 +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/assets/guests.svg +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +36 -17
- package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +11 -11
- package/es/components/appointmentBooking/components/Date/index.js +49 -32
- package/es/components/appointmentBooking/components/Date/index.less +5 -0
- package/es/components/appointmentBooking/components/Guest/index.js +8 -21
- package/es/components/appointmentBooking/components/Header/index.js +44 -7
- package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +28 -20
- package/es/components/appointmentBooking/components/Resource/index.less +5 -0
- package/es/components/appointmentBooking/components/Services/index.js +20 -9
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
- package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +238 -0
- package/es/components/appointmentBooking/components/Voucher/index.less +26 -0
- package/es/components/appointmentBooking/context.d.ts +2 -0
- package/es/components/appointmentBooking/context.js +7 -1
- package/es/components/appointmentBooking/hooks.d.ts +46 -9
- package/es/components/appointmentBooking/hooks.js +162 -121
- package/es/components/appointmentBooking/index.js +12 -7
- package/es/components/appointmentBooking/locales.d.ts +57 -0
- package/es/components/appointmentBooking/locales.js +60 -3
- package/es/components/appointmentBooking/utils.d.ts +19 -0
- package/es/components/appointmentBooking/utils.js +71 -2
- package/es/components/booking/addons/index.js +1 -0
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +5 -1
- package/es/components/booking/components/footer/utils.js +18 -2
- package/es/components/booking/components/voucher/index.d.ts +3 -0
- package/es/components/booking/components/voucher/index.js +238 -0
- package/es/components/booking/components/voucher/index.less +88 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.js +115 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +9 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/locales.d.ts +18 -0
- package/es/components/booking/locales.js +21 -3
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/payments/index.js +1 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.js +3 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/wallet/Detail/index.js +20 -14
- package/es/components/wallet/Voucher/index.js +1 -0
- package/es/components/wallet/index.js +15 -1
- package/es/components/wallet/locales.d.ts +3 -0
- package/es/components/wallet/locales.js +3 -0
- package/es/components/wallet/model.d.ts +1 -1
- package/es/components/wallet/utils/formatUtils.js +1 -1
- package/es/components/walletList/index.js +5 -1
- package/lib/components/appointmentBooking/assets/guests.svg +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +24 -11
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +3 -5
- package/lib/components/appointmentBooking/components/Date/index.js +53 -47
- package/lib/components/appointmentBooking/components/Date/index.less +5 -0
- package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
- package/lib/components/appointmentBooking/components/Header/index.js +25 -3
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
- package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
- package/lib/components/appointmentBooking/components/Services/index.js +21 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
- package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +221 -0
- package/lib/components/appointmentBooking/components/Voucher/index.less +26 -0
- package/lib/components/appointmentBooking/context.d.ts +2 -0
- package/lib/components/appointmentBooking/context.js +4 -1
- package/lib/components/appointmentBooking/hooks.d.ts +46 -9
- package/lib/components/appointmentBooking/hooks.js +36 -43
- package/lib/components/appointmentBooking/index.js +11 -7
- package/lib/components/appointmentBooking/locales.d.ts +57 -0
- package/lib/components/appointmentBooking/locales.js +60 -3
- package/lib/components/appointmentBooking/utils.d.ts +19 -0
- package/lib/components/appointmentBooking/utils.js +42 -2
- package/lib/components/booking/addons/index.js +1 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +2 -1
- package/lib/components/booking/components/footer/utils.js +4 -1
- package/lib/components/booking/components/voucher/index.d.ts +3 -0
- package/lib/components/booking/components/voucher/index.js +222 -0
- package/lib/components/booking/components/voucher/index.less +88 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.js +109 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +8 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/locales.d.ts +18 -0
- package/lib/components/booking/locales.js +21 -3
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/wallet/Detail/index.js +6 -1
- package/lib/components/wallet/Voucher/index.js +1 -0
- package/lib/components/wallet/index.js +15 -1
- package/lib/components/wallet/locales.d.ts +3 -0
- package/lib/components/wallet/locales.js +3 -0
- package/lib/components/wallet/model.d.ts +1 -1
- package/lib/components/wallet/utils/formatUtils.js +1 -1
- package/lib/components/walletList/index.js +6 -2
- package/package.json +3 -3
|
@@ -36,19 +36,29 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_dayjs = __toESM(require("dayjs"));
|
|
38
38
|
var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
|
|
39
|
-
var import_state = require("./state");
|
|
40
39
|
var import_classnames = __toESM(require("classnames"));
|
|
40
|
+
var import_utils = require("@pisell/utils");
|
|
41
41
|
var import_icons = require("@ant-design/icons");
|
|
42
42
|
var import_context = require("../../context");
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
44
|
import_dayjs.default.extend(import_isSameOrBefore.default);
|
|
45
45
|
var CalendarDate = (props) => {
|
|
46
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
46
47
|
const [currentDate, setCurrentDate] = (0, import_react.useState)();
|
|
47
48
|
const [dateMonthList, setDateMonthList] = (0, import_react.useState)([]);
|
|
48
49
|
const [currentMonth, setCurrentMonth] = (0, import_react.useState)(() => {
|
|
49
50
|
return (0, import_dayjs.default)();
|
|
50
51
|
});
|
|
51
52
|
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
53
|
+
const weekListText = [
|
|
54
|
+
import_utils.locales.getText("pisell2.appointment.sunday"),
|
|
55
|
+
import_utils.locales.getText("pisell2.appointment.monday"),
|
|
56
|
+
import_utils.locales.getText("pisell2.appointment.tuesday"),
|
|
57
|
+
import_utils.locales.getText("pisell2.appointment.wednesday"),
|
|
58
|
+
import_utils.locales.getText("pisell2.appointment.thursday"),
|
|
59
|
+
import_utils.locales.getText("pisell2.appointment.friday"),
|
|
60
|
+
import_utils.locales.getText("pisell2.appointment.saturday")
|
|
61
|
+
];
|
|
52
62
|
const startingColumn = 0 % 7;
|
|
53
63
|
const columns = Array.from(
|
|
54
64
|
{ length: 7 },
|
|
@@ -80,40 +90,44 @@ var CalendarDate = (props) => {
|
|
|
80
90
|
return lastDate.isBefore((0, import_dayjs.default)(), "month");
|
|
81
91
|
};
|
|
82
92
|
const getDates = async (date) => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
103
|
-
}
|
|
104
|
-
const baseMonthData = getMonthData(date.format("YYYY-MM"));
|
|
105
|
-
const updatedDates = baseMonthData.map((day) => {
|
|
106
|
-
const matchedDay = data.find((d) => d.date === day.date);
|
|
107
|
-
if (matchedDay) {
|
|
108
|
-
return {
|
|
109
|
-
...day,
|
|
110
|
-
...matchedDay,
|
|
111
|
-
disabled: matchedDay.status === "unavailable"
|
|
112
|
-
};
|
|
93
|
+
try {
|
|
94
|
+
const startDate = (0, import_dayjs.default)(date).startOf("month").format("YYYY-MM-DD");
|
|
95
|
+
const endDate = (0, import_dayjs.default)(date).endOf("month").format("YYYY-MM-DD");
|
|
96
|
+
const params = {
|
|
97
|
+
startDate,
|
|
98
|
+
endDate
|
|
99
|
+
};
|
|
100
|
+
const data = await appointmentBooking.getAvailableDate(params);
|
|
101
|
+
const selected = await appointmentBooking.getDateRange();
|
|
102
|
+
if ((selected == null ? void 0 : selected.length) > 0) {
|
|
103
|
+
setCurrentDate(selected[0].date);
|
|
104
|
+
} else {
|
|
105
|
+
if (date.format("YYYY-MM") === (0, import_dayjs.default)().format("YYYY-MM")) {
|
|
106
|
+
const firstAvailableDate = data.find(
|
|
107
|
+
(d) => d.status === "available"
|
|
108
|
+
);
|
|
109
|
+
setCurrentDate(firstAvailableDate == null ? void 0 : firstAvailableDate.date);
|
|
110
|
+
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
111
|
+
}
|
|
113
112
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
const baseMonthData = getMonthData(date.format("YYYY-MM"));
|
|
114
|
+
const updatedDates = baseMonthData.map((day) => {
|
|
115
|
+
const matchedDay = data.find((d) => d.date === day.date);
|
|
116
|
+
if (matchedDay) {
|
|
117
|
+
return {
|
|
118
|
+
...day,
|
|
119
|
+
...matchedDay,
|
|
120
|
+
disabled: matchedDay.status === "unavailable"
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return day;
|
|
124
|
+
});
|
|
125
|
+
setLoading(false);
|
|
126
|
+
setDateMonthList(updatedDates);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
setLoading(false);
|
|
129
|
+
console.log(error, "wh978968234234");
|
|
130
|
+
}
|
|
117
131
|
};
|
|
118
132
|
(0, import_react.useEffect)(() => {
|
|
119
133
|
getDates(currentMonth);
|
|
@@ -127,6 +141,7 @@ var CalendarDate = (props) => {
|
|
|
127
141
|
let currentMonthText = currentMonth.format("YYYY-MM");
|
|
128
142
|
let newNextMonth = (0, import_dayjs.default)(currentMonthText).add(1, "month");
|
|
129
143
|
setCurrentMonth(newNextMonth);
|
|
144
|
+
setLoading(true);
|
|
130
145
|
};
|
|
131
146
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-date-box" }, !dateMonthList.length ? /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, style: { paddingTop: "16px" } }) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-header" }, /* @__PURE__ */ import_react.default.createElement(
|
|
132
147
|
"div",
|
|
@@ -140,7 +155,7 @@ var CalendarDate = (props) => {
|
|
|
140
155
|
}
|
|
141
156
|
},
|
|
142
157
|
/* @__PURE__ */ import_react.default.createElement(import_icons.CaretLeftOutlined, null)
|
|
143
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-current-month" }, currentMonth.format("MMMM YYYY")), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-next-month", onClick: nextMonth }, /* @__PURE__ */ import_react.default.createElement(import_icons.CaretRightOutlined, null))), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-weeks" }, columns.map((col) => /* @__PURE__ */ import_react.default.createElement("div", { key: col, className: "calendar-weeks-items" },
|
|
158
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-current-month" }, currentMonth.format("MMMM YYYY")), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-next-month", onClick: nextMonth }, /* @__PURE__ */ import_react.default.createElement(import_icons.CaretRightOutlined, null))), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-weeks" }, columns.map((col) => /* @__PURE__ */ import_react.default.createElement("div", { key: col, className: "calendar-weeks-items" }, weekListText[Number(col)]))), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-days" }, dateMonthList.map((day, index) => {
|
|
144
159
|
const date = (0, import_dayjs.default)(day.date).format("YYYY-MM-DD");
|
|
145
160
|
const isCurrentMonth = (0, import_dayjs.default)(day.date).isSame(
|
|
146
161
|
currentMonth,
|
|
@@ -152,26 +167,17 @@ var CalendarDate = (props) => {
|
|
|
152
167
|
key: index,
|
|
153
168
|
className: (0, import_classnames.default)("calendar-days-items", {
|
|
154
169
|
["disabledDate"]: day == null ? void 0 : day.disabled,
|
|
155
|
-
// ['disabledSelect']: status === 'sold_out',
|
|
156
170
|
["selectDate"]: currentDate === date,
|
|
157
|
-
["other-month-days"]: !isCurrentMonth
|
|
171
|
+
["other-month-days"]: !isCurrentMonth,
|
|
172
|
+
["loading-item"]: loading
|
|
158
173
|
}),
|
|
159
174
|
onClick: () => {
|
|
160
175
|
if (day == null ? void 0 : day.disabled) return;
|
|
161
|
-
console.log(day, "wh987976");
|
|
162
176
|
setCurrentDate(date);
|
|
163
177
|
appointmentBooking.setDateRange([day]);
|
|
164
178
|
}
|
|
165
179
|
},
|
|
166
|
-
isCurrentMonth && /* @__PURE__ */ import_react.default.createElement(
|
|
167
|
-
"div",
|
|
168
|
-
{
|
|
169
|
-
className: (0, import_classnames.default)("day-text", {
|
|
170
|
-
// ['day-line']: !disabled,
|
|
171
|
-
})
|
|
172
|
-
},
|
|
173
|
-
(0, import_dayjs.default)(day.date).format("D")
|
|
174
|
-
)
|
|
180
|
+
isCurrentMonth && /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("day-text") }, (0, import_dayjs.default)(day.date).format("D"))
|
|
175
181
|
);
|
|
176
182
|
})))));
|
|
177
183
|
};
|
|
@@ -36,14 +36,12 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
|
-
var import_hooks = require("../../hooks");
|
|
40
39
|
var import_context = require("../../context");
|
|
40
|
+
var import_hooks = require("../../hooks");
|
|
41
41
|
var import_utils2 = require("../../utils");
|
|
42
42
|
var import_index = require("./index.less");
|
|
43
43
|
var Guest = () => {
|
|
44
44
|
const [openOption, setOpenOption] = (0, import_react.useState)(false);
|
|
45
|
-
const [holderItem, setHolderItem] = (0, import_react.useState)(null);
|
|
46
|
-
const [removeOpen, setRemoveOpen] = (0, import_react.useState)(false);
|
|
47
45
|
const { carts, appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
48
46
|
const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
49
47
|
const lists = (0, import_react.useMemo)(() => {
|
|
@@ -80,7 +78,6 @@ var Guest = () => {
|
|
|
80
78
|
{
|
|
81
79
|
size: "large",
|
|
82
80
|
onClick: () => {
|
|
83
|
-
setHolderItem(item);
|
|
84
81
|
setOpenOption(true);
|
|
85
82
|
}
|
|
86
83
|
},
|
|
@@ -93,7 +90,6 @@ var Guest = () => {
|
|
|
93
90
|
menu: {
|
|
94
91
|
items: _options,
|
|
95
92
|
onClick: (e) => {
|
|
96
|
-
setHolderItem(item);
|
|
97
93
|
handleClick(e, item);
|
|
98
94
|
}
|
|
99
95
|
},
|
|
@@ -104,6 +100,11 @@ var Guest = () => {
|
|
|
104
100
|
);
|
|
105
101
|
};
|
|
106
102
|
const handleAddGuest = () => {
|
|
103
|
+
if (accountLists.length >= 6) {
|
|
104
|
+
return (0, import_materials.PisellToast)({
|
|
105
|
+
content: import_utils.locales.getText("pisell2.appointment.max.guest")
|
|
106
|
+
});
|
|
107
|
+
}
|
|
107
108
|
const guest = {
|
|
108
109
|
id: (0, import_utils.getUniqueId)(),
|
|
109
110
|
username: `Guest${accountLists.length + 1}`,
|
|
@@ -33,13 +33,35 @@ __export(Header_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Header_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
36
37
|
var import_progressBar = __toESM(require("../../../eventBooking/components/progressBar"));
|
|
37
38
|
var import_context = require("../../context");
|
|
38
39
|
var import_index = require("./index.less");
|
|
39
40
|
var Header = () => {
|
|
40
41
|
var _a, _b;
|
|
41
|
-
const { currentStep, appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
42
|
+
const { currentStep, appointmentBooking, resources } = (0, import_context.useAppointmentBookingContext)();
|
|
43
|
+
const stepName = (0, import_react.useMemo)(() => {
|
|
44
|
+
var _a2, _b2, _c, _d, _e;
|
|
45
|
+
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
46
|
+
if (key === "select-resource") {
|
|
47
|
+
const name = ((_d = (_c = (_b2 = resources == null ? void 0 : resources[0]) == null ? void 0 : _b2.resources) == null ? void 0 : _c[0]) == null ? void 0 : _d.title) || "";
|
|
48
|
+
return import_utils.locales.getText("pisell2.event.select.category")(name);
|
|
49
|
+
}
|
|
50
|
+
return (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.description;
|
|
51
|
+
}, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key, resources]);
|
|
42
52
|
const handleBack = () => {
|
|
53
|
+
var _a2;
|
|
54
|
+
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
55
|
+
const types = {
|
|
56
|
+
"select-time": "time",
|
|
57
|
+
"select-resource": "resource"
|
|
58
|
+
};
|
|
59
|
+
if (types[key]) {
|
|
60
|
+
appointmentBooking.deleteCartItemInfo(types[key]);
|
|
61
|
+
}
|
|
62
|
+
if (key === "select-date") {
|
|
63
|
+
appointmentBooking.clearDateRange();
|
|
64
|
+
}
|
|
43
65
|
appointmentBooking.back();
|
|
44
66
|
};
|
|
45
67
|
const handleClose = () => {
|
|
@@ -48,8 +70,8 @@ var Header = () => {
|
|
|
48
70
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
49
71
|
import_progressBar.default,
|
|
50
72
|
{
|
|
51
|
-
title: (
|
|
52
|
-
description:
|
|
73
|
+
title: (_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.title,
|
|
74
|
+
description: stepName,
|
|
53
75
|
showBack: (currentStep == null ? void 0 : currentStep.index) > 0,
|
|
54
76
|
onBack: () => handleBack(),
|
|
55
77
|
onClose: () => handleClose()
|
|
@@ -38,32 +38,32 @@ var import_resourceDisplay = __toESM(require("../../../eventBooking/components/r
|
|
|
38
38
|
var import_materials = require("@pisell/materials");
|
|
39
39
|
var import_hooks = require("../../hooks");
|
|
40
40
|
var import_context = require("../../context");
|
|
41
|
+
var import_guests = __toESM(require("../../assets/guests.svg"));
|
|
41
42
|
var import_utils = require("@pisell/utils");
|
|
42
43
|
var import_index = require("./index.less");
|
|
43
|
-
var Resource = (
|
|
44
|
+
var Resource = () => {
|
|
44
45
|
const [selectedResource, setSelectedResource] = (0, import_react.useState)(0);
|
|
45
46
|
const { appointmentBooking, resources, carts, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
|
|
46
|
-
const {
|
|
47
|
-
getResourceList,
|
|
48
|
-
getResourceTimeSlot,
|
|
49
|
-
autoSelectAllProductResources
|
|
50
|
-
} = (0, import_hooks.useAppointmentBookingResource)();
|
|
47
|
+
const { getResourceList, autoSelectAllProductResources } = (0, import_hooks.useAppointmentBookingResource)();
|
|
51
48
|
console.log(resources, carts, appointmentBooking, "lists, products");
|
|
52
49
|
(0, import_react.useEffect)(() => {
|
|
50
|
+
var _a, _b, _c;
|
|
53
51
|
const _resources = getResourceList();
|
|
54
|
-
|
|
52
|
+
const code = (_c = (_b = (_a = _resources == null ? void 0 : _resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[0]) == null ? void 0 : _c.code;
|
|
53
|
+
autoSelectAllProductResources(code);
|
|
55
54
|
}, []);
|
|
56
55
|
(0, import_react.useEffect)(() => {
|
|
57
56
|
var _a;
|
|
58
|
-
console.log(resourceOtherParams == null ? void 0 : resourceOtherParams.errorList, "errorListerrorListerrorList");
|
|
59
57
|
if (((_a = resourceOtherParams == null ? void 0 : resourceOtherParams.errorList) == null ? void 0 : _a.length) > 0) {
|
|
60
|
-
return
|
|
58
|
+
return (0, import_materials.PisellToast)({
|
|
59
|
+
content: import_utils.locales.getText("pisell2.appointment.no.available.time")
|
|
60
|
+
});
|
|
61
61
|
}
|
|
62
62
|
}, [resourceOtherParams == null ? void 0 : resourceOtherParams.errorList]);
|
|
63
63
|
const anyResource = [
|
|
64
64
|
{
|
|
65
65
|
id: 0,
|
|
66
|
-
image:
|
|
66
|
+
image: import_guests.default,
|
|
67
67
|
title: "Any professional",
|
|
68
68
|
subtitle: "for maximum availability"
|
|
69
69
|
}
|
|
@@ -71,7 +71,6 @@ var Resource = ({ onChange }) => {
|
|
|
71
71
|
const currentResource = (0, import_react.useMemo)(() => {
|
|
72
72
|
var _a, _b;
|
|
73
73
|
if (resources.length && carts.length) {
|
|
74
|
-
console.log(resources, carts, "lists, products");
|
|
75
74
|
if (carts.length === 1) {
|
|
76
75
|
return (_b = (_a = resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[0];
|
|
77
76
|
} else {
|
|
@@ -88,12 +87,11 @@ var Resource = ({ onChange }) => {
|
|
|
88
87
|
const onClick = (e) => {
|
|
89
88
|
var _a;
|
|
90
89
|
setSelectedResource(e.id);
|
|
91
|
-
console.log(currentResource, e, "whcurrentResourcecurrentResource");
|
|
90
|
+
console.log(currentResource, e, carts, "whcurrentResourcecurrentResource");
|
|
92
91
|
if (e.id) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
resources:
|
|
96
|
-
currentResourceId: e.id
|
|
92
|
+
return appointmentBooking.updateCart({
|
|
93
|
+
_id: (_a = carts == null ? void 0 : carts[0]) == null ? void 0 : _a._id,
|
|
94
|
+
resources: [e]
|
|
97
95
|
});
|
|
98
96
|
}
|
|
99
97
|
};
|
|
@@ -111,7 +109,8 @@ var Resource = ({ onChange }) => {
|
|
|
111
109
|
dataSource: item,
|
|
112
110
|
direction: "vertical",
|
|
113
111
|
children: !(item == null ? void 0 : item.image) ? (_a = item == null ? void 0 : item.title) == null ? void 0 : _a.charAt(0).toUpperCase() : null,
|
|
114
|
-
selected: selectedResource === (item == null ? void 0 : item.id)
|
|
112
|
+
selected: selectedResource === (item == null ? void 0 : item.id),
|
|
113
|
+
className: !item.id ? "appointment-resource-guest-card" : ""
|
|
115
114
|
}
|
|
116
115
|
);
|
|
117
116
|
},
|
|
@@ -33,22 +33,36 @@ __export(Services_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Services_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
36
37
|
var import_SearchLg = __toESM(require("@pisell/icon/es/SearchLg"));
|
|
37
38
|
var import_utils = require("@pisell/utils");
|
|
38
39
|
var import_materials = require("@pisell/materials");
|
|
39
|
-
var import_antd = require("antd");
|
|
40
40
|
var import_TabProduct = __toESM(require("../../../booking/components/TabProduct"));
|
|
41
41
|
var import_utils2 = require("../../../booking/utils");
|
|
42
42
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
43
43
|
var import_context = require("../../context");
|
|
44
|
+
var import_hooks = require("../../hooks");
|
|
45
|
+
var import_utils3 = require("../../utils");
|
|
44
46
|
var import_index = require("./index.less");
|
|
45
47
|
var Services = () => {
|
|
46
48
|
const searchRef = (0, import_react.useRef)();
|
|
47
49
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
48
50
|
const context = (0, import_useEngineContext.default)();
|
|
49
51
|
const { utils } = context.appHelper || {};
|
|
50
|
-
const
|
|
52
|
+
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
53
|
+
const { products, setProducts } = (0, import_context.useAppointmentBookingContext)();
|
|
54
|
+
const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
55
|
+
const accountRef = (0, import_react.useRef)(accountLists);
|
|
56
|
+
const currentUser = (0, import_utils3.formatCurrentUser)();
|
|
51
57
|
(0, import_react.useEffect)(() => {
|
|
58
|
+
console.log(accountLists, accountRef, "wh978896786");
|
|
59
|
+
}, [accountLists, accountRef]);
|
|
60
|
+
(0, import_react.useEffect)(() => {
|
|
61
|
+
var _a;
|
|
62
|
+
console.log(accountRef.current, currentUser, "accountRef");
|
|
63
|
+
if (!((_a = accountRef.current) == null ? void 0 : _a.length) && currentUser) {
|
|
64
|
+
appointmentBooking.addAccount([currentUser]);
|
|
65
|
+
}
|
|
52
66
|
const { productModuleParams } = appointmentBooking.otherParams || {};
|
|
53
67
|
appointmentBooking.loadProducts(productModuleParams).then((res) => {
|
|
54
68
|
setProducts(res || []);
|
|
@@ -65,6 +79,11 @@ var Services = () => {
|
|
|
65
79
|
const resources = ((_b = (_a = data == null ? void 0 : data.origin) == null ? void 0 : _a.product_resource) == null ? void 0 : _b.resources) || [];
|
|
66
80
|
const activeStatus = resources.find((item2) => item2.status === 1);
|
|
67
81
|
if (!activeStatus) {
|
|
82
|
+
return (0, import_materials.PisellToast)({
|
|
83
|
+
content: import_utils.locales.getText(
|
|
84
|
+
"pisell2.appointment.no.available.service"
|
|
85
|
+
)
|
|
86
|
+
});
|
|
68
87
|
}
|
|
69
88
|
const product = {
|
|
70
89
|
...data,
|
|
@@ -34,34 +34,31 @@ __export(TimeSlicing_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(TimeSlicing_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
37
38
|
var import_context = require("../../context");
|
|
38
39
|
var import_index = require("./index.less");
|
|
39
40
|
var Resource = ({ params }) => {
|
|
40
41
|
const [selectedResource, setSelectedResource] = (0, import_react.useState)("");
|
|
41
|
-
const { times, resources, appointmentBooking, carts } = (0, import_context.useAppointmentBookingContext)();
|
|
42
|
+
const { times, resources, appointmentBooking, carts, setSelectedTime } = (0, import_context.useAppointmentBookingContext)();
|
|
42
43
|
console.log(params, resources, times, "wh8765");
|
|
44
|
+
const getAutoSelect = async (val) => {
|
|
45
|
+
setSelectedTime(val);
|
|
46
|
+
const { errorList } = await appointmentBooking.autoSelectAllProductResources("sites", val);
|
|
47
|
+
const result = await appointmentBooking.submitTimeSlot(val);
|
|
48
|
+
console.log(errorList, result, "wh9896788");
|
|
49
|
+
};
|
|
50
|
+
(0, import_react.useEffect)(() => {
|
|
51
|
+
var _a;
|
|
52
|
+
if ((times == null ? void 0 : times.length) > 0) {
|
|
53
|
+
setSelectedResource((_a = times == null ? void 0 : times[0]) == null ? void 0 : _a.start_time);
|
|
54
|
+
getAutoSelect(times == null ? void 0 : times[0]);
|
|
55
|
+
}
|
|
56
|
+
}, [times]);
|
|
43
57
|
const onClick = async (e) => {
|
|
44
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
45
58
|
setSelectedResource(e == null ? void 0 : e.start_time);
|
|
46
|
-
|
|
47
|
-
resourceProductData: resources == null ? void 0 : resources[0],
|
|
48
|
-
resources: (_c = (_b = (_a = resources == null ? void 0 : resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[1]) == null ? void 0 : _c.renderList,
|
|
49
|
-
timeSlots: e
|
|
50
|
-
});
|
|
51
|
-
if (data) {
|
|
52
|
-
const _resources = [
|
|
53
|
-
(_g = (_f = (_e = (_d = resources == null ? void 0 : resources[0]) == null ? void 0 : _d.resources) == null ? void 0 : _e[0]) == null ? void 0 : _f.renderList) == null ? void 0 : _g[0],
|
|
54
|
-
(_k = (_j = (_i = (_h = resources == null ? void 0 : resources[0]) == null ? void 0 : _h.resources) == null ? void 0 : _i[1]) == null ? void 0 : _j.renderList) == null ? void 0 : _k[0]
|
|
55
|
-
];
|
|
56
|
-
const aa = await appointmentBooking.submitTimeSlot({
|
|
57
|
-
resourceProductData: resources == null ? void 0 : resources[0],
|
|
58
|
-
selectedResources: _resources,
|
|
59
|
-
timeSlots: e
|
|
60
|
-
});
|
|
61
|
-
console.log(data, _resources, aa, "wh9879676");
|
|
62
|
-
}
|
|
59
|
+
getAutoSelect(e);
|
|
63
60
|
};
|
|
64
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
|
|
61
|
+
return (times == null ? void 0 : times.length) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
|
|
65
62
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
66
63
|
"div",
|
|
67
64
|
{
|
|
@@ -72,6 +69,11 @@ var Resource = ({ params }) => {
|
|
|
72
69
|
/* @__PURE__ */ import_react.default.createElement("span", null, item == null ? void 0 : item.start_time),
|
|
73
70
|
/* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-chevron-right", className: `icon` })
|
|
74
71
|
);
|
|
75
|
-
}))
|
|
72
|
+
})) : /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
import_materials.PisellEmpty,
|
|
74
|
+
{
|
|
75
|
+
description: import_utils.locales.getText("pisell2.appointment.booking.empty.time")
|
|
76
|
+
}
|
|
77
|
+
);
|
|
76
78
|
};
|
|
77
79
|
var TimeSlicing_default = Resource;
|