@pisell/private-materials 3.3.97 → 3.3.98
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/eftposPay/payo/config.js +1 -1
- package/lib/components/eftposPay/payo/config.js +1 -1
- package/package.json +3 -3
- package/es/components/Sales/Cart/index.d.ts +0 -53
- package/es/components/Sales/Cart/utils.d.ts +0 -63
- package/es/components/Sales/Checkout/index.d.ts +0 -37
- package/es/components/Sales/Checkout/serve.d.ts +0 -15
- package/es/components/Sales/Checkout/utils.d.ts +0 -35
- package/es/components/Sales/Summary/index.d.ts +0 -35
- package/es/components/Sales/Summary/serve.d.ts +0 -1
- package/es/components/Sales/Summary/utils.d.ts +0 -51
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -9
- package/es/components/appointmentBooking/components/Services/index.d.ts +0 -4
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
- package/es/components/appointmentBooking/deposit/index.d.ts +0 -3
- package/es/components/appointmentBooking/index.d.ts +0 -3
- package/es/components/booking/components/voucher/index.d.ts +0 -3
- package/es/components/eftposPay/const.d.ts +0 -184
- package/es/components/eftposPay/hooks.d.ts +0 -35
- package/es/components/eftposPay/index.d.ts +0 -4
- package/es/components/eftposPay/linkly/const.d.ts +0 -23
- package/es/components/eftposPay/linkly/hooks/index.d.ts +0 -2
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/es/components/eftposPay/linkly/index.d.ts +0 -2
- package/es/components/eftposPay/linkly/service.d.ts +0 -32
- package/es/components/eftposPay/manufacturer.d.ts +0 -7
- package/es/components/eftposPay/pay.d.ts +0 -20
- package/es/components/eftposPay/store/index.d.ts +0 -355
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -3
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -3
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -3
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -3
- package/es/components/eventBooking/components/bookingDetailModal/index.d.ts +0 -7
- package/es/components/eventBooking/locales.d.ts +0 -246
- package/es/components/pay/toC/PaymentMethods/index.d.ts +0 -9
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -9
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -4
- package/es/components/ticketBooking/locales.d.ts +0 -171
- package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/es/utils/index.d.ts +0 -23
- package/lib/components/Sales/Cart/index.d.ts +0 -53
- package/lib/components/Sales/Cart/utils.d.ts +0 -63
- package/lib/components/Sales/Checkout/index.d.ts +0 -37
- package/lib/components/Sales/Checkout/serve.d.ts +0 -15
- package/lib/components/Sales/Checkout/utils.d.ts +0 -35
- package/lib/components/Sales/Summary/index.d.ts +0 -35
- package/lib/components/Sales/Summary/serve.d.ts +0 -1
- package/lib/components/Sales/Summary/utils.d.ts +0 -51
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -9
- package/lib/components/appointmentBooking/components/Services/index.d.ts +0 -4
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
- package/lib/components/appointmentBooking/deposit/index.d.ts +0 -3
- package/lib/components/appointmentBooking/index.d.ts +0 -3
- package/lib/components/booking/components/voucher/index.d.ts +0 -3
- package/lib/components/eftposPay/const.d.ts +0 -184
- package/lib/components/eftposPay/hooks.d.ts +0 -35
- package/lib/components/eftposPay/index.d.ts +0 -4
- package/lib/components/eftposPay/linkly/const.d.ts +0 -23
- package/lib/components/eftposPay/linkly/hooks/index.d.ts +0 -2
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/lib/components/eftposPay/linkly/index.d.ts +0 -2
- package/lib/components/eftposPay/linkly/service.d.ts +0 -32
- package/lib/components/eftposPay/manufacturer.d.ts +0 -7
- package/lib/components/eftposPay/pay.d.ts +0 -20
- package/lib/components/eftposPay/store/index.d.ts +0 -355
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -3
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -3
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -3
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -3
- package/lib/components/eventBooking/components/bookingDetailModal/index.d.ts +0 -7
- package/lib/components/eventBooking/locales.d.ts +0 -246
- package/lib/components/pay/toC/PaymentMethods/index.d.ts +0 -9
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -9
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -4
- package/lib/components/ticketBooking/locales.d.ts +0 -171
- package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/lib/utils/index.d.ts +0 -23
|
@@ -265,7 +265,7 @@ export var Action = function Action(_ref2) {
|
|
|
265
265
|
};
|
|
266
266
|
return /*#__PURE__*/React.createElement("div", {
|
|
267
267
|
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
268
|
-
}, client
|
|
268
|
+
}, client !== ClientEnum.Merchant && isShowCancel && /*#__PURE__*/React.createElement(Button, {
|
|
269
269
|
block: true,
|
|
270
270
|
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
271
271
|
onClick: onCancel
|
|
@@ -261,7 +261,7 @@ var Action = ({ onChange }) => {
|
|
|
261
261
|
const onCancel = () => {
|
|
262
262
|
onChange("fail", { number, uniquePaymentNumber: number, device, order_id });
|
|
263
263
|
};
|
|
264
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, client
|
|
264
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, client !== import_const.ClientEnum.Merchant && isShowCancel && /* @__PURE__ */ import_react.default.createElement(
|
|
265
265
|
import_antd.Button,
|
|
266
266
|
{
|
|
267
267
|
block: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.98",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "3.0.0",
|
|
63
|
+
"@pisell/materials": "3.3.35",
|
|
63
64
|
"@pisell/icon": "0.0.11",
|
|
64
|
-
"@pisell/date-picker": "3.0.4"
|
|
65
|
-
"@pisell/materials": "3.3.35"
|
|
65
|
+
"@pisell/date-picker": "3.0.4"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TUpdateDisabledCartItem } from './types';
|
|
3
|
-
interface CartItem {
|
|
4
|
-
_id: string;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
interface CartData {
|
|
8
|
-
cartItems: CartItem[];
|
|
9
|
-
currentCartItem: CartItem | null;
|
|
10
|
-
}
|
|
11
|
-
interface CartContextType {
|
|
12
|
-
createCartItem: () => CartItem;
|
|
13
|
-
createCartItemFromEvent: (eventItem: any) => CartItem;
|
|
14
|
-
createCartItemFromHolder: (holderItem: any) => CartItem;
|
|
15
|
-
addToCart: () => void;
|
|
16
|
-
updateCartItem: (cartItem: CartItem) => CartItem;
|
|
17
|
-
deleteCartItem: (cartItem: CartItem) => void;
|
|
18
|
-
clickCartItem: (cartItem: CartItem) => void;
|
|
19
|
-
updateCurrentCartItem: (cartItem: Partial<CartItem>) => void;
|
|
20
|
-
clearCurrentCartItem: () => void;
|
|
21
|
-
currentCartItem: CartItem | null;
|
|
22
|
-
checkHolder: () => boolean;
|
|
23
|
-
cartData: CartData;
|
|
24
|
-
openCart: boolean;
|
|
25
|
-
onOpenCart: any;
|
|
26
|
-
onCloseCart: any;
|
|
27
|
-
deleteCartItemByHolder: (holder_id: number) => void;
|
|
28
|
-
addHolderToCartItem: (holderItem: any) => void;
|
|
29
|
-
cartDataHolderList: any;
|
|
30
|
-
addNoteToCartItem: (cartItem: CartItem) => void;
|
|
31
|
-
updateDisabledCartItem: TUpdateDisabledCartItem;
|
|
32
|
-
getWithoutCartItemsHolderNames: () => Array<string>;
|
|
33
|
-
checkBeforeAddToCartResquest: any;
|
|
34
|
-
checkBeforeAddToCart: () => Promise<{
|
|
35
|
-
result: boolean;
|
|
36
|
-
num: number;
|
|
37
|
-
}>;
|
|
38
|
-
}
|
|
39
|
-
interface CartProviderProps {
|
|
40
|
-
children: React.ReactNode;
|
|
41
|
-
}
|
|
42
|
-
export declare const CartContext: React.Context<CartContextType | undefined>;
|
|
43
|
-
export declare const CartProvider: React.FC<CartProviderProps>;
|
|
44
|
-
/**
|
|
45
|
-
* 使用步骤管理的Hook
|
|
46
|
-
* @throws {Error} 如果在StepProvider外部使用会抛出错误
|
|
47
|
-
* @returns {StepContextType} 步骤管理上下文
|
|
48
|
-
*/
|
|
49
|
-
export declare const useCart: () => CartContextType;
|
|
50
|
-
declare const _default: {
|
|
51
|
-
defaultState: CartData;
|
|
52
|
-
};
|
|
53
|
-
export default _default;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import Decimal from 'decimal.js';
|
|
2
|
-
import { ICalculatePriceParams } from './types';
|
|
3
|
-
export declare const handleProductInfo: (eventDetail: any, num: number) => {
|
|
4
|
-
totalPrice: number;
|
|
5
|
-
originTotal: any;
|
|
6
|
-
is_charge_tax: any;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* 获取商品总价
|
|
10
|
-
* @description 当前总价计算基于商品数量为1
|
|
11
|
-
* @param item 商品
|
|
12
|
-
* @returns 商品总价
|
|
13
|
-
*/
|
|
14
|
-
export declare const getTotalPrice: (params: ICalculatePriceParams) => number;
|
|
15
|
-
/**
|
|
16
|
-
* 获取商品原始总价
|
|
17
|
-
* @description 当前总价计算基于商品数量为1
|
|
18
|
-
* @param item 商品
|
|
19
|
-
* @returns 商品原始总价
|
|
20
|
-
*/
|
|
21
|
-
export declare const getOriginTotalPrice: (params: ICalculatePriceParams) => number | undefined;
|
|
22
|
-
export declare const handleCartItemOrigin: (cartItem: any, eventDetail: any) => any;
|
|
23
|
-
export declare const formatBundleToOrigin: (bundle: any) => any;
|
|
24
|
-
export declare const formatOptionsToOrigin: (options: any) => any;
|
|
25
|
-
export declare const handleProductDeposit: (cartItem: any, eventDetail: any, num: number) => {
|
|
26
|
-
total: number;
|
|
27
|
-
protocols: any;
|
|
28
|
-
} | null;
|
|
29
|
-
/**
|
|
30
|
-
* 获取商品定金
|
|
31
|
-
* @description 定金基于商品售价来算,最终乘商品数量
|
|
32
|
-
* 1、如果套餐主商品有定金规则,则定金为:(套餐商品总售价 * 定金百分比 + 定金固定金额)* 商品数量
|
|
33
|
-
* 2、如果套餐主商品没有定金规则,子商品有定金规则,则定金为:(套餐子商品售价 * 套餐子商品定金百分比 + 套餐子商品定金固定金额)* 商品数量,最终将所有子商品定金相加
|
|
34
|
-
* 3、普通商品/单规格商品/组合规则商品,定金规则:(商品总售价 * 定金百分比 + 定金固定金额)* 商品数量
|
|
35
|
-
* @param params 参数
|
|
36
|
-
* @returns 商品定金
|
|
37
|
-
*/
|
|
38
|
-
export declare const getProductDeposit: (params: {
|
|
39
|
-
cartItem: any;
|
|
40
|
-
product: any;
|
|
41
|
-
bundle?: any;
|
|
42
|
-
options?: any;
|
|
43
|
-
num?: number;
|
|
44
|
-
}) => {
|
|
45
|
-
total: number;
|
|
46
|
-
protocols: any;
|
|
47
|
-
} | null;
|
|
48
|
-
/**
|
|
49
|
-
* 计算商品定金
|
|
50
|
-
* @param params 参数
|
|
51
|
-
* @returns 商品定金
|
|
52
|
-
*/
|
|
53
|
-
export declare const calculateProductDeposit: (params: {
|
|
54
|
-
depositData: {
|
|
55
|
-
deposit_fixed?: string;
|
|
56
|
-
deposit_percentage?: string;
|
|
57
|
-
};
|
|
58
|
-
total: string | number;
|
|
59
|
-
num: number;
|
|
60
|
-
}) => {
|
|
61
|
-
result: boolean;
|
|
62
|
-
depositTotal: Decimal;
|
|
63
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface CheckoutData {
|
|
3
|
-
}
|
|
4
|
-
interface PayProps {
|
|
5
|
-
order_id: string;
|
|
6
|
-
amount: number;
|
|
7
|
-
sale_channel?: string;
|
|
8
|
-
is_deposit?: number;
|
|
9
|
-
deposit_amount?: number;
|
|
10
|
-
total_amount?: number;
|
|
11
|
-
}
|
|
12
|
-
interface CheckoutContextType {
|
|
13
|
-
onCheckBeforeBooking: (data: any) => Promise<{
|
|
14
|
-
result: boolean;
|
|
15
|
-
num: number;
|
|
16
|
-
}>;
|
|
17
|
-
onCheckout: (data: any) => Promise<any>;
|
|
18
|
-
onPay: (payProps: PayProps) => void;
|
|
19
|
-
createBooking: any;
|
|
20
|
-
checkBeforeBooking: any;
|
|
21
|
-
freePay: any;
|
|
22
|
-
}
|
|
23
|
-
interface CheckoutProviderProps {
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
}
|
|
26
|
-
export declare const CheckoutContext: React.Context<CheckoutContextType | undefined>;
|
|
27
|
-
export declare const CheckoutProvider: React.FC<CheckoutProviderProps>;
|
|
28
|
-
/**
|
|
29
|
-
* 使用步骤管理的Hook
|
|
30
|
-
* @throws {Error} 如果在StepProvider外部使用会抛出错误
|
|
31
|
-
* @returns {StepContextType} 步骤管理上下文
|
|
32
|
-
*/
|
|
33
|
-
export declare const useCheckout: () => CheckoutContextType;
|
|
34
|
-
declare const _default: {
|
|
35
|
-
defaultState: CheckoutData;
|
|
36
|
-
};
|
|
37
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @title: 下单前置校验接口
|
|
3
|
-
* @param {any} data
|
|
4
|
-
*/
|
|
5
|
-
export declare const checkBeforeBookingApi: (data: any) => Promise<any>;
|
|
6
|
-
/**
|
|
7
|
-
* @title: 创建订单
|
|
8
|
-
* @param {any} data
|
|
9
|
-
*/
|
|
10
|
-
export declare const createBookingApi: (data: any) => Promise<any>;
|
|
11
|
-
/**
|
|
12
|
-
* @title: 免费支付
|
|
13
|
-
* @param {string} orderId
|
|
14
|
-
*/
|
|
15
|
-
export declare const freePayApi: (orderId: string) => Promise<any>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @title: 套餐单规格信息
|
|
3
|
-
* @description:
|
|
4
|
-
* @param {any} option
|
|
5
|
-
* @return {*}
|
|
6
|
-
* @Author: zhiwei.Wang
|
|
7
|
-
* @Date: 2024-02-19 09:26
|
|
8
|
-
*/
|
|
9
|
-
export declare const formatProductOption: (option: any) => any;
|
|
10
|
-
/**
|
|
11
|
-
* @title: 套餐信息
|
|
12
|
-
* @description:
|
|
13
|
-
* @param {any} bundle
|
|
14
|
-
* @return {*}
|
|
15
|
-
* @Author: zhiwei.Wang
|
|
16
|
-
* @Date: 2024-02-19 09:26
|
|
17
|
-
*/
|
|
18
|
-
export declare const formatProductBundle: (bundle: any) => any;
|
|
19
|
-
/**
|
|
20
|
-
* @title: 格式化下单接口数据
|
|
21
|
-
* @description:
|
|
22
|
-
* @param {any} state saledModel数据源
|
|
23
|
-
* @param {boolean} excludeDisabled 是否需要排除购物车中失效商品
|
|
24
|
-
* @Author: xiangfeng.xue
|
|
25
|
-
* @Date: 2025-01-21 17:57
|
|
26
|
-
*/
|
|
27
|
-
export declare const formatValues: (state: any, excludeDisabled?: boolean, otherValue?: Record<string, any>) => any;
|
|
28
|
-
/**
|
|
29
|
-
* @title: 获取拉开表单弹窗参数
|
|
30
|
-
* @param state
|
|
31
|
-
*/
|
|
32
|
-
export declare const getFormParams: (state: any) => {
|
|
33
|
-
product_id: any;
|
|
34
|
-
appointment_type: string;
|
|
35
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface SummaryData {
|
|
3
|
-
}
|
|
4
|
-
interface SummaryContextType {
|
|
5
|
-
subtotal: number | string;
|
|
6
|
-
total: number | string;
|
|
7
|
-
taxTitle?: string;
|
|
8
|
-
totalTaxFee?: string;
|
|
9
|
-
isPriceIncludeTax?: 0 | 1;
|
|
10
|
-
deposit?: {
|
|
11
|
-
total: string;
|
|
12
|
-
protocols: any[];
|
|
13
|
-
hasDeposit: boolean;
|
|
14
|
-
};
|
|
15
|
-
isAgreeDepositPolicy: boolean;
|
|
16
|
-
setIsAgreeDepositPolicy: (value: boolean) => void;
|
|
17
|
-
getDepositProtocol: (params: {
|
|
18
|
-
id: string;
|
|
19
|
-
}) => Promise<any>;
|
|
20
|
-
}
|
|
21
|
-
interface SummaryProviderProps {
|
|
22
|
-
children: React.ReactNode;
|
|
23
|
-
}
|
|
24
|
-
export declare const SummaryContext: React.Context<SummaryContextType | undefined>;
|
|
25
|
-
export declare const SummaryProvider: React.FC<SummaryProviderProps>;
|
|
26
|
-
/**
|
|
27
|
-
* 使用步骤管理的Hook
|
|
28
|
-
* @throws {Error} 如果在StepProvider外部使用会抛出错误
|
|
29
|
-
* @returns {StepContextType} 步骤管理上下文
|
|
30
|
-
*/
|
|
31
|
-
export declare const useSummary: () => SummaryContextType;
|
|
32
|
-
declare const _default: {
|
|
33
|
-
defaultState: SummaryData;
|
|
34
|
-
};
|
|
35
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getDepositProtocolApi: (id: string) => Promise<any>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import Decimal from 'decimal.js';
|
|
2
|
-
interface CartItem {
|
|
3
|
-
price: number | string;
|
|
4
|
-
quantity?: number;
|
|
5
|
-
[k: string]: any;
|
|
6
|
-
}
|
|
7
|
-
interface PriceDetail {
|
|
8
|
-
subtotal: string;
|
|
9
|
-
total: string;
|
|
10
|
-
taxTitle?: string;
|
|
11
|
-
totalTaxFee?: string;
|
|
12
|
-
isPriceIncludeTax?: 0 | 1;
|
|
13
|
-
deposit?: {
|
|
14
|
-
total: string;
|
|
15
|
-
protocols: any[];
|
|
16
|
-
hasDeposit: boolean;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* 计算商品小计(不含其他费用)
|
|
21
|
-
* @param items - 购物车商品数组
|
|
22
|
-
* @returns 商品总价字符串,保留2位小数
|
|
23
|
-
*/
|
|
24
|
-
export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
25
|
-
/**
|
|
26
|
-
* @title: 单个商品的税费
|
|
27
|
-
* @description:
|
|
28
|
-
* 单个商品的税费 = 商品销售单价(折扣后) * 税率 * is_charge_tax /( 1+ 税率 * is_price_include_tax)
|
|
29
|
-
* $taxFee = $price * $taxRate * $isChargeTax / (1 + $taxRate * $isPriceIncludeTax);
|
|
30
|
-
* @return {*}
|
|
31
|
-
* @Author: xiangfeng.xue
|
|
32
|
-
*/
|
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
|
|
34
|
-
/**
|
|
35
|
-
* 计算所有价格明细
|
|
36
|
-
* @param items - 购物车商品数组
|
|
37
|
-
* @param options - 其他费用配置
|
|
38
|
-
* @returns 价格明细对象
|
|
39
|
-
*/
|
|
40
|
-
export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[]) => PriceDetail;
|
|
41
|
-
/**
|
|
42
|
-
* @title: 计算定金
|
|
43
|
-
* @param items - 购物车商品数组
|
|
44
|
-
* @returns 定金字符串,保留2位小数
|
|
45
|
-
*/
|
|
46
|
-
export declare const calculateDeposit: (items: CartItem[]) => {
|
|
47
|
-
total: string;
|
|
48
|
-
protocols: any[];
|
|
49
|
-
hasDeposit: never;
|
|
50
|
-
} | undefined;
|
|
51
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
2
|
-
export declare const DepositContent: (props: {
|
|
3
|
-
isAgreeDepositPolicy: boolean;
|
|
4
|
-
setIsAgreeDepositPolicy: (value: boolean) => void;
|
|
5
|
-
deposit: any;
|
|
6
|
-
depositProtocolRequest?: any;
|
|
7
|
-
}) => JSX.Element;
|
|
8
|
-
declare const Deposit: () => JSX.Element;
|
|
9
|
-
export default Deposit;
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
export declare enum EftposEnum {
|
|
2
|
-
/** 后端支付 - 仅支付 */
|
|
3
|
-
Payo = "payo",
|
|
4
|
-
/** 前端支付 */
|
|
5
|
-
Tyro = "tyro",
|
|
6
|
-
/** 后端支付 - 支付 + 退款 */
|
|
7
|
-
Windcave = "windcave",
|
|
8
|
-
Stripe = "stripe",
|
|
9
|
-
Linkly = "linkly"
|
|
10
|
-
}
|
|
11
|
-
export declare enum StatusEnum {
|
|
12
|
-
Loading = "loading",
|
|
13
|
-
Warn = "warn",
|
|
14
|
-
Fail = "fail",
|
|
15
|
-
Success = "success",
|
|
16
|
-
Pedding = "pedding",
|
|
17
|
-
Resove = "resove",
|
|
18
|
-
Reject = "reject",
|
|
19
|
-
Question = "question"
|
|
20
|
-
}
|
|
21
|
-
export declare enum ModeEnum {
|
|
22
|
-
/** 支付 */
|
|
23
|
-
Pay = "pay",
|
|
24
|
-
/** 完整支付 */
|
|
25
|
-
FullPay = "fullPay",
|
|
26
|
-
/** 退款 */
|
|
27
|
-
Refund = "refund",
|
|
28
|
-
/** 查询 */
|
|
29
|
-
Query = "query"
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* 崩溃恢复
|
|
33
|
-
*/
|
|
34
|
-
export declare enum RestoreEumn {
|
|
35
|
-
/** 常规 */
|
|
36
|
-
Normal = "normal",
|
|
37
|
-
/** 恢复 */
|
|
38
|
-
Restore = "restore"
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* 订单状态
|
|
42
|
-
*/
|
|
43
|
-
export declare enum OrderEumn {
|
|
44
|
-
/** 恢复 */
|
|
45
|
-
Restore = "restore",
|
|
46
|
-
/** 常规 */
|
|
47
|
-
Normal = "normal",
|
|
48
|
-
/** 成功 */
|
|
49
|
-
Succeed = "succeed",
|
|
50
|
-
/** 失败 */
|
|
51
|
-
Failed = "failed",
|
|
52
|
-
/** 等待 */
|
|
53
|
-
Pending = "pending",
|
|
54
|
-
/** 没有订单状态 */
|
|
55
|
-
Null = "null"
|
|
56
|
-
}
|
|
57
|
-
export declare enum ClientEnum {
|
|
58
|
-
/** 用户端 */
|
|
59
|
-
User = "user",
|
|
60
|
-
/** 商家端 */
|
|
61
|
-
Merchant = "merchant"
|
|
62
|
-
}
|
|
63
|
-
export declare enum RouteEnum {
|
|
64
|
-
/** 改价页 */
|
|
65
|
-
Amount = "amount",
|
|
66
|
-
/** 门店列表页 */
|
|
67
|
-
DeviceList = "deviceList",
|
|
68
|
-
/**支付页 */
|
|
69
|
-
Pay = "pay"
|
|
70
|
-
}
|
|
71
|
-
export declare enum PayRouteEnum {
|
|
72
|
-
Step = "step",
|
|
73
|
-
Unset = "unset"
|
|
74
|
-
}
|
|
75
|
-
export declare type RouteType = `${RouteEnum}`;
|
|
76
|
-
export declare type PayRouteType = `${PayRouteEnum}`;
|
|
77
|
-
export declare type DeviceStatusType = `${EftposEnum}`;
|
|
78
|
-
export declare type StatusType = `${StatusEnum}`;
|
|
79
|
-
export declare type ModeType = `${ModeEnum}`;
|
|
80
|
-
export interface PosProps {
|
|
81
|
-
/** 厂商类型 */
|
|
82
|
-
type: DeviceStatusType;
|
|
83
|
-
getApi: () => {
|
|
84
|
-
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
85
|
-
};
|
|
86
|
-
params: {
|
|
87
|
-
[key: string]: unknown;
|
|
88
|
-
};
|
|
89
|
-
/** 回调 */
|
|
90
|
-
onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page' | 'print' | 'mark_tx_processed', params?: {
|
|
91
|
-
[keys: string]: unknown;
|
|
92
|
-
} | string, other?: any) => void;
|
|
93
|
-
onChangeParams(...agrn: unknown[]): void;
|
|
94
|
-
terminal: {
|
|
95
|
-
network: boolean;
|
|
96
|
-
};
|
|
97
|
-
device?: {
|
|
98
|
-
[key: string]: unknown;
|
|
99
|
-
};
|
|
100
|
-
mode: ModeEnum;
|
|
101
|
-
tyroUrl?: string;
|
|
102
|
-
tyroVersion?: string;
|
|
103
|
-
source: 'normal' | 'restore';
|
|
104
|
-
}
|
|
105
|
-
export interface PayProps {
|
|
106
|
-
api: ReturnType<PosProps['getApi']>;
|
|
107
|
-
onChange: PosProps['onChangeStatus'];
|
|
108
|
-
className?: string;
|
|
109
|
-
}
|
|
110
|
-
export declare type Amount = {
|
|
111
|
-
name: string;
|
|
112
|
-
/** 订单金额 */
|
|
113
|
-
money: number;
|
|
114
|
-
/** 上一轮操作订单金额 */
|
|
115
|
-
amount: number;
|
|
116
|
-
/** 金额单位 */
|
|
117
|
-
symbol: string;
|
|
118
|
-
/** 手续费-百分率 */
|
|
119
|
-
surRate: number;
|
|
120
|
-
/** 手续费-是否开启 */
|
|
121
|
-
surMoney: number;
|
|
122
|
-
/** 手续费-是否存在 */
|
|
123
|
-
surcharge: boolean;
|
|
124
|
-
/** 是否使用原始手续费 */
|
|
125
|
-
useOriginSurcharge: boolean;
|
|
126
|
-
};
|
|
127
|
-
export declare type PayAmount = {
|
|
128
|
-
/** 手续费-百分比-带百分号 例: 1% =》 数据为 0.01 */
|
|
129
|
-
surPercentRate: string;
|
|
130
|
-
/** 手续费-百分比-不带百分号 例:1% =》 数据为 1 */
|
|
131
|
-
surRate: string;
|
|
132
|
-
/** 手续费-比例金额 amount * surPercentRate */
|
|
133
|
-
surRateMoney: string;
|
|
134
|
-
/** 手续费-固定金额 */
|
|
135
|
-
surMoney: string;
|
|
136
|
-
/** 手续费 = surPercentRate + surMoney */
|
|
137
|
-
surcharge: string;
|
|
138
|
-
/** 支付金额 (不包含手续费) */
|
|
139
|
-
amount: string;
|
|
140
|
-
/** 支付总金额 = amount + surcharge */
|
|
141
|
-
total: string;
|
|
142
|
-
/** 订单金额 */
|
|
143
|
-
sourceAmount: string;
|
|
144
|
-
/** 支付总金额带单位 + 单位 */
|
|
145
|
-
totalUnit: string;
|
|
146
|
-
};
|
|
147
|
-
export declare enum PayStatus {
|
|
148
|
-
'Success' = "200",
|
|
149
|
-
/** 未生成交易记录 */
|
|
150
|
-
'NoPay' = "4004",
|
|
151
|
-
/** 配对失效 */
|
|
152
|
-
'PairingFailure' = "606020",
|
|
153
|
-
/** 支付失败 */
|
|
154
|
-
'Unknown' = "701000",
|
|
155
|
-
/** 交易请求超时 */
|
|
156
|
-
'Timeout' = "701001",
|
|
157
|
-
/** 繁忙 EFTPOS终端暂时不可用,因为EFTPOS正在处理另一个请求。 */
|
|
158
|
-
'PayOtherEftposFailed' = "701003",
|
|
159
|
-
/** 购物者没有出示卡片/卡片金额不足/在线拒绝/卡已过期/卡被锁定 */
|
|
160
|
-
'PayCardErrorFailed' = "701004",
|
|
161
|
-
/** 断网 向EFTPOS发送消息失败。可能有网络问题,也可能没有连接websocket。 */
|
|
162
|
-
'NoNetWork' = "701005",
|
|
163
|
-
/** 交易等待超时 */
|
|
164
|
-
'PayTimeout' = "701006",
|
|
165
|
-
/** 连接失败 */
|
|
166
|
-
'SocketError' = "701007",
|
|
167
|
-
/** 银行拒绝 */
|
|
168
|
-
'PayBankRefuses' = "701008",
|
|
169
|
-
/** 签名拒绝 */
|
|
170
|
-
'SignatureDeclined' = "701009",
|
|
171
|
-
/** 配置参数错误 */
|
|
172
|
-
'UserConfigError' = "701010"
|
|
173
|
-
}
|
|
174
|
-
export interface ActionProps {
|
|
175
|
-
onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
|
|
176
|
-
[key: string]: unknown;
|
|
177
|
-
} | string) => void;
|
|
178
|
-
api: {
|
|
179
|
-
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
180
|
-
};
|
|
181
|
-
className?: string;
|
|
182
|
-
isMobile?: boolean;
|
|
183
|
-
formatAmount: (amount: number | string, precision: number, symbol: string) => string;
|
|
184
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PayStatus } from './const';
|
|
3
|
-
import { ModeEnum, ClientEnum } from './const';
|
|
4
|
-
export declare const useStoreRef: <T extends {
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
} = {
|
|
7
|
-
[key: string]: unknown;
|
|
8
|
-
}, U extends {
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
} = {
|
|
11
|
-
[key: string]: unknown;
|
|
12
|
-
}>() => {
|
|
13
|
-
readonly deviceRef: React.MutableRefObject<T>;
|
|
14
|
-
readonly payRef: React.MutableRefObject<U>;
|
|
15
|
-
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
|
-
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
|
-
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
|
-
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
|
-
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
|
-
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
|
|
23
|
-
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
|
-
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* @title: 通用失败处理
|
|
28
|
-
* @description: 固定步骤 错误处理逻辑
|
|
29
|
-
* @return null
|
|
30
|
-
* @Author: hongbing.wang
|
|
31
|
-
* @Date: 2024-08-12 11:54
|
|
32
|
-
*/
|
|
33
|
-
export declare const useFail: (index: number) => (res: {
|
|
34
|
-
code?: `${PayStatus}`;
|
|
35
|
-
}, isMark?: boolean) => void;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { State } from '../store';
|
|
2
|
-
import { ModeEnum } from '../const';
|
|
3
|
-
export declare const getStep: (mode?: ModeEnum) => State['steps'];
|
|
4
|
-
declare const _default: (params: any) => State;
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare enum EVisibleButtonType {
|
|
7
|
-
/** 取消按钮 */
|
|
8
|
-
CancelButton = "CancelButton",
|
|
9
|
-
/** 等待按钮 */
|
|
10
|
-
WaitButton = "WaitButton"
|
|
11
|
-
}
|
|
12
|
-
export declare enum LinklyActionStatus {
|
|
13
|
-
/** 空 */
|
|
14
|
-
Empty = "Empty",
|
|
15
|
-
/** 取消 */
|
|
16
|
-
Cancel = "Cancel",
|
|
17
|
-
/** 取消中 */
|
|
18
|
-
CancelWaiting = "CancelWaiting",
|
|
19
|
-
/** 签名 */
|
|
20
|
-
Signature = "Signature",
|
|
21
|
-
/** 签名等待中 */
|
|
22
|
-
SignatureWaiting = "SignatureWaiting"
|
|
23
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 支付或退款
|
|
3
|
-
* @param failAction 失败回调
|
|
4
|
-
*/
|
|
5
|
-
export declare const useLinklyPayOrRefund: (handleCheck: () => boolean) => {
|
|
6
|
-
action: {
|
|
7
|
-
pay: import("ahooks/lib/useRequest/src/types").Result<any, [data: any]>;
|
|
8
|
-
};
|
|
9
|
-
payOrRefund: (resultQuery: any, handleLinklySuccess: any) => void;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @title: 取消支付或退款
|
|
13
|
-
* @description: 取消支付或退款调用接口后不管成功还是失败都需要调用支付查询接口
|
|
14
|
-
*/
|
|
15
|
-
export declare const useLinklyCancel: (handleCheck: () => boolean) => {
|
|
16
|
-
action: {
|
|
17
|
-
cancel: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
|
|
18
|
-
};
|
|
19
|
-
linklyCancel: (resultQuery: any) => void;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* @title: 支付或退款签名
|
|
23
|
-
* @description: 支付或退款签名调用接口后不管成功还是失败都需要调用支付查询接口
|
|
24
|
-
*/
|
|
25
|
-
export declare const useLinklySignature: (handleCheck: () => boolean) => {
|
|
26
|
-
action: {
|
|
27
|
-
signature: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
|
|
28
|
-
};
|
|
29
|
-
linklySignature: (status: number, resultQuery: any) => void;
|
|
30
|
-
};
|