@pisell/private-materials 3.0.159 → 3.0.161
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +2 -2
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.js +5 -5
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/footer/utils.js +4 -1
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/info/service/editService/index.js +14 -28
- package/es/components/booking/info2/utilsByBooking.js +34 -33
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +9 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/footer/utils.js +2 -1
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/info/service/editService/index.js +22 -33
- package/lib/components/booking/info2/utilsByBooking.js +13 -17
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/package.json +4 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -142,6 +142,9 @@ var formatBookings = function formatBookings(data) {
|
|
|
142
142
|
var total = Number(item._extend.total);
|
|
143
143
|
var origin_total = Number(item._extend.origin_total);
|
|
144
144
|
var discount_amount = origin_total - total;
|
|
145
|
+
|
|
146
|
+
// 加价时type使用change_price
|
|
147
|
+
var discount_type = discount_amount < 0 ? 'change_price' : 'discount';
|
|
145
148
|
return _objectSpread({
|
|
146
149
|
"product": {
|
|
147
150
|
"num": item._extend.quantity,
|
|
@@ -153,7 +156,7 @@ var formatBookings = function formatBookings(data) {
|
|
|
153
156
|
"note": "",
|
|
154
157
|
"discountway": item._extend.discountway || "num",
|
|
155
158
|
"discount_per": item._extend.discount_per,
|
|
156
|
-
"discount_type": item._extend.discount_type ||
|
|
159
|
+
"discount_type": item._extend.discount_type || discount_type,
|
|
157
160
|
"order_detail_id": item._extend.order_detail_id || 0,
|
|
158
161
|
"product_bundle": formatProductBundle((_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : (_item$_extend$other = _item$_extend.other) === null || _item$_extend$other === void 0 ? void 0 : _item$_extend$other.bundle),
|
|
159
162
|
"bundle_edit": item._extend.bundle_edit
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -34,9 +34,10 @@ import { getErrorList, getServiceTimes, deleteCacheParams, getProductTotalPrice
|
|
|
34
34
|
import Like from "../like";
|
|
35
35
|
import { getNoResource } from "../../../mock";
|
|
36
36
|
import { formatResources, getDurationProps, getFlexibleOption, getTimeObj } from "../addService/utils";
|
|
37
|
+
import { PisellAdjustPriceInputNumber, Page } from '@pisell/materials';
|
|
37
38
|
var submitLock = false;
|
|
38
39
|
var Info = function Info(_, ref) {
|
|
39
|
-
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _state$date, _state$date$value, _state$date$value$for, _window$BaseMaterials, _state$service$
|
|
40
|
+
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _state$date, _state$date$value, _state$date$value$for, _window$BaseMaterials, _state$service$cacheI19, _state$service7, _state$service7$cache, _state$service7$cache2, _state$service$cacheI20, _state$service$cacheI21, _state$bookingConfig9, _state$bookingConfig10, _state$bookingConfig11, _state$bookingConfig12;
|
|
40
41
|
var _Form$useForm = Form.useForm(),
|
|
41
42
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
42
43
|
form = _Form$useForm2[0];
|
|
@@ -661,7 +662,7 @@ var Info = function Info(_, ref) {
|
|
|
661
662
|
});
|
|
662
663
|
var SelectTime = (_window$BaseMaterials = window.BaseMaterials) === null || _window$BaseMaterials === void 0 ? void 0 : _window$BaseMaterials.SelectTime;
|
|
663
664
|
return useMemo(function () {
|
|
664
|
-
var _state$service$cacheI10, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI11, _state$service$cacheI12, _state$service$cacheI13, _state$service$cacheI14, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
|
|
665
|
+
var _state$service$cacheI10, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI11, _state$service$cacheI12, _state$service$cacheI13, _state$service$cacheI14, _state$service$cacheI15, _state$service$cacheI16, _state$service$cacheI17, _state$service$cacheI18, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
|
|
665
666
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer
|
|
666
667
|
//通过zIndex的方式控制 添加商品 和 编辑服务弹窗的上下层级
|
|
667
668
|
, {
|
|
@@ -682,7 +683,7 @@ var Info = function Info(_, ref) {
|
|
|
682
683
|
}
|
|
683
684
|
}, /*#__PURE__*/React.createElement("div", {
|
|
684
685
|
className: "pisell-lowcode__booking-service-body-edit"
|
|
685
|
-
}, /*#__PURE__*/React.createElement(Form, {
|
|
686
|
+
}, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(Form, {
|
|
686
687
|
layout: "vertical",
|
|
687
688
|
form: form,
|
|
688
689
|
onFinish: onFinish
|
|
@@ -714,39 +715,24 @@ var Info = function Info(_, ref) {
|
|
|
714
715
|
return renderBundles(item, state.amountSymbol);
|
|
715
716
|
}
|
|
716
717
|
})))), /*#__PURE__*/React.createElement(Col, {
|
|
717
|
-
span:
|
|
718
|
+
span: 24
|
|
718
719
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
719
720
|
label: locales.getText('pisell2.text.price'),
|
|
720
721
|
name: "total",
|
|
721
722
|
rules: [{
|
|
722
723
|
required: true
|
|
723
|
-
}]
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
prefix: state.amountSymbol,
|
|
727
|
-
size: "large",
|
|
728
|
-
precision: 2,
|
|
724
|
+
}],
|
|
725
|
+
extra: useTotal !== ((_state$service$cacheI11 = state.service.cacheItem) === null || _state$service$cacheI11 === void 0 ? void 0 : (_state$service$cacheI12 = _state$service$cacheI11._extend) === null || _state$service$cacheI12 === void 0 ? void 0 : _state$service$cacheI12.origin_total) && locales.getText('page.booking.text.price-extra')(formatAmount((_state$service$cacheI13 = state.service.cacheItem) === null || _state$service$cacheI13 === void 0 ? void 0 : (_state$service$cacheI14 = _state$service$cacheI13._extend) === null || _state$service$cacheI14 === void 0 ? void 0 : _state$service$cacheI14.origin_total, 2, state.amountSymbol), formatAmount(useTotal, 2, state.amountSymbol))
|
|
726
|
+
}, /*#__PURE__*/React.createElement(PisellAdjustPriceInputNumber, {
|
|
729
727
|
style: {
|
|
730
728
|
width: '100%'
|
|
731
729
|
},
|
|
732
730
|
min: 0,
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}))), /*#__PURE__*/React.createElement(Col, {
|
|
736
|
-
span: 12
|
|
737
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
738
|
-
label: locales.getText('pisell2.text.discount'),
|
|
739
|
-
name: "discount"
|
|
740
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
731
|
+
precision: 2,
|
|
732
|
+
prefix: state.amountSymbol,
|
|
741
733
|
disabled: state.channelDisabledEdit,
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
allowClear: isDiscount,
|
|
745
|
-
onChange: function onChange(e) {
|
|
746
|
-
form.setFieldsValue({
|
|
747
|
-
total: state.service.cacheItem._extend.origin_total
|
|
748
|
-
});
|
|
749
|
-
}
|
|
734
|
+
originValue: ((_state$service$cacheI15 = state.service.cacheItem) === null || _state$service$cacheI15 === void 0 ? void 0 : (_state$service$cacheI16 = _state$service$cacheI15._extend) === null || _state$service$cacheI16 === void 0 ? void 0 : _state$service$cacheI16.origin_total) || 0,
|
|
735
|
+
placeholder: ((_state$service$cacheI17 = state.service.cacheItem) === null || _state$service$cacheI17 === void 0 ? void 0 : (_state$service$cacheI18 = _state$service$cacheI17._extend) === null || _state$service$cacheI18 === void 0 ? void 0 : _state$service$cacheI18.origin_total) || '0'
|
|
750
736
|
}))), isReason ? /*#__PURE__*/React.createElement(Col, {
|
|
751
737
|
span: 24
|
|
752
738
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -824,7 +810,7 @@ var Info = function Info(_, ref) {
|
|
|
824
810
|
}, /*#__PURE__*/React.createElement(InputNumber, null)), /*#__PURE__*/React.createElement(Form.Item, {
|
|
825
811
|
hidden: true,
|
|
826
812
|
name: "like_status"
|
|
827
|
-
}, /*#__PURE__*/React.createElement(Input, null))))), state.renderType !== 'eventBooking' && errorList.map(function (d, i) {
|
|
813
|
+
}, /*#__PURE__*/React.createElement(Input, null)))))), state.renderType !== 'eventBooking' && errorList.map(function (d, i) {
|
|
828
814
|
return /*#__PURE__*/React.createElement(Alert, {
|
|
829
815
|
key: d.type,
|
|
830
816
|
message: d.label,
|
|
@@ -849,6 +835,6 @@ var Info = function Info(_, ref) {
|
|
|
849
835
|
form.submit();
|
|
850
836
|
}
|
|
851
837
|
}, locales.getText('pisell2.text.apply'))))));
|
|
852
|
-
}, [state.service.changeService, state.service.editModal, (_state$service$
|
|
838
|
+
}, [state.service.changeService, state.service.editModal, (_state$service$cacheI19 = state.service.cacheItem) === null || _state$service$cacheI19 === void 0 ? void 0 : _state$service$cacheI19.autoClose, locales, (_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : (_state$service7$cache2 = _state$service7$cache._extend) === null || _state$service7$cache2 === void 0 ? void 0 : _state$service7$cache2.product_name, bundles, state.amountSymbol, state.channelDisabledEdit, (_state$service$cacheI20 = state.service.cacheItem) === null || _state$service$cacheI20 === void 0 ? void 0 : (_state$service$cacheI21 = _state$service$cacheI20._extend) === null || _state$service$cacheI21 === void 0 ? void 0 : _state$service$cacheI21.origin_total, isDiscount, isReason, state.renderType, (_state$bookingConfig9 = state.bookingConfig) === null || _state$bookingConfig9 === void 0 ? void 0 : (_state$bookingConfig10 = _state$bookingConfig9.config) === null || _state$bookingConfig10 === void 0 ? void 0 : (_state$bookingConfig11 = _state$bookingConfig10.basic) === null || _state$bookingConfig11 === void 0 ? void 0 : (_state$bookingConfig12 = _state$bookingConfig11.service_time) === null || _state$bookingConfig12 === void 0 ? void 0 : _state$bookingConfig12.value, SelectTime, durationProps, timeObj, useResource, useLikeStatus, resourceLoading, selectOpen, state.service.resources, errorList, useTotal]);
|
|
853
839
|
};
|
|
854
840
|
export default /*#__PURE__*/forwardRef(Info);
|
|
@@ -95,45 +95,46 @@ export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cach
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
// 如果 预约人数超过总容量, 则不可用
|
|
98
|
-
if (totalCount < currentCount) {
|
|
99
|
-
|
|
100
|
-
} else {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
98
|
+
// if (totalCount < currentCount) {
|
|
99
|
+
// isCountRange = false;
|
|
100
|
+
// } else {
|
|
101
|
+
/**
|
|
102
|
+
* 从这里判断预约量
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
// 取出已预约列表和当前预约重叠的时间段
|
|
106
|
+
var conflict = (time.event_list || []).filter(function (d) {
|
|
107
|
+
return isConflict({
|
|
108
|
+
start_at: d.start_at,
|
|
109
|
+
end_at: d.end_at
|
|
110
|
+
}, {
|
|
111
|
+
start_at: startDate,
|
|
112
|
+
end_at: endDate
|
|
114
113
|
});
|
|
114
|
+
});
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
} else {
|
|
122
|
-
isCountRange = false;
|
|
123
|
-
}
|
|
116
|
+
// 同一时间段内只能进行一个预约,无论容量是否已满。
|
|
117
|
+
if (resourceItem.resourceType === 'single') {
|
|
118
|
+
// 0代表着不重叠,则满足条件
|
|
119
|
+
if (conflict.length === 0) {
|
|
120
|
+
isCountRange = true;
|
|
124
121
|
} else {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
isCountRange = false;
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
// 减去重叠的总量
|
|
126
|
+
var conflictCount = getUseableEventCount(conflict, resourceItem.capacity);
|
|
127
|
+
|
|
128
|
+
// 当前预约量 <= 总剩余容量
|
|
129
|
+
if (currentCount <= conflictCount) {
|
|
130
|
+
isCountRange = true;
|
|
131
|
+
} else {
|
|
132
|
+
isCountRange = false;
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
|
|
136
|
+
// }
|
|
137
|
+
|
|
137
138
|
// 是否可用 只判断是否在日期范围内,
|
|
138
139
|
var isUsable = isDateRange && isCountRange;
|
|
139
140
|
|
|
@@ -195,6 +195,7 @@ declare const _default: {
|
|
|
195
195
|
'page.booking.text.please-choose-an-option-1': string;
|
|
196
196
|
'page.booking.text.please-choose-an-option-2': string;
|
|
197
197
|
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
198
|
+
'page.booking.text.price-extra': (origin: string, current: string) => string;
|
|
198
199
|
};
|
|
199
200
|
'zh-CN': {
|
|
200
201
|
'pisell2.text.refunded-amount': string;
|
|
@@ -392,6 +393,7 @@ declare const _default: {
|
|
|
392
393
|
'page.booking.text.please-choose-an-option-1': string;
|
|
393
394
|
'page.booking.text.please-choose-an-option-2': string;
|
|
394
395
|
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
396
|
+
'page.booking.text.price-extra': (origin: string, current: string) => string;
|
|
395
397
|
};
|
|
396
398
|
'zh-HK': {
|
|
397
399
|
'pisell2.text.refunded-amount': string;
|
|
@@ -589,6 +591,7 @@ declare const _default: {
|
|
|
589
591
|
'page.booking.text.please-choose-an-option-1': string;
|
|
590
592
|
'page.booking.text.please-choose-an-option-2': string;
|
|
591
593
|
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
594
|
+
'page.booking.text.price-extra': (origin: string, current: string) => string;
|
|
592
595
|
};
|
|
593
596
|
};
|
|
594
597
|
export default _default;
|
|
@@ -225,6 +225,9 @@ export default {
|
|
|
225
225
|
'page.booking.text.please-choose-an-option-2': "Cancel only: Cancel the appointment without processing a refund. (You can still process a refund after cancellation if needed)",
|
|
226
226
|
'page.booking.text.resource.min-length-error': function pageBookingTextResourceMinLengthError(x, y) {
|
|
227
227
|
return "Select at least ".concat(x, " ").concat(y);
|
|
228
|
+
},
|
|
229
|
+
'page.booking.text.price-extra': function pageBookingTextPriceExtra(origin, current) {
|
|
230
|
+
return "Original price of the item:".concat(origin, ",Current price of the item:").concat(current);
|
|
228
231
|
}
|
|
229
232
|
},
|
|
230
233
|
'zh-CN': {
|
|
@@ -457,6 +460,9 @@ export default {
|
|
|
457
460
|
'page.booking.text.please-choose-an-option-2': "仅取消:仅取消预约,但不进行退款处理。(您仍然可以在取消后再进行退款操作)",
|
|
458
461
|
'page.booking.text.resource.min-length-error': function pageBookingTextResourceMinLengthError(x, y) {
|
|
459
462
|
return "\u81F3\u5C11\u9009\u62E9".concat(x, "\u9879").concat(y);
|
|
463
|
+
},
|
|
464
|
+
'page.booking.text.price-extra': function pageBookingTextPriceExtra(origin, current) {
|
|
465
|
+
return "\u5546\u54C1\u539F\u4EF7:".concat(origin, ",\u5546\u54C1\u73B0\u4EF7:").concat(current);
|
|
460
466
|
}
|
|
461
467
|
},
|
|
462
468
|
'zh-HK': {
|
|
@@ -689,6 +695,9 @@ export default {
|
|
|
689
695
|
'page.booking.text.please-choose-an-option-2': '僅取消:僅取消預約,但不進行退款處理。(您仍然可以在取消後再進行退款操作)',
|
|
690
696
|
'page.booking.text.resource.min-length-error': function pageBookingTextResourceMinLengthError(x, y) {
|
|
691
697
|
return "\u81F3\u5C11\u9078\u64C7".concat(x, "\u9805").concat(y);
|
|
698
|
+
},
|
|
699
|
+
'page.booking.text.price-extra': function pageBookingTextPriceExtra(origin, current) {
|
|
700
|
+
return "\u5546\u54C1\u539F\u50F9:".concat(origin, ",\u5546\u54C1\u73FE\u50F9:").concat(current);
|
|
692
701
|
}
|
|
693
702
|
}
|
|
694
703
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -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,7 +69,7 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
72
73
|
state: FormState;
|
|
73
74
|
} & {
|
|
74
75
|
dispatch: (params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -129,6 +129,7 @@ var formatBookings = (data) => {
|
|
|
129
129
|
const total = Number(item._extend.total);
|
|
130
130
|
const origin_total = Number(item._extend.origin_total);
|
|
131
131
|
const discount_amount = origin_total - total;
|
|
132
|
+
const discount_type = discount_amount < 0 ? "change_price" : "discount";
|
|
132
133
|
return {
|
|
133
134
|
"product": {
|
|
134
135
|
"num": item._extend.quantity,
|
|
@@ -140,7 +141,7 @@ var formatBookings = (data) => {
|
|
|
140
141
|
"note": "",
|
|
141
142
|
"discountway": item._extend.discountway || "num",
|
|
142
143
|
"discount_per": item._extend.discount_per,
|
|
143
|
-
"discount_type": item._extend.discount_type ||
|
|
144
|
+
"discount_type": item._extend.discount_type || discount_type,
|
|
144
145
|
"order_detail_id": item._extend.order_detail_id || 0,
|
|
145
146
|
"product_bundle": formatProductBundle((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle),
|
|
146
147
|
"bundle_edit": item._extend.bundle_edit
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -47,6 +47,7 @@ var import_utils3 = require("../../../utils");
|
|
|
47
47
|
var import_like = __toESM(require("../like"));
|
|
48
48
|
var import_mock = require("../../../mock");
|
|
49
49
|
var import_utils4 = require("../addService/utils");
|
|
50
|
+
var import_materials = require("@pisell/materials");
|
|
50
51
|
var submitLock = false;
|
|
51
52
|
var Info = (_, ref) => {
|
|
52
53
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
|
|
@@ -414,7 +415,7 @@ var Info = (_, ref) => {
|
|
|
414
415
|
});
|
|
415
416
|
const SelectTime = (_r = window.BaseMaterials) == null ? void 0 : _r.SelectTime;
|
|
416
417
|
return (0, import_react.useMemo)(() => {
|
|
417
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;
|
|
418
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2;
|
|
418
419
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
419
420
|
import_drawer.default,
|
|
420
421
|
{
|
|
@@ -434,51 +435,38 @@ var Info = (_, ref) => {
|
|
|
434
435
|
});
|
|
435
436
|
}
|
|
436
437
|
},
|
|
437
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_d2 = (_c2 = (_b2 = state.service) == null ? void 0 : _b2.cacheItem) == null ? void 0 : _c2._extend) == null ? void 0 : _d2.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
|
|
438
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Page, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_d2 = (_c2 = (_b2 = state.service) == null ? void 0 : _b2.cacheItem) == null ? void 0 : _c2._extend) == null ? void 0 : _d2.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
|
|
438
439
|
import_collapsibleList.default,
|
|
439
440
|
{
|
|
440
441
|
style: { marginTop: bundles.length ? "8px" : 0 },
|
|
441
442
|
list: bundles,
|
|
442
443
|
renderItem: (item) => (0, import_utils2.renderBundles)(item, state.amountSymbol)
|
|
443
444
|
}
|
|
444
|
-
)))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span:
|
|
445
|
+
)))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
445
446
|
import_antd.Form.Item,
|
|
446
447
|
{
|
|
447
448
|
label: import_utils.locales.getText("pisell2.text.price"),
|
|
448
449
|
name: "total",
|
|
449
|
-
rules: [{ required: true }]
|
|
450
|
+
rules: [{ required: true }],
|
|
451
|
+
extra: useTotal !== ((_f2 = (_e2 = state.service.cacheItem) == null ? void 0 : _e2._extend) == null ? void 0 : _f2.origin_total) && import_utils.locales.getText("page.booking.text.price-extra")(
|
|
452
|
+
(0, import_utils.formatAmount)(
|
|
453
|
+
(_h2 = (_g2 = state.service.cacheItem) == null ? void 0 : _g2._extend) == null ? void 0 : _h2.origin_total,
|
|
454
|
+
2,
|
|
455
|
+
state.amountSymbol
|
|
456
|
+
),
|
|
457
|
+
(0, import_utils.formatAmount)(useTotal, 2, state.amountSymbol)
|
|
458
|
+
)
|
|
450
459
|
},
|
|
451
460
|
/* @__PURE__ */ import_react.default.createElement(
|
|
452
|
-
|
|
461
|
+
import_materials.PisellAdjustPriceInputNumber,
|
|
453
462
|
{
|
|
454
|
-
disabled: state.channelDisabledEdit,
|
|
455
|
-
prefix: state.amountSymbol,
|
|
456
|
-
size: "large",
|
|
457
|
-
precision: 2,
|
|
458
463
|
style: { width: "100%" },
|
|
459
464
|
min: 0,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
)
|
|
464
|
-
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
465
|
-
import_antd.Form.Item,
|
|
466
|
-
{
|
|
467
|
-
label: import_utils.locales.getText("pisell2.text.discount"),
|
|
468
|
-
name: "discount"
|
|
469
|
-
},
|
|
470
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
471
|
-
import_antd.Select,
|
|
472
|
-
{
|
|
465
|
+
precision: 2,
|
|
466
|
+
prefix: state.amountSymbol,
|
|
473
467
|
disabled: state.channelDisabledEdit,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
allowClear: isDiscount,
|
|
477
|
-
onChange: (e) => {
|
|
478
|
-
form.setFieldsValue({
|
|
479
|
-
total: state.service.cacheItem._extend.origin_total
|
|
480
|
-
});
|
|
481
|
-
}
|
|
468
|
+
originValue: ((_j2 = (_i2 = state.service.cacheItem) == null ? void 0 : _i2._extend) == null ? void 0 : _j2.origin_total) || 0,
|
|
469
|
+
placeholder: ((_l2 = (_k2 = state.service.cacheItem) == null ? void 0 : _k2._extend) == null ? void 0 : _l2.origin_total) || "0"
|
|
482
470
|
}
|
|
483
471
|
)
|
|
484
472
|
)), isReason ? /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -498,7 +486,7 @@ var Info = (_, ref) => {
|
|
|
498
486
|
SelectTime ? /* @__PURE__ */ import_react.default.createElement(
|
|
499
487
|
SelectTime,
|
|
500
488
|
{
|
|
501
|
-
slice: (
|
|
489
|
+
slice: (_p2 = (_o2 = (_n2 = (_m2 = state.bookingConfig) == null ? void 0 : _m2.config) == null ? void 0 : _n2.basic) == null ? void 0 : _o2.service_time) == null ? void 0 : _p2.value,
|
|
502
490
|
timePickerProps: {
|
|
503
491
|
style: { width: "100%" }
|
|
504
492
|
},
|
|
@@ -566,7 +554,7 @@ var Info = (_, ref) => {
|
|
|
566
554
|
)
|
|
567
555
|
)
|
|
568
556
|
))
|
|
569
|
-
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "like_status" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input, null))))), state.renderType !== "eventBooking" && errorList.map((d, i) => {
|
|
557
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null)), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "like_status" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input, null)))))), state.renderType !== "eventBooking" && errorList.map((d, i) => {
|
|
570
558
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
571
559
|
import_antd.Alert,
|
|
572
560
|
{
|
|
@@ -619,7 +607,8 @@ var Info = (_, ref) => {
|
|
|
619
607
|
resourceLoading,
|
|
620
608
|
selectOpen,
|
|
621
609
|
state.service.resources,
|
|
622
|
-
errorList
|
|
610
|
+
errorList,
|
|
611
|
+
useTotal
|
|
623
612
|
]);
|
|
624
613
|
};
|
|
625
614
|
var editService_default = (0, import_react.forwardRef)(Info);
|
|
@@ -85,25 +85,21 @@ var getResourceTimeIsUsable = (item, cacheItem, resourceItem) => {
|
|
|
85
85
|
isDateRange = true;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
let conflict = (time.event_list || []).filter((d) => {
|
|
89
|
+
return isConflict({ start_at: d.start_at, end_at: d.end_at }, { start_at: startDate, end_at: endDate });
|
|
90
|
+
});
|
|
91
|
+
if (resourceItem.resourceType === "single") {
|
|
92
|
+
if (conflict.length === 0) {
|
|
93
|
+
isCountRange = true;
|
|
94
|
+
} else {
|
|
95
|
+
isCountRange = false;
|
|
96
|
+
}
|
|
90
97
|
} else {
|
|
91
|
-
let
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (resourceItem.resourceType === "single") {
|
|
95
|
-
if (conflict.length === 0) {
|
|
96
|
-
isCountRange = true;
|
|
97
|
-
} else {
|
|
98
|
-
isCountRange = false;
|
|
99
|
-
}
|
|
98
|
+
let conflictCount = getUseableEventCount(conflict, resourceItem.capacity);
|
|
99
|
+
if (currentCount <= conflictCount) {
|
|
100
|
+
isCountRange = true;
|
|
100
101
|
} else {
|
|
101
|
-
|
|
102
|
-
if (currentCount <= conflictCount) {
|
|
103
|
-
isCountRange = true;
|
|
104
|
-
} else {
|
|
105
|
-
isCountRange = false;
|
|
106
|
-
}
|
|
102
|
+
isCountRange = false;
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
105
|
const isUsable = isDateRange && isCountRange;
|
|
@@ -195,6 +195,7 @@ declare const _default: {
|
|
|
195
195
|
'page.booking.text.please-choose-an-option-1': string;
|
|
196
196
|
'page.booking.text.please-choose-an-option-2': string;
|
|
197
197
|
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
198
|
+
'page.booking.text.price-extra': (origin: string, current: string) => string;
|
|
198
199
|
};
|
|
199
200
|
'zh-CN': {
|
|
200
201
|
'pisell2.text.refunded-amount': string;
|
|
@@ -392,6 +393,7 @@ declare const _default: {
|
|
|
392
393
|
'page.booking.text.please-choose-an-option-1': string;
|
|
393
394
|
'page.booking.text.please-choose-an-option-2': string;
|
|
394
395
|
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
396
|
+
'page.booking.text.price-extra': (origin: string, current: string) => string;
|
|
395
397
|
};
|
|
396
398
|
'zh-HK': {
|
|
397
399
|
'pisell2.text.refunded-amount': string;
|
|
@@ -589,6 +591,7 @@ declare const _default: {
|
|
|
589
591
|
'page.booking.text.please-choose-an-option-1': string;
|
|
590
592
|
'page.booking.text.please-choose-an-option-2': string;
|
|
591
593
|
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
594
|
+
'page.booking.text.price-extra': (origin: string, current: string) => string;
|
|
592
595
|
};
|
|
593
596
|
};
|
|
594
597
|
export default _default;
|
|
@@ -250,7 +250,8 @@ var locales_default = {
|
|
|
250
250
|
"page.booking.text.please-choose-an-option": "Please choose an option:",
|
|
251
251
|
"page.booking.text.please-choose-an-option-1": "Refund: Cancel the appointment and process a refund.",
|
|
252
252
|
"page.booking.text.please-choose-an-option-2": "Cancel only: Cancel the appointment without processing a refund. (You can still process a refund after cancellation if needed)",
|
|
253
|
-
"page.booking.text.resource.min-length-error": (x, y) => `Select at least ${x} ${y}
|
|
253
|
+
"page.booking.text.resource.min-length-error": (x, y) => `Select at least ${x} ${y}`,
|
|
254
|
+
"page.booking.text.price-extra": (origin, current) => `Original price of the item:${origin},Current price of the item:${current}`
|
|
254
255
|
},
|
|
255
256
|
"zh-CN": {
|
|
256
257
|
"pisell2.text.refunded-amount": "已退金额",
|
|
@@ -473,7 +474,8 @@ var locales_default = {
|
|
|
473
474
|
"page.booking.text.please-choose-an-option": "请选择:",
|
|
474
475
|
"page.booking.text.please-choose-an-option-1": "退款:取消预约,同时处理退款。",
|
|
475
476
|
"page.booking.text.please-choose-an-option-2": "仅取消:仅取消预约,但不进行退款处理。(您仍然可以在取消后再进行退款操作)",
|
|
476
|
-
"page.booking.text.resource.min-length-error": (x, y) => `至少选择${x}项${y}
|
|
477
|
+
"page.booking.text.resource.min-length-error": (x, y) => `至少选择${x}项${y}`,
|
|
478
|
+
"page.booking.text.price-extra": (origin, current) => `商品原价:${origin},商品现价:${current}`
|
|
477
479
|
},
|
|
478
480
|
"zh-HK": {
|
|
479
481
|
"pisell2.text.refunded-amount": "已退金額",
|
|
@@ -696,6 +698,7 @@ var locales_default = {
|
|
|
696
698
|
"page.booking.text.please-choose-an-option": "請選擇:",
|
|
697
699
|
"page.booking.text.please-choose-an-option-1": "退款:取消預約,同時處理退款。",
|
|
698
700
|
"page.booking.text.please-choose-an-option-2": "僅取消:僅取消預約,但不進行退款處理。(您仍然可以在取消後再進行退款操作)",
|
|
699
|
-
"page.booking.text.resource.min-length-error": (x, y) => `至少選擇${x}項${y}
|
|
701
|
+
"page.booking.text.resource.min-length-error": (x, y) => `至少選擇${x}項${y}`,
|
|
702
|
+
"page.booking.text.price-extra": (origin, current) => `商品原價:${origin},商品現價:${current}`
|
|
700
703
|
}
|
|
701
704
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -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,7 +69,7 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
72
73
|
state: FormState;
|
|
73
74
|
} & {
|
|
74
75
|
dispatch: (params: {
|