@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
@@ -9,7 +9,6 @@ import ProductExtension from './productExtension';
9
9
  import RuleSetting from './ruleSetting';
10
10
  import TaxSelect from './taxSelect';
11
11
  import ToCPay from './pay/toC';
12
- import Wallet from './wallet';
13
12
  import WalletList from './walletList';
14
13
  import WorkspaceListDetail from './workSpaceListDetail/';
15
14
  import WorkspaceList from './workSpaceList';
@@ -19,4 +18,4 @@ import EditBookingModal from './booking/editBookingModal';
19
18
  import StepController from './stepController';
20
19
  import PinModal from './pinModal';
21
20
  import PinVerifyModal from './pinVerifyModal';
22
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, };
21
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, };
@@ -9,7 +9,6 @@ import ProductExtension from "./productExtension";
9
9
  import RuleSetting from "./ruleSetting";
10
10
  import TaxSelect from "./taxSelect";
11
11
  import ToCPay from "./pay/toC";
12
- import Wallet from "./wallet";
13
12
  import WalletList from "./walletList";
14
13
  import WorkspaceListDetail from "./workSpaceListDetail/";
15
14
  import WorkspaceList from "./workSpaceList";
@@ -19,4 +18,4 @@ import EditBookingModal from "./booking/editBookingModal";
19
18
  import StepController from "./stepController";
20
19
  import PinModal from "./pinModal";
21
20
  import PinVerifyModal from "./pinVerifyModal";
22
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal };
21
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal };
@@ -1,28 +1,3 @@
1
- import React from 'react';
2
1
  import './index.less';
3
- declare module 'react' {
4
- interface HTMLAttributes<T> {
5
- role?: string;
6
- }
7
- }
8
- declare global {
9
- namespace JSX {
10
- interface IntrinsicElements {
11
- div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
12
- children?: React.ReactNode;
13
- onClick?: React.MouseEventHandler<HTMLDivElement>;
14
- onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
15
- onMouseUp?: React.MouseEventHandler<HTMLDivElement>;
16
- onTouchStart?: React.TouchEventHandler<HTMLDivElement>;
17
- onTouchEnd?: React.TouchEventHandler<HTMLDivElement>;
18
- role?: string;
19
- };
20
- img: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
21
- span: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> & {
22
- children?: React.ReactNode;
23
- };
24
- }
25
- }
26
- }
27
2
  declare const WalletList: (props: any) => JSX.Element;
28
3
  export default WalletList;
@@ -21,7 +21,7 @@ import { Provider, Context } from "./model";
21
21
  import { WalletCard, Carousel } from '@pisell/materials';
22
22
  import { LeftOutlined, RightOutlined } from '@ant-design/icons';
23
23
  import useEngineContext from "./../../hooks/useEngineContext";
24
- import { getWalletList, getWalletBalance, getWalletShopList } from "./serve";
24
+ import { getWalletList, batchGetWalletBalance, getWalletShopList } from "./serve";
25
25
  import { locales, getUniqueId } from '@pisell/utils';
26
26
  import { request } from "./../../utils";
27
27
  import { defaultWalletGuideConfig } from "./status";
@@ -29,7 +29,7 @@ import localeTexts from "./locales";
29
29
  import "./index.less";
30
30
  import classNames from 'classnames';
31
31
  // 导入所有类型
32
- import { WalletCardItem, DEFAULT_CARD_CONFIG } from "./types";
32
+ import { DEFAULT_CARD_CONFIG } from "./types";
33
33
  import PinModal from "../pinModal";
34
34
 
35
35
  // 添加 localStorage 相关的操作函数
@@ -73,10 +73,6 @@ var getFromLocalStorage = function getFromLocalStorage(key) {
73
73
  }
74
74
  };
75
75
 
76
- // @ts-ignore
77
-
78
- // @ts-ignore
79
-
80
76
  // 定义轮播图配置
81
77
  var CAROUSEL_CONFIG = {
82
78
  className: 'pisell-lowcode__walletList',
@@ -126,8 +122,43 @@ var DEFAULT_WALLET_CARD = {
126
122
  en: 'Level'
127
123
  },
128
124
  metadata: {
129
- barcodetype: 'barCode',
130
- showcaseWalletPass: ['rechargeable', 'piont', 'voucher', 'discount'],
125
+ showcaseWalletPassNew: [{
126
+ type: 'rechargeable',
127
+ display: 1,
128
+ custom_title: {
129
+ original: 'Balance',
130
+ 'zh-CN': '充值卡',
131
+ 'zh-HK': '充值卡',
132
+ en: 'Balance'
133
+ }
134
+ }, {
135
+ type: 'point',
136
+ display: 1,
137
+ custom_title: {
138
+ original: 'Points',
139
+ 'zh-CN': '积分卡',
140
+ 'zh-HK': '積分卡',
141
+ en: 'Points'
142
+ }
143
+ }, {
144
+ type: 'voucher',
145
+ display: 1,
146
+ custom_title: {
147
+ original: 'Voucher',
148
+ 'zh-CN': '代金券',
149
+ 'zh-HK': '代金券',
150
+ en: 'Voucher'
151
+ }
152
+ }, {
153
+ type: 'discount',
154
+ display: 1,
155
+ custom_title: {
156
+ original: 'Discount',
157
+ 'zh-CN': '折扣卡',
158
+ 'zh-HK': '折扣卡',
159
+ en: 'Discount'
160
+ }
161
+ }],
131
162
  coverImage: '',
132
163
  icon: ''
133
164
  }
@@ -243,7 +274,7 @@ var WalletList = Provider(function (props) {
243
274
  if (isMountedRef.current) {
244
275
  setState({
245
276
  list: [DEFAULT_WALLET_CARD],
246
- balance: DEFAULT_BALANCE,
277
+ balance: [],
247
278
  hasAttempted: true,
248
279
  isLoggedIn: false
249
280
  });
@@ -392,7 +423,7 @@ var WalletList = Provider(function (props) {
392
423
  };
393
424
  var initData = /*#__PURE__*/function () {
394
425
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(requestId) {
395
- var cachedList, cachedBalance, _yield$Promise$all, _yield$Promise$all2, walletListData, walletBalanceData, _message, _data, isAuthError;
426
+ var cachedList, cachedBalance, walletListData, walletBalanceData, _message, _data, isAuthError;
396
427
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
397
428
  while (1) switch (_context3.prev = _context3.next) {
398
429
  case 0:
@@ -415,7 +446,7 @@ var WalletList = Provider(function (props) {
415
446
  // 设置状态为已尝试请求,提供默认数据而不是空列表
416
447
  setState({
417
448
  list: [DEFAULT_WALLET_CARD],
418
- balance: DEFAULT_BALANCE,
449
+ balance: [],
419
450
  hasAttempted: true,
420
451
  isLoggedIn: false
421
452
  });
@@ -433,6 +464,13 @@ var WalletList = Provider(function (props) {
433
464
  try {
434
465
  cachedList = getFromLocalStorage(STORAGE_KEY);
435
466
  cachedBalance = getFromLocalStorage(STORAGE_KEY_BALANCE);
467
+ // 避免使用旧版数据
468
+ if (!Array.isArray(cachedBalance) || !cachedBalance.some(function () {
469
+ var _items, _items$hasOwnProperty;
470
+ return (_items = items) === null || _items === void 0 || (_items$hasOwnProperty = _items.hasOwnProperty) === null || _items$hasOwnProperty === void 0 ? void 0 : _items$hasOwnProperty.call(_items, 'gift_card_balance');
471
+ })) {
472
+ cachedBalance = null;
473
+ }
436
474
  } catch (e) {
437
475
  console.error('Error fetching from localStorage:', e);
438
476
  }
@@ -453,12 +491,15 @@ var WalletList = Provider(function (props) {
453
491
  return _context3.abrupt("return");
454
492
  case 16:
455
493
  _context3.next = 18;
456
- return Promise.all([getWalletList(), getWalletBalance()]);
494
+ return getWalletList();
457
495
  case 18:
458
- _yield$Promise$all = _context3.sent;
459
- _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
460
- walletListData = _yield$Promise$all2[0];
461
- walletBalanceData = _yield$Promise$all2[1];
496
+ walletListData = _context3.sent;
497
+ _context3.next = 21;
498
+ return batchGetWalletBalance(walletListData.map(function (item) {
499
+ return item.wallet_id;
500
+ }));
501
+ case 21:
502
+ walletBalanceData = _context3.sent;
462
503
  if (!(!isMountedRef.current || requestIdRef.current !== requestId)) {
463
504
  _context3.next = 24;
464
505
  break;
@@ -498,36 +539,38 @@ var WalletList = Provider(function (props) {
498
539
  _context2.prev = 2;
499
540
  // 准备重试请求
500
541
  retryBalanceData = walletBalanceData;
501
- retryListData = walletListData; // 如果余额数据为空,重试请求余额
502
- if (walletBalanceData) {
542
+ retryListData = walletListData; // 如果列表数据为空,重试请求列表
543
+ if (!(Array.isArray(walletListData) && walletListData.length === 0)) {
503
544
  _context2.next = 10;
504
545
  break;
505
546
  }
506
547
  _context2.next = 8;
507
- return getWalletBalance();
548
+ return getWalletList();
508
549
  case 8:
509
- retryBalanceData = _context2.sent;
510
- if (retryBalanceData) {
550
+ retryListData = _context2.sent;
551
+ if (retryListData && retryListData.length > 0) {
511
552
  try {
512
- saveToLocalStorage(STORAGE_KEY_BALANCE, retryBalanceData);
553
+ saveToLocalStorage(STORAGE_KEY, retryListData);
513
554
  } catch (e) {
514
- console.error('Error saving retry balance to localStorage:', e);
555
+ console.error('Error saving retry list to localStorage:', e);
515
556
  }
516
557
  }
517
558
  case 10:
518
- if (!(Array.isArray(walletListData) && walletListData.length === 0)) {
559
+ if (walletBalanceData) {
519
560
  _context2.next = 15;
520
561
  break;
521
562
  }
522
563
  _context2.next = 13;
523
- return getWalletList({});
564
+ return batchGetWalletBalance(retryListData.map(function (item) {
565
+ return item.wallet_id;
566
+ }));
524
567
  case 13:
525
- retryListData = _context2.sent;
526
- if (retryListData && retryListData.length > 0) {
568
+ retryBalanceData = _context2.sent;
569
+ if (retryBalanceData) {
527
570
  try {
528
- saveToLocalStorage(STORAGE_KEY, retryListData);
571
+ saveToLocalStorage(STORAGE_KEY_BALANCE, retryBalanceData);
529
572
  } catch (e) {
530
- console.error('Error saving retry list to localStorage:', e);
573
+ console.error('Error saving retry balance to localStorage:', e);
531
574
  }
532
575
  }
533
576
  case 15:
@@ -598,67 +641,56 @@ var WalletList = Provider(function (props) {
598
641
  console.error('onViewPinClick方法需要传入wallet_detail_id');
599
642
  }
600
643
  };
601
- var renderWalletCard = function renderWalletCard(item) {
644
+ var renderWalletCard = function renderWalletCard(_walletItem) {
602
645
  var _dvaStore$core;
603
- var code = item.code,
604
- shop = item.shop,
605
- wallet = item.wallet,
606
- id = item.id;
646
+ var code = _walletItem.code,
647
+ shop = _walletItem.shop,
648
+ wallet = _walletItem.wallet,
649
+ id = _walletItem.id;
607
650
  var _ref5 = wallet || {},
608
651
  metadata = _ref5.metadata,
609
652
  name = _ref5.name;
610
653
  var _ref6 = metadata || {},
611
- _ref6$barcodetype = _ref6.barcodetype,
612
- barcodetype = _ref6$barcodetype === void 0 ? 'barCode' : _ref6$barcodetype,
613
- _ref6$showcaseWalletP = _ref6.showcaseWalletPass,
614
- showcaseWalletPass = _ref6$showcaseWalletP === void 0 ? [] : _ref6$showcaseWalletP,
654
+ _ref6$showcaseWalletP = _ref6.showcaseWalletPassNew,
655
+ showcaseWalletPassNew = _ref6$showcaseWalletP === void 0 ? [] : _ref6$showcaseWalletP,
615
656
  _ref6$coverImage = _ref6.coverImage,
616
657
  coverImage = _ref6$coverImage === void 0 ? '' : _ref6$coverImage,
617
658
  _ref6$icon = _ref6.icon,
618
659
  icon = _ref6$icon === void 0 ? '' : _ref6$icon;
619
660
  var shopName = shop.name;
620
- var balance = state.balance;
661
+ var _state$balance = state.balance,
662
+ balance = _state$balance === void 0 ? [] : _state$balance;
663
+ var balanceItem = balance.find(function (bi) {
664
+ return bi.wallet_id == _walletItem.wallet_id;
665
+ }) || DEFAULT_BALANCE;
621
666
 
622
667
  // 字段映射关系
623
- var balanceKeyMap = {
624
- gift_card_balance: 'rechargeable',
625
- point_card_balance: 'piont',
626
- voucher_count: 'voucher',
627
- discount_card_count: 'discount'
668
+ var _balanceKeyMap = {
669
+ rechargeable: 'gift_card_balance',
670
+ point: 'point_card_balance',
671
+ voucher: 'voucher_count',
672
+ discount: 'discount_card_count'
628
673
  };
629
-
630
- // 根据showcaseWalletPass生成items数组
631
- var cardItems = (showcaseWalletPass || []).map(function (key) {
632
- var _Object$entries$find;
633
- // 找到对应的balance字段
634
- var balanceKey = (_Object$entries$find = Object.entries(balanceKeyMap).find(function (_ref7) {
635
- var _ref8 = _slicedToArray(_ref7, 2),
636
- _ = _ref8[0],
637
- value = _ref8[1];
638
- return value === key;
639
- })) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0];
640
- var value = balanceKey ? balance[balanceKey] || 0 : 0;
641
- if (balanceKey === 'voucher_count') {
642
- value += balance.good_pass_count;
643
- }
644
- return {
645
- key: key,
646
- label: key,
647
- hidden: false,
674
+ var cardItems = showcaseWalletPassNew.map(function (item) {
675
+ var balanceKey = _balanceKeyMap[item.type];
676
+ var value = balanceKey ? balanceItem[balanceKey] || 0 : 0;
677
+ return _objectSpread(_objectSpread({}, item), {}, {
648
678
  value: value
649
- };
679
+ });
650
680
  });
681
+
651
682
  // 构建WalletCard的props
652
683
  // 优先级:接口返回值 > globalState > DEFAULT_CARD_CONFIG
653
684
  var cardProps = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CARD_CONFIG), globalState), {}, {
654
685
  // 最后应用API返回的数据,这些拥有最高优先级
686
+ id: wallet.id,
655
687
  iconImg: icon,
656
688
  symbol: symbol,
657
689
  cardNo: code,
658
690
  walletName: getLocalizedName(name, dvaStore === null || dvaStore === void 0 || (_dvaStore$core = dvaStore.core) === null || _dvaStore$core === void 0 ? void 0 : _dvaStore$core.translateLocale),
659
691
  shopName: shopName,
660
- codeType: barcodetype,
661
- items: cardItems,
692
+ // codeType: barcodetype,
693
+ items: cardItems.slice(0, 4),
662
694
  customBackgroundImage: coverImage,
663
695
  isLogin: isUserLoggedIn // 添加登录状态
664
696
  });
@@ -10,6 +10,10 @@ export declare const getWalletList: () => Promise<WalletPass[]>;
10
10
  * @returns
11
11
  */
12
12
  export declare const getWalletBalance: () => Promise<WalletBalance | null>;
13
+ /**
14
+ * 批量获取钱包余额信息
15
+ */
16
+ export declare const batchGetWalletBalance: (walletIds: string[]) => Promise<Record<string, WalletBalance> | null>;
13
17
  /**
14
18
  * @title: 获取钱包店铺列表
15
19
  * @description:
@@ -69,39 +69,72 @@ export var getWalletBalance = /*#__PURE__*/function () {
69
69
  }();
70
70
 
71
71
  /**
72
- * @title: 获取钱包店铺列表
73
- * @description:
74
- * @return {*}
75
- * @Author: WangHan
76
- * @Date: 2025-06-09 11:12
72
+ * 批量获取钱包余额信息
77
73
  */
78
- export var getWalletShopList = /*#__PURE__*/function () {
79
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
74
+ export var batchGetWalletBalance = /*#__PURE__*/function () {
75
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(walletIds) {
80
76
  var _yield$request$getReq3, data;
81
77
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
82
78
  while (1) switch (_context3.prev = _context3.next) {
83
79
  case 0:
84
80
  _context3.prev = 0;
85
81
  _context3.next = 3;
86
- return request.getRequest().get('/h5/wallet/shop/list', params || {}, {
87
- // abort: true,
88
- useCache: true
82
+ return request.getRequest().get('/h5/wallet/wallet-pass/balance/batch', {
83
+ wallet_id: walletIds
89
84
  });
90
85
  case 3:
91
86
  _yield$request$getReq3 = _context3.sent;
92
87
  data = _yield$request$getReq3.data;
93
- return _context3.abrupt("return", data || null);
88
+ return _context3.abrupt("return", data || {});
94
89
  case 8:
95
90
  _context3.prev = 8;
96
91
  _context3.t0 = _context3["catch"](0);
97
- return _context3.abrupt("return", null);
92
+ return _context3.abrupt("return", {});
98
93
  case 11:
99
94
  case "end":
100
95
  return _context3.stop();
101
96
  }
102
97
  }, _callee3, null, [[0, 8]]);
103
98
  }));
104
- return function getWalletShopList(_x) {
99
+ return function batchGetWalletBalance(_x) {
105
100
  return _ref3.apply(this, arguments);
106
101
  };
102
+ }();
103
+
104
+ /**
105
+ * @title: 获取钱包店铺列表
106
+ * @description:
107
+ * @return {*}
108
+ * @Author: WangHan
109
+ * @Date: 2025-06-09 11:12
110
+ */
111
+ export var getWalletShopList = /*#__PURE__*/function () {
112
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
113
+ var _yield$request$getReq4, data;
114
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
115
+ while (1) switch (_context4.prev = _context4.next) {
116
+ case 0:
117
+ _context4.prev = 0;
118
+ _context4.next = 3;
119
+ return request.getRequest().get('/h5/wallet/shop/list', params || {}, {
120
+ // abort: true,
121
+ useCache: true
122
+ });
123
+ case 3:
124
+ _yield$request$getReq4 = _context4.sent;
125
+ data = _yield$request$getReq4.data;
126
+ return _context4.abrupt("return", data || null);
127
+ case 8:
128
+ _context4.prev = 8;
129
+ _context4.t0 = _context4["catch"](0);
130
+ return _context4.abrupt("return", null);
131
+ case 11:
132
+ case "end":
133
+ return _context4.stop();
134
+ }
135
+ }, _callee4, null, [[0, 8]]);
136
+ }));
137
+ return function getWalletShopList(_x2) {
138
+ return _ref4.apply(this, arguments);
139
+ };
107
140
  }();
@@ -6,14 +6,18 @@ export interface MultiLanguageName {
6
6
  en: string;
7
7
  [key: string]: string;
8
8
  }
9
+ declare type WalletPassType = 'rechargeable' | 'point' | 'voucher' | 'discount';
9
10
  export interface WalletMetadata {
10
11
  name: MultiLanguageName;
11
12
  welcomeText?: string | MultiLanguageName;
12
13
  customerName?: string;
13
14
  coverImage?: string;
14
15
  icon?: string;
15
- barcodetype: 'barCode' | 'orCode';
16
- showcaseWalletPass?: ('rechargeable' | 'piont' | 'voucher' | 'discount')[];
16
+ showcaseWalletPassNew?: Array<{
17
+ type: WalletPassType;
18
+ custom_title?: string | MultiLanguageName;
19
+ display?: 0 | 1;
20
+ }>;
17
21
  }
18
22
  export interface Shop {
19
23
  id: number;
@@ -56,15 +60,10 @@ export interface WalletBalance {
56
60
  voucher_count: number;
57
61
  discount_card_count: number;
58
62
  }
59
- export interface WalletBalanceItem {
60
- key: string;
61
- label: string;
62
- value: number;
63
- }
64
63
  export interface WalletCardItem {
65
- key: string;
66
- label: string;
67
- hidden: boolean;
64
+ type: WalletPassType;
65
+ custom_title?: string | MultiLanguageName;
66
+ display: 0 | 1;
68
67
  value?: number;
69
68
  }
70
69
  export interface State {
@@ -106,7 +105,7 @@ export interface WalletListProps {
106
105
  platform?: 'pc' | 'h5' | 'ipad';
107
106
  mode?: 'dark' | 'light';
108
107
  cardStyle?: 'normal' | 'full';
109
- codeType?: 'barCode' | 'orCode';
108
+ codeType?: 'barCode' | 'qrCode';
110
109
  codeDirection?: 'bottom' | 'top';
111
110
  shopName?: boolean;
112
111
  showWalletName?: boolean;
@@ -131,7 +130,7 @@ export interface WalletCardProps {
131
130
  platform?: 'pc' | 'h5' | 'ipad';
132
131
  mode?: 'dark' | 'light';
133
132
  cardStyle?: 'normal' | 'full';
134
- codeType?: 'barCode' | 'orCode';
133
+ codeType?: 'barCode' | 'qrCode';
135
134
  codeDirection?: 'bottom' | 'top';
136
135
  shopName?: boolean;
137
136
  showIcon?: boolean;
@@ -192,3 +191,4 @@ export interface CarouselSettings {
192
191
  };
193
192
  }>;
194
193
  }
194
+ export {};
@@ -1,5 +1,7 @@
1
1
  // 多语言名称接口
2
2
 
3
+ //rechargeable:充值卡 point:积分卡 voucher:优惠券 discountCard:折扣卡
4
+
3
5
  // 钱包元数据接口
4
6
 
5
7
  // 商店接口
@@ -10,8 +12,6 @@
10
12
 
11
13
  // 钱包余额接口
12
14
 
13
- // 钱包余额项接口
14
-
15
15
  // 卡片项接口
16
16
 
17
17
  // 应用状态接口
package/es/index.d.ts CHANGED
@@ -22,7 +22,6 @@ export { default as TaxSelect } from './components/taxSelect';
22
22
  export { default as EftposPay } from './components/eftposPay';
23
23
  export { default as ToCPay } from './components/pay/toC';
24
24
  export { default as Eftpos } from './components/eftpos';
25
- export { default as Wallet } from './components/wallet';
26
25
  export { default as WalletList } from './components/walletList';
27
26
  export { default as BookingDashboard } from './components/booking/dashboard';
28
27
  export { default as PisellSelectCustomerModal } from './components/pisellSelectCustomerModal';
@@ -48,6 +47,8 @@ export { default as StepController } from './components/stepController';
48
47
  export { default as SaasLogin } from './plus/saasLogin';
49
48
  export { default as SaasRegister } from './plus/saasRegister';
50
49
  export { default as SaasCreateOrganization } from './plus/saasCreateOrganization';
50
+ export { default as WalletEditor } from './plus/walletEditor';
51
+ export { default as WalletPassGallery } from './plus/walletPassGallery';
51
52
  export { default as PinModal } from './components/pinModal';
52
53
  export { default as PinVerifyModal } from './components/pinVerifyModal';
53
54
  export { default as ContactInfo } from './plus/contactInfo';
package/es/index.js CHANGED
@@ -26,7 +26,6 @@ export { default as TaxSelect } from "./components/taxSelect";
26
26
  export { default as EftposPay } from "./components/eftposPay";
27
27
  export { default as ToCPay } from "./components/pay/toC";
28
28
  export { default as Eftpos } from "./components/eftpos";
29
- export { default as Wallet } from "./components/wallet";
30
29
  export { default as WalletList } from "./components/walletList";
31
30
  export { default as BookingDashboard } from "./components/booking/dashboard";
32
31
  export { default as PisellSelectCustomerModal } from "./components/pisellSelectCustomerModal";
@@ -52,6 +51,8 @@ export { default as StepController } from "./components/stepController";
52
51
  export { default as SaasLogin } from "./plus/saasLogin";
53
52
  export { default as SaasRegister } from "./plus/saasRegister";
54
53
  export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
54
+ export { default as WalletEditor } from "./plus/walletEditor";
55
+ export { default as WalletPassGallery } from "./plus/walletPassGallery";
55
56
  export { default as PinModal } from "./components/pinModal";
56
57
  export { default as PinVerifyModal } from "./components/pinVerifyModal";
57
58
  export { default as ContactInfo } from "./plus/contactInfo";
@@ -7,11 +7,13 @@ declare type TabItem = {
7
7
  icon?: React.ReactNode;
8
8
  };
9
9
  interface IProps {
10
+ className?: string;
10
11
  items: TabItem[];
11
12
  activeKey: string;
12
13
  onChange: (key: string) => void;
13
14
  loading?: boolean;
14
15
  skeleton?: React.ReactNode;
16
+ style?: React.CSSProperties;
15
17
  }
16
18
  declare const CategoryTabs: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
17
19
  export default CategoryTabs;
@@ -11,12 +11,14 @@ import "../components/TabsStructure/TabsStructure.less";
11
11
  import CategorySkeleton from "./CategorySkeleton";
12
12
  import { PREFIX } from "../index";
13
13
  var CategoryTabs = /*#__PURE__*/forwardRef(function (props, ref) {
14
- var items = props.items,
14
+ var className = props.className,
15
+ items = props.items,
15
16
  activeKey = props.activeKey,
16
17
  onChange = props.onChange,
17
18
  _props$loading = props.loading,
18
19
  loading = _props$loading === void 0 ? false : _props$loading,
19
- skeleton = props.skeleton;
20
+ skeleton = props.skeleton,
21
+ style = props.style;
20
22
  var railRef = useRef(null);
21
23
 
22
24
  // 使用IntersectionTrigger来优雅地控制滚动状态
@@ -102,7 +104,8 @@ var CategoryTabs = /*#__PURE__*/forwardRef(function (props, ref) {
102
104
  return /*#__PURE__*/React.createElement(React.Fragment, null, skeleton);
103
105
  }
104
106
  return /*#__PURE__*/React.createElement(IntersectionObserverProvider, null, items.length > 0 && /*#__PURE__*/React.createElement("div", {
105
- className: "".concat(PREFIX, "__tabs-wrapper")
107
+ className: "".concat(PREFIX, "__tabs-wrapper ").concat(className || ''),
108
+ style: style
106
109
  }, /*#__PURE__*/React.createElement(TabsStructure, {
107
110
  variant: "pill",
108
111
  backgroundVariant: "onPage",
@@ -129,17 +129,6 @@
129
129
  border-radius: calc(20px - 2px);
130
130
  }
131
131
 
132
- &::after {
133
- content: '';
134
- position: absolute;
135
- inset-block-start: 1px;
136
- inset-inline-start: 1px;
137
- inset-inline-end: 1px;
138
- block-size: 50%;
139
- background-color: var(--ps-color-primary, #7f56d9);
140
- border-radius: 20px 20px 0 0;
141
- }
142
-
143
132
  &--focused {
144
133
  .pisell-tabstruct-focus-ring();
145
134
  }
@@ -101,7 +101,6 @@ export function groupProductsByCategory(products) {
101
101
  });
102
102
  result.push.apply(result, _toConsumableArray(sortedUncategorizedProducts));
103
103
  }
104
- console.log('xxxxxx', result);
105
104
  return result;
106
105
  }
107
106
 
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { WalletEditorProps, WalletEditorRef } from './types';
3
+ import './WalletEditor.less';
4
+ declare const WalletEditor: React.ForwardRefExoticComponent<WalletEditorProps & React.RefAttributes<WalletEditorRef>>;
5
+ export default WalletEditor;