@pisell/private-materials 3.4.54 → 3.4.56

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 (124) 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 +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/Sales/Summary/utils.d.ts +1 -1
  12. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  14. package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
  15. package/es/components/booking/addons/index.js +20 -17
  16. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  17. package/es/components/booking/components/footer/utils.d.ts +6 -0
  18. package/es/components/booking/components/footer/utils.js +117 -53
  19. package/es/components/booking/components/voucher/index.js +27 -12
  20. package/es/components/booking/forms/table/index.d.ts +0 -1
  21. package/es/components/booking/info/service2/utils.js +1 -0
  22. package/es/components/booking/info2/service/addService/index.js +3 -3
  23. package/es/components/booking/utils.d.ts +1 -0
  24. package/es/components/booking/utils.js +16 -2
  25. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  26. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  27. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  28. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  29. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  30. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  31. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  32. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  33. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  34. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  35. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  36. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  37. package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
  38. package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
  39. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  40. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  41. package/es/components/schedules/products/index.d.ts +0 -1
  42. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  43. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  44. package/es/components/systemSettings/registry/components/SectionList.js +5 -1
  45. package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
  46. package/es/components/ticketBooking/utils/index.js +23 -8
  47. package/es/components/wallet/Detail/index.js +34 -2
  48. package/es/components/wallet/Detail/index.less +11 -0
  49. package/es/components/wallet/Detail/locales.d.ts +6 -0
  50. package/es/components/wallet/Detail/locales.js +14 -2
  51. package/es/components/wallet/Voucher/index.js +11 -10
  52. package/es/components/wallet/components/WalletCard.js +5 -1
  53. package/es/components/wallet/index.js +4 -2
  54. package/es/components/wallet/serve.d.ts +7 -0
  55. package/es/components/wallet/utils.d.ts +48 -0
  56. package/es/components/wallet/utils.js +342 -0
  57. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  58. package/es/index.d.ts +1 -0
  59. package/es/index.js +1 -0
  60. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  61. package/es/plus/walletPassGallery/components/passDetail/index.js +79 -30
  62. package/es/plus/walletPassGallery/index.js +4 -2
  63. package/es/plus/walletPassGallery/serve.d.ts +3 -0
  64. package/es/plus/walletPassGallery/serve.js +6 -2
  65. package/es/pro/Login2.0/AuthModal.js +12 -4
  66. package/es/pro/Login2.0/index.less +7 -7
  67. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  68. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  69. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  70. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  71. package/lib/components/booking/addons/index.js +10 -7
  72. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  73. package/lib/components/booking/components/footer/utils.d.ts +6 -0
  74. package/lib/components/booking/components/footer/utils.js +86 -36
  75. package/lib/components/booking/components/voucher/index.js +23 -7
  76. package/lib/components/booking/forms/table/index.d.ts +0 -1
  77. package/lib/components/booking/info/service2/utils.js +1 -0
  78. package/lib/components/booking/info2/service/addService/index.js +2 -2
  79. package/lib/components/booking/utils.d.ts +1 -0
  80. package/lib/components/booking/utils.js +12 -0
  81. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  82. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  83. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  84. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  85. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  86. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  87. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  88. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  89. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  90. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  91. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  92. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  93. package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
  94. package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
  95. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  96. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  97. package/lib/components/schedules/products/index.d.ts +0 -1
  98. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  99. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  100. package/lib/components/systemSettings/registry/components/SectionList.js +4 -1
  101. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  102. package/lib/components/ticketBooking/utils/index.js +9 -4
  103. package/lib/components/wallet/Detail/index.js +31 -3
  104. package/lib/components/wallet/Detail/index.less +11 -0
  105. package/lib/components/wallet/Detail/locales.d.ts +6 -0
  106. package/lib/components/wallet/Detail/locales.js +14 -2
  107. package/lib/components/wallet/Voucher/index.js +8 -8
  108. package/lib/components/wallet/components/WalletCard.js +4 -0
  109. package/lib/components/wallet/index.js +2 -2
  110. package/lib/components/wallet/serve.d.ts +7 -0
  111. package/lib/components/wallet/utils.d.ts +48 -0
  112. package/lib/components/wallet/utils.js +287 -0
  113. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  114. package/lib/index.d.ts +1 -0
  115. package/lib/index.js +3 -0
  116. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  117. package/lib/plus/walletPassGallery/components/passDetail/index.js +50 -14
  118. package/lib/plus/walletPassGallery/index.js +4 -2
  119. package/lib/plus/walletPassGallery/serve.d.ts +3 -0
  120. package/lib/plus/walletPassGallery/serve.js +5 -2
  121. package/lib/pro/Login2.0/AuthModal.js +15 -7
  122. package/lib/pro/Login2.0/index.less +7 -7
  123. package/lowcode/wallet-pass-detail/meta.ts +89 -0
  124. package/package.json +4 -4
@@ -0,0 +1,48 @@
1
+ interface ScheduleTextResult {
2
+ validityTexts: string[];
3
+ excluded_date: string[];
4
+ included_date: string[];
5
+ }
6
+ declare type Locale = 'en' | 'zh-CN' | 'zh-HK';
7
+ interface ScheduleItem {
8
+ id: number;
9
+ name: string | {
10
+ [key: string]: string;
11
+ };
12
+ type: 'standard' | 'time-slots' | 'designation';
13
+ start_time: string | null;
14
+ end_time: string | null;
15
+ repeat_type: 'none' | 'daily' | 'weekly';
16
+ repeat_rule: {
17
+ end: {
18
+ type: 'never' | 'date' | 'occurrence';
19
+ end_date: string | null;
20
+ occurrence: number | null;
21
+ };
22
+ frequency: number;
23
+ excluded_date: Array<{
24
+ start: string;
25
+ end: string;
26
+ }>;
27
+ included_date: any[];
28
+ frequency_date: number[];
29
+ } | null;
30
+ designation: Array<{
31
+ start_date: string;
32
+ start_time: string;
33
+ end_date: string;
34
+ end_time: string;
35
+ }> | null;
36
+ is_all: number;
37
+ time_slot: Array<{
38
+ start_time: string;
39
+ end_time: string;
40
+ }>;
41
+ }
42
+ /**
43
+ * 根据scheduleList格式化文案展示
44
+ * @param scheduleList 日程列表
45
+ * @returns 格式化后的文案结果数组,每个日程对应一个结果
46
+ */
47
+ export declare function formatScheduleText(scheduleList: ScheduleItem[], locale?: Locale): ScheduleTextResult[];
48
+ export {};
@@ -0,0 +1,342 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ // 日程文案格式化接口
8
+
9
+ // 日程项接口定义
10
+
11
+ // 格式化日期时间函数
12
+ function formatDateTime(dateTime) {
13
+ var isAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
14
+ var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'zh-CN';
15
+ var date = new Date(dateTime);
16
+ var year = date.getFullYear();
17
+ var month = String(date.getMonth() + 1).padStart(2, '0');
18
+ var day = String(date.getDate()).padStart(2, '0');
19
+ var hours = date.getHours();
20
+ var minutes = String(date.getMinutes()).padStart(2, '0');
21
+ if (isAll) {
22
+ // 全天情况下的日期格式
23
+ if (locale === 'en') {
24
+ return "".concat(day, "/").concat(month, "/").concat(year);
25
+ } else {
26
+ return "".concat(year, "-").concat(month, "-").concat(day);
27
+ }
28
+ }
29
+
30
+ // 非全天情况下的日期时间格式
31
+ if (locale === 'en') {
32
+ // DD/MM/YYYY h:mm A 格式
33
+ var period = hours >= 12 ? 'PM' : 'AM';
34
+ var displayHours = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
35
+ return "".concat(day, "/").concat(month, "/").concat(year, " ").concat(displayHours, ":").concat(minutes, " ").concat(period);
36
+ } else {
37
+ // YYYY-MM-DD HH:mm 格式
38
+ var _displayHours = String(hours).padStart(2, '0');
39
+ return "".concat(year, "-").concat(month, "-").concat(day, " ").concat(_displayHours, ":").concat(minutes);
40
+ }
41
+ }
42
+
43
+ // 多语言文案配置
44
+ var textConfig = {
45
+ 'zh-HK': {
46
+ weekdays: ['日', '一', '二', '三', '四', '五', '六'],
47
+ separator: '、',
48
+ timeSeparator: '–',
49
+ rangeSeparator: ' 至 ',
50
+ periodSeparator: ';',
51
+ timeSlotSeparator: ',',
52
+ every: '每',
53
+ day: '天',
54
+ week: '周',
55
+ month: '月',
56
+ year: '年',
57
+ available: '可用',
58
+ unlimited: '无限期',
59
+ weekPrefix: '周'
60
+ },
61
+ 'zh-CN': {
62
+ weekdays: ['日', '一', '二', '三', '四', '五', '六'],
63
+ separator: '、',
64
+ timeSeparator: '–',
65
+ rangeSeparator: ' 至 ',
66
+ periodSeparator: ';',
67
+ timeSlotSeparator: ',',
68
+ every: '每',
69
+ day: '天',
70
+ week: '周',
71
+ month: '月',
72
+ year: '年',
73
+ available: '可用',
74
+ unlimited: '无限期',
75
+ weekPrefix: '周'
76
+ },
77
+ 'en': {
78
+ weekdays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
79
+ separator: ', ',
80
+ timeSeparator: '–',
81
+ rangeSeparator: ' - ',
82
+ periodSeparator: '; ',
83
+ timeSlotSeparator: ', ',
84
+ every: 'every ',
85
+ day: 'day',
86
+ week: 'week',
87
+ month: 'month',
88
+ year: 'year',
89
+ available: 'available',
90
+ unlimited: 'unlimited',
91
+ weekPrefix: ''
92
+ }
93
+ };
94
+
95
+ // 获取星期几的表示
96
+ function getWeekdayText(dayNumbers, locale) {
97
+ var config = textConfig[locale];
98
+ return dayNumbers.map(function (day) {
99
+ return config.weekdays[day];
100
+ }).join(config.separator);
101
+ }
102
+
103
+ // 获取重复频率文案
104
+ function getRepeatFrequencyText(repeatType, frequency, locale) {
105
+ var config = textConfig[locale];
106
+ var typeMap = {
107
+ 'daily': config.day,
108
+ 'weekly': config.week,
109
+ 'monthly': config.month,
110
+ 'yearly': config.year
111
+ };
112
+ if (locale === 'en') {
113
+ if (frequency === 1) {
114
+ return "".concat(config.every).concat(typeMap[repeatType]);
115
+ }
116
+ return "".concat(config.every).concat(frequency, " ").concat(typeMap[repeatType], "s");
117
+ } else {
118
+ if (frequency === 1) {
119
+ return "".concat(config.every).concat(typeMap[repeatType]);
120
+ }
121
+ return "".concat(config.every).concat(frequency).concat(typeMap[repeatType]);
122
+ }
123
+ }
124
+
125
+ /**
126
+ * 根据scheduleList格式化文案展示
127
+ * @param scheduleList 日程列表
128
+ * @returns 格式化后的文案结果数组,每个日程对应一个结果
129
+ */
130
+ export function formatScheduleText(scheduleList) {
131
+ var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en';
132
+ var results = [];
133
+ var config = textConfig[locale];
134
+ scheduleList.forEach(function (schedule) {
135
+ var _schedule$repeat_rule, _schedule$repeat_rule2;
136
+ var validityTexts = [];
137
+ var excluded_date = [];
138
+ var included_date = [];
139
+
140
+ // 处理排除日期
141
+ if ((_schedule$repeat_rule = schedule.repeat_rule) !== null && _schedule$repeat_rule !== void 0 && _schedule$repeat_rule.excluded_date) {
142
+ schedule.repeat_rule.excluded_date.forEach(function (excludeItem) {
143
+ var startDate = formatDateTime(excludeItem.start, true, locale);
144
+ var endDate = formatDateTime(excludeItem.end, true, locale);
145
+ if (excludeItem.start === excludeItem.end) {
146
+ // 开始和结束日期相同,只显示开始日期
147
+ excluded_date.push(startDate);
148
+ } else {
149
+ // 开始和结束日期不同,显示范围格式
150
+ excluded_date.push("".concat(startDate).concat(config.rangeSeparator).concat(endDate));
151
+ }
152
+ });
153
+ }
154
+
155
+ // 处理包含日期
156
+ if ((_schedule$repeat_rule2 = schedule.repeat_rule) !== null && _schedule$repeat_rule2 !== void 0 && _schedule$repeat_rule2.included_date) {
157
+ schedule.repeat_rule.included_date.forEach(function (includeItem) {
158
+ var startDate = formatDateTime(includeItem.start, true, locale);
159
+ var endDate = formatDateTime(includeItem.end, true, locale);
160
+ if (includeItem.start === includeItem.end) {
161
+ // 开始和结束日期相同,只显示开始日期
162
+ included_date.push(startDate);
163
+ } else {
164
+ // 开始和结束日期不同,显示范围格式
165
+ included_date.push("".concat(startDate).concat(config.rangeSeparator).concat(endDate));
166
+ }
167
+ });
168
+ }
169
+ var isAllDay = schedule.is_all === 1;
170
+ var validityText = '';
171
+
172
+ // 1. 非循环日程处理
173
+ if (schedule.repeat_type === 'none') {
174
+ // 1.1 单个标准日程(单日单段)
175
+ if (schedule.type === 'standard') {
176
+ var startDateTime = formatDateTime(schedule.start_time, isAllDay, locale);
177
+ var endDateTime = formatDateTime(schedule.end_time, isAllDay, locale);
178
+ validityText = "".concat(startDateTime).concat(config.rangeSeparator).concat(endDateTime);
179
+ }
180
+ // 1.2 多时间段日程(单日多段)
181
+ else if (schedule.type === 'time-slots' && schedule.time_slot.length > 0) {
182
+ var baseDate = formatDateTime(schedule.start_time, true, locale);
183
+ if (isAllDay) {
184
+ // 全天情况下,不显示时分
185
+ validityText = "".concat(baseDate);
186
+ } else {
187
+ // 非全天情况下,按新格式显示时间段
188
+ var timeSlots = schedule.time_slot.map(function (slot) {
189
+ return "".concat(slot.start_time).concat(config.timeSeparator).concat(slot.end_time);
190
+ });
191
+ validityText = "".concat(baseDate, " ").concat(timeSlots.join(config.timeSlotSeparator));
192
+ }
193
+ } else if (schedule.type === 'designation' && schedule.designation) {
194
+ var designationTexts = schedule.designation.map(function (item) {
195
+ if (isAllDay || item.start_time === '00:00' && item.end_time === '23:59') {
196
+ // 全天情况:只显示日期
197
+ var startDate = formatDateTime(item.start_date, true, locale);
198
+ var endDate = formatDateTime(item.end_date, true, locale);
199
+ return "".concat(startDate).concat(config.rangeSeparator).concat(endDate);
200
+ } else {
201
+ // 非全天情况:按新格式显示日期时间
202
+ var _startDate = formatDateTime(item.start_date, true, locale);
203
+ return "".concat(_startDate, " ").concat(item.start_time).concat(config.timeSeparator).concat(item.end_time);
204
+ }
205
+ });
206
+ validityTexts.push.apply(validityTexts, _toConsumableArray(designationTexts));
207
+ }
208
+ }
209
+
210
+ // 2. 循环日程处理
211
+ else if (schedule.repeat_rule) {
212
+ var _schedule$repeat_rule3 = schedule.repeat_rule,
213
+ frequency = _schedule$repeat_rule3.frequency,
214
+ frequency_date = _schedule$repeat_rule3.frequency_date;
215
+
216
+ // 根据 is_all 决定是否显示时分
217
+ var startText = isAllDay ? formatDateTime(schedule.start_time, true, locale) : formatDateTime(schedule.start_time, false, locale);
218
+
219
+ // 结束日期处理
220
+ var endDateText = '';
221
+ if (schedule.repeat_rule.end.type === 'never') {
222
+ endDateText = config.unlimited;
223
+ } else if (schedule.repeat_rule.end.end_date) {
224
+ endDateText = formatDateTime(schedule.repeat_rule.end.end_date, true, locale);
225
+ }
226
+
227
+ // 2.1 标准类型循环日程
228
+ if (schedule.type === 'standard') {
229
+ // 按天循环
230
+ if (schedule.repeat_type === 'daily') {
231
+ if (isAllDay) {
232
+ var frequencyText = getRepeatFrequencyText('daily', frequency, locale);
233
+ if (locale === 'en') {
234
+ validityText = "".concat(startText).concat(config.rangeSeparator).concat(endDateText, ", ").concat(config.available, " ").concat(frequencyText);
235
+ } else {
236
+ validityText = "".concat(startText).concat(config.rangeSeparator).concat(endDateText, "\uFF0C").concat(frequencyText).concat(config.available);
237
+ }
238
+ } else {
239
+ var startTime = formatDateTime(schedule.start_time, false, locale);
240
+ var endTime = formatDateTime(schedule.end_time, false, locale);
241
+ var timeRange = locale === 'en' ? "".concat(startTime.split(' ')[1], " ").concat(startTime.split(' ')[2]).concat(config.timeSeparator).concat(endTime.split(' ')[1], " ").concat(endTime.split(' ')[2]) : "".concat(startTime.split(' ')[1]).concat(config.timeSeparator).concat(endTime.split(' ')[1]);
242
+ var _frequencyText = getRepeatFrequencyText('daily', frequency, locale);
243
+ var dateRange = locale === 'en' ? "".concat(startTime.split(' ')[0]).concat(config.rangeSeparator).concat(endDateText) : "".concat(startText.split(' ')[0]).concat(config.rangeSeparator).concat(endDateText);
244
+ if (locale === 'en') {
245
+ validityText = "".concat(dateRange, ", ").concat(config.available, " ").concat(_frequencyText, " ").concat(timeRange);
246
+ } else {
247
+ validityText = "".concat(dateRange, "\uFF0C").concat(_frequencyText, " ").concat(timeRange, " ").concat(config.available);
248
+ }
249
+ }
250
+ }
251
+
252
+ // 按周循环
253
+ else if (schedule.repeat_type === 'weekly') {
254
+ var weekdaysText = getWeekdayText(frequency_date, locale);
255
+ if (isAllDay) {
256
+ if (locale === 'en') {
257
+ var _frequencyText2 = frequency === 1 ? 'every week' : "every ".concat(frequency, " weeks");
258
+ validityText = "".concat(startText).concat(config.rangeSeparator).concat(endDateText, ", ").concat(_frequencyText2, " on ").concat(weekdaysText, " ");
259
+ } else {
260
+ var _frequencyText3 = frequency === 1 ? '每周' : "\u6BCF".concat(frequency, "\u5468\u7684");
261
+ validityText = "".concat(startText).concat(config.rangeSeparator).concat(endDateText, "\uFF0C").concat(_frequencyText3).concat(config.weekPrefix).concat(weekdaysText).concat(config.available);
262
+ }
263
+ } else {
264
+ var _startTime = formatDateTime(schedule.start_time, false, locale);
265
+ var _endTime = formatDateTime(schedule.end_time, false, locale);
266
+ var _timeRange = locale === 'en' ? "".concat(_startTime.split(' ')[1], " ").concat(_startTime.split(' ')[2]).concat(config.timeSeparator).concat(_endTime.split(' ')[1], " ").concat(_endTime.split(' ')[2]) : "".concat(_startTime.split(' ')[1]).concat(config.timeSeparator).concat(_endTime.split(' ')[1]);
267
+ var _dateRange = locale === 'en' ? "".concat(_startTime.split(' ')[0]).concat(config.rangeSeparator).concat(endDateText) : "".concat(startText.split(' ')[0]).concat(config.rangeSeparator).concat(endDateText);
268
+ if (locale === 'en') {
269
+ var _frequencyText4 = frequency === 1 ? 'every week' : "every ".concat(frequency, " weeks");
270
+ validityText = "".concat(_dateRange, ", ").concat(_frequencyText4, " on ").concat(weekdaysText, " ").concat(_timeRange);
271
+ } else {
272
+ var _frequencyText5 = frequency === 1 ? '每周' : "\u6BCF".concat(frequency, "\u5468\u7684");
273
+ validityText = "".concat(_dateRange, "\uFF0C").concat(_frequencyText5).concat(config.weekPrefix).concat(weekdaysText, " ").concat(_timeRange);
274
+ }
275
+ }
276
+ }
277
+ }
278
+
279
+ // 2.2 多时间段类型循环日程
280
+ else if (schedule.type === 'time-slots' && schedule.time_slot.length > 0) {
281
+ var _baseDate = formatDateTime(schedule.start_time, true, locale);
282
+
283
+ // 格式化时间段
284
+ var _timeSlots = schedule.time_slot.map(function (slot) {
285
+ return "".concat(slot.start_time).concat(config.timeSeparator).concat(slot.end_time);
286
+ });
287
+ var timeSlotsText = _timeSlots.join(config.timeSlotSeparator);
288
+
289
+ // 按天循环
290
+ if (schedule.repeat_type === 'daily') {
291
+ var _frequencyText6 = getRepeatFrequencyText('daily', frequency, locale);
292
+ if (locale === 'en') {
293
+ validityText = "".concat(_baseDate).concat(config.rangeSeparator).concat(endDateText, ", ").concat(config.available, " ").concat(_frequencyText6, " ").concat(timeSlotsText);
294
+ } else {
295
+ validityText = "".concat(_baseDate).concat(config.rangeSeparator).concat(endDateText, "\uFF0C").concat(_frequencyText6, " ").concat(timeSlotsText, " ").concat(config.available);
296
+ }
297
+ }
298
+
299
+ // 按周循环
300
+ else if (schedule.repeat_type === 'weekly') {
301
+ var _weekdaysText = getWeekdayText(frequency_date, locale);
302
+ if (locale === 'en') {
303
+ var _frequencyText7 = frequency === 1 ? 'every week' : "every ".concat(frequency, " weeks");
304
+ validityText = "".concat(_baseDate).concat(config.rangeSeparator).concat(endDateText, ", ").concat(_frequencyText7, " on ").concat(_weekdaysText, " ").concat(timeSlotsText);
305
+ } else {
306
+ var _frequencyText8 = frequency === 1 ? '每周' : "\u6BCF".concat(frequency, "\u5468\u7684");
307
+ validityText = "".concat(_baseDate).concat(config.rangeSeparator).concat(endDateText, "\uFF0C").concat(_frequencyText8).concat(config.weekPrefix).concat(_weekdaysText, " ").concat(timeSlotsText, " ").concat(config.available);
308
+ }
309
+ }
310
+ }
311
+ }
312
+
313
+ // 4. 指定日期日程(多天多段)
314
+ else if (schedule.type === 'designation' && schedule.designation) {
315
+ var _designationTexts = schedule.designation.map(function (item) {
316
+ if (isAllDay || item.start_time === '00:00' && item.end_time === '23:59') {
317
+ // 全天情况:只显示日期
318
+ var startDate = formatDateTime(item.start_date, true, locale);
319
+ var endDate = formatDateTime(item.end_date, true, locale);
320
+ return "".concat(startDate).concat(config.rangeSeparator).concat(endDate);
321
+ } else {
322
+ // 非全天情况:按新格式显示日期时间
323
+ var _startDate2 = formatDateTime(item.start_date, true, locale);
324
+ return "".concat(_startDate2, " ").concat(item.start_time).concat(config.timeSeparator).concat(item.end_time);
325
+ }
326
+ });
327
+ // 多天多段情况,每个时间段作为独立元素添加到validityTexts中
328
+ validityTexts.push.apply(validityTexts, _toConsumableArray(_designationTexts));
329
+ }
330
+ if (validityText) {
331
+ validityTexts.push(validityText);
332
+ }
333
+
334
+ // 为每个日程创建一个结果
335
+ results.push({
336
+ validityTexts: validityTexts,
337
+ excluded_date: excluded_date,
338
+ included_date: included_date
339
+ });
340
+ });
341
+ return results;
342
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Modal as AntModal, ModalFuncProps as AntModalFuncProps, ModalProps as AntModalProps } from 'antd';
3
2
  import './index.less';
4
3
  interface ModalProps extends AntModalProps {
package/es/index.d.ts CHANGED
@@ -57,4 +57,5 @@ export { default as ContactInfoModal } from './plus/contactInfoModal';
57
57
  export { Login2, Register2, AuthModal } from './pro/Login2.0';
58
58
  export { default as WalletEditor } from './plus/walletEditor';
59
59
  export { default as WalletPassGallery } from './plus/walletPassGallery';
60
+ export { default as WalletPassDetail } from './plus/walletPassGallery/components/passDetail';
60
61
  export { default as SettingsRegistry } from './components/systemSettings/registry';
package/es/index.js CHANGED
@@ -60,4 +60,5 @@ export { default as ContactInfoModal } from "./plus/contactInfoModal";
60
60
  export { Login2, Register2, AuthModal } from "./pro/Login2.0";
61
61
  export { default as WalletEditor } from "./plus/walletEditor";
62
62
  export { default as WalletPassGallery } from "./plus/walletPassGallery";
63
+ export { default as WalletPassDetail } from "./plus/walletPassGallery/components/passDetail";
63
64
  export { default as SettingsRegistry } from "./components/systemSettings/registry";
@@ -3,6 +3,7 @@ interface PassDetailProps {
3
3
  dataSource?: any | null;
4
4
  platform?: 'pc' | 'h5';
5
5
  buttonGroupList?: any[][];
6
+ showTimeLine?: boolean;
6
7
  }
7
8
  declare const PassDetail: (props: PassDetailProps) => JSX.Element | null;
8
9
  export default PassDetail;
@@ -24,16 +24,20 @@ import Recharge from "../recharge";
24
24
  import FooterButtons from "../footerButton";
25
25
  import useEngineContext from "../../../../hooks/useEngineContext";
26
26
  import "./index.less";
27
+ import { formatScheduleText } from "../../../../components/wallet/utils";
28
+ import localeTexts from "../../locales";
29
+ import { request } from "../../../../utils";
27
30
  var Text = Typography.Text;
28
31
  var PassDetail = function PassDetail(props) {
29
- var _context$appHelper, _store$getState, _dataSource$machineco, _getDetail$data, _getDetail$data2, _dataSource$machineco2;
30
- if (!props.dataSource) return null;
32
+ var _context$appHelper, _context$appHelper2, _store$getState, _context$engine, _context$appHelper3, _dataSource$machineco, _getDetail$data, _getDetail$data2, _dataSource$machineco2;
31
33
  var _usePisellConfig = usePisellConfig(),
32
34
  _usePisellConfig$symb = _usePisellConfig.symbol,
33
35
  symbol = _usePisellConfig$symb === void 0 ? '$' : _usePisellConfig$symb;
34
36
  var dataSource = props.dataSource,
35
37
  _props$platform = props.platform,
36
- platform = _props$platform === void 0 ? 'pc' : _props$platform;
38
+ platform = _props$platform === void 0 ? 'pc' : _props$platform,
39
+ _props$showTimeLine = props.showTimeLine,
40
+ showTimeLine = _props$showTimeLine === void 0 ? true : _props$showTimeLine;
37
41
  var _useState = useState('detail'),
38
42
  _useState2 = _slicedToArray(_useState, 2),
39
43
  activeKey = _useState2[0],
@@ -51,38 +55,54 @@ var PassDetail = function PassDetail(props) {
51
55
  store: {}
52
56
  },
53
57
  store = _ref.store;
54
- var timezone = (store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.symbol) === null || _store$getState === void 0 ? void 0 : _store$getState.shop.timezone) || 'Asia/Shanghai';
55
- var _ref2 = dataSource || {},
56
- _ref2$id = _ref2.id,
57
- id = _ref2$id === void 0 ? '' : _ref2$id,
58
- _ref2$code = _ref2.code,
59
- code = _ref2$code === void 0 ? '' : _ref2$code,
60
- _ref2$tag = _ref2.tag,
61
- tag = _ref2$tag === void 0 ? '' : _ref2$tag,
62
- _ref2$product_title = _ref2.product_title,
63
- product_title = _ref2$product_title === void 0 ? '' : _ref2$product_title,
64
- _ref2$encoded = _ref2.encoded,
65
- encoded = _ref2$encoded === void 0 ? '' : _ref2$encoded,
66
- balance = _ref2.balance,
67
- _ref2$expire_date = _ref2.expire_date,
68
- expire_date = _ref2$expire_date === void 0 ? '' : _ref2$expire_date,
69
- _ref2$product = _ref2.product,
70
- product = _ref2$product === void 0 ? {} : _ref2$product;
71
- var _ref3 = product || {},
72
- _ref3$description = _ref3.description,
73
- description = _ref3$description === void 0 ? '' : _ref3$description,
74
- _ref3$extension_data = _ref3.extension_data,
75
- extension_data = _ref3$extension_data === void 0 ? [] : _ref3$extension_data,
76
- _ref3$customer_order_ = _ref3.customer_order_behavior_count,
77
- customer_order_behavior_count = _ref3$customer_order_ === void 0 ? 0 : _ref3$customer_order_;
58
+ var _ref2 = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.constants) || {
59
+ apiPrefix: "/h5"
60
+ },
61
+ apiPrefix = _ref2.apiPrefix;
62
+ var timezone = (store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.symbol) === null || _store$getState === void 0 || (_store$getState = _store$getState.shop) === null || _store$getState === void 0 ? void 0 : _store$getState.timezone) || 'Asia/Shanghai';
63
+ locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
64
+ if ((_context$appHelper3 = context.appHelper) !== null && _context$appHelper3 !== void 0 && (_context$appHelper3 = _context$appHelper3.utils) !== null && _context$appHelper3 !== void 0 && _context$appHelper3.request) {
65
+ var _context$appHelper4;
66
+ request.setRequest((_context$appHelper4 = context.appHelper) === null || _context$appHelper4 === void 0 || (_context$appHelper4 = _context$appHelper4.utils) === null || _context$appHelper4 === void 0 ? void 0 : _context$appHelper4.request);
67
+ }
68
+ var _ref3 = dataSource || {},
69
+ _ref3$id = _ref3.id,
70
+ id = _ref3$id === void 0 ? '' : _ref3$id,
71
+ _ref3$code = _ref3.code,
72
+ code = _ref3$code === void 0 ? '' : _ref3$code,
73
+ _ref3$tag = _ref3.tag,
74
+ tag = _ref3$tag === void 0 ? '' : _ref3$tag,
75
+ _ref3$product_title = _ref3.product_title,
76
+ product_title = _ref3$product_title === void 0 ? '' : _ref3$product_title,
77
+ _ref3$encoded = _ref3.encoded,
78
+ encoded = _ref3$encoded === void 0 ? '' : _ref3$encoded,
79
+ balance = _ref3.balance,
80
+ _ref3$expire_date = _ref3.expire_date,
81
+ expire_date = _ref3$expire_date === void 0 ? '' : _ref3$expire_date,
82
+ _ref3$product = _ref3.product,
83
+ product = _ref3$product === void 0 ? {} : _ref3$product,
84
+ custom_schedule_snapshot = _ref3.custom_schedule_snapshot,
85
+ customer_id = _ref3.customer_id;
86
+ var _ref4 = product || {},
87
+ _ref4$description = _ref4.description,
88
+ description = _ref4$description === void 0 ? '' : _ref4$description,
89
+ _ref4$extension_data = _ref4.extension_data,
90
+ extension_data = _ref4$extension_data === void 0 ? [] : _ref4$extension_data,
91
+ _ref4$customer_order_ = _ref4.customer_order_behavior_count,
92
+ customer_order_behavior_count = _ref4$customer_order_ === void 0 ? 0 : _ref4$customer_order_;
78
93
  var _getDetail = useRequest(function () {
79
94
  return getDetailApi({
80
- id: id
95
+ id: id,
96
+ apiPrefix: apiPrefix,
97
+ order_behavior_count_customer_id: customer_id
81
98
  });
82
99
  }, {
83
100
  ready: !!id,
84
- refreshDeps: [id]
101
+ refreshDeps: [id, customer_id]
85
102
  });
103
+ var scheduleList = useMemo(function () {
104
+ return (custom_schedule_snapshot === null || custom_schedule_snapshot === void 0 ? void 0 : custom_schedule_snapshot.data) || [];
105
+ }, [custom_schedule_snapshot]);
86
106
  useEffect(function () {
87
107
  if (tag === 'product_discount_card') {
88
108
  setActiveKey('detail');
@@ -117,6 +137,33 @@ var PassDetail = function PassDetail(props) {
117
137
  };
118
138
  }, []);
119
139
  var descs = useMemo(function () {
140
+ var _context$engine2;
141
+ var detail = formatScheduleText(scheduleList, context === null || context === void 0 || (_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.locale);
142
+ var expireText = expire_date ? expire_date : locales.getText('wallet-pass-gallery.expireDate');
143
+ if (scheduleList.length > 0) {
144
+ // 换行展示
145
+ var validityTexts = "";
146
+ var excludedText = "";
147
+ var includedText = "";
148
+ detail.forEach(function (item) {
149
+ if (item.validityTexts.length > 0) {
150
+ validityTexts = "".concat(validityTexts).concat(item.validityTexts.join('\n'), "\n");
151
+ }
152
+ if (item.excluded_date.length > 0) {
153
+ excludedText = "".concat(excludedText).concat(item.excluded_date.join('\n'), "\n");
154
+ }
155
+ if (item.included_date.length > 0) {
156
+ includedText = "".concat(includedText).concat(item.included_date.join('\n'), "\n");
157
+ }
158
+ });
159
+ expireText = /*#__PURE__*/React.createElement("span", {
160
+ className: "wallet-detail-expire-text"
161
+ }, validityTexts, excludedText && /*#__PURE__*/React.createElement("div", {
162
+ className: "wallet-detail-expire-text-title"
163
+ }, locales.getText('page.wallet.notValidDate')), excludedText, includedText && /*#__PURE__*/React.createElement("div", {
164
+ className: "wallet-detail-expire-text-title"
165
+ }, locales.getText('page.wallet.includedDate')), includedText);
166
+ }
120
167
  var data = [{
121
168
  label: locales.getText('wallet-pass-gallery.cardName'),
122
169
  value: product_title
@@ -126,7 +173,7 @@ var PassDetail = function PassDetail(props) {
126
173
  isLink: false
127
174
  }, {
128
175
  label: locales.getText('wallet-pass-gallery.validDate'),
129
- value: expire_date ? expire_date : locales.getText('wallet-pass-gallery.expireDate')
176
+ value: expireText
130
177
  }];
131
178
  //折扣卡显示折扣字段 其他显示余额字段
132
179
  if (tag === 'product_discount_card') {
@@ -195,12 +242,14 @@ var PassDetail = function PassDetail(props) {
195
242
  };
196
243
  var renderTimeLine = function renderTimeLine() {
197
244
  if (tag === 'product_discount_card') return null;
245
+ if (!showTimeLine) return null;
198
246
  return /*#__PURE__*/React.createElement(TimelineSection, {
199
247
  code: code,
200
248
  tag: tag,
201
249
  timezone: timezone
202
250
  });
203
251
  };
252
+ if (!props.dataSource) return null;
204
253
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
205
254
  className: classNames("pisell-wallet-pass-gallery_detail", "pisell-wallet-pass-gallery_detail-".concat(platform), _defineProperty({}, "pisell-wallet-pass-gallery_detail-with-footer", platform === 'h5' && tag === 'gift_card'))
206
255
  }, /*#__PURE__*/React.createElement("div", {
@@ -82,7 +82,8 @@ var WalletPassGallery = function WalletPassGallery(props) {
82
82
  num: 20,
83
83
  skip: (d === null || d === void 0 ? void 0 : d.nextId) || 1,
84
84
  tags: TAGS,
85
- filter_wallet_id: walletId || undefined
85
+ filter_wallet_id: walletId || undefined,
86
+ "with": ['customScheduleSnapshot']
86
87
  });
87
88
  case 3:
88
89
  res = _context.sent;
@@ -121,7 +122,8 @@ var WalletPassGallery = function WalletPassGallery(props) {
121
122
  num: 20,
122
123
  skip: (d === null || d === void 0 ? void 0 : d.nextId) || 1,
123
124
  tags: TAGS,
124
- filter_wallet_id: walletId || undefined
125
+ filter_wallet_id: walletId || undefined,
126
+ "with": ['customScheduleSnapshot']
125
127
  });
126
128
  case 3:
127
129
  res = _context2.sent;
@@ -17,6 +17,7 @@ export interface IWalletListParmsProps {
17
17
  skip?: number;
18
18
  filter_wallet_id?: string;
19
19
  available: 0 | 1;
20
+ with?: string[];
20
21
  }
21
22
  /**
22
23
  * 钱包列表项属性接口
@@ -171,6 +172,8 @@ export declare const getAssetList: (params: IAssetListProps) => Promise<{
171
172
  */
172
173
  export declare const getDetailApi: (params: {
173
174
  id: string;
175
+ order_behavior_count_customer_id: string;
176
+ apiPrefix: string;
174
177
  }) => Promise<IDetailResponse>;
175
178
  /**
176
179
  * 详情响应数据结构,供组件消费
@@ -214,10 +214,14 @@ export var getDetailApi = /*#__PURE__*/function () {
214
214
  while (1) switch (_context6.prev = _context6.next) {
215
215
  case 0:
216
216
  _context6.next = 2;
217
- return request.getRequest().get("/h5/machinecode/lowcode/detail/".concat(params.id), {
217
+ return request.getRequest().get("".concat(params.apiPrefix || '/h5', "/machinecode/lowcode/detail/").concat(params.id), {
218
218
  order_behavior_count: 1,
219
219
  // 订单行为次数
220
- order_behavior_count_customer: 1 // 客户订单行为次数
220
+ order_behavior_count_customer: 1,
221
+ // 客户订单行为次数
222
+ order_behavior_count_customer_id: params.apiPrefix === '/shop' ? params.order_behavior_count_customer_id : undefined
223
+ }, {
224
+ isOriginHost: true
221
225
  });
222
226
  case 2:
223
227
  _yield$request$getReq6 = _context6.sent;