@pisell/private-materials 3.0.72 → 3.0.74
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +15 -15
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/footer/amount.js +47 -24
- package/es/components/booking/components/footer/index.js +5 -0
- package/es/components/booking/components/footer/utils.js +22 -1
- package/es/components/booking/deposit/index.js +10 -1
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/info/service/actions/index.d.ts +6 -0
- package/es/components/booking/info/service/actions/index.js +73 -0
- package/es/components/booking/info/service/actions/index.less +9 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +4 -0
- package/es/components/booking/info/service/addTimeModal/index.js +658 -0
- package/es/components/booking/info/service/addTimeModal/index.less +133 -0
- package/es/components/booking/info/service/addTimeModal/serve.d.ts +5 -0
- package/es/components/booking/info/service/addTimeModal/serve.js +50 -0
- package/es/components/booking/info/service/addTimeModal/utils.d.ts +12 -0
- package/es/components/booking/info/service/addTimeModal/utils.js +96 -0
- package/es/components/booking/info/service/index.js +2 -1
- package/es/components/booking/info/service/serviceItem/Sales/index.d.ts +0 -0
- package/es/components/booking/info/service/serviceItem/Sales/index.js +0 -0
- package/es/components/booking/info/service/serviceItem/Sales/index.less +0 -0
- package/es/components/booking/info/service/serviceItem/index.js +24 -2
- package/es/components/booking/info/service/serviceItem/index.less +28 -0
- package/es/components/booking/locales.d.ts +24 -0
- package/es/components/booking/locales.js +26 -2
- package/es/components/booking/model.d.ts +3 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/booking/utils.d.ts +12 -0
- package/es/components/booking/utils.js +91 -48
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/footer/amount.js +10 -0
- package/lib/components/booking/components/footer/index.js +5 -0
- package/lib/components/booking/components/footer/utils.js +21 -1
- package/lib/components/booking/deposit/index.js +3 -1
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/info/service/actions/index.d.ts +6 -0
- package/lib/components/booking/info/service/actions/index.js +97 -0
- package/lib/components/booking/info/service/actions/index.less +9 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +4 -0
- package/lib/components/booking/info/service/addTimeModal/index.js +566 -0
- package/lib/components/booking/info/service/addTimeModal/index.less +133 -0
- package/lib/components/booking/info/service/addTimeModal/serve.d.ts +5 -0
- package/lib/components/booking/info/service/addTimeModal/serve.js +39 -0
- package/lib/components/booking/info/service/addTimeModal/utils.d.ts +12 -0
- package/lib/components/booking/info/service/addTimeModal/utils.js +129 -0
- package/lib/components/booking/info/service/index.js +2 -1
- package/lib/components/booking/info/service/serviceItem/Sales/index.d.ts +0 -0
- package/lib/components/booking/info/service/serviceItem/Sales/index.js +0 -0
- package/lib/components/booking/info/service/serviceItem/Sales/index.less +0 -0
- package/lib/components/booking/info/service/serviceItem/index.js +14 -1
- package/lib/components/booking/info/service/serviceItem/index.less +28 -0
- package/lib/components/booking/locales.d.ts +24 -0
- package/lib/components/booking/locales.js +26 -2
- package/lib/components/booking/model.d.ts +3 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/booking/utils.d.ts +12 -0
- package/lib/components/booking/utils.js +82 -33
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -9,6 +9,24 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
9
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
10
|
import { getDiscountTime, flexibleObj } from "../../utils";
|
|
11
11
|
import { formatAmount } from '@pisell/utils';
|
|
12
|
+
var getRelationDetailsTotal = function getRelationDetailsTotal(relation_details) {
|
|
13
|
+
var total = 0;
|
|
14
|
+
var _iterator = _createForOfIteratorHelper(relation_details),
|
|
15
|
+
_step;
|
|
16
|
+
try {
|
|
17
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
18
|
+
var item = _step.value;
|
|
19
|
+
var number = item.product_quantity || item.num;
|
|
20
|
+
var price = item.payment_price || item.price;
|
|
21
|
+
total += Number(price) * Number(number);
|
|
22
|
+
}
|
|
23
|
+
} catch (err) {
|
|
24
|
+
_iterator.e(err);
|
|
25
|
+
} finally {
|
|
26
|
+
_iterator.f();
|
|
27
|
+
}
|
|
28
|
+
return total;
|
|
29
|
+
};
|
|
12
30
|
/**
|
|
13
31
|
* 总金额
|
|
14
32
|
* @param state
|
|
@@ -20,30 +38,35 @@ var getProductAmount = function getProductAmount(state, isEdit) {
|
|
|
20
38
|
if (isEdit) {
|
|
21
39
|
// 计算总价 服务 和 附加商品
|
|
22
40
|
if (state !== null && state !== void 0 && state.service || state !== null && state !== void 0 && state.addons) {
|
|
23
|
-
var
|
|
24
|
-
|
|
41
|
+
var _iterator2 = _createForOfIteratorHelper(state === null || state === void 0 ? void 0 : state.service.value),
|
|
42
|
+
_step2;
|
|
25
43
|
try {
|
|
26
|
-
for (
|
|
27
|
-
var item =
|
|
44
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
45
|
+
var item = _step2.value;
|
|
46
|
+
// 预约商品
|
|
28
47
|
price += Number(item._extend.total);
|
|
48
|
+
|
|
49
|
+
// 附加商品
|
|
50
|
+
price += getRelationDetailsTotal(item._extend.relation_details || []);
|
|
51
|
+
// price +=
|
|
29
52
|
duration += flexibleObj.getValue(item._extend.duration);
|
|
30
53
|
}
|
|
31
54
|
} catch (err) {
|
|
32
|
-
|
|
55
|
+
_iterator2.e(err);
|
|
33
56
|
} finally {
|
|
34
|
-
|
|
57
|
+
_iterator2.f();
|
|
35
58
|
}
|
|
36
|
-
var
|
|
37
|
-
|
|
59
|
+
var _iterator3 = _createForOfIteratorHelper(state.addons.value),
|
|
60
|
+
_step3;
|
|
38
61
|
try {
|
|
39
|
-
for (
|
|
40
|
-
var _item =
|
|
62
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
63
|
+
var _item = _step3.value;
|
|
41
64
|
price += Number(_item._extend.total) * _item._extend.quantity;
|
|
42
65
|
}
|
|
43
66
|
} catch (err) {
|
|
44
|
-
|
|
67
|
+
_iterator3.e(err);
|
|
45
68
|
} finally {
|
|
46
|
-
|
|
69
|
+
_iterator3.f();
|
|
47
70
|
}
|
|
48
71
|
}
|
|
49
72
|
} else {
|
|
@@ -103,11 +126,11 @@ var getTax = function getTax(state, isEdit) {
|
|
|
103
126
|
return Number((_state$bookingDetail2 = state.bookingDetail) === null || _state$bookingDetail2 === void 0 ? void 0 : _state$bookingDetail2.tax_fee);
|
|
104
127
|
}
|
|
105
128
|
if (state !== null && state !== void 0 && state.service || state !== null && state !== void 0 && state.addons) {
|
|
106
|
-
var
|
|
107
|
-
|
|
129
|
+
var _iterator4 = _createForOfIteratorHelper(state === null || state === void 0 ? void 0 : state.service.value),
|
|
130
|
+
_step4;
|
|
108
131
|
try {
|
|
109
|
-
for (
|
|
110
|
-
var item =
|
|
132
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
133
|
+
var item = _step4.value;
|
|
111
134
|
price += getProductItemTax(_objectSpread(_objectSpread({}, item), {}, {
|
|
112
135
|
total: getTotal(item),
|
|
113
136
|
price: item._extend.price,
|
|
@@ -115,15 +138,15 @@ var getTax = function getTax(state, isEdit) {
|
|
|
115
138
|
}), state.bookingDetail);
|
|
116
139
|
}
|
|
117
140
|
} catch (err) {
|
|
118
|
-
|
|
141
|
+
_iterator4.e(err);
|
|
119
142
|
} finally {
|
|
120
|
-
|
|
143
|
+
_iterator4.f();
|
|
121
144
|
}
|
|
122
|
-
var
|
|
123
|
-
|
|
145
|
+
var _iterator5 = _createForOfIteratorHelper(state.addons.value),
|
|
146
|
+
_step5;
|
|
124
147
|
try {
|
|
125
|
-
for (
|
|
126
|
-
var _item2 =
|
|
148
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
149
|
+
var _item2 = _step5.value;
|
|
127
150
|
price += getProductItemTax(_objectSpread(_objectSpread({}, _item2), {}, {
|
|
128
151
|
total: getTotal(_item2),
|
|
129
152
|
price: _item2._extend.price,
|
|
@@ -131,9 +154,9 @@ var getTax = function getTax(state, isEdit) {
|
|
|
131
154
|
}), state.bookingDetail);
|
|
132
155
|
}
|
|
133
156
|
} catch (err) {
|
|
134
|
-
|
|
157
|
+
_iterator5.e(err);
|
|
135
158
|
} finally {
|
|
136
|
-
|
|
159
|
+
_iterator5.f();
|
|
137
160
|
}
|
|
138
161
|
}
|
|
139
162
|
return price;
|
|
@@ -859,6 +859,11 @@ var Footer = function Footer(props) {
|
|
|
859
859
|
}
|
|
860
860
|
return _arr3;
|
|
861
861
|
}
|
|
862
|
+
if (source === "addTime") {
|
|
863
|
+
var _arr4 = [];
|
|
864
|
+
_arr4 = _toConsumableArray(buttons);
|
|
865
|
+
return _arr4;
|
|
866
|
+
}
|
|
862
867
|
return [];
|
|
863
868
|
}, [buttons, total, isEdit, checkoutLoading, isDisabled, source, buttonMap, loading, isCheckout, state]);
|
|
864
869
|
|
|
@@ -71,6 +71,26 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
71
71
|
};
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
+
var getSubType = function getSubType(item) {
|
|
75
|
+
var _item$duration;
|
|
76
|
+
var _type = (_item$duration = item.duration) === null || _item$duration === void 0 ? void 0 : _item$duration.type;
|
|
77
|
+
// 目前不支持跨天
|
|
78
|
+
if (_type && _type !== 'days') {
|
|
79
|
+
return _type;
|
|
80
|
+
}
|
|
81
|
+
return 'minutes';
|
|
82
|
+
};
|
|
83
|
+
var formatRelationDetails = function formatRelationDetails(list) {
|
|
84
|
+
return (list || []).map(function (item) {
|
|
85
|
+
return {
|
|
86
|
+
num: item.product_quantity,
|
|
87
|
+
price: item.payment_price || 0,
|
|
88
|
+
product_id: item.product_id,
|
|
89
|
+
is_charge_tax: item.is_charge_tax,
|
|
90
|
+
order_detail_id: item.order_detail_id
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
};
|
|
74
94
|
|
|
75
95
|
/**
|
|
76
96
|
* @title: 预约商品信息
|
|
@@ -113,6 +133,7 @@ var formatBookings = function formatBookings(data) {
|
|
|
113
133
|
"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),
|
|
114
134
|
"bundle_edit": item._extend.bundle_edit
|
|
115
135
|
},
|
|
136
|
+
"relation_products": formatRelationDetails(item._extend.relation_details),
|
|
116
137
|
'id': item.booking_id || 0,
|
|
117
138
|
"relation_id": item._extend.relation_id,
|
|
118
139
|
"like_status": item._extend.like_status || 'common',
|
|
@@ -120,7 +141,7 @@ var formatBookings = function formatBookings(data) {
|
|
|
120
141
|
"is_all": false,
|
|
121
142
|
"schedule_id": item._extend.schedule_id,
|
|
122
143
|
"end_time": end_time,
|
|
123
|
-
"sub_type":
|
|
144
|
+
"sub_type": getSubType(item),
|
|
124
145
|
"select_date": start_date,
|
|
125
146
|
"start_time": start_time,
|
|
126
147
|
"end_date": end_date,
|
|
@@ -46,7 +46,8 @@ var Deposit = function Deposit(props) {
|
|
|
46
46
|
bookingId = globalState.bookingId,
|
|
47
47
|
amountSymbol = globalState.amountSymbol,
|
|
48
48
|
generatePaymentLink = globalState.generatePaymentLink,
|
|
49
|
-
locale = globalState.locale
|
|
49
|
+
locale = globalState.locale,
|
|
50
|
+
callback = globalState.callback;
|
|
50
51
|
var sendEmail = function sendEmail(id) {
|
|
51
52
|
action({
|
|
52
53
|
type: 'pisell1.sendPayLinkEmail',
|
|
@@ -77,6 +78,10 @@ var Deposit = function Deposit(props) {
|
|
|
77
78
|
deposit_amount: 0
|
|
78
79
|
})
|
|
79
80
|
});
|
|
81
|
+
callback === null || callback === void 0 ? void 0 : callback({
|
|
82
|
+
order_id: bookingId,
|
|
83
|
+
afterCloseUpdate: true
|
|
84
|
+
});
|
|
80
85
|
});
|
|
81
86
|
}
|
|
82
87
|
});
|
|
@@ -130,6 +135,10 @@ var Deposit = function Deposit(props) {
|
|
|
130
135
|
deposit_amount: amount
|
|
131
136
|
})
|
|
132
137
|
});
|
|
138
|
+
callback === null || callback === void 0 ? void 0 : callback({
|
|
139
|
+
order_id: bookingId,
|
|
140
|
+
afterCloseUpdate: true
|
|
141
|
+
});
|
|
133
142
|
});
|
|
134
143
|
};
|
|
135
144
|
var handleGoOrderDetail = function handleGoOrderDetail() {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => JSX.Element;
|
|
2
2
|
export default Booking;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
2
|
export declare const walkInData: {
|
|
4
3
|
id: number;
|
|
5
4
|
nickname: string;
|
|
6
5
|
};
|
|
7
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
8
7
|
state: FormState;
|
|
9
8
|
} & {
|
|
10
9
|
dispatch: (params: {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { useMemo, useContext } from "react";
|
|
2
|
+
import { Context } from "../../model";
|
|
3
|
+
import { Button } from "antd";
|
|
4
|
+
import { getIsEdit } from "../../../utils";
|
|
5
|
+
import { isUsableProduct } from "../addTimeModal/utils";
|
|
6
|
+
import "./index.less";
|
|
7
|
+
import { locales } from "@pisell/utils";
|
|
8
|
+
var Actions = function Actions(_ref) {
|
|
9
|
+
var _state$bookingConfig2, _state$bookingConfig3;
|
|
10
|
+
var currentService = _ref.currentService;
|
|
11
|
+
var _useContext = useContext(Context),
|
|
12
|
+
state = _useContext.state,
|
|
13
|
+
dispatch = _useContext.dispatch;
|
|
14
|
+
var appointment_card = useMemo(function () {
|
|
15
|
+
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2;
|
|
16
|
+
return (state === null || state === void 0 ? void 0 : (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : (_state$bookingConfig$ = _state$bookingConfig.config) === null || _state$bookingConfig$ === void 0 ? void 0 : (_state$bookingConfig$2 = _state$bookingConfig$.information_tab) === null || _state$bookingConfig$2 === void 0 ? void 0 : _state$bookingConfig$2.appointment_card) || {
|
|
17
|
+
quick_time: 1
|
|
18
|
+
};
|
|
19
|
+
}, [state === null || state === void 0 ? void 0 : (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 ? void 0 : (_state$bookingConfig3 = _state$bookingConfig2.config) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.information_tab]);
|
|
20
|
+
var onAddTime = function onAddTime() {
|
|
21
|
+
dispatch({
|
|
22
|
+
type: "setService",
|
|
23
|
+
payload: {
|
|
24
|
+
addTimeModal: true,
|
|
25
|
+
cacheItem: currentService
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var addTimeProducts = useMemo(function () {
|
|
30
|
+
return (state.addTimeProducts || []).some(function (item) {
|
|
31
|
+
return isUsableProduct(item.add_time.relation_product, currentService);
|
|
32
|
+
});
|
|
33
|
+
}, [state.addTimeProducts, currentService]);
|
|
34
|
+
var showAddTimeButton = useMemo(function () {
|
|
35
|
+
// event预约不需要
|
|
36
|
+
if (state.renderType === "eventBooking") {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 禁止编辑
|
|
41
|
+
if (state.disabledEdit) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 未开启加时
|
|
46
|
+
if (appointment_card.quick_time !== 1) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 如果在编辑态, 不展示加时
|
|
51
|
+
if (getIsEdit(state)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 如果该服务没有符合的加时商品, 不展示加时
|
|
56
|
+
if (!addTimeProducts) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
}, [state, appointment_card.quick_time, addTimeProducts]);
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: "actions-wrap"
|
|
63
|
+
}, showAddTimeButton && /*#__PURE__*/React.createElement(Button, {
|
|
64
|
+
className: "action-item",
|
|
65
|
+
size: "large",
|
|
66
|
+
onClick: function onClick(e) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
e.stopPropagation();
|
|
69
|
+
onAddTime();
|
|
70
|
+
}
|
|
71
|
+
}, locales.getText("page.booking.text.add-time")));
|
|
72
|
+
};
|
|
73
|
+
export default Actions;
|