@pisell/private-materials 3.0.211 → 3.0.213
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 +5 -5
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/Sales/Cart/index.js +3 -1
- package/es/components/Sales/Checkout/index.js +6 -0
- package/es/components/Sales/Event/Detail.js +1 -1
- package/es/components/Sales/Init/index.d.ts +4 -0
- package/es/components/Sales/Init/index.js +6 -2
- package/es/components/Sales/Resource/serve.d.ts +1 -0
- package/es/components/Sales/Summary/index.d.ts +3 -0
- package/es/components/Sales/Summary/index.js +9 -3
- package/es/components/Sales/Summary/serve.d.ts +0 -2
- package/es/components/Sales/Summary/serve.js +0 -11
- package/es/components/Sales/Summary/utils.d.ts +15 -1
- package/es/components/Sales/Summary/utils.js +32 -3
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +6 -2
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +46 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -8
- package/es/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
- package/es/components/eventBooking/components/Provider/Cart/index.js +1 -5
- package/es/components/eventBooking/components/Provider/Cart/index.less +0 -2
- package/es/components/eventBooking/components/Provider/Content/index.js +24 -0
- package/es/components/eventBooking/components/Provider/Content/index.less +3 -2
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.js +1 -2
- package/es/components/eventBooking/components/Provider/Event/index.less +1 -1
- package/es/components/eventBooking/components/Provider/Footer/index.js +18 -11
- package/es/components/eventBooking/components/Provider/Footer/index.less +29 -5
- package/es/components/eventBooking/components/Provider/Header/index.js +4 -2
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.js +1 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.js +0 -1
- package/es/components/eventBooking/components/Provider/Resource/index.js +4 -21
- package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.js +77 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.js +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/index.js +142 -41
- package/es/components/eventBooking/components/bookingDetailModal/index.less +2 -2
- package/es/components/eventBooking/components/resourceDisplay/index.less +14 -0
- package/es/components/eventBooking/components/selectHolder/index.js +2 -6
- package/es/components/eventBooking/index.js +2 -1
- package/es/components/eventBooking/index.less +2 -0
- package/es/components/eventBooking/locales.d.ts +6 -3
- package/es/components/eventBooking/locales.js +22 -7
- package/es/components/eventBooking/utils.d.ts +9 -0
- package/es/components/eventBooking/utils.js +17 -0
- package/es/components/tabProduct/tabs/index.less +13 -3
- package/lib/components/Sales/Cart/index.js +6 -4
- package/lib/components/Sales/Checkout/index.js +3 -0
- package/lib/components/Sales/Event/Detail.js +1 -1
- package/lib/components/Sales/Init/index.d.ts +4 -0
- package/lib/components/Sales/Init/index.js +5 -2
- package/lib/components/Sales/Resource/serve.d.ts +1 -0
- package/lib/components/Sales/Summary/index.d.ts +3 -0
- package/lib/components/Sales/Summary/index.js +11 -3
- package/lib/components/Sales/Summary/serve.d.ts +0 -2
- package/lib/components/Sales/Summary/serve.js +0 -37
- package/lib/components/Sales/Summary/utils.d.ts +15 -1
- package/lib/components/Sales/Summary/utils.js +25 -5
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +5 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +82 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -9
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
- package/lib/components/eventBooking/components/Provider/Cart/index.js +1 -5
- package/lib/components/eventBooking/components/Provider/Cart/index.less +0 -2
- package/lib/components/eventBooking/components/Provider/Content/index.js +16 -0
- package/lib/components/eventBooking/components/Provider/Content/index.less +3 -2
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.js +1 -2
- package/lib/components/eventBooking/components/Provider/Event/index.less +1 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.js +14 -12
- package/lib/components/eventBooking/components/Provider/Footer/index.less +29 -5
- package/lib/components/eventBooking/components/Provider/Header/index.js +5 -2
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.js +1 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.js +0 -1
- package/lib/components/eventBooking/components/Provider/Resource/index.js +4 -12
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +69 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.js +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +101 -22
- package/lib/components/eventBooking/components/bookingDetailModal/index.less +2 -2
- package/lib/components/eventBooking/components/resourceDisplay/index.less +14 -0
- package/lib/components/eventBooking/components/selectHolder/index.js +1 -1
- package/lib/components/eventBooking/index.js +2 -1
- package/lib/components/eventBooking/index.less +2 -0
- package/lib/components/eventBooking/locales.d.ts +6 -3
- package/lib/components/eventBooking/locales.js +10 -7
- package/lib/components/eventBooking/utils.d.ts +9 -0
- package/lib/components/eventBooking/utils.js +12 -2
- package/lib/components/tabProduct/tabs/index.less +13 -3
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
.booking-detail-modal-content {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
height:
|
|
5
|
+
height: 100%;
|
|
6
6
|
overflow-y: auto;
|
|
7
7
|
overflow-x: hidden;
|
|
8
8
|
scroll-behavior: smooth;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
top: 0;
|
|
13
13
|
z-index: 10;
|
|
14
14
|
background: #fff;
|
|
15
|
-
padding: 0 !important;
|
|
15
|
+
padding: 0 16px !important;
|
|
16
16
|
// padding: 16px;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -78,4 +78,18 @@
|
|
|
78
78
|
line-height: 10px;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
&-empty-avatar {
|
|
83
|
+
.pisell-lowcode-avatar-string {
|
|
84
|
+
position: relative;
|
|
85
|
+
left: 0;
|
|
86
|
+
height: 32px;
|
|
87
|
+
line-height: 32px;
|
|
88
|
+
transform: scale(1) !important;
|
|
89
|
+
.pisell-lowcode-image {
|
|
90
|
+
width: 32px;
|
|
91
|
+
height: 32px;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
81
95
|
}
|
|
@@ -82,11 +82,7 @@ var PisellSelectHolder = function PisellSelectHolder(_ref) {
|
|
|
82
82
|
title: isMobile() ? '' : title,
|
|
83
83
|
platform: isMobile() ? 'h5' : 'pc',
|
|
84
84
|
okText: okText,
|
|
85
|
-
cancelVisible: false
|
|
86
|
-
// okButtonProps={{
|
|
87
|
-
// disabled: disabled,
|
|
88
|
-
// }}
|
|
89
|
-
,
|
|
85
|
+
cancelVisible: false,
|
|
90
86
|
closable: showCancel,
|
|
91
87
|
onCancel: onCancel,
|
|
92
88
|
onOk: function onOk(e) {
|
|
@@ -98,7 +94,7 @@ var PisellSelectHolder = function PisellSelectHolder(_ref) {
|
|
|
98
94
|
bodyStyle: {
|
|
99
95
|
padding: isMobile() ? '0 16px 16px' : 20
|
|
100
96
|
},
|
|
101
|
-
mobileModalHeight: '
|
|
97
|
+
mobileModalHeight: 'auto',
|
|
102
98
|
destroyOnClose: true,
|
|
103
99
|
className: "select-holder-modal ".concat(isMobile() ? 'select-holder-modal-mobile' : ''),
|
|
104
100
|
headerDivider: false
|
|
@@ -40,7 +40,8 @@ var Content = function Content() {
|
|
|
40
40
|
if (!form_id) return;
|
|
41
41
|
getResourceList.run({
|
|
42
42
|
form_id: form_id,
|
|
43
|
-
shop_id: shop_id
|
|
43
|
+
shop_id: shop_id,
|
|
44
|
+
form_data_status: 'active'
|
|
44
45
|
});
|
|
45
46
|
}, [form_id]);
|
|
46
47
|
return getResourceList.data ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -13,11 +13,12 @@ declare const _default: {
|
|
|
13
13
|
'pisell2.event.close.continue': string;
|
|
14
14
|
'pisell2.event.close.exit': string;
|
|
15
15
|
'pisell2.event.step': (step: number) => string;
|
|
16
|
-
'pisell2.event.select.category': string;
|
|
16
|
+
'pisell2.event.select.category': (val: string) => string;
|
|
17
17
|
'pisell2.event.select.campus': (val: string) => string;
|
|
18
18
|
'pisell2.event.select.event': string;
|
|
19
19
|
'pisell2.event.cart': string;
|
|
20
20
|
'pisell2.event.total': string;
|
|
21
|
+
'pisell2.event.total.gst': (val: string, amount: any) => string;
|
|
21
22
|
'pisell2.event.continue': string;
|
|
22
23
|
'pisell2.event.details': string;
|
|
23
24
|
'pisell2.event.introduction': string;
|
|
@@ -83,11 +84,12 @@ declare const _default: {
|
|
|
83
84
|
'pisell2.event.close.continue': string;
|
|
84
85
|
'pisell2.event.close.exit': string;
|
|
85
86
|
'pisell2.event.step': (step: number) => string;
|
|
86
|
-
'pisell2.event.select.category': string;
|
|
87
|
+
'pisell2.event.select.category': (val: string) => string;
|
|
87
88
|
'pisell2.event.select.event': string;
|
|
88
89
|
'pisell2.event.select.campus': (val: string) => string;
|
|
89
90
|
'pisell2.event.cart': string;
|
|
90
91
|
'pisell2.event.total': string;
|
|
92
|
+
'pisell2.event.total.gst': (val: string, amount: any) => string;
|
|
91
93
|
'pisell2.event.continue': string;
|
|
92
94
|
'pisell2.event.details': string;
|
|
93
95
|
'pisell2.event.introduction': string;
|
|
@@ -153,11 +155,12 @@ declare const _default: {
|
|
|
153
155
|
'pisell2.event.close.continue': string;
|
|
154
156
|
'pisell2.event.close.exit': string;
|
|
155
157
|
'pisell2.event.step': (step: number) => string;
|
|
156
|
-
'pisell2.event.select.category': string;
|
|
158
|
+
'pisell2.event.select.category': (val: string) => string;
|
|
157
159
|
'pisell2.event.select.event': string;
|
|
158
160
|
'pisell2.event.select.campus': (val: string) => string;
|
|
159
161
|
'pisell2.event.cart': string;
|
|
160
162
|
'pisell2.event.total': string;
|
|
163
|
+
'pisell2.event.total.gst': (val: string, amount: any) => string;
|
|
161
164
|
'pisell2.event.continue': string;
|
|
162
165
|
'pisell2.event.details': string;
|
|
163
166
|
'pisell2.event.introduction': string;
|
|
@@ -15,13 +15,18 @@ export default {
|
|
|
15
15
|
'pisell2.event.step': function pisell2EventStep(step) {
|
|
16
16
|
return "Step ".concat(step);
|
|
17
17
|
},
|
|
18
|
-
'pisell2.event.select.category':
|
|
18
|
+
'pisell2.event.select.category': function pisell2EventSelectCategory(val) {
|
|
19
|
+
return "Select ".concat(val || 'resource');
|
|
20
|
+
},
|
|
19
21
|
'pisell2.event.select.campus': function pisell2EventSelectCampus(val) {
|
|
20
|
-
return "Please
|
|
22
|
+
return "Please select ".concat(val || 'resource');
|
|
21
23
|
},
|
|
22
|
-
'pisell2.event.select.event': "Select
|
|
24
|
+
'pisell2.event.select.event': "Select service",
|
|
23
25
|
'pisell2.event.cart': "Cart",
|
|
24
26
|
'pisell2.event.total': "Total",
|
|
27
|
+
'pisell2.event.total.gst': function pisell2EventTotalGst(val, amount) {
|
|
28
|
+
return "Including ".concat(val, " ").concat(amount);
|
|
29
|
+
},
|
|
25
30
|
'pisell2.event.continue': "Continue",
|
|
26
31
|
'pisell2.event.details': "Details",
|
|
27
32
|
'pisell2.event.introduction': "Introduction",
|
|
@@ -93,13 +98,18 @@ export default {
|
|
|
93
98
|
'pisell2.event.step': function pisell2EventStep(step) {
|
|
94
99
|
return "\u6B65\u9AA4 ".concat(step);
|
|
95
100
|
},
|
|
96
|
-
'pisell2.event.select.category':
|
|
97
|
-
|
|
101
|
+
'pisell2.event.select.category': function pisell2EventSelectCategory(val) {
|
|
102
|
+
return "\u9009\u62E9".concat(val || '资源');
|
|
103
|
+
},
|
|
104
|
+
'pisell2.event.select.event': "选择服务",
|
|
98
105
|
'pisell2.event.select.campus': function pisell2EventSelectCampus(val) {
|
|
99
106
|
return "\u8BF7\u9009\u62E9".concat(val || '资源');
|
|
100
107
|
},
|
|
101
108
|
'pisell2.event.cart': "购物车",
|
|
102
109
|
'pisell2.event.total': "总计",
|
|
110
|
+
'pisell2.event.total.gst': function pisell2EventTotalGst(val, amount) {
|
|
111
|
+
return "\u5305\u542B".concat(val, " ").concat(amount);
|
|
112
|
+
},
|
|
103
113
|
'pisell2.event.continue': "继续",
|
|
104
114
|
'pisell2.event.details': "详情",
|
|
105
115
|
'pisell2.event.introduction': "介绍",
|
|
@@ -171,13 +181,18 @@ export default {
|
|
|
171
181
|
'pisell2.event.step': function pisell2EventStep(step) {
|
|
172
182
|
return "\u6B65\u9A5F ".concat(step);
|
|
173
183
|
},
|
|
174
|
-
'pisell2.event.select.category':
|
|
175
|
-
|
|
184
|
+
'pisell2.event.select.category': function pisell2EventSelectCategory(val) {
|
|
185
|
+
return "\u9078\u64C7".concat(val || '資源');
|
|
186
|
+
},
|
|
187
|
+
'pisell2.event.select.event': "選擇服務",
|
|
176
188
|
'pisell2.event.select.campus': function pisell2EventSelectCampus(val) {
|
|
177
189
|
return "\u8ACB\u9078\u64C7".concat(val || '資源');
|
|
178
190
|
},
|
|
179
191
|
'pisell2.event.cart': "購物車",
|
|
180
192
|
'pisell2.event.total': "總計",
|
|
193
|
+
'pisell2.event.total.gst': function pisell2EventTotalGst(val, amount) {
|
|
194
|
+
return "\u5305\u542B".concat(val, " ").concat(amount);
|
|
195
|
+
},
|
|
181
196
|
'pisell2.event.continue': "繼續",
|
|
182
197
|
'pisell2.event.details': "詳情",
|
|
183
198
|
'pisell2.event.introduction': "介紹",
|
|
@@ -34,3 +34,12 @@ export declare const getScheduleColors: (schedules: any[]) => string;
|
|
|
34
34
|
* @Date: 2025-01-12 11:55
|
|
35
35
|
*/
|
|
36
36
|
export declare const formatMonthDisplay: (dateString: string) => string;
|
|
37
|
+
/**
|
|
38
|
+
* @title: 资源名称
|
|
39
|
+
* @description:
|
|
40
|
+
* @param {any} data
|
|
41
|
+
* @return {*}
|
|
42
|
+
* @Author: WangHan
|
|
43
|
+
* @Date: 2025-02-11 13:39
|
|
44
|
+
*/
|
|
45
|
+
export declare const resourceTitle: (data: any) => any;
|
|
@@ -79,4 +79,21 @@ export var formatMonthDisplay = function formatMonthDisplay(dateString) {
|
|
|
79
79
|
month: 'long',
|
|
80
80
|
year: 'numeric'
|
|
81
81
|
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @title: 资源名称
|
|
86
|
+
* @description:
|
|
87
|
+
* @param {any} data
|
|
88
|
+
* @return {*}
|
|
89
|
+
* @Author: WangHan
|
|
90
|
+
* @Date: 2025-02-11 13:39
|
|
91
|
+
*/
|
|
92
|
+
export var resourceTitle = function resourceTitle(data) {
|
|
93
|
+
var _data$initData, _data$initData$boardS, _data$initData$boardS2, _form$setting, _context$appHelper, _context$appHelper$ut, _translation;
|
|
94
|
+
var context = useEngineContext();
|
|
95
|
+
var form = data === null || data === void 0 ? void 0 : (_data$initData = data.initData) === null || _data$initData === void 0 ? void 0 : (_data$initData$boardS = _data$initData.boardSetting) === null || _data$initData$boardS === void 0 ? void 0 : (_data$initData$boardS2 = _data$initData$boardS.event_v2_form) === null || _data$initData$boardS2 === void 0 ? void 0 : _data$initData$boardS2.form;
|
|
96
|
+
var title = (form === null || form === void 0 ? void 0 : (_form$setting = form.setting) === null || _form$setting === void 0 ? void 0 : _form$setting.title) || (form === null || form === void 0 ? void 0 : form.title);
|
|
97
|
+
var translation = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.translation;
|
|
98
|
+
return (_translation = translation(title)) === null || _translation === void 0 ? void 0 : _translation.toLowerCase();
|
|
82
99
|
};
|
|
@@ -108,9 +108,19 @@
|
|
|
108
108
|
white-space: nowrap;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
@media (min-width: 769px) {
|
|
112
|
+
&:hover {
|
|
113
|
+
.pisell-tabs-tab-content {
|
|
114
|
+
background-color: #f1f1f1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (max-width: 768px) {
|
|
120
|
+
&:hover {
|
|
121
|
+
.pisell-tabs-tab-content {
|
|
122
|
+
background-color: transparent;
|
|
123
|
+
}
|
|
114
124
|
}
|
|
115
125
|
}
|
|
116
126
|
|
|
@@ -219,7 +219,7 @@ var CartProvider = ({ children }) => {
|
|
|
219
219
|
});
|
|
220
220
|
};
|
|
221
221
|
const createCartItemData = () => {
|
|
222
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
222
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
223
223
|
const _cartData = getCurrentData().cartData;
|
|
224
224
|
if (_cartData.currentCartItem) {
|
|
225
225
|
const {
|
|
@@ -256,6 +256,8 @@ var CartProvider = ({ children }) => {
|
|
|
256
256
|
// 是否显示时间
|
|
257
257
|
show_time: true,
|
|
258
258
|
end_time: endTime ? (0, import_dayjs.default)(endTime || "").format("HH:mm") : "",
|
|
259
|
+
custom_day_count: ((_n = (_m = (_l = eventItem == null ? void 0 : eventItem.eventDetail) == null ? void 0 : _l.selectDate) == null ? void 0 : _m.dates) == null ? void 0 : _n.length) || 0,
|
|
260
|
+
is_charge_tax: bookingOptionData == null ? void 0 : bookingOptionData.is_charge_tax,
|
|
259
261
|
_originData: {
|
|
260
262
|
..._cartData.currentCartItem._originData,
|
|
261
263
|
product: {
|
|
@@ -281,9 +283,9 @@ var CartProvider = ({ children }) => {
|
|
|
281
283
|
};
|
|
282
284
|
if (holderItem == null ? void 0 : holderItem._originData) {
|
|
283
285
|
newCartItem._originData.holder = {
|
|
284
|
-
customer_id: (
|
|
285
|
-
form_id: (
|
|
286
|
-
form_record: ((
|
|
286
|
+
customer_id: (_o = getUserInfo()) == null ? void 0 : _o.id,
|
|
287
|
+
form_id: (_p = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _p.form_id,
|
|
288
|
+
form_record: ((_q = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _q.form_record_id) ? [(_r = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _r.form_record_id] : null
|
|
287
289
|
};
|
|
288
290
|
}
|
|
289
291
|
return newCartItem;
|
|
@@ -71,6 +71,9 @@ var CheckoutProvider = ({
|
|
|
71
71
|
onSuccess: (res) => {
|
|
72
72
|
onPay(res.data);
|
|
73
73
|
checkoutCallback.current({ success: true });
|
|
74
|
+
},
|
|
75
|
+
onError: (err) => {
|
|
76
|
+
checkoutCallback.current({ success: false, err });
|
|
74
77
|
}
|
|
75
78
|
});
|
|
76
79
|
const onCheckBeforeBooking = (data2) => {
|
|
@@ -60,7 +60,7 @@ var EventDetailProvider = ({
|
|
|
60
60
|
const introduction = {
|
|
61
61
|
title: eventItem.title,
|
|
62
62
|
price: eventItem.price,
|
|
63
|
-
images: [eventItem.image]
|
|
63
|
+
images: eventItem.image ? [eventItem.image] : []
|
|
64
64
|
};
|
|
65
65
|
eventRef.current = eventItem;
|
|
66
66
|
_setDetail({ introduction });
|
|
@@ -45,11 +45,13 @@ var import_Holder = __toESM(require("../Holder"));
|
|
|
45
45
|
var import_Event = __toESM(require("../Event"));
|
|
46
46
|
var import_Resource = __toESM(require("../Resource"));
|
|
47
47
|
var import_Summary = __toESM(require("../Summary"));
|
|
48
|
+
var import_Customer = require("../Customer");
|
|
48
49
|
var InitContext = (0, import_react.createContext)(
|
|
49
50
|
void 0
|
|
50
51
|
);
|
|
51
52
|
var InitProvider = ({ children }) => {
|
|
52
53
|
const { data, setData, hooks, getCurrentData, getSessionStorage } = (0, import_SalesModel.useSales)();
|
|
54
|
+
const { appUtils } = (0, import_Customer.useCustomer)();
|
|
53
55
|
const { useCustomInit } = hooks;
|
|
54
56
|
const customInit = useCustomInit();
|
|
55
57
|
const initData = (0, import_react.useMemo)(() => {
|
|
@@ -95,11 +97,12 @@ var InitProvider = ({ children }) => {
|
|
|
95
97
|
const getBoardSetting = (0, import_ahooks.useRequest)(import_serve.getBoardSettingApi, {
|
|
96
98
|
manual: true,
|
|
97
99
|
onSuccess: (res) => {
|
|
98
|
-
var _a, _b, _c, _d, _e;
|
|
100
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
99
101
|
setInitData({
|
|
100
102
|
boardSetting: res == null ? void 0 : res.data,
|
|
101
103
|
form_id: (_d = (_c = (_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.config) == null ? void 0 : _b.resource) == null ? void 0 : _c.booking_event_v2_resource) == null ? void 0 : _d.form_id,
|
|
102
|
-
shop_id: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.shop_id
|
|
104
|
+
shop_id: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.shop_id,
|
|
105
|
+
shop: (_i = (_h = (_g = (_f = appUtils.getStore()) == null ? void 0 : _f.getState()) == null ? void 0 : _g.core) == null ? void 0 : _h.core) == null ? void 0 : _i.shop
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
108
|
});
|
|
@@ -38,6 +38,7 @@ module.exports = __toCommonJS(Summary_exports);
|
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
39
|
var import_Cart = require("../Cart");
|
|
40
40
|
var import_utils = require("./utils");
|
|
41
|
+
var import_Init = require("../Init");
|
|
41
42
|
var defaultState = {};
|
|
42
43
|
var SummaryContext = (0, import_react.createContext)(
|
|
43
44
|
void 0
|
|
@@ -46,14 +47,21 @@ var SummaryProvider = ({
|
|
|
46
47
|
children
|
|
47
48
|
}) => {
|
|
48
49
|
const { cartData } = (0, import_Cart.useCart)();
|
|
50
|
+
const { initData } = (0, import_Init.useInit)();
|
|
49
51
|
const summaryData = (0, import_react.useMemo)(() => {
|
|
50
|
-
return (0, import_utils.calculatePriceDetails)(
|
|
51
|
-
|
|
52
|
+
return (0, import_utils.calculatePriceDetails)(
|
|
53
|
+
(initData == null ? void 0 : initData.shop) || {},
|
|
54
|
+
cartData.cartItems
|
|
55
|
+
);
|
|
56
|
+
}, [cartData.cartItems, initData == null ? void 0 : initData.shop]);
|
|
52
57
|
const contextValue = {
|
|
53
58
|
// 商品总价
|
|
54
59
|
subtotal: summaryData.subtotal,
|
|
55
60
|
// 总金额
|
|
56
|
-
total: summaryData.total
|
|
61
|
+
total: summaryData.total,
|
|
62
|
+
taxTitle: summaryData.taxTitle,
|
|
63
|
+
totalTaxFee: summaryData.totalTaxFee,
|
|
64
|
+
isPriceIncludeTax: summaryData.isPriceIncludeTax
|
|
57
65
|
};
|
|
58
66
|
return /* @__PURE__ */ import_react.default.createElement(SummaryContext.Provider, { value: contextValue }, children);
|
|
59
67
|
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/components/Sales/Summary/serve.ts
|
|
20
|
-
var serve_exports = {};
|
|
21
|
-
__export(serve_exports, {
|
|
22
|
-
createHolderApi: () => createHolderApi,
|
|
23
|
-
getHolderListApi: () => getHolderListApi
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(serve_exports);
|
|
26
|
-
var import_request = require("../../../utils/request");
|
|
27
|
-
var getHolderListApi = () => {
|
|
28
|
-
return (0, import_request.get)("/api/holder/list");
|
|
29
|
-
};
|
|
30
|
-
var createHolderApi = (data) => {
|
|
31
|
-
return (0, import_request.post)("/api/holder/create", data);
|
|
32
|
-
};
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
createHolderApi,
|
|
36
|
-
getHolderListApi
|
|
37
|
-
});
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import Decimal from 'decimal.js';
|
|
1
2
|
interface CartItem {
|
|
2
3
|
price: number | string;
|
|
3
4
|
quantity?: number;
|
|
5
|
+
[k: string]: any;
|
|
4
6
|
}
|
|
5
7
|
interface PriceDetail {
|
|
6
8
|
subtotal: string;
|
|
7
9
|
total: string;
|
|
10
|
+
taxTitle?: string;
|
|
11
|
+
totalTaxFee?: string;
|
|
12
|
+
isPriceIncludeTax?: 0 | 1;
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* 计算商品小计(不含其他费用)
|
|
@@ -12,11 +17,20 @@ interface PriceDetail {
|
|
|
12
17
|
* @returns 商品总价字符串,保留2位小数
|
|
13
18
|
*/
|
|
14
19
|
export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
20
|
+
/**
|
|
21
|
+
* @title: 单个商品的税费
|
|
22
|
+
* @description:
|
|
23
|
+
* 单个商品的税费 = 商品销售单价(折扣后) * 税率 * is_charge_tax /( 1+ 税率 * is_price_include_tax)
|
|
24
|
+
* $taxFee = $price * $taxRate * $isChargeTax / (1 + $taxRate * $isPriceIncludeTax);
|
|
25
|
+
* @return {*}
|
|
26
|
+
* @Author: xiangfeng.xue
|
|
27
|
+
*/
|
|
28
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
|
15
29
|
/**
|
|
16
30
|
* 计算所有价格明细
|
|
17
31
|
* @param items - 购物车商品数组
|
|
18
32
|
* @param options - 其他费用配置
|
|
19
33
|
* @returns 价格明细对象
|
|
20
34
|
*/
|
|
21
|
-
export declare const calculatePriceDetails: (items: CartItem[]) => PriceDetail;
|
|
35
|
+
export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[]) => PriceDetail;
|
|
22
36
|
export {};
|
|
@@ -30,7 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var utils_exports = {};
|
|
31
31
|
__export(utils_exports, {
|
|
32
32
|
calculatePriceDetails: () => calculatePriceDetails,
|
|
33
|
-
calculateSubtotal: () => calculateSubtotal
|
|
33
|
+
calculateSubtotal: () => calculateSubtotal,
|
|
34
|
+
calculateTaxFee: () => calculateTaxFee
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(utils_exports);
|
|
36
37
|
var import_decimal = __toESM(require("decimal.js"));
|
|
@@ -45,16 +46,35 @@ var calculateSubtotal = (items) => {
|
|
|
45
46
|
}, new import_decimal.default(0));
|
|
46
47
|
return subtotal.toFixed(2);
|
|
47
48
|
};
|
|
48
|
-
var
|
|
49
|
+
var calculateTaxFee = (shopInfo, items) => {
|
|
50
|
+
if (!(items == null ? void 0 : items.length)) {
|
|
51
|
+
return "0.00";
|
|
52
|
+
}
|
|
53
|
+
const { is_price_include_tax, tax_rate } = shopInfo || {};
|
|
54
|
+
const totalTaxFee = items.reduce((sum, item) => {
|
|
55
|
+
const price = new import_decimal.default(item.price || 0);
|
|
56
|
+
const taxRate = new import_decimal.default(tax_rate || 0).div(100);
|
|
57
|
+
const productTaxRate = price.times(taxRate).times((item == null ? void 0 : item.is_charge_tax) || 0).div(taxRate.times(is_price_include_tax || 0).plus(1));
|
|
58
|
+
return sum.plus(productTaxRate);
|
|
59
|
+
}, new import_decimal.default(0));
|
|
60
|
+
return totalTaxFee;
|
|
61
|
+
};
|
|
62
|
+
var calculatePriceDetails = (shopInfo, items) => {
|
|
49
63
|
const subtotal = new import_decimal.default(calculateSubtotal(items));
|
|
50
|
-
const
|
|
64
|
+
const totalTaxFee = new import_decimal.default(calculateTaxFee(shopInfo, items));
|
|
65
|
+
console.log("totalTaxFee", totalTaxFee.toFixed(2));
|
|
66
|
+
const total = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subtotal : subtotal.plus(totalTaxFee);
|
|
51
67
|
return {
|
|
52
68
|
subtotal: subtotal.toFixed(2),
|
|
53
|
-
total: total.toFixed(2)
|
|
69
|
+
total: total.toFixed(2),
|
|
70
|
+
taxTitle: shopInfo == null ? void 0 : shopInfo.tax_title,
|
|
71
|
+
totalTaxFee: totalTaxFee.toFixed(2),
|
|
72
|
+
isPriceIncludeTax: shopInfo == null ? void 0 : shopInfo.is_price_include_tax
|
|
54
73
|
};
|
|
55
74
|
};
|
|
56
75
|
// Annotate the CommonJS export names for ESM import in node:
|
|
57
76
|
0 && (module.exports = {
|
|
58
77
|
calculatePriceDetails,
|
|
59
|
-
calculateSubtotal
|
|
78
|
+
calculateSubtotal,
|
|
79
|
+
calculateTaxFee
|
|
60
80
|
});
|
|
@@ -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" | "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<"windcave" | "tyro" | "payo" | "stripe">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -58,10 +58,15 @@ var ContinueButton = () => {
|
|
|
58
58
|
const [openEmptyHolder, setOpenEmptyHolder] = (0, import_react.useState)(false);
|
|
59
59
|
const { removeSessionStorage } = (0, import_Sales.useSales)();
|
|
60
60
|
const handleCheckout = async () => {
|
|
61
|
+
var _a2;
|
|
61
62
|
const value = (0, import_utils2.formatValues)(data);
|
|
62
63
|
const result = await onCheckout(value);
|
|
63
64
|
if (result == null ? void 0 : result.success) {
|
|
64
65
|
removeSessionStorage();
|
|
66
|
+
} else {
|
|
67
|
+
(0, import_materials.PisellToast)({
|
|
68
|
+
content: ((_a2 = result == null ? void 0 : result.err) == null ? void 0 : _a2.message) || ""
|
|
69
|
+
});
|
|
65
70
|
}
|
|
66
71
|
};
|
|
67
72
|
const handleNextStep = async () => {
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eventBooking/components/Provider/Cart/Item/Total.tsx
|
|
30
|
+
var Total_exports = {};
|
|
31
|
+
__export(Total_exports, {
|
|
32
|
+
default: () => Total_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Total_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_materials = require("@pisell/materials");
|
|
38
|
+
var import_Sales = require("../../../../../Sales");
|
|
39
|
+
var import_useEngineContext = __toESM(require("../../../../../../hooks/useEngineContext"));
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var import_classnames = __toESM(require("classnames"));
|
|
42
|
+
var Total = ({ className, isFooter }) => {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f;
|
|
44
|
+
const { taxTitle, totalTaxFee, isPriceIncludeTax, total } = (0, import_Sales.useSummary)();
|
|
45
|
+
const context = (0, import_useEngineContext.default)();
|
|
46
|
+
console.log(
|
|
47
|
+
taxTitle,
|
|
48
|
+
isPriceIncludeTax,
|
|
49
|
+
totalTaxFee,
|
|
50
|
+
total,
|
|
51
|
+
(_c = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.getSymbolic) == null ? void 0 : _c.call(_b),
|
|
52
|
+
"wh97978"
|
|
53
|
+
);
|
|
54
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `event-total-wrap ${className}` }, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "gst-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", null, taxTitle, isFooter ? ": " : ""), /* @__PURE__ */ import_react.default.createElement(import_materials.PisellText.Amount, { value: totalTaxFee, showCurrencySymbol: true })) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: (0, import_classnames.default)("event-total", {
|
|
58
|
+
[["total-gst-wrap"]]: !isPriceIncludeTax && Number(totalTaxFee) > 0
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "left" }, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.event.total"), isFooter ? ": " : ""), isFooter ? /* @__PURE__ */ import_react.default.createElement(
|
|
62
|
+
import_materials.PisellText.Amount,
|
|
63
|
+
{
|
|
64
|
+
value: total,
|
|
65
|
+
showCurrencySymbol: true,
|
|
66
|
+
className: "event-amount"
|
|
67
|
+
}
|
|
68
|
+
) : null), isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ import_react.default.createElement("span", { className: "gst" }, import_utils.locales.getText("pisell2.event.total.gst")(
|
|
69
|
+
`${isFooter ? `${taxTitle}: ` : taxTitle}`,
|
|
70
|
+
`${(_f = (_e = (_d = context == null ? void 0 : context.appHelper) == null ? void 0 : _d.utils) == null ? void 0 : _e.getSymbolic) == null ? void 0 : _f.call(_e)}${totalTaxFee}`
|
|
71
|
+
)) : null),
|
|
72
|
+
!isFooter ? /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
import_materials.PisellText.Amount,
|
|
74
|
+
{
|
|
75
|
+
value: total,
|
|
76
|
+
showCurrencySymbol: true,
|
|
77
|
+
className: "event-amount"
|
|
78
|
+
}
|
|
79
|
+
) : null
|
|
80
|
+
));
|
|
81
|
+
};
|
|
82
|
+
var Total_default = Total;
|