@pisell/private-materials 6.2.49 → 6.2.50

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 (168) 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 +2 -2
  6. package/build/lowcode/preview.js +7 -7
  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 +7 -7
  11. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +27 -3
  12. package/es/components/appointmentBooking/components/Content/index.js +3 -3
  13. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  14. package/es/components/appointmentBooking/components/Voucher/index.js +6 -5
  15. package/es/components/appointmentBooking/hooks.js +10 -2
  16. package/es/components/appointmentBooking/index.js +10 -0
  17. package/es/components/booking/addons/model.d.ts +1 -10
  18. package/es/components/booking/components/footer/index.js +12 -1
  19. package/es/components/booking/editBookingModal/index.js +8 -2
  20. package/es/components/booking/forms/model.d.ts +1 -10
  21. package/es/components/booking/info/model.d.ts +1 -10
  22. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  23. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  24. package/es/components/booking/locales.d.ts +6 -0
  25. package/es/components/booking/locales.js +12 -0
  26. package/es/components/booking/model.d.ts +1 -9
  27. package/es/components/booking/notes/model.d.ts +1 -10
  28. package/es/components/booking/payments/model.d.ts +1 -10
  29. package/es/components/eftposPay/hooks.d.ts +1 -1
  30. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  31. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +25 -4
  32. package/es/components/eftposPay/store/index.d.ts +2 -2
  33. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +34 -8
  34. package/es/components/index.d.ts +3 -1
  35. package/es/components/index.js +3 -1
  36. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  37. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  38. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  39. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  40. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  41. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  42. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  43. package/es/components/pay/toC/model.d.ts +1 -9
  44. package/es/components/pay/toC/utils.js +1 -1
  45. package/es/components/pinModal/hooks.d.ts +7 -0
  46. package/es/components/pinModal/hooks.js +65 -0
  47. package/es/components/pinModal/index.d.ts +4 -0
  48. package/es/components/pinModal/index.js +98 -0
  49. package/es/components/pinModal/index.less +44 -0
  50. package/es/components/pinModal/locales.d.ts +27 -0
  51. package/es/components/pinModal/locales.js +26 -0
  52. package/es/components/pinModal/serve.d.ts +6 -0
  53. package/es/components/pinModal/serve.js +11 -0
  54. package/es/components/pinModal/types.d.ts +0 -0
  55. package/es/components/pinModal/types.js +0 -0
  56. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  57. package/es/components/pinVerifyModal/hooks.js +80 -0
  58. package/es/components/pinVerifyModal/index.d.ts +5 -0
  59. package/es/components/pinVerifyModal/index.js +218 -0
  60. package/es/components/pinVerifyModal/index.less +92 -0
  61. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  62. package/es/components/pinVerifyModal/locales.js +23 -0
  63. package/es/components/pinVerifyModal/types.d.ts +33 -0
  64. package/es/components/pinVerifyModal/types.js +1 -0
  65. package/es/components/schedules/model.d.ts +1 -9
  66. package/es/components/ticketBooking/components/ticketBooking/index.js +58 -10
  67. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  68. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  69. package/es/components/wallet/Detail/index.js +251 -63
  70. package/es/components/wallet/Detail/locales.d.ts +51 -0
  71. package/es/components/wallet/Detail/locales.js +57 -3
  72. package/es/components/wallet/Detail/model.d.ts +1 -13
  73. package/es/components/wallet/Detail/serve.js +5 -1
  74. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  75. package/es/components/wallet/PointCard/model.d.ts +1 -13
  76. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  77. package/es/components/wallet/Voucher/model.d.ts +1 -13
  78. package/es/components/wallet/components/UsageRules/index.d.ts +23 -0
  79. package/es/components/wallet/components/UsageRules/index.js +147 -0
  80. package/es/components/wallet/components/UsageRules/index.less +157 -0
  81. package/es/components/wallet/components/WalletCard.js +8 -3
  82. package/es/components/wallet/components/index.d.ts +1 -0
  83. package/es/components/wallet/components/index.js +2 -1
  84. package/es/components/wallet/model.d.ts +1 -9
  85. package/es/components/walletList/index.js +20 -2
  86. package/es/index.d.ts +2 -0
  87. package/es/index.js +3 -1
  88. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +22 -2
  89. package/lib/components/appointmentBooking/components/Content/index.js +2 -2
  90. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  91. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  92. package/lib/components/appointmentBooking/hooks.js +10 -2
  93. package/lib/components/appointmentBooking/index.js +6 -0
  94. package/lib/components/booking/addons/model.d.ts +1 -10
  95. package/lib/components/booking/components/footer/index.js +15 -2
  96. package/lib/components/booking/components/voucher/index.js +1 -3
  97. package/lib/components/booking/editBookingModal/index.js +6 -1
  98. package/lib/components/booking/forms/model.d.ts +1 -10
  99. package/lib/components/booking/info/model.d.ts +1 -10
  100. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  101. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  102. package/lib/components/booking/locales.d.ts +6 -0
  103. package/lib/components/booking/locales.js +6 -0
  104. package/lib/components/booking/model.d.ts +1 -9
  105. package/lib/components/booking/notes/model.d.ts +1 -10
  106. package/lib/components/booking/payments/model.d.ts +1 -10
  107. package/lib/components/eftposPay/hooks.d.ts +1 -1
  108. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  109. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +16 -4
  110. package/lib/components/eftposPay/store/index.d.ts +2 -2
  111. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +30 -8
  112. package/lib/components/index.d.ts +3 -1
  113. package/lib/components/index.js +6 -0
  114. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  115. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  116. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  117. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  118. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  119. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  120. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  121. package/lib/components/pay/toC/model.d.ts +1 -9
  122. package/lib/components/pay/toC/utils.js +1 -1
  123. package/lib/components/pinModal/hooks.d.ts +7 -0
  124. package/lib/components/pinModal/hooks.js +85 -0
  125. package/lib/components/pinModal/index.d.ts +4 -0
  126. package/lib/components/pinModal/index.js +88 -0
  127. package/lib/components/pinModal/index.less +44 -0
  128. package/lib/components/pinModal/locales.d.ts +27 -0
  129. package/lib/components/pinModal/locales.js +50 -0
  130. package/lib/components/pinModal/serve.d.ts +6 -0
  131. package/lib/components/pinModal/serve.js +37 -0
  132. package/lib/components/pinModal/types.d.ts +0 -0
  133. package/lib/components/pinModal/types.js +0 -0
  134. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  135. package/lib/components/pinVerifyModal/hooks.js +93 -0
  136. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  137. package/lib/components/pinVerifyModal/index.js +230 -0
  138. package/lib/components/pinVerifyModal/index.less +92 -0
  139. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  140. package/lib/components/pinVerifyModal/locales.js +47 -0
  141. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  142. package/lib/components/pinVerifyModal/types.js +17 -0
  143. package/lib/components/schedules/model.d.ts +1 -9
  144. package/lib/components/ticketBooking/components/ticketBooking/index.js +50 -6
  145. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  146. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  147. package/lib/components/wallet/Detail/index.js +140 -8
  148. package/lib/components/wallet/Detail/locales.d.ts +51 -0
  149. package/lib/components/wallet/Detail/locales.js +57 -3
  150. package/lib/components/wallet/Detail/model.d.ts +1 -13
  151. package/lib/components/wallet/Detail/serve.js +6 -1
  152. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  153. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  154. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  155. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  156. package/lib/components/wallet/components/UsageRules/index.d.ts +23 -0
  157. package/lib/components/wallet/components/UsageRules/index.js +113 -0
  158. package/lib/components/wallet/components/UsageRules/index.less +157 -0
  159. package/lib/components/wallet/components/WalletCard.js +3 -1
  160. package/lib/components/wallet/components/index.d.ts +1 -0
  161. package/lib/components/wallet/components/index.js +3 -0
  162. package/lib/components/wallet/model.d.ts +1 -9
  163. package/lib/components/walletList/index.js +19 -2
  164. package/lib/index.d.ts +2 -0
  165. package/lib/index.js +6 -0
  166. package/lowcode/pin-modal/meta.ts +37 -0
  167. package/lowcode/pin-verify-modal/meta.ts +80 -0
  168. package/package.json +4 -4
@@ -30,6 +30,7 @@ import "./index.less";
30
30
  import classNames from 'classnames';
31
31
  // 导入所有类型
32
32
  import { WalletCardItem, DEFAULT_CARD_CONFIG } from "./types";
33
+ import PinModal from "../pinModal";
33
34
 
34
35
  // 添加 localStorage 相关的操作函数
35
36
  var STORAGE_KEY = 'pisell_wallet_list_data';
@@ -176,6 +177,9 @@ var WalletList = Provider(function (props) {
176
177
  var requestIdRef = useRef('');
177
178
  var pubsub = utils === null || utils === void 0 ? void 0 : utils.pubsub;
178
179
 
180
+ // pinModal的ref
181
+ var pinModalRef = useRef(null);
182
+
179
183
  //获取登录状态
180
184
  var isUserLoggedIn = useMemo(function () {
181
185
  var _utils$token, _utils$token$get;
@@ -586,6 +590,14 @@ var WalletList = Provider(function (props) {
586
590
  return _ref3.apply(this, arguments);
587
591
  };
588
592
  }();
593
+ var _onViewPinClick = function onViewPinClick(card) {
594
+ if (card !== null && card !== void 0 && card.id) {
595
+ var _pinModalRef$current;
596
+ (_pinModalRef$current = pinModalRef.current) === null || _pinModalRef$current === void 0 || _pinModalRef$current.open(card === null || card === void 0 ? void 0 : card.id);
597
+ } else {
598
+ console.error('onViewPinClick方法需要传入wallet_detail_id');
599
+ }
600
+ };
589
601
  var renderWalletCard = function renderWalletCard(item) {
590
602
  var _dvaStore$core;
591
603
  var code = item.code,
@@ -652,7 +664,11 @@ var WalletList = Provider(function (props) {
652
664
  });
653
665
  return /*#__PURE__*/React.createElement(WalletCard, _extends({
654
666
  key: id
655
- }, cardProps));
667
+ }, cardProps, {
668
+ onViewPinClick: function onViewPinClick() {
669
+ return _onViewPinClick(item);
670
+ }
671
+ }));
656
672
  };
657
673
  var carouselProps = {
658
674
  className: classNames('pisell-lowcode__walletList'),
@@ -811,7 +827,9 @@ var WalletList = Provider(function (props) {
811
827
  fontSize: '24px',
812
828
  color: currentIndex === list.length - 1 ? '#D0D5DD' : '#101828'
813
829
  }
814
- }))));
830
+ }))), /*#__PURE__*/React.createElement(PinModal, {
831
+ ref: pinModalRef
832
+ }));
815
833
  };
816
834
 
817
835
  // 最终返回组件内容
package/es/index.d.ts CHANGED
@@ -52,3 +52,5 @@ export { default as NoteModal } from './plus/noteModal';
52
52
  export { default as SaasLogin } from './plus/saasLogin';
53
53
  export { default as SaasRegister } from './plus/saasRegister';
54
54
  export { default as SaasCreateOrganization } from './plus/saasCreateOrganization';
55
+ export { default as PinModal } from './components/pinModal';
56
+ export { default as PinVerifyModal } from './components/pinVerifyModal';
package/es/index.js CHANGED
@@ -55,4 +55,6 @@ export { default as ComprehensiveSearch } from "./pro/comprehensiveSearch";
55
55
  export { default as NoteModal } from "./plus/noteModal";
56
56
  export { default as SaasLogin } from "./plus/saasLogin";
57
57
  export { default as SaasRegister } from "./plus/saasRegister";
58
- export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
58
+ export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
59
+ export { default as PinModal } from "./components/pinModal";
60
+ export { default as PinVerifyModal } from "./components/pinVerifyModal";
@@ -43,9 +43,11 @@ var import_utils3 = require("./utils");
43
43
  var import_index = require("./index.less");
44
44
  var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
45
45
  var _a, _b;
46
+ const hasSubscribedRef = (0, import_react.useRef)(false);
46
47
  const context = (0, import_useEngineContext.default)();
47
48
  const config = ((_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.config) || {};
48
49
  const utils = (0, import_hooks.contextUtils)();
50
+ const { pubsub } = context.appHelper.utils;
49
51
  const { appointmentBooking, summary, isAgreeDepositPolicy, setLoading } = (0, import_context.useAppointmentBookingContext)();
50
52
  const { isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
51
53
  const goPaymentFinish = (order_id, amount) => {
@@ -141,10 +143,28 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
141
143
  }, 50);
142
144
  }
143
145
  };
146
+ const handleSubmit = () => {
147
+ var _a2, _b2, _c, _d;
148
+ if ((_b2 = (_a2 = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _a2.isGuestUser) == null ? void 0 : _b2.call(_a2)) {
149
+ if (!hasSubscribedRef.current) {
150
+ pubsub.subscribe("bind.guest.user", handleNext);
151
+ hasSubscribedRef.current = true;
152
+ }
153
+ (_d = (_c = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _c.openRegisterModal) == null ? void 0 : _d.call(_c, true);
154
+ return;
155
+ }
156
+ handleNext();
157
+ };
158
+ (0, import_react.useEffect)(() => {
159
+ return () => {
160
+ pubsub.unsubscribe("bind.guest.user", handleNext);
161
+ hasSubscribedRef.current = false;
162
+ };
163
+ }, []);
144
164
  (0, import_react.useImperativeHandle)(ref, () => ({
145
- next: handleNext
165
+ next: handleSubmit
146
166
  }));
147
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleNext }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
167
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleSubmit }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
148
168
  "img",
149
169
  {
150
170
  src: `${config == null ? void 0 : config.awsStatic}/checkout_confirm.png`,
@@ -84,7 +84,7 @@ var Layout = () => {
84
84
  const context = (0, import_useEngineContext.default)();
85
85
  const { pubsub } = context.appHelper.utils;
86
86
  (0, import_react.useEffect)(() => {
87
- const handleLoginSuccess = async () => {
87
+ const handleLoginSuccess = async (res) => {
88
88
  var _a2;
89
89
  if (!isFormSubject) {
90
90
  const user = JSON.parse(((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("customer")) || "{}");
@@ -100,7 +100,7 @@ var Layout = () => {
100
100
  };
101
101
  pubsub.subscribe("pisell1.login.success", handleLoginSuccess);
102
102
  return () => {
103
- pubsub.unsubscribe("pisell1.login.success");
103
+ pubsub.unsubscribe("pisell1.login.success", handleLoginSuccess);
104
104
  };
105
105
  }, []);
106
106
  (0, import_react.useEffect)(() => {
@@ -95,20 +95,27 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
95
95
  delete product.option;
96
96
  if (isRetailTemplate) {
97
97
  if (data == null ? void 0 : data.isCancel) return;
98
- appointmentBooking.storeProduct(product);
98
+ const res = appointmentBooking.storeProduct(product);
99
+ if (!res.success && res.errorCode === "not_enough_stock") {
100
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
101
+ }
99
102
  return;
100
103
  }
101
104
  const session = data == null ? void 0 : data.session;
102
105
  if (session) {
103
106
  const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
104
107
  const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
105
- appointmentBooking.addProductToCart({
108
+ const res = appointmentBooking.addProductToCart({
106
109
  product: { ...product },
107
110
  date: {
108
111
  startTime: `${startDate} ${session == null ? void 0 : session.start_time}`,
109
112
  endTime: `${endDate} ${session == null ? void 0 : session.end_time}`
110
113
  }
111
114
  });
115
+ if (!res.success && res.errorCode === "not_enough_stock") {
116
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
117
+ }
118
+ appointmentBooking.closeProductDetail();
112
119
  await appointmentBooking.getAvailableDate({
113
120
  startDate,
114
121
  endDate
@@ -121,7 +128,10 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
121
128
  import_utils.locales.getText("pisell2.appointment.no.available.service")
122
129
  );
123
130
  }
124
- appointmentBooking.storeProduct(product);
131
+ const res = appointmentBooking.storeProduct(product);
132
+ if (!res.success && res.errorCode === "not_enough_stock") {
133
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
134
+ }
125
135
  if (type === "duration") {
126
136
  await appointmentBooking.getAvailableDate();
127
137
  }
@@ -133,7 +133,8 @@ var VoucherCard = (props) => {
133
133
  );
134
134
  }, []);
135
135
  const onScanCode = async () => {
136
- const val = await shopDiscount.scanCode(code);
136
+ const customerId = currentUser.id;
137
+ const val = await shopDiscount.scanCode(code, customerId);
137
138
  if (val == null ? void 0 : val.isAvailable) {
138
139
  batchUpdateCart(val.productList);
139
140
  setCode("");
@@ -189,6 +189,12 @@ var useAppointmentBookingStep = () => {
189
189
  if (!result) {
190
190
  return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.date"));
191
191
  }
192
+ const capacityResult = appointmentBooking.checkMaxDurationCapacity();
193
+ if (!capacityResult.success) {
194
+ const getMessage = import_utils.locales.getText("pisell2.appointment.unuse.capacity");
195
+ const message = typeof getMessage === "function" ? getMessage(capacityResult.minAvailableCount) : getMessage;
196
+ return (0, import_utils2.Toast)(message);
197
+ }
192
198
  }
193
199
  if (!isRetailTemplate && (currentKey == null ? void 0 : currentKey.startsWith("select-resource"))) {
194
200
  const { hasError, updatedCartList } = (0, import_utils2.checkAndMarkCartRenderError)(currentSelectedResources, appointmentBooking, utils);
@@ -266,8 +272,10 @@ var useAppointmentBookingStep = () => {
266
272
  const checkLogin = async () => {
267
273
  if (!isLogin) {
268
274
  const { pubsub } = utils;
269
- pubsub.once("pisell1.login.success", () => {
270
- checkHolder();
275
+ pubsub.once("pisell1.login.success", (res) => {
276
+ if (res === "success") {
277
+ checkHolder();
278
+ }
271
279
  });
272
280
  return openLoginModal({
273
281
  callback: (status) => {
@@ -55,6 +55,12 @@ var AppointmentBooking = () => {
55
55
  if (!data.length) {
56
56
  const currentUser = (0, import_utils2.formatCurrentUser)(utils);
57
57
  appointmentBooking.addAccounts([currentUser]);
58
+ } else if (data.length >= 1) {
59
+ const meAccount = data == null ? void 0 : data.find((d) => !(d == null ? void 0 : d.isGuest));
60
+ const currentUser = (0, import_utils2.formatCurrentUser)(utils);
61
+ if (currentUser && meAccount.id !== currentUser.id) {
62
+ appointmentBooking.setLoginAccount(meAccount.id, currentUser);
63
+ }
58
64
  }
59
65
  });
60
66
  }, []);
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -281,7 +281,7 @@ var Footer = (props) => {
281
281
  type,
282
282
  messageShow = true
283
283
  }) => {
284
- var _a2;
284
+ var _a2, _b2, _c2, _d2, _e2;
285
285
  if ((0, import_utils2.isDayBooking)(state)) {
286
286
  const isHasDayProducts = handleDaySubmit();
287
287
  if (isHasDayProducts) return;
@@ -306,7 +306,20 @@ var Footer = (props) => {
306
306
  title: "saveBooking",
307
307
  content: [
308
308
  { key: "下单前数据", value: JSON.stringify(values) },
309
- { key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") }
309
+ { key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") },
310
+ {
311
+ key: "店铺id",
312
+ value: (_e2 = (_d2 = (_c2 = (_b2 = store == null ? void 0 : store.getState) == null ? void 0 : _b2.call(store)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id
313
+ },
314
+ {
315
+ key: "shopApi",
316
+ value: JSON.stringify(window == null ? void 0 : window.shopApi, (key, value) => {
317
+ if (typeof value === "function") {
318
+ return "function";
319
+ }
320
+ return value;
321
+ })
322
+ }
310
323
  ]
311
324
  });
312
325
  if (addonsEdit) {
@@ -69,9 +69,7 @@ var VoucherCard = (props) => {
69
69
  const isBooking4Shop = (0, import_useIsBooking4Shop.useIsBooking4Shop)(state);
70
70
  const shopDiscount = pisellos.getModule("shopDiscount");
71
71
  services = state.service;
72
- const {
73
- selectCustomer
74
- } = (0, import_pisellos.useCustomer)();
72
+ const { selectCustomer } = (0, import_pisellos.useCustomer)();
75
73
  (0, import_ahooks.useDebounceEffect)(
76
74
  () => {
77
75
  if (isBooking4Shop) {
@@ -113,7 +113,12 @@ var EditBookingModal = (props, ref) => {
113
113
  _cloned[_idx] = _targetResource;
114
114
  }
115
115
  } else {
116
- _cloned.push(_targetResource);
116
+ const _targetIdx = _cloned.findIndex((rs) => {
117
+ return rs.relation_id == (_targetResource == null ? void 0 : _targetResource.relation_id);
118
+ });
119
+ if (_targetIdx === -1) {
120
+ _cloned.push(_targetResource);
121
+ }
117
122
  }
118
123
  _initResourceVal = {
119
124
  ..._initResourceVal,
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,14 +1,5 @@
1
- /// <reference types="react" />
2
- import { FormState } from '../model';
3
1
  export declare const walkInData: {
4
2
  id: number;
5
3
  nickname: string;
6
4
  };
7
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
- state: FormState;
9
- } & {
10
- dispatch: (params: {
11
- type: string;
12
- payload: any;
13
- }) => void;
14
- }>;
5
+ export declare const Provider: any, Context: any;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -156,6 +156,8 @@ declare const _default: {
156
156
  'pisell2.text.deposit-delete-message': string;
157
157
  'pisell2.text.deposit-paid': string;
158
158
  "pisell2.text.stock": string;
159
+ 'pisell2.appointment.unuse.stock': string;
160
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
159
161
  'pisell2.text.payment-link': string;
160
162
  'pisell2.text.send-mail': string;
161
163
  'pisell2.text.copy-to-clipboard': string;
@@ -458,6 +460,8 @@ declare const _default: {
458
460
  'pisell2.text.deposit-delete-message': string;
459
461
  'pisell2.text.deposit-paid': string;
460
462
  "pisell2.text.stock": string;
463
+ 'pisell2.appointment.unuse.stock': string;
464
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
461
465
  'pisell2.text.payment-link': string;
462
466
  'pisell2.text.send-mail': string;
463
467
  'pisell2.text.copy-to-clipboard': string;
@@ -760,6 +764,8 @@ declare const _default: {
760
764
  'pisell2.text.deposit-delete-message': string;
761
765
  'pisell2.text.deposit-paid': string;
762
766
  "pisell2.text.stock": string;
767
+ 'pisell2.appointment.unuse.stock': string;
768
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
763
769
  'pisell2.text.payment-link': string;
764
770
  'pisell2.text.send-mail': string;
765
771
  'pisell2.text.copy-to-clipboard': string;
@@ -200,6 +200,8 @@ var locales_default = {
200
200
  "pisell2.text.deposit-delete-message": "It cannot be restored after deletion. Please confirm the operation.",
201
201
  "pisell2.text.deposit-paid": "Deposit paid",
202
202
  "pisell2.text.stock": "Stock",
203
+ "pisell2.appointment.unuse.stock": "Not enough stock",
204
+ "pisell2.appointment.unuse.capacity": (count) => `Only ${count} spots available. Please reduce quantity.`,
203
205
  "pisell2.text.payment-link": "Payment link",
204
206
  "pisell2.text.send-mail": "Send email",
205
207
  "pisell2.text.copy-to-clipboard": "Copy to clipboard",
@@ -540,6 +542,8 @@ var locales_default = {
540
542
  "pisell2.text.deposit-delete-message": "删除后不可恢复,请确认操作",
541
543
  "pisell2.text.deposit-paid": "已付定金",
542
544
  "pisell2.text.stock": "库存",
545
+ "pisell2.appointment.unuse.stock": "库存不足",
546
+ "pisell2.appointment.unuse.capacity": (count) => `仅可预约 ${count} 个,请减少数量`,
543
547
  "pisell2.text.payment-link": "付款链接",
544
548
  "pisell2.text.send-mail": "发送邮件",
545
549
  "pisell2.text.copy-to-clipboard": "复制到剪切板",
@@ -880,6 +884,8 @@ var locales_default = {
880
884
  "pisell2.text.deposit-delete-message": "刪除後不可恢復,請確認操作",
881
885
  "pisell2.text.deposit-paid": "已付定金",
882
886
  "pisell2.text.stock": "庫存",
887
+ "pisell2.appointment.unuse.stock": "庫存不足",
888
+ "pisell2.appointment.unuse.capacity": (count) => `僅可預約 ${count} 個,請減少數量`,
883
889
  "pisell2.text.payment-link": "付款鏈接",
884
890
  "pisell2.text.send-mail": "發送郵件",
885
891
  "pisell2.text.copy-to-clipboard": "複製到剪切板",
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -106,11 +105,4 @@ export declare const walkInData: {
106
105
  id: number;
107
106
  nickname: string;
108
107
  };
109
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
110
- state: FormState;
111
- } & {
112
- dispatch: (params: {
113
- type: string;
114
- payload: any;
115
- }) => void;
116
- }>;
108
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -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<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -63,18 +63,18 @@ var useLinklyPayOrRefund = (handleCheck) => {
63
63
  content: [{ key: "response", value: JSON.stringify(res) }]
64
64
  });
65
65
  const status = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.status;
66
- if (status === 0) {
66
+ if (status == 0) {
67
67
  numRef.current = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.session_id;
68
68
  dispatch((0, import_store.updateState)({ number: numRef.current }));
69
69
  dispatch((0, import_store.updateCustom)({ actionStatus: import_const2.LinklyActionStatus.Cancel }));
70
70
  setTimeout(() => {
71
71
  var _a2;
72
72
  (_a2 = resultQueryRef.current) == null ? void 0 : _a2.call(resultQueryRef);
73
- });
73
+ }, 300);
74
74
  return;
75
75
  }
76
76
  dispatch((0, import_store.updateCustom)({ actionStatus: import_const2.LinklyActionStatus.Empty }));
77
- if (status === 1) {
77
+ if (status == 1) {
78
78
  (_c = handleLinklySuccessRef.current) == null ? void 0 : _c.call(handleLinklySuccessRef, res);
79
79
  return;
80
80
  }
@@ -83,13 +83,17 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
83
83
  _log("Success" /* Success */, result);
84
84
  isQueryFinishedRef.current = true;
85
85
  const data = (result == null ? void 0 : result.data) || {};
86
- if (data.status === 1) {
86
+ if (data.status == 1) {
87
87
  console.log("交易成功,终止查询");
88
+ (0, import_utils.sendWarningLog)({
89
+ title: `Linkly-${isPay ? "Pay" : "Refund"}-交易成功`,
90
+ content: [{ key: "response", value: JSON.stringify(result) }]
91
+ });
88
92
  reset();
89
93
  handleLinklySuccess(result);
90
94
  return;
91
95
  }
92
- if (data.status !== void 0 && (data == null ? void 0 : data.status) === 0) {
96
+ if ((data == null ? void 0 : data.status) == 0 && (data == null ? void 0 : data.signature_flag) != 1) {
93
97
  console.log("交易状态为0需要继续查询");
94
98
  isQueryFinishedRef.current = false;
95
99
  _resultQuery();
@@ -97,13 +101,21 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
97
101
  }
98
102
  if (data.status < 0) {
99
103
  console.log("交易失败,终止查询");
104
+ (0, import_utils.sendWarningLog)({
105
+ title: `Linkly-${isPay ? "Pay" : "Refund"}-交易失败`,
106
+ content: [{ key: "response", value: JSON.stringify(result) }]
107
+ });
100
108
  reset();
101
109
  result.code = import_const.PayStatus.Unknown;
102
110
  (_a2 = failRef.current) == null ? void 0 : _a2.call(failRef, result, false);
103
111
  return;
104
112
  }
105
- if (data.signature_flag === 1) {
113
+ if (data.signature_flag == 1) {
106
114
  console.log("交易需要签名,终止查询");
115
+ (0, import_utils.sendWarningLog)({
116
+ title: `Linkly-${isPay ? "Pay" : "Refund"}-交易需要签名`,
117
+ content: [{ key: "response", value: JSON.stringify(result) }]
118
+ });
107
119
  reset();
108
120
  gotoSignature();
109
121
  return;
@@ -194,7 +206,7 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
194
206
  content.push({ key: "error", value: JSON.stringify(res) });
195
207
  }
196
208
  (0, import_utils.sendWarningLog)({
197
- title: `Linkly-${isPay ? "Pay" : "Refund"}-结果查询--${type}`,
209
+ title: `Linkly-${isPay ? "Pay" : "Refund"}-交易结果轮询`,
198
210
  content
199
211
  });
200
212
  };
@@ -297,8 +297,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  amount?: string | number | undefined;
298
298
  mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
301
- action?: "amount" | "pay" | "deviceList" | undefined;
300
+ eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
301
+ action?: "pay" | "amount" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
@@ -45,7 +45,8 @@ var import_useEngineContext = __toESM(require("../../../../../../hooks/useEngine
45
45
  var import_index = require("./index.less");
46
46
  var import_utils3 = require("../../../../../appointmentBooking/utils");
47
47
  var ContinueButton = () => {
48
- var _a, _b;
48
+ var _a, _b, _c, _d, _e;
49
+ const hasSubscribedRef = (0, import_react.useRef)(false);
49
50
  const { data } = (0, import_Sales.useSales)();
50
51
  const { onHolderOpen } = (0, import_Sales.useHolder)();
51
52
  const { checkHolder, onCloseCart, cartData, getWithoutCartItemsHolderNames } = (0, import_Sales.useCart)();
@@ -64,14 +65,17 @@ var ContinueButton = () => {
64
65
  const [openEmptyHolder, setOpenEmptyHolder] = (0, import_react.useState)(false);
65
66
  const { setData, removeSessionStorage } = (0, import_Sales.useSales)();
66
67
  const context = (0, import_useEngineContext.default)();
67
- const { store, action, getStore } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
68
+ const config = ((_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.config) || {};
69
+ const utils = ((_c = context == null ? void 0 : context.appHelper) == null ? void 0 : _c.utils) || {};
70
+ const { pubsub } = context.appHelper.utils;
71
+ const { store, action, getStore } = ((_d = context.appHelper) == null ? void 0 : _d.utils) || {};
68
72
  const handleCheckout = async () => {
69
73
  const params = (0, import_utils2.getFormParams)(data);
70
74
  action == null ? void 0 : action({
71
75
  type: "pisell1.goProductForm",
72
76
  data: params,
73
77
  callback: async (e) => {
74
- var _a2, _b2, _c;
78
+ var _a2, _b2, _c2;
75
79
  if ((e == null ? void 0 : e.type) === "close") {
76
80
  return;
77
81
  }
@@ -88,7 +92,7 @@ var ContinueButton = () => {
88
92
  removeSessionStorage();
89
93
  } else {
90
94
  (0, import_materials.PisellToast)({
91
- content: ((_c = result == null ? void 0 : result.err) == null ? void 0 : _c.message) || ""
95
+ content: ((_c2 = result == null ? void 0 : result.err) == null ? void 0 : _c2.message) || ""
92
96
  });
93
97
  }
94
98
  }
@@ -234,13 +238,13 @@ var ContinueButton = () => {
234
238
  handleNextStep();
235
239
  };
236
240
  const handleContinue = async () => {
237
- var _a2, _b2, _c;
241
+ var _a2, _b2, _c2;
238
242
  if (isLastStep) {
239
243
  const value = (0, import_utils2.formatValues)({
240
244
  state: data,
241
245
  platform: (_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.constants) == null ? void 0 : _b2.platform
242
246
  });
243
- if ((deposit == null ? void 0 : deposit.hasDeposit) && ((_c = deposit == null ? void 0 : deposit.protocols) == null ? void 0 : _c.length) > 0 && !isAgreeDepositPolicy) {
247
+ if ((deposit == null ? void 0 : deposit.hasDeposit) && ((_c2 = deposit == null ? void 0 : deposit.protocols) == null ? void 0 : _c2.length) > 0 && !isAgreeDepositPolicy) {
244
248
  (0, import_utils3.Toast)(import_utils.locales.getText("pisell2.appointment.deposit.agree.policy"));
245
249
  return;
246
250
  }
@@ -270,6 +274,24 @@ var ContinueButton = () => {
270
274
  }
271
275
  handleHolder();
272
276
  };
277
+ const handleSubmit = () => {
278
+ var _a2, _b2, _c2, _d2;
279
+ if ((_b2 = (_a2 = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _a2.isGuestUser) == null ? void 0 : _b2.call(_a2)) {
280
+ if (!hasSubscribedRef.current) {
281
+ pubsub.subscribe("bind.guest.user", handleContinue);
282
+ hasSubscribedRef.current = true;
283
+ }
284
+ (_d2 = (_c2 = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _c2.openRegisterModal) == null ? void 0 : _d2.call(_c2, true);
285
+ return;
286
+ }
287
+ handleContinue();
288
+ };
289
+ (0, import_react.useEffect)(() => {
290
+ return () => {
291
+ pubsub.unsubscribe("bind.guest.user", handleContinue);
292
+ hasSubscribedRef.current = false;
293
+ };
294
+ }, []);
273
295
  const continueText = (0, import_react.useMemo)(() => {
274
296
  if (isLastStep) {
275
297
  return import_utils.locales.getText("pisell2.event.checkout");
@@ -289,10 +311,10 @@ var ContinueButton = () => {
289
311
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
290
312
  import_materials.Button,
291
313
  {
292
- disabled: !((_b = cartData == null ? void 0 : cartData.cartItems) == null ? void 0 : _b.length),
314
+ disabled: !((_e = cartData == null ? void 0 : cartData.cartItems) == null ? void 0 : _e.length),
293
315
  size: "large",
294
316
  type: "primary",
295
- onClick: () => handleContinue(),
317
+ onClick: () => isLastStep ? handleSubmit() : handleContinue(),
296
318
  loading: confirmLoading
297
319
  },
298
320
  continueText