best-unit 1.5.2 → 2.0.1

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/src/local/zh.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  // 中文语言包
2
2
  export const zh: Record<string, string> = {
3
- "额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。": "额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。",
3
+ "额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。":
4
+ "额外费用说明:您的地区、币种、支付卡类型等因素可能会导致手续费的变动,最终手续费以官方为准。",
4
5
  "手续费约为:": "手续费约为:",
5
6
  确定: "确定",
6
7
  提交成功: "提交成功",
@@ -30,6 +31,83 @@ export const zh: Record<string, string> = {
30
31
  去支付: "去支付",
31
32
  取消: "取消",
32
33
  关闭: "关闭",
34
+ 在线支付: "在线支付",
35
+ 选择支付方式: "选择支付方式",
36
+ 支付方式: "支付方式",
37
+ 付款人名称: "付款人名称",
38
+ 支付币种: "支付币种",
39
+ 支付金额: "支付金额",
40
+ 线上支付: "线上支付",
41
+ 立即支付: "立即支付",
42
+ "请在转账后提交银行回单,否则可能无法及时核验":
43
+ "请在转账后提交银行回单,否则可能无法及时核验",
44
+ "支付金额须与申请金额一致,请勿多付、少付或分批提交。":
45
+ "支付金额须与申请金额一致,请勿多付、少付或分批提交。",
46
+ "请妥善保存回单并提供准确的支付时间,否则可能无法核验。":
47
+ "请妥善保存回单并提供准确的支付时间,否则可能无法核验。",
48
+ "工作时间提交4小时内审核,非工作时间将顺延至下一个工作日。":
49
+ "工作时间提交4小时内审核,非工作时间将顺延至下一个工作日。",
50
+ "如有问题,请联系平台客服。": "如有问题,请联系平台客服。",
51
+ "预付充值将收取平台服务费,具体以官方为准。":
52
+ "预付充值将收取平台服务费,具体以官方为准。",
53
+
54
+ // 银行转账相关
55
+ 银行转账: "银行转账",
56
+ 银行名称: "银行名称",
57
+ 账户持有人: "账户持有人",
58
+ 账户号码: "账户号码",
59
+ "SWIFT/BIC代码": "SWIFT/BIC代码",
60
+ 银行代码: "银行代码",
61
+ 银行地址: "银行地址",
62
+ 复制: "复制",
63
+ 复制成功: "复制成功",
64
+ 确认转账详情: "确认转账详情",
65
+ 转账后提交银行回单提示: "请在转账后提交银行回单,否则可能无法及时核验",
66
+ 温馨提示: "温馨提示",
67
+ 支付金额匹配提醒:
68
+ "支付金额须与申请金额一致,请勿多付、少付或分批提交。银行回单显示的实际金额为准。请勿重复提交同一笔转账申请。",
69
+ 保存交易回单提醒:
70
+ "请打印或拍照保存交易回单并提供准确的支付时间,否则无法核验转账。",
71
+ 查看余额提醒:
72
+ "建议提交成功后4小时查看可用余额。工作时间提交的转账当日处理,非工作时间提交的转账将在下一个工作日处理。",
73
+ 联系客服提醒: "如有问题,请联系客服。",
74
+ P卡转账延迟提醒: "P卡转账可能会有最多10分钟的延迟,请耐心等待。",
75
+ 平台服务费说明: "预付充值将收取1%的平台服务费,详情请参考",
76
+ 费用政策: "费用政策",
77
+ 详情: "。",
78
+
79
+ // 银行转账回单上传相关
80
+ 返回账户信息: "返回账户信息",
81
+ 请上传银行转账回单: "请上传银行转账回单",
82
+ 点击或拖拽文件到此区域上传: "点击或拖拽文件到此区域上传",
83
+ 转账时间: "转账时间",
84
+ 转账金额: "转账金额",
85
+ 请输入实际转账金额: "请输入实际转账金额",
86
+ 提交审核: "提交审核",
87
+ 请选择转账时间: "请选择转账时间",
88
+ 请输入转账金额: "请输入转账金额",
89
+
90
+ // 日期选择器相关
91
+ 请选择日期: "请选择日期",
92
+ 一月: "一月",
93
+ 二月: "二月",
94
+ 三月: "三月",
95
+ 四月: "四月",
96
+ 五月: "五月",
97
+ 六月: "六月",
98
+ 七月: "七月",
99
+ 八月: "八月",
100
+ 九月: "九月",
101
+ 十月: "十月",
102
+ 十一月: "十一月",
103
+ 十二月: "十二月",
104
+ 日: "日",
105
+ 一: "一",
106
+ 二: "二",
107
+ 三: "三",
108
+ 四: "四",
109
+ 五: "五",
110
+ 六: "六",
33
111
 
34
112
  // 离线转账相关
35
113
  第三方支付平台: "第三方支付平台",
package/src/main.ts CHANGED
@@ -7,12 +7,14 @@ import {
7
7
  import { viteProxy } from "@/api/proxy";
8
8
 
9
9
  import "@/components/business/recharge-sdk";
10
+ import "@/components/business/payment-sdk";
10
11
  import "@/components/business/statistical-balance";
11
12
  import "@/components/business/refresh-button";
12
13
 
13
14
  // 可选:导出组件列表或版本信息
14
15
  export const components = [
15
16
  "best-recharge",
17
+ "best-payment",
16
18
  "best-statistical-balance",
17
19
  "best-refresh-button",
18
20
  ];
@@ -139,6 +139,7 @@ declare global {
139
139
  };
140
140
  "best-statistical-balance": any;
141
141
  "best-refresh-button": any;
142
+ "best-payment": any;
142
143
  }
143
144
  }
144
145
  }
@@ -0,0 +1,69 @@
1
+ import { message } from "@/components/common/message";
2
+
3
+ /**
4
+ * 复制文本到剪贴板
5
+ * @param text 要复制的文本
6
+ * @param onSuccess 复制成功回调
7
+ * @param onError 复制失败回调
8
+ * @returns Promise<boolean> 复制是否成功
9
+ */
10
+ export async function copyToClipboard(
11
+ text: string,
12
+ onSuccess?: (text: string) => void,
13
+ onError?: (error: Error) => void
14
+ ): Promise<boolean> {
15
+ try {
16
+ // 优先使用现代 Clipboard API
17
+ if (navigator.clipboard && window.isSecureContext) {
18
+ await navigator.clipboard.writeText(text);
19
+ onSuccess?.(text);
20
+ return true;
21
+ }
22
+
23
+ // 降级方案:使用传统的 document.execCommand
24
+ const textArea = document.createElement("textarea");
25
+ textArea.value = text;
26
+ textArea.style.position = "fixed";
27
+ textArea.style.left = "-999999px";
28
+ textArea.style.top = "-999999px";
29
+ document.body.appendChild(textArea);
30
+ textArea.focus();
31
+ textArea.select();
32
+
33
+ const successful = document.execCommand("copy");
34
+ document.body.removeChild(textArea);
35
+
36
+ if (successful) {
37
+ onSuccess?.(text);
38
+ return true;
39
+ } else {
40
+ throw new Error("复制失败");
41
+ }
42
+ } catch (err) {
43
+ const error = err instanceof Error ? err : new Error("复制失败");
44
+ onError?.(error);
45
+ console.error("复制到剪贴板失败:", error);
46
+ return false;
47
+ }
48
+ }
49
+
50
+ /**
51
+ * 复制文本并显示成功提示
52
+ * @param text 要复制的文本
53
+ * @param successMessage 成功提示消息,默认为"复制成功"
54
+ * @returns Promise<boolean> 复制是否成功
55
+ */
56
+ export async function copyWithToast(
57
+ text: string,
58
+ successMessage: string = "复制成功"
59
+ ): Promise<boolean> {
60
+ return copyToClipboard(
61
+ text,
62
+ () => {
63
+ message.success(successMessage);
64
+ },
65
+ () => {
66
+ message.error("复制失败,请重试");
67
+ }
68
+ );
69
+ }
@@ -6,3 +6,6 @@ export function printCurrentTime() {
6
6
  const now = new Date();
7
7
  console.log("Current time:", now.toISOString());
8
8
  }
9
+
10
+ // 导出复制相关方法
11
+ export { copyToClipboard, copyWithToast } from "./copy";