@pisell/private-materials 3.3.68 → 3.3.69
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.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/appointmentBooking/components/Cart/Item/index.js +4 -2
- package/es/components/appointmentBooking/components/Services/index.js +25 -32
- package/es/components/appointmentBooking/components/Voucher/index.js +13 -0
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +6 -7
- package/es/components/appointmentBooking/locales.js +3 -3
- package/es/components/booking/addons/index.js +9 -2
- package/es/components/booking/addons/model.js +5 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.js +3 -1
- package/es/components/booking/components/TabProduct/selectProductItem/index.less +6 -0
- package/es/components/booking/components/footer/index.js +9 -3
- package/es/components/booking/components/footer/utils.js +73 -35
- package/es/components/booking/components/voucher/index.js +110 -66
- package/es/components/booking/components/voucher/utils.d.ts +4 -0
- package/es/components/booking/components/voucher/utils.js +15 -0
- package/es/components/booking/hooks/useQuotation.d.ts +1 -0
- package/es/components/booking/hooks/useQuotation.js +16 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +6 -2
- package/es/components/booking/info2/index.js +9 -4
- package/es/components/booking/info2/serve.d.ts +1 -1
- package/es/components/booking/info2/serve.js +12 -8
- package/es/components/booking/info2/service/addService/index.js +2 -2
- package/es/components/booking/info2/service/editService/index.js +5 -2
- package/es/components/booking/info2/utils.d.ts +1 -1
- package/es/components/booking/info2/utils.js +3 -2
- package/es/components/booking/info2/utilsByBooking.d.ts +1 -1
- package/es/components/booking/info2/utilsByBooking.js +5 -3
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +6 -3
- package/es/components/booking/utils.d.ts +2 -2
- 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 +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +5 -4
- package/es/components/ticketBooking/components/ticketBooking/index.js +4 -2
- package/es/components/ticketBooking/utils/index.d.ts +5 -1
- package/es/components/ticketBooking/utils/index.js +50 -5
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -4
- package/lib/components/appointmentBooking/components/Services/index.js +6 -14
- package/lib/components/appointmentBooking/components/Voucher/index.js +9 -0
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +0 -1
- package/lib/components/appointmentBooking/locales.js +3 -3
- package/lib/components/booking/addons/index.js +10 -2
- package/lib/components/booking/addons/model.js +3 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.js +5 -1
- package/lib/components/booking/components/TabProduct/selectProductItem/index.less +6 -0
- package/lib/components/booking/components/footer/index.js +10 -5
- package/lib/components/booking/components/footer/utils.js +47 -11
- package/lib/components/booking/components/voucher/index.js +111 -67
- package/lib/components/booking/components/voucher/utils.d.ts +4 -0
- package/lib/components/booking/components/voucher/utils.js +43 -0
- package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
- package/lib/components/booking/hooks/useQuotation.js +19 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +3 -1
- package/lib/components/booking/info2/index.js +9 -9
- package/lib/components/booking/info2/serve.d.ts +1 -1
- package/lib/components/booking/info2/serve.js +1 -1
- package/lib/components/booking/info2/service/addService/index.js +2 -2
- package/lib/components/booking/info2/service/editService/index.js +5 -2
- package/lib/components/booking/info2/utils.d.ts +1 -1
- package/lib/components/booking/info2/utils.js +2 -2
- package/lib/components/booking/info2/utilsByBooking.d.ts +1 -1
- package/lib/components/booking/info2/utilsByBooking.js +3 -2
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/utils.d.ts +2 -2
- 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 +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +5 -3
- package/lib/components/ticketBooking/components/ticketBooking/index.js +4 -2
- package/lib/components/ticketBooking/utils/index.d.ts +5 -1
- package/lib/components/ticketBooking/utils/index.js +44 -4
- package/package.json +2 -2
|
@@ -20,7 +20,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
20
20
|
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); }
|
|
21
21
|
import { getNoResource } from "../../mock";
|
|
22
22
|
import { getErrorList, getProductTotalPrice } from "../../utils";
|
|
23
|
-
import { locales } from '@pisell/utils';
|
|
23
|
+
import { isArr, locales } from '@pisell/utils';
|
|
24
24
|
import dayjs from 'dayjs';
|
|
25
25
|
import { appointmentTypes, openingTime } from "./status";
|
|
26
26
|
import { postMultiDay } from "../service/serve";
|
|
@@ -199,7 +199,9 @@ export var handleChangeHolder = function handleChangeHolder(products, currentIte
|
|
|
199
199
|
if (item._id === currentItem._id) {
|
|
200
200
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
201
201
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
202
|
-
holder_id: other.
|
|
202
|
+
holder_id: isArr(other) ? other.map(function (item) {
|
|
203
|
+
return item.id;
|
|
204
|
+
}) : item._extend.quantity > 1 ? [other.id] : other.id
|
|
203
205
|
})
|
|
204
206
|
});
|
|
205
207
|
}
|
|
@@ -610,6 +612,8 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
610
612
|
actionText: locales.getText('page.booking.text.add-time'),
|
|
611
613
|
isMultipleResource: true,
|
|
612
614
|
multiResources: multiResources,
|
|
615
|
+
holderMaxCount: item === null || item === void 0 ? void 0 : item._extend.quantity,
|
|
616
|
+
holderMode: (item === null || item === void 0 ? void 0 : item._extend.quantity) > 1 ? 'multiple' : undefined,
|
|
613
617
|
isErrorHolder: getIsSubjectRequire(state),
|
|
614
618
|
addHolderButtonText: (formData === null || formData === void 0 || (_formData$ = formData[0]) === null || _formData$ === void 0 || (_formData$ = _formData$.form) === null || _formData$ === void 0 ? void 0 : _formData$.title) || "",
|
|
615
619
|
holder_id: item === null || item === void 0 || (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.holder_id,
|
|
@@ -31,6 +31,7 @@ import { Skeleton } from 'antd';
|
|
|
31
31
|
import classNames from 'classnames';
|
|
32
32
|
import useCreateBookingPageHeader from "../hooks/useCreateBookingPageHeader";
|
|
33
33
|
import { getLocale } from "../../../utils/locales";
|
|
34
|
+
import { useDebounceEffect } from "ahooks";
|
|
34
35
|
var defaultModules = {
|
|
35
36
|
client: 1,
|
|
36
37
|
date: 1,
|
|
@@ -164,7 +165,7 @@ var Info = Provider(function (props) {
|
|
|
164
165
|
try {
|
|
165
166
|
// 同步最新数据用, 增加延迟为了不和getProduct接口冲突
|
|
166
167
|
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
167
|
-
var _stateRef$current;
|
|
168
|
+
var _stateRef$current, _stateRef$current$map;
|
|
168
169
|
var data;
|
|
169
170
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
170
171
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -172,7 +173,9 @@ var Info = Provider(function (props) {
|
|
|
172
173
|
_context.next = 2;
|
|
173
174
|
return getResourceList({
|
|
174
175
|
date: currentDate
|
|
175
|
-
}, stateRef === null || stateRef === void 0 || (_stateRef$current = stateRef.current) === null || _stateRef$current === void 0 ? void 0 : _stateRef$current.
|
|
176
|
+
}, stateRef === null || stateRef === void 0 || (_stateRef$current = stateRef.current) === null || _stateRef$current === void 0 || (_stateRef$current = _stateRef$current.service) === null || _stateRef$current === void 0 || (_stateRef$current = _stateRef$current.value) === null || _stateRef$current === void 0 || (_stateRef$current$map = _stateRef$current.map) === null || _stateRef$current$map === void 0 ? void 0 : _stateRef$current$map.call(_stateRef$current, function (item) {
|
|
177
|
+
return item === null || item === void 0 ? void 0 : item.booking_id;
|
|
178
|
+
}));
|
|
176
179
|
case 2:
|
|
177
180
|
data = _context.sent;
|
|
178
181
|
data.date = currentDate;
|
|
@@ -203,13 +206,15 @@ var Info = Provider(function (props) {
|
|
|
203
206
|
return _ref.apply(this, arguments);
|
|
204
207
|
};
|
|
205
208
|
}();
|
|
206
|
-
|
|
209
|
+
useDebounceEffect(function () {
|
|
207
210
|
// setTimeout(() => {
|
|
208
211
|
if (currentDate) {
|
|
209
212
|
getResourcesData();
|
|
210
213
|
}
|
|
211
214
|
// }, 20);
|
|
212
|
-
}, [currentDate]
|
|
215
|
+
}, [currentDate], {
|
|
216
|
+
wait: 300
|
|
217
|
+
});
|
|
213
218
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, _defineProperty(_defineProperty({
|
|
214
219
|
style: style,
|
|
215
220
|
header: header,
|
|
@@ -5,24 +5,28 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
5
5
|
import { request } from "../utils";
|
|
6
6
|
import { getFormatResourceListAndMap } from "./utils";
|
|
7
7
|
export var getResourceList = /*#__PURE__*/function () {
|
|
8
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params
|
|
9
|
-
var
|
|
8
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
9
|
+
var bookingId,
|
|
10
|
+
_yield$request$getReq,
|
|
11
|
+
data,
|
|
12
|
+
_args = arguments;
|
|
10
13
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11
14
|
while (1) switch (_context.prev = _context.next) {
|
|
12
15
|
case 0:
|
|
13
|
-
|
|
16
|
+
bookingId = _args.length > 1 && _args[1] !== undefined ? _args[1] : [];
|
|
17
|
+
_context.next = 3;
|
|
14
18
|
return request.getRequest().get("/shop/schedule/resource/list", params);
|
|
15
|
-
case
|
|
19
|
+
case 3:
|
|
16
20
|
_yield$request$getReq = _context.sent;
|
|
17
21
|
data = _yield$request$getReq.data;
|
|
18
22
|
return _context.abrupt("return", getFormatResourceListAndMap(data, bookingId));
|
|
19
|
-
case
|
|
23
|
+
case 6:
|
|
20
24
|
case "end":
|
|
21
25
|
return _context.stop();
|
|
22
26
|
}
|
|
23
27
|
}, _callee);
|
|
24
28
|
}));
|
|
25
|
-
return function getResourceList(_x
|
|
29
|
+
return function getResourceList(_x) {
|
|
26
30
|
return _ref.apply(this, arguments);
|
|
27
31
|
};
|
|
28
32
|
}();
|
|
@@ -44,7 +48,7 @@ export var createBookings = /*#__PURE__*/function () {
|
|
|
44
48
|
}
|
|
45
49
|
}, _callee2);
|
|
46
50
|
}));
|
|
47
|
-
return function createBookings(
|
|
51
|
+
return function createBookings(_x2) {
|
|
48
52
|
return _ref2.apply(this, arguments);
|
|
49
53
|
};
|
|
50
54
|
}();
|
|
@@ -66,7 +70,7 @@ export var editBookings = /*#__PURE__*/function () {
|
|
|
66
70
|
}
|
|
67
71
|
}, _callee3);
|
|
68
72
|
}));
|
|
69
|
-
return function editBookings(
|
|
73
|
+
return function editBookings(_x3, _x4) {
|
|
70
74
|
return _ref3.apply(this, arguments);
|
|
71
75
|
};
|
|
72
76
|
}();
|
|
@@ -33,7 +33,7 @@ import { getProductExtend } from "./utils";
|
|
|
33
33
|
import { formatProductListByCategory, getIsEject, getIsOnlySession, getProductTotalPrice, isSessionProduct, request } from "../../../utils";
|
|
34
34
|
import { locales, getUniqueId } from '@pisell/utils';
|
|
35
35
|
import { useUpdateEffect } from 'ahooks';
|
|
36
|
-
import {
|
|
36
|
+
import { getIsShowNumber } from "../../../../ticketBooking/utils";
|
|
37
37
|
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
|
|
38
38
|
var Info = function Info(props) {
|
|
39
39
|
var _state$client2, _state$service2, _state$service4, _state$service5;
|
|
@@ -255,7 +255,7 @@ var Info = function Info(props) {
|
|
|
255
255
|
session: isSession,
|
|
256
256
|
variant: true,
|
|
257
257
|
package: true,
|
|
258
|
-
number:
|
|
258
|
+
number: getIsShowNumber(item, state)
|
|
259
259
|
},
|
|
260
260
|
is_eject: isEject ? 1 : 0,
|
|
261
261
|
isOnlySession: isOnlySession,
|
|
@@ -35,6 +35,7 @@ import { formatResources, getDurationProps, getFlexibleOption, getTimeObj, setDe
|
|
|
35
35
|
import { PisellAdjustPriceInputNumber } from '@pisell/materials';
|
|
36
36
|
import { editSessionProduct } from "../../../info/utils";
|
|
37
37
|
import { isNormalProductByDurationSchedule } from "../../../info/service2/utils";
|
|
38
|
+
import { addService, genServiceKey, getIsShowNumber } from "../../../../ticketBooking/utils";
|
|
38
39
|
var submitLock = false;
|
|
39
40
|
var Info = function Info(_, ref) {
|
|
40
41
|
var _state$service3, _state$bookingConfig2, _state$service$cacheI4, _state$service$cacheI5, _state$service6, _state$service8, _window$BaseMaterials, _state$service$cacheI6, _state$service9, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service$cacheI10, _state$bookingConfig3, _state$service$resour;
|
|
@@ -244,13 +245,15 @@ var Info = function Info(_, ref) {
|
|
|
244
245
|
}
|
|
245
246
|
_item._extend = _extend;
|
|
246
247
|
_item._time = new Date().getTime();
|
|
248
|
+
_item._serviceKey = genServiceKey(_item);
|
|
247
249
|
var _id = _item === null || _item === void 0 ? void 0 : _item._id;
|
|
248
250
|
|
|
249
251
|
// 判断是新增还是编辑
|
|
250
252
|
if (!_list.some(function (d) {
|
|
251
253
|
return d._id === _id;
|
|
252
254
|
})) {
|
|
253
|
-
_list
|
|
255
|
+
var detail = addService(_list, _item, state);
|
|
256
|
+
_list = detail.list;
|
|
254
257
|
} else {
|
|
255
258
|
// 手动改价时移除优惠券使用
|
|
256
259
|
if (isChangeTotal.current) {
|
|
@@ -428,7 +431,7 @@ var Info = function Info(_, ref) {
|
|
|
428
431
|
session: isSession,
|
|
429
432
|
variant: true,
|
|
430
433
|
package: true,
|
|
431
|
-
number:
|
|
434
|
+
number: getIsShowNumber(item, state)
|
|
432
435
|
},
|
|
433
436
|
isOS: isSession,
|
|
434
437
|
customer_id: (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id,
|
|
@@ -5,7 +5,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
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); }
|
|
7
7
|
import { getNoResource2 } from "../mock";
|
|
8
|
-
export var getFormatResourceListAndMap = function getFormatResourceListAndMap(data
|
|
8
|
+
export var getFormatResourceListAndMap = function getFormatResourceListAndMap(data) {
|
|
9
|
+
var bookingId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
9
10
|
var resourceList = (data || {}).concat([getNoResource2({})]);
|
|
10
11
|
var map = resourceList.reduce(function (prev, item) {
|
|
11
12
|
prev[item.id] = item;
|
|
@@ -20,7 +21,7 @@ export var getFormatResourceListAndMap = function getFormatResourceListAndMap(da
|
|
|
20
21
|
var pax = 0;
|
|
21
22
|
(((_map$cur = map[cur]) === null || _map$cur === void 0 ? void 0 : _map$cur.times) || []).forEach(function (time) {
|
|
22
23
|
time.event_list.forEach(function (event) {
|
|
23
|
-
if (event.id
|
|
24
|
+
if (!bookingId.includes(event.id)) {
|
|
24
25
|
pax += (event === null || event === void 0 ? void 0 : event.pax) || 0;
|
|
25
26
|
}
|
|
26
27
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const getResourceTimeIsUsable: (item: any, cacheItem: any, resourceItem: any) => any;
|
|
2
|
-
export declare const getSumCapacity: ({ cacheItem }: any) => number;
|
|
2
|
+
export declare const getSumCapacity: ({ cacheItem }: any, isCalcQuantity?: boolean) => number;
|
|
3
3
|
/**
|
|
4
4
|
* @title: 查找是否有可用的time
|
|
5
5
|
* @description:
|
|
@@ -162,7 +162,9 @@ export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cach
|
|
|
162
162
|
return time;
|
|
163
163
|
};
|
|
164
164
|
export var getSumCapacity = function getSumCapacity(_ref) {
|
|
165
|
+
var _cacheItem$_extend;
|
|
165
166
|
var cacheItem = _ref.cacheItem;
|
|
167
|
+
var isCalcQuantity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
166
168
|
var sum = 0;
|
|
167
169
|
var _iterator = _createForOfIteratorHelper(cacheItem._extend.capacity || []),
|
|
168
170
|
_step;
|
|
@@ -176,7 +178,7 @@ export var getSumCapacity = function getSumCapacity(_ref) {
|
|
|
176
178
|
} finally {
|
|
177
179
|
_iterator.f();
|
|
178
180
|
}
|
|
179
|
-
return sum;
|
|
181
|
+
return sum * (isCalcQuantity ? (cacheItem === null || cacheItem === void 0 || (_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.quantity) || 1 : 1);
|
|
180
182
|
};
|
|
181
183
|
|
|
182
184
|
/**
|
|
@@ -302,7 +304,7 @@ export var getAppointmentTimingPreference = function getAppointmentTimingPrefere
|
|
|
302
304
|
* @Date: 2024-01-26 14:09
|
|
303
305
|
*/
|
|
304
306
|
export var getServiceStartTimeAndEndTime = function getServiceStartTimeAndEndTime(state, cacheItem, timeObj) {
|
|
305
|
-
var _cacheItem$duration, _cacheItem$
|
|
307
|
+
var _cacheItem$duration, _cacheItem$_extend2;
|
|
306
308
|
var appointmentTimingPreference = getAppointmentTimingPreference(state);
|
|
307
309
|
|
|
308
310
|
// 获取上一个服务商品
|
|
@@ -370,7 +372,7 @@ export var getServiceStartTimeAndEndTime = function getServiceStartTimeAndEndTim
|
|
|
370
372
|
endDate = _getServiceTimes2.endDate;
|
|
371
373
|
_extend.startDate = startDate;
|
|
372
374
|
_extend.endDate = endDate;
|
|
373
|
-
var session = cacheItem === null || cacheItem === void 0 || (_cacheItem$
|
|
375
|
+
var session = cacheItem === null || cacheItem === void 0 || (_cacheItem$_extend2 = cacheItem._extend) === null || _cacheItem$_extend2 === void 0 || (_cacheItem$_extend2 = _cacheItem$_extend2.other) === null || _cacheItem$_extend2 === void 0 ? void 0 : _cacheItem$_extend2.session;
|
|
374
376
|
if (isSessionProduct(cacheItem) && session) {
|
|
375
377
|
_extend.start_date = session.start_at;
|
|
376
378
|
_extend.startDate = session.start_at;
|
|
@@ -261,6 +261,7 @@ declare const _default: {
|
|
|
261
261
|
'pisell2.text.goodpass.code': string;
|
|
262
262
|
'pisell2.text.goodpass.enter-code': string;
|
|
263
263
|
'pisell2.text.goodpass.code-invalid': string;
|
|
264
|
+
'pisell2.text.goodpass.code-invalid-cart': string;
|
|
264
265
|
'pisell2.text.status.valid': string;
|
|
265
266
|
'pisell2.text.status.expired': string;
|
|
266
267
|
'pisell2.text.validity.expired': (str: string) => string;
|
|
@@ -531,6 +532,7 @@ declare const _default: {
|
|
|
531
532
|
'pisell2.text.goodpass.code': string;
|
|
532
533
|
'pisell2.text.goodpass.enter-code': string;
|
|
533
534
|
'pisell2.text.goodpass.code-invalid': string;
|
|
535
|
+
'pisell2.text.goodpass.code-invalid-cart': string;
|
|
534
536
|
'pisell2.text.status.valid': string;
|
|
535
537
|
'pisell2.text.status.expired': string;
|
|
536
538
|
'pisell2.text.validity.expired': (str: string) => string;
|
|
@@ -801,6 +803,7 @@ declare const _default: {
|
|
|
801
803
|
'pisell2.text.goodpass.code': string;
|
|
802
804
|
'pisell2.text.goodpass.enter-code': string;
|
|
803
805
|
'pisell2.text.goodpass.code-invalid': string;
|
|
806
|
+
'pisell2.text.goodpass.code-invalid-cart': string;
|
|
804
807
|
'pisell2.text.status.valid': string;
|
|
805
808
|
'pisell2.text.status.expired': string;
|
|
806
809
|
'pisell2.text.validity.expired': (str: string) => string;
|
|
@@ -292,12 +292,13 @@ export default {
|
|
|
292
292
|
'pisell2.text.send-form-reminder-tooltip': 'Refresh forms',
|
|
293
293
|
'pisell2.text.send-form-reminder-refresh': 'Forms refreshed successfully',
|
|
294
294
|
'pisell2.text.send-form-reminder-error-message': 'Please select at least one reminder method',
|
|
295
|
-
'pisell2.text.goodpass': "
|
|
295
|
+
'pisell2.text.goodpass': "Promotion",
|
|
296
296
|
'pisell2.text.goodpass.product-vouchers': "Product Vouchers",
|
|
297
297
|
'pisell2.text.goodpass.view-more': "View More",
|
|
298
298
|
'pisell2.text.goodpass.code': "Code",
|
|
299
299
|
'pisell2.text.goodpass.enter-code': "Enter Code",
|
|
300
300
|
'pisell2.text.goodpass.code-invalid': "Current code is invalid",
|
|
301
|
+
'pisell2.text.goodpass.code-invalid-cart': "No eligible items in the cart",
|
|
301
302
|
'pisell2.text.status.valid': 'Valid',
|
|
302
303
|
'pisell2.text.status.expired': 'Expired',
|
|
303
304
|
'pisell2.text.validity.expired': function pisell2TextValidityExpired(str) {
|
|
@@ -609,12 +610,13 @@ export default {
|
|
|
609
610
|
'pisell2.text.send-form-reminder-tooltip': '刷新表单',
|
|
610
611
|
'pisell2.text.send-form-reminder-refresh': '已刷新表单',
|
|
611
612
|
'pisell2.text.send-form-reminder-error-message': '请至少选择一种提醒方式',
|
|
612
|
-
'pisell2.text.goodpass': "
|
|
613
|
+
'pisell2.text.goodpass': "促销",
|
|
613
614
|
'pisell2.text.goodpass.product-vouchers': "商品兑换券",
|
|
614
615
|
'pisell2.text.goodpass.view-more': "查看更多",
|
|
615
616
|
'pisell2.text.goodpass.code': "券码",
|
|
616
617
|
'pisell2.text.goodpass.enter-code': "请输入券码",
|
|
617
618
|
'pisell2.text.goodpass.code-invalid': "当前券码不可用",
|
|
619
|
+
'pisell2.text.goodpass.code-invalid-cart': "当前购物车中无可用商品",
|
|
618
620
|
'pisell2.text.status.valid': '有效',
|
|
619
621
|
'pisell2.text.status.expired': '已过期',
|
|
620
622
|
'pisell2.text.validity.expired': function pisell2TextValidityExpired(str) {
|
|
@@ -926,12 +928,13 @@ export default {
|
|
|
926
928
|
'pisell2.text.send-form-reminder-tooltip': '刷新表單',
|
|
927
929
|
'pisell2.text.send-form-reminder-refresh': '已刷新表單',
|
|
928
930
|
'pisell2.text.send-form-reminder-error-message': '請至少選擇一種提醒方式',
|
|
929
|
-
'pisell2.text.goodpass': "
|
|
931
|
+
'pisell2.text.goodpass': "促銷",
|
|
930
932
|
'pisell2.text.goodpass.product-vouchers': "商品兌換券",
|
|
931
933
|
'pisell2.text.goodpass.view-more': "查看更多",
|
|
932
934
|
'pisell2.text.goodpass.code': "券碼",
|
|
933
935
|
'pisell2.text.goodpass.enter-code': "請輸入券碼",
|
|
934
936
|
'pisell2.text.goodpass.code-invalid': "當前券碼不可用",
|
|
937
|
+
'pisell2.text.goodpass.code-invalid-cart': "當前購物車中無可用商品",
|
|
935
938
|
'pisell2.text.status.valid': '有效',
|
|
936
939
|
'pisell2.text.status.expired': '已過期',
|
|
937
940
|
'pisell2.text.validity.expired': function pisell2TextValidityExpired(str) {
|
|
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
165
165
|
export declare const getDuration: (duration: number | {
|
|
166
166
|
type: string;
|
|
167
167
|
value: number;
|
|
168
|
-
}) => number | {
|
|
168
|
+
}) => number | "flexible" | {
|
|
169
169
|
type: string;
|
|
170
170
|
value: number;
|
|
171
|
-
}
|
|
171
|
+
};
|
|
172
172
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
173
173
|
export declare const getIsEdit: (state: any) => boolean;
|
|
174
174
|
export {};
|
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
10
10
|
className?: string | undefined;
|
|
11
|
-
onChange?: ((status: "
|
|
11
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
12
12
|
[keys: string]: unknown;
|
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
|
14
14
|
onClose: () => void;
|
|
@@ -10,7 +10,7 @@ import './device.less';
|
|
|
10
10
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
11
11
|
api: PayProps['api'];
|
|
12
12
|
className?: string | undefined;
|
|
13
|
-
onChange?: ((status: "
|
|
13
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
14
14
|
[keys: string]: unknown;
|
|
15
15
|
} | undefined, other?: any) => void) | undefined;
|
|
16
16
|
onClose: () => void;
|
|
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
175
175
|
type: EActionTypes;
|
|
176
176
|
payload: {
|
|
177
|
-
status: "
|
|
177
|
+
status: "success" | "loading" | "warn" | "fail" | "question";
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
/**
|
|
@@ -295,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
295
295
|
name?: string | undefined;
|
|
296
296
|
symbol?: string | undefined;
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
|
-
mode?: "
|
|
298
|
+
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "
|
|
301
|
-
action?: "amount" | "
|
|
300
|
+
eftpos?: "tyro" | "windcave" | "stripe" | "payo" | undefined;
|
|
301
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
304
304
|
title?: string | undefined;
|
|
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
308
308
|
net?: boolean | undefined;
|
|
309
309
|
component?: string | undefined;
|
|
310
310
|
form?: string | undefined;
|
|
311
|
-
status?: "
|
|
311
|
+
status?: "success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
312
312
|
warn?: string | undefined;
|
|
313
313
|
steps?: {
|
|
314
314
|
/** 用于重置当前步骤 */
|
|
@@ -24,13 +24,13 @@ import useEngineContext from "../../../../hooks/useEngineContext";
|
|
|
24
24
|
import { isSessionProduct, request, getProductTotalPrice, getIsEject, getIsOnlySession } from "../../../booking/utils";
|
|
25
25
|
import { getProductExtend } from "../../../booking/info2/service/addService/utils";
|
|
26
26
|
import { appointmentTypes } from "../../../booking/info/service2/status";
|
|
27
|
-
import { holderId, isDaysBooking
|
|
27
|
+
import { holderId, isDaysBooking } from "../../../booking/info/service2/utils";
|
|
28
28
|
import { getIsBundleOrCombination, isBooking4Shop } from "../../../booking/info/utils";
|
|
29
29
|
import { getProductDetail } from "../../../booking/info/service/serve";
|
|
30
30
|
import { useService } from "../../../booking/info/service/serviceManager";
|
|
31
31
|
import ProductSelect from "../../../productSelect";
|
|
32
32
|
import "./index.less";
|
|
33
|
-
import { addService, addServiceScroll } from "../../utils";
|
|
33
|
+
import { addService, addServiceScroll, genServiceKey, getIsShowNumber } from "../../utils";
|
|
34
34
|
import NotAvailable from "../notAvailable";
|
|
35
35
|
var AddSerivce = function AddSerivce(props) {
|
|
36
36
|
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _state$bookingConfig2, _state$client2, _state$service3, _state$service4;
|
|
@@ -279,7 +279,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
279
279
|
session: isSession,
|
|
280
280
|
variant: true,
|
|
281
281
|
package: true,
|
|
282
|
-
number:
|
|
282
|
+
number: getIsShowNumber(item, state)
|
|
283
283
|
},
|
|
284
284
|
isOnlySession: isOnlySession,
|
|
285
285
|
is_eject: isEject ? 1 : 0,
|
|
@@ -368,7 +368,8 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
368
368
|
}
|
|
369
369
|
if (cacheItem.autoClose) {
|
|
370
370
|
cacheItem.autoClose = false;
|
|
371
|
-
|
|
371
|
+
cacheItem._serviceKey = genServiceKey(cacheItem);
|
|
372
|
+
_addService = addService(_toConsumableArray(state.service.value), cacheItem, state), _list = _addService.list, quantity = _addService.quantity;
|
|
372
373
|
Toast === null || Toast === void 0 || (_Toast$success = Toast.success) === null || _Toast$success === void 0 || _Toast$success.call(Toast, /*#__PURE__*/React.createElement("div", {
|
|
373
374
|
className: "add-toast-wrap"
|
|
374
375
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -892,7 +892,8 @@ var TicketBooking = function TicketBooking() {
|
|
|
892
892
|
addTimeProducts: state.addTimeProducts,
|
|
893
893
|
isBookingCreatePage: true,
|
|
894
894
|
closeAutoOpenService: true,
|
|
895
|
-
productExtensionType: state.productExtensionType
|
|
895
|
+
productExtensionType: state.productExtensionType,
|
|
896
|
+
isBookingTicket2: true
|
|
896
897
|
}),
|
|
897
898
|
setGlobalState: _setModalState
|
|
898
899
|
})), /*#__PURE__*/React.createElement(TimeBar, {
|
|
@@ -936,7 +937,8 @@ var TicketBooking = function TicketBooking() {
|
|
|
936
937
|
refreshData: _refreshData,
|
|
937
938
|
setActiveTab: _setActiveTab,
|
|
938
939
|
clearAllValue: _clearAllValue,
|
|
939
|
-
drawerMask: true
|
|
940
|
+
drawerMask: true,
|
|
941
|
+
isBookingTicket2: true
|
|
940
942
|
}),
|
|
941
943
|
setGlobalState: _setModalState,
|
|
942
944
|
setState: setState,
|
|
@@ -12,8 +12,12 @@ export declare const restoreProductOtherData: (data: any) => {
|
|
|
12
12
|
product_variant_id: number;
|
|
13
13
|
quantity: number;
|
|
14
14
|
} | undefined;
|
|
15
|
-
export declare const addService: (list: any[], addItem: any) => {
|
|
15
|
+
export declare const addService: (list: any[], addItem: any, state: any) => {
|
|
16
16
|
list: any[];
|
|
17
17
|
quantity: any;
|
|
18
18
|
};
|
|
19
19
|
export declare const addServiceScroll: (rowKey: string, cacheItem: any) => void;
|
|
20
|
+
export declare const getCartProductOverlay: (state: any) => any;
|
|
21
|
+
export declare const getIsOverlayProduct: (item: any, state: any) => any;
|
|
22
|
+
export declare const getIsShowNumber: (item: any, state: any) => any;
|
|
23
|
+
export declare const genServiceKey: (item: any) => string;
|
|
@@ -104,14 +104,18 @@ export var restoreProductOtherData = function restoreProductOtherData(data) {
|
|
|
104
104
|
|
|
105
105
|
// 是相同的商品
|
|
106
106
|
var isSameProduct = function isSameProduct(a, b) {
|
|
107
|
-
var _a$
|
|
108
|
-
|
|
107
|
+
var _a$_extend2, _b$_extend2;
|
|
108
|
+
if (isNormalProductByDurationSchedule(a) && isNormalProductByDurationSchedule(b)) {
|
|
109
|
+
var _a$_extend, _b$_extend;
|
|
110
|
+
return ((_a$_extend = a._extend) === null || _a$_extend === void 0 || (_a$_extend = _a$_extend.other) === null || _a$_extend === void 0 ? void 0 : _a$_extend.rowKey) === ((_b$_extend = b._extend) === null || _b$_extend === void 0 || (_b$_extend = _b$_extend.other) === null || _b$_extend === void 0 ? void 0 : _b$_extend.rowKey);
|
|
111
|
+
}
|
|
112
|
+
return ((_a$_extend2 = a._extend) === null || _a$_extend2 === void 0 || (_a$_extend2 = _a$_extend2.other) === null || _a$_extend2 === void 0 ? void 0 : _a$_extend2.rowKey) === ((_b$_extend2 = b._extend) === null || _b$_extend2 === void 0 || (_b$_extend2 = _b$_extend2.other) === null || _b$_extend2 === void 0 ? void 0 : _b$_extend2.rowKey) && a._serviceKey === b._serviceKey;
|
|
109
113
|
};
|
|
110
|
-
export var addService = function addService(list, addItem) {
|
|
114
|
+
export var addService = function addService(list, addItem, state) {
|
|
111
115
|
var value = list;
|
|
112
116
|
var count;
|
|
113
|
-
//
|
|
114
|
-
if (!isNormalProductByDurationSchedule(addItem)) {
|
|
117
|
+
// 预约商品 并且配置商品卡片不叠加 直接添加
|
|
118
|
+
if (!isNormalProductByDurationSchedule(addItem) && !getIsOverlayProduct(addItem, state)) {
|
|
115
119
|
value.push(addItem);
|
|
116
120
|
count = addItem._extend.quantity;
|
|
117
121
|
} else {
|
|
@@ -164,4 +168,45 @@ export var addServiceScroll = function addServiceScroll(rowKey, cacheItem) {
|
|
|
164
168
|
}, 100);
|
|
165
169
|
}
|
|
166
170
|
});
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// 获取购物车商品覆盖规则
|
|
174
|
+
export var getCartProductOverlay = function getCartProductOverlay(state) {
|
|
175
|
+
var _state$bookingConfig;
|
|
176
|
+
return (state === null || state === void 0 || (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.config) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.basic) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.cart_product_overlay) || {
|
|
177
|
+
type: "product_all"
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// 获取购物车商品是否覆盖
|
|
182
|
+
export var getIsOverlayProduct = function getIsOverlayProduct(item, state) {
|
|
183
|
+
var _getCartProductOverla = getCartProductOverlay(state),
|
|
184
|
+
type = _getCartProductOverla.type,
|
|
185
|
+
product_ids = _getCartProductOverla.product_ids;
|
|
186
|
+
if (type === 'product_all') {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
return product_ids.includes(item.product_id || item.id);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// 获取购物车商品是否显示数量
|
|
193
|
+
export var getIsShowNumber = function getIsShowNumber(item, state) {
|
|
194
|
+
var isBookingTicket2 = state.isBookingTicket2;
|
|
195
|
+
return isNormalProductByDurationSchedule(item) || isBookingTicket2 && getIsOverlayProduct(item, state);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// 生成服务key
|
|
199
|
+
export var genServiceKey = function genServiceKey(item) {
|
|
200
|
+
var _item$_extend3, _item$_extend4, _item$_extend5;
|
|
201
|
+
var product_id = item.product_id;
|
|
202
|
+
var durationKey = (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.duration;
|
|
203
|
+
var start_time = (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.start_time;
|
|
204
|
+
var total = (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.total;
|
|
205
|
+
var resourceKey = '';
|
|
206
|
+
Object.values(item._extend.resource).forEach(function (resources) {
|
|
207
|
+
resources.forEach(function (resource) {
|
|
208
|
+
resourceKey += "".concat(resource.relation_id);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
return "".concat(product_id, "-").concat(durationKey, "-").concat(resourceKey, "-").concat(start_time, "-").concat(total);
|
|
167
212
|
};
|
|
@@ -46,7 +46,7 @@ var import_Deposit = __toESM(require("../../Deposit"));
|
|
|
46
46
|
var import_utils3 = require("../utils");
|
|
47
47
|
var import_index = require("./index.less");
|
|
48
48
|
var CartItem = ({ onNext }) => {
|
|
49
|
-
var _a, _b, _c, _d;
|
|
49
|
+
var _a, _b, _c, _d, _e;
|
|
50
50
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
51
51
|
const {
|
|
52
52
|
carts,
|
|
@@ -78,6 +78,7 @@ var CartItem = ({ onNext }) => {
|
|
|
78
78
|
return (0, import_utils2.formatHolder)(accountLists);
|
|
79
79
|
}, [accountLists, isFormSubject]);
|
|
80
80
|
const hasGoodPassApp = !!((_a = businessUtils == null ? void 0 : businessUtils.getAppByModal) == null ? void 0 : _a.call(businessUtils, "goodpass"));
|
|
81
|
+
const hasDiscountCardApp = !!((_b = businessUtils == null ? void 0 : businessUtils.getAppByModal) == null ? void 0 : _b.call(businessUtils, "discountcard"));
|
|
81
82
|
const handleClickCard = (e, type, val) => {
|
|
82
83
|
console.log(e, type, val, "handleClickCard");
|
|
83
84
|
if (type === "note") {
|
|
@@ -187,8 +188,8 @@ var CartItem = ({ onNext }) => {
|
|
|
187
188
|
hideAddBtn: false,
|
|
188
189
|
holders,
|
|
189
190
|
disabledEdit: isLastStep,
|
|
190
|
-
isShowChangeResource: (
|
|
191
|
-
isShowDelete: ((
|
|
191
|
+
isShowChangeResource: (_d = (_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key) == null ? void 0 : _d.startsWith("select-resource"),
|
|
192
|
+
isShowDelete: ((_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.key) === "select-service",
|
|
192
193
|
isShowPackageNote: false,
|
|
193
194
|
isShowChangeHolder: isLastStep ? false : isFormSubject && isLogin,
|
|
194
195
|
isShowHolder: isFormSubject,
|
|
@@ -205,7 +206,7 @@ var CartItem = ({ onNext }) => {
|
|
|
205
206
|
onChange: (e, type, key) => handleClickCard(e, type, key)
|
|
206
207
|
}
|
|
207
208
|
)),
|
|
208
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-footer" }, hasGoodPassApp ? /* @__PURE__ */ import_react.default.createElement(import_Voucher.default, { currentUser, products: carts }) : null, /* @__PURE__ */ import_react.default.createElement(import_Total.default, null), (carts == null ? void 0 : carts.length) > 0 && (deposit == null ? void 0 : deposit.hasDeposit) ? /* @__PURE__ */ import_react.default.createElement(import_Deposit.default, null) : null, /* @__PURE__ */ import_react.default.createElement(import_ContinueButton.default, { onNext }))
|
|
209
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-footer" }, hasGoodPassApp || hasDiscountCardApp ? /* @__PURE__ */ import_react.default.createElement(import_Voucher.default, { currentUser, products: carts }) : null, /* @__PURE__ */ import_react.default.createElement(import_Total.default, null), (carts == null ? void 0 : carts.length) > 0 && (deposit == null ? void 0 : deposit.hasDeposit) ? /* @__PURE__ */ import_react.default.createElement(import_Deposit.default, null) : null, /* @__PURE__ */ import_react.default.createElement(import_ContinueButton.default, { onNext }))
|
|
209
210
|
));
|
|
210
211
|
};
|
|
211
212
|
var Item_default = CartItem;
|