@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,287 @@
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/passDetail/index.tsx
30
+ var passDetail_exports = {};
31
+ __export(passDetail_exports, {
32
+ default: () => passDetail_default
33
+ });
34
+ module.exports = __toCommonJS(passDetail_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_ahooks = require("ahooks");
38
+ var import_classnames = __toESM(require("classnames"));
39
+ var import_utils = require("@pisell/utils");
40
+ var import_materials = require("@pisell/materials");
41
+ var import_utils2 = require("../../../productSelect/utils");
42
+ var import_CategoryTabs = __toESM(require("../../../productSelect/CategoryTabs"));
43
+ var import_IntersectionObserver = __toESM(require("../../../productSelect/components/IntersectionObserver"));
44
+ var import_serve = require("../../serve");
45
+ var import_usageRule = __toESM(require("../usageRule"));
46
+ var import_timelineSection = __toESM(require("../timelineSection"));
47
+ var import_recharge = __toESM(require("../recharge"));
48
+ var import_footerButton = __toESM(require("../footerButton"));
49
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
50
+ var import_index = require("./index.less");
51
+ var { Text } = import_antd.Typography;
52
+ var PassDetail = (props) => {
53
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
54
+ if (!props.dataSource) return null;
55
+ const { symbol = "$" } = (0, import_materials.usePisellConfig)();
56
+ const { dataSource, platform = "pc" } = props;
57
+ const [activeKey, setActiveKey] = (0, import_react.useState)("detail");
58
+ const [rechargeOpen, setRechargeOpen] = (0, import_react.useState)(false);
59
+ const containerRef = (0, import_react.useRef)(null);
60
+ const isIndicatorVisibleRef = (0, import_react.useRef)(false);
61
+ const context = (0, import_useEngineContext.default)();
62
+ const { store } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || { store: {} };
63
+ const timezone = ((_e = (_d = (_c = (_b = store == null ? void 0 : store.getState) == null ? void 0 : _b.call(store)) == null ? void 0 : _c.global) == null ? void 0 : _d.symbol) == null ? void 0 : _e.shop.timezone) || "Asia/Shanghai";
64
+ const {
65
+ id = "",
66
+ code = "",
67
+ tag = "",
68
+ product_title = "",
69
+ encoded = "",
70
+ balance,
71
+ expire_date = "",
72
+ product = {}
73
+ } = dataSource || {};
74
+ const {
75
+ description = "",
76
+ extension_data = [],
77
+ customer_order_behavior_count = 0
78
+ } = product || {};
79
+ const _getDetail = (0, import_ahooks.useRequest)(() => (0, import_serve.getDetailApi)({ id }), {
80
+ ready: !!id,
81
+ refreshDeps: [id]
82
+ });
83
+ (0, import_react.useEffect)(() => {
84
+ if (tag === "product_discount_card") {
85
+ setActiveKey("detail");
86
+ }
87
+ if (containerRef.current) {
88
+ containerRef.current.scrollTop = 0;
89
+ }
90
+ }, [id, tag]);
91
+ const _anchorOptions = (0, import_react.useMemo)(() => {
92
+ const options = [
93
+ {
94
+ key: "detail",
95
+ label: import_utils.locales.getText("wallet-pass-gallery.detail")
96
+ }
97
+ ];
98
+ if (tag !== "product_discount_card") {
99
+ options.push({
100
+ key: "activityLog",
101
+ label: import_utils.locales.getText("wallet-pass-gallery.activelog")
102
+ });
103
+ }
104
+ return options;
105
+ }, [dataSource == null ? void 0 : dataSource.tag]);
106
+ const debounceIndicator = (0, import_react.useCallback)((delay) => {
107
+ isIndicatorVisibleRef.current = true;
108
+ const timeoutId = setTimeout(() => {
109
+ isIndicatorVisibleRef.current = false;
110
+ }, delay);
111
+ return () => clearTimeout(timeoutId);
112
+ }, []);
113
+ const descs = (0, import_react.useMemo)(() => {
114
+ var _a2;
115
+ let data = [
116
+ {
117
+ label: import_utils.locales.getText("wallet-pass-gallery.cardName"),
118
+ value: product_title
119
+ },
120
+ {
121
+ label: import_utils.locales.getText("wallet-pass-gallery.carNumber"),
122
+ value: encoded,
123
+ isLink: false
124
+ },
125
+ {
126
+ label: import_utils.locales.getText("wallet-pass-gallery.validDate"),
127
+ value: expire_date ? expire_date : import_utils.locales.getText("wallet-pass-gallery.expireDate")
128
+ }
129
+ ];
130
+ if (tag === "product_discount_card") {
131
+ const isFixedAmount = ((_a2 = dataSource.metadata) == null ? void 0 : _a2.discount_card_type) === "fixed_amount";
132
+ data.splice(2, 0, {
133
+ label: import_utils.locales.getText("wallet-pass-gallery.discount"),
134
+ value: balance ? isFixedAmount ? `${symbol}${Number(balance)}` : `${Number(balance)}%` : ""
135
+ });
136
+ } else if (tag === "point_card") {
137
+ data.splice(2, 0, {
138
+ label: import_utils.locales.getText("wallet-pass-gallery.points"),
139
+ value: balance ? `${Number(balance)}` : ""
140
+ });
141
+ } else if (tag === "good_pass") {
142
+ data.splice(2, 0, {
143
+ label: import_utils.locales.getText("wallet-pass-gallery.goodPass"),
144
+ value: balance ? `${Number(balance)}` : ""
145
+ });
146
+ } else {
147
+ data.splice(2, 0, {
148
+ label: import_utils.locales.getText("wallet-pass-gallery.balance"),
149
+ value: balance ? `${symbol}${Number(balance)}` : ""
150
+ });
151
+ }
152
+ return data;
153
+ }, [dataSource]);
154
+ const handleItemIntersectionIn = (0, import_react.useCallback)((_key) => {
155
+ if (!isIndicatorVisibleRef.current && _key) {
156
+ setActiveKey(_key);
157
+ }
158
+ }, []);
159
+ if (!dataSource) {
160
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Empty, null);
161
+ }
162
+ const _switchCategory = (key) => {
163
+ setActiveKey(key);
164
+ debounceIndicator(300);
165
+ const categoryIndex = _anchorOptions.findIndex((item) => item.key === key);
166
+ const _scrollParent = containerRef.current;
167
+ if (!_scrollParent) return;
168
+ const target = document.querySelector(
169
+ `[data-anchor="${key}"]`
170
+ );
171
+ if (!target) return;
172
+ const detailWrapper = document.querySelector(
173
+ `.pisell-wallet-pass-gallery_detail-content`
174
+ );
175
+ const tabsWrapper = document.querySelector(
176
+ `.pisell-wallet-pass-gallery-tabs-wrapper`
177
+ );
178
+ const tabsHeight = (tabsWrapper == null ? void 0 : tabsWrapper.offsetHeight) || 0;
179
+ if (categoryIndex === 0) {
180
+ if (detailWrapper) {
181
+ const wrapperOffsetTop = (0, import_utils2.getOffsetTopRelativeToScrollContainer)(
182
+ detailWrapper,
183
+ _scrollParent
184
+ );
185
+ _scrollParent.scrollTop = wrapperOffsetTop;
186
+ }
187
+ return;
188
+ } else {
189
+ const listOffsetTop = (0, import_utils2.getOffsetTopRelativeToScrollContainer)(
190
+ target,
191
+ _scrollParent
192
+ );
193
+ _scrollParent.scrollTop = listOffsetTop - tabsHeight;
194
+ }
195
+ };
196
+ const renderTimeLine = () => {
197
+ if (tag === "product_discount_card") return null;
198
+ return /* @__PURE__ */ import_react.default.createElement(import_timelineSection.default, { code, tag, timezone });
199
+ };
200
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
201
+ "div",
202
+ {
203
+ className: (0, import_classnames.default)(
204
+ `pisell-wallet-pass-gallery_detail`,
205
+ `pisell-wallet-pass-gallery_detail-${platform}`
206
+ )
207
+ },
208
+ /* @__PURE__ */ import_react.default.createElement(
209
+ "div",
210
+ {
211
+ className: "pisell-wallet-pass-gallery_detail-content",
212
+ ref: containerRef
213
+ },
214
+ _anchorOptions.length > 1 && /* @__PURE__ */ import_react.default.createElement(
215
+ import_CategoryTabs.default,
216
+ {
217
+ key: id,
218
+ className: "pisell-wallet-pass-gallery-tabs-wrapper",
219
+ activeKey,
220
+ items: _anchorOptions,
221
+ onChange: _switchCategory,
222
+ loading: false,
223
+ style: { padding: 0 }
224
+ }
225
+ ),
226
+ /* @__PURE__ */ import_react.default.createElement(
227
+ import_IntersectionObserver.default,
228
+ {
229
+ rootMargin: "-70px 0px -270px 0px",
230
+ priorityMode: "top"
231
+ },
232
+ /* @__PURE__ */ import_react.default.createElement(
233
+ import_IntersectionObserver.IntersectionTrigger,
234
+ {
235
+ style: { height: "1px" },
236
+ onShow: () => handleItemIntersectionIn("detail")
237
+ },
238
+ /* @__PURE__ */ import_react.default.createElement("div", { "data-anchor": "detail" })
239
+ ),
240
+ /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(Text, { className: "pisell-wallet-pass-gallery_detail-title" }, import_utils.locales.getText("wallet-pass-gallery.details")), platform === "pc" && tag === "gift_card" && ((_f = dataSource == null ? void 0 : dataSource.machinecode_config) == null ? void 0 : _f.hide_recharge) === 0 && /* @__PURE__ */ import_react.default.createElement(
241
+ import_antd.Button,
242
+ {
243
+ type: "primary",
244
+ size: "large",
245
+ onClick: () => setRechargeOpen(true)
246
+ },
247
+ import_utils.locales.getText("wallet-pass-gallery.recharge")
248
+ ), /* @__PURE__ */ import_react.default.createElement(
249
+ import_materials.PisellStatisticList,
250
+ {
251
+ data: descs,
252
+ labelColor: "#667085",
253
+ valueColor: "#101828",
254
+ backgroundColors: ["#fff"],
255
+ isHasBorder: false
256
+ }
257
+ ), description && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_detail-card-content-tip" }, /* @__PURE__ */ import_react.default.createElement("div", { dangerouslySetInnerHTML: { __html: description } })), /* @__PURE__ */ import_react.default.createElement(import_usageRule.default, { dataSource: _getDetail.data })),
258
+ /* @__PURE__ */ import_react.default.createElement(
259
+ import_IntersectionObserver.IntersectionTrigger,
260
+ {
261
+ style: { height: "1px" },
262
+ onShow: () => handleItemIntersectionIn("activityLog")
263
+ },
264
+ /* @__PURE__ */ import_react.default.createElement("div", { "data-anchor": "activityLog" })
265
+ ),
266
+ /* @__PURE__ */ import_react.default.createElement("div", null, renderTimeLine())
267
+ )
268
+ )
269
+ ), platform === "h5" && tag === "gift_card" ? /* @__PURE__ */ import_react.default.createElement(
270
+ import_footerButton.default,
271
+ {
272
+ appleWalletUrl: (_g = _getDetail.data) == null ? void 0 : _g.apple_wallet_url,
273
+ googleWalletUrl: (_h = _getDetail.data) == null ? void 0 : _h.google_wallet_url,
274
+ onRechargeClick: ((_i = dataSource == null ? void 0 : dataSource.machinecode_config) == null ? void 0 : _i.hide_recharge) === 0 ? () => setRechargeOpen(true) : void 0,
275
+ platform
276
+ }
277
+ ) : null, /* @__PURE__ */ import_react.default.createElement(
278
+ import_recharge.default,
279
+ {
280
+ platform,
281
+ detailData: _getDetail.data,
282
+ open: rechargeOpen,
283
+ onClose: () => setRechargeOpen(false)
284
+ }
285
+ ));
286
+ };
287
+ var passDetail_default = PassDetail;
@@ -0,0 +1,57 @@
1
+ .pisell-wallet-pass-gallery_detail {
2
+ background-color: white;
3
+ overflow: hidden;
4
+
5
+ &-pc {
6
+ height: 800px;
7
+ max-height: calc(100vh - 128px);
8
+ border: 1px solid #d0d5de;
9
+ padding: 20px;
10
+ z-index: 1;
11
+ border-radius: 12px;
12
+ }
13
+
14
+ &-h5 {
15
+ height: 100%;
16
+ overflow: hidden;
17
+ border: none;
18
+ padding: 20px 0px;
19
+ }
20
+
21
+ .pisell-wallet-pass-gallery_detail-content {
22
+ overflow-y: auto;
23
+ height: 100%;
24
+ &::-webkit-scrollbar {
25
+ width: 0 !important;
26
+ height: 0 !important;
27
+ background: transparent !important;
28
+ display: none !important;
29
+ }
30
+ }
31
+
32
+ .pisell-wallet-pass-gallery_detail-title {
33
+ color: #101828;
34
+ font-size: 20px;
35
+ font-weight: 600;
36
+ line-height: 30px;
37
+ margin: 10px 0;
38
+ display: block;
39
+ }
40
+
41
+ // 覆盖 tab 默认样式
42
+ .pisell-tabstruct-item[aria-selected='true'] {
43
+ background-color: var(--theme-color);
44
+ }
45
+
46
+ .pisell-tabstruct-selection {
47
+ background-color: var(--theme-color);
48
+ transition: none !important;
49
+ }
50
+
51
+ .pisell-wallet-pass-gallery_detail-card-content-tip {
52
+ color: #667085;
53
+ font-size: 14px;
54
+ line-height: 22px;
55
+ margin: 12px 0;
56
+ }
57
+ }
@@ -0,0 +1,11 @@
1
+ interface IPassListProps {
2
+ dataSource: any[];
3
+ value?: string | number;
4
+ onChange?: (newId: string | number) => void;
5
+ valuePropName?: string;
6
+ hasMore?: boolean;
7
+ onLoadMore?: () => void;
8
+ loading?: boolean;
9
+ }
10
+ declare const PassList: (props: IPassListProps) => JSX.Element;
11
+ export default PassList;
@@ -0,0 +1,136 @@
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/passList/index.tsx
30
+ var passList_exports = {};
31
+ __export(passList_exports, {
32
+ default: () => passList_default
33
+ });
34
+ module.exports = __toCommonJS(passList_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 PassList = (props) => {
40
+ const {
41
+ dataSource = [],
42
+ value,
43
+ onChange,
44
+ valuePropName = "id",
45
+ hasMore,
46
+ onLoadMore,
47
+ loading
48
+ } = props;
49
+ const _loadMore = /* @__PURE__ */ import_react.default.createElement(
50
+ "div",
51
+ {
52
+ style: {
53
+ textAlign: "center",
54
+ marginBottom: 12,
55
+ height: 32,
56
+ lineHeight: "32px"
57
+ }
58
+ },
59
+ hasMore ? /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: onLoadMore, loading }, import_utils.locales.getText("wallet-pass-gallery.viewMore")) : /* @__PURE__ */ import_react.default.createElement(
60
+ "div",
61
+ {
62
+ style: {
63
+ color: "#999"
64
+ }
65
+ },
66
+ import_utils.locales.getText("wallet-pass-gallery.allLoaded")
67
+ )
68
+ );
69
+ return /* @__PURE__ */ import_react.default.createElement(
70
+ import_antd.List,
71
+ {
72
+ className: "pisell-wallet-pass-gallery_list",
73
+ itemLayout: "horizontal",
74
+ dataSource,
75
+ split: false,
76
+ loadMore: _loadMore,
77
+ loading,
78
+ renderItem: (item, index) => {
79
+ const {
80
+ id,
81
+ tag,
82
+ product_title = "",
83
+ balance = 0,
84
+ code = "",
85
+ encoded = "",
86
+ expire_date = "",
87
+ shop = { name: "" },
88
+ limit_status,
89
+ product_cover = "",
90
+ par_value = "",
91
+ unified_messages = {},
92
+ ...rest
93
+ } = item;
94
+ const itemValue = item == null ? void 0 : item[valuePropName];
95
+ const { title: disabledReason = "" } = unified_messages;
96
+ const { name: storeName = "" } = shop;
97
+ const isDiscountCard = tag === "product_discount_card";
98
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.List.Item, { style: { padding: 0 } }, /* @__PURE__ */ import_react.default.createElement(
99
+ "div",
100
+ {
101
+ style: { cursor: "pointer", width: "100%" },
102
+ role: "button",
103
+ onClick: () => onChange == null ? void 0 : onChange(itemValue)
104
+ },
105
+ /* @__PURE__ */ import_react.default.createElement(
106
+ import_materials.PisellWalletPassCard,
107
+ {
108
+ ...rest,
109
+ balanceTitle: tag === "good_pass" ? import_utils.locales.getText("wallet-pass-gallery.goodPass") : void 0,
110
+ showDetail: false,
111
+ showRedeem: false,
112
+ showQrCode: true,
113
+ showBalance: !isDiscountCard,
114
+ cover: product_cover,
115
+ disabled: limit_status !== "enable",
116
+ showDisabledReason: limit_status !== "enable",
117
+ disabledReason,
118
+ style: { marginBottom: 16, width: "100%" },
119
+ showBalanceSymbol: !["point_card", "good_pass"].includes(tag),
120
+ active: value === itemValue,
121
+ name: product_title,
122
+ qrCode: code,
123
+ storeName,
124
+ balance: Number(balance),
125
+ discount: isDiscountCard ? Number(par_value) : void 0,
126
+ showDiscount: isDiscountCard,
127
+ code: encoded,
128
+ validDate: expire_date
129
+ }
130
+ )
131
+ ));
132
+ }
133
+ }
134
+ );
135
+ };
136
+ var passList_default = PassList;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { IDetailResponse } from '../../serve';
3
+ import './index.less';
4
+ interface RechargeProps {
5
+ platform?: 'pc' | 'h5';
6
+ detailData?: IDetailResponse | undefined;
7
+ open: boolean;
8
+ onClose: () => void;
9
+ }
10
+ declare const Recharge: React.FC<RechargeProps>;
11
+ export default Recharge;
@@ -0,0 +1,146 @@
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/recharge/index.tsx
30
+ var recharge_exports = {};
31
+ __export(recharge_exports, {
32
+ default: () => recharge_default
33
+ });
34
+ module.exports = __toCommonJS(recharge_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_utils = require("@pisell/utils");
38
+ var import_materials = require("@pisell/materials");
39
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
40
+ var import_serve = require("../../serve");
41
+ var import_index = require("./index.less");
42
+ var Recharge = ({
43
+ platform = "pc",
44
+ detailData,
45
+ open,
46
+ onClose
47
+ }) => {
48
+ var _a, _b, _c, _d, _e, _f, _g;
49
+ const [chargeItem, setChargeItem] = (0, import_react.useState)({});
50
+ const context = (0, import_useEngineContext.default)();
51
+ const { action, storage } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
52
+ const dvaStore = (_e = (_d = (_c = (_b = context.appHelper) == null ? void 0 : _b.utils) == null ? void 0 : _c.getStore) == null ? void 0 : _d.call(_c)) == null ? void 0 : _e.getState();
53
+ const shop = ((_g = (_f = dvaStore == null ? void 0 : dvaStore.core) == null ? void 0 : _f.core) == null ? void 0 : _g.shop) || {};
54
+ (0, import_react.useEffect)(() => {
55
+ if (detailData) {
56
+ setChargeItem(((detailData == null ? void 0 : detailData.gift_option) || [])[0]);
57
+ }
58
+ }, [detailData]);
59
+ const handleRecharge = async () => {
60
+ var _a2;
61
+ try {
62
+ const params = {
63
+ voucher_id: (detailData == null ? void 0 : detailData.id) || "",
64
+ product_id: (detailData == null ? void 0 : detailData.product_id) || "",
65
+ product_variant_id: (chargeItem == null ? void 0 : chargeItem.variant_id) || "",
66
+ quantity: 1,
67
+ type: "virtual",
68
+ platform: "h5",
69
+ currency_code: {
70
+ currency_code: (shop == null ? void 0 : shop.currency_code) || "",
71
+ currency_symbol: (shop == null ? void 0 : shop.currency_symbol) || "",
72
+ currency_format: (shop == null ? void 0 : shop.currency_format) || ""
73
+ }
74
+ };
75
+ const data = await (0, import_serve.orderRechargeProduct)(params);
76
+ if (data == null ? void 0 : data.order_id) {
77
+ (_a2 = storage == null ? void 0 : storage.set) == null ? void 0 : _a2.call(storage, "orderId", data.order_id);
78
+ action && action({
79
+ type: "pisell1.payment",
80
+ data,
81
+ callback: () => {
82
+ }
83
+ });
84
+ }
85
+ } catch (error) {
86
+ console.error(
87
+ import_utils.locales.getText("wallet-pass-gallery.log.rechargeOrderFailed"),
88
+ error
89
+ );
90
+ }
91
+ };
92
+ return /* @__PURE__ */ import_react.default.createElement(
93
+ import_antd.Drawer,
94
+ {
95
+ title: import_utils.locales.getText("wallet-pass-gallery.rechargeOptions"),
96
+ open,
97
+ zIndex: 999,
98
+ onClose,
99
+ width: 375,
100
+ placement: platform === "pc" ? "right" : "bottom",
101
+ footer: /* @__PURE__ */ import_react.default.createElement(
102
+ import_antd.Button,
103
+ {
104
+ type: "primary",
105
+ block: true,
106
+ size: "large",
107
+ onClick: handleRecharge,
108
+ disabled: !(chargeItem == null ? void 0 : chargeItem.id)
109
+ },
110
+ import_utils.locales.getText("wallet-pass-gallery.recharge")
111
+ )
112
+ },
113
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_recharge" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_recharge-options" }, ((detailData == null ? void 0 : detailData.gift_option) || []).map((item) => /* @__PURE__ */ import_react.default.createElement(
114
+ "div",
115
+ {
116
+ key: item.id,
117
+ className: "pisell-wallet-pass-gallery_recharge-card-item",
118
+ onClick: () => setChargeItem(item)
119
+ },
120
+ /* @__PURE__ */ import_react.default.createElement(
121
+ import_materials.PisellCard,
122
+ {
123
+ className: `pisell-card-item ${item.id === (chargeItem == null ? void 0 : chargeItem.id) ? "pisell-card-selected" : ""}`
124
+ },
125
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "card-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "card-content-left" }, /* @__PURE__ */ import_react.default.createElement("p", { className: "pisell-card-amount-item-name" }, item.name), /* @__PURE__ */ import_react.default.createElement(
126
+ import_materials.PisellText.Amount,
127
+ {
128
+ showCurrencySymbol: true,
129
+ className: "pisell-card-amount-item-value",
130
+ useThousandsSeparator: true,
131
+ value: item.gift_price
132
+ }
133
+ )), /* @__PURE__ */ import_react.default.createElement(
134
+ import_materials.PisellText.Amount,
135
+ {
136
+ showCurrencySymbol: true,
137
+ className: "pisell-card-amount-item-value",
138
+ useThousandsSeparator: true,
139
+ value: item.price
140
+ }
141
+ ))
142
+ )
143
+ ))))
144
+ );
145
+ };
146
+ var recharge_default = Recharge;
@@ -0,0 +1,16 @@
1
+ .pisell-wallet-pass-gallery_recharge {
2
+ &-options {
3
+ display: grid;
4
+ grid-template-columns: 1fr;
5
+ gap: 12px;
6
+ }
7
+
8
+ &-card-item {
9
+ cursor: pointer;
10
+ }
11
+
12
+ .pisell-card-selected {
13
+ border: 1px solid var(--theme-color, #7f56d9);
14
+ background: var(--Primary-50, #f9f5ff);
15
+ }
16
+ }
@@ -0,0 +1,8 @@
1
+ import './index.less';
2
+ interface TimelineSectionProps {
3
+ code: string;
4
+ tag: string;
5
+ timezone: string;
6
+ }
7
+ declare const TimelineSection: (props: TimelineSectionProps) => JSX.Element;
8
+ export default TimelineSection;