@pisell/private-materials 6.3.33 → 6.3.35

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 (175) 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/booking/addons/model.d.ts +10 -1
  12. package/es/components/booking/components/customSelect/index.js +18 -3
  13. package/es/components/booking/forms/model.d.ts +10 -1
  14. package/es/components/booking/info/model.d.ts +10 -1
  15. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  16. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  17. package/es/components/booking/model.d.ts +9 -1
  18. package/es/components/booking/notes/model.d.ts +10 -1
  19. package/es/components/booking/payments/model.d.ts +10 -1
  20. package/es/components/index.d.ts +1 -2
  21. package/es/components/index.js +1 -2
  22. package/es/components/pay/toC/model.d.ts +9 -1
  23. package/es/components/schedules/model.d.ts +9 -1
  24. package/es/components/wallet/Detail/model.d.ts +13 -1
  25. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  26. package/es/components/wallet/PointCard/model.d.ts +13 -1
  27. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  28. package/es/components/wallet/Voucher/model.d.ts +13 -1
  29. package/es/components/wallet/model.d.ts +9 -1
  30. package/es/components/walletList/index.d.ts +0 -25
  31. package/es/components/walletList/index.js +98 -66
  32. package/es/components/walletList/serve.d.ts +4 -0
  33. package/es/components/walletList/serve.js +46 -13
  34. package/es/components/walletList/types/index.d.ts +12 -12
  35. package/es/components/walletList/types/index.js +2 -2
  36. package/es/index.d.ts +2 -1
  37. package/es/index.js +2 -1
  38. package/es/plus/productSelect/CategoryTabs/index.d.ts +2 -0
  39. package/es/plus/productSelect/CategoryTabs/index.js +6 -3
  40. package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
  41. package/es/plus/productSelect/utils.js +0 -1
  42. package/es/plus/walletEditor/WalletEditor.d.ts +5 -0
  43. package/es/plus/walletEditor/WalletEditor.js +316 -0
  44. package/es/plus/walletEditor/WalletEditor.less +129 -0
  45. package/es/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
  46. package/es/plus/walletEditor/components/ImageUpload/index.js +223 -0
  47. package/es/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
  48. package/es/plus/walletEditor/components/JsonEditor/index.js +68 -0
  49. package/es/plus/walletEditor/components/JsonEditor/index.less +4 -0
  50. package/es/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
  51. package/es/plus/walletEditor/components/ValidityPeriodSelector/index.js +222 -0
  52. package/es/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
  53. package/es/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
  54. package/es/plus/walletEditor/components/relationProduct/index.js +49 -0
  55. package/es/plus/walletEditor/components/relationProduct/index.less +15 -0
  56. package/es/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
  57. package/es/plus/walletEditor/components/sortableWalletPassTypes/index.js +193 -0
  58. package/es/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
  59. package/es/plus/walletEditor/index.d.ts +3 -0
  60. package/es/plus/walletEditor/index.js +3 -0
  61. package/es/plus/walletEditor/locales.d.ts +126 -0
  62. package/es/plus/walletEditor/locales.js +143 -0
  63. package/es/plus/walletEditor/types.d.ts +52 -0
  64. package/es/plus/walletEditor/types.js +1 -0
  65. package/es/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
  66. package/es/plus/walletPassGallery/components/footerButton/index.js +247 -0
  67. package/es/plus/walletPassGallery/components/footerButton/index.less +93 -0
  68. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
  69. package/es/plus/walletPassGallery/components/passDetail/index.js +274 -0
  70. package/es/plus/walletPassGallery/components/passDetail/index.less +57 -0
  71. package/es/plus/walletPassGallery/components/passList/index.d.ts +11 -0
  72. package/es/plus/walletPassGallery/components/passList/index.js +115 -0
  73. package/es/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
  74. package/es/plus/walletPassGallery/components/recharge/index.js +134 -0
  75. package/es/plus/walletPassGallery/components/recharge/index.less +16 -0
  76. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +8 -0
  77. package/es/plus/walletPassGallery/components/timelineSection/index.js +176 -0
  78. package/es/plus/walletPassGallery/components/timelineSection/index.less +67 -0
  79. package/es/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
  80. package/es/plus/walletPassGallery/components/usageRule/index.js +248 -0
  81. package/es/plus/walletPassGallery/components/usageRule/index.less +157 -0
  82. package/es/plus/walletPassGallery/index.d.ts +6 -0
  83. package/es/plus/walletPassGallery/index.js +602 -0
  84. package/es/plus/walletPassGallery/index.less +115 -0
  85. package/es/plus/walletPassGallery/locales.d.ts +270 -0
  86. package/es/plus/walletPassGallery/locales.js +279 -0
  87. package/es/plus/walletPassGallery/serve.d.ts +218 -0
  88. package/es/plus/walletPassGallery/serve.js +289 -0
  89. package/es/pro/Login2.0/Login2.js +8 -1
  90. package/es/pro/Login2.0/locales.js +93 -93
  91. package/lib/components/booking/addons/model.d.ts +10 -1
  92. package/lib/components/booking/components/customSelect/index.js +22 -3
  93. package/lib/components/booking/forms/model.d.ts +10 -1
  94. package/lib/components/booking/info/model.d.ts +10 -1
  95. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  96. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  97. package/lib/components/booking/model.d.ts +9 -1
  98. package/lib/components/booking/notes/model.d.ts +10 -1
  99. package/lib/components/booking/payments/model.d.ts +10 -1
  100. package/lib/components/index.d.ts +1 -2
  101. package/lib/components/index.js +0 -3
  102. package/lib/components/pay/toC/model.d.ts +9 -1
  103. package/lib/components/schedules/model.d.ts +9 -1
  104. package/lib/components/wallet/Detail/model.d.ts +13 -1
  105. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  106. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  107. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  108. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  109. package/lib/components/wallet/model.d.ts +9 -1
  110. package/lib/components/walletList/index.d.ts +0 -25
  111. package/lib/components/walletList/index.js +90 -51
  112. package/lib/components/walletList/serve.d.ts +4 -0
  113. package/lib/components/walletList/serve.js +12 -0
  114. package/lib/components/walletList/types/index.d.ts +12 -12
  115. package/lib/index.d.ts +2 -1
  116. package/lib/index.js +6 -3
  117. package/lib/plus/productSelect/CategoryTabs/index.d.ts +2 -0
  118. package/lib/plus/productSelect/CategoryTabs/index.js +84 -69
  119. package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
  120. package/lib/plus/productSelect/utils.js +0 -1
  121. package/lib/plus/walletEditor/WalletEditor.d.ts +5 -0
  122. package/lib/plus/walletEditor/WalletEditor.js +354 -0
  123. package/lib/plus/walletEditor/WalletEditor.less +129 -0
  124. package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
  125. package/lib/plus/walletEditor/components/ImageUpload/index.js +201 -0
  126. package/lib/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
  127. package/lib/plus/walletEditor/components/JsonEditor/index.js +89 -0
  128. package/lib/plus/walletEditor/components/JsonEditor/index.less +4 -0
  129. package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
  130. package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.js +176 -0
  131. package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
  132. package/lib/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
  133. package/lib/plus/walletEditor/components/relationProduct/index.js +73 -0
  134. package/lib/plus/walletEditor/components/relationProduct/index.less +15 -0
  135. package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
  136. package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.js +211 -0
  137. package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
  138. package/lib/plus/walletEditor/index.d.ts +3 -0
  139. package/lib/plus/walletEditor/index.js +42 -0
  140. package/lib/plus/walletEditor/locales.d.ts +126 -0
  141. package/lib/plus/walletEditor/locales.js +167 -0
  142. package/lib/plus/walletEditor/types.d.ts +52 -0
  143. package/lib/plus/walletEditor/types.js +17 -0
  144. package/lib/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
  145. package/lib/plus/walletPassGallery/components/footerButton/index.js +187 -0
  146. package/lib/plus/walletPassGallery/components/footerButton/index.less +93 -0
  147. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
  148. package/lib/plus/walletPassGallery/components/passDetail/index.js +287 -0
  149. package/lib/plus/walletPassGallery/components/passDetail/index.less +57 -0
  150. package/lib/plus/walletPassGallery/components/passList/index.d.ts +11 -0
  151. package/lib/plus/walletPassGallery/components/passList/index.js +136 -0
  152. package/lib/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
  153. package/lib/plus/walletPassGallery/components/recharge/index.js +146 -0
  154. package/lib/plus/walletPassGallery/components/recharge/index.less +16 -0
  155. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +8 -0
  156. package/lib/plus/walletPassGallery/components/timelineSection/index.js +212 -0
  157. package/lib/plus/walletPassGallery/components/timelineSection/index.less +67 -0
  158. package/lib/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
  159. package/lib/plus/walletPassGallery/components/usageRule/index.js +209 -0
  160. package/lib/plus/walletPassGallery/components/usageRule/index.less +157 -0
  161. package/lib/plus/walletPassGallery/index.d.ts +6 -0
  162. package/lib/plus/walletPassGallery/index.js +498 -0
  163. package/lib/plus/walletPassGallery/index.less +115 -0
  164. package/lib/plus/walletPassGallery/locales.d.ts +270 -0
  165. package/lib/plus/walletPassGallery/locales.js +299 -0
  166. package/lib/plus/walletPassGallery/serve.d.ts +218 -0
  167. package/lib/plus/walletPassGallery/serve.js +98 -0
  168. package/lib/pro/Login2.0/Login2.js +6 -0
  169. package/lib/pro/Login2.0/locales.js +93 -93
  170. package/lowcode/sortable-wallet-pass-types/meta.ts +267 -0
  171. package/lowcode/wallet-editor/meta.ts +57 -0
  172. package/lowcode/wallet-editor/snippets.ts +13 -0
  173. package/lowcode/wallet-pass-gallery/meta.ts +35 -0
  174. package/package.json +3 -3
  175. package/lowcode/wallet/meta.ts +0 -79
@@ -0,0 +1,498 @@
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/index.tsx
30
+ var walletPassGallery_exports = {};
31
+ __export(walletPassGallery_exports, {
32
+ default: () => walletPassGallery_default
33
+ });
34
+ module.exports = __toCommonJS(walletPassGallery_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_classnames = __toESM(require("classnames"));
37
+ var import_ahooks = require("ahooks");
38
+ var import_antd = require("antd");
39
+ var import_materials = require("@pisell/materials");
40
+ var import_utils = require("@pisell/utils");
41
+ var import_serve = require("./serve");
42
+ var import_locales = __toESM(require("./locales"));
43
+ var import_utils2 = require("../../utils");
44
+ var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
45
+ var import_passList = __toESM(require("./components/passList"));
46
+ var import_passDetail = __toESM(require("./components/passDetail"));
47
+ var import_index = require("./index.less");
48
+ var { Title } = import_antd.Typography;
49
+ var KEYS = {
50
+ available: "available",
51
+ unavailable: "unavailable"
52
+ };
53
+ var ARow = import_antd.Row;
54
+ var ACol = import_antd.Col;
55
+ var TAGS = [
56
+ "gift_card",
57
+ "point_card",
58
+ "product_discount_card",
59
+ "good_pass",
60
+ "product_voucher"
61
+ ];
62
+ var WalletPassGallery = (props) => {
63
+ var _a, _b, _c, _d, _e, _f, _g;
64
+ const [activeKey, setActiveKey] = (0, import_react.useState)("available");
65
+ const [currentItemId, setCurrentItemId] = (0, import_react.useState)(void 0);
66
+ const [isOpenAddModal, setIsOpenAddModal] = (0, import_react.useState)(false);
67
+ const [currentUnbindItem, setCurrentUnbindItem] = (0, import_react.useState)(null);
68
+ const context = (0, import_useEngineContext.default)();
69
+ const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
70
+ const platform = (0, import_react.useMemo)(() => {
71
+ if (utils.isMobile) {
72
+ return utils.isMobile() ? "h5" : "pc";
73
+ }
74
+ if (typeof window !== "undefined") {
75
+ return window.innerWidth <= 768 ? "h5" : "pc";
76
+ }
77
+ }, [utils]);
78
+ const dvaStore = (_c = (_b = utils == null ? void 0 : utils.getStore) == null ? void 0 : _b.call(utils)) == null ? void 0 : _c.getState();
79
+ import_utils.locales.init(import_locales.default, ((_d = dvaStore == null ? void 0 : dvaStore.core) == null ? void 0 : _d.translateLocale) || "en");
80
+ import_utils2.request.setRequest(utils == null ? void 0 : utils.request);
81
+ const _getWalletDetail = (0, import_ahooks.useRequest)(import_serve.getWalletDetail, {
82
+ manual: true
83
+ });
84
+ const _getAvailableList = (0, import_ahooks.useInfiniteScroll)(
85
+ async (d) => {
86
+ const walletId = new URLSearchParams(window.location.search).get("id");
87
+ const res = await (0, import_serve.getWalletList)({
88
+ available: 1,
89
+ num: 20,
90
+ skip: (d == null ? void 0 : d.nextId) || 1,
91
+ tags: TAGS,
92
+ filter_wallet_id: walletId || void 0
93
+ });
94
+ return {
95
+ list: (res == null ? void 0 : res.list) || [],
96
+ count: (res == null ? void 0 : res.count) || 0,
97
+ nextId: (res == null ? void 0 : res.skip) || 1
98
+ };
99
+ },
100
+ {
101
+ manual: true,
102
+ onSuccess: (data) => {
103
+ },
104
+ isNoMore: (d) => {
105
+ if (!(d == null ? void 0 : d.list)) return false;
106
+ return d.list.length >= (d.count || 0);
107
+ }
108
+ }
109
+ );
110
+ const _getUnavailableList = (0, import_ahooks.useInfiniteScroll)(
111
+ async (d) => {
112
+ const walletId = new URLSearchParams(window.location.search).get("id");
113
+ const res = await (0, import_serve.getWalletList)({
114
+ available: 0,
115
+ num: 20,
116
+ skip: (d == null ? void 0 : d.nextId) || 1,
117
+ tags: TAGS,
118
+ filter_wallet_id: walletId || void 0
119
+ });
120
+ return {
121
+ list: (res == null ? void 0 : res.list) || [],
122
+ count: (res == null ? void 0 : res.count) || 0,
123
+ nextId: (res == null ? void 0 : res.skip) || 1
124
+ };
125
+ },
126
+ {
127
+ manual: true,
128
+ isNoMore: (d) => {
129
+ if (!(d == null ? void 0 : d.list)) return false;
130
+ return d.list.length >= (d.count || 0);
131
+ }
132
+ }
133
+ );
134
+ (0, import_react.useEffect)(() => {
135
+ const walletId = new URLSearchParams(window.location.search).get("id");
136
+ if (walletId) {
137
+ _getWalletDetail.runAsync(walletId);
138
+ }
139
+ const req1 = _getAvailableList.loadMoreAsync();
140
+ const req2 = _getUnavailableList.loadMoreAsync();
141
+ Promise.all([req1, req2]).then(([data1, data2]) => {
142
+ if (platform === "h5") return;
143
+ const list = (data1 == null ? void 0 : data1.list) || [];
144
+ const firstAvailable = list[0];
145
+ if (firstAvailable) {
146
+ setCurrentItemId(firstAvailable.id);
147
+ return;
148
+ }
149
+ const list2 = (data2 == null ? void 0 : data2.list) || [];
150
+ const firstUnavailable = list2[0];
151
+ if (firstUnavailable) {
152
+ setCurrentItemId(firstUnavailable.id);
153
+ setActiveKey("unavailable");
154
+ }
155
+ });
156
+ }, []);
157
+ const _getUnbindList = (0, import_ahooks.useRequest)(import_serve.getUnbindList, {
158
+ manual: true,
159
+ onSuccess: (data) => {
160
+ if (data == null ? void 0 : data.length) {
161
+ setCurrentUnbindItem(data[0]);
162
+ } else {
163
+ setCurrentUnbindItem(null);
164
+ (0, import_materials.PisellToast)({
165
+ content: import_utils.locales.getText("wallet-pass-gallery.searchNoFound"),
166
+ duration: 2
167
+ });
168
+ }
169
+ },
170
+ onError: (e) => {
171
+ console.log("get unbind list error", e);
172
+ setCurrentUnbindItem(null);
173
+ (0, import_materials.PisellToast)({
174
+ content: import_utils.locales.getText("wallet-pass-gallery.searchNoFound"),
175
+ duration: 2
176
+ });
177
+ }
178
+ });
179
+ (0, import_react.useEffect)(() => {
180
+ document.body.id = "body";
181
+ }, []);
182
+ const _avaliable = (0, import_react.useMemo)(() => {
183
+ var _a2;
184
+ return ((_a2 = _getAvailableList.data) == null ? void 0 : _a2.list) || [];
185
+ }, [_getAvailableList.data]);
186
+ const _unavailable = (0, import_react.useMemo)(() => {
187
+ var _a2;
188
+ return ((_a2 = _getUnavailableList.data) == null ? void 0 : _a2.list) || [];
189
+ }, [_getUnavailableList.data]);
190
+ const _handleTabChange = (key) => {
191
+ var _a2, _b2;
192
+ setActiveKey(key);
193
+ if (platform === "h5") {
194
+ setCurrentItemId(void 0);
195
+ return;
196
+ }
197
+ const newId = key === KEYS.unavailable ? (_a2 = _unavailable[0]) == null ? void 0 : _a2.id : (_b2 = _avaliable[0]) == null ? void 0 : _b2.id;
198
+ setCurrentItemId(newId);
199
+ };
200
+ const _handleMenuChange = (key) => {
201
+ setActiveKey(key);
202
+ setCurrentItemId(void 0);
203
+ };
204
+ const _resetSearchState = () => {
205
+ setCurrentUnbindItem(null);
206
+ _getUnbindList.mutate([]);
207
+ };
208
+ const _handleCardClick = (id) => {
209
+ setCurrentItemId(id);
210
+ };
211
+ const _handleSearchByCode = async (code) => {
212
+ if (!code || !code.trim()) {
213
+ _resetSearchState();
214
+ return;
215
+ }
216
+ try {
217
+ await _getUnbindList.run({
218
+ code
219
+ });
220
+ } catch (error) {
221
+ _resetSearchState();
222
+ (0, import_materials.PisellToast)({
223
+ content: import_utils.locales.getText("wallet-pass-gallery.searchNoFound"),
224
+ duration: 2
225
+ });
226
+ }
227
+ };
228
+ const _handleBind = async () => {
229
+ if (!(currentUnbindItem == null ? void 0 : currentUnbindItem.code)) return;
230
+ try {
231
+ const data = await (0, import_serve.bindCodeToCustomer)({
232
+ code: currentUnbindItem.code
233
+ });
234
+ console.log("bind result", data);
235
+ if (data) {
236
+ (0, import_materials.PisellToast)({
237
+ content: import_utils.locales.getText("wallet-pass-gallery.addSuccess"),
238
+ duration: 2
239
+ });
240
+ _getAvailableList.reloadAsync();
241
+ _getUnavailableList.reloadAsync();
242
+ }
243
+ setIsOpenAddModal(false);
244
+ _resetSearchState();
245
+ } catch (error) {
246
+ (0, import_materials.PisellToast)({
247
+ content: import_utils.locales.getText("wallet-pass-gallery.addError"),
248
+ duration: 2
249
+ });
250
+ }
251
+ };
252
+ const _currentItem = (0, import_react.useMemo)(() => {
253
+ if (!currentItemId) return null;
254
+ const found1 = _avaliable.find(
255
+ (item) => item.id === currentItemId
256
+ );
257
+ if (found1) return found1;
258
+ const found2 = _unavailable.find(
259
+ (item) => item.id === currentItemId
260
+ );
261
+ return found2;
262
+ }, [currentItemId, _avaliable, _unavailable]);
263
+ const _pcTitle = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_title" }, /* @__PURE__ */ import_react.default.createElement(Title, null, ((_g = utils == null ? void 0 : utils.translation) == null ? void 0 : _g.call(utils, (_f = (_e = _getWalletDetail.data) == null ? void 0 : _e.data) == null ? void 0 : _f.name)) || import_utils.locales.getText("wallet-pass-gallery.wallet")), platform === "pc" ? /* @__PURE__ */ import_react.default.createElement(
264
+ import_antd.Button,
265
+ {
266
+ icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "pisell2-plus" }),
267
+ size: "large",
268
+ onClick: () => setIsOpenAddModal(true)
269
+ },
270
+ import_utils.locales.getText("wallet-pass-gallery.add")
271
+ ) : null);
272
+ const renderAvaliableList = () => {
273
+ if (platform === "h5") {
274
+ return /* @__PURE__ */ import_react.default.createElement(
275
+ import_passList.default,
276
+ {
277
+ onLoadMore: () => _getAvailableList.loadMoreAsync(),
278
+ loading: _getAvailableList.loadingMore,
279
+ hasMore: !_getAvailableList.noMore,
280
+ dataSource: _avaliable,
281
+ value: currentItemId,
282
+ onChange: _handleCardClick
283
+ }
284
+ );
285
+ }
286
+ return /* @__PURE__ */ import_react.default.createElement(ARow, { gutter: 20, wrap: false }, /* @__PURE__ */ import_react.default.createElement(ACol, { flex: "367px" }, /* @__PURE__ */ import_react.default.createElement(
287
+ import_passList.default,
288
+ {
289
+ onLoadMore: () => _getAvailableList.loadMoreAsync(),
290
+ loading: _getAvailableList.loadingMore,
291
+ hasMore: !_getAvailableList.noMore,
292
+ dataSource: _avaliable,
293
+ value: currentItemId,
294
+ onChange: _handleCardClick
295
+ }
296
+ )), /* @__PURE__ */ import_react.default.createElement(ACol, { flex: "auto" }, /* @__PURE__ */ import_react.default.createElement(import_passDetail.default, { dataSource: _currentItem, platform })));
297
+ };
298
+ const renderUnavailableList = () => {
299
+ if (platform === "h5") {
300
+ return /* @__PURE__ */ import_react.default.createElement(
301
+ import_passList.default,
302
+ {
303
+ onLoadMore: () => _getUnavailableList.loadMoreAsync(),
304
+ hasMore: !_getUnavailableList.noMore,
305
+ loading: _getUnavailableList.loadingMore,
306
+ dataSource: _unavailable,
307
+ value: currentItemId,
308
+ onChange: _handleCardClick
309
+ }
310
+ );
311
+ }
312
+ return /* @__PURE__ */ import_react.default.createElement(ARow, { gutter: 20, wrap: false }, /* @__PURE__ */ import_react.default.createElement(ACol, { flex: "367px" }, /* @__PURE__ */ import_react.default.createElement(
313
+ import_passList.default,
314
+ {
315
+ onLoadMore: () => _getUnavailableList.loadMoreAsync(),
316
+ hasMore: !_getUnavailableList.noMore,
317
+ loading: _getUnavailableList.loadingMore,
318
+ dataSource: _unavailable,
319
+ value: currentItemId,
320
+ onChange: _handleCardClick
321
+ }
322
+ )), /* @__PURE__ */ import_react.default.createElement(ACol, { flex: "auto" }, /* @__PURE__ */ import_react.default.createElement(import_passDetail.default, { dataSource: _currentItem, platform })));
323
+ };
324
+ const renderTabBar = (props2, DefaultTabBar) => /* @__PURE__ */ import_react.default.createElement("div", { style: { zIndex: 99, position: "sticky", top: 0 } }, /* @__PURE__ */ import_react.default.createElement(DefaultTabBar, { ...props2, style: { background: "white" } }));
325
+ const renderContent = () => {
326
+ var _a2, _b2;
327
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_content" }, /* @__PURE__ */ import_react.default.createElement(
328
+ import_materials.Tabs,
329
+ {
330
+ defaultActiveKey: "available",
331
+ activeKey,
332
+ type: "line",
333
+ onChange: _handleTabChange,
334
+ renderTabBar: platform === "h5" ? renderTabBar : void 0,
335
+ items: [
336
+ {
337
+ key: KEYS.available,
338
+ label: import_utils.locales.getText("wallet-pass-gallery.available"),
339
+ children: renderAvaliableList(),
340
+ badge: ((_a2 = _getAvailableList.data) == null ? void 0 : _a2.count) || 0
341
+ },
342
+ {
343
+ key: KEYS.unavailable,
344
+ label: import_utils.locales.getText("wallet-pass-gallery.unavailable"),
345
+ children: renderUnavailableList(),
346
+ badge: ((_b2 = _getUnavailableList.data) == null ? void 0 : _b2.count) || 0
347
+ }
348
+ ]
349
+ }
350
+ ));
351
+ };
352
+ const renderPcContent = () => {
353
+ return /* @__PURE__ */ import_react.default.createElement("div", null, _pcTitle, renderContent());
354
+ };
355
+ const renderSearchCard = (item, index) => {
356
+ const {
357
+ id,
358
+ product_name = "",
359
+ balance = 0,
360
+ code = "",
361
+ encoded = "",
362
+ expire_date = "",
363
+ shop,
364
+ limit_status,
365
+ product_cover = "",
366
+ unified_messages = {},
367
+ par_value = "",
368
+ tag = "",
369
+ ...rest
370
+ } = item;
371
+ const { title = "" } = unified_messages;
372
+ const { name = "" } = shop;
373
+ const isActive = id === (currentUnbindItem == null ? void 0 : currentUnbindItem.id) && platform === "pc";
374
+ const isEnabled = limit_status === "enable";
375
+ const isDiscountCard = tag === "product_discount_card";
376
+ const getBalanceTitle = () => {
377
+ if (tag === "point_card") {
378
+ return import_utils.locales.getText("wallet-pass-gallery.points");
379
+ } else if (tag === "good_pass") {
380
+ return import_utils.locales.getText("wallet-pass-gallery.goodPass");
381
+ }
382
+ return void 0;
383
+ };
384
+ return /* @__PURE__ */ import_react.default.createElement(
385
+ import_materials.PisellWalletPassCard,
386
+ {
387
+ ...rest,
388
+ id,
389
+ type: tag,
390
+ key: id,
391
+ balanceTitle: getBalanceTitle(),
392
+ showDetail: false,
393
+ showRedeem: false,
394
+ showQrCode: false,
395
+ cover: product_cover,
396
+ disabled: !isEnabled,
397
+ showDisabledReason: !isEnabled,
398
+ disabledReason: title,
399
+ propStyle: { marginBottom: 10 },
400
+ showBalanceSymbol: !["point_card", "good_pass"].includes(tag),
401
+ showBalance: tag !== "product_discount_card",
402
+ active: isActive,
403
+ name: product_name,
404
+ qrCode: code,
405
+ storeName: name,
406
+ balance: Number(balance),
407
+ code: encoded,
408
+ discount: Number(par_value),
409
+ showDiscount: isDiscountCard,
410
+ validDate: expire_date,
411
+ onClick: () => setCurrentUnbindItem(item),
412
+ style: {
413
+ cursor: "pointer",
414
+ width: "100%",
415
+ marginTop: 8
416
+ }
417
+ }
418
+ );
419
+ };
420
+ const renderH5Content = () => {
421
+ var _a2, _b2, _c2, _d2, _e2, _f2;
422
+ const _walletBar = !((_c2 = (_b2 = (_a2 = utils == null ? void 0 : utils.interaction) == null ? void 0 : _a2.utils) == null ? void 0 : _b2.isAppEnv) == null ? void 0 : _c2.call(_b2)) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery-bar" }, /* @__PURE__ */ import_react.default.createElement(
423
+ "div",
424
+ {
425
+ className: "pisell-wallet-pass-gallery-header-bar-arrow",
426
+ onClick: () => {
427
+ history.back();
428
+ }
429
+ },
430
+ /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "pisell2-chevron-left" })
431
+ ), /* @__PURE__ */ import_react.default.createElement("span", { className: "header-title" }, ((_f2 = utils == null ? void 0 : utils.translation) == null ? void 0 : _f2.call(utils, (_e2 = (_d2 = _getWalletDetail.data) == null ? void 0 : _d2.data) == null ? void 0 : _e2.name)) || import_utils.locales.getText("wallet-pass-gallery.wallet")));
432
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, _walletBar, renderContent(), /* @__PURE__ */ import_react.default.createElement(
433
+ "div",
434
+ {
435
+ style: {
436
+ padding: 24
437
+ }
438
+ },
439
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { size: "large", onClick: () => setIsOpenAddModal(true), block: true }, import_utils.locales.getText("wallet-pass-gallery.button.add"))
440
+ ), /* @__PURE__ */ import_react.default.createElement(
441
+ import_materials.PisellModal,
442
+ {
443
+ platform: "h5",
444
+ visible: !!_currentItem,
445
+ onCancel: () => setCurrentItemId(""),
446
+ footer: null,
447
+ title: import_utils.locales.getText("wallet-pass-gallery.details")
448
+ },
449
+ /* @__PURE__ */ import_react.default.createElement(import_passDetail.default, { dataSource: _currentItem, platform })
450
+ ));
451
+ };
452
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
453
+ "div",
454
+ {
455
+ className: (0, import_classnames.default)(
456
+ "pisell-wallet-pass-gallery",
457
+ `pisell-wallet-pass-gallery-${platform}`
458
+ )
459
+ },
460
+ platform === "pc" ? renderPcContent() : renderH5Content()
461
+ ), /* @__PURE__ */ import_react.default.createElement(
462
+ import_materials.PisellModal,
463
+ {
464
+ title: import_utils.locales.getText("wallet-pass-gallery.add"),
465
+ platform: platform === "pc" ? "pc" : "h5",
466
+ mobileModalHeight: "auto",
467
+ open: isOpenAddModal,
468
+ onCancel: () => setIsOpenAddModal(false),
469
+ cancelVisible: false,
470
+ destroyOnClose: true,
471
+ okText: import_utils.locales.getText("wallet-pass-gallery.confirm"),
472
+ okButtonProps: { disabled: !(currentUnbindItem == null ? void 0 : currentUnbindItem.code) },
473
+ onOk: _handleBind
474
+ },
475
+ /* @__PURE__ */ import_react.default.createElement("div", { style: { margin: "24px 0" } }, /* @__PURE__ */ import_react.default.createElement(
476
+ import_materials.PisellInformationEntry,
477
+ {
478
+ title: import_utils.locales.getText("wallet-pass-gallery.addModalTitle"),
479
+ entryModes: [
480
+ {
481
+ type: "scanCode",
482
+ name: import_utils.locales.getText("wallet-pass-gallery.scanBarQrCode")
483
+ },
484
+ {
485
+ type: "input",
486
+ name: import_utils.locales.getText("wallet-pass-gallery.enterCodes")
487
+ }
488
+ ],
489
+ searchDescribe: import_utils.locales.getText(
490
+ "wallet-pass-gallery.searchDescribe"
491
+ ),
492
+ onChange: _handleSearchByCode,
493
+ onChangeType: _resetSearchState
494
+ }
495
+ ), (_getUnbindList.data || []).map(renderSearchCard))
496
+ ));
497
+ };
498
+ var walletPassGallery_default = WalletPassGallery;
@@ -0,0 +1,115 @@
1
+ .pisell-wallet-pass-gallery {
2
+ background-color: #fff;
3
+
4
+ &_content {
5
+ margin: 0 auto;
6
+ padding: 0 20px;
7
+ }
8
+
9
+ &-pc {
10
+ padding-bottom: 20px;
11
+ .pisell-wallet-pass-gallery_list {
12
+ max-height: calc(100vh - 128px);
13
+ overflow-y: auto;
14
+ }
15
+ }
16
+
17
+ &-h5 {
18
+ height: 100%;
19
+ width: 100vw;
20
+ padding: 0px;
21
+ display: flex;
22
+ flex-direction: column;
23
+ overflow: hidden;
24
+
25
+ .pisell-wallet-pass-gallery_content {
26
+ flex: 1;
27
+ width: 100%;
28
+ overflow-y: auto;
29
+ display: flex;
30
+ flex-direction: column;
31
+ padding: 0px;
32
+ }
33
+
34
+ .pisell-lowcode-tabs-content {
35
+ padding: 0 20px;
36
+ }
37
+ }
38
+
39
+ .pisell-wallet-pass-gallery_title {
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: space-between;
43
+ padding: 20px 20px 0 20px;
44
+
45
+ h1 {
46
+ margin: 0;
47
+ }
48
+ }
49
+
50
+ .pisell-lowcode-menu-root.pisell-lowcode-menu-vertical {
51
+ border-right: none;
52
+ }
53
+
54
+ .pisell-lowcode-wallet-menu {
55
+ margin: 0;
56
+
57
+ .pisell-lowcode-menu-item {
58
+ height: 72px;
59
+ margin: 0;
60
+ line-height: 72px;
61
+ padding: 0;
62
+ border-bottom: 1px solid #f2f4f7;
63
+ box-sizing: border-box;
64
+
65
+ .pisell-lowcode-wallet-menu-item {
66
+ display: flex;
67
+ justify-content: space-between;
68
+ align-items: center;
69
+
70
+ .pisell-lowcode-wallet-menu-title {
71
+ color: var(--Gray-900, #101828);
72
+ font-size: 16px;
73
+ font-style: normal;
74
+ font-weight: 500;
75
+ line-height: 24px;
76
+ margin-right: 8px;
77
+ }
78
+ }
79
+ }
80
+ }
81
+
82
+ // WalletBar 样式(迁移并适配当前组件类名)
83
+ .pisell-wallet-pass-gallery-bar {
84
+ position: relative;
85
+ height: 68px;
86
+ width: 100vw;
87
+ -webkit-box-sizing: border-box;
88
+ box-sizing: border-box;
89
+ background-color: #fff;
90
+ padding: 0 12px;
91
+ border-bottom: 1px solid #d0d5de;
92
+ color: var(--Gray-900, #101828);
93
+ text-align: center;
94
+ font-size: 14px;
95
+ font-style: normal;
96
+ font-weight: 600;
97
+ line-height: 68px;
98
+
99
+ .pisell-wallet-pass-gallery-header-bar-arrow {
100
+ position: absolute;
101
+ font-size: 24px;
102
+ top: 0px;
103
+ left: 22px;
104
+ }
105
+
106
+ .header-title {
107
+ flex: 1;
108
+ text-align: center;
109
+ font-size: 16px;
110
+ font-weight: 500;
111
+ line-height: 24px;
112
+ margin-left: -24px;
113
+ }
114
+ }
115
+ }