@pisell/private-materials 6.4.19 → 6.4.20

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.
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
30
30
  * @return {*}
31
31
  * @Author: xiangfeng.xue
32
32
  */
33
- export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
33
+ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
34
34
  /**
35
35
  * 计算所有价格明细
36
36
  * @param items - 购物车商品数组
@@ -1048,25 +1048,35 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
1048
1048
  };
1049
1049
  var handleSendCustomerPaymentLink = /*#__PURE__*/function () {
1050
1050
  var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(data) {
1051
- var isCurrentOrderSynced, res;
1051
+ var order, stateAmount, isCurrentOrderSynced, res;
1052
1052
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1053
1053
  while (1) switch (_context12.prev = _context12.next) {
1054
1054
  case 0:
1055
1055
  // 先检测订单是否同步过,如果没有,需要先手动下单
1056
+ // 如果是定金模式,则需要设置当前待付金额至 os 的 deposit_amount
1057
+ order = checkoutModule.getCurrentOrderInfo();
1058
+ if (!order.isDeposit) {
1059
+ _context12.next = 5;
1060
+ break;
1061
+ }
1062
+ stateAmount = checkoutModule.getStateAmount();
1063
+ _context12.next = 5;
1064
+ return checkoutModule.setDepositAmountAsync(stateAmount);
1065
+ case 5:
1056
1066
  isCurrentOrderSynced = checkoutModule.isCurrentOrderSynced();
1057
1067
  if (isCurrentOrderSynced) {
1058
- _context12.next = 4;
1068
+ _context12.next = 9;
1059
1069
  break;
1060
1070
  }
1061
- _context12.next = 4;
1071
+ _context12.next = 9;
1062
1072
  return checkoutModule.manualSyncOrderAsync();
1063
- case 4:
1064
- _context12.next = 6;
1073
+ case 9:
1074
+ _context12.next = 11;
1065
1075
  return checkoutModule.sendCustomerPayLinkAsync({
1066
1076
  emails: data.emails,
1067
1077
  order_ids: [checkoutModule.getCurrentOrderId()]
1068
1078
  });
1069
- case 6:
1079
+ case 11:
1070
1080
  res = _context12.sent;
1071
1081
  // 支付链接发送成功 转 toC,这边可以关掉了
1072
1082
  if (res.success) {
@@ -1075,7 +1085,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
1075
1085
  } else {
1076
1086
  Toast === null || Toast === void 0 || Toast.error(res.message || locales.getText('pisell2.checkout.send-payment-link.error'));
1077
1087
  }
1078
- case 8:
1088
+ case 13:
1079
1089
  case "end":
1080
1090
  return _context12.stop();
1081
1091
  }
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
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" | "payo" | "tyro" | "windcave" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
174
174
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
175
175
  type: EActionTypes;
176
176
  payload: {
177
- status: "loading" | "warn" | "success" | "fail" | "question";
177
+ status: "loading" | "success" | "warn" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -295,9 +295,9 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
298
+ mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
300
+ eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
310
310
  form?: string | undefined;
311
- status?: "loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
312
312
  warn?: string | undefined;
313
313
  steps?: {
314
314
  /** 用于重置当前步骤 */
@@ -41,7 +41,7 @@ declare type ScanData = {
41
41
  };
42
42
  };
43
43
  export declare const formatScanCustomer: (data: ScanData) => {
44
- searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
44
+ searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
45
45
  data: any;
46
46
  scanCode: string;
47
47
  } | null;
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
30
30
  * @return {*}
31
31
  * @Author: xiangfeng.xue
32
32
  */
33
- export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
33
+ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
34
34
  /**
35
35
  * 计算所有价格明细
36
36
  * @param items - 购物车商品数组
@@ -744,6 +744,11 @@ var PaymentContent = (0, import_react.forwardRef)(
744
744
  };
745
745
  };
746
746
  const handleSendCustomerPaymentLink = async (data) => {
747
+ const order = checkoutModule.getCurrentOrderInfo();
748
+ if (order.isDeposit) {
749
+ const stateAmount = checkoutModule.getStateAmount();
750
+ await checkoutModule.setDepositAmountAsync(stateAmount);
751
+ }
747
752
  const isCurrentOrderSynced = checkoutModule.isCurrentOrderSynced();
748
753
  if (!isCurrentOrderSynced) {
749
754
  await checkoutModule.manualSyncOrderAsync();
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
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" | "payo" | "tyro" | "windcave" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
174
174
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
175
175
  type: EActionTypes;
176
176
  payload: {
177
- status: "loading" | "warn" | "success" | "fail" | "question";
177
+ status: "loading" | "success" | "warn" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -295,9 +295,9 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
298
+ mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
300
+ eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
310
310
  form?: string | undefined;
311
- status?: "loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
312
312
  warn?: string | undefined;
313
313
  steps?: {
314
314
  /** 用于重置当前步骤 */
@@ -41,7 +41,7 @@ declare type ScanData = {
41
41
  };
42
42
  };
43
43
  export declare const formatScanCustomer: (data: ScanData) => {
44
- searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
44
+ searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
45
45
  data: any;
46
46
  scanCode: string;
47
47
  } | null;
package/package.json CHANGED
@@ -1,12 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.4.19",
4
- "scripts": {
5
- "dev": "father dev",
6
- "build": "father build",
7
- "lowcode:dev": "build-scripts start --config ./build.lowcode.js",
8
- "lowcode:build": " build-scripts build --config ./build.lowcode.js"
9
- },
3
+ "version": "6.4.20",
10
4
  "main": "./lib/index.js",
11
5
  "module": "./es/index.js",
12
6
  "types": "./lib/index.d.ts",
@@ -56,10 +50,6 @@
56
50
  "@dnd-kit/modifiers": "^6.0.1",
57
51
  "@dnd-kit/sortable": "^7.0.2",
58
52
  "@dnd-kit/utilities": "^3.2.1",
59
- "@pisell/date-picker": "workspace:*",
60
- "@pisell/icon": "workspace:*",
61
- "@pisell/materials": "workspace:*",
62
- "@pisell/utils": "workspace:*",
63
53
  "ahooks": "^3.7.6",
64
54
  "antd": "^5.6.3",
65
55
  "classnames": "^2.3.2",
@@ -68,7 +58,11 @@
68
58
  "rc-virtual-list": "^3.11.3",
69
59
  "react-infinite-scroll-component": "^6.1.0",
70
60
  "react-resizable": "^3.0.5",
71
- "styled-components": "^6.0.0-rc.3"
61
+ "styled-components": "^6.0.0-rc.3",
62
+ "@pisell/date-picker": "3.0.7",
63
+ "@pisell/materials": "6.4.3",
64
+ "@pisell/utils": "3.0.2",
65
+ "@pisell/icon": "0.0.11"
72
66
  },
73
67
  "peerDependencies": {
74
68
  "react": "^18.0.0",
@@ -76,5 +70,11 @@
76
70
  },
77
71
  "componentConfig": {
78
72
  "materialSchema": "https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/assets-prod.json"
73
+ },
74
+ "scripts": {
75
+ "dev": "father dev",
76
+ "build": "father build",
77
+ "lowcode:dev": "build-scripts start --config ./build.lowcode.js",
78
+ "lowcode:build": " build-scripts build --config ./build.lowcode.js"
79
79
  }
80
80
  }