@pisell/private-materials 6.6.36 → 6.6.38
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 +1 -10
- package/es/components/booking/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/index.js +34 -28
- 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 +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/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 +6 -2
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +23 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/booking/payments/model.d.ts +1 -10
- 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/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/amount.js +3 -3
- package/lib/components/booking/components/footer/index.js +5 -0
- 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 +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/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 +3 -0
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +26 -5
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -10
- 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/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
|
@@ -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;
|
|
@@ -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 {
|
|
@@ -870,7 +870,7 @@ var Footer = function Footer(props) {
|
|
|
870
870
|
var handleSave = /*#__PURE__*/function () {
|
|
871
871
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref6) {
|
|
872
872
|
var _state$bookingConfig6, _state$service$value2, _state$client3;
|
|
873
|
-
var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, isToastMode, isHasDayProducts, hasUnspecifiedHolderProduct, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window7, callbackData, values, checkout, subtotal_info, res, isNeedDeposit, api;
|
|
873
|
+
var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, isToastMode, isHasDayProducts, hasUnspecifiedHolderProduct, _setLoading, loadingTimer, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window7, callbackData, values, checkout, subtotal_info, res, isNeedDeposit, api;
|
|
874
874
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
875
875
|
while (1) switch (_context6.prev = _context6.next) {
|
|
876
876
|
case 0:
|
|
@@ -913,39 +913,43 @@ var Footer = function Footer(props) {
|
|
|
913
913
|
// 区分loading, 是点击的checkout 还是save
|
|
914
914
|
_setLoading = type === 'checkout' ? setCheckoutLoading : setLoading;
|
|
915
915
|
_setLoading(true);
|
|
916
|
+
// 超时保护: 超过20秒自动关闭loading
|
|
917
|
+
loadingTimer = setTimeout(function () {
|
|
918
|
+
_setLoading(false);
|
|
919
|
+
}, 20000);
|
|
916
920
|
_getApis = getApis(), createBooking = _getApis.createBooking, editBooking = _getApis.editBooking;
|
|
917
921
|
editApi = state.renderType === 'eventBooking' ? editEventBooking : editBooking;
|
|
918
922
|
createApi = state.renderType === 'eventBooking' ? createEventBooking : createBooking;
|
|
919
923
|
saveOtherValue = {};
|
|
920
924
|
if (!(type === 'save')) {
|
|
921
|
-
_context6.next =
|
|
925
|
+
_context6.next = 27;
|
|
922
926
|
break;
|
|
923
927
|
}
|
|
924
|
-
_context6.next =
|
|
928
|
+
_context6.next = 23;
|
|
925
929
|
return state === null || state === void 0 || (_state$onSave = state.onSave) === null || _state$onSave === void 0 ? void 0 : _state$onSave.call(state, state.client);
|
|
926
|
-
case
|
|
930
|
+
case 23:
|
|
927
931
|
_context6.t0 = _context6.sent;
|
|
928
932
|
if (_context6.t0) {
|
|
929
|
-
_context6.next =
|
|
933
|
+
_context6.next = 26;
|
|
930
934
|
break;
|
|
931
935
|
}
|
|
932
936
|
_context6.t0 = {};
|
|
933
|
-
case 25:
|
|
934
|
-
saveOtherValue = _context6.t0;
|
|
935
937
|
case 26:
|
|
936
|
-
|
|
938
|
+
saveOtherValue = _context6.t0;
|
|
939
|
+
case 27:
|
|
940
|
+
_context6.prev = 27;
|
|
937
941
|
callbackData = null; // 格式化提交的参数
|
|
938
942
|
values = formatValues(_objectSpread(_objectSpread({}, state), saveOtherValue)); // checkout 2.0 补充商品总税费字段
|
|
939
943
|
values.product_tax_fee = total.tax || 0;
|
|
940
944
|
if (!noSubmit) {
|
|
941
|
-
_context6.next =
|
|
945
|
+
_context6.next = 33;
|
|
942
946
|
break;
|
|
943
947
|
}
|
|
944
948
|
return _context6.abrupt("return", values);
|
|
945
|
-
case
|
|
949
|
+
case 33:
|
|
946
950
|
checkout = pisellos.getModule('checkout'); // 如果有 orderid,则应该走更新逻辑
|
|
947
951
|
if (!editOrderId) {
|
|
948
|
-
_context6.next =
|
|
952
|
+
_context6.next = 43;
|
|
949
953
|
break;
|
|
950
954
|
}
|
|
951
955
|
subtotal_info = {
|
|
@@ -954,7 +958,7 @@ var Footer = function Footer(props) {
|
|
|
954
958
|
total: cloneDeep(total),
|
|
955
959
|
showDetail: showDetail
|
|
956
960
|
};
|
|
957
|
-
_context6.next =
|
|
961
|
+
_context6.next = 38;
|
|
958
962
|
return checkout.updateLocalOrderAsync({
|
|
959
963
|
orderId: editOrderId,
|
|
960
964
|
orderData: values,
|
|
@@ -962,10 +966,10 @@ var Footer = function Footer(props) {
|
|
|
962
966
|
autoPayment: true,
|
|
963
967
|
totalInfo: subtotal_info
|
|
964
968
|
});
|
|
965
|
-
case
|
|
966
|
-
_context6.next =
|
|
969
|
+
case 38:
|
|
970
|
+
_context6.next = 40;
|
|
967
971
|
return checkout.manualSyncOrderAsync();
|
|
968
|
-
case
|
|
972
|
+
case 40:
|
|
969
973
|
res = _context6.sent;
|
|
970
974
|
if (res.success) {
|
|
971
975
|
// 回调关闭弹窗
|
|
@@ -973,7 +977,7 @@ var Footer = function Footer(props) {
|
|
|
973
977
|
_setLoading(false);
|
|
974
978
|
}
|
|
975
979
|
return _context6.abrupt("return");
|
|
976
|
-
case
|
|
980
|
+
case 43:
|
|
977
981
|
// 如果是保存,检查是否需要支付定金
|
|
978
982
|
if (type === 'save' && !state.bookingId) {
|
|
979
983
|
isNeedDeposit = checkout.checkIsNeedDepositAsync(values.bookings, values.relation_products);
|
|
@@ -1037,43 +1041,45 @@ var Footer = function Footer(props) {
|
|
|
1037
1041
|
|
|
1038
1042
|
// 如果有addons改动, 则先保存
|
|
1039
1043
|
if (!addonsEdit) {
|
|
1040
|
-
_context6.next =
|
|
1044
|
+
_context6.next = 49;
|
|
1041
1045
|
break;
|
|
1042
1046
|
}
|
|
1043
|
-
_context6.next =
|
|
1047
|
+
_context6.next = 49;
|
|
1044
1048
|
return handleSaveAddons();
|
|
1045
|
-
case
|
|
1049
|
+
case 49:
|
|
1046
1050
|
if (!infoEdit) {
|
|
1047
|
-
_context6.next =
|
|
1051
|
+
_context6.next = 54;
|
|
1048
1052
|
break;
|
|
1049
1053
|
}
|
|
1050
|
-
_context6.next =
|
|
1054
|
+
_context6.next = 52;
|
|
1051
1055
|
return api(values, state.bookingId || editOrderId);
|
|
1052
|
-
case
|
|
1056
|
+
case 52:
|
|
1053
1057
|
callbackData = _context6.sent;
|
|
1054
1058
|
if (messageShow) {
|
|
1055
1059
|
message.success(locales.getText(state.bookingId ? 'pisell2.text.appointment-updated' : 'pisell2.text.created-successfully'));
|
|
1056
1060
|
}
|
|
1057
|
-
case
|
|
1061
|
+
case 54:
|
|
1058
1062
|
// 回调关闭弹窗
|
|
1059
1063
|
state === null || state === void 0 || state.callback(callbackData, type);
|
|
1064
|
+
clearTimeout(loadingTimer);
|
|
1060
1065
|
_setLoading(false);
|
|
1061
1066
|
|
|
1062
1067
|
// return数据 checkout时需要
|
|
1063
1068
|
return _context6.abrupt("return", callbackData || values);
|
|
1064
|
-
case
|
|
1065
|
-
_context6.prev =
|
|
1066
|
-
_context6.t1 = _context6["catch"](
|
|
1069
|
+
case 60:
|
|
1070
|
+
_context6.prev = 60;
|
|
1071
|
+
_context6.t1 = _context6["catch"](27);
|
|
1067
1072
|
console.log(_context6.t1);
|
|
1068
1073
|
if ((_context6.t1 === null || _context6.t1 === void 0 ? void 0 : _context6.t1.code) === 70101) {
|
|
1069
1074
|
message.error(_context6.t1 === null || _context6.t1 === void 0 ? void 0 : _context6.t1.message);
|
|
1070
1075
|
}
|
|
1076
|
+
clearTimeout(loadingTimer);
|
|
1071
1077
|
_setLoading(false);
|
|
1072
|
-
case
|
|
1078
|
+
case 66:
|
|
1073
1079
|
case "end":
|
|
1074
1080
|
return _context6.stop();
|
|
1075
1081
|
}
|
|
1076
|
-
}, _callee6, null, [[
|
|
1082
|
+
}, _callee6, null, [[27, 60]]);
|
|
1077
1083
|
}));
|
|
1078
1084
|
return function handleSave(_x5) {
|
|
1079
1085
|
return _ref7.apply(this, arguments);
|
|
@@ -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
|
// 可选,附加费均摊舍入金额
|
|
@@ -482,7 +483,7 @@ export var getMainProductSellingPrice = function getMainProductSellingPrice(item
|
|
|
482
483
|
* @Author: WangHan
|
|
483
484
|
* @Date: 2024-12-07 14:21
|
|
484
485
|
*/
|
|
485
|
-
var formatProducts = function formatProducts(item, quantity) {
|
|
486
|
+
var formatProducts = function formatProducts(item, quantity, options) {
|
|
486
487
|
var _item$_extend34, _getMainProductSellin, _item$_extend35, _item$_extend36, _item$_extend37, _item$_extend38;
|
|
487
488
|
var total = Number(item._extend.total);
|
|
488
489
|
var origin_total = Number(item._extend.origin_total);
|
|
@@ -497,6 +498,9 @@ var formatProducts = function formatProducts(item, quantity) {
|
|
|
497
498
|
d.metadata = _objectSpread(_objectSpread({}, d.metadata), {}, {
|
|
498
499
|
unique_identification_number: "".concat(item._extend.unique_identification_number, "_").concat(d.discount.resource_id)
|
|
499
500
|
});
|
|
501
|
+
if (options !== null && options !== void 0 && options.isServiceEdit && options !== null && options !== void 0 && options.isMultiDay) {
|
|
502
|
+
delete d.id;
|
|
503
|
+
}
|
|
500
504
|
});
|
|
501
505
|
|
|
502
506
|
// 非手动折扣
|
|
@@ -719,7 +723,10 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
719
723
|
item._extend.unique_identification_number = unique_identification_number;
|
|
720
724
|
}
|
|
721
725
|
var booking = _objectSpread(_objectSpread({
|
|
722
|
-
product: formatProducts(item
|
|
726
|
+
product: formatProducts(item, undefined, {
|
|
727
|
+
isServiceEdit: data.service.edit,
|
|
728
|
+
isMultiDay: isMultiDay
|
|
729
|
+
}),
|
|
723
730
|
relation_products: formatRelationDetails(item._extend.relation_details),
|
|
724
731
|
id: item.booking_id || 0,
|
|
725
732
|
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,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;
|
|
@@ -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[];
|
|
@@ -41,7 +41,7 @@ import { editSessionProduct } from "../../../info/utils";
|
|
|
41
41
|
import { deleteCacheParams, getDays, 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, mergeBundles, 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";
|
|
@@ -655,7 +655,9 @@ var Info = function Info(_, ref) {
|
|
|
655
655
|
},
|
|
656
656
|
isOS: isSession,
|
|
657
657
|
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,
|
|
658
|
-
value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other),
|
|
658
|
+
value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other), {}, {
|
|
659
|
+
bundle: mergeBundles(item._extend.other)
|
|
660
|
+
}, sessionValue), {}, {
|
|
659
661
|
quantity: values.quantity || item._extend.quantity
|
|
660
662
|
})
|
|
661
663
|
},
|
|
@@ -1175,6 +1177,8 @@ var Info = function Info(_, ref) {
|
|
|
1175
1177
|
var _cacheItem$_extend$ot, _cacheItem$_extend$ot2;
|
|
1176
1178
|
delete cacheItem.discount_list;
|
|
1177
1179
|
(_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) {
|
|
1180
|
+
var _bundle$metadata;
|
|
1181
|
+
bundle === null || bundle === void 0 || (_bundle$metadata = bundle.metadata) === null || _bundle$metadata === void 0 || delete _bundle$metadata.custom_product_bundle_map_id;
|
|
1178
1182
|
bundle === null || bundle === void 0 || delete bundle.discount_list;
|
|
1179
1183
|
bundle === null || bundle === void 0 || delete bundle.booking_id;
|
|
1180
1184
|
bundle === null || bundle === void 0 || delete bundle.bundle_selling_price;
|
|
@@ -75,9 +75,15 @@ export var setAutoAllocationStorage = function setAutoAllocationStorage(data) {
|
|
|
75
75
|
* @param origin_total - 原始总价
|
|
76
76
|
*/
|
|
77
77
|
export var setProductPrice = function setProductPrice(cacheItem, _ref2) {
|
|
78
|
-
var _cacheItem$_extend$ot, _cacheItem$_extend$ot2, _cacheItem$_extend$ot4, _cacheItem$_extend$ot5;
|
|
78
|
+
var _cacheItem$discount_l, _cacheItem$_extend$ot, _cacheItem$_extend$ot2, _cacheItem$_extend$ot4, _cacheItem$_extend$ot5;
|
|
79
79
|
var newTotal = _ref2.newTotal,
|
|
80
80
|
origin_total = _ref2.origin_total;
|
|
81
|
+
if (cacheItem !== null && cacheItem !== void 0 && (_cacheItem$discount_l = cacheItem.discount_list) !== null && _cacheItem$discount_l !== void 0 && _cacheItem$discount_l.length && ((cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.discount_list) || []).some(function (item) {
|
|
82
|
+
return ['good_pass', 'discount_card', 'product_discount_card'].includes(item.type);
|
|
83
|
+
})) {
|
|
84
|
+
return cacheItem;
|
|
85
|
+
}
|
|
86
|
+
|
|
81
87
|
// 计算折扣比例
|
|
82
88
|
var discountRatio = new Decimal(newTotal).div(new Decimal(origin_total));
|
|
83
89
|
|
|
@@ -139,4 +145,20 @@ export var getProductAllDiscountList = function getProductAllDiscountList(cacheI
|
|
|
139
145
|
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) || []) || [];
|
|
140
146
|
(_discountList = discountList).push.apply(_discountList, _toConsumableArray(bundleDiscountList));
|
|
141
147
|
return discountList;
|
|
148
|
+
};
|
|
149
|
+
export var mergeBundles = function mergeBundles(other) {
|
|
150
|
+
var bundle = (other === null || other === void 0 ? void 0 : other.bundle) || [];
|
|
151
|
+
var newBundle = [];
|
|
152
|
+
bundle.forEach(function (item) {
|
|
153
|
+
var newItem = newBundle.find(function (newItem) {
|
|
154
|
+
return newItem.id === item.id;
|
|
155
|
+
});
|
|
156
|
+
if (newItem) {
|
|
157
|
+
newItem.num += item.num || 1;
|
|
158
|
+
newItem.quantity += item.quantity || 1;
|
|
159
|
+
} else {
|
|
160
|
+
newBundle.push(_objectSpread({}, item));
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
return newBundle;
|
|
142
164
|
};
|
|
@@ -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;
|
|
@@ -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,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;
|
|
@@ -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" | "print" | "page" | "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" | "print" | "page" | "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;
|
|
@@ -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;
|