@pisell/private-materials 6.6.37 → 6.6.39
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 +2 -2
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/footer/utils.js +2 -2
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/Group/utils.js +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +21 -5
- package/es/components/booking/info2/service/editService/utils.d.ts +7 -0
- package/es/components/booking/info2/service/editService/utils.js +30 -0
- 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 +3 -2
- package/es/components/booking/utils.js +36 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- 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/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/footer/utils.js +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/Group/utils.js +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +15 -5
- package/lib/components/booking/info2/service/editService/utils.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/utils.js +19 -0
- 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 +3 -2
- package/lib/components/booking/utils.js +29 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- 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 +3 -3
- package/lowcode/eco-cup-list/meta.ts +0 -63
- package/lowcode/eco-customer-list/meta.ts +0 -63
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
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
|
+
export declare const Provider: any, Context: any;
|
|
@@ -439,9 +439,9 @@ var formatProductMetadata = function formatProductMetadata(item) {
|
|
|
439
439
|
|
|
440
440
|
// 获取商品价格 包含组合规格
|
|
441
441
|
export var getSourceProductPrice = function getSourceProductPrice(item) {
|
|
442
|
-
var _item$_extend29, _item$_extend30, _item$variant2;
|
|
442
|
+
var _item$_extend29, _item$price2, _item$_extend30, _item$variant2;
|
|
443
443
|
var other = (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.other;
|
|
444
|
-
var price = Number((_item$_extend30 = item._extend) === null || _item$_extend30 === void 0 ? void 0 : _item$_extend30.price);
|
|
444
|
+
var price = Number((_item$price2 = item === null || item === void 0 ? void 0 : item.price) !== null && _item$price2 !== void 0 ? _item$price2 : (_item$_extend30 = item._extend) === null || _item$_extend30 === void 0 ? void 0 : _item$_extend30.price);
|
|
445
445
|
|
|
446
446
|
// 组合规格: 根据当前选择的组合规格id 和商品的组合规格列表 获取当前商品的价格
|
|
447
447
|
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) {
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
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
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormState } from '../model';
|
|
3
1
|
export declare const walkInData: {
|
|
4
2
|
id: number;
|
|
5
3
|
nickname: string;
|
|
6
4
|
};
|
|
7
|
-
export declare const Provider:
|
|
8
|
-
state: FormState;
|
|
9
|
-
} & {
|
|
10
|
-
dispatch: (params: {
|
|
11
|
-
type: string;
|
|
12
|
-
payload: any;
|
|
13
|
-
}) => void;
|
|
14
|
-
}>;
|
|
5
|
+
export declare const Provider: any, Context: any;
|
|
@@ -91,7 +91,7 @@ export var createBookingItemsByGroup = function createBookingItemsByGroup(item,
|
|
|
91
91
|
// 编辑时组商品需要清空booking_id 否则会重复
|
|
92
92
|
booking_id: isBatchEdit ? 0 : item.booking_id,
|
|
93
93
|
_id: "".concat(item._id, "-").concat(i + 1),
|
|
94
|
-
price: price,
|
|
94
|
+
// price: price,
|
|
95
95
|
_extend: _objectSpread(_objectSpread({}, _extend), {}, {
|
|
96
96
|
order_detail_id: isBatchEdit ? 0 : item.order_detail_id,
|
|
97
97
|
groupId: groupId,
|
|
@@ -216,4 +216,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
216
216
|
* @Author: WangHan
|
|
217
217
|
* @Date: 2024-12-24 11:32
|
|
218
218
|
*/
|
|
219
|
-
export declare const updateServicePrice: (state: any) => never[]
|
|
219
|
+
export declare const updateServicePrice: (state: any) => Promise<any> | never[];
|
|
@@ -38,10 +38,10 @@ import { ConfigProvider, Iconfont } from '@pisell/materials';
|
|
|
38
38
|
import { addService, genHolderKey, genServiceKey, getIsShowNumber } from "../../../../ticketBooking/utils";
|
|
39
39
|
import { disabledDate as _disabledDate, isNormalProductByDurationSchedule } from "../../../info/service2/utils";
|
|
40
40
|
import { editSessionProduct } from "../../../info/utils";
|
|
41
|
-
import { deleteCacheParams, getDays, getProductTotalPrice, getServiceTimes, isSessionProduct, isWalkIn } from "../../../utils";
|
|
41
|
+
import { deleteCacheParams, getDays, getProductOriginTotalPrice, getProductTotalPrice, getServiceTimes, isSessionProduct, isWalkIn } from "../../../utils";
|
|
42
42
|
import { getErrorList, getIsNoSpecAndPackage } from "../../utilsByBooking";
|
|
43
43
|
import { formatResources, getDurationProps, getFlexibleOption, getMultiDay, getTimeObj, setDefaultCapacitys } from "../addService/utils";
|
|
44
|
-
import { getProductAllDiscountList, setProductPrice } from "./utils";
|
|
44
|
+
import { getProductAllDiscountList, mergeBundleWithOriginalPrice, setProductPrice } from "./utils";
|
|
45
45
|
import NoteModal from "../../../../../plus/noteModal";
|
|
46
46
|
import { DiscountKeyboard } from "../../../../../pro/priceKeyboard";
|
|
47
47
|
import EditTabs from "../../../info/service/editService/EditTabs";
|
|
@@ -660,11 +660,17 @@ var Info = function Info(_, ref) {
|
|
|
660
660
|
})
|
|
661
661
|
},
|
|
662
662
|
callback: function callback(e, extension_type, detail) {
|
|
663
|
-
var _cacheItem$_extend, _cacheItem$_extend2;
|
|
663
|
+
var _cacheItem$metadata, _cacheItem$_extend, _cacheItem$_extend2;
|
|
664
664
|
// 标记已执行过编辑操作
|
|
665
665
|
isEditedRef.current = true;
|
|
666
666
|
var _detail = detail || item;
|
|
667
667
|
var other = JSON.parse(JSON.stringify(e));
|
|
668
|
+
|
|
669
|
+
// 手动折扣时 合并 bundle price,优先使用编辑前的价格
|
|
670
|
+
if (item.discount_amount) {
|
|
671
|
+
var _item$_extend10;
|
|
672
|
+
other = mergeBundleWithOriginalPrice(other, ((_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.other) || {});
|
|
673
|
+
}
|
|
668
674
|
other.session = e.session;
|
|
669
675
|
|
|
670
676
|
// 重新生成商品
|
|
@@ -680,6 +686,12 @@ var Info = function Info(_, ref) {
|
|
|
680
686
|
new: 0
|
|
681
687
|
});
|
|
682
688
|
|
|
689
|
+
// 手动折扣编辑时保留原有折扣
|
|
690
|
+
if (cacheItem.discount_amount && cacheItem !== null && cacheItem !== void 0 && (_cacheItem$metadata = cacheItem.metadata) !== null && _cacheItem$metadata !== void 0 && _cacheItem$metadata.main_product_selling_price) {
|
|
691
|
+
var _cacheItem$metadata2;
|
|
692
|
+
cacheItem._extend.price = cacheItem === null || cacheItem === void 0 || (_cacheItem$metadata2 = cacheItem.metadata) === null || _cacheItem$metadata2 === void 0 ? void 0 : _cacheItem$metadata2.main_product_selling_price;
|
|
693
|
+
}
|
|
694
|
+
|
|
683
695
|
// 获取商品总价
|
|
684
696
|
var _total = getProductTotalPrice(cacheItem);
|
|
685
697
|
|
|
@@ -700,11 +712,15 @@ var Info = function Info(_, ref) {
|
|
|
700
712
|
});
|
|
701
713
|
}, 200);
|
|
702
714
|
}
|
|
715
|
+
var origin_total = _total;
|
|
716
|
+
if (item.discount_amount) {
|
|
717
|
+
origin_total = getProductOriginTotalPrice(cacheItem);
|
|
718
|
+
}
|
|
703
719
|
|
|
704
720
|
// 用于储存原价
|
|
705
|
-
cacheItem._extend.origin_total =
|
|
721
|
+
cacheItem._extend.origin_total = origin_total;
|
|
706
722
|
(((_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.items) || []).forEach(function (item) {
|
|
707
|
-
return item._extend.origin_total =
|
|
723
|
+
return item._extend.origin_total = origin_total;
|
|
708
724
|
});
|
|
709
725
|
|
|
710
726
|
// 覆盖商品
|
|
@@ -32,3 +32,10 @@ export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total
|
|
|
32
32
|
* @returns 折扣列表
|
|
33
33
|
*/
|
|
34
34
|
export declare const getProductAllDiscountList: (cacheItem: any) => any;
|
|
35
|
+
/**
|
|
36
|
+
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
37
|
+
* @param other - callback 返回的新数据
|
|
38
|
+
* @param originalOther - 编辑前的原始数据 (item._extend.other)
|
|
39
|
+
* @returns 合并后的 other
|
|
40
|
+
*/
|
|
41
|
+
export declare const mergeBundleWithOriginalPrice: (other: any, originalOther: any) => any;
|
|
@@ -83,6 +83,9 @@ export var setProductPrice = function setProductPrice(cacheItem, _ref2) {
|
|
|
83
83
|
})) {
|
|
84
84
|
return cacheItem;
|
|
85
85
|
}
|
|
86
|
+
if (cacheItem.discount_amount) {
|
|
87
|
+
return cacheItem;
|
|
88
|
+
}
|
|
86
89
|
|
|
87
90
|
// 计算折扣比例
|
|
88
91
|
var discountRatio = new Decimal(newTotal).div(new Decimal(origin_total));
|
|
@@ -145,4 +148,31 @@ export var getProductAllDiscountList = function getProductAllDiscountList(cacheI
|
|
|
145
148
|
var bundleDiscountList = getBundleDiscountList(((_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 || (_cacheItem$_extend = _cacheItem$_extend.other) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.bundle) || []) || [];
|
|
146
149
|
(_discountList = discountList).push.apply(_discountList, _toConsumableArray(bundleDiscountList));
|
|
147
150
|
return discountList;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
155
|
+
* @param other - callback 返回的新数据
|
|
156
|
+
* @param originalOther - 编辑前的原始数据 (item._extend.other)
|
|
157
|
+
* @returns 合并后的 other
|
|
158
|
+
*/
|
|
159
|
+
export var mergeBundleWithOriginalPrice = function mergeBundleWithOriginalPrice(other, originalOther) {
|
|
160
|
+
var _other$bundle, _originalOther$bundle;
|
|
161
|
+
if (!(other !== null && other !== void 0 && (_other$bundle = other.bundle) !== null && _other$bundle !== void 0 && _other$bundle.length) || !(originalOther !== null && originalOther !== void 0 && (_originalOther$bundle = originalOther.bundle) !== null && _originalOther$bundle !== void 0 && _originalOther$bundle.length)) return other;
|
|
162
|
+
other.bundle = other.bundle.map(function (bundle) {
|
|
163
|
+
var matched = originalOther.bundle.find(function (orig) {
|
|
164
|
+
return orig.id === bundle.id && orig.product_id === bundle.product_id;
|
|
165
|
+
});
|
|
166
|
+
if (matched && matched.price !== undefined) {
|
|
167
|
+
var _matched$original_tot, _matched$original_pri, _matched$custom_price;
|
|
168
|
+
return _objectSpread(_objectSpread({}, bundle), {}, {
|
|
169
|
+
price: matched.price,
|
|
170
|
+
original_total: (_matched$original_tot = matched === null || matched === void 0 ? void 0 : matched.original_total) !== null && _matched$original_tot !== void 0 ? _matched$original_tot : bundle.original_total,
|
|
171
|
+
original_price: (_matched$original_pri = matched === null || matched === void 0 ? void 0 : matched.original_price) !== null && _matched$original_pri !== void 0 ? _matched$original_pri : bundle.original_price,
|
|
172
|
+
custom_price: (_matched$custom_price = matched === null || matched === void 0 ? void 0 : matched.custom_price) !== null && _matched$custom_price !== void 0 ? _matched$custom_price : bundle.custom_price
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return bundle;
|
|
176
|
+
});
|
|
177
|
+
return other;
|
|
148
178
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -110,11 +109,4 @@ export declare const walkInData: {
|
|
|
110
109
|
id: number;
|
|
111
110
|
nickname: string;
|
|
112
111
|
};
|
|
113
|
-
export declare const Provider:
|
|
114
|
-
state: FormState;
|
|
115
|
-
} & {
|
|
116
|
-
dispatch: (params: {
|
|
117
|
-
type: string;
|
|
118
|
-
payload: any;
|
|
119
|
-
}) => void;
|
|
120
|
-
}>;
|
|
112
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
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
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
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
|
+
export declare const Provider: any, Context: any;
|
|
@@ -163,6 +163,7 @@ export declare const getIsOnlySession: (item: any) => boolean;
|
|
|
163
163
|
export declare const getServerItemExtend: (state: any, cacheItem: any, timeObj: any) => any;
|
|
164
164
|
export declare const getMainPrice: (item: any, price?: number) => number;
|
|
165
165
|
export declare const getProductTotalPrice: (item: any) => number;
|
|
166
|
+
export declare const getProductOriginTotalPrice: (item: any) => number;
|
|
166
167
|
/**
|
|
167
168
|
* @title: 判断 duration
|
|
168
169
|
* @description: 用于处理不同格式的duration
|
|
@@ -174,10 +175,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
174
175
|
export declare const getDuration: (duration: number | {
|
|
175
176
|
type: string;
|
|
176
177
|
value: number;
|
|
177
|
-
}) => number |
|
|
178
|
+
}) => number | {
|
|
178
179
|
type: string;
|
|
179
180
|
value: number;
|
|
180
|
-
};
|
|
181
|
+
} | "flexible";
|
|
181
182
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
182
183
|
export declare const getIsEdit: (state: any) => boolean;
|
|
183
184
|
export {};
|
|
@@ -820,6 +820,42 @@ export var getProductTotalPrice = function getProductTotalPrice(item) {
|
|
|
820
820
|
}
|
|
821
821
|
return price.toDecimalPlaces(2, Decimal.ROUND_HALF_UP).toNumber();
|
|
822
822
|
};
|
|
823
|
+
export var getProductOriginTotalPrice = function getProductOriginTotalPrice(item) {
|
|
824
|
+
var _ref2, _ref3, _item$metadata$source, _item$metadata, _item$_extend3, _item$_extend4, _item$_extend5;
|
|
825
|
+
var price = new Decimal((_ref2 = (_ref3 = (_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.price) !== null && _ref3 !== void 0 ? _ref3 : item === null || item === void 0 || (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.price) !== null && _ref2 !== void 0 ? _ref2 : 0);
|
|
826
|
+
var other = (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.other;
|
|
827
|
+
// 如果有 priceOverride,则强制使用 priceOverride,不受规则约束
|
|
828
|
+
if ((_item$_extend5 = item._extend) !== null && _item$_extend5 !== void 0 && _item$_extend5.priceOverride) {
|
|
829
|
+
var _item$_extend6;
|
|
830
|
+
price = new Decimal(((_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.priceOverride) || 0);
|
|
831
|
+
return price.toNumber();
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// 多规格
|
|
835
|
+
if (other !== null && other !== void 0 && other.product_variant_id) {
|
|
836
|
+
price = new Decimal((other === null || other === void 0 ? void 0 : other.price) || 0);
|
|
837
|
+
}
|
|
838
|
+
if (other !== null && other !== void 0 && other.bundle) {
|
|
839
|
+
// bundle
|
|
840
|
+
price = other === null || other === void 0 ? void 0 : other.bundle.reduce(function (accumulator, currentValue) {
|
|
841
|
+
var _ref4, _ref5, _ref6, _currentValue$source_;
|
|
842
|
+
var currentPrice = new Decimal((_ref4 = (_ref5 = (_ref6 = (_currentValue$source_ = currentValue === null || currentValue === void 0 ? void 0 : currentValue.source_product_price) !== null && _currentValue$source_ !== void 0 ? _currentValue$source_ : currentValue === null || currentValue === void 0 ? void 0 : currentValue.original_price) !== null && _ref6 !== void 0 ? _ref6 : currentValue === null || currentValue === void 0 ? void 0 : currentValue.product_price) !== null && _ref5 !== void 0 ? _ref5 : currentValue.price) !== null && _ref4 !== void 0 ? _ref4 : 0);
|
|
843
|
+
var currentNum = new Decimal(currentValue.num || 0);
|
|
844
|
+
return accumulator.add(currentPrice.mul(currentNum));
|
|
845
|
+
}, price);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// 单规格
|
|
849
|
+
if (other !== null && other !== void 0 && other.option) {
|
|
850
|
+
price = other === null || other === void 0 ? void 0 : other.option.reduce(function (accumulator, currentValue) {
|
|
851
|
+
var currentPrice = new Decimal(currentValue.price || 0);
|
|
852
|
+
var currentNum = new Decimal(currentValue.num || 0);
|
|
853
|
+
return accumulator.add(currentPrice.mul(currentNum));
|
|
854
|
+
}, price);
|
|
855
|
+
}
|
|
856
|
+
return price.toDecimalPlaces(2, Decimal.ROUND_HALF_UP).toNumber();
|
|
857
|
+
};
|
|
858
|
+
|
|
823
859
|
/**
|
|
824
860
|
* @title: 判断 duration
|
|
825
861
|
* @description: 用于处理不同格式的duration
|
|
@@ -9,7 +9,7 @@ import { PosProps } from './const';
|
|
|
9
9
|
*/
|
|
10
10
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
11
11
|
className?: string | undefined;
|
|
12
|
-
onChange?: ((status: "
|
|
12
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
13
13
|
[keys: string]: unknown;
|
|
14
14
|
} | undefined, other?: any) => void) | undefined;
|
|
15
15
|
onClose: () => void;
|
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
|
|
12
12
|
api: PayProps['api'];
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
onChange?: ((status: "
|
|
14
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
15
15
|
[keys: string]: unknown;
|
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
|
17
17
|
onClose: () => void;
|
|
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "warn" | "loading" | "init" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly" | "huifu">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -178,7 +178,7 @@ export declare const updateCustom: (payload: {
|
|
|
178
178
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
179
179
|
type: EActionTypes;
|
|
180
180
|
payload: {
|
|
181
|
-
status: "
|
|
181
|
+
status: "success" | "warn" | "loading" | "fail" | "question";
|
|
182
182
|
};
|
|
183
183
|
};
|
|
184
184
|
/**
|
|
@@ -299,10 +299,10 @@ 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" | "pay" | "fullPay" | "query" | undefined;
|
|
303
303
|
order_id?: string | number | undefined;
|
|
304
|
-
eftpos?: "
|
|
305
|
-
action?: "
|
|
304
|
+
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | "huifu" | undefined;
|
|
305
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
306
306
|
key?: number | undefined;
|
|
307
307
|
step?: number | undefined;
|
|
308
308
|
title?: string | undefined;
|
|
@@ -312,7 +312,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
312
312
|
net?: boolean | undefined;
|
|
313
313
|
component?: string | undefined;
|
|
314
314
|
form?: string | undefined;
|
|
315
|
-
status?: "
|
|
315
|
+
status?: "success" | "warn" | "loading" | "init" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
316
316
|
warn?: string | undefined;
|
|
317
317
|
steps?: {
|
|
318
318
|
/** 用于重置当前步骤 */
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
4
3
|
order: any;
|
|
@@ -30,11 +29,4 @@ export interface PayGroup {
|
|
|
30
29
|
_order: any;
|
|
31
30
|
front_order_uuid?: string;
|
|
32
31
|
}
|
|
33
|
-
export declare const Provider:
|
|
34
|
-
state: FormState;
|
|
35
|
-
} & {
|
|
36
|
-
dispatch: (params: {
|
|
37
|
-
type: string;
|
|
38
|
-
payload: any;
|
|
39
|
-
}) => void;
|
|
40
|
-
}>;
|
|
32
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,11 +68,4 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider:
|
|
73
|
-
state: FormState;
|
|
74
|
-
} & {
|
|
75
|
-
dispatch: (params: {
|
|
76
|
-
type: string;
|
|
77
|
-
payload: any;
|
|
78
|
-
}) => void;
|
|
79
|
-
}>;
|
|
71
|
+
export declare const Provider: any, Context: any;
|
|
@@ -47,7 +47,7 @@ declare type ScanData = {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
export declare const formatScanCustomer: (data: ScanData) => {
|
|
50
|
-
searchType: "
|
|
50
|
+
searchType: "customer" | "product" | "walletPass" | "wallet" | "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;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
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
|
+
export declare const Provider: any, Context: any;
|
|
@@ -337,7 +337,7 @@ var formatProductMetadata = (item) => {
|
|
|
337
337
|
var getSourceProductPrice = (item) => {
|
|
338
338
|
var _a, _b, _c;
|
|
339
339
|
const other = (_a = item._extend) == null ? void 0 : _a.other;
|
|
340
|
-
let price = Number((_b = item._extend) == null ? void 0 : _b.price);
|
|
340
|
+
let price = Number((item == null ? void 0 : item.price) ?? ((_b = item._extend) == null ? void 0 : _b.price));
|
|
341
341
|
if ((other == null ? void 0 : other.product_variant_id) > 0 && ((_c = item == null ? void 0 : item.variant) == null ? void 0 : _c.length) > 0) {
|
|
342
342
|
const variant = item.variant.find(
|
|
343
343
|
(d) => d.id === (other == null ? void 0 : other.product_variant_id)
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
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
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormState } from '../model';
|
|
3
1
|
export declare const walkInData: {
|
|
4
2
|
id: number;
|
|
5
3
|
nickname: string;
|
|
6
4
|
};
|
|
7
|
-
export declare const Provider:
|
|
8
|
-
state: FormState;
|
|
9
|
-
} & {
|
|
10
|
-
dispatch: (params: {
|
|
11
|
-
type: string;
|
|
12
|
-
payload: any;
|
|
13
|
-
}) => void;
|
|
14
|
-
}>;
|
|
5
|
+
export declare const Provider: any, Context: any;
|
|
@@ -81,7 +81,7 @@ var createBookingItemsByGroup = (item, isBatchEdit) => {
|
|
|
81
81
|
// 编辑时组商品需要清空booking_id 否则会重复
|
|
82
82
|
booking_id: isBatchEdit ? 0 : item.booking_id,
|
|
83
83
|
_id: `${item._id}-${i + 1}`,
|
|
84
|
-
price,
|
|
84
|
+
// price: price,
|
|
85
85
|
_extend: {
|
|
86
86
|
..._extend,
|
|
87
87
|
order_detail_id: isBatchEdit ? 0 : item.order_detail_id,
|
|
@@ -216,4 +216,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
216
216
|
* @Author: WangHan
|
|
217
217
|
* @Date: 2024-12-24 11:32
|
|
218
218
|
*/
|
|
219
|
-
export declare const updateServicePrice: (state: any) => never[]
|
|
219
|
+
export declare const updateServicePrice: (state: any) => Promise<any> | never[];
|