@pisell/private-materials 3.0.68 → 3.0.70
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.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -1
- package/es/components/booking/components/footer/FooterMenus/index.js +71 -22
- package/es/components/booking/components/footer/index.js +254 -13
- package/es/components/booking/info/header/index.less +7 -1
- package/es/components/booking/info/service/addService/index.js +6 -5
- package/es/components/booking/locales.js +10 -10
- package/es/components/booking/payments/index.js +0 -6
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -1
- package/lib/components/booking/components/footer/FooterMenus/index.js +4 -21
- package/lib/components/booking/components/footer/index.js +243 -16
- package/lib/components/booking/info/header/index.less +7 -1
- package/lib/components/booking/info/service/addService/index.js +6 -6
- package/lib/components/booking/locales.js +10 -10
- package/lib/components/booking/payments/index.js +0 -6
- package/package.json +2 -2
|
@@ -1,29 +1,75 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import MenuButton from "../../../components/menuButton";
|
|
3
3
|
import "./index.less";
|
|
4
|
-
import { locales } from "@pisell/utils";
|
|
5
4
|
var FooterMenus = function FooterMenus(_ref) {
|
|
6
5
|
var state = _ref.state,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
menuChange = _ref.menuChange,
|
|
7
|
+
items = _ref.items;
|
|
8
|
+
// const items = useMemo(() => {
|
|
9
|
+
// return [
|
|
10
|
+
// {
|
|
11
|
+
// label: "Payment link",
|
|
12
|
+
// key: "payment",
|
|
13
|
+
// children: [
|
|
14
|
+
// {
|
|
15
|
+
// label: "Send email",
|
|
16
|
+
// key: "sendEmail",
|
|
17
|
+
// },
|
|
18
|
+
// {
|
|
19
|
+
// label: "Copy to clipboard",
|
|
20
|
+
// key: "copyToClipboard",
|
|
21
|
+
// },
|
|
22
|
+
// ],
|
|
23
|
+
// },
|
|
24
|
+
// {
|
|
25
|
+
// label: "Sale",
|
|
26
|
+
// key: "sale",
|
|
27
|
+
// },
|
|
28
|
+
// {
|
|
29
|
+
// label: "Print",
|
|
30
|
+
// key: "print",
|
|
31
|
+
// },
|
|
32
|
+
// {
|
|
33
|
+
// label: "Order detail",
|
|
34
|
+
// key: "orderDetail",
|
|
35
|
+
// },
|
|
36
|
+
// {
|
|
37
|
+
// label: "Refund",
|
|
38
|
+
// key: "refund",
|
|
39
|
+
// },
|
|
40
|
+
// {
|
|
41
|
+
// label: "Rebook",
|
|
42
|
+
// key: "rebook",
|
|
43
|
+
// },
|
|
44
|
+
// {
|
|
45
|
+
// label: "Cancel order",
|
|
46
|
+
// key: "cancelOrder",
|
|
47
|
+
// },
|
|
48
|
+
// ];
|
|
49
|
+
// let list = [];
|
|
50
|
+
// if (
|
|
51
|
+
// source === "info" &&
|
|
52
|
+
// state.bookingId &&
|
|
53
|
+
// state.renderType !== "eventBooking"
|
|
54
|
+
// ) {
|
|
55
|
+
// list.push({
|
|
56
|
+
// label: locales.getText("pisell2.text.rebook"),
|
|
57
|
+
// key: "rebook",
|
|
58
|
+
// });
|
|
59
|
+
// }
|
|
60
|
+
|
|
61
|
+
// return list;
|
|
62
|
+
// }, [state, source]);
|
|
63
|
+
|
|
64
|
+
// const handleRebook = () => {
|
|
65
|
+
// state.onRebook?.();
|
|
66
|
+
// };
|
|
67
|
+
|
|
68
|
+
// const menuChange = (e: any) => {
|
|
69
|
+
// if (e.key === "rebook") {
|
|
70
|
+
// handleRebook();
|
|
71
|
+
// }
|
|
72
|
+
// };
|
|
27
73
|
return items.length ? /*#__PURE__*/React.createElement("div", {
|
|
28
74
|
className: "pisell-lowcode__booking-footer-buttons-item-rebook"
|
|
29
75
|
}, /*#__PURE__*/React.createElement(MenuButton, {
|
|
@@ -31,6 +77,9 @@ var FooterMenus = function FooterMenus(_ref) {
|
|
|
31
77
|
dropdownProps: {
|
|
32
78
|
placement: "bottomLeft",
|
|
33
79
|
menu: {
|
|
80
|
+
style: {
|
|
81
|
+
minWidth: 200
|
|
82
|
+
},
|
|
34
83
|
items: items,
|
|
35
84
|
onClick: menuChange
|
|
36
85
|
}
|
|
@@ -20,7 +20,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
20
20
|
import React, { useEffect, useMemo, useState } from "react";
|
|
21
21
|
import ChevronDown from "@pisell/icon/es/ChevronDown";
|
|
22
22
|
import classNames from "classnames";
|
|
23
|
-
import { Skeleton, message, Dropdown, Space } from "antd";
|
|
23
|
+
import { Skeleton, message, Dropdown, Space, Modal } from "antd";
|
|
24
24
|
import { formatAmount, locales } from "@pisell/utils";
|
|
25
25
|
import { Button } from "antd";
|
|
26
26
|
import { formatProducts } from "../../addons";
|
|
@@ -40,7 +40,7 @@ import { DownOutlined } from "@ant-design/icons";
|
|
|
40
40
|
* @Date: 2024-01-30 16:51
|
|
41
41
|
*/
|
|
42
42
|
var Footer = function Footer(props) {
|
|
43
|
-
var _context$appHelper, _store$getState, _store$getState$call, _store$getState$call$, _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$addons2, _state$addons4, _state$bookingDetail11;
|
|
43
|
+
var _context$appHelper, _store$getState, _store$getState$call, _store$getState$call$, _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$bookingConfig8, _state$bookingConfig9, _state$addons2, _state$addons4, _state$bookingDetail11;
|
|
44
44
|
var state = props.state,
|
|
45
45
|
buttons = props.buttons,
|
|
46
46
|
dispatch = props.dispatch,
|
|
@@ -66,6 +66,58 @@ var Footer = function Footer(props) {
|
|
|
66
66
|
interaction = _context$appHelper$ut.interaction,
|
|
67
67
|
store = _context$appHelper$ut.store;
|
|
68
68
|
var isShowPaymentLink = store === null || store === void 0 ? void 0 : (_store$getState = store.getState) === null || _store$getState === void 0 ? void 0 : (_store$getState$call = _store$getState.call(store)) === null || _store$getState$call === void 0 ? void 0 : (_store$getState$call$ = _store$getState$call.global) === null || _store$getState$call$ === void 0 ? void 0 : _store$getState$call$.paymentLinkBtnShow;
|
|
69
|
+
var _Modal$useModal = Modal.useModal(),
|
|
70
|
+
_Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
|
|
71
|
+
modal = _Modal$useModal2[0],
|
|
72
|
+
contextHolder = _Modal$useModal2[1];
|
|
73
|
+
var setActiveTab = state.setActiveTab;
|
|
74
|
+
var actionMap = {
|
|
75
|
+
sale: {
|
|
76
|
+
label: locales.getText("pisell2.text.addons"),
|
|
77
|
+
key: "sale"
|
|
78
|
+
},
|
|
79
|
+
paymentLink: {
|
|
80
|
+
label: locales.getText("pisell2.text.payment-link"),
|
|
81
|
+
key: "payment",
|
|
82
|
+
children: [{
|
|
83
|
+
label: locales.getText("pisell2.text.send-mail"),
|
|
84
|
+
key: "sendMail"
|
|
85
|
+
}, {
|
|
86
|
+
label: locales.getText("pisell2.text.copy-to-clipboard"),
|
|
87
|
+
key: "copy"
|
|
88
|
+
}]
|
|
89
|
+
},
|
|
90
|
+
print: {
|
|
91
|
+
label: "Print",
|
|
92
|
+
key: "print"
|
|
93
|
+
},
|
|
94
|
+
orderDetail: {
|
|
95
|
+
label: locales.getText("pisell2.text.deposit-order-detail"),
|
|
96
|
+
key: "orderDetail"
|
|
97
|
+
},
|
|
98
|
+
refund: {
|
|
99
|
+
label: locales.getText("pisell2.text.refund"),
|
|
100
|
+
key: "refund"
|
|
101
|
+
},
|
|
102
|
+
rebook: {
|
|
103
|
+
label: locales.getText("pisell2.text.rebook"),
|
|
104
|
+
key: "rebook"
|
|
105
|
+
},
|
|
106
|
+
cancelOrder: {
|
|
107
|
+
label: "Cancel order",
|
|
108
|
+
key: "cancelOrder"
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
useEffect(function () {
|
|
112
|
+
if (state.bookingDetail) {
|
|
113
|
+
state.action({
|
|
114
|
+
type: "pisell1.registerPlugin",
|
|
115
|
+
data: {
|
|
116
|
+
pluginList: ["RefundPlugin"]
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}, [state.bookingDetail]);
|
|
69
121
|
useEffect(function () {
|
|
70
122
|
store === null || store === void 0 ? void 0 : store.dispatch({
|
|
71
123
|
type: "global/_getPaymentLinkBtnShow"
|
|
@@ -77,6 +129,13 @@ var Footer = function Footer(props) {
|
|
|
77
129
|
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2;
|
|
78
130
|
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$.basic) === null || _state$bookingConfig$2 === void 0 ? void 0 : _state$bookingConfig$2.appointment_subject) || {};
|
|
79
131
|
}, [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$bookingConfig4 = _state$bookingConfig3.basic) === null || _state$bookingConfig4 === void 0 ? void 0 : _state$bookingConfig4.appointment_subject]);
|
|
132
|
+
var transaction_habit_selection = useMemo(function () {
|
|
133
|
+
var _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7;
|
|
134
|
+
return (state === null || state === void 0 ? void 0 : (_state$bookingConfig5 = state.bookingConfig) === null || _state$bookingConfig5 === void 0 ? void 0 : (_state$bookingConfig6 = _state$bookingConfig5.config) === null || _state$bookingConfig6 === void 0 ? void 0 : (_state$bookingConfig7 = _state$bookingConfig6.information_tab) === null || _state$bookingConfig7 === void 0 ? void 0 : _state$bookingConfig7.transaction_habit_selection) || {
|
|
135
|
+
type: "service_now_pay_later",
|
|
136
|
+
button_rows: 1
|
|
137
|
+
};
|
|
138
|
+
}, [state === null || state === void 0 ? void 0 : (_state$bookingConfig8 = state.bookingConfig) === null || _state$bookingConfig8 === void 0 ? void 0 : (_state$bookingConfig9 = _state$bookingConfig8.config) === null || _state$bookingConfig9 === void 0 ? void 0 : _state$bookingConfig9.information_tab]);
|
|
80
139
|
|
|
81
140
|
// addons 是否有编辑
|
|
82
141
|
var addonsEdit = useMemo(function () {
|
|
@@ -415,7 +474,8 @@ var Footer = function Footer(props) {
|
|
|
415
474
|
key: "booking_refund",
|
|
416
475
|
data: {
|
|
417
476
|
order_id: state.bookingId
|
|
418
|
-
}
|
|
477
|
+
},
|
|
478
|
+
origin: "/booking"
|
|
419
479
|
});
|
|
420
480
|
}
|
|
421
481
|
state.action({
|
|
@@ -440,11 +500,21 @@ var Footer = function Footer(props) {
|
|
|
440
500
|
* @Date: 2024-01-30 16:57
|
|
441
501
|
*/
|
|
442
502
|
var checkoutButton = useMemo(function () {
|
|
503
|
+
var buttonType = "primary";
|
|
504
|
+
if (transaction_habit_selection.type === "service_now_pay_later") {
|
|
505
|
+
buttonType = "default";
|
|
506
|
+
}
|
|
507
|
+
if (source === "payment") {
|
|
508
|
+
buttonType = "primary";
|
|
509
|
+
}
|
|
510
|
+
if (!isEdit) {
|
|
511
|
+
buttonType = "primary";
|
|
512
|
+
}
|
|
443
513
|
return /*#__PURE__*/React.createElement(Button, {
|
|
444
514
|
className: "pisell-lowcode__booking-footer-buttons-item"
|
|
445
515
|
// payment页面为主按钮 info页面 编辑时默认按钮 否则是主按钮
|
|
446
516
|
,
|
|
447
|
-
type:
|
|
517
|
+
type: buttonType,
|
|
448
518
|
loading: checkoutLoading,
|
|
449
519
|
onClick: function onClick() {
|
|
450
520
|
handleCheckout();
|
|
@@ -477,6 +547,7 @@ var Footer = function Footer(props) {
|
|
|
477
547
|
} : state.bookingDetail.customer;
|
|
478
548
|
case 8:
|
|
479
549
|
if (e.key === "sendMail") {
|
|
550
|
+
console.log(e);
|
|
480
551
|
state.action({
|
|
481
552
|
type: "pisell1.sendPayLinkEmail",
|
|
482
553
|
data: {
|
|
@@ -508,6 +579,59 @@ var Footer = function Footer(props) {
|
|
|
508
579
|
return _ref7.apply(this, arguments);
|
|
509
580
|
};
|
|
510
581
|
}();
|
|
582
|
+
|
|
583
|
+
// 重新预约
|
|
584
|
+
var handleRebook = function handleRebook() {
|
|
585
|
+
var _state$onRebook;
|
|
586
|
+
(_state$onRebook = state.onRebook) === null || _state$onRebook === void 0 ? void 0 : _state$onRebook.call(state);
|
|
587
|
+
};
|
|
588
|
+
// 销售
|
|
589
|
+
var handleSale = function handleSale() {
|
|
590
|
+
if (isTerminal !== null && isTerminal !== void 0 && isTerminal()) {
|
|
591
|
+
var _interaction$utils3, _interaction$utils3$p;
|
|
592
|
+
return interaction === null || interaction === void 0 ? void 0 : (_interaction$utils3 = interaction.utils) === null || _interaction$utils3 === void 0 ? void 0 : (_interaction$utils3$p = _interaction$utils3.postMessageToApp) === null || _interaction$utils3$p === void 0 ? void 0 : _interaction$utils3$p.call(_interaction$utils3, {
|
|
593
|
+
module: "booking",
|
|
594
|
+
key: "edit_order",
|
|
595
|
+
data: {
|
|
596
|
+
order_id: state.bookingId
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
if (state.channelDisabledEdit) {
|
|
601
|
+
modal.warning({
|
|
602
|
+
okText: locales.getText("pisell2.text.ok"),
|
|
603
|
+
content: locales.getText("pisell2.text.terminal-edit-message")
|
|
604
|
+
});
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
setActiveTab === null || setActiveTab === void 0 ? void 0 : setActiveTab("addons");
|
|
608
|
+
};
|
|
609
|
+
// 打印
|
|
610
|
+
var handlePrint = function handlePrint() {};
|
|
611
|
+
// 订单详情
|
|
612
|
+
var handleOrderDetail = function handleOrderDetail() {
|
|
613
|
+
if (isTerminal !== null && isTerminal !== void 0 && isTerminal()) {
|
|
614
|
+
return interaction.utils.postMessageToApp({
|
|
615
|
+
module: "booking",
|
|
616
|
+
key: "view_order",
|
|
617
|
+
data: {
|
|
618
|
+
order_id: state.bookingId
|
|
619
|
+
},
|
|
620
|
+
origin: "/booking"
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
state.action({
|
|
624
|
+
type: "pisell1.goOrderDetail",
|
|
625
|
+
data: {
|
|
626
|
+
orderId: state.bookingId
|
|
627
|
+
},
|
|
628
|
+
callback: function callback() {
|
|
629
|
+
state === null || state === void 0 ? void 0 : state.callback();
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
};
|
|
633
|
+
// 取消订单
|
|
634
|
+
var handleCancel = function handleCancel() {};
|
|
511
635
|
var paymentLinkButton = useMemo(function () {
|
|
512
636
|
var items = [{
|
|
513
637
|
label: locales.getText("pisell2.text.send-mail"),
|
|
@@ -535,9 +659,13 @@ var Footer = function Footer(props) {
|
|
|
535
659
|
* @Date: 2024-01-30 16:58
|
|
536
660
|
*/
|
|
537
661
|
var saveButton = useMemo(function () {
|
|
662
|
+
var buttonType = "default";
|
|
663
|
+
if (transaction_habit_selection.type === "service_now_pay_later") {
|
|
664
|
+
buttonType = "primary";
|
|
665
|
+
}
|
|
538
666
|
return /*#__PURE__*/React.createElement(Button, {
|
|
539
667
|
className: "pisell-lowcode__booking-footer-buttons-item",
|
|
540
|
-
type:
|
|
668
|
+
type: buttonType,
|
|
541
669
|
onClick: function onClick() {
|
|
542
670
|
handleSave({
|
|
543
671
|
type: "save"
|
|
@@ -565,6 +693,21 @@ var Footer = function Footer(props) {
|
|
|
565
693
|
}, locales.getText("pisell2.text.status.completed"));
|
|
566
694
|
}, [state.appointment_status]);
|
|
567
695
|
|
|
696
|
+
/**
|
|
697
|
+
* @title: Rebook按钮
|
|
698
|
+
* @description:
|
|
699
|
+
* @param {*} useMemo
|
|
700
|
+
* @return {*}
|
|
701
|
+
* @Author: zhiwei.Wang
|
|
702
|
+
* @Date: 2024-01-30 16:58
|
|
703
|
+
*/
|
|
704
|
+
var rebookButton = useMemo(function () {
|
|
705
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
706
|
+
className: "pisell-lowcode__booking-footer-buttons-item",
|
|
707
|
+
onClick: handleRebook
|
|
708
|
+
}, locales.getText("pisell2.text.rebook"));
|
|
709
|
+
}, [state === null || state === void 0 ? void 0 : state.onRebook]);
|
|
710
|
+
|
|
568
711
|
/**
|
|
569
712
|
* @title: 退款按钮
|
|
570
713
|
* @description:
|
|
@@ -585,7 +728,8 @@ var Footer = function Footer(props) {
|
|
|
585
728
|
save: saveButton,
|
|
586
729
|
complete: completeButton,
|
|
587
730
|
refund: refundButton,
|
|
588
|
-
paymentLink: paymentLinkButton
|
|
731
|
+
paymentLink: paymentLinkButton,
|
|
732
|
+
rebook: rebookButton
|
|
589
733
|
};
|
|
590
734
|
|
|
591
735
|
/**
|
|
@@ -609,10 +753,57 @@ var Footer = function Footer(props) {
|
|
|
609
753
|
return false;
|
|
610
754
|
}
|
|
611
755
|
}, [state.bookingDetail, total.notPaidAmount]);
|
|
756
|
+
var moreButton = useMemo(function () {
|
|
757
|
+
var arr = [];
|
|
758
|
+
if (!state.bookingId) {
|
|
759
|
+
return [];
|
|
760
|
+
}
|
|
761
|
+
if (source !== "info") {
|
|
762
|
+
return [];
|
|
763
|
+
}
|
|
764
|
+
if (state.renderType === "eventBooking") {
|
|
765
|
+
return [];
|
|
766
|
+
}
|
|
767
|
+
// 支付链接
|
|
768
|
+
if (state.bookingId && isShowPaymentLink) {
|
|
769
|
+
arr.push(actionMap.paymentLink);
|
|
770
|
+
}
|
|
771
|
+
if (transaction_habit_selection.button_rows == 1) {
|
|
772
|
+
if (state.appointment_status !== "cancelled") {
|
|
773
|
+
if (!state.disabledEdit) {
|
|
774
|
+
arr.push(actionMap.sale);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// if (transaction_habit_selection.button_rows == 1) {
|
|
780
|
+
// if (isTerminal?.()) {
|
|
781
|
+
// arr.push(actionMap.print);
|
|
782
|
+
// }
|
|
783
|
+
// }
|
|
784
|
+
|
|
785
|
+
if (transaction_habit_selection.button_rows == 1) {
|
|
786
|
+
arr.push(actionMap.orderDetail);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// 退款
|
|
790
|
+
if (total.paidAmount > 0) {
|
|
791
|
+
arr.push(actionMap.refund);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// 重新预约
|
|
795
|
+
if (state.appointment_status !== "cancelled") {
|
|
796
|
+
arr.push(actionMap.rebook);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// 取消订单
|
|
800
|
+
// arr.push(actionMap.cancelOrder);
|
|
801
|
+
return arr;
|
|
802
|
+
}, [state, total, isShowPaymentLink, source]);
|
|
612
803
|
var _buttons = useMemo(function () {
|
|
613
804
|
// 如果预约是取消状态,则不展示任何按钮
|
|
614
805
|
if (state.appointment_status === "cancelled") {
|
|
615
|
-
return [];
|
|
806
|
+
return [buttonMap.rebook];
|
|
616
807
|
}
|
|
617
808
|
|
|
618
809
|
// addons 默认为新增按钮, 如果有新增数据 则添加save按钮
|
|
@@ -650,9 +841,9 @@ var Footer = function Footer(props) {
|
|
|
650
841
|
// info
|
|
651
842
|
if (source === "info") {
|
|
652
843
|
var _arr3 = [];
|
|
653
|
-
if (state.bookingId && isShowPaymentLink) {
|
|
654
|
-
|
|
655
|
-
}
|
|
844
|
+
// if (state.bookingId && isShowPaymentLink) {
|
|
845
|
+
// arr.push(buttonMap.paymentLink);
|
|
846
|
+
// }
|
|
656
847
|
// 有未支付金额 展示checkout
|
|
657
848
|
if (isCheckout) {
|
|
658
849
|
_arr3.push(buttonMap.checkout);
|
|
@@ -669,7 +860,7 @@ var Footer = function Footer(props) {
|
|
|
669
860
|
return _arr3;
|
|
670
861
|
}
|
|
671
862
|
return [];
|
|
672
|
-
}, [buttons, total, isEdit, checkoutLoading, isDisabled,
|
|
863
|
+
}, [buttons, total, isEdit, checkoutLoading, isDisabled, source, buttonMap, loading, isCheckout, state]);
|
|
673
864
|
|
|
674
865
|
/**
|
|
675
866
|
* 是否只有定金支付
|
|
@@ -788,6 +979,37 @@ var Footer = function Footer(props) {
|
|
|
788
979
|
}
|
|
789
980
|
return false;
|
|
790
981
|
}, [state.bookingId, state.bookingDetail, (_state$addons4 = state.addons) === null || _state$addons4 === void 0 ? void 0 : _state$addons4.load, state.renderType]);
|
|
982
|
+
var menuChange = function menuChange(e) {
|
|
983
|
+
console.log("e.key", e.key);
|
|
984
|
+
switch (e.key) {
|
|
985
|
+
case "sendMail":
|
|
986
|
+
handleMenuClick(e);
|
|
987
|
+
break;
|
|
988
|
+
case "copy":
|
|
989
|
+
handleMenuClick(e);
|
|
990
|
+
break;
|
|
991
|
+
case "rebook":
|
|
992
|
+
handleRebook();
|
|
993
|
+
break;
|
|
994
|
+
case "sale":
|
|
995
|
+
handleSale();
|
|
996
|
+
break;
|
|
997
|
+
case "print":
|
|
998
|
+
handlePrint();
|
|
999
|
+
break;
|
|
1000
|
+
case "orderDetail":
|
|
1001
|
+
handleOrderDetail();
|
|
1002
|
+
break;
|
|
1003
|
+
case "refund":
|
|
1004
|
+
handleRefund();
|
|
1005
|
+
break;
|
|
1006
|
+
case "cancelOrder":
|
|
1007
|
+
handleCancel();
|
|
1008
|
+
break;
|
|
1009
|
+
default:
|
|
1010
|
+
break;
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
791
1013
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
792
1014
|
title: false,
|
|
793
1015
|
round: true,
|
|
@@ -885,9 +1107,28 @@ var Footer = function Footer(props) {
|
|
|
885
1107
|
}, formatAmount(total.totalRefundAmount, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || "$"))) : null) : null), /*#__PURE__*/React.createElement("div", {
|
|
886
1108
|
className: "pisell-lowcode__booking-footer-buttons"
|
|
887
1109
|
}, /*#__PURE__*/React.createElement(FooterMenus, {
|
|
1110
|
+
items: moreButton,
|
|
888
1111
|
state: state,
|
|
889
1112
|
dispatch: dispatch,
|
|
890
|
-
source: source
|
|
891
|
-
|
|
1113
|
+
source: source,
|
|
1114
|
+
menuChange: menuChange
|
|
1115
|
+
}), _buttons), source === "info" && state.bookingId && !state.disabledEdit && (transaction_habit_selection === null || transaction_habit_selection === void 0 ? void 0 : transaction_habit_selection.button_rows) == 2 ? /*#__PURE__*/React.createElement("div", {
|
|
1116
|
+
className: "pisell-lowcode__booking-footer-buttons",
|
|
1117
|
+
style: {
|
|
1118
|
+
marginTop: 12
|
|
1119
|
+
}
|
|
1120
|
+
}, state.appointment_status !== "cancelled" ? /*#__PURE__*/React.createElement(Button, {
|
|
1121
|
+
onClick: function onClick() {
|
|
1122
|
+
return handleSale();
|
|
1123
|
+
},
|
|
1124
|
+
size: "large",
|
|
1125
|
+
className: "pisell-lowcode__booking-footer-buttons-item"
|
|
1126
|
+
}, actionMap.sale.label) : null, /*#__PURE__*/React.createElement(Button, {
|
|
1127
|
+
onClick: function onClick() {
|
|
1128
|
+
return handleOrderDetail();
|
|
1129
|
+
},
|
|
1130
|
+
size: "large",
|
|
1131
|
+
className: "pisell-lowcode__booking-footer-buttons-item"
|
|
1132
|
+
}, actionMap.orderDetail.label)) : null, contextHolder);
|
|
892
1133
|
};
|
|
893
1134
|
export default Footer;
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
font-size: 14px;
|
|
26
26
|
font-style: normal;
|
|
27
27
|
font-weight: 400;
|
|
28
|
-
line-height: 20px;
|
|
28
|
+
line-height: 20px;
|
|
29
|
+
/* 142.857% */
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
.booking-header-line-2 {
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
align-items: center;
|
|
35
36
|
justify-content: space-between;
|
|
36
37
|
}
|
|
38
|
+
|
|
37
39
|
.booking-header-left {
|
|
38
40
|
color: var(--Base-White, #FFF);
|
|
39
41
|
font-size: 18px;
|
|
@@ -51,6 +53,10 @@
|
|
|
51
53
|
font-style: normal;
|
|
52
54
|
font-weight: 400;
|
|
53
55
|
cursor: pointer;
|
|
56
|
+
border: 1px solid #fff;
|
|
57
|
+
padding: 4px 12px;
|
|
58
|
+
border-radius: 24px;
|
|
59
|
+
|
|
54
60
|
|
|
55
61
|
.booking-header-right-status-icon {
|
|
56
62
|
font-size: 20px;
|
|
@@ -34,7 +34,7 @@ import { locales, getUniqueId } from "@pisell/utils";
|
|
|
34
34
|
import { useUpdateEffect } from "ahooks";
|
|
35
35
|
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080];
|
|
36
36
|
var Info = function Info() {
|
|
37
|
-
var _state$service3, _state$
|
|
37
|
+
var _state$service3, _state$service5, _state$service6, _state$service6$cache;
|
|
38
38
|
var _useState = useState(""),
|
|
39
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
40
40
|
search = _useState2[0],
|
|
@@ -275,17 +275,18 @@ var Info = function Info() {
|
|
|
275
275
|
return state.service.value.length > 0;
|
|
276
276
|
}, [state.service.value]);
|
|
277
277
|
useEffect(function () {
|
|
278
|
-
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5;
|
|
278
|
+
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _state$service4, _state$service4$value;
|
|
279
279
|
// Salonip 不要这个
|
|
280
280
|
|
|
281
281
|
if (shopList.includes((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.global) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id)) {
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
+
|
|
284
285
|
// 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
|
|
285
|
-
if (state.modalOpen && !state.bookingId && state.renderType !== "eventBooking") {
|
|
286
|
+
if (state.modalOpen && !state.bookingId && state.renderType !== "eventBooking" && ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$value = _state$service4.value) === null || _state$service4$value === void 0 ? void 0 : _state$service4$value.length) === 0) {
|
|
286
287
|
handleSelectService();
|
|
287
288
|
}
|
|
288
|
-
}, [state.modalOpen, state.bookingId]);
|
|
289
|
+
}, [state.modalOpen, state.bookingId, (_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value]);
|
|
289
290
|
var showAddButton = useMemo(function () {
|
|
290
291
|
return !state.disabledEdit && !state.channelDisabledEdit;
|
|
291
292
|
}, [state.disabledEdit, state.channelDisabledEdit]);
|
|
@@ -325,7 +326,7 @@ var Info = function Info() {
|
|
|
325
326
|
}
|
|
326
327
|
});
|
|
327
328
|
}, [state.renderType, showAddButton, isService, state.service.value, loading]);
|
|
328
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$
|
|
329
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : _state$service6$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
|
|
329
330
|
loading: true,
|
|
330
331
|
active: true,
|
|
331
332
|
round: true
|
|
@@ -131,23 +131,23 @@ export default {
|
|
|
131
131
|
'pisell2.text.add-contacts': 'Add contact',
|
|
132
132
|
'pisell2.text.edit-profile': 'Edit profile',
|
|
133
133
|
'pisell2.text.remove-contact': 'Remove contact',
|
|
134
|
-
'pisell2.text.order.sales.channel.online': "Online
|
|
135
|
-
'pisell2.text.order.sales.channel.pos-terminal': "Pisell
|
|
134
|
+
'pisell2.text.order.sales.channel.online': "Online store",
|
|
135
|
+
'pisell2.text.order.sales.channel.pos-terminal': "Pisell terminal",
|
|
136
136
|
'pisell2.text.order.sales.channel.boxcocal': "Boxlocal",
|
|
137
|
-
'pisell2.text.order.sales.channel.tableorder': "Table
|
|
138
|
-
'pisell2.text.order.sales.channel.reserve': "Google
|
|
137
|
+
'pisell2.text.order.sales.channel.tableorder': "Table order",
|
|
138
|
+
'pisell2.text.order.sales.channel.reserve': "Google reservation",
|
|
139
139
|
'pisell2.text.rebook': "Rebook",
|
|
140
140
|
'pisell2.text.now': 'Now',
|
|
141
|
-
'pisell2.text.deposit-list': "Deposit
|
|
141
|
+
'pisell2.text.deposit-list': "Deposit list",
|
|
142
142
|
'pisell2.text.deposit-item-status-paid': "Paid",
|
|
143
143
|
'pisell2.text.deposit-item-status-unpaid': "Unpaid",
|
|
144
|
-
'pisell2.text.deposit-order-total': "Order
|
|
145
|
-
'pisell2.text.deposit-order-detail': "Order
|
|
146
|
-
'pisell2.text.deposit-collect-deposit': "Collect
|
|
144
|
+
'pisell2.text.deposit-order-total': "Order total",
|
|
145
|
+
'pisell2.text.deposit-order-detail': "Order details",
|
|
146
|
+
'pisell2.text.deposit-collect-deposit': "Collect deposit",
|
|
147
147
|
'pisell2.text.deposit-order-no': "Order No",
|
|
148
148
|
'pisell2.text.deposit-amount': "Amount",
|
|
149
|
-
'pisell2.text.deposit-deposit-amount': "Deposit
|
|
150
|
-
'pisell2.text.deposit-generate-payment-link': "Generate
|
|
149
|
+
'pisell2.text.deposit-deposit-amount': "Deposit amount",
|
|
150
|
+
'pisell2.text.deposit-generate-payment-link': "Generate payment link",
|
|
151
151
|
'pisell2.text.deposit-list-empty': "Please add a deposit",
|
|
152
152
|
'pisell2.text.deposit-amount-message': "Amount must be greater than 0",
|
|
153
153
|
'pisell2.text.deposit-amount-message2': "The deposit amount cannot be greater than the total order amount",
|
|
@@ -87,12 +87,6 @@ var Payments = Provider(function (props) {
|
|
|
87
87
|
useEffect(function () {
|
|
88
88
|
if (state.bookingDetail) {
|
|
89
89
|
init();
|
|
90
|
-
state.action({
|
|
91
|
-
type: "pisell1.registerPlugin",
|
|
92
|
-
data: {
|
|
93
|
-
pluginList: ["RefundPlugin"]
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
90
|
}
|
|
97
91
|
}, [state.bookingDetail]);
|
|
98
92
|
var getRefundInfo = /*#__PURE__*/function () {
|
|
@@ -35,27 +35,7 @@ module.exports = __toCommonJS(FooterMenus_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_menuButton = __toESM(require("../../../components/menuButton"));
|
|
37
37
|
var import_index = require("./index.less");
|
|
38
|
-
var
|
|
39
|
-
var FooterMenus = ({ state, source }) => {
|
|
40
|
-
const items = (0, import_react.useMemo)(() => {
|
|
41
|
-
let list = [];
|
|
42
|
-
if (source === "info" && state.bookingId && state.renderType !== "eventBooking") {
|
|
43
|
-
list.push({
|
|
44
|
-
label: import_utils.locales.getText("pisell2.text.rebook"),
|
|
45
|
-
key: "rebook"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return list;
|
|
49
|
-
}, [state, source]);
|
|
50
|
-
const handleRebook = () => {
|
|
51
|
-
var _a;
|
|
52
|
-
(_a = state.onRebook) == null ? void 0 : _a.call(state);
|
|
53
|
-
};
|
|
54
|
-
const menuChange = (e) => {
|
|
55
|
-
if (e.key === "rebook") {
|
|
56
|
-
handleRebook();
|
|
57
|
-
}
|
|
58
|
-
};
|
|
38
|
+
var FooterMenus = ({ state, menuChange, items }) => {
|
|
59
39
|
return items.length ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-buttons-item-rebook" }, /* @__PURE__ */ import_react.default.createElement(
|
|
60
40
|
import_menuButton.default,
|
|
61
41
|
{
|
|
@@ -63,6 +43,9 @@ var FooterMenus = ({ state, source }) => {
|
|
|
63
43
|
dropdownProps: {
|
|
64
44
|
placement: "bottomLeft",
|
|
65
45
|
menu: {
|
|
46
|
+
style: {
|
|
47
|
+
minWidth: 200
|
|
48
|
+
},
|
|
66
49
|
items,
|
|
67
50
|
onClick: menuChange
|
|
68
51
|
}
|