@pisell/private-materials 3.3.21 → 3.3.22
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/components/appointmentBooking/components/Cart/Item/index.js +19 -7
- package/es/components/appointmentBooking/components/ConfirmInformation/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +2 -1
- package/es/components/appointmentBooking/components/Content/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Content/index.js +0 -1
- package/es/components/appointmentBooking/components/Date/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Date/index.js +1 -5
- package/es/components/appointmentBooking/components/Form/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Form/index.js +4 -3
- package/es/components/appointmentBooking/components/Guest/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Resource/index.d.ts +7 -0
- package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Services/index.js +21 -11
- package/es/components/appointmentBooking/components/TimeSlicing/index.d.ts +4 -0
- package/es/components/appointmentBooking/context.d.ts +35 -0
- package/es/components/appointmentBooking/hooks.d.ts +106 -0
- package/es/components/appointmentBooking/hooks.js +12 -18
- package/es/components/appointmentBooking/index.js +3 -5
- package/es/components/appointmentBooking/utils.d.ts +114 -0
- package/es/components/appointmentBooking/utils.js +15 -15
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +4 -2
- package/es/components/booking/deposit/index.d.ts +2 -0
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/notes/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.js +14 -16
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +1 -0
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.js +14 -15
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/materiels/duration/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +12 -9
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +7 -1
- package/lib/components/appointmentBooking/components/Content/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Content/index.js +1 -1
- package/lib/components/appointmentBooking/components/Date/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Date/index.js +1 -1
- package/lib/components/appointmentBooking/components/Form/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Form/index.js +3 -2
- package/lib/components/appointmentBooking/components/Guest/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +7 -0
- package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Services/index.js +8 -1
- package/lib/components/appointmentBooking/components/TimeSlicing/index.d.ts +4 -0
- package/lib/components/appointmentBooking/context.d.ts +35 -0
- package/lib/components/appointmentBooking/hooks.d.ts +106 -0
- package/lib/components/appointmentBooking/hooks.js +2 -6
- package/lib/components/appointmentBooking/index.js +2 -2
- package/lib/components/appointmentBooking/utils.d.ts +114 -0
- package/lib/components/appointmentBooking/utils.js +14 -23
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +4 -2
- package/lib/components/booking/deposit/index.d.ts +2 -0
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/notes/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.js +14 -14
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +1 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.js +15 -13
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/materiels/duration/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +1 -0
- package/package.json +3 -3
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -3
- package/es/components/booking/components/customSelect/index.d.ts +0 -38
- package/es/components/booking/forms/footer.d.ts +0 -6
- package/es/components/booking/forms/sendModal/index.d.ts +0 -27
- package/es/components/booking/info/clientVariant/utils.d.ts +0 -1
- package/es/components/booking/info2/utils.d.ts +0 -4
- package/es/components/booking/locales.d.ts +0 -807
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -3
- package/es/components/eftposPay/component/fail/index.d.ts +0 -3
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -10
- package/es/components/eftposPay/hooks.d.ts +0 -35
- package/es/components/eftposPay/index.d.ts +0 -4
- package/es/components/eftposPay/locales.d.ts +0 -330
- package/es/components/eftposPay/pay.d.ts +0 -20
- package/es/components/eftposPay/tyro/index.d.ts +0 -9
- package/es/components/eftposPay/windcave/helper.d.ts +0 -23
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -3
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/serve.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/serve.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/serve.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/serve.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/StripePay/serve.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/serve.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/serve.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -111
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +0 -3
- package/es/components/pay/toC/index.d.ts +0 -3
- package/es/components/pay/toC/utils.d.ts +0 -49
- package/es/components/ruleSetting/index.d.ts +0 -9
- package/es/components/ruleSetting/server.d.ts +0 -4
- package/es/components/shoppingCart/Provider.d.ts +0 -3
- package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -3
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -2
- package/es/components/workSpaceList/components/AppearanceEdit/IconPanel.d.ts +0 -11
- package/es/components/workSpaceList/components/AppearanceEdit/constants.d.ts +0 -8
- package/es/components/workSpaceList/components/Card/constants.d.ts +0 -2
- package/es/components/workSpaceList/components/EditableString/index.d.ts +0 -21
- package/es/components/workSpaceList/components/SearchBar/index.d.ts +0 -17
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -3
- package/es/components/workSpaceList/components/Sort/index.d.ts +0 -7
- package/es/components/workSpaceList/components/WorkspaceItem/index.d.ts +0 -22
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -3
- package/lib/components/booking/components/customSelect/index.d.ts +0 -38
- package/lib/components/booking/forms/footer.d.ts +0 -6
- package/lib/components/booking/forms/sendModal/index.d.ts +0 -27
- package/lib/components/booking/info/clientVariant/utils.d.ts +0 -1
- package/lib/components/booking/info2/utils.d.ts +0 -4
- package/lib/components/booking/locales.d.ts +0 -807
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -3
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -3
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -10
- package/lib/components/eftposPay/hooks.d.ts +0 -35
- package/lib/components/eftposPay/index.d.ts +0 -4
- package/lib/components/eftposPay/locales.d.ts +0 -330
- package/lib/components/eftposPay/pay.d.ts +0 -20
- package/lib/components/eftposPay/tyro/index.d.ts +0 -9
- package/lib/components/eftposPay/windcave/helper.d.ts +0 -23
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -3
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/serve.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/serve.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/serve.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/serve.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/StripePay/serve.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/serve.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/serve.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -111
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +0 -3
- package/lib/components/pay/toC/index.d.ts +0 -3
- package/lib/components/pay/toC/utils.d.ts +0 -49
- package/lib/components/ruleSetting/index.d.ts +0 -9
- package/lib/components/ruleSetting/server.d.ts +0 -4
- package/lib/components/shoppingCart/Provider.d.ts +0 -3
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -3
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -2
- package/lib/components/workSpaceList/components/AppearanceEdit/IconPanel.d.ts +0 -11
- package/lib/components/workSpaceList/components/AppearanceEdit/constants.d.ts +0 -8
- package/lib/components/workSpaceList/components/Card/constants.d.ts +0 -2
- package/lib/components/workSpaceList/components/EditableString/index.d.ts +0 -21
- package/lib/components/workSpaceList/components/SearchBar/index.d.ts +0 -17
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -3
- package/lib/components/workSpaceList/components/Sort/index.d.ts +0 -7
- package/lib/components/workSpaceList/components/WorkspaceItem/index.d.ts +0 -22
|
@@ -12,8 +12,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
12
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
13
|
import { getUniqueId, locales } from "@pisell/utils";
|
|
14
14
|
import { PisellToast } from '@pisell/materials';
|
|
15
|
-
import useEngineContext from "../../hooks/useEngineContext";
|
|
16
|
-
|
|
17
15
|
/**
|
|
18
16
|
* @title: 格式化holder表数据
|
|
19
17
|
* @description:
|
|
@@ -102,11 +100,10 @@ export var formatCartsResources = function formatCartsResources(carts, resources
|
|
|
102
100
|
* @Author: WangHan
|
|
103
101
|
* @Date: 2025-05-07 21:22
|
|
104
102
|
*/
|
|
105
|
-
export var formatCarts = function formatCarts(data, resources, accountLists) {
|
|
103
|
+
export var formatCarts = function formatCarts(data, resources, utils, accountLists) {
|
|
106
104
|
try {
|
|
107
105
|
var _utils$storage;
|
|
108
|
-
|
|
109
|
-
var utils = context.appHelper.utils || {};
|
|
106
|
+
if (!utils || !(data !== null && data !== void 0 && data.length)) return [];
|
|
110
107
|
var locale = (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || 'en-US';
|
|
111
108
|
var symbol = (utils === null || utils === void 0 ? void 0 : utils.getSymbolic()) || '$';
|
|
112
109
|
var newCarts = data === null || data === void 0 ? void 0 : data.map(function (d) {
|
|
@@ -182,14 +179,17 @@ export var getMeAccount = function getMeAccount(val) {
|
|
|
182
179
|
return !(d !== null && d !== void 0 && d.isGuest);
|
|
183
180
|
});
|
|
184
181
|
};
|
|
185
|
-
export var getCustomer = function getCustomer() {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
182
|
+
export var getCustomer = function getCustomer(utils) {
|
|
183
|
+
try {
|
|
184
|
+
var _utils$getStore$getSt, _userInfo;
|
|
185
|
+
if (!utils) return;
|
|
186
|
+
var userInfo = (_utils$getStore$getSt = utils.getStore().getState()) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.global) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.userInfo;
|
|
187
|
+
var localUserInfo = JSON.parse(utils.storage.get('customer') || '{}');
|
|
188
|
+
userInfo = (_userInfo = userInfo) !== null && _userInfo !== void 0 && _userInfo.id ? userInfo : localUserInfo;
|
|
189
|
+
return userInfo;
|
|
190
|
+
} catch (error) {
|
|
191
|
+
console.log("getCustomer ".concat(error));
|
|
192
|
+
}
|
|
193
193
|
};
|
|
194
194
|
export var formatCustomer = function formatCustomer(val) {
|
|
195
195
|
var currentUserName = "".concat((val === null || val === void 0 ? void 0 : val.first_name) || '').concat(val !== null && val !== void 0 && val.last_name ? " ".concat(val === null || val === void 0 ? void 0 : val.last_name) : '');
|
|
@@ -199,8 +199,8 @@ export var formatCustomer = function formatCustomer(val) {
|
|
|
199
199
|
username: currentUserName
|
|
200
200
|
};
|
|
201
201
|
};
|
|
202
|
-
export var formatCurrentUser = function formatCurrentUser() {
|
|
203
|
-
var userInfo = getCustomer();
|
|
202
|
+
export var formatCurrentUser = function formatCurrentUser(utils) {
|
|
203
|
+
var userInfo = getCustomer(utils);
|
|
204
204
|
var customer = formatCustomer(userInfo);
|
|
205
205
|
return customer;
|
|
206
206
|
};
|
|
@@ -39,7 +39,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
39
39
|
var context = useEngineContext();
|
|
40
40
|
var state = props.state,
|
|
41
41
|
dispatch = props.dispatch;
|
|
42
|
-
var _useState = useState(
|
|
42
|
+
var _useState = useState(false),
|
|
43
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
44
44
|
showDetail = _useState2[0],
|
|
45
45
|
setShowDetail = _useState2[1];
|
|
@@ -169,10 +169,12 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
169
169
|
val = _context.sent;
|
|
170
170
|
console.log(val);
|
|
171
171
|
if (val !== null && val !== void 0 && val.isAvailable) {
|
|
172
|
+
productRef.current = val.productList;
|
|
172
173
|
dispatch({
|
|
173
174
|
type: 'setService',
|
|
174
175
|
payload: {
|
|
175
|
-
value: val.productList
|
|
176
|
+
value: val.productList,
|
|
177
|
+
edit: true
|
|
176
178
|
}
|
|
177
179
|
});
|
|
178
180
|
setCode('');
|
|
@@ -251,7 +251,7 @@ var Info = function Info(props) {
|
|
|
251
251
|
dayParams.customer_id = customerId;
|
|
252
252
|
}
|
|
253
253
|
_context2.next = 9;
|
|
254
|
-
return state.apis.getServices(_objectSpread(
|
|
254
|
+
return state.apis.getServices(_objectSpread({
|
|
255
255
|
skip: 1,
|
|
256
256
|
num: 500,
|
|
257
257
|
extension_type: state.renderType === 'eventBooking' ? undefined : ['product_appointment', 'appointment_ticket', 'session_product', 'session_ticket'],
|
|
@@ -261,14 +261,9 @@ var Info = function Info(props) {
|
|
|
261
261
|
with_schedule: 1,
|
|
262
262
|
with_count: ['bundleGroup', 'optionGroup'],
|
|
263
263
|
order_by_string: 'sort:desc',
|
|
264
|
-
status: 'published'
|
|
265
|
-
}, state.isBookingCreatePage ? {
|
|
264
|
+
status: 'published',
|
|
266
265
|
schedule_date: params === null || params === void 0 ? void 0 : params.schedule_date
|
|
267
|
-
}
|
|
268
|
-
_config: {
|
|
269
|
-
useCache: true
|
|
270
|
-
}
|
|
271
|
-
}), dayParams));
|
|
266
|
+
}, dayParams));
|
|
272
267
|
case 9:
|
|
273
268
|
data = _context2.sent;
|
|
274
269
|
setLoading(false);
|
|
@@ -408,16 +403,17 @@ var Info = function Info(props) {
|
|
|
408
403
|
var showAddButton = useMemo(function () {
|
|
409
404
|
return !state.disabledEdit && !state.channelDisabledEdit;
|
|
410
405
|
}, [state.disabledEdit, state.channelDisabledEdit]);
|
|
406
|
+
var currentDate = useMemo(function () {
|
|
407
|
+
return state.date.value.format('YYYY-MM-DD');
|
|
408
|
+
}, [state.date.value]);
|
|
411
409
|
useUpdateEffect(function () {
|
|
412
410
|
if (state.service.addModal) {
|
|
413
|
-
getServices(
|
|
411
|
+
getServices({
|
|
412
|
+
schedule_date: currentDate
|
|
413
|
+
});
|
|
414
414
|
setSearch('');
|
|
415
415
|
}
|
|
416
|
-
}, [state.service.addModal]);
|
|
417
|
-
var currentDate = useMemo(function () {
|
|
418
|
-
return state.date.value.format('YYYY-MM-DD');
|
|
419
|
-
}, [state.date.value]);
|
|
420
|
-
console.log(currentDate, 'currentDate');
|
|
416
|
+
}, [state.service.addModal, currentDate]);
|
|
421
417
|
useEffect(function () {
|
|
422
418
|
if (renderMode === 'current') {
|
|
423
419
|
getServices({
|
|
@@ -427,9 +423,11 @@ var Info = function Info(props) {
|
|
|
427
423
|
}, [renderMode, currentDate]);
|
|
428
424
|
useEffect(function () {
|
|
429
425
|
if (state.renderType === 'eventBooking' && state.modalOpen) {
|
|
430
|
-
getServices(
|
|
426
|
+
getServices({
|
|
427
|
+
schedule_date: currentDate
|
|
428
|
+
});
|
|
431
429
|
}
|
|
432
|
-
}, [state.renderType, state.modalOpen]);
|
|
430
|
+
}, [state.renderType, state.modalOpen, currentDate]);
|
|
433
431
|
var addButton = useMemo(function () {
|
|
434
432
|
// 跨日预约不显示添加服务按钮
|
|
435
433
|
if (isDay) {
|
|
@@ -240,4 +240,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
240
240
|
* @Author: WangHan
|
|
241
241
|
* @Date: 2024-12-24 11:32
|
|
242
242
|
*/
|
|
243
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
|
243
|
+
export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
|
|
@@ -348,6 +348,7 @@ export var updateServices = function updateServices(state, currentItem, type, ot
|
|
|
348
348
|
// 更新holder
|
|
349
349
|
if (type === 'change_holder') {
|
|
350
350
|
products = handleChangeHolder(products, currentItem, other);
|
|
351
|
+
return products;
|
|
351
352
|
}
|
|
352
353
|
if (type === 'add_holder') {
|
|
353
354
|
var _actions$handleAddHol;
|
|
@@ -171,7 +171,7 @@ var Info = function Info(props) {
|
|
|
171
171
|
return _context2.abrupt("return");
|
|
172
172
|
case 5:
|
|
173
173
|
_context2.next = 7;
|
|
174
|
-
return state.apis.getServices(
|
|
174
|
+
return state.apis.getServices({
|
|
175
175
|
skip: 1,
|
|
176
176
|
num: 500,
|
|
177
177
|
extension_type: state.renderType === 'eventBooking' ? undefined : ['product_appointment', 'appointment_ticket', 'service_product', 'session_product', 'session_ticket'],
|
|
@@ -181,14 +181,9 @@ var Info = function Info(props) {
|
|
|
181
181
|
with_schedule: 1,
|
|
182
182
|
with_count: ['bundleGroup', 'optionGroup'],
|
|
183
183
|
order_by_string: 'sort:desc',
|
|
184
|
-
status: 'published'
|
|
185
|
-
}, state.isBookingCreatePage ? {
|
|
184
|
+
status: 'published',
|
|
186
185
|
schedule_date: params === null || params === void 0 ? void 0 : params.schedule_date
|
|
187
|
-
}
|
|
188
|
-
_config: {
|
|
189
|
-
useCache: true
|
|
190
|
-
}
|
|
191
|
-
}));
|
|
186
|
+
});
|
|
192
187
|
case 7:
|
|
193
188
|
data = _context2.sent;
|
|
194
189
|
setLoading(false);
|
|
@@ -354,15 +349,17 @@ var Info = function Info(props) {
|
|
|
354
349
|
var showAddButton = useMemo(function () {
|
|
355
350
|
return !state.disabledEdit && !state.channelDisabledEdit;
|
|
356
351
|
}, [state.disabledEdit, state.channelDisabledEdit]);
|
|
352
|
+
var currentDate = useMemo(function () {
|
|
353
|
+
return state.date.value.format('YYYY-MM-DD');
|
|
354
|
+
}, [state.date.value]);
|
|
357
355
|
useUpdateEffect(function () {
|
|
358
356
|
if (state.service.addModal) {
|
|
359
|
-
getServices(
|
|
357
|
+
getServices({
|
|
358
|
+
schedule_date: currentDate
|
|
359
|
+
});
|
|
360
360
|
setSearch('');
|
|
361
361
|
}
|
|
362
|
-
}, [state.service.addModal]);
|
|
363
|
-
var currentDate = useMemo(function () {
|
|
364
|
-
return state.date.value.format('YYYY-MM-DD');
|
|
365
|
-
}, [state.date.value]);
|
|
362
|
+
}, [state.service.addModal, currentDate]);
|
|
366
363
|
useEffect(function () {
|
|
367
364
|
if (renderMode === 'current') {
|
|
368
365
|
getServices({
|
|
@@ -372,9 +369,11 @@ var Info = function Info(props) {
|
|
|
372
369
|
}, [renderMode, currentDate]);
|
|
373
370
|
useEffect(function () {
|
|
374
371
|
if (state.renderType === 'eventBooking' && state.modalOpen) {
|
|
375
|
-
getServices(
|
|
372
|
+
getServices({
|
|
373
|
+
schedule_date: currentDate
|
|
374
|
+
});
|
|
376
375
|
}
|
|
377
|
-
}, [state.renderType, state.modalOpen]);
|
|
376
|
+
}, [state.renderType, state.modalOpen, currentDate]);
|
|
378
377
|
var addButton = useMemo(function () {
|
|
379
378
|
if (state.isBookingCreatePage) {
|
|
380
379
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -163,10 +163,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
163
163
|
export declare const getDuration: (duration: number | {
|
|
164
164
|
type: string;
|
|
165
165
|
value: number;
|
|
166
|
-
}) => number | {
|
|
166
|
+
}) => number | "flexible" | {
|
|
167
167
|
type: string;
|
|
168
168
|
value: number;
|
|
169
|
-
}
|
|
169
|
+
};
|
|
170
170
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
171
171
|
export declare const getIsEdit: (state: any) => boolean;
|
|
172
172
|
export {};
|
|
@@ -76,6 +76,7 @@ var TimeBar = function TimeBar(props) {
|
|
|
76
76
|
flexShrink: 0
|
|
77
77
|
}
|
|
78
78
|
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
79
|
+
inputReadOnly: true,
|
|
79
80
|
value: state === null || state === void 0 || (_state$modalState4 = state.modalState) === null || _state$modalState4 === void 0 || (_state$modalState4 = _state$modalState4.date) === null || _state$modalState4 === void 0 ? void 0 : _state$modalState4.value,
|
|
80
81
|
format: locale === 'en' ? 'dddd, DD MMM YYYY' : 'YYYY年MM月DD日',
|
|
81
82
|
onChange: props === null || props === void 0 ? void 0 : props.onDateChange,
|
|
@@ -43,11 +43,10 @@ var import_utils2 = require("../../../utils");
|
|
|
43
43
|
var import_Voucher = __toESM(require("../../Voucher"));
|
|
44
44
|
var import_Total = __toESM(require("./Total"));
|
|
45
45
|
var import_Deposit = __toESM(require("../../Deposit"));
|
|
46
|
-
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
47
46
|
var import_utils3 = require("../utils");
|
|
48
47
|
var import_index = require("./index.less");
|
|
49
48
|
var CartItem = ({ onNext }) => {
|
|
50
|
-
var _a, _b, _c
|
|
49
|
+
var _a, _b, _c;
|
|
51
50
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
52
51
|
const {
|
|
53
52
|
carts,
|
|
@@ -62,11 +61,12 @@ var CartItem = ({ onNext }) => {
|
|
|
62
61
|
const { getResourceList } = (0, import_hooks2.useAppointmentBookingResource)();
|
|
63
62
|
const { isFormSubject, bookingSubject } = (0, import_hooks2.useAppointmentBookingSetting)();
|
|
64
63
|
const { isLogin } = (0, import_hooks2.useAppointmentBookingLogin)();
|
|
65
|
-
const
|
|
66
|
-
const utils = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
64
|
+
const utils = (0, import_hooks2.contextUtils)();
|
|
67
65
|
const { businessUtils } = utils;
|
|
68
|
-
const currentUser = (0, import_utils2.formatCurrentUser)();
|
|
69
66
|
const { deposit } = summary;
|
|
67
|
+
const currentUser = (0, import_react.useMemo)(() => {
|
|
68
|
+
return (0, import_utils2.formatCurrentUser)(utils) || {};
|
|
69
|
+
}, []);
|
|
70
70
|
const holderIds = (0, import_react.useMemo)(() => {
|
|
71
71
|
if (isFormSubject) return [];
|
|
72
72
|
return accountLists.map((item) => item.id);
|
|
@@ -75,7 +75,7 @@ var CartItem = ({ onNext }) => {
|
|
|
75
75
|
if (isFormSubject) return [];
|
|
76
76
|
return (0, import_utils2.formatHolder)(accountLists);
|
|
77
77
|
}, [accountLists, isFormSubject]);
|
|
78
|
-
const hasGoodPassApp = !!((
|
|
78
|
+
const hasGoodPassApp = !!((_a = businessUtils == null ? void 0 : businessUtils.getAppByModal) == null ? void 0 : _a.call(businessUtils, "goodpass"));
|
|
79
79
|
const handleClickCard = (e, type, val) => {
|
|
80
80
|
console.log(e, type, val, "handleClickCard");
|
|
81
81
|
if (type === "note") {
|
|
@@ -149,6 +149,9 @@ var CartItem = ({ onNext }) => {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
|
+
const products = (0, import_react.useMemo)(() => {
|
|
153
|
+
return (0, import_utils2.formatCarts)(carts, resources, utils, accountLists);
|
|
154
|
+
}, [carts, resources, accountLists]);
|
|
152
155
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
153
156
|
"div",
|
|
154
157
|
{
|
|
@@ -158,12 +161,12 @@ var CartItem = ({ onNext }) => {
|
|
|
158
161
|
import_shoppingCart.default,
|
|
159
162
|
{
|
|
160
163
|
productParams: {
|
|
161
|
-
products
|
|
164
|
+
products,
|
|
162
165
|
hideAddBtn: false,
|
|
163
166
|
holders,
|
|
164
167
|
disabledEdit: isLastStep,
|
|
165
|
-
isShowChangeResource: ((
|
|
166
|
-
isShowDelete: ((
|
|
168
|
+
isShowChangeResource: ((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key) === "select-resource",
|
|
169
|
+
isShowDelete: ((_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key) === "select-service",
|
|
167
170
|
isShowPackageNote: false,
|
|
168
171
|
isShowChangeHolder: isLastStep ? false : isFormSubject && isLogin,
|
|
169
172
|
isShowHolder: isFormSubject,
|
|
@@ -104,6 +104,12 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
104
104
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
105
105
|
next: handleNext
|
|
106
106
|
}));
|
|
107
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleNext }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
|
|
107
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleNext }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
|
|
108
|
+
"img",
|
|
109
|
+
{
|
|
110
|
+
src: `${config == null ? void 0 : config.awsStatic}/checkout_confirm.png`,
|
|
111
|
+
loading: "lazy"
|
|
112
|
+
}
|
|
113
|
+
)), /* @__PURE__ */ import_react.default.createElement("span", { className: "tips" }, import_utils.locales.getText("pisell2.appointment.tips")), /* @__PURE__ */ import_react.default.createElement("span", { className: "tips-content" }, import_utils.locales.getText("pisell2.appointment.tips.content"))));
|
|
108
114
|
});
|
|
109
115
|
var ConfirmInformation_default = ConfirmInformation;
|
|
@@ -62,7 +62,7 @@ var Layout = () => {
|
|
|
62
62
|
policyParams,
|
|
63
63
|
closePolicy
|
|
64
64
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
65
|
-
const {
|
|
65
|
+
const { isDateSelectedFirst, isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
66
66
|
const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
67
67
|
const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
68
68
|
const { removeStep, stepList } = (0, import_hooks.useAppointmentBookingStep)();
|
|
@@ -53,7 +53,7 @@ var Date = (0, import_react.forwardRef)((props, ref) => {
|
|
|
53
53
|
const [dateMonthList, setDateMonthList] = (0, import_react.useState)([]);
|
|
54
54
|
const [currentMonth, setCurrentMonth] = (0, import_react.useState)();
|
|
55
55
|
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
56
|
-
const { isDateSelectedFirst, customPageId,
|
|
56
|
+
const { isDateSelectedFirst, customPageId, channel } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
57
57
|
const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
58
58
|
const context = (0, import_useEngineContext.default)();
|
|
59
59
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
@@ -51,6 +51,7 @@ var Form = (0, import_react.forwardRef)((props, ref) => {
|
|
|
51
51
|
const { getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
|
|
52
52
|
const { setOtherData, getOtherData } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
53
53
|
const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
54
|
+
const utils = (0, import_hooks.contextUtils)();
|
|
54
55
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
55
56
|
next: () => {
|
|
56
57
|
var _a, _b;
|
|
@@ -64,11 +65,11 @@ var Form = (0, import_react.forwardRef)((props, ref) => {
|
|
|
64
65
|
const _resource = getResourceList();
|
|
65
66
|
return (_resource == null ? void 0 : _resource.resources) || [];
|
|
66
67
|
}, []);
|
|
67
|
-
const newCarts = (0, import_utils.formatCarts)(carts, resources);
|
|
68
68
|
const forms = (0, import_react.useMemo)(() => {
|
|
69
|
+
const newCarts = (0, import_utils.formatCarts)(carts, resources, utils);
|
|
69
70
|
if (!(newCarts == null ? void 0 : newCarts.length) || !(resources == null ? void 0 : resources.length)) return [];
|
|
70
71
|
return (0, import_utils.formatForms)(newCarts) || [];
|
|
71
|
-
}, [
|
|
72
|
+
}, [carts, resources]);
|
|
72
73
|
(0, import_react.useEffect)(() => {
|
|
73
74
|
var _a;
|
|
74
75
|
if (!(forms == null ? void 0 : forms.length)) return;
|
|
@@ -78,12 +78,19 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
78
78
|
},
|
|
79
79
|
callback: async (data) => {
|
|
80
80
|
var _a, _b;
|
|
81
|
+
if (data == null ? void 0 : data.isCancel) {
|
|
82
|
+
if (type === "session") {
|
|
83
|
+
appointmentBooking.closeProductDetail();
|
|
84
|
+
appointmentBooking.getAvailableDate();
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const session = data == null ? void 0 : data.session;
|
|
81
89
|
const product = {
|
|
82
90
|
...data,
|
|
83
91
|
options: (data == null ? void 0 : data.option) || []
|
|
84
92
|
};
|
|
85
93
|
delete product.option;
|
|
86
|
-
const session = data == null ? void 0 : data.session;
|
|
87
94
|
if (session) {
|
|
88
95
|
const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
|
|
89
96
|
const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TasksManager } from '../../utils/tasks';
|
|
3
|
+
interface AppointmentBookingContextType {
|
|
4
|
+
appointmentBooking: any;
|
|
5
|
+
times: any[];
|
|
6
|
+
resources: any[];
|
|
7
|
+
setTimes: (times: any[]) => void;
|
|
8
|
+
setResources: (lists: any[]) => void;
|
|
9
|
+
carts: any[];
|
|
10
|
+
summary: any;
|
|
11
|
+
setCarts: (val: any[]) => void;
|
|
12
|
+
setSummary: (val: any) => void;
|
|
13
|
+
currentStep: any;
|
|
14
|
+
setCurrentStep: (val: any) => void;
|
|
15
|
+
appHelper?: any;
|
|
16
|
+
symbolic?: any;
|
|
17
|
+
resourceOtherParams?: any;
|
|
18
|
+
setResourceOtherParams: (val: any) => void;
|
|
19
|
+
selectedTime: any;
|
|
20
|
+
setSelectedTime: (val: any) => void;
|
|
21
|
+
isAgreeDepositPolicy: boolean;
|
|
22
|
+
setIsAgreeDepositPolicy: (val: boolean) => void;
|
|
23
|
+
isLastStep: boolean;
|
|
24
|
+
tasksManager: TasksManager;
|
|
25
|
+
policyParams: any;
|
|
26
|
+
setPolicyParams: (val: any) => void;
|
|
27
|
+
openPolicy: (content: any, callback?: any) => void;
|
|
28
|
+
closePolicy: (val?: boolean) => void;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
export declare const AppointmentBookingProvider: ({ children, }: {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}) => JSX.Element;
|
|
34
|
+
export declare const useAppointmentBookingContext: () => AppointmentBookingContextType | undefined;
|
|
35
|
+
export {};
|