@pisell/private-materials 6.4.71 → 6.4.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/footer/amount.js +25 -8
- package/es/components/booking/components/footer/utils.d.ts +7 -0
- package/es/components/booking/components/footer/utils.js +46 -22
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/hooks/useQuotation.js +69 -21
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/Lists.js +1 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/serve.d.ts +14 -0
- package/es/components/booking/info/service/serve.js +22 -1
- package/es/components/booking/info/service2/Group/utils.js +2 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -33
- package/es/components/booking/info/service2/utils.js +75 -29
- package/es/components/booking/info/utils.js +5 -0
- package/es/components/booking/info2/service/addService/index.js +146 -89
- package/es/components/booking/info2/service/addService/utils.d.ts +9 -1
- package/es/components/booking/info2/service/addService/utils.js +78 -9
- package/es/components/booking/info2/service/editService/index.js +235 -55
- package/es/components/booking/info2/utilsByBooking.js +14 -5
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +9 -1
- package/es/components/booking/utils.js +23 -0
- package/es/components/checkout/hooks/useWalletPass.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/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +283 -138
- package/es/components/ticketBooking/components/ticketBooking/index.js +14 -11
- package/es/components/ticketBooking/utils/index.d.ts +6 -1
- package/es/components/ticketBooking/utils/index.js +21 -3
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +355 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/es/pro/multiDayTimeSelect/index.js +1 -0
- package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/es/pro/multiDayTimeSelect/types.js +1 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/footer/amount.js +23 -6
- package/lib/components/booking/components/footer/utils.d.ts +7 -0
- package/lib/components/booking/components/footer/utils.js +23 -11
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/hooks/useQuotation.js +45 -13
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/Lists.js +1 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/serve.d.ts +14 -0
- package/lib/components/booking/info/service/serve.js +5 -0
- package/lib/components/booking/info/service2/Group/utils.js +2 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -33
- package/lib/components/booking/info/service2/utils.js +24 -10
- package/lib/components/booking/info/utils.js +4 -0
- package/lib/components/booking/info2/service/addService/index.js +22 -3
- package/lib/components/booking/info2/service/addService/utils.d.ts +9 -1
- package/lib/components/booking/info2/service/addService/utils.js +47 -9
- package/lib/components/booking/info2/service/editService/index.js +191 -31
- package/lib/components/booking/info2/utilsByBooking.js +19 -8
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +9 -1
- package/lib/components/booking/utils.js +15 -0
- package/lib/components/checkout/hooks/useWalletPass.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/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +185 -119
- package/lib/components/ticketBooking/components/ticketBooking/index.js +0 -16
- package/lib/components/ticketBooking/utils/index.d.ts +6 -1
- package/lib/components/ticketBooking/utils/index.js +11 -1
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/lib/pro/multiDayTimeSelect/index.js +35 -0
- package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/lib/pro/multiDayTimeSelect/types.js +17 -0
- package/package.json +13 -13
|
@@ -28,7 +28,7 @@ import localeTexts from "../../locales";
|
|
|
28
28
|
import { concatBookings, isGroupBooking, getProductByGroupId } from "./Group/utils";
|
|
29
29
|
import { isShowAddTime } from "../utils";
|
|
30
30
|
import { formatResources } from "../service/addService/utils";
|
|
31
|
-
import { getProductExtend } from "../../info2/service/addService/utils";
|
|
31
|
+
import { getProductExtend, isMultiDayProduct } from "../../info2/service/addService/utils";
|
|
32
32
|
import { getErrorList as getErrorListInfo2 } from "../../info2/utilsByBooking";
|
|
33
33
|
import { getRelationDetailsTotal } from "../../components/footer/amount";
|
|
34
34
|
locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
|
|
@@ -616,10 +616,11 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
616
616
|
}];
|
|
617
617
|
}
|
|
618
618
|
var isNormalProduct = isNormalProductByDurationSchedule(item);
|
|
619
|
+
var isMultiDay = isMultiDayProduct(item);
|
|
619
620
|
return _objectSpread({
|
|
620
621
|
format: ['HH:mm', 'HH:mm'],
|
|
621
622
|
show_time: true,
|
|
622
|
-
duration_type: 'minutes',
|
|
623
|
+
duration_type: isMultiDay ? 'days' : 'minutes',
|
|
623
624
|
// 当前可选择holder列表
|
|
624
625
|
holders: formatHolders(holders),
|
|
625
626
|
isShowChangeHolder: !isNormalProduct,
|
|
@@ -655,8 +656,6 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
655
656
|
var isGeneral = arguments.length > 3 ? arguments[3] : undefined;
|
|
656
657
|
var isParallelResource = arguments.length > 4 ? arguments[4] : undefined;
|
|
657
658
|
if (!(lists !== null && lists !== void 0 && lists.length)) return [];
|
|
658
|
-
var normalList = [];
|
|
659
|
-
var groupList = [];
|
|
660
659
|
var formItem = function formItem(item) {
|
|
661
660
|
var _item$_extend10, _item$_extend11, _item$_extend12, _item$_extend14, _item$_extend15, _item$_extend16, _item$_extend17, _item$_extend18, _item$_extend19, _item$_extend20, _item$_extend21, _item$_extend22, _item$_extend23, _resourceItem, _item$_extend24, _item$_extend25, _item$_extend26, _item$_extend27, _item$_extend28;
|
|
662
661
|
var _isDayBookingProduct = isDayBookingProduct(item, state);
|
|
@@ -711,31 +710,78 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
711
710
|
_origin: item
|
|
712
711
|
});
|
|
713
712
|
};
|
|
714
|
-
console.log(normalList, 'normalList');
|
|
715
713
|
if (isRenderGroup) {
|
|
716
|
-
//
|
|
717
|
-
|
|
714
|
+
// 记录每个商品在原始列表中的索引
|
|
715
|
+
var normalItemsWithIndex = [];
|
|
716
|
+
var groupItemsWithIndex = [];
|
|
717
|
+
// 记录每个组第一次出现的索引
|
|
718
|
+
var groupFirstIndexMap = {};
|
|
719
|
+
|
|
720
|
+
// 将商品分为组商品和非组商品,并记录索引
|
|
721
|
+
lists.forEach(function (item, index) {
|
|
718
722
|
var _item$_extend29;
|
|
719
723
|
if (!(item !== null && item !== void 0 && (_item$_extend29 = item._extend) !== null && _item$_extend29 !== void 0 && _item$_extend29.groupId)) {
|
|
720
|
-
|
|
724
|
+
normalItemsWithIndex.push({
|
|
725
|
+
item: item,
|
|
726
|
+
index: index
|
|
727
|
+
});
|
|
721
728
|
} else {
|
|
722
|
-
|
|
729
|
+
var _item$_extend30;
|
|
730
|
+
var groupId = item === null || item === void 0 || (_item$_extend30 = item._extend) === null || _item$_extend30 === void 0 ? void 0 : _item$_extend30.groupId;
|
|
731
|
+
groupItemsWithIndex.push({
|
|
732
|
+
item: item,
|
|
733
|
+
index: index
|
|
734
|
+
});
|
|
735
|
+
// 记录组第一次出现的索引
|
|
736
|
+
if (groupFirstIndexMap[groupId] === undefined) {
|
|
737
|
+
groupFirstIndexMap[groupId] = index;
|
|
738
|
+
}
|
|
723
739
|
}
|
|
724
740
|
});
|
|
725
741
|
|
|
726
742
|
// 根据item._extend.groupId 进行分组
|
|
727
|
-
var groups =
|
|
728
|
-
var _item$
|
|
729
|
-
var
|
|
743
|
+
var groups = groupItemsWithIndex.reduce(function (prev, _ref11) {
|
|
744
|
+
var _item$_extend31;
|
|
745
|
+
var item = _ref11.item;
|
|
746
|
+
var groupId = item === null || item === void 0 || (_item$_extend31 = item._extend) === null || _item$_extend31 === void 0 ? void 0 : _item$_extend31.groupId;
|
|
730
747
|
if (!prev[groupId]) {
|
|
731
748
|
prev[groupId] = [];
|
|
732
749
|
}
|
|
733
750
|
prev[groupId].push(item);
|
|
734
751
|
return prev;
|
|
735
752
|
}, {});
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
753
|
+
|
|
754
|
+
// 将分组商品转换为合并后的商品,并记录组第一次出现的索引
|
|
755
|
+
var mergedGroupItems = Object.entries(groups).map(function (_ref12) {
|
|
756
|
+
var _ref13 = _slicedToArray(_ref12, 2),
|
|
757
|
+
groupId = _ref13[0],
|
|
758
|
+
items = _ref13[1];
|
|
759
|
+
return {
|
|
760
|
+
item: formItem(concatBookings(items)),
|
|
761
|
+
index: groupFirstIndexMap[groupId]
|
|
762
|
+
};
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
// 将非组商品格式化
|
|
766
|
+
var formattedNormalItems = normalItemsWithIndex.map(function (_ref14) {
|
|
767
|
+
var item = _ref14.item,
|
|
768
|
+
index = _ref14.index;
|
|
769
|
+
return {
|
|
770
|
+
item: formItem(item),
|
|
771
|
+
index: index
|
|
772
|
+
};
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
// 合并分组商品和非组商品,按照原始索引排序
|
|
776
|
+
var allItems = [].concat(_toConsumableArray(mergedGroupItems), _toConsumableArray(formattedNormalItems)).sort(function (a, b) {
|
|
777
|
+
return a.index - b.index;
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
// 返回格式化后的商品列表
|
|
781
|
+
return allItems.map(function (_ref15) {
|
|
782
|
+
var item = _ref15.item;
|
|
783
|
+
return item;
|
|
784
|
+
});
|
|
739
785
|
} else {
|
|
740
786
|
return lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
|
|
741
787
|
return formItem(item);
|
|
@@ -815,9 +861,9 @@ export var formatDayDate = function formatDayDate(_extend) {
|
|
|
815
861
|
* @Author: WangHan
|
|
816
862
|
* @Date: 2024-12-04 12:07
|
|
817
863
|
*/
|
|
818
|
-
export var formatDayTime = function formatDayTime(
|
|
819
|
-
var startDate =
|
|
820
|
-
endDate =
|
|
864
|
+
export var formatDayTime = function formatDayTime(_ref16) {
|
|
865
|
+
var startDate = _ref16.startDate,
|
|
866
|
+
endDate = _ref16.endDate;
|
|
821
867
|
// 营业日时间
|
|
822
868
|
var shopOpeningTime = localStorage.getItem('shopOpeningHours') || '00:00';
|
|
823
869
|
|
|
@@ -894,8 +940,8 @@ export var isHasDayAppointmentProduct = function isHasDayAppointmentProduct(stat
|
|
|
894
940
|
// 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
|
|
895
941
|
// services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
|
|
896
942
|
services: services.filter(function (item) {
|
|
897
|
-
var _item$
|
|
898
|
-
return ((_item$
|
|
943
|
+
var _item$_extend32;
|
|
944
|
+
return ((_item$_extend32 = item._extend) === null || _item$_extend32 === void 0 ? void 0 : _item$_extend32.holder_id) == d.form_record_id && checkType(item.extension_type);
|
|
899
945
|
})
|
|
900
946
|
});
|
|
901
947
|
});
|
|
@@ -1074,10 +1120,10 @@ function updateSinglePrice(currentValue, single) {
|
|
|
1074
1120
|
* @Author: WangHan
|
|
1075
1121
|
* @Date: 2024-12-31 15:17
|
|
1076
1122
|
*/
|
|
1077
|
-
function updateBundlePrice(currentValue,
|
|
1078
|
-
var
|
|
1079
|
-
bundle =
|
|
1080
|
-
single =
|
|
1123
|
+
function updateBundlePrice(currentValue, _ref17) {
|
|
1124
|
+
var _ref18 = _slicedToArray(_ref17, 2),
|
|
1125
|
+
bundle = _ref18[0],
|
|
1126
|
+
single = _ref18[1];
|
|
1081
1127
|
var _bundle = [];
|
|
1082
1128
|
var _loop2 = function _loop2() {
|
|
1083
1129
|
var item = currentValue[index];
|
|
@@ -1213,7 +1259,7 @@ export function updateNormalBundlePrice(currentValue, newBundleData) {
|
|
|
1213
1259
|
* @Date: 2024-12-31 15:15
|
|
1214
1260
|
*/
|
|
1215
1261
|
var normalServicePrice = /*#__PURE__*/function () {
|
|
1216
|
-
var
|
|
1262
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ids, state) {
|
|
1217
1263
|
var _state$service6, _state$client, _data$list;
|
|
1218
1264
|
var services, customerId, data, _lists;
|
|
1219
1265
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -1288,7 +1334,7 @@ var normalServicePrice = /*#__PURE__*/function () {
|
|
|
1288
1334
|
}, _callee);
|
|
1289
1335
|
}));
|
|
1290
1336
|
return function normalServicePrice(_x, _x2) {
|
|
1291
|
-
return
|
|
1337
|
+
return _ref19.apply(this, arguments);
|
|
1292
1338
|
};
|
|
1293
1339
|
}();
|
|
1294
1340
|
|
|
@@ -1302,13 +1348,13 @@ var normalServicePrice = /*#__PURE__*/function () {
|
|
|
1302
1348
|
* @Date: 2024-12-25 16:41
|
|
1303
1349
|
*/
|
|
1304
1350
|
export var updateAppointmentServicePrice = /*#__PURE__*/function () {
|
|
1305
|
-
var
|
|
1351
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(state, _ref20) {
|
|
1306
1352
|
var _state$service7;
|
|
1307
1353
|
var start_date, end_date, product_id, defaultReturn, _state$client2, _state$service$cacheI, _res$data, _res$data2, format, customer_id, _product_id, multi_day_price, startDate, endDate, params, res, _prices;
|
|
1308
1354
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1309
1355
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1310
1356
|
case 0:
|
|
1311
|
-
start_date =
|
|
1357
|
+
start_date = _ref20.start_date, end_date = _ref20.end_date, product_id = _ref20.product_id;
|
|
1312
1358
|
defaultReturn = {
|
|
1313
1359
|
multiDayPrices: [],
|
|
1314
1360
|
price: Number(state === null || state === void 0 || (_state$service7 = state.service) === null || _state$service7 === void 0 || (_state$service7 = _state$service7.cacheItem) === null || _state$service7 === void 0 || (_state$service7 = _state$service7._extend) === null || _state$service7 === void 0 ? void 0 : _state$service7.price) || 0
|
|
@@ -1371,7 +1417,7 @@ export var updateAppointmentServicePrice = /*#__PURE__*/function () {
|
|
|
1371
1417
|
}, _callee2, null, [[2, 21]]);
|
|
1372
1418
|
}));
|
|
1373
1419
|
return function updateAppointmentServicePrice(_x3, _x4) {
|
|
1374
|
-
return
|
|
1420
|
+
return _ref21.apply(this, arguments);
|
|
1375
1421
|
};
|
|
1376
1422
|
}();
|
|
1377
1423
|
|
|
@@ -7,6 +7,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7
7
|
import dayjs from "dayjs";
|
|
8
8
|
import { getDays, getIsEdit, isSessionProduct } from "../utils";
|
|
9
9
|
import { isUsableProduct } from "../info2/service/addTimeModal/utils";
|
|
10
|
+
import { isMultiDayProduct } from "../info2/service/addService/utils";
|
|
10
11
|
// 商品是套餐或单规格多规格
|
|
11
12
|
export var getIsBundleOrCombination = function getIsBundleOrCombination(productDetail) {
|
|
12
13
|
var _productDetail$bundle;
|
|
@@ -161,6 +162,10 @@ export var isOpenAddTime = function isOpenAddTime(state) {
|
|
|
161
162
|
|
|
162
163
|
// 是否展示加时按钮
|
|
163
164
|
export var isShowAddTime = function isShowAddTime(state, currentService) {
|
|
165
|
+
// 跨日预约不显示加时按钮
|
|
166
|
+
if (isMultiDayProduct(currentService)) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
164
169
|
if (!isOpenAddTime(state)) {
|
|
165
170
|
return false;
|
|
166
171
|
}
|
|
@@ -29,12 +29,13 @@ import "../../../info/service/addService/index.less";
|
|
|
29
29
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
30
30
|
import { getProductDetail } from "../../../info/service/serve";
|
|
31
31
|
import { getIsBundleOrCombination } from "../../../info/utils";
|
|
32
|
-
import { getProductExtend } from "./utils";
|
|
32
|
+
import { getMultiDay, getProductExtend, isMultiDayProduct } 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
36
|
import { isNormalProductByDurationSchedule } from "../../../info/service2/utils";
|
|
37
37
|
import { getIsShowNumber } from "../../../../ticketBooking/utils";
|
|
38
|
+
import { concatBookings, createBookingItemsByGroup } from "../../../info/service2/Group/utils";
|
|
38
39
|
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
|
|
39
40
|
var Info = function Info(props) {
|
|
40
41
|
var _state$client2, _state$service3, _state$service5, _state$service6;
|
|
@@ -276,98 +277,154 @@ var Info = function Info(props) {
|
|
|
276
277
|
isOS: isSession,
|
|
277
278
|
customer_id: (_state$client3 = state.client) === null || _state$client3 === void 0 || (_state$client3 = _state$client3.value) === null || _state$client3 === void 0 ? void 0 : _state$client3.id
|
|
278
279
|
},
|
|
279
|
-
callback: function
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
callback: function () {
|
|
281
|
+
var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(e, extension_type, detail) {
|
|
282
|
+
var _detail, other, cacheItem, isMultiDay, _total, _isEdit, _state$service$cacheI, getMultiDayCacheItem, newValue, _window$openBookingEd, _window;
|
|
283
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
284
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
285
|
+
case 0:
|
|
286
|
+
if (!lock) {
|
|
287
|
+
_context4.next = 2;
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
return _context4.abrupt("return");
|
|
291
|
+
case 2:
|
|
292
|
+
lock = true;
|
|
285
293
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
});
|
|
306
|
-
console.log(cacheItem, 'cacheItem', e);
|
|
307
|
-
var _total = getProductTotalPrice(cacheItem);
|
|
308
|
-
// 用于折扣 可修改
|
|
309
|
-
cacheItem._extend.total = _total;
|
|
310
|
-
// 用于储存原价
|
|
311
|
-
cacheItem._extend.origin_total = _total;
|
|
312
|
-
var _isEdit = !!state.service.cacheItem;
|
|
313
|
-
if (_isEdit) {
|
|
314
|
-
var _state$service$cacheI;
|
|
315
|
-
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
|
316
|
-
cacheItem.new = 0;
|
|
317
|
-
}
|
|
318
|
-
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
|
319
|
-
if (renderMode === 'current') {
|
|
320
|
-
// cacheItem._extend.resource = 0;
|
|
321
|
-
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
|
322
|
-
}
|
|
323
|
-
cacheItem = getProductExtend({
|
|
324
|
-
cacheItem: cacheItem,
|
|
325
|
-
state: state
|
|
326
|
-
});
|
|
327
|
-
if (state.renderType === 'eventBooking') {
|
|
328
|
-
cacheItem.autoClose = false;
|
|
329
|
-
}
|
|
330
|
-
if (cacheItem.autoClose) {
|
|
331
|
-
cacheItem.autoClose = false;
|
|
332
|
-
var newValue = _toConsumableArray(state.service.value);
|
|
333
|
-
if (!newValue.some(function (item) {
|
|
334
|
-
return item._id === cacheItem._id;
|
|
335
|
-
})) {
|
|
336
|
-
newValue.push(cacheItem);
|
|
337
|
-
} else {
|
|
338
|
-
newValue = newValue.map(function (item) {
|
|
339
|
-
if (item._id === cacheItem._id) {
|
|
340
|
-
return _objectSpread(_objectSpread({}, cacheItem), {}, {
|
|
341
|
-
new: 0
|
|
294
|
+
// 2秒后解除
|
|
295
|
+
setTimeout(function () {
|
|
296
|
+
lock = false;
|
|
297
|
+
}, 2000);
|
|
298
|
+
_detail = detail || item;
|
|
299
|
+
other = JSON.parse(JSON.stringify(e));
|
|
300
|
+
other.session = e.session;
|
|
301
|
+
cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
|
|
302
|
+
product_id: item.id,
|
|
303
|
+
_id: getUniqueId(),
|
|
304
|
+
_key: e.key,
|
|
305
|
+
_extend: {
|
|
306
|
+
start_date: state.date.value,
|
|
307
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
|
308
|
+
price: _detail.price,
|
|
309
|
+
product_name: item.title,
|
|
310
|
+
other: other
|
|
311
|
+
},
|
|
312
|
+
new: 1
|
|
342
313
|
});
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
314
|
+
isMultiDay = isMultiDayProduct(cacheItem);
|
|
315
|
+
if (isMultiDay) {
|
|
316
|
+
cacheItem._extend.end_date = state.date.value.add(1, 'day');
|
|
317
|
+
}
|
|
318
|
+
_total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
|
|
319
|
+
cacheItem._extend.total = _total;
|
|
320
|
+
// 用于储存原价
|
|
321
|
+
cacheItem._extend.origin_total = _total;
|
|
322
|
+
_isEdit = !!state.service.cacheItem;
|
|
323
|
+
if (_isEdit) {
|
|
324
|
+
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
|
325
|
+
cacheItem.new = 0;
|
|
326
|
+
}
|
|
327
|
+
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
|
328
|
+
if (renderMode === 'current') {
|
|
329
|
+
// cacheItem._extend.resource = 0;
|
|
330
|
+
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
|
331
|
+
}
|
|
332
|
+
cacheItem = getProductExtend({
|
|
333
|
+
cacheItem: cacheItem,
|
|
334
|
+
state: state
|
|
335
|
+
});
|
|
336
|
+
getMultiDayCacheItem = /*#__PURE__*/function () {
|
|
337
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(isConcatBookings) {
|
|
338
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
339
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
340
|
+
case 0:
|
|
341
|
+
_context3.next = 2;
|
|
342
|
+
return getMultiDay({
|
|
343
|
+
start_date: cacheItem._extend.start_date,
|
|
344
|
+
end_date: cacheItem._extend.end_date,
|
|
345
|
+
state: state,
|
|
346
|
+
cacheItem: cacheItem
|
|
347
|
+
});
|
|
348
|
+
case 2:
|
|
349
|
+
cacheItem = _context3.sent;
|
|
350
|
+
cacheItem = createBookingItemsByGroup(cacheItem);
|
|
351
|
+
if (isConcatBookings) {
|
|
352
|
+
cacheItem = concatBookings(cacheItem);
|
|
353
|
+
}
|
|
354
|
+
case 5:
|
|
355
|
+
case "end":
|
|
356
|
+
return _context3.stop();
|
|
357
|
+
}
|
|
358
|
+
}, _callee3);
|
|
359
|
+
}));
|
|
360
|
+
return function getMultiDayCacheItem(_x6) {
|
|
361
|
+
return _ref3.apply(this, arguments);
|
|
362
|
+
};
|
|
363
|
+
}();
|
|
364
|
+
if (state.renderType === 'eventBooking' || isMultiDay) {
|
|
365
|
+
cacheItem.autoClose = false;
|
|
366
|
+
}
|
|
367
|
+
if (!cacheItem.autoClose) {
|
|
368
|
+
_context4.next = 26;
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
cacheItem.autoClose = false;
|
|
372
|
+
newValue = _toConsumableArray(state.service.value);
|
|
373
|
+
if (!newValue.some(function (item) {
|
|
374
|
+
return item._id === cacheItem._id;
|
|
375
|
+
})) {
|
|
376
|
+
newValue.push(cacheItem);
|
|
377
|
+
} else {
|
|
378
|
+
newValue = newValue.map(function (item) {
|
|
379
|
+
if (item._id === cacheItem._id) {
|
|
380
|
+
return _objectSpread(_objectSpread({}, cacheItem), {}, {
|
|
381
|
+
new: 0
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
return item;
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
dispatch({
|
|
388
|
+
type: 'setService',
|
|
389
|
+
payload: {
|
|
390
|
+
addModal: false,
|
|
391
|
+
value: newValue,
|
|
392
|
+
edit: true,
|
|
393
|
+
changeService: false
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
_context4.next = 32;
|
|
397
|
+
break;
|
|
398
|
+
case 26:
|
|
399
|
+
(_window$openBookingEd = (_window = window).openBookingEditModal) === null || _window$openBookingEd === void 0 || _window$openBookingEd.call(_window);
|
|
400
|
+
if (!isMultiDay) {
|
|
401
|
+
_context4.next = 30;
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
_context4.next = 30;
|
|
405
|
+
return getMultiDayCacheItem(true);
|
|
406
|
+
case 30:
|
|
407
|
+
dispatch({
|
|
408
|
+
type: 'setService',
|
|
409
|
+
payload: {
|
|
410
|
+
editModal: true,
|
|
411
|
+
cacheItem: cacheItem,
|
|
412
|
+
addModal: !cacheItem.autoClose,
|
|
413
|
+
changeService: false
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
|
417
|
+
case 32:
|
|
418
|
+
case "end":
|
|
419
|
+
return _context4.stop();
|
|
366
420
|
}
|
|
367
|
-
});
|
|
368
|
-
|
|
421
|
+
}, _callee4);
|
|
422
|
+
}));
|
|
423
|
+
function callback(_x3, _x4, _x5) {
|
|
424
|
+
return _callback.apply(this, arguments);
|
|
369
425
|
}
|
|
370
|
-
|
|
426
|
+
return callback;
|
|
427
|
+
}()
|
|
371
428
|
});
|
|
372
429
|
};
|
|
373
430
|
var renderList = useMemo(function () {
|
|
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
|
|
|
7
7
|
type: string;
|
|
8
8
|
value: number;
|
|
9
9
|
};
|
|
10
|
-
locale:
|
|
10
|
+
locale: any;
|
|
11
11
|
slice: any;
|
|
12
12
|
selectProps: {
|
|
13
13
|
size: string;
|
|
@@ -79,6 +79,14 @@ export declare const setDefaultCapacitys: ({ capacitys, cacheItem }: any) => any
|
|
|
79
79
|
* @Date: 2024-09-19 20:23
|
|
80
80
|
*/
|
|
81
81
|
export declare const getResourceByIds: (resourcesOriginMap: any, cacheItem: any, extraParams?: any) => any[];
|
|
82
|
+
/**
|
|
83
|
+
* @title: 是否是跨日商品
|
|
84
|
+
* @description:
|
|
85
|
+
* @param {any} cacheItem
|
|
86
|
+
* @return {*}
|
|
87
|
+
*/
|
|
88
|
+
export declare const isMultiDayProduct: (product: any) => boolean;
|
|
89
|
+
export declare const getMultiDay: ({ start_date, end_date, state, cacheItem, }: any) => Promise<any>;
|
|
82
90
|
/**
|
|
83
91
|
* @title: 预生成服务的 extend
|
|
84
92
|
* @description:
|