@pisell/private-materials 3.0.95 → 3.0.97
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +16 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -8
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/eftpos/const.d.ts +38 -0
- package/es/components/eftpos/const.js +79 -0
- package/es/components/eftpos/device.d.ts +8 -0
- package/es/components/eftpos/device.js +30 -0
- package/es/components/eftpos/form/index.d.ts +16 -0
- package/es/components/eftpos/form/index.js +113 -0
- package/es/components/eftpos/index.d.ts +37 -0
- package/es/components/eftpos/index.js +274 -0
- package/es/components/eftpos/index.less +153 -0
- package/es/components/eftpos/locales.d.ts +75 -0
- package/es/components/eftpos/locales.js +98 -0
- package/es/components/eftpos/pos.d.ts +9 -0
- package/es/components/eftpos/pos.js +33 -0
- package/es/components/eftpos/surcharge/index.css +17 -0
- package/es/components/eftpos/surcharge/index.d.ts +8 -0
- package/es/components/eftpos/surcharge/index.js +111 -0
- package/es/components/eftpos/table.d.ts +17 -0
- package/es/components/eftpos/table.js +236 -0
- package/es/components/eftposPay/amount.d.ts +14 -0
- package/es/components/eftposPay/amount.js +253 -0
- package/es/components/eftposPay/component/alert/index.d.ts +6 -0
- package/es/components/eftposPay/component/alert/index.js +11 -0
- package/es/components/eftposPay/component/alert/index.less +29 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +3 -0
- package/es/components/eftposPay/component/alert/warn.js +45 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +4 -0
- package/es/components/eftposPay/component/fail/failCustom.js +95 -0
- package/es/components/eftposPay/component/fail/index.d.ts +4 -0
- package/es/components/eftposPay/component/fail/index.js +105 -0
- package/es/components/eftposPay/component/fail/network.d.ts +4 -0
- package/es/components/eftposPay/component/fail/network.js +48 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +4 -0
- package/es/components/eftposPay/component/fail/unknow.js +43 -0
- package/es/components/eftposPay/component/header/index.d.ts +9 -0
- package/es/components/eftposPay/component/header/index.js +66 -0
- package/es/components/eftposPay/component/header/index.less +44 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +13 -0
- package/es/components/eftposPay/component/header/titlebar.js +39 -0
- package/es/components/eftposPay/component/header/titlebar.less +17 -0
- package/es/components/eftposPay/component/manual/index.d.ts +5 -0
- package/es/components/eftposPay/component/manual/index.js +91 -0
- package/es/components/eftposPay/component/manual/index.less +96 -0
- package/es/components/eftposPay/component/signature/index.d.ts +4 -0
- package/es/components/eftposPay/component/signature/index.js +63 -0
- package/es/components/eftposPay/component/step/index.d.ts +12 -0
- package/es/components/eftposPay/component/step/index.js +31 -0
- package/es/components/eftposPay/component/step/step.d.ts +9 -0
- package/es/components/eftposPay/component/step/step.js +23 -0
- package/es/components/eftposPay/const.d.ts +131 -0
- package/es/components/eftposPay/const.js +48 -0
- package/es/components/eftposPay/device.d.ts +14 -0
- package/es/components/eftposPay/device.js +124 -0
- package/es/components/eftposPay/device.less +61 -0
- package/es/components/eftposPay/eftpos/config.d.ts +11 -0
- package/es/components/eftposPay/eftpos/config.js +178 -0
- package/es/components/eftposPay/eftpos/const.d.ts +10 -0
- package/es/components/eftposPay/eftpos/const.js +139 -0
- package/es/components/eftposPay/eftpos/index.d.ts +7 -0
- package/es/components/eftposPay/eftpos/index.js +35 -0
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +35 -0
- package/es/components/eftposPay/hooks.d.ts +4 -0
- package/es/components/eftposPay/hooks.js +153 -0
- package/es/components/eftposPay/index.d.ts +7 -0
- package/es/components/eftposPay/index.js +188 -0
- package/es/components/eftposPay/index.less +273 -0
- package/es/components/eftposPay/locales.d.ts +264 -0
- package/es/components/eftposPay/locales.js +384 -0
- package/es/components/eftposPay/manufacturer.d.ts +6 -0
- package/es/components/eftposPay/manufacturer.js +32 -0
- package/es/components/eftposPay/pay.d.ts +10 -0
- package/es/components/eftposPay/pay.js +108 -0
- package/es/components/eftposPay/payo/config.d.ts +11 -0
- package/es/components/eftposPay/payo/config.js +357 -0
- package/es/components/eftposPay/payo/const.d.ts +6 -0
- package/es/components/eftposPay/payo/const.js +93 -0
- package/es/components/eftposPay/payo/hooks.d.ts +5 -0
- package/es/components/eftposPay/payo/hooks.js +84 -0
- package/es/components/eftposPay/payo/index.d.ts +7 -0
- package/es/components/eftposPay/payo/index.js +35 -0
- package/es/components/eftposPay/store/index.d.ts +239 -0
- package/es/components/eftposPay/store/index.js +304 -0
- package/es/components/eftposPay/store/useThunkReducer.d.ts +9 -0
- package/es/components/eftposPay/store/useThunkReducer.js +31 -0
- package/es/components/eftposPay/windcave/action.d.ts +8 -0
- package/es/components/eftposPay/windcave/action.js +104 -0
- package/es/components/eftposPay/windcave/const.d.ts +104 -0
- package/es/components/eftposPay/windcave/const.js +253 -0
- package/es/components/eftposPay/windcave/helper.d.ts +9 -0
- package/es/components/eftposPay/windcave/helper.js +314 -0
- package/es/components/eftposPay/windcave/hook.d.ts +14 -0
- package/es/components/eftposPay/windcave/hook.js +144 -0
- package/es/components/eftposPay/windcave/index.d.ts +8 -0
- package/es/components/eftposPay/windcave/index.js +49 -0
- package/es/components/eftposPay/windcave/pos.d.ts +8 -0
- package/es/components/eftposPay/windcave/pos.js +180 -0
- package/es/components/eftposPay/windcave/pwd.d.ts +8 -0
- package/es/components/eftposPay/windcave/pwd.js +124 -0
- package/es/components/eftposPay/windcave/receipet.d.ts +6 -0
- package/es/components/eftposPay/windcave/receipet.js +67 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +11 -0
- package/es/components/eftposPay/windcave/receiptAction.js +326 -0
- package/es/components/eftposPay/windcave/timer.d.ts +17 -0
- package/es/components/eftposPay/windcave/timer.js +181 -0
- package/es/components/eftposPay/windcave/wait.d.ts +12 -0
- package/es/components/eftposPay/windcave/wait.js +139 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +6 -0
- package/es/components/eftposPay/windcave/windcave.js +283 -0
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/es/hooks/usePrefix.d.ts +1 -0
- package/es/hooks/usePrefix.js +10 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/eftpos/const.d.ts +38 -0
- package/lib/components/eftpos/const.js +108 -0
- package/lib/components/eftpos/device.d.ts +8 -0
- package/lib/components/eftpos/device.js +55 -0
- package/lib/components/eftpos/form/index.d.ts +16 -0
- package/lib/components/eftpos/form/index.js +124 -0
- package/lib/components/eftpos/index.d.ts +37 -0
- package/lib/components/eftpos/index.js +279 -0
- package/lib/components/eftpos/index.less +153 -0
- package/lib/components/eftpos/locales.d.ts +75 -0
- package/lib/components/eftpos/locales.js +116 -0
- package/lib/components/eftpos/pos.d.ts +9 -0
- package/lib/components/eftpos/pos.js +55 -0
- package/lib/components/eftpos/surcharge/index.css +17 -0
- package/lib/components/eftpos/surcharge/index.d.ts +8 -0
- package/lib/components/eftpos/surcharge/index.js +125 -0
- package/lib/components/eftpos/table.d.ts +17 -0
- package/lib/components/eftpos/table.js +235 -0
- package/lib/components/eftposPay/amount.d.ts +14 -0
- package/lib/components/eftposPay/amount.js +239 -0
- package/lib/components/eftposPay/component/alert/index.d.ts +6 -0
- package/lib/components/eftposPay/component/alert/index.js +38 -0
- package/lib/components/eftposPay/component/alert/index.less +29 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +3 -0
- package/lib/components/eftposPay/component/alert/warn.js +80 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +117 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/index.js +121 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/network.js +65 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/unknow.js +72 -0
- package/lib/components/eftposPay/component/header/index.d.ts +9 -0
- package/lib/components/eftposPay/component/header/index.js +92 -0
- package/lib/components/eftposPay/component/header/index.less +44 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +13 -0
- package/lib/components/eftposPay/component/header/titlebar.js +55 -0
- package/lib/components/eftposPay/component/header/titlebar.less +17 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +5 -0
- package/lib/components/eftposPay/component/manual/index.js +101 -0
- package/lib/components/eftposPay/component/manual/index.less +96 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +4 -0
- package/lib/components/eftposPay/component/signature/index.js +80 -0
- package/lib/components/eftposPay/component/step/index.d.ts +12 -0
- package/lib/components/eftposPay/component/step/index.js +71 -0
- package/lib/components/eftposPay/component/step/step.d.ts +9 -0
- package/lib/components/eftposPay/component/step/step.js +59 -0
- package/lib/components/eftposPay/const.d.ts +131 -0
- package/lib/components/eftposPay/const.js +86 -0
- package/lib/components/eftposPay/device.d.ts +14 -0
- package/lib/components/eftposPay/device.js +127 -0
- package/lib/components/eftposPay/device.less +61 -0
- package/lib/components/eftposPay/eftpos/config.d.ts +11 -0
- package/lib/components/eftposPay/eftpos/config.js +199 -0
- package/lib/components/eftposPay/eftpos/const.d.ts +10 -0
- package/lib/components/eftposPay/eftpos/const.js +165 -0
- package/lib/components/eftposPay/eftpos/index.d.ts +7 -0
- package/lib/components/eftposPay/eftpos/index.js +66 -0
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +62 -0
- package/lib/components/eftposPay/hooks.d.ts +4 -0
- package/lib/components/eftposPay/hooks.js +237 -0
- package/lib/components/eftposPay/index.d.ts +7 -0
- package/lib/components/eftposPay/index.js +189 -0
- package/lib/components/eftposPay/index.less +273 -0
- package/lib/components/eftposPay/locales.d.ts +264 -0
- package/lib/components/eftposPay/locales.js +304 -0
- package/lib/components/eftposPay/manufacturer.d.ts +6 -0
- package/lib/components/eftposPay/manufacturer.js +77 -0
- package/lib/components/eftposPay/pay.d.ts +10 -0
- package/lib/components/eftposPay/pay.js +120 -0
- package/lib/components/eftposPay/payo/config.d.ts +11 -0
- package/lib/components/eftposPay/payo/config.js +377 -0
- package/lib/components/eftposPay/payo/const.d.ts +6 -0
- package/lib/components/eftposPay/payo/const.js +112 -0
- package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
- package/lib/components/eftposPay/payo/hooks.js +80 -0
- package/lib/components/eftposPay/payo/index.d.ts +7 -0
- package/lib/components/eftposPay/payo/index.js +63 -0
- package/lib/components/eftposPay/store/index.d.ts +239 -0
- package/lib/components/eftposPay/store/index.js +371 -0
- package/lib/components/eftposPay/store/useThunkReducer.d.ts +9 -0
- package/lib/components/eftposPay/store/useThunkReducer.js +53 -0
- package/lib/components/eftposPay/windcave/action.d.ts +8 -0
- package/lib/components/eftposPay/windcave/action.js +143 -0
- package/lib/components/eftposPay/windcave/const.d.ts +104 -0
- package/lib/components/eftposPay/windcave/const.js +300 -0
- package/lib/components/eftposPay/windcave/helper.d.ts +9 -0
- package/lib/components/eftposPay/windcave/helper.js +378 -0
- package/lib/components/eftposPay/windcave/hook.d.ts +14 -0
- package/lib/components/eftposPay/windcave/hook.js +139 -0
- package/lib/components/eftposPay/windcave/index.d.ts +8 -0
- package/lib/components/eftposPay/windcave/index.js +78 -0
- package/lib/components/eftposPay/windcave/pos.d.ts +8 -0
- package/lib/components/eftposPay/windcave/pos.js +197 -0
- package/lib/components/eftposPay/windcave/pwd.d.ts +8 -0
- package/lib/components/eftposPay/windcave/pwd.js +143 -0
- package/lib/components/eftposPay/windcave/receipet.d.ts +6 -0
- package/lib/components/eftposPay/windcave/receipet.js +93 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +11 -0
- package/lib/components/eftposPay/windcave/receiptAction.js +386 -0
- package/lib/components/eftposPay/windcave/timer.d.ts +17 -0
- package/lib/components/eftposPay/windcave/timer.js +126 -0
- package/lib/components/eftposPay/windcave/wait.d.ts +12 -0
- package/lib/components/eftposPay/windcave/wait.js +163 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +6 -0
- package/lib/components/eftposPay/windcave/windcave.js +283 -0
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/lib/hooks/usePrefix.d.ts +1 -0
- package/lib/hooks/usePrefix.js +44 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/eftpos/meta.ts +187 -0
- package/lowcode/eftpos-pay/meta.ts +122 -0
- package/package.json +4 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export declare enum EftposEnum {
|
|
2
|
+
Payo = "payo",
|
|
3
|
+
Tyro = "tyro",
|
|
4
|
+
Windcave = "windcave",
|
|
5
|
+
Stripe = "stripe",
|
|
6
|
+
Eftpos = "eftpos"
|
|
7
|
+
}
|
|
8
|
+
export declare enum StatusEnum {
|
|
9
|
+
Loading = "loading",
|
|
10
|
+
Warn = "warn",
|
|
11
|
+
Fail = "fail",
|
|
12
|
+
Success = "success",
|
|
13
|
+
Pedding = "pedding",
|
|
14
|
+
Resove = "resove",
|
|
15
|
+
Reject = "reject",
|
|
16
|
+
Question = "question"
|
|
17
|
+
}
|
|
18
|
+
export declare enum ModeEnum {
|
|
19
|
+
/** 支付 */
|
|
20
|
+
Pay = "pay",
|
|
21
|
+
/** 退款 */
|
|
22
|
+
Refund = "refund",
|
|
23
|
+
/** 查询 */
|
|
24
|
+
Query = "query"
|
|
25
|
+
}
|
|
26
|
+
export declare enum RouteEnum {
|
|
27
|
+
/** 改价页 */
|
|
28
|
+
Amount = "amount",
|
|
29
|
+
/** 门店列表页 */
|
|
30
|
+
DeviceList = "deviceList",
|
|
31
|
+
/**支付页 */
|
|
32
|
+
Pay = "pay"
|
|
33
|
+
}
|
|
34
|
+
export declare enum PayRouteEnum {
|
|
35
|
+
Step = "step",
|
|
36
|
+
Unset = "unset"
|
|
37
|
+
}
|
|
38
|
+
export declare type RouteType = `${RouteEnum}`;
|
|
39
|
+
export declare type PayRouteType = `${PayRouteEnum}`;
|
|
40
|
+
export declare type DeviceStatusType = `${EftposEnum}`;
|
|
41
|
+
export declare type StatusType = `${StatusEnum}`;
|
|
42
|
+
export declare type ModeType = `${ModeEnum}`;
|
|
43
|
+
export interface PosProps {
|
|
44
|
+
/** 厂商类型 */
|
|
45
|
+
type: DeviceStatusType;
|
|
46
|
+
getApi: () => {
|
|
47
|
+
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
48
|
+
};
|
|
49
|
+
params: {
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
};
|
|
52
|
+
/** 回调 */
|
|
53
|
+
onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
|
|
54
|
+
[keys: string]: unknown;
|
|
55
|
+
} | string) => void;
|
|
56
|
+
terminal: {
|
|
57
|
+
network: boolean;
|
|
58
|
+
};
|
|
59
|
+
device?: {
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
};
|
|
62
|
+
action: RouteType;
|
|
63
|
+
}
|
|
64
|
+
export interface PayProps {
|
|
65
|
+
api: ReturnType<PosProps['getApi']>;
|
|
66
|
+
onChange: PosProps['onChangeStatus'];
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
export declare type Amount = {
|
|
70
|
+
name: string;
|
|
71
|
+
/** 订单金额 */
|
|
72
|
+
money: number;
|
|
73
|
+
/** 上一轮操作订单金额 */
|
|
74
|
+
amount: number;
|
|
75
|
+
/** 金额单位 */
|
|
76
|
+
symbol: string;
|
|
77
|
+
/** 手续费-百分率 */
|
|
78
|
+
surRate: number;
|
|
79
|
+
/** 手续费-是否开启 */
|
|
80
|
+
surMoney: number;
|
|
81
|
+
/** 手续费-是否存在 */
|
|
82
|
+
surcharge: boolean;
|
|
83
|
+
};
|
|
84
|
+
export declare type PayAmount = {
|
|
85
|
+
/** 手续费-百分比-带百分号 例: 1% =》 数据为 0.01 */
|
|
86
|
+
surPercentRate: string;
|
|
87
|
+
/** 手续费-百分比-不带百分号 例:1% =》 数据为 1 */
|
|
88
|
+
surRate: string;
|
|
89
|
+
/** 手续费-比例金额 amount * surPercentRate */
|
|
90
|
+
surRateMoney: string;
|
|
91
|
+
/** 手续费-固定金额 */
|
|
92
|
+
surMoney: string;
|
|
93
|
+
/** 手续费 = surPercentRate + surMoney */
|
|
94
|
+
surcharge: string;
|
|
95
|
+
/** 支付金额 (不包含手续费) */
|
|
96
|
+
amount: string;
|
|
97
|
+
/** 支付总金额 = amount + surcharge */
|
|
98
|
+
total: string;
|
|
99
|
+
/** 订单金额 */
|
|
100
|
+
sourceAmount: string;
|
|
101
|
+
/** 支付总金额带单位 + 单位 */
|
|
102
|
+
totalUnit: string;
|
|
103
|
+
};
|
|
104
|
+
export declare enum PayStatus {
|
|
105
|
+
'Success' = "200",
|
|
106
|
+
/** 未生成交易记录 */
|
|
107
|
+
'NoPay' = "4004",
|
|
108
|
+
/** 支付失败 */
|
|
109
|
+
'Unknown' = "701000",
|
|
110
|
+
/** 交易请求超时 */
|
|
111
|
+
'Timeout' = "701001",
|
|
112
|
+
/** 繁忙 EFTPOS终端暂时不可用,因为EFTPOS正在处理另一个请求。 */
|
|
113
|
+
'PayOtherEftposFailed' = "701003",
|
|
114
|
+
/** 购物者没有出示卡片/卡片金额不足/在线拒绝/卡已过期/卡被锁定 */
|
|
115
|
+
'PayCardErrorFailed' = "701004",
|
|
116
|
+
/** 断网 向EFTPOS发送消息失败。可能有网络问题,也可能没有连接websocket。 */
|
|
117
|
+
'NoNetWork' = "701005",
|
|
118
|
+
/** 交易等待超时 */
|
|
119
|
+
'PayTimeout' = "701006",
|
|
120
|
+
/** 连接失败 */
|
|
121
|
+
'SocketError' = "701007"
|
|
122
|
+
}
|
|
123
|
+
export interface ActionProps {
|
|
124
|
+
onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
|
|
125
|
+
[key: string]: unknown;
|
|
126
|
+
} | string) => void;
|
|
127
|
+
api: {
|
|
128
|
+
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
129
|
+
};
|
|
130
|
+
className?: string;
|
|
131
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export var EftposEnum;
|
|
2
|
+
(function (EftposEnum) {
|
|
3
|
+
EftposEnum["Payo"] = "payo";
|
|
4
|
+
EftposEnum["Tyro"] = "tyro";
|
|
5
|
+
EftposEnum["Windcave"] = "windcave";
|
|
6
|
+
EftposEnum["Stripe"] = "stripe";
|
|
7
|
+
EftposEnum["Eftpos"] = "eftpos";
|
|
8
|
+
})(EftposEnum || (EftposEnum = {}));
|
|
9
|
+
export var StatusEnum;
|
|
10
|
+
(function (StatusEnum) {
|
|
11
|
+
StatusEnum["Loading"] = "loading";
|
|
12
|
+
StatusEnum["Warn"] = "warn";
|
|
13
|
+
StatusEnum["Fail"] = "fail";
|
|
14
|
+
StatusEnum["Success"] = "success";
|
|
15
|
+
StatusEnum["Pedding"] = "pedding";
|
|
16
|
+
StatusEnum["Resove"] = "resove";
|
|
17
|
+
StatusEnum["Reject"] = "reject";
|
|
18
|
+
StatusEnum["Question"] = "question";
|
|
19
|
+
})(StatusEnum || (StatusEnum = {}));
|
|
20
|
+
export var ModeEnum;
|
|
21
|
+
(function (ModeEnum) {
|
|
22
|
+
ModeEnum["Pay"] = "pay";
|
|
23
|
+
ModeEnum["Refund"] = "refund";
|
|
24
|
+
ModeEnum["Query"] = "query";
|
|
25
|
+
})(ModeEnum || (ModeEnum = {}));
|
|
26
|
+
export var RouteEnum;
|
|
27
|
+
(function (RouteEnum) {
|
|
28
|
+
RouteEnum["Amount"] = "amount";
|
|
29
|
+
RouteEnum["DeviceList"] = "deviceList";
|
|
30
|
+
RouteEnum["Pay"] = "pay";
|
|
31
|
+
})(RouteEnum || (RouteEnum = {}));
|
|
32
|
+
export var PayRouteEnum;
|
|
33
|
+
(function (PayRouteEnum) {
|
|
34
|
+
PayRouteEnum["Step"] = "step";
|
|
35
|
+
PayRouteEnum["Unset"] = "unset";
|
|
36
|
+
})(PayRouteEnum || (PayRouteEnum = {}));
|
|
37
|
+
export var PayStatus;
|
|
38
|
+
(function (PayStatus) {
|
|
39
|
+
PayStatus["Success"] = "200";
|
|
40
|
+
PayStatus["NoPay"] = "4004";
|
|
41
|
+
PayStatus["Unknown"] = "701000";
|
|
42
|
+
PayStatus["Timeout"] = "701001";
|
|
43
|
+
PayStatus["PayOtherEftposFailed"] = "701003";
|
|
44
|
+
PayStatus["PayCardErrorFailed"] = "701004";
|
|
45
|
+
PayStatus["NoNetWork"] = "701005";
|
|
46
|
+
PayStatus["PayTimeout"] = "701006";
|
|
47
|
+
PayStatus["SocketError"] = "701007";
|
|
48
|
+
})(PayStatus || (PayStatus = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PayProps, PosProps } from './const';
|
|
3
|
+
import './device.less';
|
|
4
|
+
declare const _default: ({ api, onChange, onClose, className, isIpad, net, }: {
|
|
5
|
+
api: PayProps['api'];
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
onChange?: ((status: "page" | "success" | "fail", params?: string | {
|
|
8
|
+
[keys: string]: unknown;
|
|
9
|
+
} | undefined) => void) | undefined;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
isIpad: boolean;
|
|
12
|
+
net: boolean;
|
|
13
|
+
}) => React.JSX.Element;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { locales } from '@pisell/utils';
|
|
8
|
+
import { useMount } from 'ahooks';
|
|
9
|
+
import { Spin, message } from 'antd';
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
|
+
import Titlebar from "./component/header/titlebar";
|
|
12
|
+
import { ModeEnum } from "./const";
|
|
13
|
+
import { useDispatch, useContextData, updateDevice } from "./store";
|
|
14
|
+
import "./device.less";
|
|
15
|
+
export default (function (_ref) {
|
|
16
|
+
var api = _ref.api,
|
|
17
|
+
onChange = _ref.onChange,
|
|
18
|
+
onClose = _ref.onClose,
|
|
19
|
+
_ref$className = _ref.className,
|
|
20
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
21
|
+
isIpad = _ref.isIpad,
|
|
22
|
+
net = _ref.net;
|
|
23
|
+
var _useContextData = useContextData(),
|
|
24
|
+
device = _useContextData.device,
|
|
25
|
+
mode = _useContextData.mode,
|
|
26
|
+
eftpos = _useContextData.eftpos;
|
|
27
|
+
var _useState = useState(false),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
loading = _useState2[0],
|
|
30
|
+
setLoading = _useState2[1];
|
|
31
|
+
var _useState3 = useState(true),
|
|
32
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
|
+
dataStaus = _useState4[0],
|
|
34
|
+
setDataStaus = _useState4[1];
|
|
35
|
+
var _useState5 = useState([]),
|
|
36
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
|
+
list = _useState6[0],
|
|
38
|
+
setList = _useState6[1];
|
|
39
|
+
var dispatch = useDispatch();
|
|
40
|
+
var onClick = function onClick(event) {
|
|
41
|
+
if (!net) {
|
|
42
|
+
message.open({
|
|
43
|
+
key: 'net-warning',
|
|
44
|
+
type: 'warning',
|
|
45
|
+
content: locales.getText('page.eftpos-pay.text.not.connected')
|
|
46
|
+
});
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
var _ref2 = [Number(event.currentTarget.dataset.index)],
|
|
50
|
+
index = _ref2[0];
|
|
51
|
+
dispatch(updateDevice({
|
|
52
|
+
device: list[index]
|
|
53
|
+
}));
|
|
54
|
+
if (typeof onChange === 'function') {
|
|
55
|
+
onChange('page', mode === ModeEnum.Pay ? 'amount' : 'pay');
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
useMount(function () {
|
|
59
|
+
setLoading(true);
|
|
60
|
+
api.getDeviceList({
|
|
61
|
+
type: eftpos,
|
|
62
|
+
status: 'paired'
|
|
63
|
+
}).then(function (res) {
|
|
64
|
+
setLoading(false);
|
|
65
|
+
if (res && Array.isArray(res.list) && res.list.length > 0) {
|
|
66
|
+
setDataStaus(true);
|
|
67
|
+
setList(res.list);
|
|
68
|
+
if (res.list.length === 1) {
|
|
69
|
+
dispatch(updateDevice({
|
|
70
|
+
device: res.list[0]
|
|
71
|
+
}));
|
|
72
|
+
if (typeof api.selectDevice === 'function') {
|
|
73
|
+
api.selectDevice(res.list[0]);
|
|
74
|
+
}
|
|
75
|
+
if (typeof onChange === 'function') {
|
|
76
|
+
onChange('page', mode === ModeEnum.Pay ? 'amount' : 'pay');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
setDataStaus(false);
|
|
82
|
+
}, function () {
|
|
83
|
+
setDataStaus(false);
|
|
84
|
+
setLoading(false);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: "pisell-lowcode__eft-pay-device-box ".concat(className)
|
|
89
|
+
}, isIpad ? null : /*#__PURE__*/React.createElement(Titlebar, {
|
|
90
|
+
type: "left-title-close",
|
|
91
|
+
onClose: onClose
|
|
92
|
+
}, dataStaus ? locales.getText('page.eftpos-pay.text.device') : ''), dataStaus ? /*#__PURE__*/React.createElement(Spin, {
|
|
93
|
+
spinning: loading
|
|
94
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "pisell-lowcode__eft-pay-device-list",
|
|
96
|
+
style: isIpad ? {
|
|
97
|
+
marginTop: '20px'
|
|
98
|
+
} : {}
|
|
99
|
+
}, list.map(function (_ref3, index) {
|
|
100
|
+
var id = _ref3.id,
|
|
101
|
+
name = _ref3.name;
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
key: id,
|
|
104
|
+
className: "pisell-lowcode__eft-pay-device ".concat(id === (device === null || device === void 0 ? void 0 : device.id) ? 'active' : ''),
|
|
105
|
+
"data-index": index,
|
|
106
|
+
onClick: onClick,
|
|
107
|
+
role: "button",
|
|
108
|
+
tabIndex: index
|
|
109
|
+
}, name);
|
|
110
|
+
}))) : /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
className: "pisell-lowcode__eft-pay-device-error",
|
|
112
|
+
style: isIpad ? {
|
|
113
|
+
marginTop: '20px'
|
|
114
|
+
} : {}
|
|
115
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: "pisell-lowcode__eft-pay-device-error-tit"
|
|
117
|
+
}, locales.getText('page.eftpos-pay.text.device.no.title')), /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: "pisell-lowcode__eft-pay-device-error-txt"
|
|
119
|
+
}, locales.getText('page.eftpos-pay.text.device.no.add')), /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
className: "pisell-lowcode__eft-pay-device-error-txt"
|
|
121
|
+
}, locales.getText('page.eftpos-pay.text.device.no.web')), /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: "pisell-lowcode__eft-pay-device-error-txt"
|
|
123
|
+
}, locales.getText('page.eftpos-pay.text.device.no.terminal'))));
|
|
124
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.pisell-lowcode__eft-pay-device-box {
|
|
2
|
+
max-height: var(--pisel-lc-pos-device-max-height, unset);
|
|
3
|
+
width: var(--pisel-lc-pos-device-width, 400px);
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
padding: var(--pisel-lc-pos-device-padding, 0 24px 24px);
|
|
6
|
+
}
|
|
7
|
+
.pisell-lowcode__eft-pay-device-list,
|
|
8
|
+
.pisell-lowcode__eft-pay-device-error {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
|
|
12
|
+
overflow: auto;
|
|
13
|
+
min-height: 200px;
|
|
14
|
+
margin: 0 0 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pisell-lowcode__eft-pay-device-list {
|
|
18
|
+
gap: 10px;
|
|
19
|
+
}
|
|
20
|
+
.pisell-lowcode__eft-pay-device {
|
|
21
|
+
height: 52px;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
padding: 0 16px;
|
|
25
|
+
border-radius: 12px;
|
|
26
|
+
border: 1px solid var(--Gray-200, #eaecf0);
|
|
27
|
+
background: #fff;
|
|
28
|
+
|
|
29
|
+
color: var(--Gray-900, #101828);
|
|
30
|
+
/* Text sm/Medium */
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
font-style: normal;
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
}
|
|
37
|
+
.pisell-lowcode__eft-pay-device.active,
|
|
38
|
+
.pisell-lowcode__eft-pay-device:hover {
|
|
39
|
+
background: var(--Gray-50, #f9fafb);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.pisell-lowcode__eft-pay-device-error {
|
|
43
|
+
gap: 20px;
|
|
44
|
+
}
|
|
45
|
+
.pisell-lowcode__eft-pay-device-error-tit {
|
|
46
|
+
color: var(--Gray-900, #101828);
|
|
47
|
+
|
|
48
|
+
font-size: 18px;
|
|
49
|
+
font-style: normal;
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
line-height: 28px; /* 155.556% */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.pisell-lowcode__eft-pay-device-error-txt {
|
|
55
|
+
color: var(--Gray-900, #101828);
|
|
56
|
+
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
font-style: normal;
|
|
59
|
+
font-weight: 400;
|
|
60
|
+
line-height: 20px; /* 142.857% */
|
|
61
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const POS: () => React.JSX.Element;
|
|
3
|
+
export declare const Surcharge: () => React.JSX.Element;
|
|
4
|
+
export declare const Card: () => React.JSX.Element;
|
|
5
|
+
export declare const Pwd: () => React.JSX.Element;
|
|
6
|
+
export declare const Receipet: () => React.JSX.Element;
|
|
7
|
+
export declare const ReceipetAgain: () => React.JSX.Element;
|
|
8
|
+
export declare const Wait: () => React.JSX.Element;
|
|
9
|
+
export declare const Action: ({ index }: {
|
|
10
|
+
index: number;
|
|
11
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
var _excluded = ["key"],
|
|
2
|
+
_excluded2 = ["key"],
|
|
3
|
+
_excluded3 = ["key"],
|
|
4
|
+
_excluded4 = ["key"],
|
|
5
|
+
_excluded5 = ["key"],
|
|
6
|
+
_excluded6 = ["key"],
|
|
7
|
+
_excluded7 = ["key"];
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
/* eslint-disable no-unused-vars */
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
12
|
+
import { locales } from '@pisell/utils';
|
|
13
|
+
import { Button } from 'antd';
|
|
14
|
+
import React, { useEffect } from 'react';
|
|
15
|
+
import Step from "../component/step";
|
|
16
|
+
import { useContextData, useDispatch, updateNextStep, updateStatus, updateComponent, updateSteps, updateWarn, updateStep, updateState } from "../store";
|
|
17
|
+
export var POS = function POS() {
|
|
18
|
+
var dispatch = useDispatch();
|
|
19
|
+
var _useContextData = useContextData(),
|
|
20
|
+
steps = _useContextData.steps;
|
|
21
|
+
var _steps$ = steps[0],
|
|
22
|
+
key = _steps$.key,
|
|
23
|
+
props = _objectWithoutProperties(_steps$, _excluded);
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
setTimeout(function () {
|
|
26
|
+
dispatch(updateStep({
|
|
27
|
+
step: 1
|
|
28
|
+
}));
|
|
29
|
+
}, 2000);
|
|
30
|
+
}, []);
|
|
31
|
+
return /*#__PURE__*/React.createElement(Step, props);
|
|
32
|
+
};
|
|
33
|
+
export var Surcharge = function Surcharge() {
|
|
34
|
+
var dispatch = useDispatch();
|
|
35
|
+
var _useContextData2 = useContextData(),
|
|
36
|
+
steps = _useContextData2.steps;
|
|
37
|
+
var _steps$2 = steps[1],
|
|
38
|
+
key = _steps$2.key,
|
|
39
|
+
props = _objectWithoutProperties(_steps$2, _excluded2);
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
setTimeout(function () {
|
|
42
|
+
dispatch(updateStep({
|
|
43
|
+
step: 2
|
|
44
|
+
}));
|
|
45
|
+
}, 4000);
|
|
46
|
+
}, []);
|
|
47
|
+
return /*#__PURE__*/React.createElement(Step, props);
|
|
48
|
+
};
|
|
49
|
+
export var Card = function Card() {
|
|
50
|
+
var dispatch = useDispatch();
|
|
51
|
+
var _useContextData3 = useContextData(),
|
|
52
|
+
steps = _useContextData3.steps;
|
|
53
|
+
var _steps$3 = steps[2],
|
|
54
|
+
key = _steps$3.key,
|
|
55
|
+
props = _objectWithoutProperties(_steps$3, _excluded3);
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
setTimeout(function () {
|
|
58
|
+
dispatch(updateStep({
|
|
59
|
+
step: 3
|
|
60
|
+
}));
|
|
61
|
+
}, 200);
|
|
62
|
+
}, []);
|
|
63
|
+
return /*#__PURE__*/React.createElement(Step, props);
|
|
64
|
+
};
|
|
65
|
+
export var Pwd = function Pwd() {
|
|
66
|
+
var dispatch = useDispatch();
|
|
67
|
+
var _useContextData4 = useContextData(),
|
|
68
|
+
steps = _useContextData4.steps;
|
|
69
|
+
var _steps$4 = steps[3],
|
|
70
|
+
key = _steps$4.key,
|
|
71
|
+
props = _objectWithoutProperties(_steps$4, _excluded4);
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
setTimeout(function () {
|
|
74
|
+
dispatch(updateStep({
|
|
75
|
+
step: 4
|
|
76
|
+
}));
|
|
77
|
+
}, 200);
|
|
78
|
+
}, []);
|
|
79
|
+
return /*#__PURE__*/React.createElement(Step, props);
|
|
80
|
+
};
|
|
81
|
+
//
|
|
82
|
+
export var Receipet = function Receipet() {
|
|
83
|
+
var dispatch = useDispatch();
|
|
84
|
+
var _useContextData5 = useContextData(),
|
|
85
|
+
steps = _useContextData5.steps;
|
|
86
|
+
var _steps$5 = steps[4],
|
|
87
|
+
key = _steps$5.key,
|
|
88
|
+
props = _objectWithoutProperties(_steps$5, _excluded5);
|
|
89
|
+
useEffect(function () {
|
|
90
|
+
setTimeout(function () {
|
|
91
|
+
dispatch(updateStep({
|
|
92
|
+
step: 5
|
|
93
|
+
}));
|
|
94
|
+
dispatch(updateStatus('warn'));
|
|
95
|
+
dispatch(updateWarn(locales.getText('page.eftpos-pay.text.receipt.again.text')));
|
|
96
|
+
}, 200);
|
|
97
|
+
}, []);
|
|
98
|
+
return /*#__PURE__*/React.createElement(Step, props);
|
|
99
|
+
};
|
|
100
|
+
export var ReceipetAgain = function ReceipetAgain() {
|
|
101
|
+
var _useContextData6 = useContextData(),
|
|
102
|
+
steps = _useContextData6.steps;
|
|
103
|
+
var _steps$6 = steps[5],
|
|
104
|
+
key = _steps$6.key,
|
|
105
|
+
props = _objectWithoutProperties(_steps$6, _excluded6);
|
|
106
|
+
return /*#__PURE__*/React.createElement(Step, props);
|
|
107
|
+
};
|
|
108
|
+
export var Wait = function Wait() {
|
|
109
|
+
var dispatch = useDispatch();
|
|
110
|
+
var _useContextData7 = useContextData(),
|
|
111
|
+
steps = _useContextData7.steps,
|
|
112
|
+
mode = _useContextData7.mode;
|
|
113
|
+
var _steps$7 = steps[6],
|
|
114
|
+
key = _steps$7.key,
|
|
115
|
+
props = _objectWithoutProperties(_steps$7, _excluded7);
|
|
116
|
+
useEffect(function () {
|
|
117
|
+
setTimeout(function () {
|
|
118
|
+
dispatch(updateNextStep());
|
|
119
|
+
}, 200);
|
|
120
|
+
}, []);
|
|
121
|
+
return /*#__PURE__*/React.createElement(Step, props);
|
|
122
|
+
};
|
|
123
|
+
export var Action = function Action(_ref) {
|
|
124
|
+
var index = _ref.index;
|
|
125
|
+
var dispatch = useDispatch();
|
|
126
|
+
var data = useContextData();
|
|
127
|
+
var onCancel = function onCancel() {
|
|
128
|
+
dispatch(updateComponent('Fail'));
|
|
129
|
+
data.steps[index].fail = locales.getText('page.eftpos-pay.text.cancel');
|
|
130
|
+
dispatch(updateSteps(data.steps));
|
|
131
|
+
};
|
|
132
|
+
var onAccept = function onAccept() {
|
|
133
|
+
console.log('index 内 = ', index);
|
|
134
|
+
dispatch(updateNextStep());
|
|
135
|
+
};
|
|
136
|
+
var onDecline = function onDecline() {
|
|
137
|
+
dispatch(updateComponent('Signature'));
|
|
138
|
+
};
|
|
139
|
+
var onManually = function onManually() {
|
|
140
|
+
dispatch(updateState({
|
|
141
|
+
manual: {
|
|
142
|
+
title: locales.getText('page.eftpos-pay.text.request.title')(data.mode),
|
|
143
|
+
text: locales.getText('page.eftpos-pay.text.request.text')(data.mode)
|
|
144
|
+
}
|
|
145
|
+
}));
|
|
146
|
+
dispatch(updateComponent('Manual'));
|
|
147
|
+
};
|
|
148
|
+
if (index < 5) {
|
|
149
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
150
|
+
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
151
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
152
|
+
block: true,
|
|
153
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
154
|
+
onClick: onCancel
|
|
155
|
+
}, locales.getText('page.eftpos-pay.text.cancel')));
|
|
156
|
+
}
|
|
157
|
+
if (index === 5) {
|
|
158
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
160
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
161
|
+
block: true,
|
|
162
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
163
|
+
onClick: onDecline
|
|
164
|
+
}, locales.getText('page.eftpos-pay.text.decline')), /*#__PURE__*/React.createElement(Button, {
|
|
165
|
+
block: true,
|
|
166
|
+
type: "primary",
|
|
167
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
168
|
+
onClick: onAccept
|
|
169
|
+
}, locales.getText('page.eftpos-pay.text.accept')));
|
|
170
|
+
}
|
|
171
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
172
|
+
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
173
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
174
|
+
block: true,
|
|
175
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
176
|
+
onClick: onManually
|
|
177
|
+
}, locales.getText('page.eftpos-pay.text.manual.marking')));
|
|
178
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Amount } from '../const';
|
|
2
|
+
import { State } from '../store';
|
|
3
|
+
export declare const getStep: ({ amount, symbol, mode, }?: {
|
|
4
|
+
amount?: string | undefined;
|
|
5
|
+
symbol: string;
|
|
6
|
+
mode?: string | undefined;
|
|
7
|
+
}) => State['steps'];
|
|
8
|
+
declare const getInitState: (params: any) => State;
|
|
9
|
+
export default getInitState;
|
|
10
|
+
export declare function getAmonunt(store: State): Amount;
|