@pisell/private-materials 6.2.49 → 6.2.51

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 (136) 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 +2 -2
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +27 -3
  12. package/es/components/appointmentBooking/components/Content/index.js +3 -3
  13. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  14. package/es/components/appointmentBooking/components/Voucher/index.js +6 -5
  15. package/es/components/appointmentBooking/hooks.js +10 -2
  16. package/es/components/appointmentBooking/index.js +10 -0
  17. package/es/components/booking/components/footer/index.js +12 -1
  18. package/es/components/booking/editBookingModal/index.js +8 -2
  19. package/es/components/booking/locales.d.ts +6 -0
  20. package/es/components/booking/locales.js +12 -0
  21. package/es/components/eftposPay/hooks.d.ts +1 -1
  22. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  23. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +60 -17
  24. package/es/components/eftposPay/payo/config.js +10 -10
  25. package/es/components/eftposPay/store/index.d.ts +1 -1
  26. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +34 -8
  27. package/es/components/index.d.ts +3 -1
  28. package/es/components/index.js +3 -1
  29. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  30. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  31. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  32. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  33. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  34. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  35. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  36. package/es/components/pay/toC/utils.js +1 -1
  37. package/es/components/pinModal/hooks.d.ts +7 -0
  38. package/es/components/pinModal/hooks.js +65 -0
  39. package/es/components/pinModal/index.d.ts +4 -0
  40. package/es/components/pinModal/index.js +98 -0
  41. package/es/components/pinModal/index.less +44 -0
  42. package/es/components/pinModal/locales.d.ts +27 -0
  43. package/es/components/pinModal/locales.js +26 -0
  44. package/es/components/pinModal/serve.d.ts +6 -0
  45. package/es/components/pinModal/serve.js +11 -0
  46. package/es/components/pinModal/types.d.ts +0 -0
  47. package/es/components/pinModal/types.js +0 -0
  48. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  49. package/es/components/pinVerifyModal/hooks.js +80 -0
  50. package/es/components/pinVerifyModal/index.d.ts +5 -0
  51. package/es/components/pinVerifyModal/index.js +218 -0
  52. package/es/components/pinVerifyModal/index.less +92 -0
  53. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  54. package/es/components/pinVerifyModal/locales.js +23 -0
  55. package/es/components/pinVerifyModal/types.d.ts +33 -0
  56. package/es/components/pinVerifyModal/types.js +1 -0
  57. package/es/components/ticketBooking/components/ticketBooking/index.js +58 -10
  58. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  59. package/es/components/wallet/Detail/index.js +251 -63
  60. package/es/components/wallet/Detail/locales.d.ts +51 -0
  61. package/es/components/wallet/Detail/locales.js +57 -3
  62. package/es/components/wallet/Detail/serve.js +5 -1
  63. package/es/components/wallet/components/UsageRules/index.d.ts +23 -0
  64. package/es/components/wallet/components/UsageRules/index.js +147 -0
  65. package/es/components/wallet/components/UsageRules/index.less +157 -0
  66. package/es/components/wallet/components/WalletCard.js +8 -3
  67. package/es/components/wallet/components/index.d.ts +1 -0
  68. package/es/components/wallet/components/index.js +2 -1
  69. package/es/components/walletList/index.js +20 -2
  70. package/es/index.d.ts +2 -0
  71. package/es/index.js +3 -1
  72. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +22 -2
  73. package/lib/components/appointmentBooking/components/Content/index.js +2 -2
  74. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  75. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  76. package/lib/components/appointmentBooking/hooks.js +10 -2
  77. package/lib/components/appointmentBooking/index.js +6 -0
  78. package/lib/components/booking/components/footer/index.js +15 -2
  79. package/lib/components/booking/components/voucher/index.js +1 -3
  80. package/lib/components/booking/editBookingModal/index.js +6 -1
  81. package/lib/components/booking/locales.d.ts +6 -0
  82. package/lib/components/booking/locales.js +6 -0
  83. package/lib/components/eftposPay/hooks.d.ts +1 -1
  84. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  85. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +59 -15
  86. package/lib/components/eftposPay/payo/config.js +9 -9
  87. package/lib/components/eftposPay/store/index.d.ts +1 -1
  88. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +30 -8
  89. package/lib/components/index.d.ts +3 -1
  90. package/lib/components/index.js +6 -0
  91. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  92. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  93. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  94. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  95. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  96. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  97. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  98. package/lib/components/pay/toC/utils.js +1 -1
  99. package/lib/components/pinModal/hooks.d.ts +7 -0
  100. package/lib/components/pinModal/hooks.js +85 -0
  101. package/lib/components/pinModal/index.d.ts +4 -0
  102. package/lib/components/pinModal/index.js +88 -0
  103. package/lib/components/pinModal/index.less +44 -0
  104. package/lib/components/pinModal/locales.d.ts +27 -0
  105. package/lib/components/pinModal/locales.js +50 -0
  106. package/lib/components/pinModal/serve.d.ts +6 -0
  107. package/lib/components/pinModal/serve.js +37 -0
  108. package/lib/components/pinModal/types.d.ts +0 -0
  109. package/lib/components/pinModal/types.js +0 -0
  110. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  111. package/lib/components/pinVerifyModal/hooks.js +93 -0
  112. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  113. package/lib/components/pinVerifyModal/index.js +230 -0
  114. package/lib/components/pinVerifyModal/index.less +92 -0
  115. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  116. package/lib/components/pinVerifyModal/locales.js +47 -0
  117. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  118. package/lib/components/pinVerifyModal/types.js +17 -0
  119. package/lib/components/ticketBooking/components/ticketBooking/index.js +50 -6
  120. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  121. package/lib/components/wallet/Detail/index.js +140 -8
  122. package/lib/components/wallet/Detail/locales.d.ts +51 -0
  123. package/lib/components/wallet/Detail/locales.js +57 -3
  124. package/lib/components/wallet/Detail/serve.js +6 -1
  125. package/lib/components/wallet/components/UsageRules/index.d.ts +23 -0
  126. package/lib/components/wallet/components/UsageRules/index.js +113 -0
  127. package/lib/components/wallet/components/UsageRules/index.less +157 -0
  128. package/lib/components/wallet/components/WalletCard.js +3 -1
  129. package/lib/components/wallet/components/index.d.ts +1 -0
  130. package/lib/components/wallet/components/index.js +3 -0
  131. package/lib/components/walletList/index.js +19 -2
  132. package/lib/index.d.ts +2 -0
  133. package/lib/index.js +6 -0
  134. package/lowcode/pin-modal/meta.ts +37 -0
  135. package/lowcode/pin-verify-modal/meta.ts +80 -0
  136. package/package.json +3 -3
@@ -0,0 +1,147 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import React from 'react';
8
+ import { Typography } from '@pisell/materials';
9
+ import "./index.less";
10
+ var Text = Typography.Text;
11
+ function UsageRules(_ref) {
12
+ var _ref$className = _ref.className,
13
+ className = _ref$className === void 0 ? '' : _ref$className,
14
+ style = _ref.style,
15
+ rules = _ref.rules,
16
+ _ref$personalLimit = _ref.personalLimit,
17
+ personalLimit = _ref$personalLimit === void 0 ? {
18
+ total: 5,
19
+ remaining: 3,
20
+ note: '用完后此券将自动失效'
21
+ } : _ref$personalLimit,
22
+ locales = _ref.locales;
23
+ // Helper function to interpolate text with variables
24
+ var interpolateText = function interpolateText(text, variables) {
25
+ return text.replace(/\{(\w+)\}/g, function (match, key) {
26
+ return variables[key] !== undefined ? variables[key] : match;
27
+ });
28
+ };
29
+
30
+ // Get localized text with fallback
31
+ var getText = function getText(key, fallback) {
32
+ return (locales === null || locales === void 0 ? void 0 : locales.getText(key)) || fallback || key;
33
+ };
34
+
35
+ // Generate rule description with limit value
36
+ var getRuleDescription = function getRuleDescription(type, limit) {
37
+ // Handle unlimited case (limit = 0 means unlimited)
38
+ if (limit === 0 && type === 'monthly') {
39
+ return getText('page.wallet.monthlyLimitUnlimited', '无限制');
40
+ }
41
+ var templateKey = "page.wallet.".concat(type, "LimitDesc");
42
+ var template = getText(templateKey, '');
43
+ return interpolateText(template, {
44
+ limit: limit
45
+ });
46
+ };
47
+
48
+ // Generate rule reset time text
49
+ var getRuleResetTime = function getRuleResetTime(type) {
50
+ var resetKey = "page.wallet.".concat(type, "Reset");
51
+ return getText(resetKey, '');
52
+ };
53
+
54
+ // Default rules with localized text
55
+ var defaultRules = [{
56
+ type: 'daily',
57
+ limit: 3,
58
+ description: getRuleDescription('daily', 3),
59
+ resetTime: getRuleResetTime('daily')
60
+ }, {
61
+ type: 'weekly',
62
+ limit: 15,
63
+ description: getRuleDescription('weekly', 15),
64
+ resetTime: getRuleResetTime('weekly')
65
+ }, {
66
+ type: 'monthly',
67
+ limit: 60,
68
+ description: getRuleDescription('monthly', 60),
69
+ resetTime: getRuleResetTime('monthly')
70
+ }];
71
+
72
+ // Process rules to add localized descriptions
73
+ var processedRules = rules ? rules.map(function (rule) {
74
+ return _objectSpread(_objectSpread({}, rule), {}, {
75
+ description: getRuleDescription(rule.type, rule.limit),
76
+ resetTime: getRuleResetTime(rule.type)
77
+ });
78
+ }) : defaultRules;
79
+ var finalRules = processedRules;
80
+ var getRuleLabel = function getRuleLabel(type) {
81
+ switch (type) {
82
+ case 'daily':
83
+ return getText('page.wallet.dailyLimit', '每日限制:');
84
+ case 'weekly':
85
+ return getText('page.wallet.weeklyLimit', '每周限制:');
86
+ case 'monthly':
87
+ return getText('page.wallet.monthlyLimit', '每月限制:');
88
+ default:
89
+ return getText('page.wallet.dailyLimit', '限制:');
90
+ }
91
+ };
92
+ return /*#__PURE__*/React.createElement("div", {
93
+ className: "usage-rules ".concat(className),
94
+ style: style
95
+ }, /*#__PURE__*/React.createElement(Text, {
96
+ className: "usage-rules-title"
97
+ }, getText('page.wallet.usageRules', '使用规则')), /*#__PURE__*/React.createElement(Text, {
98
+ className: "usage-rules-subtitle"
99
+ }, getText('page.wallet.usageRulesSubtitle', '请仔细阅读以下使用条件')), /*#__PURE__*/React.createElement("div", {
100
+ className: "usage-rules-section"
101
+ }, /*#__PURE__*/React.createElement(Text, {
102
+ className: "usage-rules-section-title"
103
+ }, getText('page.wallet.timeUsageLimits', '时间使用限制')), /*#__PURE__*/React.createElement("div", {
104
+ className: "usage-rules-list"
105
+ }, finalRules.length > 0 ? finalRules.map(function (rule, index) {
106
+ return /*#__PURE__*/React.createElement("div", {
107
+ key: index,
108
+ className: "usage-rules-item"
109
+ }, /*#__PURE__*/React.createElement("div", {
110
+ className: "usage-rules-item-content"
111
+ }, /*#__PURE__*/React.createElement("div", {
112
+ className: "usage-rules-item-main-line"
113
+ }, /*#__PURE__*/React.createElement(Text, {
114
+ className: "usage-rules-item-label"
115
+ }, getRuleLabel(rule.type)), /*#__PURE__*/React.createElement(Text, {
116
+ className: "usage-rules-item-description"
117
+ }, rule.description)), rule.resetTime && /*#__PURE__*/React.createElement(Text, {
118
+ className: "usage-rules-item-reset"
119
+ }, rule.resetTime)));
120
+ }) : /*#__PURE__*/React.createElement("div", {
121
+ className: "usage-rules-item"
122
+ }, /*#__PURE__*/React.createElement("div", {
123
+ className: "usage-rules-item-content"
124
+ }, /*#__PURE__*/React.createElement(Text, {
125
+ className: "usage-rules-item-description"
126
+ }, getText('page.wallet.monthlyLimitUnlimited', '无限制')))))), /*#__PURE__*/React.createElement("div", {
127
+ className: "usage-rules-section"
128
+ }, /*#__PURE__*/React.createElement(Text, {
129
+ className: "usage-rules-section-title"
130
+ }, getText('page.wallet.totalQuantityControl', '总量控制')), /*#__PURE__*/React.createElement("div", {
131
+ className: "usage-rules-item"
132
+ }, /*#__PURE__*/React.createElement("div", {
133
+ className: "usage-rules-item-content"
134
+ }, personalLimit.total > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
135
+ className: "usage-rules-item-label"
136
+ }, getText('page.wallet.personalLimit', '个人限额:')), /*#__PURE__*/React.createElement(Text, {
137
+ className: "usage-rules-item-description"
138
+ }, interpolateText(getText('page.wallet.personalLimitDesc', '您最多可使用此券{total}次(剩余{remaining}次)'), {
139
+ total: personalLimit.total,
140
+ remaining: personalLimit.remaining
141
+ })), /*#__PURE__*/React.createElement(Text, {
142
+ className: "usage-rules-item-note"
143
+ }, getText('page.wallet.voucherExpireNote', '用完后此券将自动失效'))) : /*#__PURE__*/React.createElement(Text, {
144
+ className: "usage-rules-item-description"
145
+ }, getText('page.wallet.monthlyLimitUnlimited', '无限制'))))));
146
+ }
147
+ export default UsageRules;
@@ -0,0 +1,157 @@
1
+ .usage-rules {
2
+ padding: 16px;
3
+ background: #ffffff;
4
+ border-radius: 8px;
5
+ border: 1px solid #f0f0f0;
6
+ margin-top: 16px;
7
+ margin-bottom: 20px;
8
+
9
+ // 确保所有Text组件都是块级元素
10
+ .ant-typography {
11
+ display: block !important;
12
+ width: 100% !important;
13
+ margin-bottom: 0 !important;
14
+ }
15
+
16
+ &-title {
17
+ font-size: 18px;
18
+ font-weight: 600;
19
+ color: #000000;
20
+ line-height: 24px;
21
+ margin-bottom: 8px;
22
+ display: block;
23
+ width: 100%;
24
+ }
25
+
26
+ &-subtitle {
27
+ font-size: 14px;
28
+ color: #6B7280;
29
+ line-height: 20px;
30
+ margin-bottom: 24px;
31
+ display: block;
32
+ width: 100%;
33
+ }
34
+
35
+ &-section {
36
+ margin-bottom: 24px;
37
+
38
+ &:last-child {
39
+ margin-bottom: 0;
40
+ }
41
+
42
+ &-title {
43
+ font-size: 16px;
44
+ font-weight: 500;
45
+ color: #6B7280;
46
+ line-height: 20px;
47
+ margin-bottom: 16px;
48
+ display: block;
49
+ width: 100%;
50
+ }
51
+ }
52
+
53
+ &-list {
54
+ display: flex;
55
+ flex-direction: column;
56
+ gap: 16px;
57
+ }
58
+
59
+ &-item {
60
+ position: relative;
61
+ display: flex;
62
+ align-items: flex-start;
63
+
64
+ &::before {
65
+ content: '•';
66
+ color: #697281;
67
+ font-size: 16px;
68
+ line-height: 20px;
69
+ font-weight: bold;
70
+ margin-right: 8px;
71
+ flex-shrink: 0;
72
+ margin-top: 0;
73
+ }
74
+
75
+ &-content {
76
+ flex: 1;
77
+ min-width: 0;
78
+ }
79
+
80
+ &-main-line {
81
+ margin-bottom: 4px;
82
+ }
83
+
84
+ &-label {
85
+ font-size: 14px;
86
+ font-weight: 600;
87
+ color: #000000;
88
+ line-height: 20px;
89
+ display: inline;
90
+ margin-right: 4px;
91
+ }
92
+
93
+ &-description {
94
+ font-size: 14px;
95
+ color: #000000;
96
+ line-height: 20px;
97
+ display: inline;
98
+ word-wrap: break-word;
99
+ }
100
+
101
+ &-reset {
102
+ font-size: 14px;
103
+ color: #000000;
104
+ line-height: 20px;
105
+ display: block;
106
+ width: 100%;
107
+ }
108
+
109
+ &-note {
110
+ font-size: 14px;
111
+ color: #000000;
112
+ line-height: 20px;
113
+ margin-top: 4px;
114
+ display: block;
115
+ width: 100%;
116
+ }
117
+ }
118
+
119
+ }
120
+
121
+ // 响应式设计
122
+ @media (max-width: 768px) {
123
+ .usage-rules {
124
+ padding: 12px;
125
+ margin-top: 12px;
126
+
127
+ &-title {
128
+ font-size: 16px;
129
+ }
130
+
131
+ &-subtitle {
132
+ font-size: 13px;
133
+ }
134
+
135
+ &-section {
136
+ margin-bottom: 20px;
137
+
138
+ &-title {
139
+ font-size: 15px;
140
+ }
141
+ }
142
+
143
+ &-item {
144
+ &::before {
145
+ font-size: 14px;
146
+ margin-right: 6px;
147
+ }
148
+
149
+ &-label,
150
+ &-description,
151
+ &-reset,
152
+ &-note {
153
+ font-size: 13px;
154
+ }
155
+ }
156
+ }
157
+ }
@@ -1,3 +1,7 @@
1
+ var _excluded = ["id", "tag", "product_title", "balance", "code", "encoded", "expire_date", "shop", "limit_status", "product_cover", "par_value", "unified_messages"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
1
5
  import React, { useMemo } from 'react';
2
6
  import { PisellWalletPassCard } from '@pisell/materials';
3
7
  import { isMobile } from '@pisell/utils';
@@ -35,7 +39,8 @@ var WalletCard = function WalletCard(_ref) {
35
39
  _item$par_value = item.par_value,
36
40
  par_value = _item$par_value === void 0 ? '' : _item$par_value,
37
41
  _item$unified_message = item.unified_messages,
38
- unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message;
42
+ unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message,
43
+ rest = _objectWithoutProperties(item, _excluded);
39
44
 
40
45
  // 获取平台
41
46
  var platform = useMemo(function () {
@@ -52,7 +57,7 @@ var WalletCard = function WalletCard(_ref) {
52
57
  var isActive = id === currentId && platform === 'pc';
53
58
  // 是否禁用
54
59
  var isDisabled = limit_status !== 'enable';
55
- return /*#__PURE__*/React.createElement(PisellWalletPassCard, {
60
+ return /*#__PURE__*/React.createElement(PisellWalletPassCard, _extends({}, rest, {
56
61
  balanceTitle: balanceTitle,
57
62
  showDetail: false,
58
63
  showRedeem: false,
@@ -77,6 +82,6 @@ var WalletCard = function WalletCard(_ref) {
77
82
  code: encoded,
78
83
  validDate: expire_date,
79
84
  onClick: onClick
80
- });
85
+ }));
81
86
  };
82
87
  export default /*#__PURE__*/React.memo(WalletCard);
@@ -1,2 +1,3 @@
1
1
  export { default as WalletBar } from './WalletBar';
2
2
  export { default as FooterButtons } from './FooterButtons';
3
+ export { default as UsageRules } from './UsageRules';
@@ -1,3 +1,4 @@
1
1
  // 导出所有公共组件
2
2
  export { default as WalletBar } from "./WalletBar";
3
- export { default as FooterButtons } from "./FooterButtons";
3
+ export { default as FooterButtons } from "./FooterButtons";
4
+ export { default as UsageRules } from "./UsageRules";
@@ -30,6 +30,7 @@ import "./index.less";
30
30
  import classNames from 'classnames';
31
31
  // 导入所有类型
32
32
  import { WalletCardItem, DEFAULT_CARD_CONFIG } from "./types";
33
+ import PinModal from "../pinModal";
33
34
 
34
35
  // 添加 localStorage 相关的操作函数
35
36
  var STORAGE_KEY = 'pisell_wallet_list_data';
@@ -176,6 +177,9 @@ var WalletList = Provider(function (props) {
176
177
  var requestIdRef = useRef('');
177
178
  var pubsub = utils === null || utils === void 0 ? void 0 : utils.pubsub;
178
179
 
180
+ // pinModal的ref
181
+ var pinModalRef = useRef(null);
182
+
179
183
  //获取登录状态
180
184
  var isUserLoggedIn = useMemo(function () {
181
185
  var _utils$token, _utils$token$get;
@@ -586,6 +590,14 @@ var WalletList = Provider(function (props) {
586
590
  return _ref3.apply(this, arguments);
587
591
  };
588
592
  }();
593
+ var _onViewPinClick = function onViewPinClick(card) {
594
+ if (card !== null && card !== void 0 && card.id) {
595
+ var _pinModalRef$current;
596
+ (_pinModalRef$current = pinModalRef.current) === null || _pinModalRef$current === void 0 || _pinModalRef$current.open(card === null || card === void 0 ? void 0 : card.id);
597
+ } else {
598
+ console.error('onViewPinClick方法需要传入wallet_detail_id');
599
+ }
600
+ };
589
601
  var renderWalletCard = function renderWalletCard(item) {
590
602
  var _dvaStore$core;
591
603
  var code = item.code,
@@ -652,7 +664,11 @@ var WalletList = Provider(function (props) {
652
664
  });
653
665
  return /*#__PURE__*/React.createElement(WalletCard, _extends({
654
666
  key: id
655
- }, cardProps));
667
+ }, cardProps, {
668
+ onViewPinClick: function onViewPinClick() {
669
+ return _onViewPinClick(item);
670
+ }
671
+ }));
656
672
  };
657
673
  var carouselProps = {
658
674
  className: classNames('pisell-lowcode__walletList'),
@@ -811,7 +827,9 @@ var WalletList = Provider(function (props) {
811
827
  fontSize: '24px',
812
828
  color: currentIndex === list.length - 1 ? '#D0D5DD' : '#101828'
813
829
  }
814
- }))));
830
+ }))), /*#__PURE__*/React.createElement(PinModal, {
831
+ ref: pinModalRef
832
+ }));
815
833
  };
816
834
 
817
835
  // 最终返回组件内容
package/es/index.d.ts CHANGED
@@ -52,3 +52,5 @@ export { default as NoteModal } from './plus/noteModal';
52
52
  export { default as SaasLogin } from './plus/saasLogin';
53
53
  export { default as SaasRegister } from './plus/saasRegister';
54
54
  export { default as SaasCreateOrganization } from './plus/saasCreateOrganization';
55
+ export { default as PinModal } from './components/pinModal';
56
+ export { default as PinVerifyModal } from './components/pinVerifyModal';
package/es/index.js CHANGED
@@ -55,4 +55,6 @@ export { default as ComprehensiveSearch } from "./pro/comprehensiveSearch";
55
55
  export { default as NoteModal } from "./plus/noteModal";
56
56
  export { default as SaasLogin } from "./plus/saasLogin";
57
57
  export { default as SaasRegister } from "./plus/saasRegister";
58
- export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
58
+ export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
59
+ export { default as PinModal } from "./components/pinModal";
60
+ export { default as PinVerifyModal } from "./components/pinVerifyModal";
@@ -43,9 +43,11 @@ var import_utils3 = require("./utils");
43
43
  var import_index = require("./index.less");
44
44
  var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
45
45
  var _a, _b;
46
+ const hasSubscribedRef = (0, import_react.useRef)(false);
46
47
  const context = (0, import_useEngineContext.default)();
47
48
  const config = ((_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.config) || {};
48
49
  const utils = (0, import_hooks.contextUtils)();
50
+ const { pubsub } = context.appHelper.utils;
49
51
  const { appointmentBooking, summary, isAgreeDepositPolicy, setLoading } = (0, import_context.useAppointmentBookingContext)();
50
52
  const { isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
51
53
  const goPaymentFinish = (order_id, amount) => {
@@ -141,10 +143,28 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
141
143
  }, 50);
142
144
  }
143
145
  };
146
+ const handleSubmit = () => {
147
+ var _a2, _b2, _c, _d;
148
+ if ((_b2 = (_a2 = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _a2.isGuestUser) == null ? void 0 : _b2.call(_a2)) {
149
+ if (!hasSubscribedRef.current) {
150
+ pubsub.subscribe("bind.guest.user", handleNext);
151
+ hasSubscribedRef.current = true;
152
+ }
153
+ (_d = (_c = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _c.openRegisterModal) == null ? void 0 : _d.call(_c, true);
154
+ return;
155
+ }
156
+ handleNext();
157
+ };
158
+ (0, import_react.useEffect)(() => {
159
+ return () => {
160
+ pubsub.unsubscribe("bind.guest.user", handleNext);
161
+ hasSubscribedRef.current = false;
162
+ };
163
+ }, []);
144
164
  (0, import_react.useImperativeHandle)(ref, () => ({
145
- next: handleNext
165
+ next: handleSubmit
146
166
  }));
147
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleNext }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
167
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleSubmit }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
148
168
  "img",
149
169
  {
150
170
  src: `${config == null ? void 0 : config.awsStatic}/checkout_confirm.png`,
@@ -84,7 +84,7 @@ var Layout = () => {
84
84
  const context = (0, import_useEngineContext.default)();
85
85
  const { pubsub } = context.appHelper.utils;
86
86
  (0, import_react.useEffect)(() => {
87
- const handleLoginSuccess = async () => {
87
+ const handleLoginSuccess = async (res) => {
88
88
  var _a2;
89
89
  if (!isFormSubject) {
90
90
  const user = JSON.parse(((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("customer")) || "{}");
@@ -100,7 +100,7 @@ var Layout = () => {
100
100
  };
101
101
  pubsub.subscribe("pisell1.login.success", handleLoginSuccess);
102
102
  return () => {
103
- pubsub.unsubscribe("pisell1.login.success");
103
+ pubsub.unsubscribe("pisell1.login.success", handleLoginSuccess);
104
104
  };
105
105
  }, []);
106
106
  (0, import_react.useEffect)(() => {
@@ -95,20 +95,27 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
95
95
  delete product.option;
96
96
  if (isRetailTemplate) {
97
97
  if (data == null ? void 0 : data.isCancel) return;
98
- appointmentBooking.storeProduct(product);
98
+ const res = appointmentBooking.storeProduct(product);
99
+ if (!res.success && res.errorCode === "not_enough_stock") {
100
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
101
+ }
99
102
  return;
100
103
  }
101
104
  const session = data == null ? void 0 : data.session;
102
105
  if (session) {
103
106
  const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
104
107
  const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
105
- appointmentBooking.addProductToCart({
108
+ const res = appointmentBooking.addProductToCart({
106
109
  product: { ...product },
107
110
  date: {
108
111
  startTime: `${startDate} ${session == null ? void 0 : session.start_time}`,
109
112
  endTime: `${endDate} ${session == null ? void 0 : session.end_time}`
110
113
  }
111
114
  });
115
+ if (!res.success && res.errorCode === "not_enough_stock") {
116
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
117
+ }
118
+ appointmentBooking.closeProductDetail();
112
119
  await appointmentBooking.getAvailableDate({
113
120
  startDate,
114
121
  endDate
@@ -121,7 +128,10 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
121
128
  import_utils.locales.getText("pisell2.appointment.no.available.service")
122
129
  );
123
130
  }
124
- appointmentBooking.storeProduct(product);
131
+ const res = appointmentBooking.storeProduct(product);
132
+ if (!res.success && res.errorCode === "not_enough_stock") {
133
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
134
+ }
125
135
  if (type === "duration") {
126
136
  await appointmentBooking.getAvailableDate();
127
137
  }
@@ -133,7 +133,8 @@ var VoucherCard = (props) => {
133
133
  );
134
134
  }, []);
135
135
  const onScanCode = async () => {
136
- const val = await shopDiscount.scanCode(code);
136
+ const customerId = currentUser.id;
137
+ const val = await shopDiscount.scanCode(code, customerId);
137
138
  if (val == null ? void 0 : val.isAvailable) {
138
139
  batchUpdateCart(val.productList);
139
140
  setCode("");
@@ -189,6 +189,12 @@ var useAppointmentBookingStep = () => {
189
189
  if (!result) {
190
190
  return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.date"));
191
191
  }
192
+ const capacityResult = appointmentBooking.checkMaxDurationCapacity();
193
+ if (!capacityResult.success) {
194
+ const getMessage = import_utils.locales.getText("pisell2.appointment.unuse.capacity");
195
+ const message = typeof getMessage === "function" ? getMessage(capacityResult.minAvailableCount) : getMessage;
196
+ return (0, import_utils2.Toast)(message);
197
+ }
192
198
  }
193
199
  if (!isRetailTemplate && (currentKey == null ? void 0 : currentKey.startsWith("select-resource"))) {
194
200
  const { hasError, updatedCartList } = (0, import_utils2.checkAndMarkCartRenderError)(currentSelectedResources, appointmentBooking, utils);
@@ -266,8 +272,10 @@ var useAppointmentBookingStep = () => {
266
272
  const checkLogin = async () => {
267
273
  if (!isLogin) {
268
274
  const { pubsub } = utils;
269
- pubsub.once("pisell1.login.success", () => {
270
- checkHolder();
275
+ pubsub.once("pisell1.login.success", (res) => {
276
+ if (res === "success") {
277
+ checkHolder();
278
+ }
271
279
  });
272
280
  return openLoginModal({
273
281
  callback: (status) => {
@@ -55,6 +55,12 @@ var AppointmentBooking = () => {
55
55
  if (!data.length) {
56
56
  const currentUser = (0, import_utils2.formatCurrentUser)(utils);
57
57
  appointmentBooking.addAccounts([currentUser]);
58
+ } else if (data.length >= 1) {
59
+ const meAccount = data == null ? void 0 : data.find((d) => !(d == null ? void 0 : d.isGuest));
60
+ const currentUser = (0, import_utils2.formatCurrentUser)(utils);
61
+ if (currentUser && meAccount.id !== currentUser.id) {
62
+ appointmentBooking.setLoginAccount(meAccount.id, currentUser);
63
+ }
58
64
  }
59
65
  });
60
66
  }, []);
@@ -281,7 +281,7 @@ var Footer = (props) => {
281
281
  type,
282
282
  messageShow = true
283
283
  }) => {
284
- var _a2;
284
+ var _a2, _b2, _c2, _d2, _e2;
285
285
  if ((0, import_utils2.isDayBooking)(state)) {
286
286
  const isHasDayProducts = handleDaySubmit();
287
287
  if (isHasDayProducts) return;
@@ -306,7 +306,20 @@ var Footer = (props) => {
306
306
  title: "saveBooking",
307
307
  content: [
308
308
  { key: "下单前数据", value: JSON.stringify(values) },
309
- { key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") }
309
+ { key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") },
310
+ {
311
+ key: "店铺id",
312
+ value: (_e2 = (_d2 = (_c2 = (_b2 = store == null ? void 0 : store.getState) == null ? void 0 : _b2.call(store)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id
313
+ },
314
+ {
315
+ key: "shopApi",
316
+ value: JSON.stringify(window == null ? void 0 : window.shopApi, (key, value) => {
317
+ if (typeof value === "function") {
318
+ return "function";
319
+ }
320
+ return value;
321
+ })
322
+ }
310
323
  ]
311
324
  });
312
325
  if (addonsEdit) {
@@ -69,9 +69,7 @@ var VoucherCard = (props) => {
69
69
  const isBooking4Shop = (0, import_useIsBooking4Shop.useIsBooking4Shop)(state);
70
70
  const shopDiscount = pisellos.getModule("shopDiscount");
71
71
  services = state.service;
72
- const {
73
- selectCustomer
74
- } = (0, import_pisellos.useCustomer)();
72
+ const { selectCustomer } = (0, import_pisellos.useCustomer)();
75
73
  (0, import_ahooks.useDebounceEffect)(
76
74
  () => {
77
75
  if (isBooking4Shop) {
@@ -113,7 +113,12 @@ var EditBookingModal = (props, ref) => {
113
113
  _cloned[_idx] = _targetResource;
114
114
  }
115
115
  } else {
116
- _cloned.push(_targetResource);
116
+ const _targetIdx = _cloned.findIndex((rs) => {
117
+ return rs.relation_id == (_targetResource == null ? void 0 : _targetResource.relation_id);
118
+ });
119
+ if (_targetIdx === -1) {
120
+ _cloned.push(_targetResource);
121
+ }
117
122
  }
118
123
  _initResourceVal = {
119
124
  ..._initResourceVal,
@@ -156,6 +156,8 @@ declare const _default: {
156
156
  'pisell2.text.deposit-delete-message': string;
157
157
  'pisell2.text.deposit-paid': string;
158
158
  "pisell2.text.stock": string;
159
+ 'pisell2.appointment.unuse.stock': string;
160
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
159
161
  'pisell2.text.payment-link': string;
160
162
  'pisell2.text.send-mail': string;
161
163
  'pisell2.text.copy-to-clipboard': string;
@@ -458,6 +460,8 @@ declare const _default: {
458
460
  'pisell2.text.deposit-delete-message': string;
459
461
  'pisell2.text.deposit-paid': string;
460
462
  "pisell2.text.stock": string;
463
+ 'pisell2.appointment.unuse.stock': string;
464
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
461
465
  'pisell2.text.payment-link': string;
462
466
  'pisell2.text.send-mail': string;
463
467
  'pisell2.text.copy-to-clipboard': string;
@@ -760,6 +764,8 @@ declare const _default: {
760
764
  'pisell2.text.deposit-delete-message': string;
761
765
  'pisell2.text.deposit-paid': string;
762
766
  "pisell2.text.stock": string;
767
+ 'pisell2.appointment.unuse.stock': string;
768
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
763
769
  'pisell2.text.payment-link': string;
764
770
  'pisell2.text.send-mail': string;
765
771
  'pisell2.text.copy-to-clipboard': string;