@pisell/private-materials 3.3.45 → 3.3.47
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 +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.js +7 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.js +2 -2
- package/es/components/appointmentBooking/components/Resource/index.js +30 -12
- package/es/components/appointmentBooking/components/Services/index.js +5 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -4
- package/es/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/es/components/appointmentBooking/context.js +7 -3
- package/es/components/appointmentBooking/hooks.js +129 -68
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/utils.js +6 -1
- package/es/components/booking/addons/index.js +31 -26
- package/es/components/booking/components/footer/amount.js +2 -2
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/utils.d.ts +9 -0
- package/es/components/booking/components/footer/utils.js +32 -10
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.js +2 -2
- 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/service2/utils.d.ts +4 -1
- package/es/components/booking/info/service2/utils.js +21 -2
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +9 -6
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +56 -18
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/utils.d.ts +3 -2
- package/es/components/booking/utils.js +5 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -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/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/ruleSetting/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/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +75 -26
- package/es/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/es/components/ticketBooking/components/notAvailable/index.js +39 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.js +1 -1
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/serve.js +98 -92
- package/es/components/ticketBooking/utils/index.d.ts +1 -0
- package/es/components/ticketBooking/utils/index.js +33 -0
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +3 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.js +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +15 -9
- package/lib/components/appointmentBooking/components/Services/index.js +3 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +4 -3
- package/lib/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/lib/components/appointmentBooking/context.js +7 -3
- package/lib/components/appointmentBooking/hooks.js +73 -12
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.js +2 -0
- package/lib/components/booking/addons/index.js +27 -21
- package/lib/components/booking/components/footer/amount.js +1 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.d.ts +9 -0
- package/lib/components/booking/components/footer/utils.js +24 -7
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.js +1 -1
- 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/service2/utils.d.ts +4 -1
- package/lib/components/booking/info/service2/utils.js +21 -2
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/addService/index.js +8 -5
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +59 -23
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +3 -2
- package/lib/components/booking/utils.js +6 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -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/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/ruleSetting/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/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +74 -20
- package/lib/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/lib/components/ticketBooking/components/notAvailable/index.js +61 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/serve.js +6 -2
- package/lib/components/ticketBooking/utils/index.d.ts +1 -0
- package/lib/components/ticketBooking/utils/index.js +33 -0
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/package.json +4 -4
|
@@ -197,6 +197,9 @@ var CartItem = function CartItem(_ref) {
|
|
|
197
197
|
};
|
|
198
198
|
var products = useMemo(function () {
|
|
199
199
|
if (!(carts !== null && carts !== void 0 && carts.length)) return [];
|
|
200
|
+
carts.forEach(function (item) {
|
|
201
|
+
item.isShowChangeHolder = !appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id);
|
|
202
|
+
});
|
|
200
203
|
if ((currentSelectedResources === null || currentSelectedResources === void 0 ? void 0 : currentSelectedResources.length) > 0) {
|
|
201
204
|
var newCarts = carts.map(function (item) {
|
|
202
205
|
var currentResourceData = currentSelectedResources.find(function (resource) {
|
|
@@ -83,8 +83,14 @@ var Layout = function Layout() {
|
|
|
83
83
|
}, [currentStepParams]);
|
|
84
84
|
useEffect(function () {
|
|
85
85
|
try {
|
|
86
|
+
var _appointmentBooking$o;
|
|
86
87
|
if (!(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.otherParams) || isRetailTemplate) return;
|
|
87
|
-
|
|
88
|
+
|
|
89
|
+
// 显示预约添加人
|
|
90
|
+
var showAddGuest = appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 || (_appointmentBooking$o = _appointmentBooking$o.productModuleParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.showAddGuest;
|
|
91
|
+
|
|
92
|
+
// 如果是表单主体或者是预约添加人不显示,则删除添加人步骤
|
|
93
|
+
if (isFormSubject || !showAddGuest) {
|
|
88
94
|
removeStep('select-guest');
|
|
89
95
|
} else {
|
|
90
96
|
appointmentBooking.addStep({
|
|
@@ -145,8 +145,8 @@ var Header = function Header() {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
//
|
|
149
|
-
if ((
|
|
148
|
+
// 如果前一步是选择资源,则清空表单步骤,不然表单步骤会累加
|
|
149
|
+
if ((prevStepData === null || prevStepData === void 0 ? void 0 : prevStepData.key) === 'select-resource') {
|
|
150
150
|
stepList.forEach(function (item) {
|
|
151
151
|
if (item.key.startsWith('fill-form_')) {
|
|
152
152
|
removeStep(item.key);
|
|
@@ -125,8 +125,11 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
125
125
|
return currentAppointmentBoard(currentStepParams.key, resources, appointmentBooking);
|
|
126
126
|
}, [currentStepParams.key, resources]);
|
|
127
127
|
var renderLists = useMemo(function () {
|
|
128
|
-
//
|
|
129
|
-
|
|
128
|
+
// 如果购物车有多个预约类商品,则不显示左侧内容
|
|
129
|
+
var appointmentCarts = carts.filter(function (n) {
|
|
130
|
+
return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
|
|
131
|
+
});
|
|
132
|
+
if (appointmentCarts.length > 1 || !(appointmentCarts !== null && appointmentCarts !== void 0 && appointmentCarts.length)) {
|
|
130
133
|
return [];
|
|
131
134
|
}
|
|
132
135
|
return currentRenderLists(resources, appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code);
|
|
@@ -142,7 +145,7 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
142
145
|
useEffect(function () {
|
|
143
146
|
var autoSelectResources = /*#__PURE__*/function () {
|
|
144
147
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
145
|
-
var res, cartItem;
|
|
148
|
+
var res, carts, cartItem;
|
|
146
149
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
147
150
|
while (1) switch (_context3.prev = _context3.next) {
|
|
148
151
|
case 0:
|
|
@@ -160,11 +163,17 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
160
163
|
|
|
161
164
|
// 自动分派之后获取重新获取资源列表数据;
|
|
162
165
|
getResourceList();
|
|
163
|
-
|
|
164
|
-
appointmentBooking.
|
|
165
|
-
_id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
|
|
166
|
-
}, cartItem));
|
|
166
|
+
_context3.next = 9;
|
|
167
|
+
return appointmentBooking.getCart();
|
|
167
168
|
case 9:
|
|
169
|
+
carts = _context3.sent;
|
|
170
|
+
cartItem = carts === null || carts === void 0 ? void 0 : carts[0];
|
|
171
|
+
if (cartItem !== null && cartItem !== void 0 && cartItem._id) {
|
|
172
|
+
appointmentBooking.updateCart(_objectSpread({
|
|
173
|
+
_id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
|
|
174
|
+
}, cartItem));
|
|
175
|
+
}
|
|
176
|
+
case 12:
|
|
168
177
|
case "end":
|
|
169
178
|
return _context3.stop();
|
|
170
179
|
}
|
|
@@ -184,16 +193,25 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
184
193
|
var _onClick = function onClick(e) {
|
|
185
194
|
setSelectedResource(e.id);
|
|
186
195
|
if (e.id) {
|
|
187
|
-
var _carts
|
|
196
|
+
var _carts$index;
|
|
197
|
+
// 能够被点击的情况
|
|
198
|
+
// 1. 购物车里只有一个预约类商品
|
|
199
|
+
// 2. 购物车里有多个商品,但只有一个预约类商品
|
|
200
|
+
var index = carts.findIndex(function (n) {
|
|
201
|
+
return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
|
|
202
|
+
});
|
|
188
203
|
return appointmentBooking.updateCart({
|
|
189
|
-
_id: carts === null || carts === void 0 || (_carts$ = carts[
|
|
190
|
-
resources: updateCartResources(carts === null || carts === void 0 ? void 0 : carts[
|
|
204
|
+
_id: carts === null || carts === void 0 || (_carts$index = carts[index]) === null || _carts$index === void 0 ? void 0 : _carts$index._id,
|
|
205
|
+
resources: updateCartResources(carts === null || carts === void 0 ? void 0 : carts[index], e)
|
|
191
206
|
});
|
|
192
207
|
}
|
|
193
208
|
};
|
|
194
209
|
useEffect(function () {
|
|
195
|
-
var _carts$
|
|
196
|
-
var
|
|
210
|
+
var _carts$index2;
|
|
211
|
+
var index = carts.findIndex(function (n) {
|
|
212
|
+
return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
|
|
213
|
+
});
|
|
214
|
+
var selectedResource = carts === null || carts === void 0 || (_carts$index2 = carts[index]) === null || _carts$index2 === void 0 || (_carts$index2 = _carts$index2._origin) === null || _carts$index2 === void 0 || (_carts$index2 = _carts$index2.resources) === null || _carts$index2 === void 0 ? void 0 : _carts$index2.find(function (item) {
|
|
197
215
|
return (item === null || item === void 0 ? void 0 : item.form_id) === (appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_id);
|
|
198
216
|
});
|
|
199
217
|
setSelectedResource((selectedResource === null || selectedResource === void 0 ? void 0 : selectedResource.id) || 0);
|
|
@@ -94,7 +94,10 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
94
94
|
data: {
|
|
95
95
|
detail: _objectSpread(_objectSpread({}, item), {}, {
|
|
96
96
|
open_deposit: 1
|
|
97
|
-
})
|
|
97
|
+
}),
|
|
98
|
+
setting: {
|
|
99
|
+
can_input: true
|
|
100
|
+
}
|
|
98
101
|
},
|
|
99
102
|
callback: function () {
|
|
100
103
|
var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
@@ -159,7 +162,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
159
162
|
activeStatus = resources.find(function (item) {
|
|
160
163
|
return item.status === 1;
|
|
161
164
|
});
|
|
162
|
-
if (activeStatus) {
|
|
165
|
+
if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
|
|
163
166
|
_context.next = 24;
|
|
164
167
|
break;
|
|
165
168
|
}
|
|
@@ -68,11 +68,14 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
68
68
|
};
|
|
69
69
|
}();
|
|
70
70
|
useEffect(function () {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
var appoimentBookingProductCart = carts.filter(function (item) {
|
|
72
|
+
return !appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id);
|
|
73
|
+
});
|
|
74
|
+
if ((times === null || times === void 0 ? void 0 : times.length) > 0 && (appoimentBookingProductCart === null || appoimentBookingProductCart === void 0 ? void 0 : appoimentBookingProductCart.length) > 0) {
|
|
75
|
+
var _appoimentBookingProd, _times$, _appoimentBookingProd2;
|
|
76
|
+
var startTime = (appoimentBookingProductCart === null || appoimentBookingProductCart === void 0 || (_appoimentBookingProd = appoimentBookingProductCart[0]) === null || _appoimentBookingProd === void 0 ? void 0 : _appoimentBookingProd.start_time) || (times === null || times === void 0 || (_times$ = times[0]) === null || _times$ === void 0 ? void 0 : _times$.start_time);
|
|
74
77
|
setSelectedResource(startTime);
|
|
75
|
-
if (
|
|
78
|
+
if (appoimentBookingProductCart !== null && appoimentBookingProductCart !== void 0 && (_appoimentBookingProd2 = appoimentBookingProductCart[0]) !== null && _appoimentBookingProd2 !== void 0 && _appoimentBookingProd2.start_time) return;
|
|
76
79
|
|
|
77
80
|
// 如果没有选择时间,则默认选中第一个时间
|
|
78
81
|
getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
|
|
@@ -166,11 +166,15 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
166
166
|
if (!(carts !== null && carts !== void 0 && carts.length) || !(resources !== null && resources !== void 0 && resources.length)) {
|
|
167
167
|
return setCurrentSelectedResources(null);
|
|
168
168
|
}
|
|
169
|
-
var _currentSelectedResources =
|
|
170
|
-
|
|
169
|
+
var _currentSelectedResources = [];
|
|
170
|
+
carts.forEach(function (item) {
|
|
171
|
+
if (appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id)) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
_currentSelectedResources.push({
|
|
171
175
|
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
172
176
|
currentSelectedResource: getCartCurrentResourceData(item, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources)
|
|
173
|
-
};
|
|
177
|
+
});
|
|
174
178
|
});
|
|
175
179
|
setCurrentSelectedResources(_currentSelectedResources);
|
|
176
180
|
|