@pisell/private-materials 6.3.33 → 6.3.34

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 (141) 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/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +23 -8
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +23 -8
  11. package/es/components/index.d.ts +1 -2
  12. package/es/components/index.js +1 -2
  13. package/es/components/walletList/index.d.ts +0 -25
  14. package/es/components/walletList/index.js +98 -66
  15. package/es/components/walletList/serve.d.ts +4 -0
  16. package/es/components/walletList/serve.js +46 -13
  17. package/es/components/walletList/types/index.d.ts +12 -12
  18. package/es/components/walletList/types/index.js +2 -2
  19. package/es/index.d.ts +2 -1
  20. package/es/index.js +2 -1
  21. package/es/plus/productSelect/CategoryTabs/index.d.ts +2 -0
  22. package/es/plus/productSelect/CategoryTabs/index.js +6 -3
  23. package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
  24. package/es/plus/productSelect/utils.js +0 -1
  25. package/es/plus/walletEditor/WalletEditor.d.ts +5 -0
  26. package/es/plus/walletEditor/WalletEditor.js +316 -0
  27. package/es/plus/walletEditor/WalletEditor.less +129 -0
  28. package/es/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
  29. package/es/plus/walletEditor/components/ImageUpload/index.js +223 -0
  30. package/es/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
  31. package/es/plus/walletEditor/components/JsonEditor/index.js +68 -0
  32. package/es/plus/walletEditor/components/JsonEditor/index.less +4 -0
  33. package/es/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
  34. package/es/plus/walletEditor/components/ValidityPeriodSelector/index.js +222 -0
  35. package/es/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
  36. package/es/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
  37. package/es/plus/walletEditor/components/relationProduct/index.js +49 -0
  38. package/es/plus/walletEditor/components/relationProduct/index.less +15 -0
  39. package/es/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
  40. package/es/plus/walletEditor/components/sortableWalletPassTypes/index.js +193 -0
  41. package/es/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
  42. package/es/plus/walletEditor/index.d.ts +3 -0
  43. package/es/plus/walletEditor/index.js +3 -0
  44. package/es/plus/walletEditor/locales.d.ts +126 -0
  45. package/es/plus/walletEditor/locales.js +143 -0
  46. package/es/plus/walletEditor/types.d.ts +52 -0
  47. package/es/plus/walletEditor/types.js +1 -0
  48. package/es/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
  49. package/es/plus/walletPassGallery/components/footerButton/index.js +247 -0
  50. package/es/plus/walletPassGallery/components/footerButton/index.less +93 -0
  51. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
  52. package/es/plus/walletPassGallery/components/passDetail/index.js +274 -0
  53. package/es/plus/walletPassGallery/components/passDetail/index.less +57 -0
  54. package/es/plus/walletPassGallery/components/passList/index.d.ts +11 -0
  55. package/es/plus/walletPassGallery/components/passList/index.js +115 -0
  56. package/es/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
  57. package/es/plus/walletPassGallery/components/recharge/index.js +134 -0
  58. package/es/plus/walletPassGallery/components/recharge/index.less +16 -0
  59. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +8 -0
  60. package/es/plus/walletPassGallery/components/timelineSection/index.js +176 -0
  61. package/es/plus/walletPassGallery/components/timelineSection/index.less +67 -0
  62. package/es/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
  63. package/es/plus/walletPassGallery/components/usageRule/index.js +248 -0
  64. package/es/plus/walletPassGallery/components/usageRule/index.less +157 -0
  65. package/es/plus/walletPassGallery/index.d.ts +6 -0
  66. package/es/plus/walletPassGallery/index.js +602 -0
  67. package/es/plus/walletPassGallery/index.less +115 -0
  68. package/es/plus/walletPassGallery/locales.d.ts +270 -0
  69. package/es/plus/walletPassGallery/locales.js +279 -0
  70. package/es/plus/walletPassGallery/serve.d.ts +218 -0
  71. package/es/plus/walletPassGallery/serve.js +289 -0
  72. package/es/pro/Login2.0/Login2.js +4 -0
  73. package/es/pro/Login2.0/locales.js +93 -93
  74. package/lib/components/index.d.ts +1 -2
  75. package/lib/components/index.js +0 -3
  76. package/lib/components/walletList/index.d.ts +0 -25
  77. package/lib/components/walletList/index.js +90 -51
  78. package/lib/components/walletList/serve.d.ts +4 -0
  79. package/lib/components/walletList/serve.js +12 -0
  80. package/lib/components/walletList/types/index.d.ts +12 -12
  81. package/lib/index.d.ts +2 -1
  82. package/lib/index.js +6 -3
  83. package/lib/plus/productSelect/CategoryTabs/index.d.ts +2 -0
  84. package/lib/plus/productSelect/CategoryTabs/index.js +84 -69
  85. package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
  86. package/lib/plus/productSelect/utils.js +0 -1
  87. package/lib/plus/walletEditor/WalletEditor.d.ts +5 -0
  88. package/lib/plus/walletEditor/WalletEditor.js +354 -0
  89. package/lib/plus/walletEditor/WalletEditor.less +129 -0
  90. package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
  91. package/lib/plus/walletEditor/components/ImageUpload/index.js +201 -0
  92. package/lib/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
  93. package/lib/plus/walletEditor/components/JsonEditor/index.js +89 -0
  94. package/lib/plus/walletEditor/components/JsonEditor/index.less +4 -0
  95. package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
  96. package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.js +176 -0
  97. package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
  98. package/lib/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
  99. package/lib/plus/walletEditor/components/relationProduct/index.js +73 -0
  100. package/lib/plus/walletEditor/components/relationProduct/index.less +15 -0
  101. package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
  102. package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.js +211 -0
  103. package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
  104. package/lib/plus/walletEditor/index.d.ts +3 -0
  105. package/lib/plus/walletEditor/index.js +42 -0
  106. package/lib/plus/walletEditor/locales.d.ts +126 -0
  107. package/lib/plus/walletEditor/locales.js +167 -0
  108. package/lib/plus/walletEditor/types.d.ts +52 -0
  109. package/lib/plus/walletEditor/types.js +17 -0
  110. package/lib/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
  111. package/lib/plus/walletPassGallery/components/footerButton/index.js +187 -0
  112. package/lib/plus/walletPassGallery/components/footerButton/index.less +93 -0
  113. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
  114. package/lib/plus/walletPassGallery/components/passDetail/index.js +287 -0
  115. package/lib/plus/walletPassGallery/components/passDetail/index.less +57 -0
  116. package/lib/plus/walletPassGallery/components/passList/index.d.ts +11 -0
  117. package/lib/plus/walletPassGallery/components/passList/index.js +136 -0
  118. package/lib/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
  119. package/lib/plus/walletPassGallery/components/recharge/index.js +146 -0
  120. package/lib/plus/walletPassGallery/components/recharge/index.less +16 -0
  121. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +8 -0
  122. package/lib/plus/walletPassGallery/components/timelineSection/index.js +212 -0
  123. package/lib/plus/walletPassGallery/components/timelineSection/index.less +67 -0
  124. package/lib/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
  125. package/lib/plus/walletPassGallery/components/usageRule/index.js +209 -0
  126. package/lib/plus/walletPassGallery/components/usageRule/index.less +157 -0
  127. package/lib/plus/walletPassGallery/index.d.ts +6 -0
  128. package/lib/plus/walletPassGallery/index.js +498 -0
  129. package/lib/plus/walletPassGallery/index.less +115 -0
  130. package/lib/plus/walletPassGallery/locales.d.ts +270 -0
  131. package/lib/plus/walletPassGallery/locales.js +299 -0
  132. package/lib/plus/walletPassGallery/serve.d.ts +218 -0
  133. package/lib/plus/walletPassGallery/serve.js +98 -0
  134. package/lib/pro/Login2.0/Login2.js +3 -0
  135. package/lib/pro/Login2.0/locales.js +93 -93
  136. package/lowcode/sortable-wallet-pass-types/meta.ts +267 -0
  137. package/lowcode/wallet-editor/meta.ts +57 -0
  138. package/lowcode/wallet-editor/snippets.ts +13 -0
  139. package/lowcode/wallet-pass-gallery/meta.ts +35 -0
  140. package/package.json +4 -4
  141. package/lowcode/wallet/meta.ts +0 -79
@@ -0,0 +1,167 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/plus/walletEditor/locales.ts
20
+ var locales_exports = {};
21
+ __export(locales_exports, {
22
+ default: () => locales_default
23
+ });
24
+ module.exports = __toCommonJS(locales_exports);
25
+ var locales_default = {
26
+ en: {
27
+ // Form Labels
28
+ walletName: "Wallet name",
29
+ validityPeriod: "Validity Period",
30
+ linkedPasses: "Linked passes",
31
+ linkedPassesDesc: "Select the passes that will be available in this Wallet.",
32
+ sort: "Sort",
33
+ status: "Status",
34
+ distributionConditions: "Issuance conditions",
35
+ selectPasses: "Select passes",
36
+ backgroundImage: "Background image",
37
+ advancedSettings: "Advanced Settings",
38
+ sendConfig: "Send Config",
39
+ displaySettings: "Display settings",
40
+ viewPreview: "View Preview",
41
+ coverImage: "Cover Image",
42
+ icon: "Icon",
43
+ upload: "Upload",
44
+ // Status Options
45
+ enable: "Enable",
46
+ disable: "Disable",
47
+ // Barcode Types
48
+ barCode: "Barcode",
49
+ qrCode: "QR Code",
50
+ // Validity Period Options
51
+ day: "day",
52
+ days: "days",
53
+ month: "month",
54
+ months: "months",
55
+ year: "year",
56
+ years: "years",
57
+ forever: "Forever",
58
+ custom: "Custom",
59
+ // Wallet Pass Types
60
+ balance: "Balance",
61
+ point: "Points",
62
+ voucher: "Voucher",
63
+ discount: "Discount",
64
+ rechargeable: "Rechargeable",
65
+ // Messages
66
+ pleaseInputWalletName: "Please input wallet name!",
67
+ enterCoverImageURL: "Enter cover image URL",
68
+ enterJSONConfig: 'Enter JSON config, e.g. {"type": "register"}',
69
+ selectValidityPeriod: "Select validity period",
70
+ selectCustomDate: "Select custom date",
71
+ registerToIssue: "Register to issue"
72
+ },
73
+ "zh-CN": {
74
+ // 表单标签
75
+ walletName: "钱包名称",
76
+ validityPeriod: "有效期",
77
+ linkedPasses: "包含的卡券",
78
+ linkedPassesDesc: "选择此 Wallet 中可展示与使用的卡券。",
79
+ sort: "排序",
80
+ status: "状态",
81
+ distributionConditions: "发放条件",
82
+ selectPasses: "选择卡券",
83
+ backgroundImage: "背景图",
84
+ advancedSettings: "高级设置",
85
+ sendConfig: "发送配置",
86
+ displaySettings: "显示设置",
87
+ viewPreview: "查看预览",
88
+ coverImage: "封面图片",
89
+ icon: "图标",
90
+ upload: "上传",
91
+ // 状态选项
92
+ enable: "启用",
93
+ disable: "禁用",
94
+ // 条形码类型
95
+ barCode: "条形码",
96
+ qrCode: "二维码",
97
+ // 有效期选项
98
+ day: "天",
99
+ days: "天",
100
+ month: "个月",
101
+ months: "个月",
102
+ year: "年",
103
+ years: "年",
104
+ forever: "永久",
105
+ custom: "自定义",
106
+ // 钱包通行证类型
107
+ balance: "余额",
108
+ point: "积分",
109
+ voucher: "代金券",
110
+ discount: "折扣券",
111
+ rechargeable: "充值卡",
112
+ // 消息
113
+ pleaseInputWalletName: "请输入钱包名称!",
114
+ enterCoverImageURL: "输入封面图片URL",
115
+ enterJSONConfig: '输入JSON配置,例如 {"type": "register"}',
116
+ selectValidityPeriod: "选择有效期",
117
+ selectCustomDate: "选择自定义日期",
118
+ registerToIssue: "注册即发放"
119
+ },
120
+ "zh-HK": {
121
+ // 表單標籤
122
+ walletName: "錢包名稱",
123
+ validityPeriod: "有效期",
124
+ linkedPasses: "包含的卡券",
125
+ linkedPassesDesc: "選擇此 Wallet 中可展示與使用的卡券。",
126
+ sort: "排序",
127
+ status: "狀態",
128
+ distributionConditions: "發放條件",
129
+ selectPasses: "選擇卡券",
130
+ backgroundImage: "背景圖",
131
+ advancedSettings: "高級設置",
132
+ sendConfig: "發送配置",
133
+ displaySettings: "顯示設置",
134
+ viewPreview: "查看預覽",
135
+ coverImage: "封面圖片",
136
+ icon: "圖標",
137
+ upload: "上傳",
138
+ // 狀態選項
139
+ enable: "啟用",
140
+ disable: "禁用",
141
+ // 條形碼類型
142
+ barCode: "條形碼",
143
+ qrCode: "二維碼",
144
+ // 有效期選項
145
+ day: "天",
146
+ days: "天",
147
+ month: "個月",
148
+ months: "個月",
149
+ year: "年",
150
+ years: "年",
151
+ forever: "永久",
152
+ custom: "自定義",
153
+ // 錢包通行證類型
154
+ balance: "餘額",
155
+ point: "積分",
156
+ voucher: "代金券",
157
+ discount: "折扣券",
158
+ rechargeable: "充值卡",
159
+ // 消息
160
+ pleaseInputWalletName: "請輸入錢包名稱!",
161
+ enterCoverImageURL: "輸入封面圖片URL",
162
+ enterJSONConfig: '輸入JSON配置,例如 {"type": "register"}',
163
+ selectValidityPeriod: "選擇有效期",
164
+ selectCustomDate: "選擇自定義日期",
165
+ registerToIssue: "註冊即發放"
166
+ }
167
+ };
@@ -0,0 +1,52 @@
1
+ /// <reference types="react" />
2
+ import { FormInstance } from 'antd';
3
+ export interface MultiLanguageTitle {
4
+ original?: string;
5
+ 'zh-CN'?: string;
6
+ 'zh-HK'?: string;
7
+ en?: string;
8
+ }
9
+ export interface ValidForConfig {
10
+ unit: string;
11
+ unit_type: 'day' | 'month' | 'year';
12
+ type: 'normal' | 'custom' | 'forever';
13
+ custom_date?: string;
14
+ }
15
+ export declare type WalletPassType = 'balance' | 'point' | 'voucher' | 'discount' | 'rechargeable';
16
+ export interface ShowcaseWalletPassItem {
17
+ type: WalletPassType;
18
+ display: 0 | 1;
19
+ name?: MultiLanguageTitle;
20
+ custom_title?: MultiLanguageTitle;
21
+ }
22
+ export interface SendConfig {
23
+ type: string;
24
+ [key: string]: any;
25
+ }
26
+ export interface WalletMetadata {
27
+ showcaseWalletPass?: string[];
28
+ showcaseWalletPassNew?: ShowcaseWalletPassItem[];
29
+ welcomeText?: string;
30
+ customerName?: string;
31
+ coverImage?: string;
32
+ send_config?: SendConfig;
33
+ }
34
+ export interface WalletEditorValue {
35
+ name?: MultiLanguageTitle;
36
+ status: 'enable' | 'disable';
37
+ valid_for: ValidForConfig;
38
+ metadata: WalletMetadata;
39
+ }
40
+ export interface WalletEditorRef {
41
+ form: FormInstance;
42
+ setInitialValues: (values: WalletEditorValue) => void;
43
+ getValues: () => WalletEditorValue;
44
+ }
45
+ export interface WalletEditorProps {
46
+ value?: WalletEditorValue;
47
+ onChange?: (value: WalletEditorValue) => void;
48
+ onValuesChange?: (changedValue: any, values: WalletEditorValue) => void;
49
+ disabled?: boolean;
50
+ className?: string;
51
+ style?: React.CSSProperties;
52
+ }
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/plus/walletEditor/types.ts
16
+ var types_exports = {};
17
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface FooterButtonsProps {
4
+ onRechargeClick?: () => void;
5
+ platform?: 'pc' | 'h5';
6
+ appleWalletUrl?: string;
7
+ googleWalletUrl?: string;
8
+ }
9
+ /**
10
+ * 通用底部按钮组件
11
+ * 根据step不同显示不同的按钮组
12
+ */
13
+ declare const FooterButtons: React.FC<FooterButtonsProps>;
14
+ export default FooterButtons;
@@ -0,0 +1,187 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
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
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/plus/walletPassGallery/components/footerButton/index.tsx
30
+ var footerButton_exports = {};
31
+ __export(footerButton_exports, {
32
+ default: () => footerButton_default
33
+ });
34
+ module.exports = __toCommonJS(footerButton_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_materials = require("@pisell/materials");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_index = require("./index.less");
40
+ var FooterButtons = ({
41
+ onRechargeClick,
42
+ platform = "h5",
43
+ appleWalletUrl,
44
+ googleWalletUrl
45
+ }) => {
46
+ if (platform === "pc") {
47
+ return null;
48
+ }
49
+ const [addWalletLoading, setAddWalletLoading] = (0, import_react.useState)(false);
50
+ const [wechatModalOpen, setWechatModalOpen] = (0, import_react.useState)(false);
51
+ const [copyUrl, setCopyUrl] = (0, import_react.useState)("");
52
+ const addWalletPass = async (url, type) => {
53
+ if (!url) {
54
+ (0, import_materials.PisellToast)({
55
+ content: import_utils.locales.getText("wallet-pass-gallery.urlEmpty") || "钱包链接为空",
56
+ duration: 2
57
+ });
58
+ return false;
59
+ }
60
+ if (isWechat()) {
61
+ setWechatModalOpen(true);
62
+ setCopyUrl(url);
63
+ return false;
64
+ }
65
+ setAddWalletLoading(true);
66
+ try {
67
+ if (type === "apple") {
68
+ const response = await fetch(url);
69
+ if (!response.ok) {
70
+ throw new Error(`HTTP error! status: ${response.status}`);
71
+ }
72
+ const passData = await response.arrayBuffer();
73
+ const blob = new Blob([passData], {
74
+ type: "application/vnd.apple.pkpass"
75
+ });
76
+ const downloadUrl = URL.createObjectURL(blob);
77
+ const a = document.createElement("a");
78
+ a.href = downloadUrl;
79
+ a.download = "pass.pkpass";
80
+ a.click();
81
+ URL.revokeObjectURL(downloadUrl);
82
+ } else {
83
+ window.open(url);
84
+ }
85
+ } catch (error) {
86
+ console.error("Failed to add wallet:", error);
87
+ (0, import_materials.PisellToast)({
88
+ content: import_utils.locales.getText("wallet-pass-gallery.error.addFailed"),
89
+ duration: 3
90
+ });
91
+ } finally {
92
+ setAddWalletLoading(false);
93
+ }
94
+ };
95
+ const onAppleClick = async () => {
96
+ await addWalletPass(appleWalletUrl || "", "apple");
97
+ };
98
+ const onGoogleClick = async () => {
99
+ await addWalletPass(googleWalletUrl || "", "google");
100
+ };
101
+ const isWechat = () => {
102
+ return /MicroMessenger/i.test(window.navigator.userAgent);
103
+ };
104
+ const httpCopyToClipboard = (text) => {
105
+ const textArea = document.createElement("textarea");
106
+ textArea.value = text;
107
+ textArea.style.position = "fixed";
108
+ textArea.style.top = "-10000px";
109
+ textArea.style.left = "-10000px";
110
+ document.body.appendChild(textArea);
111
+ textArea.focus();
112
+ textArea.select();
113
+ document.execCommand("copy");
114
+ document.body.removeChild(textArea);
115
+ };
116
+ const copyToClipboard = (text) => {
117
+ if (navigator.clipboard) {
118
+ return navigator.clipboard.writeText(text);
119
+ } else {
120
+ return httpCopyToClipboard(text);
121
+ }
122
+ };
123
+ const onCopyClick = () => {
124
+ copyToClipboard(copyUrl);
125
+ (0, import_materials.PisellToast)({
126
+ content: import_utils.locales.getText("wallet-pass-gallery.copySuccess"),
127
+ duration: 2
128
+ });
129
+ setWechatModalOpen(false);
130
+ };
131
+ const renderButtons = () => {
132
+ const buttons = [];
133
+ if (appleWalletUrl || googleWalletUrl) {
134
+ buttons.push(
135
+ /* @__PURE__ */ import_react.default.createElement(
136
+ import_antd.Button,
137
+ {
138
+ loading: addWalletLoading,
139
+ key: "add-wallet",
140
+ onClick: (0, import_utils.isIos)() ? onAppleClick : onGoogleClick,
141
+ size: "large",
142
+ className: "pisell-wallet-pass-gallery_footer-buttons-item pisell-wallet-pass-gallery_footer-buttons-item-secondary"
143
+ },
144
+ (0, import_utils.isIos)() ? import_utils.locales.getText("wallet-pass-gallery.button.addToAppleWallet") : import_utils.locales.getText("wallet-pass-gallery.button.addToGoogleWallet")
145
+ )
146
+ );
147
+ }
148
+ if (onRechargeClick) {
149
+ buttons.push(
150
+ /* @__PURE__ */ import_react.default.createElement(
151
+ import_antd.Button,
152
+ {
153
+ key: "recharge",
154
+ type: "primary",
155
+ onClick: onRechargeClick,
156
+ size: "large",
157
+ className: "pisell-wallet-pass-gallery_footer-buttons-item pisell-wallet-pass-gallery_footer-buttons-item-primary"
158
+ },
159
+ import_utils.locales.getText("wallet-pass-gallery.recharge")
160
+ )
161
+ );
162
+ }
163
+ const buttonCount = buttons.length;
164
+ const className = `pisell-wallet-pass-gallery_footer-buttons pisell-wallet-pass-gallery_footer-buttons-count-${buttonCount}`;
165
+ return buttons.length > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className }, buttons) : null;
166
+ };
167
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_footer" }, renderButtons()), /* @__PURE__ */ import_react.default.createElement(
168
+ import_materials.PisellModal,
169
+ {
170
+ platform,
171
+ mobileModalHeight: "auto",
172
+ headerDivider: false,
173
+ closable: true,
174
+ maskClosable: true,
175
+ onCancel: () => {
176
+ setWechatModalOpen(false);
177
+ },
178
+ open: wechatModalOpen,
179
+ footer: [
180
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: onCopyClick, block: true, type: "primary", size: "large" }, import_utils.locales.getText("wallet-pass-gallery.copyButton"))
181
+ ]
182
+ },
183
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_footer-copy-title" }, import_utils.locales.getText("wallet-pass-gallery.copyTitle")),
184
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_footer-copy-text" }, import_utils.locales.getText("wallet-pass-gallery.copyText"))
185
+ ));
186
+ };
187
+ var footerButton_default = FooterButtons;
@@ -0,0 +1,93 @@
1
+ .pisell-wallet-pass-gallery_footer {
2
+ position: relative;
3
+ left: 0;
4
+ right: 0;
5
+ bottom: 0;
6
+ background-color: #fff;
7
+ padding: 24px;
8
+ z-index: 100;
9
+ border-top: 1px solid #d0d5de;
10
+ margin-left: -20px;
11
+ margin-right: -20px;
12
+ &-buttons {
13
+ display: flex;
14
+ gap: 12px;
15
+ width: 100%;
16
+
17
+
18
+ .pisell-wallet-pass-gallery_footer-buttons-item-secondary{
19
+ overflow: hidden;
20
+ display: flex;
21
+ >span{
22
+ display: block;
23
+ // width: 100%;
24
+ flex:1;
25
+ white-space: nowrap;
26
+ overflow: hidden;
27
+ text-overflow: ellipsis;
28
+ text-wrap: nowrap;
29
+ }
30
+ }
31
+
32
+
33
+ // 按钮数量样式
34
+ // 单个按钮占满宽度
35
+ &-count-1 {
36
+ .pisell-wallet-pass-gallery_footer-buttons-item {
37
+ flex: 1;
38
+ width: 100%;
39
+ }
40
+ }
41
+
42
+ // 两个按钮各占一半
43
+ &-count-2 {
44
+ .pisell-wallet-pass-gallery_footer-buttons-item {
45
+ flex: 1;
46
+ width: calc(50% - 6px);
47
+ }
48
+ }
49
+
50
+ // 三个按钮各占三分之一
51
+ &-count-3 {
52
+ .pisell-wallet-pass-gallery_footer-buttons-item {
53
+ flex: 1;
54
+ width: calc(33.33% - 8px);
55
+ }
56
+ }
57
+
58
+ // 四个按钮各占四分之一
59
+ &-count-4 {
60
+ .pisell-wallet-pass-gallery_footer-buttons-item {
61
+ flex: 1;
62
+ width: calc(25% - 9px);
63
+ }
64
+ }
65
+
66
+ // Ant Design按钮覆盖样式
67
+ :global(.ant-btn) {
68
+ height: 48px;
69
+ border-radius: 6px;
70
+ font-size: 16px;
71
+ font-weight: 500;
72
+ width: 100%;
73
+ }
74
+
75
+ &-item {
76
+ // 修饰符:主按钮
77
+ &-primary {
78
+ background-color: var(--theme-color, #7F56D9);
79
+ }
80
+
81
+ // 修饰符:次按钮
82
+ &-secondary {
83
+ background-color: #fff;
84
+ border-color: #d0d5de;
85
+ color: var(--Gray-700, #344054);
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ .pisell-wallet-pass-gallery_footer:empty {
92
+ display: none;
93
+ }
@@ -0,0 +1,8 @@
1
+ import './index.less';
2
+ interface PassDetailProps {
3
+ dataSource?: any | null;
4
+ platform?: 'pc' | 'h5';
5
+ buttonGroupList?: any[][];
6
+ }
7
+ declare const PassDetail: (props: PassDetailProps) => JSX.Element | null;
8
+ export default PassDetail;