@pisell/private-materials 3.3.26 → 3.3.27

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 (205) 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 +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/Sales/Customer/index.js +3 -1
  12. package/es/components/Sales/Event/Detail.js +5 -1
  13. package/es/components/Sales/Event/serve.d.ts +3 -0
  14. package/es/components/Sales/Init/index.d.ts +1 -0
  15. package/es/components/Sales/Init/index.js +3 -2
  16. package/es/components/Sales/Step/index.d.ts +2 -0
  17. package/es/components/Sales/Step/index.js +13 -4
  18. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  19. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +5 -5
  20. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  21. package/es/components/appointmentBooking/components/Services/index.js +2 -0
  22. package/es/components/appointmentBooking/deposit/index.js +2 -2
  23. package/es/components/appointmentBooking/index.d.ts +1 -0
  24. package/es/components/booking/components/footer/utils.js +16 -15
  25. package/es/components/booking/hooks/useQuotation.d.ts +4 -0
  26. package/es/components/booking/hooks/useQuotation.js +256 -0
  27. package/es/components/booking/info/index.d.ts +0 -1
  28. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  29. package/es/components/booking/info/service/addService/index.js +4 -4
  30. package/es/components/booking/info/service/editService/index.js +6 -3
  31. package/es/components/booking/info/service/index.js +4 -1
  32. package/es/components/booking/info/service2/Group/utils.js +1 -1
  33. package/es/components/booking/info/service2/hooks/useSelectPet.js +6 -4
  34. package/es/components/booking/info/service2/index.js +4 -1
  35. package/es/components/booking/info2/service/addService/index.d.ts +1 -0
  36. package/es/components/booking/info2/service/addService/index.js +29 -9
  37. package/es/components/booking/info2/service/editService/index.js +2 -0
  38. package/es/components/booking/info2/service/index.js +4 -1
  39. package/es/components/booking/locales.d.ts +6 -0
  40. package/es/components/booking/locales.js +9 -3
  41. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  42. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  43. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  44. package/es/components/eftposPay/hooks.d.ts +1 -1
  45. package/es/components/eftposPay/index.d.ts +1 -0
  46. package/es/components/eftposPay/pay.d.ts +1 -0
  47. package/es/components/eftposPay/store/index.d.ts +1 -1
  48. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +122 -31
  49. package/es/components/eventBooking/components/Provider/Event/index.js +20 -4
  50. package/es/components/eventBooking/components/Provider/Resource/index.js +26 -5
  51. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.d.ts +2 -2
  52. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.js +1 -1
  53. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  54. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.js +5 -2
  55. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  56. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.js +7 -2
  57. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +3 -0
  58. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.js +60 -0
  59. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.less +63 -0
  60. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.d.ts +9 -0
  61. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.js +59 -0
  62. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.less +7 -0
  63. package/es/components/eventBooking/components/scheduleCalendar/index.d.ts +1 -0
  64. package/es/components/eventBooking/components/scheduleCalendar/index.js +30 -21
  65. package/es/components/eventBooking/components/scheduleCalendar/index.less +2 -0
  66. package/es/components/eventBooking/index.d.ts +1 -0
  67. package/es/components/eventBooking/index.js +2 -2
  68. package/es/components/eventBooking/locales.d.ts +6 -0
  69. package/es/components/eventBooking/locales.js +166 -160
  70. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +3 -0
  71. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.js +3 -2
  72. package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  73. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +73 -20
  74. package/es/components/pay/toC/PaymentMethods/WalletPass/index.less +30 -0
  75. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +2 -0
  76. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -1
  77. package/es/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.d.ts +16 -0
  78. package/es/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.js +60 -0
  79. package/es/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.less +38 -0
  80. package/es/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.d.ts +17 -0
  81. package/es/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.js +98 -0
  82. package/es/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.less +133 -0
  83. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +7 -0
  84. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.js +34 -0
  85. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.less +23 -0
  86. package/es/components/pay/toC/WalletPassBlock/index.d.ts +9 -2
  87. package/es/components/pay/toC/WalletPassBlock/index.js +119 -21
  88. package/es/components/pay/toC/WalletPassBlock/index.less +82 -13
  89. package/es/components/pay/toC/index.js +138 -89
  90. package/es/components/pay/toC/locales.d.ts +69 -3
  91. package/es/components/pay/toC/locales.js +132 -6
  92. package/es/components/pay/toC/model.d.ts +4 -0
  93. package/es/components/pay/toC/model.js +9 -0
  94. package/es/components/pay/toC/serve.d.ts +23 -0
  95. package/es/components/pay/toC/serve.js +34 -2
  96. package/es/components/pay/toC/utils.d.ts +3 -1
  97. package/es/components/pay/toC/utils.js +8 -3
  98. package/es/components/productSelect/components/productGroup/index.less +4 -12
  99. package/es/components/productSelect/index.less +1 -1
  100. package/es/components/ruleSetting/index.d.ts +1 -0
  101. package/es/components/ticketBooking/components/addServiceVariant/addService.js +15 -20
  102. package/es/components/ticketBooking/components/menuBar/index.less +0 -1
  103. package/es/components/ticketBooking/components/ticketBooking/index.less +2 -4
  104. package/es/hooks/useLocale.d.ts +2 -0
  105. package/es/hooks/useLocale.js +7 -0
  106. package/es/hooks/useLoginUser.d.ts +2 -0
  107. package/es/hooks/useLoginUser.js +19 -0
  108. package/lib/components/Sales/Customer/index.js +3 -1
  109. package/lib/components/Sales/Event/Detail.js +5 -1
  110. package/lib/components/Sales/Event/serve.d.ts +3 -0
  111. package/lib/components/Sales/Init/index.d.ts +1 -0
  112. package/lib/components/Sales/Init/index.js +3 -2
  113. package/lib/components/Sales/Step/index.d.ts +2 -0
  114. package/lib/components/Sales/Step/index.js +13 -4
  115. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  116. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +2 -2
  117. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  118. package/lib/components/appointmentBooking/components/Services/index.js +2 -0
  119. package/lib/components/appointmentBooking/deposit/index.js +2 -2
  120. package/lib/components/appointmentBooking/index.d.ts +1 -0
  121. package/lib/components/booking/components/footer/utils.js +5 -4
  122. package/lib/components/booking/hooks/useQuotation.d.ts +4 -0
  123. package/lib/components/booking/hooks/useQuotation.js +210 -0
  124. package/lib/components/booking/info/index.d.ts +0 -1
  125. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  126. package/lib/components/booking/info/service/addService/index.js +2 -3
  127. package/lib/components/booking/info/service/editService/index.js +5 -2
  128. package/lib/components/booking/info/service/index.js +3 -1
  129. package/lib/components/booking/info/service2/Group/utils.js +2 -2
  130. package/lib/components/booking/info/service2/hooks/useSelectPet.js +5 -3
  131. package/lib/components/booking/info/service2/index.js +3 -1
  132. package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
  133. package/lib/components/booking/info2/service/addService/index.js +25 -17
  134. package/lib/components/booking/info2/service/editService/index.js +2 -1
  135. package/lib/components/booking/info2/service/index.js +3 -1
  136. package/lib/components/booking/locales.d.ts +6 -0
  137. package/lib/components/booking/locales.js +9 -3
  138. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  139. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  140. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  141. package/lib/components/eftposPay/hooks.d.ts +1 -1
  142. package/lib/components/eftposPay/index.d.ts +1 -0
  143. package/lib/components/eftposPay/pay.d.ts +1 -0
  144. package/lib/components/eftposPay/store/index.d.ts +1 -1
  145. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +52 -4
  146. package/lib/components/eventBooking/components/Provider/Event/index.js +15 -3
  147. package/lib/components/eventBooking/components/Provider/Resource/index.js +16 -3
  148. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.d.ts +2 -2
  149. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.js +7 -7
  150. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  151. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.js +3 -1
  152. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  153. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.js +6 -5
  154. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +3 -0
  155. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.js +75 -0
  156. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.less +63 -0
  157. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.d.ts +9 -0
  158. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.js +64 -0
  159. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.less +7 -0
  160. package/lib/components/eventBooking/components/scheduleCalendar/index.d.ts +1 -0
  161. package/lib/components/eventBooking/components/scheduleCalendar/index.js +17 -11
  162. package/lib/components/eventBooking/components/scheduleCalendar/index.less +2 -0
  163. package/lib/components/eventBooking/index.d.ts +1 -0
  164. package/lib/components/eventBooking/index.js +2 -2
  165. package/lib/components/eventBooking/locales.d.ts +6 -0
  166. package/lib/components/eventBooking/locales.js +10 -4
  167. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +3 -0
  168. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.js +2 -2
  169. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  170. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +52 -11
  171. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.less +30 -0
  172. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +2 -0
  173. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -1
  174. package/lib/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.d.ts +16 -0
  175. package/lib/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.js +87 -0
  176. package/lib/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.less +38 -0
  177. package/lib/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.d.ts +17 -0
  178. package/lib/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.js +103 -0
  179. package/lib/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.less +133 -0
  180. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +7 -0
  181. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.js +52 -0
  182. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.less +23 -0
  183. package/lib/components/pay/toC/WalletPassBlock/index.d.ts +9 -2
  184. package/lib/components/pay/toC/WalletPassBlock/index.js +115 -20
  185. package/lib/components/pay/toC/WalletPassBlock/index.less +82 -13
  186. package/lib/components/pay/toC/index.js +35 -9
  187. package/lib/components/pay/toC/locales.d.ts +69 -3
  188. package/lib/components/pay/toC/locales.js +72 -6
  189. package/lib/components/pay/toC/model.d.ts +4 -0
  190. package/lib/components/pay/toC/model.js +10 -0
  191. package/lib/components/pay/toC/serve.d.ts +23 -0
  192. package/lib/components/pay/toC/serve.js +12 -6
  193. package/lib/components/pay/toC/utils.d.ts +3 -1
  194. package/lib/components/pay/toC/utils.js +8 -3
  195. package/lib/components/productSelect/components/productGroup/index.less +4 -12
  196. package/lib/components/productSelect/index.less +1 -1
  197. package/lib/components/ruleSetting/index.d.ts +1 -0
  198. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +13 -16
  199. package/lib/components/ticketBooking/components/menuBar/index.less +0 -1
  200. package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -4
  201. package/lib/hooks/useLocale.d.ts +2 -0
  202. package/lib/hooks/useLocale.js +41 -0
  203. package/lib/hooks/useLoginUser.d.ts +2 -0
  204. package/lib/hooks/useLoginUser.js +50 -0
  205. package/package.json +3 -3
@@ -0,0 +1,23 @@
1
+ .toc-pay-wallet-use-list {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 6px;
5
+ .toc-pay-wallet-use-list-item {
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: space-between;
9
+ color: var(--sds-color-border-default-secondary);
10
+ font-size: 12px;
11
+ font-weight: 400;
12
+ line-height: 20px;
13
+ .toc-pay-wallet-use-list-item-icon {
14
+ font-size: 20px;
15
+ color: #667085;
16
+ }
17
+ .toc-pay-wallet-use-list-item-name {
18
+ display: flex;
19
+ align-items: center;
20
+ gap: 8px;
21
+ }
22
+ }
23
+ }
@@ -9,6 +9,13 @@ export interface WalletPassBlockProps extends React.HTMLAttributes<HTMLDivElemen
9
9
  amount: number;
10
10
  }) => void;
11
11
  customer_id?: number;
12
+ walletSetting: {
13
+ name: string;
14
+ popup_status: 0 | 1;
15
+ };
12
16
  }
13
- declare const WalletPassBlock: (props: WalletPassBlockProps) => JSX.Element;
14
- export default WalletPassBlock;
17
+ export interface WalletPassBlockRef {
18
+ open: () => void;
19
+ }
20
+ declare const _default: React.ForwardRefExoticComponent<WalletPassBlockProps & React.RefAttributes<WalletPassBlockRef>>;
21
+ export default _default;
@@ -1,46 +1,91 @@
1
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 = ["className", "payGroup", "onWalletPassChange", "customer_id"];
2
+ var _excluded = ["className", "payGroup", "onWalletPassChange", "customer_id", "walletSetting"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  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; }
5
5
  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; }
6
6
  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; }
7
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
8
  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); }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ 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; }
13
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
15
  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; }
10
16
  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; }
11
- import React, { useMemo, useRef } from 'react';
12
- import { PisellRow, Iconfont, PisellText, Button } from '@pisell/materials';
17
+ import React, { useMemo, useRef, forwardRef, useImperativeHandle, useState, useEffect } from 'react';
18
+ import { PisellRow, Iconfont, PisellText, Button, Icon } from '@pisell/materials';
13
19
  import classNames from 'classnames';
14
20
  import { locales } from '@pisell/utils';
15
21
  import WalletPass from "../PaymentMethods/WalletPass";
22
+ import WalletAvailable from "./components/WalletAvailable";
23
+ import WalletBestValueFound from "./components/WalletBestValueFound";
24
+ import WalletUseList from "./components/WalletUseList";
16
25
  import "./index.less";
17
- var WalletPassBlock = function WalletPassBlock(props) {
18
- var _payGroup$walletPass4;
26
+ import { CaretRightOutlined } from '@ant-design/icons';
27
+ var WalletPassBlock = function WalletPassBlock(props, ref) {
28
+ var _payGroup$walletPass, _payGroup$walletPass4, _payGroup$walletPass5, _payGroup$walletPass6, _payGroup$walletPass7;
19
29
  var className = props.className,
20
30
  payGroup = props.payGroup,
21
31
  onWalletPassChange = props.onWalletPassChange,
22
32
  customer_id = props.customer_id,
33
+ walletSetting = props.walletSetting,
23
34
  others = _objectWithoutProperties(props, _excluded);
24
35
  var walletPassRef = useRef(null);
36
+ var walletAvailableRef = useRef(null);
37
+ var walletBestValueFoundRef = useRef(null);
38
+ var _useState = useState(false),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ isViewDetail = _useState2[0],
41
+ setIsViewDetail = _useState2[1];
42
+ var contentRef = useRef(null);
43
+ var _useState3 = useState(0),
44
+ _useState4 = _slicedToArray(_useState3, 2),
45
+ contentHeight = _useState4[0],
46
+ setContentHeight = _useState4[1];
47
+ useEffect(function () {
48
+ if (contentRef.current) {
49
+ var scrollHeight = contentRef.current.scrollHeight;
50
+ setContentHeight(isViewDetail ? scrollHeight : 0);
51
+ }
52
+ }, [isViewDetail, payGroup === null || payGroup === void 0 || (_payGroup$walletPass = payGroup.walletPass) === null || _payGroup$walletPass === void 0 ? void 0 : _payGroup$walletPass.cards]);
25
53
  var handleClick = function handleClick() {
26
54
  var _walletPassRef$curren;
55
+ setIsViewDetail(false);
27
56
  (_walletPassRef$curren = walletPassRef.current) === null || _walletPassRef$curren === void 0 || _walletPassRef$curren.init(_objectSpread(_objectSpread({}, payGroup), {}, {
28
57
  customer_id: customer_id
29
58
  }));
30
59
  };
31
- var centerContentDesc = useMemo(function () {
32
- var _payGroup$walletPass, _payGroup$walletPass2;
33
- // 没有钱包金额或为0
34
- if (!(payGroup !== null && payGroup !== void 0 && (_payGroup$walletPass = payGroup.walletPass) !== null && _payGroup$walletPass !== void 0 && _payGroup$walletPass.amount) || (payGroup === null || payGroup === void 0 || (_payGroup$walletPass2 = payGroup.walletPass) === null || _payGroup$walletPass2 === void 0 ? void 0 : _payGroup$walletPass2.amount) == 0) {
35
- return locales.getText('tocPay.text.walletCanPay');
36
- } else {
37
- var _payGroup$walletPass3;
38
- return /*#__PURE__*/React.createElement(React.Fragment, null, locales.getText('tocPay.text.congrats'), ' ', /*#__PURE__*/React.createElement(PisellText.Amount, {
39
- value: payGroup === null || payGroup === void 0 || (_payGroup$walletPass3 = payGroup.walletPass) === null || _payGroup$walletPass3 === void 0 ? void 0 : _payGroup$walletPass3.amount,
40
- className: "price"
41
- }), ' ', locales.getText('tocPay.text.creditHaveBeen'));
42
- }
60
+
61
+ // 没有钱包金额或为0
62
+ var hasNoWalletPassAmount = useMemo(function () {
63
+ var _payGroup$walletPass2, _payGroup$walletPass3;
64
+ return !(payGroup !== null && payGroup !== void 0 && (_payGroup$walletPass2 = payGroup.walletPass) !== null && _payGroup$walletPass2 !== void 0 && _payGroup$walletPass2.amount) || (payGroup === null || payGroup === void 0 || (_payGroup$walletPass3 = payGroup.walletPass) === null || _payGroup$walletPass3 === void 0 ? void 0 : _payGroup$walletPass3.amount) == 0;
43
65
  }, [payGroup === null || payGroup === void 0 || (_payGroup$walletPass4 = payGroup.walletPass) === null || _payGroup$walletPass4 === void 0 ? void 0 : _payGroup$walletPass4.amount]);
66
+ useImperativeHandle(ref, function () {
67
+ return {
68
+ open: function open() {
69
+ if (hasNoWalletPassAmount) {
70
+ var _walletAvailableRef$c;
71
+ (_walletAvailableRef$c = walletAvailableRef.current) === null || _walletAvailableRef$c === void 0 || _walletAvailableRef$c.open();
72
+ } else {
73
+ var _walletBestValueFound;
74
+ (_walletBestValueFound = walletBestValueFoundRef.current) === null || _walletBestValueFound === void 0 || _walletBestValueFound.open();
75
+ }
76
+ }
77
+ };
78
+ });
79
+ var handleViewDetail = function handleViewDetail(e) {
80
+ e.stopPropagation();
81
+ setIsViewDetail(!isViewDetail);
82
+ };
83
+ var handleUnused = function handleUnused() {
84
+ onWalletPassChange === null || onWalletPassChange === void 0 || onWalletPassChange({
85
+ cards: [],
86
+ amount: 0
87
+ });
88
+ };
44
89
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({}, others, {
45
90
  className: classNames('wallet-pass-wrap', className)
46
91
  }), /*#__PURE__*/React.createElement("div", {
@@ -49,16 +94,57 @@ var WalletPassBlock = function WalletPassBlock(props) {
49
94
  className: "wallet-pass-card",
50
95
  centerContent: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
51
96
  className: "wallet-pass-card-title"
52
- }, locales.getText('tocPay.text.walletPass')), /*#__PURE__*/React.createElement("div", {
97
+ }, /*#__PURE__*/React.createElement("div", {
98
+ className: "wallet-pass-card-title-left"
99
+ }, /*#__PURE__*/React.createElement(Icon, {
100
+ type: "pisell2-a-wallet-021",
101
+ className: "wallet-pass-card-title-left-icon"
102
+ }), walletSetting.name), walletSetting.popup_status === 1 && /*#__PURE__*/React.createElement("div", {
103
+ className: "wallet-pass-card-title-right"
104
+ }, /*#__PURE__*/React.createElement("span", {
105
+ className: "wallet-pass-card-title-right-amount"
106
+ }, "-", /*#__PURE__*/React.createElement(PisellText.Amount, {
107
+ value: payGroup === null || payGroup === void 0 || (_payGroup$walletPass5 = payGroup.walletPass) === null || _payGroup$walletPass5 === void 0 ? void 0 : _payGroup$walletPass5.amount
108
+ })), /*#__PURE__*/React.createElement(CaretRightOutlined, {
109
+ className: "wallet-pass-card-title-right-icon"
110
+ }))), walletSetting.popup_status === 0 && /*#__PURE__*/React.createElement("div", {
111
+ className: "wallet-pass-card-desc-wrap"
112
+ }, /*#__PURE__*/React.createElement("div", {
53
113
  className: "wallet-pass-card-desc"
54
- }, centerContentDesc), /*#__PURE__*/React.createElement(Button, {
114
+ }, hasNoWalletPassAmount ? locales.getText('tocPay.text.hasNoWalletPassAmount') : locales.getText('tocPay.text.bestValueFound')), !hasNoWalletPassAmount && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
115
+ className: "wallet-pass-card-total-savings"
116
+ }, /*#__PURE__*/React.createElement("div", {
117
+ className: "wallet-pass-card-total-savings-title"
118
+ }, /*#__PURE__*/React.createElement("span", {
119
+ className: "wallet-pass-card-total-savings-title-left"
120
+ }, locales.getText('tocPay.text.totalSavings'), ":", /*#__PURE__*/React.createElement(PisellText.Amount, {
121
+ value: payGroup === null || payGroup === void 0 || (_payGroup$walletPass6 = payGroup.walletPass) === null || _payGroup$walletPass6 === void 0 ? void 0 : _payGroup$walletPass6.amount
122
+ })), /*#__PURE__*/React.createElement("span", {
123
+ className: "wallet-pass-card-total-savings-title-right",
124
+ onClick: handleViewDetail
125
+ }, locales.getText('tocPay.text.viewDetail'), /*#__PURE__*/React.createElement(Icon, {
126
+ type: "pisell2-chevron-down",
127
+ className: classNames('wallet-pass-card-total-savings-title-right-icon', {
128
+ 'is-rotate': isViewDetail
129
+ })
130
+ }))), /*#__PURE__*/React.createElement("div", {
131
+ ref: contentRef,
132
+ className: "wallet-pass-card-total-savings-desc",
133
+ style: {
134
+ height: contentHeight
135
+ }
136
+ }, /*#__PURE__*/React.createElement(WalletUseList, {
137
+ walletPass: (payGroup === null || payGroup === void 0 || (_payGroup$walletPass7 = payGroup.walletPass) === null || _payGroup$walletPass7 === void 0 ? void 0 : _payGroup$walletPass7.cards) || []
138
+ })))), /*#__PURE__*/React.createElement(Button, {
55
139
  size: "large",
56
140
  className: "wallet-pass-card-to-use",
141
+ type: "primary",
142
+ block: true,
57
143
  rightIcon: /*#__PURE__*/React.createElement(Iconfont, {
58
144
  type: "pisell2-arrow-right",
59
145
  className: "wallet-pass-card-icon"
60
146
  })
61
- }, locales.getText('tocPay.text.toUse')))
147
+ }, locales.getText(hasNoWalletPassAmount ? 'tocPay.text.useWalletPass' : 'tocPay.text.editWalletPass')(walletSetting.name))))
62
148
  // rightContent={
63
149
  // <Iconfont
64
150
  // type="pisell2-chevron-right"
@@ -75,8 +161,20 @@ var WalletPassBlock = function WalletPassBlock(props) {
75
161
  className: "wallet-pass-card-complete-no-extre-pay"
76
162
  }, locales.getText('tocPay.text.walletPassNoExtraPay')))), /*#__PURE__*/React.createElement(WalletPass, {
77
163
  ref: walletPassRef,
164
+ walletSetting: walletSetting,
78
165
  onWalletPassChange: onWalletPassChange,
79
166
  walletPass: payGroup === null || payGroup === void 0 ? void 0 : payGroup.walletPass
167
+ }), /*#__PURE__*/React.createElement(WalletAvailable, {
168
+ ref: walletAvailableRef,
169
+ walletSetting: walletSetting,
170
+ payGroup: payGroup,
171
+ onOk: handleClick
172
+ }), /*#__PURE__*/React.createElement(WalletBestValueFound, {
173
+ ref: walletBestValueFoundRef,
174
+ walletSetting: walletSetting,
175
+ payGroup: payGroup,
176
+ onEdit: handleClick,
177
+ onUnused: handleUnused
80
178
  }));
81
179
  };
82
- export default WalletPassBlock;
180
+ export default /*#__PURE__*/forwardRef(WalletPassBlock);
@@ -4,11 +4,12 @@
4
4
  margin-top: 8px;
5
5
  .wallet-pass-card-icon {
6
6
  font-size: 20px;
7
- color: #344054;
7
+ color: #fff;
8
8
  }
9
9
  & > span {
10
10
  display: flex;
11
11
  align-items: center;
12
+ justify-content: center;
12
13
  }
13
14
  }
14
15
 
@@ -23,27 +24,45 @@
23
24
  .wallet-pass-card {
24
25
  margin-top: 20px;
25
26
  border-radius: 12px;
26
- border: 1px solid var(--Gray-400, #98A2B3);
27
- background: var(--Base-White, #FFF);
27
+ border: 1px solid var(--Gray-400, #98a2b3);
28
+ background: var(--Base-White, #fff);
29
+ .pisell-row-center {
30
+ width: 100%;
31
+ }
28
32
 
29
33
  .wallet-pass-card-title {
34
+ display: flex;
35
+ justify-content: space-between;
30
36
  color: var(--Gray-900, #101828);
31
37
  font-size: 16px;
32
- font-style: normal;
33
38
  font-weight: 600;
34
39
  line-height: 20px;
40
+ gap: 6px;
41
+ .wallet-pass-card-title-left {
42
+ display: flex;
43
+ align-items: center;
44
+ gap: 6px;
45
+ .wallet-pass-card-title-left-icon {
46
+ font-size: 22px;
47
+ }
48
+ }
49
+ .wallet-pass-card-title-right {
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 6px;
53
+ flex-shrink: 0;
54
+ .wallet-pass-card-title-right-icon {
55
+ font-size: 14px;
56
+ }
57
+ }
35
58
  }
36
59
 
37
60
  .wallet-pass-card-desc {
38
- color: var(--Gray-600, #101828);
61
+ color: #757575;
39
62
  font-size: 14px;
40
- font-style: normal;
41
- font-weight: 400;
42
- line-height: 20px;
43
-
44
- .price {
45
- color: var(--theme-color, #7F56D9);
46
- }
63
+ font-weight: 500;
64
+ line-height: 20px; /* 142.857% */
65
+ margin: 4px 0 0;
47
66
  }
48
67
 
49
68
  //.wallet-pass-card-icon {
@@ -73,4 +92,54 @@
73
92
  line-height: 24px;
74
93
  /* 150% */
75
94
  }
76
- }
95
+
96
+ .wallet-pass-card-desc-wrap {
97
+ .wallet-pass-card-total-savings {
98
+ .wallet-pass-card-total-savings-title {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: space-between;
102
+ .wallet-pass-card-total-savings-title-left {
103
+ color: #009951;
104
+ font-size: 16px;
105
+ font-weight: 600;
106
+ line-height: 28px; /* 175% */
107
+ }
108
+ .wallet-pass-card-total-savings-title-right {
109
+ display: flex;
110
+ align-items: center;
111
+ gap: 4px;
112
+ color: #757575;
113
+ font-size: 12px;
114
+ font-weight: 400;
115
+ line-height: 20px; /* 166.667% */
116
+ padding: 7px 0 7px 0px;
117
+ .wallet-pass-card-total-savings-title-right-icon {
118
+ font-size: 18px;
119
+ color: #344054;
120
+ transition: transform 0.3s ease;
121
+
122
+ &.is-rotate {
123
+ transform: rotate(180deg);
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ .wallet-pass-card-total-savings-desc {
130
+ overflow: hidden;
131
+ opacity: 0;
132
+ transition: all 0.3s ease-in-out;
133
+ will-change: height, opacity;
134
+
135
+ &[style*="height: 0"] {
136
+ opacity: 0;
137
+ }
138
+
139
+ &:not([style*="height: 0"]) {
140
+ opacity: 1;
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }