@pisell/private-materials 6.3.16 → 6.3.18

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 (179) 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 +150 -150
  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 +8 -8
  11. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  12. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  13. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  14. package/es/components/booking/info/service/like/index.d.ts +1 -0
  15. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  16. package/es/components/eftpos/group/index.d.ts +1 -0
  17. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  18. package/es/components/eftpos/icon/device.d.ts +1 -0
  19. package/es/components/eftpos/receipt/index.d.ts +1 -0
  20. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  21. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  22. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  23. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  24. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  25. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  26. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  27. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  28. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  29. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  30. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  31. package/es/components/index.d.ts +3 -1
  32. package/es/components/index.js +3 -1
  33. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  34. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  35. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  36. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  37. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  38. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  39. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  40. package/es/components/pay/toC/utils.js +1 -1
  41. package/es/components/pinModal/hooks.d.ts +7 -0
  42. package/es/components/pinModal/hooks.js +65 -0
  43. package/{lib/components/booking/info/service/editService → es/components/pinModal}/index.d.ts +0 -3
  44. package/es/components/pinModal/index.js +98 -0
  45. package/es/components/pinModal/index.less +44 -0
  46. package/es/components/pinModal/locales.d.ts +27 -0
  47. package/es/components/pinModal/locales.js +26 -0
  48. package/es/components/pinModal/serve.d.ts +6 -0
  49. package/es/components/pinModal/serve.js +11 -0
  50. package/es/components/pinModal/types.d.ts +0 -0
  51. package/es/components/pinModal/types.js +0 -0
  52. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  53. package/es/components/pinVerifyModal/hooks.js +80 -0
  54. package/es/components/pinVerifyModal/index.d.ts +5 -0
  55. package/es/components/pinVerifyModal/index.js +218 -0
  56. package/es/components/pinVerifyModal/index.less +92 -0
  57. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  58. package/es/components/pinVerifyModal/locales.js +23 -0
  59. package/es/components/pinVerifyModal/types.d.ts +33 -0
  60. package/es/components/pinVerifyModal/types.js +1 -0
  61. package/es/components/schedules/utils.d.ts +1 -1
  62. package/es/components/walletList/index.js +20 -2
  63. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  64. package/es/index.d.ts +2 -0
  65. package/es/index.js +3 -1
  66. package/es/utils/index.d.ts +1 -1
  67. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  68. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  69. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  70. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  71. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  72. package/lib/components/eftpos/group/index.d.ts +1 -0
  73. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  74. package/lib/components/eftpos/icon/device.d.ts +1 -0
  75. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  76. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  77. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  78. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  79. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  80. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  81. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  82. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  83. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  84. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  85. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  86. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  87. package/lib/components/index.d.ts +3 -1
  88. package/lib/components/index.js +6 -0
  89. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  90. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  91. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  92. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  93. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  94. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  95. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  96. package/lib/components/pay/toC/utils.js +1 -1
  97. package/lib/components/pinModal/hooks.d.ts +7 -0
  98. package/lib/components/pinModal/hooks.js +85 -0
  99. package/{es/components/booking/info/service/editService → lib/components/pinModal}/index.d.ts +0 -3
  100. package/lib/components/pinModal/index.js +88 -0
  101. package/lib/components/pinModal/index.less +44 -0
  102. package/lib/components/pinModal/locales.d.ts +27 -0
  103. package/lib/components/pinModal/locales.js +50 -0
  104. package/lib/components/pinModal/serve.d.ts +6 -0
  105. package/lib/components/pinModal/serve.js +37 -0
  106. package/lib/components/pinModal/types.d.ts +0 -0
  107. package/lib/components/pinModal/types.js +0 -0
  108. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  109. package/lib/components/pinVerifyModal/hooks.js +93 -0
  110. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  111. package/lib/components/pinVerifyModal/index.js +230 -0
  112. package/lib/components/pinVerifyModal/index.less +92 -0
  113. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  114. package/lib/components/pinVerifyModal/locales.js +47 -0
  115. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  116. package/lib/components/pinVerifyModal/types.js +17 -0
  117. package/lib/components/schedules/utils.d.ts +1 -1
  118. package/lib/components/walletList/index.js +19 -2
  119. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  120. package/lib/index.d.ts +2 -0
  121. package/lib/index.js +6 -0
  122. package/lib/utils/index.d.ts +1 -1
  123. package/lowcode/pin-modal/meta.ts +37 -0
  124. package/lowcode/pin-verify-modal/meta.ts +80 -0
  125. package/package.json +3 -3
  126. package/es/components/appointmentBooking/components/Services/index.d.ts +0 -4
  127. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  128. package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -8
  129. package/es/components/booking/components/voucher/index.d.ts +0 -3
  130. package/es/components/booking/info/service/editService/constants.d.ts +0 -1
  131. package/es/components/booking/info2/index.d.ts +0 -12
  132. package/es/components/booking/info2/service/addService/index.d.ts +0 -11
  133. package/es/components/booking/locales.d.ts +0 -831
  134. package/es/components/booking/model.d.ts +0 -116
  135. package/es/components/pay/toC/PaymentMethods/ApplePay/index.d.ts +0 -10
  136. package/es/components/pay/toC/PaymentMethods/BankDeposit/index.d.ts +0 -10
  137. package/es/components/pay/toC/PaymentMethods/CashManual/index.d.ts +0 -10
  138. package/es/components/pay/toC/PaymentMethods/CustomPayment/index.d.ts +0 -10
  139. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
  140. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
  141. package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.d.ts +0 -10
  142. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
  143. package/es/components/pay/toC/PaymentMethods/GooglePay/index.d.ts +0 -9
  144. package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.d.ts +0 -10
  145. package/es/components/pay/toC/PaymentMethods/StripePay/index.d.ts +0 -10
  146. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
  147. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
  148. package/es/components/pay/toC/PaymentMethods/index.d.ts +0 -9
  149. package/es/components/pay/toC/index.d.ts +0 -3
  150. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -9
  151. package/es/components/ticketBooking/index.d.ts +0 -7
  152. package/es/hooks/usePaymentLogger.d.ts +0 -22
  153. package/lib/components/appointmentBooking/components/Services/index.d.ts +0 -4
  154. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  155. package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -8
  156. package/lib/components/booking/components/voucher/index.d.ts +0 -3
  157. package/lib/components/booking/info/service/editService/constants.d.ts +0 -1
  158. package/lib/components/booking/info2/index.d.ts +0 -12
  159. package/lib/components/booking/info2/service/addService/index.d.ts +0 -11
  160. package/lib/components/booking/locales.d.ts +0 -831
  161. package/lib/components/booking/model.d.ts +0 -116
  162. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.d.ts +0 -10
  163. package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.d.ts +0 -10
  164. package/lib/components/pay/toC/PaymentMethods/CashManual/index.d.ts +0 -10
  165. package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.d.ts +0 -10
  166. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
  167. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
  168. package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.d.ts +0 -10
  169. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
  170. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.d.ts +0 -9
  171. package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.d.ts +0 -10
  172. package/lib/components/pay/toC/PaymentMethods/StripePay/index.d.ts +0 -10
  173. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
  174. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
  175. package/lib/components/pay/toC/PaymentMethods/index.d.ts +0 -9
  176. package/lib/components/pay/toC/index.d.ts +0 -3
  177. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -9
  178. package/lib/components/ticketBooking/index.d.ts +0 -7
  179. package/lib/hooks/usePaymentLogger.d.ts +0 -22
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const GuestOptionsModal: (props: any) => JSX.Element;
3
4
  export default GuestOptionsModal;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const FormItemChildrenWrap: (props: any) => JSX.Element;
2
3
  export default FormItemChildrenWrap;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
2
3
  export default useIsLowSpeedNetwork;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const Like: ({ status, onChange, className, style, }: {
3
4
  style?: any;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ input, ...formItemProps }: any) => JSX.Element;
2
3
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { RadioGroupProps } from 'antd';
2
3
  export declare const CheckboxGroup: ({ direction, options, ...props }: any) => JSX.Element;
3
4
  export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ color }: {
2
3
  color?: string | undefined;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ color }: {
2
3
  color?: string | undefined;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 自定义组件设置
3
4
  * @description: 自定义组件设置
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: () => JSX.Element;
2
3
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './titlebar.less';
2
3
  declare enum EPopupTitleBarVariantType {
3
4
  BackTitleClose = "back-title-cancel",
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { StatusType } from '../../const';
2
3
  declare const _default: (props: {
3
4
  status: StatusType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: (props: {
2
3
  status: string;
3
4
  pedding?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 获取 Tyro 资源
3
4
  * @description:
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ErrorTip: ({ text }: any) => JSX.Element;
3
4
  export default ErrorTip;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const InformationOptionsModal: (props: any) => JSX.Element;
3
4
  export default InformationOptionsModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const WeekItem: (props: any) => JSX.Element;
3
4
  export default WeekItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare type CalenDateWeekProps = {
3
4
  currentDate: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const DayItem: (props: any) => JSX.Element;
3
4
  export default DayItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  import { CalendarItemProps } from '../../../../../type';
3
4
  declare const Item: (props: CalendarItemProps) => JSX.Element;
@@ -17,4 +17,6 @@ import PisellSelectCustomerModal from './pisellSelectCustomerModal';
17
17
  import SubTotal from './subTotal';
18
18
  import EditBookingModal from './booking/editBookingModal';
19
19
  import StepController from './stepController';
20
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController };
20
+ import PinModal from './pinModal';
21
+ import PinVerifyModal from './pinVerifyModal';
22
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, };
@@ -17,4 +17,6 @@ import PisellSelectCustomerModal from "./pisellSelectCustomerModal";
17
17
  import SubTotal from "./subTotal";
18
18
  import EditBookingModal from "./booking/editBookingModal";
19
19
  import StepController from "./stepController";
20
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController };
20
+ import PinModal from "./pinModal";
21
+ import PinVerifyModal from "./pinVerifyModal";
22
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const SetupForm: ({ onReady, amount, order_id, payment_method, scene, }: any) => JSX.Element;
3
4
  export default SetupForm;
@@ -11,6 +11,8 @@ export interface WalletPassListProps {
11
11
  name: string;
12
12
  };
13
13
  onChangeDebounce?: boolean;
14
+ loading?: boolean;
15
+ onLoadingChange?: (loading: boolean) => void;
14
16
  }
15
17
  export declare type WalletPassListRef = {
16
18
  init: (params: MachineCodeListParams, formatList?: (val: WalletPassDataType[]) => WalletPassDataType[]) => void;
@@ -22,18 +22,22 @@ import { PisellModal, PisellText, PisellToast } from '@pisell/materials';
22
22
  import { locales, uniqueByKey } from '@pisell/utils';
23
23
  import { useMemoizedFn } from 'ahooks';
24
24
  import { InfoCircleOutlined } from '@ant-design/icons';
25
+ import PinVerifyModal from "../../../../pinVerifyModal";
25
26
  import MultiModeSearch from "./MultiModeSearch";
26
27
  import List from "./List";
27
- import { searchMachineCodeList } from "./serve";
28
- import { formatMachineCodeServer2CardList } from "./utils";
28
+ import { searchMachineCodeList, searchWalletCode } from "./serve";
29
+ import { formatMachineCodeServer2CardList, getIsWalletCode } from "./utils";
29
30
  import { calcWalletPassListAmount, formatWalletPassList2PreparePayments } from "../../utils";
30
31
  import "./index.less";
32
+ import useEngineContext from "../../../../../hooks/useEngineContext";
31
33
  var Amount = PisellText.Amount;
32
34
  var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
33
- var _searchSelectData$ids;
35
+ var _context$appHelper, _context$appHelper$ge, _searchSelectData$ids;
34
36
  var onWalletPassChange = props.onWalletPassChange,
35
37
  walletPass = props.walletPass,
36
38
  walletSetting = props.walletSetting;
39
+ var context = useEngineContext();
40
+ var isWalletCode = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.businessUtils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getAppByModal) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper, 'wallet');
37
41
 
38
42
  /** 当前 walletPass信息 弹窗操作时都在内部进行,点击 redeem时同步到外层 */
39
43
  var _useState = useState(walletPass),
@@ -87,7 +91,8 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
87
91
  var listRef = useRef(null);
88
92
 
89
93
  /** 当前搜索框搜索值 */
90
- var searchValRef = useRef('');
94
+ var searchValRef = useRef(null);
95
+ var pinVerifyModalRef = useRef(null);
91
96
  var _ref = currentWalletPass || {},
92
97
  walletPassSelectCards = _ref.cards,
93
98
  amount = _ref.amount;
@@ -207,30 +212,33 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
207
212
  * @param val
208
213
  */
209
214
  var searchList = /*#__PURE__*/function () {
210
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(val, isSelectChange) {
211
- var _order$_order2;
212
- var result;
215
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3, isSelectChange) {
216
+ var code, customer_pin_key, _order$_order2, result;
213
217
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
214
218
  while (1) switch (_context2.prev = _context2.next) {
215
219
  case 0:
220
+ code = _ref3.code, customer_pin_key = _ref3.customer_pin_key;
216
221
  if (order !== null && order !== void 0 && order.order_id) {
217
- _context2.next = 2;
222
+ _context2.next = 3;
218
223
  break;
219
224
  }
220
225
  return _context2.abrupt("return");
221
- case 2:
222
- _context2.next = 4;
226
+ case 3:
227
+ setLoading(true);
228
+ _context2.prev = 4;
229
+ _context2.next = 7;
223
230
  return searchMachineCodeList({
224
231
  order_id: order.order_id,
225
- code: val,
232
+ code: code,
226
233
  prepare_payments: prepare_payments,
227
- filter_prepare_wallet_pass: 1,
228
- sale_channel: ((_order$_order2 = order._order) === null || _order$_order2 === void 0 ? void 0 : _order$_order2.sale_channel) || 'online-store'
234
+ // filter_prepare_wallet_pass: 1,
235
+ sale_channel: ((_order$_order2 = order._order) === null || _order$_order2 === void 0 ? void 0 : _order$_order2.sale_channel) || 'online-store',
236
+ customer_pin_key: customer_pin_key
229
237
  });
230
- case 4:
238
+ case 7:
231
239
  result = _context2.sent;
232
240
  if (result) {
233
- _context2.next = 8;
241
+ _context2.next = 11;
234
242
  break;
235
243
  }
236
244
  if (!isSelectChange) {
@@ -239,7 +247,13 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
239
247
  });
240
248
  }
241
249
  return _context2.abrupt("return");
242
- case 8:
250
+ case 11:
251
+ if (!(isSelectChange && !searchValRef.current)) {
252
+ _context2.next = 13;
253
+ break;
254
+ }
255
+ return _context2.abrupt("return");
256
+ case 13:
243
257
  setSearchData(formatMachineCodeServer2CardList([].concat(_toConsumableArray(searchSelectData.details), _toConsumableArray(result)), searchSelectData.ids));
244
258
  if (result.length) {
245
259
  // 如果搜索结果只有一个并且可用,则直接选中
@@ -250,22 +264,88 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
250
264
  });
251
265
  }
252
266
  setSearchOpen(true);
253
- searchValRef.current = val;
267
+ searchValRef.current = {
268
+ code: code,
269
+ customer_pin_key: customer_pin_key
270
+ };
254
271
  }
255
- case 10:
272
+ case 15:
273
+ _context2.prev = 15;
274
+ setLoading(false);
275
+ return _context2.finish(15);
276
+ case 18:
256
277
  case "end":
257
278
  return _context2.stop();
258
279
  }
259
- }, _callee2);
280
+ }, _callee2, null, [[4,, 15, 18]]);
260
281
  }));
261
282
  return function searchList(_x2, _x3) {
262
- return _ref3.apply(this, arguments);
283
+ return _ref4.apply(this, arguments);
284
+ };
285
+ }();
286
+ var searchWalletCodeFn = /*#__PURE__*/function () {
287
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(val) {
288
+ var _pinVerifyModalRef$cu, result;
289
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
290
+ while (1) switch (_context3.prev = _context3.next) {
291
+ case 0:
292
+ setLoading(true);
293
+ _context3.prev = 1;
294
+ _context3.next = 4;
295
+ return searchWalletCode({
296
+ code: val,
297
+ with_customer: 1
298
+ });
299
+ case 4:
300
+ result = _context3.sent;
301
+ console.log(result, 'result');
302
+ // 如果搜索不到wallet code则走原始搜索逻辑
303
+ if (result) {
304
+ _context3.next = 9;
305
+ break;
306
+ }
307
+ searchList({
308
+ code: val
309
+ });
310
+ return _context3.abrupt("return");
311
+ case 9:
312
+ (_pinVerifyModalRef$cu = pinVerifyModalRef.current) === null || _pinVerifyModalRef$cu === void 0 || _pinVerifyModalRef$cu.open({
313
+ wallet_code: result.code,
314
+ wallet_detail_id: result.id,
315
+ failed_count: result.failed_count,
316
+ check_max_count: result.check_max_count,
317
+ customer: result.customer
318
+ });
319
+ // const pin = await getPin({ wallet_detail_id: result.id });
320
+ // const pinResult = await verifyPinCode({ wallet_detail_id: result.id, pin: pin.pin });
321
+ // searchList({ customer_pin_key: pinResult.customer_pin_key });
322
+ // console.log(pinResult, 'pinResult');
323
+ case 10:
324
+ _context3.prev = 10;
325
+ setLoading(false);
326
+ return _context3.finish(10);
327
+ case 13:
328
+ case "end":
329
+ return _context3.stop();
330
+ }
331
+ }, _callee3, null, [[1,, 10, 13]]);
332
+ }));
333
+ return function searchWalletCodeFn(_x4) {
334
+ return _ref5.apply(this, arguments);
263
335
  };
264
336
  }();
265
337
  var handleSearch = useMemoizedFn(function (val) {
266
338
  if (!val || searchOpen) return;
267
339
  isAutoSelect.current = true;
268
- searchList(val);
340
+
341
+ // 如果是wallet code 并且安装wallet应用 则搜索wallet code
342
+ if (getIsWalletCode(val) && isWalletCode) {
343
+ searchWalletCodeFn(val);
344
+ } else {
345
+ searchList({
346
+ code: val
347
+ });
348
+ }
269
349
  });
270
350
  useImperativeHandle(ref, function () {
271
351
  return {
@@ -274,7 +354,7 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
274
354
  });
275
355
  var handleSearchModalClose = function handleSearchModalClose() {
276
356
  setSearchOpen(false);
277
- searchValRef.current = '';
357
+ searchValRef.current = null;
278
358
  setSearchSelectData({
279
359
  ids: [],
280
360
  details: []
@@ -398,7 +478,15 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
398
478
  walletSetting: walletSetting,
399
479
  data: searchData,
400
480
  value: searchSelectData.ids,
401
- onChange: handleAddChange
402
- }))));
481
+ onChange: handleAddChange,
482
+ loading: loading
483
+ }))), /*#__PURE__*/React.createElement(PinVerifyModal, {
484
+ ref: pinVerifyModalRef,
485
+ onSuccess: function onSuccess(params) {
486
+ searchList({
487
+ customer_pin_key: params === null || params === void 0 ? void 0 : params.customer_pin_key
488
+ });
489
+ }
490
+ }));
403
491
  });
404
492
  export default /*#__PURE__*/memo(WalletPass);
@@ -84,14 +84,15 @@ export declare const getRecommendMachineCodeList: (order_id: number) => Promise<
84
84
  */
85
85
  export declare const searchMachineCodeList: (params: {
86
86
  order_id: number | string;
87
- code: string;
87
+ code?: string;
88
88
  sale_channel: string;
89
89
  prepare_payments: {
90
90
  voucher_id: number;
91
91
  amount: number;
92
92
  tag: string;
93
93
  }[];
94
- filter_prepare_wallet_pass: 1 | 0;
94
+ filter_prepare_wallet_pass?: 1 | 0;
95
+ customer_pin_key?: string;
95
96
  }) => Promise<WalletPassDataType[]>;
96
97
  /**
97
98
  * walletpass支付
@@ -110,4 +111,39 @@ export declare const walletPassPay: (params: {
110
111
  };
111
112
  }[];
112
113
  }) => Promise<WalletPassDataType[]>;
114
+ /**
115
+ * 搜索wallet code
116
+ */
117
+ export declare const searchWalletCode: (params: {
118
+ code: string;
119
+ with_customer: 1 | 0;
120
+ }) => Promise<{
121
+ code: string;
122
+ id: number;
123
+ status: 'enable' | 'disable' | 'expired';
124
+ expired_at: string;
125
+ customer: Record<string, any>;
126
+ check_max_count: number;
127
+ failed_count: number;
128
+ }>;
129
+ /**
130
+ * 验证pin码
131
+ */
132
+ export declare const verifyPinCode: (params: {
133
+ wallet_detail_id: number;
134
+ pin: string;
135
+ }) => Promise<{
136
+ status: number;
137
+ customer_id: number;
138
+ msg: string;
139
+ customer_pin_key: string;
140
+ }>;
141
+ /**
142
+ * 获取pin码
143
+ */
144
+ export declare const getPin: (params: {
145
+ wallet_detail_id: number;
146
+ }) => Promise<{
147
+ pin: string;
148
+ }>;
113
149
  export {};
@@ -111,4 +111,82 @@ export var walletPassPay = /*#__PURE__*/function () {
111
111
  return function walletPassPay(_x4) {
112
112
  return _ref4.apply(this, arguments);
113
113
  };
114
+ }();
115
+
116
+ /**
117
+ * 搜索wallet code
118
+ */
119
+ export var searchWalletCode = /*#__PURE__*/function () {
120
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
121
+ var _yield$request$getReq5, data;
122
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
123
+ while (1) switch (_context5.prev = _context5.next) {
124
+ case 0:
125
+ _context5.next = 2;
126
+ return request.getRequest().post("/h5/wallet/detail/search", params);
127
+ case 2:
128
+ _yield$request$getReq5 = _context5.sent;
129
+ data = _yield$request$getReq5.data;
130
+ return _context5.abrupt("return", data);
131
+ case 5:
132
+ case "end":
133
+ return _context5.stop();
134
+ }
135
+ }, _callee5);
136
+ }));
137
+ return function searchWalletCode(_x5) {
138
+ return _ref5.apply(this, arguments);
139
+ };
140
+ }();
141
+
142
+ /**
143
+ * 验证pin码
144
+ */
145
+ export var verifyPinCode = /*#__PURE__*/function () {
146
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
147
+ var _yield$request$getReq6, data;
148
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
149
+ while (1) switch (_context6.prev = _context6.next) {
150
+ case 0:
151
+ _context6.next = 2;
152
+ return request.getRequest().post("/h5/wallet/detail/pin/validate", params);
153
+ case 2:
154
+ _yield$request$getReq6 = _context6.sent;
155
+ data = _yield$request$getReq6.data;
156
+ return _context6.abrupt("return", data);
157
+ case 5:
158
+ case "end":
159
+ return _context6.stop();
160
+ }
161
+ }, _callee6);
162
+ }));
163
+ return function verifyPinCode(_x6) {
164
+ return _ref6.apply(this, arguments);
165
+ };
166
+ }();
167
+
168
+ /**
169
+ * 获取pin码
170
+ */
171
+ export var getPin = /*#__PURE__*/function () {
172
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(params) {
173
+ var _yield$request$getReq7, data;
174
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
175
+ while (1) switch (_context7.prev = _context7.next) {
176
+ case 0:
177
+ _context7.next = 2;
178
+ return request.getRequest().get("/h5/wallet/detail/pin", params);
179
+ case 2:
180
+ _yield$request$getReq7 = _context7.sent;
181
+ data = _yield$request$getReq7.data;
182
+ return _context7.abrupt("return", data);
183
+ case 5:
184
+ case "end":
185
+ return _context7.stop();
186
+ }
187
+ }, _callee7);
188
+ }));
189
+ return function getPin(_x7) {
190
+ return _ref7.apply(this, arguments);
191
+ };
114
192
  }();
@@ -1,3 +1,9 @@
1
1
  import { WalletPassDataType } from './serve';
2
2
  export declare const formatMachineCodeServer2CardList: (data: WalletPassDataType[], selectId?: number[]) => any;
3
3
  export declare const getDataByIds: (arr: any[], ids: number[]) => any[];
4
+ /**
5
+ * 判断是否是wallet code
6
+ * @param val
7
+ * @returns
8
+ */
9
+ export declare const getIsWalletCode: (val: string) => boolean;
@@ -38,4 +38,13 @@ export var getDataByIds = function getDataByIds(arr, ids) {
38
38
  return arr.filter(function (item) {
39
39
  return ids.includes(item.id);
40
40
  });
41
+ };
42
+
43
+ /**
44
+ * 判断是否是wallet code
45
+ * @param val
46
+ * @returns
47
+ */
48
+ export var getIsWalletCode = function getIsWalletCode(val) {
49
+ return val.startsWith('WL');
41
50
  };
@@ -41,7 +41,7 @@ export var formatWalletPassParams = function formatWalletPassParams(payGroup) {
41
41
  var payments = (walletPass === null || walletPass === void 0 ? void 0 : walletPass.cards.map(function (item) {
42
42
  return {
43
43
  amount: getAvailableMaxAmount(item),
44
- wallet_pass_use_value: item.available_max_par_value,
44
+ wallet_pass_use_value: item.recommended_usage_par_value,
45
45
  voucher_id: item.id,
46
46
  tag: item.tag,
47
47
  wallet_pass_usage_unit: item.wallet_pass_usage_unit
@@ -0,0 +1,7 @@
1
+ export declare const usePin: () => {
2
+ pin: string;
3
+ lastUpdateTime: string;
4
+ getPin: (id: string | number) => void;
5
+ resetPin: (id: string | number) => void;
6
+ resetPinLoading: boolean;
7
+ };
@@ -0,0 +1,65 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useState } from 'react';
8
+ import { useRequest } from 'ahooks';
9
+ import dayjs from 'dayjs';
10
+ import { getPinApi, resetPinApi } from "./serve";
11
+ export var usePin = function usePin() {
12
+ var _useState = useState(''),
13
+ _useState2 = _slicedToArray(_useState, 2),
14
+ pin = _useState2[0],
15
+ setPin = _useState2[1];
16
+ var _useState3 = useState(''),
17
+ _useState4 = _slicedToArray(_useState3, 2),
18
+ lastUpdateTime = _useState4[0],
19
+ setLastUpdateTime = _useState4[1];
20
+ var _getPinRequest = useRequest(getPinApi, {
21
+ manual: true,
22
+ loadingDelay: 100,
23
+ onSuccess: function onSuccess(res) {
24
+ var code = res.code,
25
+ data = res.data;
26
+ if (code === 200 && data !== null && data !== void 0 && data.pin) {
27
+ setPin(data.pin);
28
+ setLastUpdateTime(getTime((data === null || data === void 0 ? void 0 : data.generated_at) || ''));
29
+ }
30
+ }
31
+ });
32
+ var getTime = function getTime(time) {
33
+ if (!time) return '';
34
+ return dayjs(time).format('YYYY-MM-DD HH:mm');
35
+ };
36
+ var _resetPinRequest = useRequest(resetPinApi, {
37
+ manual: true,
38
+ loadingDelay: 100,
39
+ onSuccess: function onSuccess(res) {
40
+ var code = res.code,
41
+ data = res.data;
42
+ if (code === 200 && data !== null && data !== void 0 && data.pin) {
43
+ setPin(data.pin);
44
+ setLastUpdateTime(getTime((data === null || data === void 0 ? void 0 : data.generated_at) || ''));
45
+ }
46
+ }
47
+ });
48
+ var getPin = function getPin(id) {
49
+ _getPinRequest.run({
50
+ wallet_detail_id: id
51
+ });
52
+ };
53
+ var resetPin = function resetPin(id) {
54
+ _resetPinRequest.run({
55
+ wallet_detail_id: id
56
+ });
57
+ };
58
+ return {
59
+ pin: pin,
60
+ lastUpdateTime: lastUpdateTime,
61
+ getPin: getPin,
62
+ resetPin: resetPin,
63
+ resetPinLoading: _resetPinRequest.loading
64
+ };
65
+ };
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- export interface EditServiceRef {
4
- init: (cacheItem?: any, open?: boolean, openEditProduct?: boolean) => void;
5
- }
6
3
  declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
7
4
  export default _default;