@pisell/private-materials 3.3.95 → 3.3.96

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.
Files changed (143) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +11 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/Sales/Cart/index.js +5 -1
  12. package/es/components/Sales/Cart/utils.d.ts +40 -0
  13. package/es/components/Sales/Cart/utils.js +167 -0
  14. package/es/components/Sales/Checkout/index.d.ts +4 -0
  15. package/es/components/Sales/Checkout/index.js +52 -8
  16. package/es/components/Sales/Checkout/serve.d.ts +13 -0
  17. package/es/components/Sales/Checkout/serve.js +16 -2
  18. package/es/components/Sales/Checkout/utils.js +7 -1
  19. package/es/components/Sales/Summary/index.d.ts +10 -0
  20. package/es/components/Sales/Summary/index.js +17 -2
  21. package/es/components/Sales/Summary/serve.d.ts +1 -0
  22. package/es/components/Sales/Summary/serve.js +6 -0
  23. package/es/components/Sales/Summary/utils.d.ts +15 -0
  24. package/es/components/Sales/Summary/utils.js +43 -1
  25. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  26. package/es/components/appointmentBooking/components/Content/index.js +15 -1
  27. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  28. package/es/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  29. package/es/components/appointmentBooking/components/Deposit/index.js +27 -7
  30. package/es/components/appointmentBooking/components/Services/index.js +23 -27
  31. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +25 -20
  32. package/es/components/appointmentBooking/deposit/index.js +4 -2
  33. package/es/components/appointmentBooking/index.js +14 -0
  34. package/es/components/appointmentBooking/index.less +1 -1
  35. package/es/components/booking/components/voucher/index.js +2 -2
  36. package/es/components/booking/info/model.js +5 -0
  37. package/es/components/eftposPay/const.d.ts +4 -1
  38. package/es/components/eftposPay/const.js +3 -1
  39. package/es/components/eftposPay/hooks.d.ts +1 -1
  40. package/es/components/eftposPay/hooks.js +3 -1
  41. package/es/components/eftposPay/index.js +1 -1
  42. package/es/components/eftposPay/linkly/const.d.ts +23 -0
  43. package/es/components/eftposPay/linkly/const.js +82 -0
  44. package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  45. package/es/components/eftposPay/linkly/hooks/index.js +2 -0
  46. package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  47. package/es/components/eftposPay/linkly/hooks/normal.js +321 -0
  48. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  49. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +273 -0
  50. package/es/components/eftposPay/linkly/index.d.ts +2 -0
  51. package/es/components/eftposPay/linkly/index.js +197 -0
  52. package/es/components/eftposPay/linkly/service.d.ts +32 -0
  53. package/es/components/eftposPay/linkly/service.js +81 -0
  54. package/es/components/eftposPay/manufacturer.d.ts +1 -0
  55. package/es/components/eftposPay/manufacturer.js +4 -0
  56. package/es/components/eftposPay/pay.d.ts +1 -1
  57. package/es/components/eftposPay/pay.js +6 -2
  58. package/es/components/eftposPay/store/index.d.ts +1 -1
  59. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +29 -17
  60. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  61. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +17 -0
  62. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +10 -6
  63. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  64. package/es/components/eventBooking/components/bookingDetailModal/index.js +3 -1
  65. package/es/components/eventBooking/locales.d.ts +24 -0
  66. package/es/components/eventBooking/locales.js +27 -3
  67. package/es/components/pay/toC/PaymentMethods/index.js +5 -4
  68. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  69. package/es/components/ticketBooking/components/ticketBooking/index.js +120 -1
  70. package/es/components/ticketBooking/locales.d.ts +164 -146
  71. package/es/components/ticketBooking/locales.js +195 -147
  72. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  73. package/es/components/ticketBooking/utils/formatProductMessage.js +62 -0
  74. package/es/components/ticketBooking/utils/formatTime.d.ts +31 -0
  75. package/es/components/ticketBooking/utils/formatTime.js +144 -0
  76. package/lib/components/Sales/Cart/index.js +1 -0
  77. package/lib/components/Sales/Cart/utils.d.ts +40 -0
  78. package/lib/components/Sales/Cart/utils.js +117 -0
  79. package/lib/components/Sales/Checkout/index.d.ts +4 -0
  80. package/lib/components/Sales/Checkout/index.js +39 -7
  81. package/lib/components/Sales/Checkout/serve.d.ts +13 -0
  82. package/lib/components/Sales/Checkout/serve.js +7 -2
  83. package/lib/components/Sales/Checkout/utils.js +2 -0
  84. package/lib/components/Sales/Summary/index.d.ts +10 -0
  85. package/lib/components/Sales/Summary/index.js +7 -1
  86. package/lib/components/Sales/Summary/serve.d.ts +1 -0
  87. package/lib/components/Sales/Summary/serve.js +32 -0
  88. package/lib/components/Sales/Summary/utils.d.ts +15 -0
  89. package/lib/components/Sales/Summary/utils.js +30 -1
  90. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  91. package/lib/components/appointmentBooking/components/Content/index.js +6 -1
  92. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  93. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  94. package/lib/components/appointmentBooking/components/Deposit/index.js +36 -4
  95. package/lib/components/appointmentBooking/components/Services/index.js +6 -11
  96. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +8 -4
  97. package/lib/components/appointmentBooking/deposit/index.js +4 -2
  98. package/lib/components/appointmentBooking/index.js +11 -0
  99. package/lib/components/appointmentBooking/index.less +1 -1
  100. package/lib/components/booking/components/voucher/index.js +2 -2
  101. package/lib/components/booking/info/model.js +3 -0
  102. package/lib/components/eftposPay/const.d.ts +4 -1
  103. package/lib/components/eftposPay/const.js +2 -0
  104. package/lib/components/eftposPay/hooks.d.ts +1 -1
  105. package/lib/components/eftposPay/hooks.js +11 -4
  106. package/lib/components/eftposPay/index.js +1 -1
  107. package/lib/components/eftposPay/linkly/const.d.ts +23 -0
  108. package/lib/components/eftposPay/linkly/const.js +102 -0
  109. package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  110. package/lib/components/eftposPay/linkly/hooks/index.js +25 -0
  111. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  112. package/lib/components/eftposPay/linkly/hooks/normal.js +242 -0
  113. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  114. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +222 -0
  115. package/lib/components/eftposPay/linkly/index.d.ts +2 -0
  116. package/lib/components/eftposPay/linkly/index.js +208 -0
  117. package/lib/components/eftposPay/linkly/service.d.ts +32 -0
  118. package/lib/components/eftposPay/linkly/service.js +55 -0
  119. package/lib/components/eftposPay/manufacturer.d.ts +1 -0
  120. package/lib/components/eftposPay/manufacturer.js +6 -0
  121. package/lib/components/eftposPay/pay.d.ts +1 -1
  122. package/lib/components/eftposPay/pay.js +13 -2
  123. package/lib/components/eftposPay/store/index.d.ts +1 -1
  124. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +16 -3
  125. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  126. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +55 -0
  127. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +8 -5
  128. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  129. package/lib/components/eventBooking/components/bookingDetailModal/index.js +1 -1
  130. package/lib/components/eventBooking/locales.d.ts +24 -0
  131. package/lib/components/eventBooking/locales.js +27 -3
  132. package/lib/components/pay/toC/PaymentMethods/index.js +10 -9
  133. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  134. package/lib/components/ticketBooking/components/ticketBooking/index.js +120 -1
  135. package/lib/components/ticketBooking/locales.d.ts +164 -146
  136. package/lib/components/ticketBooking/locales.js +22 -4
  137. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  138. package/lib/components/ticketBooking/utils/formatProductMessage.js +84 -0
  139. package/lib/components/ticketBooking/utils/formatTime.d.ts +31 -0
  140. package/lib/components/ticketBooking/utils/formatTime.js +139 -0
  141. package/package.json +2 -2
  142. package/es/components/index.d.ts +0 -20
  143. package/lib/components/index.d.ts +0 -20
@@ -107,7 +107,7 @@
107
107
  margin-top: 0;
108
108
 
109
109
  .appointment-cart-item-wrap {
110
- height: calc(100vh - 16px) !important;
110
+ height: calc(var(--vh, 1vh) * 100 - 16px) !important;
111
111
  }
112
112
  }
113
113
  }
@@ -1,3 +1,9 @@
1
1
  import './index.less';
2
+ export declare const DepositContent: (props: {
3
+ isAgreeDepositPolicy: boolean;
4
+ setIsAgreeDepositPolicy: (value: boolean) => void;
5
+ deposit: any;
6
+ depositProtocolRequest?: any;
7
+ }) => JSX.Element;
2
8
  declare const Deposit: () => JSX.Element;
3
9
  export default Deposit;
@@ -4,12 +4,11 @@ import AppointmentDeposit from "../../deposit";
4
4
  import { useAppointmentBookingContext } from "../../context";
5
5
  import { locales } from '@pisell/utils';
6
6
  import "./index.less";
7
- var Deposit = function Deposit() {
8
- var _useAppointmentBookin = useAppointmentBookingContext(),
9
- setIsAgreeDepositPolicy = _useAppointmentBookin.setIsAgreeDepositPolicy,
10
- isAgreeDepositPolicy = _useAppointmentBookin.isAgreeDepositPolicy,
11
- summary = _useAppointmentBookin.summary;
12
- var deposit = summary.deposit;
7
+ export var DepositContent = function DepositContent(props) {
8
+ var isAgreeDepositPolicy = props.isAgreeDepositPolicy,
9
+ setIsAgreeDepositPolicy = props.setIsAgreeDepositPolicy,
10
+ deposit = props.deposit,
11
+ depositProtocolRequest = props.depositProtocolRequest;
13
12
  return /*#__PURE__*/React.createElement("div", {
14
13
  className: "appointment-deposit-wrap"
15
14
  }, /*#__PURE__*/React.createElement("div", {
@@ -24,7 +23,28 @@ var Deposit = function Deposit() {
24
23
  isAgreePolicy: isAgreeDepositPolicy,
25
24
  onChange: function onChange(value) {
26
25
  return setIsAgreeDepositPolicy(value);
27
- }
26
+ },
27
+ depositProtocolRequest: depositProtocolRequest
28
28
  }));
29
29
  };
30
+ var Deposit = function Deposit() {
31
+ var _ref = useAppointmentBookingContext(),
32
+ setIsAgreeDepositPolicy = _ref.setIsAgreeDepositPolicy,
33
+ isAgreeDepositPolicy = _ref.isAgreeDepositPolicy,
34
+ summary = _ref.summary,
35
+ appointmentBooking = _ref.appointmentBooking;
36
+ var deposit = summary.deposit;
37
+
38
+ // 获取协议方法需要在组件中定义才能传递给子组件,子组件无法获取到context中的方法
39
+ var depositProtocolRequest = function depositProtocolRequest(id) {
40
+ var _appointmentBooking$g;
41
+ return appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$g = appointmentBooking.getProtocol) === null || _appointmentBooking$g === void 0 ? void 0 : _appointmentBooking$g.call(appointmentBooking, id);
42
+ };
43
+ return /*#__PURE__*/React.createElement(DepositContent, {
44
+ isAgreeDepositPolicy: !!isAgreeDepositPolicy,
45
+ setIsAgreeDepositPolicy: setIsAgreeDepositPolicy,
46
+ deposit: deposit,
47
+ depositProtocolRequest: depositProtocolRequest
48
+ });
49
+ };
30
50
  export default Deposit;
@@ -85,9 +85,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
85
85
  return checkProductType(item === null || item === void 0 ? void 0 : item.id);
86
86
  case 4:
87
87
  type = _context2.sent;
88
- if (type === 'session') {
89
- appointmentBooking.openProductDetail(item.id);
90
- }
88
+ appointmentBooking.openProductDetail(item.id);
91
89
  case 6:
92
90
  utils === null || utils === void 0 || utils.action({
93
91
  type: 'pisell1.productDetail',
@@ -105,6 +103,13 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
105
103
  return _regeneratorRuntime().wrap(function _callee$(_context) {
106
104
  while (1) switch (_context.prev = _context.next) {
107
105
  case 0:
106
+ if (!data.isCancel) {
107
+ _context.next = 3;
108
+ break;
109
+ }
110
+ appointmentBooking.closeProductDetail();
111
+ return _context.abrupt("return");
112
+ case 3:
108
113
  product = _objectSpread(_objectSpread({}, data), {}, {
109
114
  options: (data === null || data === void 0 ? void 0 : data.option) || []
110
115
  });
@@ -112,31 +117,21 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
112
117
 
113
118
  // 零售模版,直接加入购物车
114
119
  if (!isRetailTemplate) {
115
- _context.next = 7;
120
+ _context.next = 10;
116
121
  break;
117
122
  }
118
123
  if (!(data !== null && data !== void 0 && data.isCancel)) {
119
- _context.next = 5;
124
+ _context.next = 8;
120
125
  break;
121
126
  }
122
127
  return _context.abrupt("return");
123
- case 5:
128
+ case 8:
124
129
  appointmentBooking.storeProduct(product);
125
130
  return _context.abrupt("return");
126
- case 7:
127
- if (!(data !== null && data !== void 0 && data.isCancel)) {
128
- _context.next = 10;
129
- break;
130
- }
131
- if (type === 'session') {
132
- appointmentBooking.closeProductDetail();
133
- appointmentBooking.getAvailableDate();
134
- }
135
- return _context.abrupt("return");
136
131
  case 10:
137
132
  session = data === null || data === void 0 ? void 0 : data.session;
138
133
  if (!session) {
139
- _context.next = 20;
134
+ _context.next = 19;
140
135
  break;
141
136
  }
142
137
  startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
@@ -148,35 +143,36 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
148
143
  endTime: "".concat(endDate, " ").concat(session === null || session === void 0 ? void 0 : session.end_time)
149
144
  }
150
145
  });
151
- appointmentBooking.closeProductDetail();
152
- _context.next = 18;
146
+ _context.next = 17;
153
147
  return appointmentBooking.getAvailableDate({
154
148
  startDate: startDate,
155
149
  endDate: endDate
156
150
  });
157
- case 18:
158
- _context.next = 28;
151
+ case 17:
152
+ _context.next = 27;
159
153
  break;
160
- case 20:
154
+ case 19:
161
155
  resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
162
156
  activeStatus = resources.find(function (item) {
163
157
  return item.status === 1;
164
158
  });
165
159
  if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
166
- _context.next = 24;
160
+ _context.next = 23;
167
161
  break;
168
162
  }
169
163
  return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
170
- case 24:
164
+ case 23:
171
165
  appointmentBooking.storeProduct(product);
172
166
  // duration 类型的商品,要获取一下资源,在先选日期的 duration 步骤里目前只能通过这个动作拉取
173
167
  if (!(type === 'duration')) {
174
- _context.next = 28;
168
+ _context.next = 27;
175
169
  break;
176
170
  }
177
- _context.next = 28;
171
+ _context.next = 27;
178
172
  return appointmentBooking.getAvailableDate();
179
- case 28:
173
+ case 27:
174
+ appointmentBooking.closeProductDetail();
175
+
180
176
  // 先选择日期流程
181
177
  if (isDateSelectedFirst) {
182
178
  index = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2; //先选择日期流程:如果商品类型是duration的商品,则需要增加选择时间步骤
@@ -12,7 +12,6 @@ import React, { useState, useEffect } from 'react';
12
12
  import { Spin } from 'antd';
13
13
  import { PisellModal, PisellEmpty, Button, Checkbox } from '@pisell/materials';
14
14
  import { locales, isMobile } from '@pisell/utils';
15
- import { useAppointmentBookingContext } from "../../../context";
16
15
  import "./index.less";
17
16
  var DepositModal = function DepositModal(props) {
18
17
  var open = props.open,
@@ -21,9 +20,8 @@ var DepositModal = function DepositModal(props) {
21
20
  onChange = props.onChange,
22
21
  onConfirm = props.onConfirm,
23
22
  _props$isHideCheckout = props.isHideCheckout,
24
- isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout;
25
- var _useAppointmentBookin = useAppointmentBookingContext(),
26
- appointmentBooking = _useAppointmentBookin.appointmentBooking;
23
+ isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout,
24
+ depositProtocolRequest = props.depositProtocolRequest;
27
25
  var _useState = useState(null),
28
26
  _useState2 = _slicedToArray(_useState, 2),
29
27
  policy = _useState2[0],
@@ -50,35 +48,42 @@ var DepositModal = function DepositModal(props) {
50
48
  */
51
49
  var getPolicy = /*#__PURE__*/function () {
52
50
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
53
- var _yield$appointmentBoo, data;
51
+ var _yield$depositProtoco, data;
54
52
  return _regeneratorRuntime().wrap(function _callee$(_context) {
55
53
  while (1) switch (_context.prev = _context.next) {
56
54
  case 0:
55
+ if (depositProtocolRequest) {
56
+ _context.next = 3;
57
+ break;
58
+ }
59
+ console.error('depositProtocolRequest is not defined');
60
+ return _context.abrupt("return");
61
+ case 3:
57
62
  setLoading(true);
58
- _context.prev = 1;
59
- _context.next = 4;
60
- return appointmentBooking.getProtocol(id);
61
- case 4:
62
- _yield$appointmentBoo = _context.sent;
63
- data = _yield$appointmentBoo.data;
63
+ _context.prev = 4;
64
+ _context.next = 7;
65
+ return depositProtocolRequest === null || depositProtocolRequest === void 0 ? void 0 : depositProtocolRequest(id);
66
+ case 7:
67
+ _yield$depositProtoco = _context.sent;
68
+ data = _yield$depositProtoco.data;
64
69
  setPolicy(data);
65
70
  onChange && onChange(data);
66
- _context.next = 14;
71
+ _context.next = 17;
67
72
  break;
68
- case 10:
69
- _context.prev = 10;
70
- _context.t0 = _context["catch"](1);
73
+ case 13:
74
+ _context.prev = 13;
75
+ _context.t0 = _context["catch"](4);
71
76
  console.log(_context.t0);
72
77
  onChange && onChange(_context.t0);
73
- case 14:
74
- _context.prev = 14;
75
- setLoading(false);
76
- return _context.finish(14);
77
78
  case 17:
79
+ _context.prev = 17;
80
+ setLoading(false);
81
+ return _context.finish(17);
82
+ case 20:
78
83
  case "end":
79
84
  return _context.stop();
80
85
  }
81
- }, _callee, null, [[1, 10, 14, 17]]);
86
+ }, _callee, null, [[4, 13, 17, 20]]);
82
87
  }));
83
88
  return function getPolicy(_x) {
84
89
  return _ref.apply(this, arguments);
@@ -21,7 +21,8 @@ var Deposit = function Deposit(props) {
21
21
  isAgreePolicy = _props$isAgreePolicy === void 0 ? true : _props$isAgreePolicy,
22
22
  _props$isShowTitle = props.isShowTitle,
23
23
  isShowTitle = _props$isShowTitle === void 0 ? true : _props$isShowTitle,
24
- onChange = props.onChange;
24
+ onChange = props.onChange,
25
+ depositProtocolRequest = props.depositProtocolRequest;
25
26
  var context = useEngineContext();
26
27
  // 打开协议弹窗
27
28
  var _useState = useState(false),
@@ -95,7 +96,8 @@ var Deposit = function Deposit(props) {
95
96
  onCancel: function onCancel() {
96
97
  return setVisible(false);
97
98
  },
98
- item: policyItem
99
+ item: policyItem,
100
+ depositProtocolRequest: depositProtocolRequest
99
101
  }));
100
102
  };
101
103
  export default Deposit;
@@ -27,6 +27,20 @@ var AppointmentBooking = function AppointmentBooking() {
27
27
  }
28
28
  });
29
29
  }, []);
30
+ useEffect(function () {
31
+ var setRealVH = function setRealVH() {
32
+ // window.innerHeight 会返回视口真实的高度(不包括工具栏)
33
+ var vh = window.innerHeight * 0.01;
34
+ document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
35
+ };
36
+
37
+ // 页面加载和窗口大小变化时都重新计算
38
+ setRealVH();
39
+ window.addEventListener('resize', setRealVH);
40
+ return function () {
41
+ window.removeEventListener('resize', setRealVH);
42
+ };
43
+ }, []);
30
44
  return /*#__PURE__*/React.createElement("div", {
31
45
  className: "parallel-booking-wrap ".concat(isMobile() ? 'parallel-booking-mobile-wrap' : '')
32
46
  }, /*#__PURE__*/React.createElement(AppointmentBookingProvider, null, /*#__PURE__*/React.createElement(Content, null)));
@@ -3,7 +3,7 @@
3
3
  flex-direction: column;
4
4
  align-items: center;
5
5
  background: #ffffff;
6
- height: 100vh;
6
+ height: calc(var(--vh, 1vh) * 100);
7
7
  overflow-y: auto;
8
8
 
9
9
  .pisell-section-headers {
@@ -26,8 +26,8 @@ import useEngineContext from "../../../../hooks/useEngineContext";
26
26
  import { PisellInput, PisellGoodPassCard, PisellToast } from '@pisell/materials';
27
27
  import { useIsBooking4Shop } from "../../hooks/useIsBooking4Shop";
28
28
  import "./index.less";
29
- import { getServiceAddons } from "./utils";
30
29
  import { useMemoizedFn, useDebounceFn, useDebounceEffect } from 'ahooks';
30
+ import { getServiceAddons } from "./utils";
31
31
  var ShopDiscountHooks = {
32
32
  onInited: 'shopDiscount:onInited',
33
33
  onDestroy: 'shopDiscount:onDestroy',
@@ -275,8 +275,8 @@ var VoucherCard = function VoucherCard(props) {
275
275
  style: {
276
276
  width: '100%'
277
277
  },
278
- mixedSort: mixedSort,
279
278
  dataSource: (_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length ? availableData : [],
279
+ mixedSort: mixedSort,
280
280
  onChange: function onChange(val) {
281
281
  var shopDiscount = pisellos.getModule('shopDiscount');
282
282
  var detail = shopDiscount.setDiscountSelected({
@@ -67,6 +67,11 @@ var _miniRedux = miniRedux({
67
67
  },
68
68
  setActiveCartId: function setActiveCartId(state, payload) {
69
69
  state.setGlobalState(payload);
70
+ },
71
+ setAddons: function setAddons(state, payload) {
72
+ state.setGlobalState({
73
+ addons: _objectSpread(_objectSpread({}, state.addons), payload)
74
+ });
70
75
  }
71
76
  },
72
77
  reducers: {
@@ -5,7 +5,8 @@ export declare enum EftposEnum {
5
5
  Tyro = "tyro",
6
6
  /** 后端支付 - 支付 + 退款 */
7
7
  Windcave = "windcave",
8
- Stripe = "stripe"
8
+ Stripe = "stripe",
9
+ Linkly = "linkly"
9
10
  }
10
11
  export declare enum StatusEnum {
11
12
  Loading = "loading",
@@ -147,6 +148,8 @@ export declare enum PayStatus {
147
148
  'Success' = "200",
148
149
  /** 未生成交易记录 */
149
150
  'NoPay' = "4004",
151
+ /** 配对失效 */
152
+ 'PairingFailure' = "606020",
150
153
  /** 支付失败 */
151
154
  'Unknown' = "701000",
152
155
  /** 交易请求超时 */
@@ -3,8 +3,9 @@ export var EftposEnum = /*#__PURE__*/function (EftposEnum) {
3
3
  EftposEnum["Tyro"] = "tyro";
4
4
  EftposEnum["Windcave"] = "windcave";
5
5
  EftposEnum["Stripe"] = "stripe";
6
+ EftposEnum["Linkly"] = "linkly";
6
7
  return EftposEnum;
7
- }({}); // Eftpos = 'eftpos',
8
+ }({});
8
9
  export var StatusEnum = /*#__PURE__*/function (StatusEnum) {
9
10
  StatusEnum["Loading"] = "loading";
10
11
  StatusEnum["Warn"] = "warn";
@@ -64,6 +65,7 @@ export var PayRouteEnum = /*#__PURE__*/function (PayRouteEnum) {
64
65
  export var PayStatus = /*#__PURE__*/function (PayStatus) {
65
66
  PayStatus["Success"] = "200";
66
67
  PayStatus["NoPay"] = "4004";
68
+ PayStatus["PairingFailure"] = "606020";
67
69
  PayStatus["Unknown"] = "701000";
68
70
  PayStatus["Timeout"] = "701001";
69
71
  PayStatus["PayOtherEftposFailed"] = "701003";
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
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<"tyro" | "windcave" | "stripe" | "payo">;
22
+ readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -139,6 +139,7 @@ export var useFail = function useFail(index) {
139
139
  return;
140
140
  }
141
141
  var code = "".concat(res.code);
142
+ console.log('code---->>>>>>>', code);
142
143
  if (code === PayStatus.Unknown) {
143
144
  // 前往报错页 不可标记
144
145
  steps[index].title = locales.getText('page.eftpos-pay.text.failed')(modeRef.current);
@@ -224,6 +225,7 @@ export var useFail = function useFail(index) {
224
225
  dispatch(updateComponent('Fail'));
225
226
  return;
226
227
  }
228
+
227
229
  // 重新支付 最多到重新发起2次
228
230
  ref.current += 1;
229
231
  dispatch(updateState({
@@ -300,7 +302,7 @@ export var useFail = function useFail(index) {
300
302
  }));
301
303
  return;
302
304
  }
303
- if (code === PayStatus.UserConfigError) {
305
+ if (code === PayStatus.UserConfigError || code === PayStatus.PairingFailure) {
304
306
  // 前往错误页 不可标记状态
305
307
  steps[index].title = locales.getText('page.eftpos-pay.text.transaction.user.config.title');
306
308
  steps[index].fail = locales.getText('page.eftpos-pay.text.transaction.user.config.text');
@@ -163,7 +163,7 @@ export default (function (props) {
163
163
  }, [mode, state]);
164
164
  useEffect(function () {
165
165
  document.body.id = 'body';
166
- console.log('初始化 ........11221801');
166
+ console.log('初始化 ........112218017777');
167
167
  }, []);
168
168
 
169
169
  // console.log('action = ', action);
@@ -0,0 +1,23 @@
1
+ import { State } from '../store';
2
+ import { ModeEnum } from '../const';
3
+ export declare const getStep: (mode?: ModeEnum) => State['steps'];
4
+ declare const _default: (params: any) => State;
5
+ export default _default;
6
+ export declare enum EVisibleButtonType {
7
+ /** 取消按钮 */
8
+ CancelButton = "CancelButton",
9
+ /** 等待按钮 */
10
+ WaitButton = "WaitButton"
11
+ }
12
+ export declare enum LinklyActionStatus {
13
+ /** 空 */
14
+ Empty = "Empty",
15
+ /** 取消 */
16
+ Cancel = "Cancel",
17
+ /** 取消中 */
18
+ CancelWaiting = "CancelWaiting",
19
+ /** 签名 */
20
+ Signature = "Signature",
21
+ /** 签名等待中 */
22
+ SignatureWaiting = "SignatureWaiting"
23
+ }
@@ -0,0 +1,82 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net", "client"];
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+ import { locales } from '@pisell/utils';
11
+ import { ClientEnum, EftposEnum, ModeEnum, PayRouteEnum, StatusEnum } from "../const";
12
+ export var getStep = function getStep() {
13
+ var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ModeEnum.Pay;
14
+ return [{
15
+ key: Date.now(),
16
+ title: locales.getText('page.eftpos-pay.text.loading')(mode),
17
+ // 'Payment in process...',
18
+ text: locales.getText('page.eftpos-pay.text.waiting.processing'),
19
+ // 'Waiting for the processing...',
20
+ warn: '',
21
+ tip: locales.getText('page.eftpos-pay.text.processing'),
22
+ // 'processing...',
23
+ status: StatusEnum.Loading
24
+ }];
25
+ };
26
+ export default (function (params) {
27
+ var _ref = params || {
28
+ mode: ModeEnum.Pay
29
+ },
30
+ order_id = _ref.order_id,
31
+ name = _ref.name,
32
+ symbol = _ref.symbol,
33
+ amount = _ref.amount,
34
+ mode = _ref.mode,
35
+ number = _ref.number,
36
+ pay = _ref.pay,
37
+ device = _ref.device,
38
+ net = _ref.net,
39
+ client = _ref.client,
40
+ other = _objectWithoutProperties(_ref, _excluded);
41
+ console.log('params =>>>>>> ', params);
42
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
43
+ order_id: order_id,
44
+ name: name,
45
+ symbol: symbol,
46
+ amount: amount,
47
+ mode: mode,
48
+ eftpos: EftposEnum.Linkly,
49
+ key: Date.now(),
50
+ step: 0,
51
+ type: PayRouteEnum.Step,
52
+ title: locales.getText('page.eftpos-pay.text.loading')(mode),
53
+ component: '',
54
+ status: StatusEnum.Loading,
55
+ steps: getStep(mode),
56
+ render: true,
57
+ client: client !== 'undefined' ? client : ClientEnum.Merchant,
58
+ warn: '',
59
+ custom: other || {}
60
+ }, typeof net !== 'undefined' ? {
61
+ net: net
62
+ } : {}), typeof number !== 'undefined' ? {
63
+ number: number
64
+ } : {}), typeof pay !== 'undefined' ? {
65
+ pay: pay
66
+ } : {}), typeof device !== 'undefined' ? {
67
+ device: device
68
+ } : {});
69
+ });
70
+ export var EVisibleButtonType = /*#__PURE__*/function (EVisibleButtonType) {
71
+ EVisibleButtonType["CancelButton"] = "CancelButton";
72
+ EVisibleButtonType["WaitButton"] = "WaitButton";
73
+ return EVisibleButtonType;
74
+ }({});
75
+ export var LinklyActionStatus = /*#__PURE__*/function (LinklyActionStatus) {
76
+ LinklyActionStatus["Empty"] = "Empty";
77
+ LinklyActionStatus["Cancel"] = "Cancel";
78
+ LinklyActionStatus["CancelWaiting"] = "CancelWaiting";
79
+ LinklyActionStatus["Signature"] = "Signature";
80
+ LinklyActionStatus["SignatureWaiting"] = "SignatureWaiting";
81
+ return LinklyActionStatus;
82
+ }({});
@@ -0,0 +1,2 @@
1
+ export * from './normal';
2
+ export * from './useTimeQuery';
@@ -0,0 +1,2 @@
1
+ export * from "./normal";
2
+ export * from "./useTimeQuery";
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 支付或退款
3
+ * @param failAction 失败回调
4
+ */
5
+ export declare const useLinklyPayOrRefund: (handleCheck: () => boolean) => {
6
+ action: {
7
+ pay: import("ahooks/lib/useRequest/src/types").Result<any, [data: any]>;
8
+ };
9
+ payOrRefund: (resultQuery: any, handleLinklySuccess: any) => void;
10
+ };
11
+ /**
12
+ * @title: 取消支付或退款
13
+ * @description: 取消支付或退款调用接口后不管成功还是失败都需要调用支付查询接口
14
+ */
15
+ export declare const useLinklyCancel: (handleCheck: () => boolean) => {
16
+ action: {
17
+ cancel: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
18
+ };
19
+ linklyCancel: (resultQuery: any) => void;
20
+ };
21
+ /**
22
+ * @title: 支付或退款签名
23
+ * @description: 支付或退款签名调用接口后不管成功还是失败都需要调用支付查询接口
24
+ */
25
+ export declare const useLinklySignature: (handleCheck: () => boolean) => {
26
+ action: {
27
+ signature: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
28
+ };
29
+ linklySignature: (status: number, resultQuery: any) => void;
30
+ };