@pisell/private-materials 3.4.89 → 3.4.91
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 +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/footer/utils.js +20 -7
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service2/utils.js +43 -39
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/utils.js +13 -1
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service2/utils.js +15 -13
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/package.json +3 -3
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
7
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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 dayjs from 'dayjs';
|
|
14
14
|
import { flexibleObj, isNowTime, getNowTime } from "../../utils";
|
|
15
15
|
import { isWalkIn } from "../../utils";
|
|
@@ -105,6 +105,7 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
105
105
|
}
|
|
106
106
|
} catch (error) {}
|
|
107
107
|
return bundle.map(function (d) {
|
|
108
|
+
var _d$metadata;
|
|
108
109
|
var option = formatProductOption(d.option);
|
|
109
110
|
var option_price = option.reduce(function (temp, item) {
|
|
110
111
|
return temp + Number(item.num) * item.custom_add_price;
|
|
@@ -113,6 +114,18 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
113
114
|
var _cur$metadata;
|
|
114
115
|
return pre + ((cur === null || cur === void 0 || (_cur$metadata = cur.metadata) === null || _cur$metadata === void 0 ? void 0 : _cur$metadata.product_discount_difference) || 0);
|
|
115
116
|
}, 0);
|
|
117
|
+
|
|
118
|
+
// 提取套餐商品的唯一标识元数据
|
|
119
|
+
var metadata = {};
|
|
120
|
+
var _metadata = (_d$metadata = d === null || d === void 0 ? void 0 : d.metadata) !== null && _d$metadata !== void 0 ? _d$metadata : {};
|
|
121
|
+
|
|
122
|
+
// 定义需要提取的元数据字段列表(便于扩展)
|
|
123
|
+
var targetFields = ['custom_product_bundle_map_id', 'unique_identification_number'];
|
|
124
|
+
targetFields.forEach(function (field) {
|
|
125
|
+
if (_metadata[field]) {
|
|
126
|
+
metadata[field] = _metadata[field];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
116
129
|
return {
|
|
117
130
|
"bundle_group_id": d.group_id,
|
|
118
131
|
"bundle_id": d.id,
|
|
@@ -129,10 +142,10 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
129
142
|
"option": option,
|
|
130
143
|
"bundle_selling_price": d === null || d === void 0 ? void 0 : d.price,
|
|
131
144
|
"bundle_sum_price": (d === null || d === void 0 ? void 0 : d.original_price) || (d === null || d === void 0 ? void 0 : d.original_total),
|
|
132
|
-
metadata: {
|
|
145
|
+
metadata: _objectSpread({
|
|
133
146
|
custom_product_bundle_map_id: d._id,
|
|
134
147
|
product_discount_difference: product_discount_difference
|
|
135
|
-
}
|
|
148
|
+
}, metadata)
|
|
136
149
|
};
|
|
137
150
|
});
|
|
138
151
|
};
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from '../model';
|
|
1
3
|
export declare const walkInData: {
|
|
2
4
|
id: number;
|
|
3
5
|
nickname: string;
|
|
4
6
|
};
|
|
5
|
-
export declare const Provider: any, Context:
|
|
7
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
8
|
+
state: FormState;
|
|
9
|
+
} & {
|
|
10
|
+
dispatch: (params: {
|
|
11
|
+
type: string;
|
|
12
|
+
payload: any;
|
|
13
|
+
}) => void;
|
|
14
|
+
}>;
|
|
@@ -215,12 +215,14 @@ export var handleChangeHolder = function handleChangeHolder(products, currentIte
|
|
|
215
215
|
var handleAddHolder = function handleAddHolder() {};
|
|
216
216
|
var handleLike = function handleLike(products, currentItem, other) {
|
|
217
217
|
return products.map(function (item) {
|
|
218
|
+
var _item$_extend3, _item$_extend4;
|
|
219
|
+
var isSameGroup = (item === null || item === void 0 || (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.groupId) && ((_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.groupId) === (currentItem === null || currentItem === void 0 ? void 0 : currentItem.serviceId);
|
|
218
220
|
if (currentItem.isParallelResource) {
|
|
219
|
-
if (item._id === currentItem.serviceId) {
|
|
220
|
-
var _item$
|
|
221
|
+
if (item._id === currentItem.serviceId || isSameGroup) {
|
|
222
|
+
var _item$_extend5, _item$_extend6;
|
|
221
223
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
222
224
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
223
|
-
resource: _objectSpread(_objectSpread({}, (_item$
|
|
225
|
+
resource: _objectSpread(_objectSpread({}, (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.resource), {}, _defineProperty({}, currentItem.resourceId, (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.resource[currentItem.resourceId].map(function (item) {
|
|
224
226
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
225
227
|
like_status: other.like_status
|
|
226
228
|
});
|
|
@@ -230,7 +232,7 @@ var handleLike = function handleLike(products, currentItem, other) {
|
|
|
230
232
|
}
|
|
231
233
|
return item;
|
|
232
234
|
} else {
|
|
233
|
-
if (item._id === currentItem._id) {
|
|
235
|
+
if (item._id === currentItem._id || isSameGroup) {
|
|
234
236
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
235
237
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
236
238
|
like_status: other.like_status
|
|
@@ -245,14 +247,16 @@ var handleLike = function handleLike(products, currentItem, other) {
|
|
|
245
247
|
// 更新资源
|
|
246
248
|
var handleChangeResource = function handleChangeResource(products, currentItem, other, state) {
|
|
247
249
|
return products.map(function (item) {
|
|
250
|
+
var _item$_extend7, _item$_extend8, _currentItem$_origin2;
|
|
248
251
|
var _ref = other || {},
|
|
249
252
|
props = _ref.props,
|
|
250
253
|
value = _ref.value;
|
|
251
254
|
var _ref2 = props || {},
|
|
252
255
|
isParallelResource = _ref2.isParallelResource,
|
|
253
256
|
resourceId = _ref2.resourceId;
|
|
257
|
+
var isSameGroup = (item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.groupId) && ((_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.groupId) === (currentItem === null || currentItem === void 0 || (_currentItem$_origin2 = currentItem._origin) === null || _currentItem$_origin2 === void 0 || (_currentItem$_origin2 = _currentItem$_origin2._extend) === null || _currentItem$_origin2 === void 0 ? void 0 : _currentItem$_origin2.groupId);
|
|
254
258
|
if (isParallelResource) {
|
|
255
|
-
if (item._id === currentItem._id) {
|
|
259
|
+
if (item._id === currentItem._id || isSameGroup) {
|
|
256
260
|
var hasDataItem = getProductExtend({
|
|
257
261
|
cacheItem: _objectSpread(_objectSpread({}, item), {}, {
|
|
258
262
|
new: 0
|
|
@@ -286,7 +290,7 @@ var handleChangeResource = function handleChangeResource(products, currentItem,
|
|
|
286
290
|
}
|
|
287
291
|
return item;
|
|
288
292
|
} else {
|
|
289
|
-
if (item._id === currentItem._id) {
|
|
293
|
+
if (item._id === currentItem._id || isSameGroup) {
|
|
290
294
|
var _resourceItem$_extend;
|
|
291
295
|
var resourceItem = currentResource(state, other.id, item);
|
|
292
296
|
var _ref3 = (resourceItem === null || resourceItem === void 0 || (_resourceItem$_extend = resourceItem._extend) === null || _resourceItem$_extend === void 0 ? void 0 : _resourceItem$_extend.usableTime) || {},
|
|
@@ -345,8 +349,8 @@ export var updateServices = function updateServices(state, currentItem, type, ot
|
|
|
345
349
|
if (type === 'delete_holders') {
|
|
346
350
|
var _products2;
|
|
347
351
|
products = (_products2 = products) === null || _products2 === void 0 ? void 0 : _products2.filter(function (item) {
|
|
348
|
-
var _item$
|
|
349
|
-
return (item === null || item === void 0 || (_item$
|
|
352
|
+
var _item$_extend9;
|
|
353
|
+
return (item === null || item === void 0 || (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.holder_id) !== other;
|
|
350
354
|
});
|
|
351
355
|
}
|
|
352
356
|
|
|
@@ -547,7 +551,7 @@ export var isAllNormalProductByState = function isAllNormalProductByState(state)
|
|
|
547
551
|
return isAllNormalProduct(state.service.value);
|
|
548
552
|
};
|
|
549
553
|
var getGeneralParams = function getGeneralParams(item, state, isParallelResource) {
|
|
550
|
-
var _formData$, _item$
|
|
554
|
+
var _formData$, _item$_extend11, _item$_extend12, _item$_extend13, _item$_extend14, _item$_extend15;
|
|
551
555
|
var pet = state.pet,
|
|
552
556
|
service = state.service;
|
|
553
557
|
var _ref8 = pet || {},
|
|
@@ -590,7 +594,7 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
590
594
|
};
|
|
591
595
|
});
|
|
592
596
|
} else {
|
|
593
|
-
var _item$
|
|
597
|
+
var _item$_extend10;
|
|
594
598
|
var _ref10 = service || {},
|
|
595
599
|
resourcesOrigin = _ref10.resourcesOrigin;
|
|
596
600
|
var resource = formatResources({
|
|
@@ -601,7 +605,7 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
601
605
|
multiResources = [{
|
|
602
606
|
_id: item._id,
|
|
603
607
|
id: item._extend.resource,
|
|
604
|
-
status: ((_item$
|
|
608
|
+
status: ((_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.like_status) || 'common',
|
|
605
609
|
lists: mapListItems(resource)
|
|
606
610
|
}];
|
|
607
611
|
}
|
|
@@ -622,10 +626,10 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
622
626
|
holderMode: (item === null || item === void 0 ? void 0 : item._extend.quantity) > 1 ? 'multiple' : undefined,
|
|
623
627
|
isErrorHolder: getIsSubjectRequire(state),
|
|
624
628
|
addHolderButtonText: (formData === null || formData === void 0 || (_formData$ = formData[0]) === null || _formData$ === void 0 || (_formData$ = _formData$.form) === null || _formData$ === void 0 ? void 0 : _formData$.title) || "",
|
|
625
|
-
holder_id: item === null || item === void 0 || (_item$
|
|
626
|
-
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$
|
|
627
|
-
end_date: !isNormalProduct ? (item === null || item === void 0 || (_item$
|
|
628
|
-
rowKey: "rowKey-".concat(item === null || item === void 0 || (_item$
|
|
629
|
+
holder_id: item === null || item === void 0 || (_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.holder_id,
|
|
630
|
+
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.startDate : "",
|
|
631
|
+
end_date: !isNormalProduct ? (item === null || item === void 0 || (_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.endDate) || (item === null || item === void 0 || (_item$_extend14 = item._extend) === null || _item$_extend14 === void 0 ? void 0 : _item$_extend14.end_date) : "",
|
|
632
|
+
rowKey: "rowKey-".concat(item === null || item === void 0 || (_item$_extend15 = item._extend) === null || _item$_extend15 === void 0 || (_item$_extend15 = _item$_extend15.other) === null || _item$_extend15 === void 0 ? void 0 : _item$_extend15.rowKey)
|
|
629
633
|
}, parallelResourceOtherParams);
|
|
630
634
|
};
|
|
631
635
|
var calcAddTimeTotalPrice = function calcAddTimeTotalPrice(total, addTimeProducts) {
|
|
@@ -648,18 +652,18 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
648
652
|
var normalList = [];
|
|
649
653
|
var groupList = [];
|
|
650
654
|
var formItem = function formItem(item) {
|
|
651
|
-
var _item$
|
|
655
|
+
var _item$_extend16, _item$_extend17, _item$_extend18, _item$_extend20, _item$_extend21, _item$_extend22, _item$_extend23, _item$_extend24, _item$_extend25, _item$_extend26, _item$_extend27, _item$_extend28, _resourceItem, _item$_extend29, _item$_extend30, _item$_extend31, _item$_extend32, _item$_extend33;
|
|
652
656
|
var _isDayBookingProduct = isDayBookingProduct(item, state);
|
|
653
|
-
var clientTitle = getHolderName(state, item === null || item === void 0 || (_item$
|
|
654
|
-
var options = formatOptions(item === null || item === void 0 || (_item$
|
|
655
|
-
var bundle = formatBundle(item === null || item === void 0 || (_item$
|
|
657
|
+
var clientTitle = getHolderName(state, item === null || item === void 0 || (_item$_extend16 = item._extend) === null || _item$_extend16 === void 0 ? void 0 : _item$_extend16.holder_id);
|
|
658
|
+
var options = formatOptions(item === null || item === void 0 || (_item$_extend17 = item._extend) === null || _item$_extend17 === void 0 || (_item$_extend17 = _item$_extend17.other) === null || _item$_extend17 === void 0 ? void 0 : _item$_extend17.option);
|
|
659
|
+
var bundle = formatBundle(item === null || item === void 0 || (_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 || (_item$_extend18 = _item$_extend18.other) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.bundle);
|
|
656
660
|
// 是否是普通商品
|
|
657
661
|
var isNormalProduct = !appointmentTypes.includes(item === null || item === void 0 ? void 0 : item.extension_type) || (state === null || state === void 0 ? void 0 : state.renderType) === 'eventBooking';
|
|
658
662
|
var resourceItem = {};
|
|
659
663
|
var errorMessage = '';
|
|
660
664
|
if (_isDayBookingProduct || isGeneral) {
|
|
661
|
-
var _item$
|
|
662
|
-
resourceItem = getResourceItem(item === null || item === void 0 || (_item$
|
|
665
|
+
var _item$_extend19;
|
|
666
|
+
resourceItem = getResourceItem(item === null || item === void 0 || (_item$_extend19 = item._extend) === null || _item$_extend19 === void 0 ? void 0 : _item$_extend19.resource, state);
|
|
663
667
|
errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
|
|
664
668
|
}
|
|
665
669
|
var generalParams = isGeneral ? getGeneralParams(item, state, !!isParallelResource) : {};
|
|
@@ -667,31 +671,31 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
667
671
|
id: item === null || item === void 0 ? void 0 : item.id,
|
|
668
672
|
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
669
673
|
name: item === null || item === void 0 ? void 0 : item.title,
|
|
670
|
-
price: item === null || item === void 0 || (_item$
|
|
674
|
+
price: item === null || item === void 0 || (_item$_extend20 = item._extend) === null || _item$_extend20 === void 0 ? void 0 : _item$_extend20.price,
|
|
671
675
|
totalDifference: getProductDiscountProductDiscountDifference(item),
|
|
672
|
-
total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$
|
|
673
|
-
origin_total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$
|
|
676
|
+
total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$_extend21 = item._extend) === null || _item$_extend21 === void 0 ? void 0 : _item$_extend21.total, item === null || item === void 0 || (_item$_extend22 = item._extend) === null || _item$_extend22 === void 0 ? void 0 : _item$_extend22.relation_details),
|
|
677
|
+
origin_total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$_extend23 = item._extend) === null || _item$_extend23 === void 0 ? void 0 : _item$_extend23.origin_total, item === null || item === void 0 || (_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.relation_details),
|
|
674
678
|
num: item === null || item === void 0 ? void 0 : item._extend.quantity,
|
|
675
679
|
image: item === null || item === void 0 ? void 0 : item.cover,
|
|
676
680
|
isShowNote: true,
|
|
677
681
|
note: item === null || item === void 0 ? void 0 : item.note,
|
|
678
|
-
like_status: item === null || item === void 0 || (_item$
|
|
682
|
+
like_status: item === null || item === void 0 || (_item$_extend25 = item._extend) === null || _item$_extend25 === void 0 ? void 0 : _item$_extend25.like_status,
|
|
679
683
|
bundle: bundle,
|
|
680
684
|
options: options,
|
|
681
685
|
errorMessage: errorMessage,
|
|
682
|
-
product_option_string: item === null || item === void 0 || (_item$
|
|
683
|
-
discount_reason: item === null || item === void 0 || (_item$
|
|
684
|
-
resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$
|
|
686
|
+
product_option_string: item === null || item === void 0 || (_item$_extend26 = item._extend) === null || _item$_extend26 === void 0 || (_item$_extend26 = _item$_extend26.other) === null || _item$_extend26 === void 0 ? void 0 : _item$_extend26.product_option_string,
|
|
687
|
+
discount_reason: item === null || item === void 0 || (_item$_extend27 = item._extend) === null || _item$_extend27 === void 0 ? void 0 : _item$_extend27.discount_reason,
|
|
688
|
+
resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$_extend28 = item._extend) === null || _item$_extend28 === void 0 ? void 0 : _item$_extend28.resource,
|
|
685
689
|
relation_form_name: isNormalProduct ? '' : ((_resourceItem = resourceItem) === null || _resourceItem === void 0 ? void 0 : _resourceItem.labelText) || item.relation_form_name,
|
|
686
690
|
holder_title: clientTitle,
|
|
687
|
-
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$
|
|
688
|
-
end_date: !isNormalProduct ? item === null || item === void 0 || (_item$
|
|
689
|
-
holder_id: (item === null || item === void 0 || (_item$
|
|
691
|
+
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.start_date : '',
|
|
692
|
+
end_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend30 = item._extend) === null || _item$_extend30 === void 0 ? void 0 : _item$_extend30.end_date : '',
|
|
693
|
+
holder_id: (item === null || item === void 0 || (_item$_extend31 = item._extend) === null || _item$_extend31 === void 0 ? void 0 : _item$_extend31.holder_id) || 0,
|
|
690
694
|
isNormalProduct: isNormalProduct,
|
|
691
695
|
locale: state.locale,
|
|
692
696
|
symbol: state.amountSymbol,
|
|
693
|
-
relation_products: (item === null || item === void 0 || (_item$
|
|
694
|
-
items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$
|
|
697
|
+
relation_products: (item === null || item === void 0 || (_item$_extend32 = item._extend) === null || _item$_extend32 === void 0 ? void 0 : _item$_extend32.relation_details) || [],
|
|
698
|
+
items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$_extend33 = item._extend) === null || _item$_extend33 === void 0 ? void 0 : _item$_extend33.items) || [])
|
|
695
699
|
}, generalParams), {}, {
|
|
696
700
|
_origin: item
|
|
697
701
|
});
|
|
@@ -700,8 +704,8 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
700
704
|
if (isRenderGroup) {
|
|
701
705
|
// 将商品分为组商品和非组商品
|
|
702
706
|
lists.forEach(function (item) {
|
|
703
|
-
var _item$
|
|
704
|
-
if (!(item !== null && item !== void 0 && (_item$
|
|
707
|
+
var _item$_extend34;
|
|
708
|
+
if (!(item !== null && item !== void 0 && (_item$_extend34 = item._extend) !== null && _item$_extend34 !== void 0 && _item$_extend34.groupId)) {
|
|
705
709
|
normalList.push(formItem(item));
|
|
706
710
|
} else {
|
|
707
711
|
groupList.push(item);
|
|
@@ -710,8 +714,8 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
710
714
|
|
|
711
715
|
// 根据item._extend.groupId 进行分组
|
|
712
716
|
var groups = groupList.reduce(function (prev, item) {
|
|
713
|
-
var _item$
|
|
714
|
-
var groupId = item === null || item === void 0 || (_item$
|
|
717
|
+
var _item$_extend35;
|
|
718
|
+
var groupId = item === null || item === void 0 || (_item$_extend35 = item._extend) === null || _item$_extend35 === void 0 ? void 0 : _item$_extend35.groupId;
|
|
715
719
|
if (!prev[groupId]) {
|
|
716
720
|
prev[groupId] = [];
|
|
717
721
|
}
|
|
@@ -879,8 +883,8 @@ export var isHasDayAppointmentProduct = function isHasDayAppointmentProduct(stat
|
|
|
879
883
|
// 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
|
|
880
884
|
// services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
|
|
881
885
|
services: services.filter(function (item) {
|
|
882
|
-
var _item$
|
|
883
|
-
return ((_item$
|
|
886
|
+
var _item$_extend36;
|
|
887
|
+
return ((_item$_extend36 = item._extend) === null || _item$_extend36 === void 0 ? void 0 : _item$_extend36.holder_id) == d.form_record_id && checkType(item.extension_type);
|
|
884
888
|
})
|
|
885
889
|
});
|
|
886
890
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
amountSymbol: string;
|
|
3
4
|
apis: {
|
|
@@ -108,4 +109,11 @@ export declare const walkInData: {
|
|
|
108
109
|
id: number;
|
|
109
110
|
nickname: string;
|
|
110
111
|
};
|
|
111
|
-
export declare const Provider: any, Context:
|
|
112
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
113
|
+
state: FormState;
|
|
114
|
+
} & {
|
|
115
|
+
dispatch: (params: {
|
|
116
|
+
type: string;
|
|
117
|
+
payload: any;
|
|
118
|
+
}) => void;
|
|
119
|
+
}>;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PosProps, RouteType } from './const';
|
|
3
|
-
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "
|
|
3
|
+
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "mode" | "type" | "getApi"> & {
|
|
4
4
|
action: RouteType;
|
|
5
5
|
device_number: string | number;
|
|
6
6
|
api: ReturnType<PosProps['getApi']>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
3
4
|
order: any;
|
|
@@ -29,4 +30,11 @@ export interface PayGroup {
|
|
|
29
30
|
_order: any;
|
|
30
31
|
front_order_uuid?: string;
|
|
31
32
|
}
|
|
32
|
-
export declare const Provider: any, Context:
|
|
33
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
34
|
+
state: FormState;
|
|
35
|
+
} & {
|
|
36
|
+
dispatch: (params: {
|
|
37
|
+
type: string;
|
|
38
|
+
payload: any;
|
|
39
|
+
}) => void;
|
|
40
|
+
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,4 +69,11 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: any, Context:
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
73
|
+
state: FormState;
|
|
74
|
+
} & {
|
|
75
|
+
dispatch: (params: {
|
|
76
|
+
type: string;
|
|
77
|
+
payload: any;
|
|
78
|
+
}) => void;
|
|
79
|
+
}>;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -112,6 +112,17 @@ var formatProductBundle = (bundle) => {
|
|
|
112
112
|
var _a;
|
|
113
113
|
return pre + (((_a = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a.product_discount_difference) || 0);
|
|
114
114
|
}, 0);
|
|
115
|
+
const metadata = {};
|
|
116
|
+
const _metadata = (d == null ? void 0 : d.metadata) ?? {};
|
|
117
|
+
const targetFields = [
|
|
118
|
+
"custom_product_bundle_map_id",
|
|
119
|
+
"unique_identification_number"
|
|
120
|
+
];
|
|
121
|
+
targetFields.forEach((field) => {
|
|
122
|
+
if (_metadata[field]) {
|
|
123
|
+
metadata[field] = _metadata[field];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
115
126
|
return {
|
|
116
127
|
"bundle_group_id": d.group_id,
|
|
117
128
|
"bundle_id": d.id,
|
|
@@ -130,7 +141,8 @@ var formatProductBundle = (bundle) => {
|
|
|
130
141
|
"bundle_sum_price": (d == null ? void 0 : d.original_price) || (d == null ? void 0 : d.original_total),
|
|
131
142
|
metadata: {
|
|
132
143
|
custom_product_bundle_map_id: d._id,
|
|
133
|
-
product_discount_difference
|
|
144
|
+
product_discount_difference,
|
|
145
|
+
...metadata
|
|
134
146
|
}
|
|
135
147
|
};
|
|
136
148
|
});
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from '../model';
|
|
1
3
|
export declare const walkInData: {
|
|
2
4
|
id: number;
|
|
3
5
|
nickname: string;
|
|
4
6
|
};
|
|
5
|
-
export declare const Provider: any, Context:
|
|
7
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
8
|
+
state: FormState;
|
|
9
|
+
} & {
|
|
10
|
+
dispatch: (params: {
|
|
11
|
+
type: string;
|
|
12
|
+
payload: any;
|
|
13
|
+
}) => void;
|
|
14
|
+
}>;
|
|
@@ -189,16 +189,17 @@ var handleChangeHolder = (products, currentItem, other) => {
|
|
|
189
189
|
};
|
|
190
190
|
var handleLike = (products, currentItem, other) => {
|
|
191
191
|
return products.map((item) => {
|
|
192
|
-
var _a, _b;
|
|
192
|
+
var _a, _b, _c, _d;
|
|
193
|
+
const isSameGroup = ((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId) && ((_b = item._extend) == null ? void 0 : _b.groupId) === (currentItem == null ? void 0 : currentItem.serviceId);
|
|
193
194
|
if (currentItem.isParallelResource) {
|
|
194
|
-
if (item._id === currentItem.serviceId) {
|
|
195
|
+
if (item._id === currentItem.serviceId || isSameGroup) {
|
|
195
196
|
return {
|
|
196
197
|
...item,
|
|
197
198
|
_extend: {
|
|
198
199
|
...item._extend,
|
|
199
200
|
resource: {
|
|
200
|
-
...(
|
|
201
|
-
[currentItem.resourceId]: (
|
|
201
|
+
...(_c = item._extend) == null ? void 0 : _c.resource,
|
|
202
|
+
[currentItem.resourceId]: (_d = item._extend) == null ? void 0 : _d.resource[currentItem.resourceId].map((item2) => ({
|
|
202
203
|
...item2,
|
|
203
204
|
like_status: other.like_status
|
|
204
205
|
}))
|
|
@@ -208,7 +209,7 @@ var handleLike = (products, currentItem, other) => {
|
|
|
208
209
|
}
|
|
209
210
|
return item;
|
|
210
211
|
} else {
|
|
211
|
-
if (item._id === currentItem._id) {
|
|
212
|
+
if (item._id === currentItem._id || isSameGroup) {
|
|
212
213
|
return {
|
|
213
214
|
...item,
|
|
214
215
|
_extend: {
|
|
@@ -223,11 +224,12 @@ var handleLike = (products, currentItem, other) => {
|
|
|
223
224
|
};
|
|
224
225
|
var handleChangeResource = (products, currentItem, other, state) => {
|
|
225
226
|
return products.map((item) => {
|
|
226
|
-
var _a;
|
|
227
|
+
var _a, _b, _c, _d, _e;
|
|
227
228
|
const { props, value } = other || {};
|
|
228
229
|
const { isParallelResource, resourceId } = props || {};
|
|
230
|
+
const isSameGroup = ((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId) && ((_b = item._extend) == null ? void 0 : _b.groupId) === ((_d = (_c = currentItem == null ? void 0 : currentItem._origin) == null ? void 0 : _c._extend) == null ? void 0 : _d.groupId);
|
|
229
231
|
if (isParallelResource) {
|
|
230
|
-
if (item._id === currentItem._id) {
|
|
232
|
+
if (item._id === currentItem._id || isSameGroup) {
|
|
231
233
|
const hasDataItem = (0, import_utils6.getProductExtend)({
|
|
232
234
|
cacheItem: { ...item, new: 0 },
|
|
233
235
|
state
|
|
@@ -237,21 +239,21 @@ var handleChangeResource = (products, currentItem, other, state) => {
|
|
|
237
239
|
return pre;
|
|
238
240
|
}, {}) : {};
|
|
239
241
|
item._extend.resource[resourceId] = value.map((d) => {
|
|
240
|
-
var _a2,
|
|
242
|
+
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i;
|
|
241
243
|
const currentForm = ((_a2 = hasDataItem._data.resourceMaps) == null ? void 0 : _a2[resourceId]) || {};
|
|
242
244
|
return (
|
|
243
245
|
// maps[d] 为真时, 说明是之前已选择, 否则为新增的值,补充数据
|
|
244
246
|
maps[d] || {
|
|
245
|
-
relation_type: ((
|
|
247
|
+
relation_type: ((_c2 = (_b2 = currentForm.renderListMaps[d]) == null ? void 0 : _b2.usable) == null ? void 0 : _c2.relation_type) || "form",
|
|
246
248
|
form_id: resourceId,
|
|
247
249
|
relation_id: d,
|
|
248
250
|
like_status: "common",
|
|
249
251
|
// 新添加的数据补充错误信息
|
|
250
252
|
errors: (0, import_utilsByBooking.getErrorList)(
|
|
251
|
-
(
|
|
253
|
+
(_d2 = currentForm.renderListMaps) == null ? void 0 : _d2[d],
|
|
252
254
|
hasDataItem
|
|
253
255
|
),
|
|
254
|
-
children: (_f = (
|
|
256
|
+
children: (_f = (_e2 = currentForm.renderListMaps) == null ? void 0 : _e2[d]) == null ? void 0 : _f.children,
|
|
255
257
|
metadata: {
|
|
256
258
|
...(_h = (_g = currentForm.renderListMaps) == null ? void 0 : _g[d]) == null ? void 0 : _h.metadata,
|
|
257
259
|
form_name: currentForm.title,
|
|
@@ -263,9 +265,9 @@ var handleChangeResource = (products, currentItem, other, state) => {
|
|
|
263
265
|
}
|
|
264
266
|
return item;
|
|
265
267
|
} else {
|
|
266
|
-
if (item._id === currentItem._id) {
|
|
268
|
+
if (item._id === currentItem._id || isSameGroup) {
|
|
267
269
|
const resourceItem = currentResource(state, other.id, item);
|
|
268
|
-
const { relation_type, item_id, schedule_id } = ((
|
|
270
|
+
const { relation_type, item_id, schedule_id } = ((_e = resourceItem == null ? void 0 : resourceItem._extend) == null ? void 0 : _e.usableTime) || {};
|
|
269
271
|
return {
|
|
270
272
|
...item,
|
|
271
273
|
_extend: {
|