@pisell/private-materials 6.6.44 → 6.6.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/utils.js +10 -3
- package/es/components/booking/components/voucher/index.js +1 -1
- 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 +6 -2
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +16 -0
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +12 -5
- package/lib/components/booking/components/voucher/index.js +1 -1
- 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 +3 -0
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +16 -0
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/package.json +2 -2
|
@@ -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
|
+
}>;
|
|
@@ -519,7 +519,8 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
|
519
519
|
}
|
|
520
520
|
return {
|
|
521
521
|
originTax: expectedOriginTax,
|
|
522
|
-
tax: expectedTax
|
|
522
|
+
tax: expectedTax,
|
|
523
|
+
taxDecimal: preciseTax
|
|
523
524
|
};
|
|
524
525
|
};
|
|
525
526
|
|
|
@@ -651,7 +652,7 @@ var getTax = function getTax(state, options) {
|
|
|
651
652
|
computed: computed
|
|
652
653
|
});
|
|
653
654
|
totalOriginTax = totalOriginTax.plus(serviceResult.originTax);
|
|
654
|
-
totalTax = totalTax.plus(serviceResult.
|
|
655
|
+
totalTax = totalTax.plus(serviceResult.taxDecimal);
|
|
655
656
|
}
|
|
656
657
|
|
|
657
658
|
// 处理附加商品
|
|
@@ -662,7 +663,7 @@ var getTax = function getTax(state, options) {
|
|
|
662
663
|
computed: computed
|
|
663
664
|
});
|
|
664
665
|
totalOriginTax = totalOriginTax.plus(addonsResult.originTax);
|
|
665
|
-
totalTax = totalTax.plus(addonsResult.
|
|
666
|
+
totalTax = totalTax.plus(addonsResult.taxDecimal);
|
|
666
667
|
}
|
|
667
668
|
}
|
|
668
669
|
return {
|
|
@@ -107,6 +107,7 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
107
107
|
}
|
|
108
108
|
} catch (error) {}
|
|
109
109
|
return bundle.map(function (d) {
|
|
110
|
+
var _d$metadata;
|
|
110
111
|
var option = formatProductOption(d.option);
|
|
111
112
|
var option_price = option.reduce(function (temp, item) {
|
|
112
113
|
return temp + Number(item.num) * item.custom_add_price;
|
|
@@ -134,7 +135,7 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
134
135
|
"bundle_selling_price": Math.abs(d === null || d === void 0 ? void 0 : d.price),
|
|
135
136
|
// "bundle_sum_price": d?.original_price || d?.original_total,
|
|
136
137
|
"metadata": {
|
|
137
|
-
custom_product_bundle_map_id: d._id,
|
|
138
|
+
custom_product_bundle_map_id: (d === null || d === void 0 || (_d$metadata = d.metadata) === null || _d$metadata === void 0 ? void 0 : _d$metadata.custom_product_bundle_map_id) || d._id,
|
|
138
139
|
// 子商品单数量附加费
|
|
139
140
|
"surcharge_fee": d.surcharge_fee,
|
|
140
141
|
// 可选,附加费均摊舍入金额
|
|
@@ -473,7 +474,7 @@ export var getMainProductSellingPrice = function getMainProductSellingPrice(item
|
|
|
473
474
|
* @Author: WangHan
|
|
474
475
|
* @Date: 2024-12-07 14:21
|
|
475
476
|
*/
|
|
476
|
-
var formatProducts = function formatProducts(item, quantity) {
|
|
477
|
+
var formatProducts = function formatProducts(item, quantity, options) {
|
|
477
478
|
var _item$_extend36, _getMainProductSellin, _item$_extend37, _item$_extend38, _item$_extend39, _item$_extend40;
|
|
478
479
|
var total = Number(item._extend.total);
|
|
479
480
|
var origin_total = Number(item._extend.origin_total);
|
|
@@ -488,6 +489,9 @@ var formatProducts = function formatProducts(item, quantity) {
|
|
|
488
489
|
d.metadata = _objectSpread(_objectSpread({}, d.metadata), {}, {
|
|
489
490
|
unique_identification_number: "".concat(item._extend.unique_identification_number, "_").concat(d.discount.resource_id)
|
|
490
491
|
});
|
|
492
|
+
if (options !== null && options !== void 0 && options.isServiceEdit && options !== null && options !== void 0 && options.isMultiDay) {
|
|
493
|
+
delete d.id;
|
|
494
|
+
}
|
|
491
495
|
});
|
|
492
496
|
|
|
493
497
|
// 非手动折扣
|
|
@@ -710,7 +714,10 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
710
714
|
item._extend.unique_identification_number = unique_identification_number;
|
|
711
715
|
}
|
|
712
716
|
var booking = _objectSpread(_objectSpread({
|
|
713
|
-
product: formatProducts(item
|
|
717
|
+
product: formatProducts(item, undefined, {
|
|
718
|
+
isServiceEdit: data.service.edit,
|
|
719
|
+
isMultiDay: isMultiDay
|
|
720
|
+
}),
|
|
714
721
|
relation_products: formatRelationDetails(item._extend.relation_details),
|
|
715
722
|
id: item.booking_id || 0,
|
|
716
723
|
relation_id: item._extend.relation_id || 0,
|
|
@@ -128,7 +128,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
128
128
|
var val = (_ref = state.service.value || []) === null || _ref === void 0 ? void 0 : _ref.map(function (value) {
|
|
129
129
|
var _value$_extend, _value$_extend2, _value$_extend3;
|
|
130
130
|
return {
|
|
131
|
-
booking_id: value.booking_id,
|
|
131
|
+
// booking_id: value.booking_id,
|
|
132
132
|
id: value.id,
|
|
133
133
|
price: value.price,
|
|
134
134
|
total: value === null || value === void 0 || (_value$_extend = value._extend) === null || _value$_extend === void 0 ? void 0 : _value$_extend.total,
|
|
@@ -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
|
+
}>;
|
|
@@ -41,7 +41,7 @@ import { editSessionProduct } from "../../../info/utils";
|
|
|
41
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,
|
|
44
|
+
import { getProductAllDiscountList, mergeBundles, setProductPrice, mergeBundleWithOriginalPrice } 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";
|
|
@@ -687,7 +687,9 @@ var Info = function Info(_, ref) {
|
|
|
687
687
|
},
|
|
688
688
|
isOS: isSession,
|
|
689
689
|
customer_id: (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id,
|
|
690
|
-
value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other),
|
|
690
|
+
value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other), {}, {
|
|
691
|
+
bundle: mergeBundles(item._extend.other)
|
|
692
|
+
}, sessionValue), {}, {
|
|
691
693
|
quantity: values.quantity || item._extend.quantity
|
|
692
694
|
})
|
|
693
695
|
},
|
|
@@ -1223,6 +1225,8 @@ var Info = function Info(_, ref) {
|
|
|
1223
1225
|
var _cacheItem$_extend$ot, _cacheItem$_extend$ot2;
|
|
1224
1226
|
delete cacheItem.discount_list;
|
|
1225
1227
|
(_cacheItem$_extend$ot = cacheItem._extend.other) === null || _cacheItem$_extend$ot === void 0 || (_cacheItem$_extend$ot = _cacheItem$_extend$ot.bundle) === null || _cacheItem$_extend$ot === void 0 || (_cacheItem$_extend$ot2 = _cacheItem$_extend$ot.forEach) === null || _cacheItem$_extend$ot2 === void 0 || _cacheItem$_extend$ot2.call(_cacheItem$_extend$ot, function (bundle) {
|
|
1228
|
+
var _bundle$metadata;
|
|
1229
|
+
bundle === null || bundle === void 0 || (_bundle$metadata = bundle.metadata) === null || _bundle$metadata === void 0 || delete _bundle$metadata.custom_product_bundle_map_id;
|
|
1226
1230
|
bundle === null || bundle === void 0 || delete bundle.discount_list;
|
|
1227
1231
|
bundle === null || bundle === void 0 || delete bundle.booking_id;
|
|
1228
1232
|
bundle === null || bundle === void 0 || delete bundle.bundle_selling_price;
|
|
@@ -32,6 +32,7 @@ export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total
|
|
|
32
32
|
* @returns 折扣列表
|
|
33
33
|
*/
|
|
34
34
|
export declare const getProductAllDiscountList: (cacheItem: any) => any;
|
|
35
|
+
export declare const mergeBundles: (other: any) => any[];
|
|
35
36
|
/**
|
|
36
37
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
37
38
|
* @param other - callback 返回的新数据
|
|
@@ -149,6 +149,22 @@ export var getProductAllDiscountList = function getProductAllDiscountList(cacheI
|
|
|
149
149
|
(_discountList = discountList).push.apply(_discountList, _toConsumableArray(bundleDiscountList));
|
|
150
150
|
return discountList;
|
|
151
151
|
};
|
|
152
|
+
export var mergeBundles = function mergeBundles(other) {
|
|
153
|
+
var bundle = (other === null || other === void 0 ? void 0 : other.bundle) || [];
|
|
154
|
+
var newBundle = [];
|
|
155
|
+
bundle.forEach(function (item) {
|
|
156
|
+
var newItem = newBundle.find(function (newItem) {
|
|
157
|
+
return newItem.id === item.id;
|
|
158
|
+
});
|
|
159
|
+
if (newItem) {
|
|
160
|
+
newItem.num += item.num || 1;
|
|
161
|
+
newItem.quantity += item.quantity || 1;
|
|
162
|
+
} else {
|
|
163
|
+
newBundle.push(_objectSpread({}, item));
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
return newBundle;
|
|
167
|
+
};
|
|
152
168
|
|
|
153
169
|
/**
|
|
154
170
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
@@ -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
|
+
}>;
|
|
@@ -189,7 +189,7 @@ var Payments = Provider(function (props) {
|
|
|
189
189
|
className: "payment-list-item-surcharge"
|
|
190
190
|
}, "(", locales.getText("pisell2.text.surcharge"), " ", formatAmount(item.service_fee, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || "$"), ")") : null, /*#__PURE__*/React.createElement("div", {
|
|
191
191
|
className: "payment-list-item-date"
|
|
192
|
-
}, dayjs(item.payment_time).format("HH:mm YYYY/MM/DD"), /*#__PURE__*/React.createElement("span", {
|
|
192
|
+
}, dayjs(item.payment_time || item.created_at).format("HH:mm YYYY/MM/DD"), /*#__PURE__*/React.createElement("span", {
|
|
193
193
|
className: "payment-list-item-platform-type"
|
|
194
194
|
}, item.platform && locales.getText("pisell2.text.platform.type")(item.platform))))))));
|
|
195
195
|
}
|
|
@@ -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,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
3
4
|
order: any;
|
|
@@ -29,4 +30,11 @@ export interface PayGroup {
|
|
|
29
30
|
_order: any;
|
|
30
31
|
front_order_uuid?: string;
|
|
31
32
|
}
|
|
32
|
-
export declare const Provider: any, Context:
|
|
33
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
34
|
+
state: FormState;
|
|
35
|
+
} & {
|
|
36
|
+
dispatch: (params: {
|
|
37
|
+
type: string;
|
|
38
|
+
payload: any;
|
|
39
|
+
}) => void;
|
|
40
|
+
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,4 +69,11 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: any, Context:
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
73
|
+
state: FormState;
|
|
74
|
+
} & {
|
|
75
|
+
dispatch: (params: {
|
|
76
|
+
type: string;
|
|
77
|
+
payload: any;
|
|
78
|
+
}) => void;
|
|
79
|
+
}>;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -322,7 +322,7 @@ var processItemsTax = (items, state, options) => {
|
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
return { originTax: expectedOriginTax, tax: expectedTax };
|
|
325
|
+
return { originTax: expectedOriginTax, tax: expectedTax, taxDecimal: preciseTax };
|
|
326
326
|
};
|
|
327
327
|
var clearTaxFee = (state) => {
|
|
328
328
|
var _a, _b;
|
|
@@ -375,7 +375,7 @@ var getTax = (state, options) => {
|
|
|
375
375
|
computed
|
|
376
376
|
});
|
|
377
377
|
totalOriginTax = totalOriginTax.plus(serviceResult.originTax);
|
|
378
|
-
totalTax = totalTax.plus(serviceResult.
|
|
378
|
+
totalTax = totalTax.plus(serviceResult.taxDecimal);
|
|
379
379
|
}
|
|
380
380
|
if ((_c = state == null ? void 0 : state.addons) == null ? void 0 : _c.value) {
|
|
381
381
|
const addonsResult = processItemsTax(state.addons.value, state, {
|
|
@@ -384,7 +384,7 @@ var getTax = (state, options) => {
|
|
|
384
384
|
computed
|
|
385
385
|
});
|
|
386
386
|
totalOriginTax = totalOriginTax.plus(addonsResult.originTax);
|
|
387
|
-
totalTax = totalTax.plus(addonsResult.
|
|
387
|
+
totalTax = totalTax.plus(addonsResult.taxDecimal);
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
return {
|
|
@@ -110,13 +110,14 @@ var formatProductBundle = (bundle) => {
|
|
|
110
110
|
} catch (error) {
|
|
111
111
|
}
|
|
112
112
|
return bundle.map((d) => {
|
|
113
|
+
var _a;
|
|
113
114
|
const option = formatProductOption(d.option);
|
|
114
115
|
const option_price = option.reduce((temp, item) => {
|
|
115
116
|
return temp + Number(item.num) * item.custom_add_price;
|
|
116
117
|
}, 0);
|
|
117
118
|
const product_discount_difference = ((d == null ? void 0 : d.discount_list) || []).reduce((pre, cur) => {
|
|
118
|
-
var
|
|
119
|
-
return pre + (((
|
|
119
|
+
var _a2;
|
|
120
|
+
return pre + (((_a2 = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a2.product_discount_difference) || 0);
|
|
120
121
|
}, 0);
|
|
121
122
|
return {
|
|
122
123
|
"is_charge_tax": d.is_charge_tax,
|
|
@@ -137,7 +138,7 @@ var formatProductBundle = (bundle) => {
|
|
|
137
138
|
"bundle_selling_price": Math.abs(d == null ? void 0 : d.price),
|
|
138
139
|
// "bundle_sum_price": d?.original_price || d?.original_total,
|
|
139
140
|
"metadata": {
|
|
140
|
-
custom_product_bundle_map_id: d._id,
|
|
141
|
+
custom_product_bundle_map_id: ((_a = d == null ? void 0 : d.metadata) == null ? void 0 : _a.custom_product_bundle_map_id) || d._id,
|
|
141
142
|
// 子商品单数量附加费
|
|
142
143
|
"surcharge_fee": d.surcharge_fee,
|
|
143
144
|
// 可选,附加费均摊舍入金额
|
|
@@ -366,7 +367,7 @@ var getMainProductSellingPrice = (item) => {
|
|
|
366
367
|
}
|
|
367
368
|
return new import_decimal.default((_f = item._extend) == null ? void 0 : _f.main_product_selling_price).add(optionPrice).toNumber();
|
|
368
369
|
};
|
|
369
|
-
var formatProducts = (item, quantity) => {
|
|
370
|
+
var formatProducts = (item, quantity, options) => {
|
|
370
371
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
371
372
|
const total = Number(item._extend.total);
|
|
372
373
|
const origin_total = Number(item._extend.origin_total);
|
|
@@ -380,6 +381,9 @@ var formatProducts = (item, quantity) => {
|
|
|
380
381
|
...d.metadata,
|
|
381
382
|
unique_identification_number: `${item._extend.unique_identification_number}_${d.discount.resource_id}`
|
|
382
383
|
};
|
|
384
|
+
if ((options == null ? void 0 : options.isServiceEdit) && (options == null ? void 0 : options.isMultiDay)) {
|
|
385
|
+
delete d.id;
|
|
386
|
+
}
|
|
383
387
|
});
|
|
384
388
|
const notManualDiscount = discount_list.filter(
|
|
385
389
|
(item2) => item2.type !== "product"
|
|
@@ -520,7 +524,10 @@ var formatBookings = (data, values) => {
|
|
|
520
524
|
item._extend.unique_identification_number = unique_identification_number;
|
|
521
525
|
}
|
|
522
526
|
const booking = {
|
|
523
|
-
product: formatProducts(item
|
|
527
|
+
product: formatProducts(item, void 0, {
|
|
528
|
+
isServiceEdit: data.service.edit,
|
|
529
|
+
isMultiDay
|
|
530
|
+
}),
|
|
524
531
|
relation_products: formatRelationDetails(item._extend.relation_details),
|
|
525
532
|
id: item.booking_id || 0,
|
|
526
533
|
relation_id: item._extend.relation_id || 0,
|
|
@@ -111,7 +111,7 @@ var VoucherCard = (props) => {
|
|
|
111
111
|
const val = (_a2 = state.service.value || []) == null ? void 0 : _a2.map((value) => {
|
|
112
112
|
var _a3, _b2, _c2;
|
|
113
113
|
return {
|
|
114
|
-
booking_id: value.booking_id,
|
|
114
|
+
// booking_id: value.booking_id,
|
|
115
115
|
id: value.id,
|
|
116
116
|
price: value.price,
|
|
117
117
|
total: (_a3 = value == null ? void 0 : value._extend) == null ? void 0 : _a3.total,
|
|
@@ -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
|
+
}>;
|
|
@@ -528,6 +528,7 @@ var Info = (_, ref) => {
|
|
|
528
528
|
customer_id: (_e2 = (_d2 = state.client) == null ? void 0 : _d2.value) == null ? void 0 : _e2.id,
|
|
529
529
|
value: {
|
|
530
530
|
...item._extend.other,
|
|
531
|
+
bundle: (0, import_utils8.mergeBundles)(item._extend.other),
|
|
531
532
|
...sessionValue,
|
|
532
533
|
quantity: values.quantity || item._extend.quantity
|
|
533
534
|
}
|
|
@@ -1023,6 +1024,8 @@ var Info = (_, ref) => {
|
|
|
1023
1024
|
var _a2, _b2, _c2;
|
|
1024
1025
|
delete cacheItem.discount_list;
|
|
1025
1026
|
(_c2 = (_b2 = (_a2 = cacheItem._extend.other) == null ? void 0 : _a2.bundle) == null ? void 0 : _b2.forEach) == null ? void 0 : _c2.call(_b2, (bundle) => {
|
|
1027
|
+
var _a3;
|
|
1028
|
+
(_a3 = bundle == null ? void 0 : bundle.metadata) == null ? true : delete _a3.custom_product_bundle_map_id;
|
|
1026
1029
|
bundle == null ? true : delete bundle.discount_list;
|
|
1027
1030
|
bundle == null ? true : delete bundle.booking_id;
|
|
1028
1031
|
bundle == null ? true : delete bundle.bundle_selling_price;
|
|
@@ -32,6 +32,7 @@ export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total
|
|
|
32
32
|
* @returns 折扣列表
|
|
33
33
|
*/
|
|
34
34
|
export declare const getProductAllDiscountList: (cacheItem: any) => any;
|
|
35
|
+
export declare const mergeBundles: (other: any) => any[];
|
|
35
36
|
/**
|
|
36
37
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
37
38
|
* @param other - callback 返回的新数据
|
|
@@ -32,6 +32,7 @@ __export(utils_exports, {
|
|
|
32
32
|
getAutoAllocationStorage: () => getAutoAllocationStorage,
|
|
33
33
|
getProductAllDiscountList: () => getProductAllDiscountList,
|
|
34
34
|
mergeBundleWithOriginalPrice: () => mergeBundleWithOriginalPrice,
|
|
35
|
+
mergeBundles: () => mergeBundles,
|
|
35
36
|
setAutoAllocationStorage: () => setAutoAllocationStorage,
|
|
36
37
|
setProductPrice: () => setProductPrice
|
|
37
38
|
});
|
|
@@ -96,6 +97,20 @@ var getProductAllDiscountList = (cacheItem) => {
|
|
|
96
97
|
discountList.push(...bundleDiscountList);
|
|
97
98
|
return discountList;
|
|
98
99
|
};
|
|
100
|
+
var mergeBundles = (other) => {
|
|
101
|
+
const bundle = (other == null ? void 0 : other.bundle) || [];
|
|
102
|
+
const newBundle = [];
|
|
103
|
+
bundle.forEach((item) => {
|
|
104
|
+
const newItem = newBundle.find((newItem2) => newItem2.id === item.id);
|
|
105
|
+
if (newItem) {
|
|
106
|
+
newItem.num += item.num || 1;
|
|
107
|
+
newItem.quantity += item.quantity || 1;
|
|
108
|
+
} else {
|
|
109
|
+
newBundle.push({ ...item });
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return newBundle;
|
|
113
|
+
};
|
|
99
114
|
var mergeBundleWithOriginalPrice = (other, originalOther) => {
|
|
100
115
|
var _a, _b;
|
|
101
116
|
if (!((_a = other == null ? void 0 : other.bundle) == null ? void 0 : _a.length) || !((_b = originalOther == null ? void 0 : originalOther.bundle) == null ? void 0 : _b.length)) return other;
|
|
@@ -115,6 +130,7 @@ var mergeBundleWithOriginalPrice = (other, originalOther) => {
|
|
|
115
130
|
getAutoAllocationStorage,
|
|
116
131
|
getProductAllDiscountList,
|
|
117
132
|
mergeBundleWithOriginalPrice,
|
|
133
|
+
mergeBundles,
|
|
118
134
|
setAutoAllocationStorage,
|
|
119
135
|
setProductPrice
|
|
120
136
|
});
|
|
@@ -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
|
+
}>;
|
|
@@ -134,7 +134,7 @@ var Payments = (0, import_model.Provider)((props) => {
|
|
|
134
134
|
item.service_fee,
|
|
135
135
|
2,
|
|
136
136
|
(state == null ? void 0 : state.amountSymbol) || "$"
|
|
137
|
-
), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time).format(
|
|
137
|
+
), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time || item.created_at).format(
|
|
138
138
|
"HH:mm YYYY/MM/DD"
|
|
139
139
|
), /* @__PURE__ */ import_react.default.createElement("span", { className: "payment-list-item-platform-type" }, item.platform && import_utils.locales.getText("pisell2.text.platform.type")(
|
|
140
140
|
item.platform
|
|
@@ -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,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
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.45",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@react-spring/web": "^9.6.1",
|
|
63
63
|
"@use-gesture/react": "^10.3.1",
|
|
64
64
|
"@pisell/utils": "3.0.2",
|
|
65
|
-
"@pisell/materials": "6.6.
|
|
65
|
+
"@pisell/materials": "6.6.15",
|
|
66
66
|
"@pisell/icon": "0.0.11",
|
|
67
67
|
"@pisell/date-picker": "3.0.7"
|
|
68
68
|
},
|