@pisell/private-materials 6.6.86 → 6.6.88
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/Sales/Summary/utils.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/footer/utils.js +49 -38
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info2/service/editService/index.js +16 -8
- 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/booking/utils.d.ts +2 -2
- 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 +3 -3
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/utils.js +13 -3
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info2/service/editService/index.js +18 -6
- 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/booking/utils.d.ts +2 -2
- 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 +3 -3
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
30
30
|
* @return {*}
|
|
31
31
|
* @Author: xiangfeng.xue
|
|
32
32
|
*/
|
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) =>
|
|
33
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
|
|
34
34
|
/**
|
|
35
35
|
* 计算所有价格明细
|
|
36
36
|
* @param items - 购物车商品数组
|
|
@@ -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
|
+
}>;
|
|
@@ -436,9 +436,20 @@ var formatProductMetadata = function formatProductMetadata(item) {
|
|
|
436
436
|
};
|
|
437
437
|
// 获取商品价格 包含组合规格
|
|
438
438
|
export var getSourceProductPrice = function getSourceProductPrice(item) {
|
|
439
|
-
var _item$_extend34, _item$
|
|
439
|
+
var _item$_extend34, _item$metadata3, _item$_extend35, _item$price2, _item$_extend36, _item$variant2;
|
|
440
440
|
var other = (_item$_extend34 = item._extend) === null || _item$_extend34 === void 0 ? void 0 : _item$_extend34.other;
|
|
441
|
-
var
|
|
441
|
+
var sourceProductPrice = item === null || item === void 0 || (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.source_product_price;
|
|
442
|
+
var sourceProductPriceNumber = Number(sourceProductPrice);
|
|
443
|
+
var originalVariantId = Number((item === null || item === void 0 ? void 0 : item.product_variant_id) || 0);
|
|
444
|
+
var currentVariantId = Number((other === null || other === void 0 ? void 0 : other.product_variant_id) || 0);
|
|
445
|
+
var isExistingOrderProduct = Boolean((item === null || item === void 0 ? void 0 : item.booking_id) || (item === null || item === void 0 || (_item$_extend35 = item._extend) === null || _item$_extend35 === void 0 ? void 0 : _item$_extend35.order_detail_id));
|
|
446
|
+
|
|
447
|
+
// 已有订单仅编辑套餐时保留主商品历史价格快照,避免被当前商品目录价覆盖。
|
|
448
|
+
// 主动切换组合规格时仍按新规格价格重新计算 source_product_price。
|
|
449
|
+
if (isExistingOrderProduct && originalVariantId === currentVariantId && sourceProductPrice !== null && sourceProductPrice !== undefined && sourceProductPrice !== '' && Number.isFinite(sourceProductPriceNumber)) {
|
|
450
|
+
return sourceProductPriceNumber;
|
|
451
|
+
}
|
|
452
|
+
var price = Number((_item$price2 = item === null || item === void 0 ? void 0 : item.price) !== null && _item$price2 !== void 0 ? _item$price2 : (_item$_extend36 = item._extend) === null || _item$_extend36 === void 0 ? void 0 : _item$_extend36.price);
|
|
442
453
|
|
|
443
454
|
// 组合规格: 根据当前选择的组合规格id 和商品的组合规格列表 获取当前商品的价格
|
|
444
455
|
if ((other === null || other === void 0 ? void 0 : other.product_variant_id) > 0 && (item === null || item === void 0 || (_item$variant2 = item.variant) === null || _item$variant2 === void 0 ? void 0 : _item$variant2.length) > 0) {
|
|
@@ -454,8 +465,8 @@ export var getSourceProductPrice = function getSourceProductPrice(item) {
|
|
|
454
465
|
|
|
455
466
|
// 获取主商品价格 要增加option
|
|
456
467
|
export var getMainProductSellingPrice = function getMainProductSellingPrice(item) {
|
|
457
|
-
var _item$
|
|
458
|
-
if (!isNumber((_item$
|
|
468
|
+
var _item$_extend37, _item$_extend38, _item$_extend$other, _item$_extend$other2, _item$_extend39;
|
|
469
|
+
if (!isNumber((_item$_extend37 = item._extend) === null || _item$_extend37 === void 0 ? void 0 : _item$_extend37.main_product_selling_price) && !isString((_item$_extend38 = item._extend) === null || _item$_extend38 === void 0 ? void 0 : _item$_extend38.main_product_selling_price)) {
|
|
459
470
|
return undefined;
|
|
460
471
|
}
|
|
461
472
|
var optionPrice = new Decimal(0);
|
|
@@ -471,7 +482,7 @@ export var getMainProductSellingPrice = function getMainProductSellingPrice(item
|
|
|
471
482
|
optionPrice = optionPrice.sub(getOptionDiscountAmount((item === null || item === void 0 ? void 0 : item.discount_list) || []));
|
|
472
483
|
}
|
|
473
484
|
}
|
|
474
|
-
return new Decimal((_item$
|
|
485
|
+
return new Decimal((_item$_extend39 = item._extend) === null || _item$_extend39 === void 0 ? void 0 : _item$_extend39.main_product_selling_price).add(optionPrice).toNumber();
|
|
475
486
|
};
|
|
476
487
|
|
|
477
488
|
/**
|
|
@@ -483,11 +494,11 @@ export var getMainProductSellingPrice = function getMainProductSellingPrice(item
|
|
|
483
494
|
* @Date: 2024-12-07 14:21
|
|
484
495
|
*/
|
|
485
496
|
var formatProducts = function formatProducts(item, quantity) {
|
|
486
|
-
var _item$
|
|
497
|
+
var _item$_extend40, _getMainProductSellin, _item$_extend41, _item$_extend42, _item$_extend43, _item$_extend44;
|
|
487
498
|
var total = Number(item._extend.total);
|
|
488
499
|
var origin_total = Number(item._extend.origin_total);
|
|
489
500
|
var discount_amount = origin_total - total;
|
|
490
|
-
var bundleDiscountList = getBundleDiscountList(((_item$
|
|
501
|
+
var bundleDiscountList = getBundleDiscountList(((_item$_extend40 = item._extend) === null || _item$_extend40 === void 0 || (_item$_extend40 = _item$_extend40.other) === null || _item$_extend40 === void 0 ? void 0 : _item$_extend40.bundle) || []);
|
|
491
502
|
var discount_list = _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []);
|
|
492
503
|
discount_list.push.apply(discount_list, _toConsumableArray(bundleDiscountList));
|
|
493
504
|
|
|
@@ -516,15 +527,15 @@ var formatProducts = function formatProducts(item, quantity) {
|
|
|
516
527
|
"discount_amount": notManualDiscount.length > 0 ? 0 : discount_amount,
|
|
517
528
|
"product_discount_reason": item._extend.discount_reason || '',
|
|
518
529
|
"is_charge_tax": item.is_charge_tax,
|
|
519
|
-
"note": ((_item$
|
|
530
|
+
"note": ((_item$_extend41 = item._extend) === null || _item$_extend41 === void 0 ? void 0 : _item$_extend41.note) || '',
|
|
520
531
|
"discountway": item._extend.discountway || "num",
|
|
521
532
|
"discount_per": item._extend.discount_per,
|
|
522
533
|
"discount_type": item._extend.discount_type || discount_type,
|
|
523
534
|
"order_detail_id": item._extend.order_detail_id || 0,
|
|
524
|
-
"product_bundle": formatProductBundle((_item$
|
|
535
|
+
"product_bundle": formatProductBundle((_item$_extend42 = item._extend) === null || _item$_extend42 === void 0 || (_item$_extend42 = _item$_extend42.other) === null || _item$_extend42 === void 0 ? void 0 : _item$_extend42.bundle),
|
|
525
536
|
"bundle_edit": item._extend.bundle_edit || bundleDiscountList.length ? 1 : 0,
|
|
526
|
-
"product_option_item": formatProductOption((_item$
|
|
527
|
-
"product_variant_id": ((_item$
|
|
537
|
+
"product_option_item": formatProductOption((_item$_extend43 = item._extend) === null || _item$_extend43 === void 0 || (_item$_extend43 = _item$_extend43.other) === null || _item$_extend43 === void 0 ? void 0 : _item$_extend43.option),
|
|
538
|
+
"product_variant_id": ((_item$_extend44 = item._extend) === null || _item$_extend44 === void 0 || (_item$_extend44 = _item$_extend44.other) === null || _item$_extend44 === void 0 ? void 0 : _item$_extend44.product_variant_id) || 0,
|
|
528
539
|
"discount_list": notManualDiscount,
|
|
529
540
|
metadata: formatProductMetadata(item),
|
|
530
541
|
// checkout 需求新增字段
|
|
@@ -549,8 +560,8 @@ var formatDayRelationProducts = function formatDayRelationProducts(data, booking
|
|
|
549
560
|
|
|
550
561
|
// 过滤出卡片中的普通商品
|
|
551
562
|
var relation_products = list === null || list === void 0 ? void 0 : list.filter(function (item) {
|
|
552
|
-
var _item$
|
|
553
|
-
var holderId = (_item$
|
|
563
|
+
var _item$_extend45;
|
|
564
|
+
var holderId = (_item$_extend45 = item._extend) === null || _item$_extend45 === void 0 ? void 0 : _item$_extend45.holder_id;
|
|
554
565
|
var bookingHolderId = booking_item._extend.holder_id;
|
|
555
566
|
var isDayBookingProduct = appointmentTypes.includes(item.extension_type);
|
|
556
567
|
return holderId && holderId === bookingHolderId && !isDayBookingProduct;
|
|
@@ -576,15 +587,15 @@ var formatAppointmentProductLists = function formatAppointmentProductLists(data)
|
|
|
576
587
|
|
|
577
588
|
// 找出预约商品
|
|
578
589
|
list = list.filter(function (item) {
|
|
579
|
-
var _item$
|
|
580
|
-
return ((_item$
|
|
590
|
+
var _item$_extend46;
|
|
591
|
+
return ((_item$_extend46 = item._extend) === null || _item$_extend46 === void 0 ? void 0 : _item$_extend46.holder_id) && !isNormalProductByDurationSchedule(item);
|
|
581
592
|
});
|
|
582
593
|
|
|
583
594
|
// 对预约商品列表根据holder_id进行分组
|
|
584
595
|
var groupMap = new Map();
|
|
585
596
|
list.forEach(function (item) {
|
|
586
|
-
var _item$
|
|
587
|
-
var key = (_item$
|
|
597
|
+
var _item$_extend47;
|
|
598
|
+
var key = (_item$_extend47 = item._extend) === null || _item$_extend47 === void 0 ? void 0 : _item$_extend47.holder_id; // 分组键
|
|
588
599
|
if (!groupMap.has(key)) {
|
|
589
600
|
groupMap.set(key, []);
|
|
590
601
|
}
|
|
@@ -620,8 +631,8 @@ var getHolderByIndex = function getHolderByIndex(holder, index) {
|
|
|
620
631
|
export var getHasMultiDayProduct = function getHasMultiDayProduct(data) {
|
|
621
632
|
var list = data.service.value;
|
|
622
633
|
var isHas = list.some(function (item) {
|
|
623
|
-
var _item$
|
|
624
|
-
return (_item$
|
|
634
|
+
var _item$_extend48;
|
|
635
|
+
return (_item$_extend48 = item._extend) === null || _item$_extend48 === void 0 ? void 0 : _item$_extend48.groupId;
|
|
625
636
|
});
|
|
626
637
|
return isHas;
|
|
627
638
|
};
|
|
@@ -661,7 +672,7 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
661
672
|
var bookings = [];
|
|
662
673
|
var obj = {};
|
|
663
674
|
list.forEach(function (item) {
|
|
664
|
-
var _item$
|
|
675
|
+
var _item$_extend49, _item$_extend54, _item$_extend55;
|
|
665
676
|
// 自定义商品直接使用 _extend 中的数据,并将 id 转换为 0 提交给后端
|
|
666
677
|
if (item.isCustomItem) {
|
|
667
678
|
bookings.push(_objectSpread(_objectSpread({}, item._extend), {}, {
|
|
@@ -671,7 +682,7 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
671
682
|
}
|
|
672
683
|
|
|
673
684
|
// 当前商品是跨日预约商品
|
|
674
|
-
var isMultiDay = (_item$
|
|
685
|
+
var isMultiDay = (_item$_extend49 = item._extend) === null || _item$_extend49 === void 0 ? void 0 : _item$_extend49.groupId;
|
|
675
686
|
var start_date = item._extend.startDate.format('YYYY-MM-DD');
|
|
676
687
|
var end_date = item._extend.endDate.format('YYYY-MM-DD');
|
|
677
688
|
var end_time = item._extend.endDate.format('HH:mm');
|
|
@@ -685,9 +696,9 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
685
696
|
|
|
686
697
|
// 跨日预约下的普通商品
|
|
687
698
|
if (isDay) {
|
|
688
|
-
var _item$
|
|
689
|
-
var startDate = ((_item$
|
|
690
|
-
var endDate = ((_item$
|
|
699
|
+
var _item$_extend50, _item$_extend51, _item$_extend52, _item$_extend53;
|
|
700
|
+
var startDate = ((_item$_extend50 = item._extend) === null || _item$_extend50 === void 0 ? void 0 : _item$_extend50.startDate) || ((_item$_extend51 = item._extend) === null || _item$_extend51 === void 0 ? void 0 : _item$_extend51.start_date);
|
|
701
|
+
var endDate = ((_item$_extend52 = item._extend) === null || _item$_extend52 === void 0 ? void 0 : _item$_extend52.endDate) || ((_item$_extend53 = item._extend) === null || _item$_extend53 === void 0 ? void 0 : _item$_extend53.end_date);
|
|
691
702
|
var _formatDayTime = formatDayTime({
|
|
692
703
|
startDate: startDate,
|
|
693
704
|
endDate: endDate
|
|
@@ -713,8 +724,8 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
713
724
|
// 跨日预约处理: 跨日预约所有数据都在list中, 每一组预约通过groupId进行分组
|
|
714
725
|
// 通过obj 记录下每个GroupId第一次出现的时机, 第一次出现需要设置 metadata.multiDayPrices
|
|
715
726
|
// 后续出现不需要设置 metadata.multiDayPrices. 节省体积
|
|
716
|
-
var isSetGroupId = obj[item === null || item === void 0 || (_item$
|
|
717
|
-
if (!((_item$
|
|
727
|
+
var isSetGroupId = obj[item === null || item === void 0 || (_item$_extend54 = item._extend) === null || _item$_extend54 === void 0 ? void 0 : _item$_extend54.groupId];
|
|
728
|
+
if (!((_item$_extend55 = item._extend) !== null && _item$_extend55 !== void 0 && _item$_extend55.unique_identification_number)) {
|
|
718
729
|
var unique_identification_number = getUniqueId();
|
|
719
730
|
item._extend.unique_identification_number = unique_identification_number;
|
|
720
731
|
}
|
|
@@ -793,16 +804,16 @@ var formatRelationProducts = function formatRelationProducts(data, type) {
|
|
|
793
804
|
var list = ((_data$service = data.service) === null || _data$service === void 0 ? void 0 : _data$service.value) || [];
|
|
794
805
|
// open items 下的商品
|
|
795
806
|
list = list.filter(function (item) {
|
|
796
|
-
var _item$
|
|
807
|
+
var _item$_extend56;
|
|
797
808
|
return (
|
|
798
809
|
// 跨日预约把普通商品加在relationProducts 活动预约按之前逻辑
|
|
799
|
-
type === 'day' ? isNormalProductByDurationSchedule(item) : ((_item$
|
|
810
|
+
type === 'day' ? isNormalProductByDurationSchedule(item) : ((_item$_extend56 = item._extend) === null || _item$_extend56 === void 0 ? void 0 : _item$_extend56.holder_id) && appointmentTypes.includes(item.extension_type)
|
|
800
811
|
);
|
|
801
812
|
});
|
|
802
813
|
var relationProducts = [];
|
|
803
814
|
relationProducts = list.map(function (item) {
|
|
804
|
-
var _item$
|
|
805
|
-
if (!((_item$
|
|
815
|
+
var _item$_extend57;
|
|
816
|
+
if (!((_item$_extend57 = item._extend) !== null && _item$_extend57 !== void 0 && _item$_extend57.unique_identification_number)) {
|
|
806
817
|
var unique_identification_number = getUniqueId();
|
|
807
818
|
item._extend.unique_identification_number = unique_identification_number;
|
|
808
819
|
}
|
|
@@ -821,8 +832,8 @@ var formatNormalProducts = function formatNormalProducts(data) {
|
|
|
821
832
|
});
|
|
822
833
|
var relationProducts = [];
|
|
823
834
|
relationProducts = list.map(function (item) {
|
|
824
|
-
var _item$
|
|
825
|
-
if (!((_item$
|
|
835
|
+
var _item$_extend58;
|
|
836
|
+
if (!((_item$_extend58 = item._extend) !== null && _item$_extend58 !== void 0 && _item$_extend58.unique_identification_number)) {
|
|
826
837
|
var unique_identification_number = getUniqueId();
|
|
827
838
|
item._extend.unique_identification_number = unique_identification_number;
|
|
828
839
|
}
|
|
@@ -947,19 +958,19 @@ export var checkHolderIsError = function checkHolderIsError(state) {
|
|
|
947
958
|
var _state$client;
|
|
948
959
|
var errorRowKey = '';
|
|
949
960
|
var holderError = state.service.value.some(function (item) {
|
|
950
|
-
var _item$_extend$holder_2, _item$
|
|
961
|
+
var _item$_extend$holder_2, _item$_extend60;
|
|
951
962
|
// 普通商品不需要检测holder
|
|
952
963
|
if (isNormalProductByDurationSchedule(item)) {
|
|
953
964
|
return false;
|
|
954
965
|
}
|
|
955
966
|
if (item._extend.quantity === 1 && (!item._extend.holder_id || ((_item$_extend$holder_2 = item._extend.holder_id) === null || _item$_extend$holder_2 === void 0 ? void 0 : _item$_extend$holder_2.length) === 0)) {
|
|
956
|
-
var _item$
|
|
957
|
-
errorRowKey = genRowKey(item === null || item === void 0 || (_item$
|
|
967
|
+
var _item$_extend59;
|
|
968
|
+
errorRowKey = genRowKey(item === null || item === void 0 || (_item$_extend59 = item._extend) === null || _item$_extend59 === void 0 || (_item$_extend59 = _item$_extend59.other) === null || _item$_extend59 === void 0 ? void 0 : _item$_extend59.rowKey);
|
|
958
969
|
return true;
|
|
959
970
|
}
|
|
960
|
-
if (item._extend.quantity > 1 && ((_item$
|
|
961
|
-
var _item$
|
|
962
|
-
errorRowKey = genRowKey(item === null || item === void 0 || (_item$
|
|
971
|
+
if (item._extend.quantity > 1 && ((_item$_extend60 = item._extend) === null || _item$_extend60 === void 0 || (_item$_extend60 = _item$_extend60.holder_id) === null || _item$_extend60 === void 0 ? void 0 : _item$_extend60.length) !== item._extend.quantity) {
|
|
972
|
+
var _item$_extend61;
|
|
973
|
+
errorRowKey = genRowKey(item === null || item === void 0 || (_item$_extend61 = item._extend) === null || _item$_extend61 === void 0 || (_item$_extend61 = _item$_extend61.other) === null || _item$_extend61 === void 0 ? void 0 : _item$_extend61.rowKey);
|
|
963
974
|
return true;
|
|
964
975
|
}
|
|
965
976
|
return false;
|
|
@@ -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
|
+
}>;
|
|
@@ -731,7 +731,7 @@ var Info = function Info(_, ref) {
|
|
|
731
731
|
})
|
|
732
732
|
},
|
|
733
733
|
callback: function callback(e, extension_type, detail) {
|
|
734
|
-
var _item$_extend10, _item$_extend11, _item$_extend12, _cacheItem$metadata, _cacheItem$metadata3, _cacheItem$_extend, _cacheItem$_extend2;
|
|
734
|
+
var _item$_extend10, _item$_extend11, _item$_extend12, _other, _ref, _item$metadata$source, _item$metadata, _cacheItem$metadata, _cacheItem$metadata3, _cacheItem$_extend, _cacheItem$_extend2;
|
|
735
735
|
// 标记已执行过编辑操作
|
|
736
736
|
isEditedRef.current = true;
|
|
737
737
|
shouldReallocateBundlePriceRef.current = false;
|
|
@@ -753,12 +753,20 @@ var Info = function Info(_, ref) {
|
|
|
753
753
|
other = mergeBundleWithOriginalPrice(other, ((_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.other) || {});
|
|
754
754
|
}
|
|
755
755
|
other.session = e.session;
|
|
756
|
+
var originalVariantId = Number((item === null || item === void 0 ? void 0 : item.product_variant_id) || 0);
|
|
757
|
+
var currentVariantId = Number(((_other = other) === null || _other === void 0 ? void 0 : _other.product_variant_id) || 0);
|
|
758
|
+
var isProductVariantChanged = originalVariantId !== currentVariantId;
|
|
759
|
+
var sourceProductPrice = (_ref = (_item$metadata$source = item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.source_product_price) !== null && _item$metadata$source !== void 0 ? _item$metadata$source : item === null || item === void 0 ? void 0 : item.source_product_price) !== null && _ref !== void 0 ? _ref : item === null || item === void 0 ? void 0 : item.price;
|
|
756
760
|
|
|
757
761
|
// 重新生成商品
|
|
758
762
|
var cacheItem = _objectSpread(_objectSpread(_objectSpread({}, item), _detail), {}, {
|
|
759
763
|
product_id: item.id,
|
|
760
764
|
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
761
765
|
_key: e.key,
|
|
766
|
+
metadata: _objectSpread(_objectSpread(_objectSpread({}, item === null || item === void 0 ? void 0 : item.metadata), _detail === null || _detail === void 0 ? void 0 : _detail.metadata), item !== null && item !== void 0 && item.booking_id ? {
|
|
767
|
+
// 仅编辑套餐时保留历史主商品价格;切换组合规格时由新规格重新生成。
|
|
768
|
+
source_product_price: isProductVariantChanged ? undefined : sourceProductPrice
|
|
769
|
+
} : {}),
|
|
762
770
|
_extend: _objectSpread(_objectSpread(_objectSpread({}, item._extend), values), {}, {
|
|
763
771
|
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || (values === null || values === void 0 ? void 0 : values.quantity) || 1,
|
|
764
772
|
// 覆盖选择的规格和套餐
|
|
@@ -1185,12 +1193,12 @@ var Info = function Info(_, ref) {
|
|
|
1185
1193
|
})));
|
|
1186
1194
|
}, [isEditGroup, currentTab, items]);
|
|
1187
1195
|
var updateMultiDay = /*#__PURE__*/function () {
|
|
1188
|
-
var
|
|
1196
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
1189
1197
|
var start_date, end_date, duration, cacheItem, fieldsValues;
|
|
1190
1198
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1191
1199
|
while (1) switch (_context.prev = _context.next) {
|
|
1192
1200
|
case 0:
|
|
1193
|
-
start_date =
|
|
1201
|
+
start_date = _ref2.start_date, end_date = _ref2.end_date, duration = _ref2.duration;
|
|
1194
1202
|
_context.next = 3;
|
|
1195
1203
|
return getMultiDay({
|
|
1196
1204
|
start_date: start_date,
|
|
@@ -1224,7 +1232,7 @@ var Info = function Info(_, ref) {
|
|
|
1224
1232
|
}, _callee);
|
|
1225
1233
|
}));
|
|
1226
1234
|
return function updateMultiDay(_x) {
|
|
1227
|
-
return
|
|
1235
|
+
return _ref3.apply(this, arguments);
|
|
1228
1236
|
};
|
|
1229
1237
|
}();
|
|
1230
1238
|
var onValuesChange = function onValuesChange(changedValues) {
|
|
@@ -1307,8 +1315,8 @@ var Info = function Info(_, ref) {
|
|
|
1307
1315
|
* const price = getBundleOriginalSellingPrice({ bundle_sum_price: '8.00', price: 7.2 });
|
|
1308
1316
|
*/
|
|
1309
1317
|
var getBundleOriginalSellingPrice = function getBundleOriginalSellingPrice(bundle) {
|
|
1310
|
-
var
|
|
1311
|
-
var priceSource = (
|
|
1318
|
+
var _ref4, _ref5, _ref6, _bundle$bundle_sum_pr;
|
|
1319
|
+
var priceSource = (_ref4 = (_ref5 = (_ref6 = (_bundle$bundle_sum_pr = bundle === null || bundle === void 0 ? void 0 : bundle.bundle_sum_price) !== null && _bundle$bundle_sum_pr !== void 0 ? _bundle$bundle_sum_pr : bundle === null || bundle === void 0 ? void 0 : bundle.original_total) !== null && _ref6 !== void 0 ? _ref6 : bundle === null || bundle === void 0 ? void 0 : bundle.original_price) !== null && _ref5 !== void 0 ? _ref5 : bundle === null || bundle === void 0 ? void 0 : bundle.product_price) !== null && _ref4 !== void 0 ? _ref4 : bundle === null || bundle === void 0 ? void 0 : bundle.price;
|
|
1312
1320
|
var price = Number(priceSource);
|
|
1313
1321
|
if (!Number.isFinite(price)) {
|
|
1314
1322
|
return undefined;
|
|
@@ -1322,7 +1330,7 @@ var Info = function Info(_, ref) {
|
|
|
1322
1330
|
setDiscountChangeModalOpen(false);
|
|
1323
1331
|
};
|
|
1324
1332
|
var handleContinue = /*#__PURE__*/function () {
|
|
1325
|
-
var
|
|
1333
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1326
1334
|
var cacheItem;
|
|
1327
1335
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1328
1336
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -1341,7 +1349,7 @@ var Info = function Info(_, ref) {
|
|
|
1341
1349
|
}, _callee2);
|
|
1342
1350
|
}));
|
|
1343
1351
|
return function handleContinue() {
|
|
1344
|
-
return
|
|
1352
|
+
return _ref7.apply(this, arguments);
|
|
1345
1353
|
};
|
|
1346
1354
|
}();
|
|
1347
1355
|
var handleRemove = function handleRemove() {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
amountSymbol: string;
|
|
3
4
|
apis: {
|
|
@@ -109,4 +110,11 @@ export declare const walkInData: {
|
|
|
109
110
|
id: number;
|
|
110
111
|
nickname: string;
|
|
111
112
|
};
|
|
112
|
-
export declare const Provider: any, Context:
|
|
113
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
114
|
+
state: FormState;
|
|
115
|
+
} & {
|
|
116
|
+
dispatch: (params: {
|
|
117
|
+
type: string;
|
|
118
|
+
payload: any;
|
|
119
|
+
}) => void;
|
|
120
|
+
}>;
|
|
@@ -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
|
+
}>;
|
|
@@ -175,10 +175,10 @@ export declare const getProductOriginTotalPrice: (item: any) => number;
|
|
|
175
175
|
export declare const getDuration: (duration: number | {
|
|
176
176
|
type: string;
|
|
177
177
|
value: number;
|
|
178
|
-
}) => number |
|
|
178
|
+
}) => number | {
|
|
179
179
|
type: string;
|
|
180
180
|
value: number;
|
|
181
|
-
};
|
|
181
|
+
} | "flexible";
|
|
182
182
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
183
183
|
export declare const getIsEdit: (state: any) => boolean;
|
|
184
184
|
export {};
|
|
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
|
|
|
17
17
|
cardData: any;
|
|
18
18
|
handleSelectWallet: (this: unknown, value: number[]) => void;
|
|
19
19
|
selectedWalletIds: any[];
|
|
20
|
-
expiredWalletIds: any
|
|
20
|
+
expiredWalletIds: any;
|
|
21
21
|
expiredWalletData: any;
|
|
22
22
|
disabledWalletData: any[];
|
|
23
23
|
clearAllSelectedWallet: (this: unknown) => void;
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
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" | "mx51" | "payo" | "windcave" | "stripe" | "linkly" | "huifu" | "adyenpos" | "adyenalipay" | "adyenwechat">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -299,15 +299,15 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
299
299
|
name?: string | undefined;
|
|
300
300
|
symbol?: string | undefined;
|
|
301
301
|
amount?: string | number | undefined;
|
|
302
|
-
mode?: "
|
|
302
|
+
mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
|
|
303
303
|
order_id?: string | number | undefined;
|
|
304
|
-
eftpos?: "
|
|
304
|
+
eftpos?: "tyro" | "mx51" | "payo" | "windcave" | "stripe" | "linkly" | "huifu" | "adyenpos" | "adyenalipay" | "adyenwechat" | undefined;
|
|
305
305
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
306
306
|
key?: number | undefined;
|
|
307
307
|
step?: number | undefined;
|
|
308
308
|
title?: string | undefined;
|
|
309
309
|
subTitle?: string | undefined;
|
|
310
|
-
type?: "
|
|
310
|
+
type?: "step" | "unset" | undefined;
|
|
311
311
|
render?: boolean | undefined;
|
|
312
312
|
net?: boolean | undefined;
|
|
313
313
|
component?: string | undefined;
|
|
@@ -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
|
+
}>;
|
|
@@ -47,7 +47,7 @@ declare type ScanData = {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
export declare const formatScanCustomer: (data: ScanData) => {
|
|
50
|
-
searchType: "
|
|
50
|
+
searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
|
|
51
51
|
data: any;
|
|
52
52
|
scanCode: string;
|
|
53
53
|
} | null;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Capacity: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true | React.
|
|
5
|
+
}) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
|
|
6
6
|
export default Capacity;
|
|
@@ -3,5 +3,5 @@ import { SkuStatusOverlayConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const CardMask: ({ props }: {
|
|
5
5
|
props: SkuStatusOverlayConfig;
|
|
6
|
-
}) => string | number | true | React.
|
|
6
|
+
}) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
|
|
7
7
|
export default CardMask;
|
|
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const Countdown: ({ props }: {
|
|
5
5
|
props: ProductCardConfig;
|
|
6
|
-
}) => string | number | true | React.
|
|
6
|
+
}) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
|
|
7
7
|
export default Countdown;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Duration: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true | React.
|
|
5
|
+
}) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
|
|
6
6
|
export default Duration;
|
|
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const MemberPrice: ({ props }: {
|
|
5
5
|
props: ProductCardConfig;
|
|
6
|
-
}) => string | number | true | React.
|
|
6
|
+
}) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
|
|
7
7
|
export default MemberPrice;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Resource: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true | React.
|
|
5
|
+
}) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
|
|
6
6
|
export default Resource;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Stock: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true | React.
|
|
5
|
+
}) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
|
|
6
6
|
export default Stock;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Time: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true | React.
|
|
5
|
+
}) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
|
|
6
6
|
export default Time;
|
|
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
30
30
|
* @return {*}
|
|
31
31
|
* @Author: xiangfeng.xue
|
|
32
32
|
*/
|
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) =>
|
|
33
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
|
|
34
34
|
/**
|
|
35
35
|
* 计算所有价格明细
|
|
36
36
|
* @param items - 购物车商品数组
|
|
@@ -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
|
+
}>;
|
|
@@ -342,10 +342,20 @@ var formatProductMetadata = (item) => {
|
|
|
342
342
|
return metadata;
|
|
343
343
|
};
|
|
344
344
|
var getSourceProductPrice = (item) => {
|
|
345
|
-
var _a, _b, _c;
|
|
345
|
+
var _a, _b, _c, _d, _e;
|
|
346
346
|
const other = (_a = item._extend) == null ? void 0 : _a.other;
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
const sourceProductPrice = (_b = item == null ? void 0 : item.metadata) == null ? void 0 : _b.source_product_price;
|
|
348
|
+
const sourceProductPriceNumber = Number(sourceProductPrice);
|
|
349
|
+
const originalVariantId = Number((item == null ? void 0 : item.product_variant_id) || 0);
|
|
350
|
+
const currentVariantId = Number((other == null ? void 0 : other.product_variant_id) || 0);
|
|
351
|
+
const isExistingOrderProduct = Boolean(
|
|
352
|
+
(item == null ? void 0 : item.booking_id) || ((_c = item == null ? void 0 : item._extend) == null ? void 0 : _c.order_detail_id)
|
|
353
|
+
);
|
|
354
|
+
if (isExistingOrderProduct && originalVariantId === currentVariantId && sourceProductPrice !== null && sourceProductPrice !== void 0 && sourceProductPrice !== "" && Number.isFinite(sourceProductPriceNumber)) {
|
|
355
|
+
return sourceProductPriceNumber;
|
|
356
|
+
}
|
|
357
|
+
let price = Number((item == null ? void 0 : item.price) ?? ((_d = item._extend) == null ? void 0 : _d.price));
|
|
358
|
+
if ((other == null ? void 0 : other.product_variant_id) > 0 && ((_e = item == null ? void 0 : item.variant) == null ? void 0 : _e.length) > 0) {
|
|
349
359
|
const variant = item.variant.find(
|
|
350
360
|
(d) => d.id === (other == null ? void 0 : other.product_variant_id)
|
|
351
361
|
);
|