@pisell/private-materials 6.6.54 → 6.6.56
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/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/components/footer/amount.js +3 -4
- package/es/components/booking/components/footer/utils.js +3 -10
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/booking/info2/service/editService/index.js +2 -6
- package/es/components/booking/info2/service/editService/utils.d.ts +0 -1
- package/es/components/booking/info2/service/editService/utils.js +0 -16
- package/es/components/booking/payments/index.js +1 -1
- package/es/pro/Login2.0/components/phoneValidation.js +65 -58
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +5 -12
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/booking/info2/service/editService/index.js +0 -3
- package/lib/components/booking/info2/service/editService/utils.d.ts +0 -1
- package/lib/components/booking/info2/service/editService/utils.js +0 -16
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/pro/Login2.0/components/phoneValidation.js +4 -2
- package/package.json +4 -4
|
@@ -519,8 +519,7 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
|
519
519
|
}
|
|
520
520
|
return {
|
|
521
521
|
originTax: expectedOriginTax,
|
|
522
|
-
tax: expectedTax
|
|
523
|
-
taxDecimal: preciseTax
|
|
522
|
+
tax: expectedTax
|
|
524
523
|
};
|
|
525
524
|
};
|
|
526
525
|
|
|
@@ -652,7 +651,7 @@ var getTax = function getTax(state, options) {
|
|
|
652
651
|
computed: computed
|
|
653
652
|
});
|
|
654
653
|
totalOriginTax = totalOriginTax.plus(serviceResult.originTax);
|
|
655
|
-
totalTax = totalTax.plus(serviceResult.
|
|
654
|
+
totalTax = totalTax.plus(serviceResult.tax);
|
|
656
655
|
}
|
|
657
656
|
|
|
658
657
|
// 处理附加商品
|
|
@@ -663,7 +662,7 @@ var getTax = function getTax(state, options) {
|
|
|
663
662
|
computed: computed
|
|
664
663
|
});
|
|
665
664
|
totalOriginTax = totalOriginTax.plus(addonsResult.originTax);
|
|
666
|
-
totalTax = totalTax.plus(addonsResult.
|
|
665
|
+
totalTax = totalTax.plus(addonsResult.tax);
|
|
667
666
|
}
|
|
668
667
|
}
|
|
669
668
|
return {
|
|
@@ -108,7 +108,6 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
108
108
|
}
|
|
109
109
|
} catch (error) {}
|
|
110
110
|
return bundle.map(function (d) {
|
|
111
|
-
var _d$metadata;
|
|
112
111
|
var option = formatProductOption(d.option);
|
|
113
112
|
var option_price = option.reduce(function (temp, item) {
|
|
114
113
|
return temp + Number(item.num) * item.custom_add_price;
|
|
@@ -136,7 +135,7 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
136
135
|
"bundle_selling_price": Math.abs(d === null || d === void 0 ? void 0 : d.price),
|
|
137
136
|
// "bundle_sum_price": d?.original_price || d?.original_total,
|
|
138
137
|
"metadata": {
|
|
139
|
-
custom_product_bundle_map_id:
|
|
138
|
+
custom_product_bundle_map_id: d._id,
|
|
140
139
|
// 子商品单数量附加费
|
|
141
140
|
"surcharge_fee": d.surcharge_fee,
|
|
142
141
|
// 可选,附加费均摊舍入金额
|
|
@@ -478,7 +477,7 @@ export var getMainProductSellingPrice = function getMainProductSellingPrice(item
|
|
|
478
477
|
* @Author: WangHan
|
|
479
478
|
* @Date: 2024-12-07 14:21
|
|
480
479
|
*/
|
|
481
|
-
var formatProducts = function formatProducts(item, quantity
|
|
480
|
+
var formatProducts = function formatProducts(item, quantity) {
|
|
482
481
|
var _item$_extend36, _getMainProductSellin, _item$_extend37, _item$_extend38, _item$_extend39, _item$_extend40;
|
|
483
482
|
var total = Number(item._extend.total);
|
|
484
483
|
var origin_total = Number(item._extend.origin_total);
|
|
@@ -493,9 +492,6 @@ var formatProducts = function formatProducts(item, quantity, options) {
|
|
|
493
492
|
d.metadata = _objectSpread(_objectSpread({}, d.metadata), {}, {
|
|
494
493
|
unique_identification_number: "".concat(item._extend.unique_identification_number, "_").concat(d.discount.resource_id)
|
|
495
494
|
});
|
|
496
|
-
if (options !== null && options !== void 0 && options.isServiceEdit && options !== null && options !== void 0 && options.isMultiDay) {
|
|
497
|
-
delete d.id;
|
|
498
|
-
}
|
|
499
495
|
});
|
|
500
496
|
|
|
501
497
|
// 非手动折扣
|
|
@@ -718,10 +714,7 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
718
714
|
item._extend.unique_identification_number = unique_identification_number;
|
|
719
715
|
}
|
|
720
716
|
var booking = _objectSpread(_objectSpread({
|
|
721
|
-
product: formatProducts(item,
|
|
722
|
-
isServiceEdit: data.service.edit,
|
|
723
|
-
isMultiDay: isMultiDay
|
|
724
|
-
}),
|
|
717
|
+
product: formatProducts(item),
|
|
725
718
|
relation_products: formatRelationDetails(item._extend.relation_details),
|
|
726
719
|
id: item.booking_id || 0,
|
|
727
720
|
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
|
-
|
|
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,
|
|
@@ -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, 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";
|
|
@@ -687,9 +687,7 @@ 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), {}, {
|
|
691
|
-
bundle: mergeBundles(item._extend.other)
|
|
692
|
-
}, sessionValue), {}, {
|
|
690
|
+
value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other), sessionValue), {}, {
|
|
693
691
|
quantity: values.quantity || item._extend.quantity
|
|
694
692
|
})
|
|
695
693
|
},
|
|
@@ -1225,8 +1223,6 @@ var Info = function Info(_, ref) {
|
|
|
1225
1223
|
var _cacheItem$_extend$ot, _cacheItem$_extend$ot2;
|
|
1226
1224
|
delete cacheItem.discount_list;
|
|
1227
1225
|
(_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;
|
|
1230
1226
|
bundle === null || bundle === void 0 || delete bundle.discount_list;
|
|
1231
1227
|
bundle === null || bundle === void 0 || delete bundle.booking_id;
|
|
1232
1228
|
bundle === null || bundle === void 0 || delete bundle.bundle_selling_price;
|
|
@@ -32,7 +32,6 @@ 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[];
|
|
36
35
|
/**
|
|
37
36
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
38
37
|
* @param other - callback 返回的新数据
|
|
@@ -149,22 +149,6 @@ 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
|
-
};
|
|
168
152
|
|
|
169
153
|
/**
|
|
170
154
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
@@ -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
|
|
192
|
+
}, dayjs(item.payment_time).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
|
}
|
|
@@ -12,7 +12,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
12
12
|
*/
|
|
13
13
|
export var validatePhoneNumber = /*#__PURE__*/function () {
|
|
14
14
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, getText) {
|
|
15
|
-
var phone, countryCode, match;
|
|
15
|
+
var phone, countryCode, match, usCanadaReg, auReg;
|
|
16
16
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
@@ -55,7 +55,7 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
55
55
|
throw new Error(getText('pisell-phone-validation-required'));
|
|
56
56
|
case 16:
|
|
57
57
|
_context.t0 = countryCode;
|
|
58
|
-
_context.next = _context.t0 === '86' ? 19 : _context.t0 === '852' ? 22 : _context.t0 === '853' ? 25 : _context.t0 === '886' ? 28 : _context.t0 === '1' ? 31 : _context.t0 === '44' ?
|
|
58
|
+
_context.next = _context.t0 === '86' ? 19 : _context.t0 === '852' ? 22 : _context.t0 === '853' ? 25 : _context.t0 === '886' ? 28 : _context.t0 === '1' ? 31 : _context.t0 === '44' ? 35 : _context.t0 === '61' ? 38 : _context.t0 === '81' ? 42 : _context.t0 === '82' ? 45 : _context.t0 === '65' ? 48 : _context.t0 === '60' ? 51 : _context.t0 === '66' ? 54 : _context.t0 === '84' ? 57 : _context.t0 === '63' ? 60 : _context.t0 === '62' ? 63 : _context.t0 === '91' ? 66 : 69;
|
|
59
59
|
break;
|
|
60
60
|
case 19:
|
|
61
61
|
if (/^1[3-9]\d{9}$/.test(phone)) {
|
|
@@ -64,7 +64,7 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
64
64
|
}
|
|
65
65
|
throw new Error(getText('pisell-phone-validation-china'));
|
|
66
66
|
case 21:
|
|
67
|
-
return _context.abrupt("break",
|
|
67
|
+
return _context.abrupt("break", 72);
|
|
68
68
|
case 22:
|
|
69
69
|
if (/^[5-9]\d{7}$/.test(phone)) {
|
|
70
70
|
_context.next = 24;
|
|
@@ -72,7 +72,7 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
72
72
|
}
|
|
73
73
|
throw new Error(getText('pisell-phone-validation-hongkong'));
|
|
74
74
|
case 24:
|
|
75
|
-
return _context.abrupt("break",
|
|
75
|
+
return _context.abrupt("break", 72);
|
|
76
76
|
case 25:
|
|
77
77
|
if (/^6\d{7}$/.test(phone)) {
|
|
78
78
|
_context.next = 27;
|
|
@@ -80,7 +80,7 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
80
80
|
}
|
|
81
81
|
throw new Error(getText('pisell-phone-validation-macau'));
|
|
82
82
|
case 27:
|
|
83
|
-
return _context.abrupt("break",
|
|
83
|
+
return _context.abrupt("break", 72);
|
|
84
84
|
case 28:
|
|
85
85
|
if (/^9\d{8}$/.test(phone)) {
|
|
86
86
|
_context.next = 30;
|
|
@@ -88,112 +88,119 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
88
88
|
}
|
|
89
89
|
throw new Error(getText('pisell-phone-validation-taiwan'));
|
|
90
90
|
case 30:
|
|
91
|
-
return _context.abrupt("break",
|
|
91
|
+
return _context.abrupt("break", 72);
|
|
92
92
|
case 31:
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
// 美国/加拿大
|
|
94
|
+
// NANP 标准 10 位格式:3位区号[2-9] + 3位局号[2-9] + 4位
|
|
95
|
+
usCanadaReg = /^[2-9]\d{2}[2-9]\d{6}$/;
|
|
96
|
+
if (usCanadaReg.test(phone)) {
|
|
97
|
+
_context.next = 34;
|
|
95
98
|
break;
|
|
96
99
|
}
|
|
97
100
|
throw new Error(getText('pisell-phone-validation-us-canada'));
|
|
98
|
-
case 33:
|
|
99
|
-
return _context.abrupt("break", 70);
|
|
100
101
|
case 34:
|
|
102
|
+
return _context.abrupt("break", 72);
|
|
103
|
+
case 35:
|
|
101
104
|
if (/^7\d{9}$/.test(phone)) {
|
|
102
|
-
_context.next =
|
|
105
|
+
_context.next = 37;
|
|
103
106
|
break;
|
|
104
107
|
}
|
|
105
108
|
throw new Error(getText('pisell-phone-validation-uk'));
|
|
106
|
-
case 36:
|
|
107
|
-
return _context.abrupt("break", 70);
|
|
108
109
|
case 37:
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
return _context.abrupt("break", 72);
|
|
111
|
+
case 38:
|
|
112
|
+
// 澳大利亚
|
|
113
|
+
// const reg = /^(\+?0)?4\d{8}$/;
|
|
114
|
+
// 固话前缀 02/03/07/08, 手机前缀 04/05, 首位 0 可选
|
|
115
|
+
auReg = /^0?[2-578]\d{8}$/;
|
|
116
|
+
if (auReg.test(phone)) {
|
|
117
|
+
_context.next = 41;
|
|
111
118
|
break;
|
|
112
119
|
}
|
|
113
120
|
throw new Error(getText('pisell-phone-validation-australia'));
|
|
114
|
-
case
|
|
115
|
-
return _context.abrupt("break",
|
|
116
|
-
case
|
|
121
|
+
case 41:
|
|
122
|
+
return _context.abrupt("break", 72);
|
|
123
|
+
case 42:
|
|
117
124
|
if (/^[789]0\d{8}$/.test(phone)) {
|
|
118
|
-
_context.next =
|
|
125
|
+
_context.next = 44;
|
|
119
126
|
break;
|
|
120
127
|
}
|
|
121
128
|
throw new Error(getText('pisell-phone-validation-japan'));
|
|
122
|
-
case
|
|
123
|
-
return _context.abrupt("break",
|
|
124
|
-
case
|
|
129
|
+
case 44:
|
|
130
|
+
return _context.abrupt("break", 72);
|
|
131
|
+
case 45:
|
|
125
132
|
if (/^1[0-9]\d{7,8}$/.test(phone)) {
|
|
126
|
-
_context.next =
|
|
133
|
+
_context.next = 47;
|
|
127
134
|
break;
|
|
128
135
|
}
|
|
129
136
|
throw new Error(getText('pisell-phone-validation-korea'));
|
|
130
|
-
case
|
|
131
|
-
return _context.abrupt("break",
|
|
132
|
-
case
|
|
137
|
+
case 47:
|
|
138
|
+
return _context.abrupt("break", 72);
|
|
139
|
+
case 48:
|
|
133
140
|
if (/^[89]\d{7}$/.test(phone)) {
|
|
134
|
-
_context.next =
|
|
141
|
+
_context.next = 50;
|
|
135
142
|
break;
|
|
136
143
|
}
|
|
137
144
|
throw new Error(getText('pisell-phone-validation-singapore'));
|
|
138
|
-
case
|
|
139
|
-
return _context.abrupt("break",
|
|
140
|
-
case
|
|
145
|
+
case 50:
|
|
146
|
+
return _context.abrupt("break", 72);
|
|
147
|
+
case 51:
|
|
141
148
|
if (/^1[0-9]\d{7,8}$/.test(phone)) {
|
|
142
|
-
_context.next =
|
|
149
|
+
_context.next = 53;
|
|
143
150
|
break;
|
|
144
151
|
}
|
|
145
152
|
throw new Error(getText('pisell-phone-validation-malaysia'));
|
|
146
|
-
case
|
|
147
|
-
return _context.abrupt("break",
|
|
148
|
-
case
|
|
153
|
+
case 53:
|
|
154
|
+
return _context.abrupt("break", 72);
|
|
155
|
+
case 54:
|
|
149
156
|
if (/^[689]\d{8}$/.test(phone)) {
|
|
150
|
-
_context.next =
|
|
157
|
+
_context.next = 56;
|
|
151
158
|
break;
|
|
152
159
|
}
|
|
153
160
|
throw new Error(getText('pisell-phone-validation-thailand'));
|
|
154
|
-
case
|
|
155
|
-
return _context.abrupt("break",
|
|
156
|
-
case
|
|
161
|
+
case 56:
|
|
162
|
+
return _context.abrupt("break", 72);
|
|
163
|
+
case 57:
|
|
157
164
|
if (/^[3579]\d{8}$/.test(phone)) {
|
|
158
|
-
_context.next =
|
|
165
|
+
_context.next = 59;
|
|
159
166
|
break;
|
|
160
167
|
}
|
|
161
168
|
throw new Error(getText('pisell-phone-validation-vietnam'));
|
|
162
|
-
case
|
|
163
|
-
return _context.abrupt("break",
|
|
164
|
-
case
|
|
169
|
+
case 59:
|
|
170
|
+
return _context.abrupt("break", 72);
|
|
171
|
+
case 60:
|
|
165
172
|
if (/^9\d{9}$/.test(phone)) {
|
|
166
|
-
_context.next =
|
|
173
|
+
_context.next = 62;
|
|
167
174
|
break;
|
|
168
175
|
}
|
|
169
176
|
throw new Error(getText('pisell-phone-validation-philippines'));
|
|
170
|
-
case
|
|
171
|
-
return _context.abrupt("break",
|
|
172
|
-
case
|
|
177
|
+
case 62:
|
|
178
|
+
return _context.abrupt("break", 72);
|
|
179
|
+
case 63:
|
|
173
180
|
if (/^8\d{8,11}$/.test(phone)) {
|
|
174
|
-
_context.next =
|
|
181
|
+
_context.next = 65;
|
|
175
182
|
break;
|
|
176
183
|
}
|
|
177
184
|
throw new Error(getText('pisell-phone-validation-indonesia'));
|
|
178
|
-
case
|
|
179
|
-
return _context.abrupt("break",
|
|
180
|
-
case
|
|
185
|
+
case 65:
|
|
186
|
+
return _context.abrupt("break", 72);
|
|
187
|
+
case 66:
|
|
181
188
|
if (/^[6-9]\d{9}$/.test(phone)) {
|
|
182
|
-
_context.next =
|
|
189
|
+
_context.next = 68;
|
|
183
190
|
break;
|
|
184
191
|
}
|
|
185
192
|
throw new Error(getText('pisell-phone-validation-india'));
|
|
186
|
-
case
|
|
187
|
-
return _context.abrupt("break",
|
|
188
|
-
case
|
|
193
|
+
case 68:
|
|
194
|
+
return _context.abrupt("break", 72);
|
|
195
|
+
case 69:
|
|
189
196
|
if (/^\d{6,15}$/.test(phone)) {
|
|
190
|
-
_context.next =
|
|
197
|
+
_context.next = 71;
|
|
191
198
|
break;
|
|
192
199
|
}
|
|
193
200
|
throw new Error(getText('pisell-phone-validation-invalid'));
|
|
194
|
-
case
|
|
195
|
-
return _context.abrupt("break",
|
|
196
|
-
case
|
|
201
|
+
case 71:
|
|
202
|
+
return _context.abrupt("break", 72);
|
|
203
|
+
case 72:
|
|
197
204
|
case "end":
|
|
198
205
|
return _context.stop();
|
|
199
206
|
}
|
|
@@ -323,7 +323,7 @@ var processItemsTax = (items, state, options) => {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
return { originTax: expectedOriginTax, tax: expectedTax
|
|
326
|
+
return { originTax: expectedOriginTax, tax: expectedTax };
|
|
327
327
|
};
|
|
328
328
|
var clearTaxFee = (state) => {
|
|
329
329
|
var _a, _b;
|
|
@@ -376,7 +376,7 @@ var getTax = (state, options) => {
|
|
|
376
376
|
computed
|
|
377
377
|
});
|
|
378
378
|
totalOriginTax = totalOriginTax.plus(serviceResult.originTax);
|
|
379
|
-
totalTax = totalTax.plus(serviceResult.
|
|
379
|
+
totalTax = totalTax.plus(serviceResult.tax);
|
|
380
380
|
}
|
|
381
381
|
if ((_c = state == null ? void 0 : state.addons) == null ? void 0 : _c.value) {
|
|
382
382
|
const addonsResult = processItemsTax(state.addons.value, state, {
|
|
@@ -385,7 +385,7 @@ var getTax = (state, options) => {
|
|
|
385
385
|
computed
|
|
386
386
|
});
|
|
387
387
|
totalOriginTax = totalOriginTax.plus(addonsResult.originTax);
|
|
388
|
-
totalTax = totalTax.plus(addonsResult.
|
|
388
|
+
totalTax = totalTax.plus(addonsResult.tax);
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
return {
|
|
@@ -111,14 +111,13 @@ var formatProductBundle = (bundle) => {
|
|
|
111
111
|
} catch (error) {
|
|
112
112
|
}
|
|
113
113
|
return bundle.map((d) => {
|
|
114
|
-
var _a;
|
|
115
114
|
const option = formatProductOption(d.option);
|
|
116
115
|
const option_price = option.reduce((temp, item) => {
|
|
117
116
|
return temp + Number(item.num) * item.custom_add_price;
|
|
118
117
|
}, 0);
|
|
119
118
|
const product_discount_difference = ((d == null ? void 0 : d.discount_list) || []).reduce((pre, cur) => {
|
|
120
|
-
var
|
|
121
|
-
return pre + (((
|
|
119
|
+
var _a;
|
|
120
|
+
return pre + (((_a = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a.product_discount_difference) || 0);
|
|
122
121
|
}, 0);
|
|
123
122
|
return {
|
|
124
123
|
"is_charge_tax": d.is_charge_tax,
|
|
@@ -139,7 +138,7 @@ var formatProductBundle = (bundle) => {
|
|
|
139
138
|
"bundle_selling_price": Math.abs(d == null ? void 0 : d.price),
|
|
140
139
|
// "bundle_sum_price": d?.original_price || d?.original_total,
|
|
141
140
|
"metadata": {
|
|
142
|
-
custom_product_bundle_map_id:
|
|
141
|
+
custom_product_bundle_map_id: d._id,
|
|
143
142
|
// 子商品单数量附加费
|
|
144
143
|
"surcharge_fee": d.surcharge_fee,
|
|
145
144
|
// 可选,附加费均摊舍入金额
|
|
@@ -371,7 +370,7 @@ var getMainProductSellingPrice = (item) => {
|
|
|
371
370
|
}
|
|
372
371
|
return new import_decimal.default((_f = item._extend) == null ? void 0 : _f.main_product_selling_price).add(optionPrice).toNumber();
|
|
373
372
|
};
|
|
374
|
-
var formatProducts = (item, quantity
|
|
373
|
+
var formatProducts = (item, quantity) => {
|
|
375
374
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
376
375
|
const total = Number(item._extend.total);
|
|
377
376
|
const origin_total = Number(item._extend.origin_total);
|
|
@@ -385,9 +384,6 @@ var formatProducts = (item, quantity, options) => {
|
|
|
385
384
|
...d.metadata,
|
|
386
385
|
unique_identification_number: `${item._extend.unique_identification_number}_${d.discount.resource_id}`
|
|
387
386
|
};
|
|
388
|
-
if ((options == null ? void 0 : options.isServiceEdit) && (options == null ? void 0 : options.isMultiDay)) {
|
|
389
|
-
delete d.id;
|
|
390
|
-
}
|
|
391
387
|
});
|
|
392
388
|
const notManualDiscount = discount_list.filter(
|
|
393
389
|
(item2) => item2.type !== "product"
|
|
@@ -528,10 +524,7 @@ var formatBookings = (data, values) => {
|
|
|
528
524
|
item._extend.unique_identification_number = unique_identification_number;
|
|
529
525
|
}
|
|
530
526
|
const booking = {
|
|
531
|
-
product: formatProducts(item,
|
|
532
|
-
isServiceEdit: data.service.edit,
|
|
533
|
-
isMultiDay
|
|
534
|
-
}),
|
|
527
|
+
product: formatProducts(item),
|
|
535
528
|
relation_products: formatRelationDetails(item._extend.relation_details),
|
|
536
529
|
id: item.booking_id || 0,
|
|
537
530
|
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
|
-
|
|
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,
|
|
@@ -528,7 +528,6 @@ 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),
|
|
532
531
|
...sessionValue,
|
|
533
532
|
quantity: values.quantity || item._extend.quantity
|
|
534
533
|
}
|
|
@@ -1024,8 +1023,6 @@ var Info = (_, ref) => {
|
|
|
1024
1023
|
var _a2, _b2, _c2;
|
|
1025
1024
|
delete cacheItem.discount_list;
|
|
1026
1025
|
(_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;
|
|
1029
1026
|
bundle == null ? true : delete bundle.discount_list;
|
|
1030
1027
|
bundle == null ? true : delete bundle.booking_id;
|
|
1031
1028
|
bundle == null ? true : delete bundle.bundle_selling_price;
|
|
@@ -32,7 +32,6 @@ 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[];
|
|
36
35
|
/**
|
|
37
36
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
38
37
|
* @param other - callback 返回的新数据
|
|
@@ -32,7 +32,6 @@ __export(utils_exports, {
|
|
|
32
32
|
getAutoAllocationStorage: () => getAutoAllocationStorage,
|
|
33
33
|
getProductAllDiscountList: () => getProductAllDiscountList,
|
|
34
34
|
mergeBundleWithOriginalPrice: () => mergeBundleWithOriginalPrice,
|
|
35
|
-
mergeBundles: () => mergeBundles,
|
|
36
35
|
setAutoAllocationStorage: () => setAutoAllocationStorage,
|
|
37
36
|
setProductPrice: () => setProductPrice
|
|
38
37
|
});
|
|
@@ -97,20 +96,6 @@ var getProductAllDiscountList = (cacheItem) => {
|
|
|
97
96
|
discountList.push(...bundleDiscountList);
|
|
98
97
|
return discountList;
|
|
99
98
|
};
|
|
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
|
-
};
|
|
114
99
|
var mergeBundleWithOriginalPrice = (other, originalOther) => {
|
|
115
100
|
var _a, _b;
|
|
116
101
|
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;
|
|
@@ -130,7 +115,6 @@ var mergeBundleWithOriginalPrice = (other, originalOther) => {
|
|
|
130
115
|
getAutoAllocationStorage,
|
|
131
116
|
getProductAllDiscountList,
|
|
132
117
|
mergeBundleWithOriginalPrice,
|
|
133
|
-
mergeBundles,
|
|
134
118
|
setAutoAllocationStorage,
|
|
135
119
|
setProductPrice
|
|
136
120
|
});
|
|
@@ -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
|
|
137
|
+
), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time).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
|
|
@@ -68,7 +68,8 @@ var validatePhoneNumber = async (value, getText) => {
|
|
|
68
68
|
}
|
|
69
69
|
break;
|
|
70
70
|
case "1":
|
|
71
|
-
|
|
71
|
+
const usCanadaReg = /^[2-9]\d{2}[2-9]\d{6}$/;
|
|
72
|
+
if (!usCanadaReg.test(phone)) {
|
|
72
73
|
throw new Error(getText("pisell-phone-validation-us-canada"));
|
|
73
74
|
}
|
|
74
75
|
break;
|
|
@@ -78,7 +79,8 @@ var validatePhoneNumber = async (value, getText) => {
|
|
|
78
79
|
}
|
|
79
80
|
break;
|
|
80
81
|
case "61":
|
|
81
|
-
|
|
82
|
+
const auReg = /^0?[2-578]\d{8}$/;
|
|
83
|
+
if (!auReg.test(phone)) {
|
|
82
84
|
throw new Error(getText("pisell-phone-validation-australia"));
|
|
83
85
|
}
|
|
84
86
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.56",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"styled-components": "^6.0.0-rc.3",
|
|
62
62
|
"@react-spring/web": "^9.6.1",
|
|
63
63
|
"@use-gesture/react": "^10.3.1",
|
|
64
|
-
"@pisell/utils": "3.0.2",
|
|
65
64
|
"@pisell/icon": "0.0.11",
|
|
66
|
-
"@pisell/
|
|
67
|
-
"@pisell/materials": "6.6.
|
|
65
|
+
"@pisell/utils": "3.0.2",
|
|
66
|
+
"@pisell/materials": "6.6.14",
|
|
67
|
+
"@pisell/date-picker": "3.0.7"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "^18.0.0",
|