@pisell/private-materials 6.2.50 → 6.2.51

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 (49) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/booking/addons/model.d.ts +10 -1
  8. package/es/components/booking/forms/model.d.ts +10 -1
  9. package/es/components/booking/info/model.d.ts +10 -1
  10. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  11. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  12. package/es/components/booking/model.d.ts +9 -1
  13. package/es/components/booking/notes/model.d.ts +10 -1
  14. package/es/components/booking/payments/model.d.ts +10 -1
  15. package/es/components/eftposPay/hooks.d.ts +1 -1
  16. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +35 -13
  17. package/es/components/eftposPay/payo/config.js +10 -10
  18. package/es/components/eftposPay/store/index.d.ts +2 -2
  19. package/es/components/pay/toC/model.d.ts +9 -1
  20. package/es/components/schedules/model.d.ts +9 -1
  21. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  22. package/es/components/wallet/Detail/model.d.ts +13 -1
  23. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  24. package/es/components/wallet/PointCard/model.d.ts +13 -1
  25. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  26. package/es/components/wallet/Voucher/model.d.ts +13 -1
  27. package/es/components/wallet/model.d.ts +9 -1
  28. package/lib/components/booking/addons/model.d.ts +10 -1
  29. package/lib/components/booking/forms/model.d.ts +10 -1
  30. package/lib/components/booking/info/model.d.ts +10 -1
  31. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  32. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  33. package/lib/components/booking/model.d.ts +9 -1
  34. package/lib/components/booking/notes/model.d.ts +10 -1
  35. package/lib/components/booking/payments/model.d.ts +10 -1
  36. package/lib/components/eftposPay/hooks.d.ts +1 -1
  37. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +43 -11
  38. package/lib/components/eftposPay/payo/config.js +9 -9
  39. package/lib/components/eftposPay/store/index.d.ts +2 -2
  40. package/lib/components/pay/toC/model.d.ts +9 -1
  41. package/lib/components/schedules/model.d.ts +9 -1
  42. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  43. package/lib/components/wallet/Detail/model.d.ts +13 -1
  44. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  45. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  46. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  47. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  48. package/lib/components/wallet/model.d.ts +9 -1
  49. package/package.json +3 -3
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/components/eftposPay/linkly/hooks/useTimeQuery.ts
@@ -24,15 +34,16 @@ __export(useTimeQuery_exports, {
24
34
  module.exports = __toCommonJS(useTimeQuery_exports);
25
35
  var import_react = require("react");
26
36
  var import_utils = require("@pisell/utils");
37
+ var import_dayjs = __toESM(require("dayjs"));
27
38
  var import_store = require("../../store");
28
39
  var import_hooks = require("../../hooks");
29
40
  var import_const = require("../../const");
30
41
  var import_const2 = require("../const");
31
- var GlobalTimeout = 1e3 * 60;
42
+ var GlobalTimeout = 1e3 * 60 * 2;
32
43
  var RequestTimeout = 1e3 * 5;
33
44
  var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
34
45
  const dispatch = (0, import_store.useDispatch)();
35
- const { numRef, modeRef, deviceRef } = (0, import_hooks.useStoreRef)();
46
+ const { numRef, modeRef, deviceRef, orderIdRef } = (0, import_hooks.useStoreRef)();
36
47
  const fail = (0, import_hooks.useFail)(0);
37
48
  const failRef = (0, import_react.useRef)(fail);
38
49
  const isPay = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay;
@@ -80,7 +91,6 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
80
91
  console.log("Success: 全局超时或不需要处理结果,终止查询");
81
92
  return;
82
93
  }
83
- _log("Success" /* Success */, result);
84
94
  isQueryFinishedRef.current = true;
85
95
  const data = (result == null ? void 0 : result.data) || {};
86
96
  if (data.status == 1) {
@@ -95,8 +105,11 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
95
105
  }
96
106
  if ((data == null ? void 0 : data.status) == 0 && (data == null ? void 0 : data.signature_flag) != 1) {
97
107
  console.log("交易状态为0需要继续查询");
108
+ _log("Querying" /* Querying */, result);
98
109
  isQueryFinishedRef.current = false;
99
- _resultQuery();
110
+ setTimeout(() => {
111
+ _resultQuery();
112
+ }, 1500);
100
113
  return;
101
114
  }
102
115
  if (data.status < 0) {
@@ -132,7 +145,18 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
132
145
  _log("AbortError" /* AbortError */);
133
146
  console.log("Error: 请求被取消,将继续查询");
134
147
  isQueryFinishedRef.current = false;
135
- _resultQuery();
148
+ setTimeout(() => {
149
+ _resultQuery();
150
+ }, 1500);
151
+ return;
152
+ }
153
+ if (!(error == null ? void 0 : error.code) || `${error.code}` === import_const.PayStatus.Timeout) {
154
+ _log("NetworkError" /* NetworkError */);
155
+ console.log("Error: 网关类报错,将继续查询");
156
+ isQueryFinishedRef.current = false;
157
+ setTimeout(() => {
158
+ _resultQuery();
159
+ }, 1500);
136
160
  return;
137
161
  }
138
162
  _log("Error" /* Error */, error);
@@ -197,13 +221,21 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
197
221
  session_id: numRef.current
198
222
  };
199
223
  const content = [
200
- { key: "queryId", value: JSON.stringify(queryIdRef.current) },
224
+ {
225
+ key: "description",
226
+ value: JSON.stringify({
227
+ queryId: queryIdRef.current,
228
+ orderId: orderIdRef.current,
229
+ type,
230
+ date: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
231
+ })
232
+ },
201
233
  { key: "params", value: JSON.stringify(params) }
202
234
  ];
203
- if (type === "Success" /* Success */) {
204
- content.push({ key: "response", value: JSON.stringify(res) });
205
- } else if (type === "Error" /* Error */) {
235
+ if (type === "Error" /* Error */) {
206
236
  content.push({ key: "error", value: JSON.stringify(res) });
237
+ } else {
238
+ content.push({ key: "response", value: JSON.stringify(res) });
207
239
  }
208
240
  (0, import_utils.sendWarningLog)({
209
241
  title: `Linkly-${isPay ? "Pay" : "Refund"}-交易结果轮询`,
@@ -212,8 +244,6 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
212
244
  };
213
245
  const run = () => {
214
246
  reset();
215
- console.log("开始查询linkly结果---->>>>>>>");
216
- _log("Start" /* Start */);
217
247
  globalTimeoutIdRef.current = setTimeout(() => {
218
248
  var _a;
219
249
  console.log("全局超时,终止所有重试");
@@ -224,6 +254,8 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
224
254
  startTimeRef.current = Date.now();
225
255
  isQueryFinishedRef.current = false;
226
256
  queryIdRef.current = (0, import_utils.getUniqueId)();
257
+ console.log("开始查询linkly结果---->>>>>>>");
258
+ _log("Start" /* Start */);
227
259
  return _resultQuery();
228
260
  };
229
261
  return { run, stop: reset };
@@ -148,15 +148,15 @@ var POS = ({
148
148
  const resultPromise = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay ? api.pay(
149
149
  {
150
150
  ...(custom == null ? void 0 : custom.platform) ? {
151
- "operator_id": custom.operator_id,
152
- "operator_type": custom.operator_type,
153
- "platform": custom.platform,
154
- "custom_payment_id": custom.custom_payment_id,
155
- "service_charge": {
156
- "amount": payRef.current.surMoney,
157
- "percentage": payRef.current.surPercentRate
151
+ operator_id: custom.operator_id,
152
+ operator_type: custom.operator_type,
153
+ platform: custom.platform,
154
+ custom_payment_id: custom.custom_payment_id,
155
+ service_charge: {
156
+ amount: payRef.current.surMoney,
157
+ percentage: payRef.current.surPercentRate
158
158
  },
159
- "original_amount": payRef.current.amount
159
+ original_amount: payRef.current.amount
160
160
  } : {},
161
161
  order_id: orderIdRef.current,
162
162
  amount: payRef.current.total,
@@ -215,7 +215,7 @@ var POS = ({
215
215
  if (unloadRef.current || !netRef.current) {
216
216
  return;
217
217
  }
218
- if (err && `${err.code}` === import_const.PayStatus.Timeout) {
218
+ if (!(err == null ? void 0 : err.code) || `${err.code}` === import_const.PayStatus.Timeout) {
219
219
  checkApi();
220
220
  return;
221
221
  }
@@ -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?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
301
- action?: "pay" | "amount" | "deviceList" | undefined;
300
+ eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
301
+ action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  platform: 'pc' | 'h5' | '' | undefined;
3
4
  order: any;
@@ -28,4 +29,11 @@ export interface PayGroup {
28
29
  pay_number?: string;
29
30
  _order: any;
30
31
  }
31
- export declare const Provider: any, Context: any;
32
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
33
+ state: FormState;
34
+ } & {
35
+ dispatch: (params: {
36
+ type: string;
37
+ payload: any;
38
+ }) => void;
39
+ }>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,4 +69,11 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: any, Context: any;
72
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
73
+ state: FormState;
74
+ } & {
75
+ dispatch: (params: {
76
+ type: string;
77
+ payload: any;
78
+ }) => void;
79
+ }>;
@@ -41,7 +41,7 @@ declare type ScanData = {
41
41
  };
42
42
  };
43
43
  export declare const formatScanCustomer: (data: ScanData) => {
44
- searchType: "wallet" | "walletPass" | "product" | "local_product" | "customer";
44
+ searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
45
45
  data: any;
46
46
  scanCode: string;
47
47
  } | null;
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ addWalletCard: any;
4
+ }
5
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
+ walletDetailState: RechargeState;
7
+ } & {
8
+ dispatch: (params: {
9
+ type: string;
10
+ payload: any;
11
+ }) => void;
12
+ }>;
13
+ export {};
@@ -1 +1,14 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ total: number;
4
+ setup?: 'menu' | 'list' | 'detail' | string;
5
+ }
6
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
7
+ state: RechargeState;
8
+ } & {
9
+ dispatch: (params: {
10
+ type: string;
11
+ payload: any;
12
+ }) => void;
13
+ }>;
14
+ export {};
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ total: number;
4
+ }
5
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
+ state: RechargeState;
7
+ } & {
8
+ dispatch: (params: {
9
+ type: string;
10
+ payload: any;
11
+ }) => void;
12
+ }>;
13
+ export {};
@@ -1 +1,29 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ selectedGiftOptionId: string | null;
4
+ cardList: Array<{
5
+ id: string;
6
+ name: string;
7
+ price: number;
8
+ }>;
9
+ selectedItem: {
10
+ id?: string;
11
+ gift_price?: number;
12
+ price?: number;
13
+ name?: string;
14
+ variant_id?: string;
15
+ };
16
+ productId?: string;
17
+ detailId?: string;
18
+ total: string | number;
19
+ rechargeModalOpen: boolean;
20
+ }
21
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
22
+ state: RechargeState;
23
+ } & {
24
+ dispatch: (params: {
25
+ type: string;
26
+ payload: any;
27
+ }) => void;
28
+ }>;
29
+ export {};
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ total: 0;
4
+ }
5
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
+ state: RechargeState;
7
+ } & {
8
+ dispatch: (params: {
9
+ type: string;
10
+ payload: any;
11
+ }) => void;
12
+ }>;
13
+ export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { IWalletListItemProps } from './serve';
2
3
  export interface WalletCardItemProps {
3
4
  id: string;
@@ -26,4 +27,11 @@ export interface WalletListProps {
26
27
  currentSearchListItemCode?: string;
27
28
  [key: string]: any;
28
29
  }
29
- export declare const Provider: any, Context: any;
30
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
31
+ global_wallet: WalletListProps;
32
+ } & {
33
+ dispatch: (params: {
34
+ type: string;
35
+ payload: any;
36
+ }) => void;
37
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.2.50",
3
+ "version": "6.2.51",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "react-resizable": "^3.0.5",
61
61
  "styled-components": "^6.0.0-rc.3",
62
+ "@pisell/materials": "6.2.40",
62
63
  "@pisell/icon": "0.0.11",
63
64
  "@pisell/date-picker": "3.0.4",
64
- "@pisell/utils": "3.0.1",
65
- "@pisell/materials": "6.2.40"
65
+ "@pisell/utils": "3.0.1"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",