@pisell/pisellos 2.1.170 → 2.1.172

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 (231) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -3
  3. package/dist/model/strategy/adapter/index.d.ts +0 -4
  4. package/dist/model/strategy/adapter/index.js +1 -5
  5. package/dist/model/strategy/adapter/promotion/evaluator.js +99 -26
  6. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  7. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  8. package/dist/model/strategy/adapter/walletPass/evaluator.js +61 -8
  9. package/dist/model/strategy/adapter/walletPass/locales.js +12 -3
  10. package/dist/model/strategy/engine.d.ts +18 -5
  11. package/dist/model/strategy/engine.js +145 -45
  12. package/dist/model/strategy/type.d.ts +17 -0
  13. package/dist/model/strategy/type.js +4 -0
  14. package/dist/modules/Cart/types.d.ts +2 -0
  15. package/dist/modules/Cart/utils/cartProduct.js +56 -25
  16. package/dist/modules/Cart/utils/changePrice.js +9 -16
  17. package/dist/modules/Discount/index.d.ts +4 -13
  18. package/dist/modules/Discount/index.js +12 -124
  19. package/dist/modules/Discount/types.d.ts +18 -13
  20. package/dist/modules/Order/index.d.ts +1 -67
  21. package/dist/modules/Order/index.js +30 -918
  22. package/dist/modules/Order/types.d.ts +12 -176
  23. package/dist/modules/Order/types.js +0 -2
  24. package/dist/modules/Order/utils.d.ts +0 -118
  25. package/dist/modules/Order/utils.js +2 -586
  26. package/dist/modules/Payment/index.d.ts +2 -1
  27. package/dist/modules/Payment/index.js +10 -7
  28. package/dist/modules/Payment/utils.js +3 -0
  29. package/dist/modules/Payment/walletpass.d.ts +23 -0
  30. package/dist/modules/Payment/walletpass.js +191 -95
  31. package/dist/modules/Product/utils.js +2 -2
  32. package/dist/modules/ProductList/index.d.ts +2 -4
  33. package/dist/modules/ProductList/index.js +12 -24
  34. package/dist/modules/Rules/index.d.ts +9 -5
  35. package/dist/modules/Rules/index.js +669 -173
  36. package/dist/modules/Rules/types.d.ts +2 -0
  37. package/dist/modules/Schedule/getDateIsInSchedule.js +18 -16
  38. package/dist/modules/Schedule/utils.d.ts +1 -1
  39. package/dist/modules/Summary/types.d.ts +2 -0
  40. package/dist/modules/Summary/utils.d.ts +9 -3
  41. package/dist/modules/Summary/utils.js +57 -67
  42. package/dist/modules/index.d.ts +0 -4
  43. package/dist/modules/index.js +1 -5
  44. package/dist/plugins/window.d.ts +2 -0
  45. package/dist/solution/BookingByStep/index.d.ts +3 -2
  46. package/dist/solution/BookingByStep/index.js +43 -46
  47. package/dist/solution/BookingByStep/types.d.ts +1 -3
  48. package/dist/solution/BookingByStep/types.js +1 -5
  49. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  50. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  51. package/dist/solution/Checkout/index.js +2 -0
  52. package/dist/solution/ShopDiscount/index.d.ts +2 -3
  53. package/dist/solution/ShopDiscount/index.js +60 -62
  54. package/dist/solution/ShopDiscount/types.d.ts +1 -1
  55. package/dist/solution/ShopDiscount/types.js +2 -1
  56. package/dist/solution/ShopDiscount/utils.js +26 -12
  57. package/dist/solution/index.d.ts +0 -2
  58. package/dist/solution/index.js +1 -3
  59. package/lib/index.d.ts +1 -1
  60. package/lib/index.js +3 -4
  61. package/lib/model/strategy/adapter/index.d.ts +0 -4
  62. package/lib/model/strategy/adapter/index.js +2 -13
  63. package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
  64. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  65. package/lib/model/strategy/adapter/walletPass/evaluator.js +34 -3
  66. package/lib/model/strategy/adapter/walletPass/locales.js +12 -3
  67. package/lib/model/strategy/engine.d.ts +18 -5
  68. package/lib/model/strategy/engine.js +85 -21
  69. package/lib/model/strategy/type.d.ts +17 -0
  70. package/lib/modules/Cart/types.d.ts +2 -0
  71. package/lib/modules/Cart/utils/cartProduct.js +39 -12
  72. package/lib/modules/Cart/utils/changePrice.js +9 -13
  73. package/lib/modules/Discount/index.d.ts +4 -13
  74. package/lib/modules/Discount/index.js +5 -76
  75. package/lib/modules/Discount/types.d.ts +18 -13
  76. package/lib/modules/Order/index.d.ts +1 -67
  77. package/lib/modules/Order/index.js +1 -525
  78. package/lib/modules/Order/types.d.ts +12 -176
  79. package/lib/modules/Order/utils.d.ts +0 -118
  80. package/lib/modules/Order/utils.js +2 -483
  81. package/lib/modules/Payment/index.d.ts +2 -1
  82. package/lib/modules/Payment/index.js +1 -0
  83. package/lib/modules/Payment/utils.js +3 -0
  84. package/lib/modules/Payment/walletpass.d.ts +23 -0
  85. package/lib/modules/Payment/walletpass.js +94 -17
  86. package/lib/modules/Product/utils.js +2 -2
  87. package/lib/modules/ProductList/index.d.ts +2 -4
  88. package/lib/modules/ProductList/index.js +39 -46
  89. package/lib/modules/Rules/index.d.ts +9 -5
  90. package/lib/modules/Rules/index.js +776 -292
  91. package/lib/modules/Rules/types.d.ts +2 -0
  92. package/lib/modules/Schedule/getDateIsInSchedule.js +11 -13
  93. package/lib/modules/Schedule/utils.d.ts +1 -1
  94. package/lib/modules/Summary/types.d.ts +2 -0
  95. package/lib/modules/Summary/utils.d.ts +9 -3
  96. package/lib/modules/Summary/utils.js +34 -45
  97. package/lib/modules/index.d.ts +0 -4
  98. package/lib/modules/index.js +1 -9
  99. package/lib/plugins/window.d.ts +2 -0
  100. package/lib/solution/BookingByStep/index.d.ts +3 -2
  101. package/lib/solution/BookingByStep/index.js +4 -6
  102. package/lib/solution/BookingByStep/types.d.ts +1 -3
  103. package/lib/solution/BookingByStep/types.js +0 -10
  104. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  105. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  106. package/lib/solution/Checkout/index.js +2 -0
  107. package/lib/solution/ShopDiscount/index.d.ts +2 -3
  108. package/lib/solution/ShopDiscount/index.js +27 -22
  109. package/lib/solution/ShopDiscount/types.d.ts +1 -1
  110. package/lib/solution/ShopDiscount/utils.js +10 -6
  111. package/lib/solution/index.d.ts +0 -2
  112. package/lib/solution/index.js +1 -5
  113. package/package.json +2 -2
  114. package/dist/apis/picoding.d.ts +0 -0
  115. package/dist/apis/picoding.js +0 -1
  116. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  117. package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
  118. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  119. package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -867
  120. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  121. package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
  122. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  123. package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
  124. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -149
  125. package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
  126. package/dist/modules/OpenData/index.d.ts +0 -24
  127. package/dist/modules/OpenData/index.js +0 -173
  128. package/dist/modules/OpenData/types.d.ts +0 -73
  129. package/dist/modules/OpenData/types.js +0 -1
  130. package/dist/modules/OpenData/utils.d.ts +0 -2
  131. package/dist/modules/OpenData/utils.js +0 -75
  132. package/dist/modules/Quotation/index.d.ts +0 -48
  133. package/dist/modules/Quotation/index.js +0 -248
  134. package/dist/modules/Quotation/types.d.ts +0 -42
  135. package/dist/modules/Quotation/types.js +0 -1
  136. package/dist/modules/SalesSummary/index.d.ts +0 -63
  137. package/dist/modules/SalesSummary/index.js +0 -174
  138. package/dist/modules/SalesSummary/types.d.ts +0 -60
  139. package/dist/modules/SalesSummary/types.js +0 -1
  140. package/dist/modules/SalesSummary/utils.d.ts +0 -30
  141. package/dist/modules/SalesSummary/utils.js +0 -480
  142. package/dist/modules/ScanOrderLogger/index.d.ts +0 -23
  143. package/dist/modules/ScanOrderLogger/index.js +0 -174
  144. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  145. package/dist/modules/ScanOrderLogger/providers/feishu.js +0 -221
  146. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  147. package/dist/modules/ScanOrderLogger/providers/grafana.js +0 -50
  148. package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
  149. package/dist/modules/ScanOrderLogger/types.js +0 -1
  150. package/dist/solution/ScanOrder/index.d.ts +0 -158
  151. package/dist/solution/ScanOrder/index.js +0 -3474
  152. package/dist/solution/ScanOrder/types.d.ts +0 -306
  153. package/dist/solution/ScanOrder/types.js +0 -35
  154. package/dist/solution/ScanOrder/utils.d.ts +0 -172
  155. package/dist/solution/ScanOrder/utils.js +0 -796
  156. package/dist/solution/VenueBooking/index.d.ts +0 -252
  157. package/dist/solution/VenueBooking/index.js +0 -3769
  158. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
  159. package/dist/solution/VenueBooking/types.d.ts +0 -156
  160. package/dist/solution/VenueBooking/types.js +0 -22
  161. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
  162. package/dist/solution/VenueBooking/utils/dateSummary.js +0 -91
  163. package/dist/solution/VenueBooking/utils/resource.d.ts +0 -14
  164. package/dist/solution/VenueBooking/utils/resource.js +0 -131
  165. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -32
  166. package/dist/solution/VenueBooking/utils/slotMerge.js +0 -233
  167. package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
  168. package/dist/solution/VenueBooking/utils/smartPricing.js +0 -302
  169. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
  170. package/dist/solution/VenueBooking/utils/timeSlot.js +0 -458
  171. package/dist/solution/VenueBooking/utils.d.ts +0 -1
  172. package/dist/solution/VenueBooking/utils.js +0 -1
  173. package/lib/apis/picoding.d.ts +0 -0
  174. package/lib/apis/picoding.js +0 -0
  175. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  176. package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
  177. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  178. package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -666
  179. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  180. package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
  181. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  182. package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
  183. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -149
  184. package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
  185. package/lib/modules/OpenData/index.d.ts +0 -24
  186. package/lib/modules/OpenData/index.js +0 -119
  187. package/lib/modules/OpenData/types.d.ts +0 -73
  188. package/lib/modules/OpenData/types.js +0 -17
  189. package/lib/modules/OpenData/utils.d.ts +0 -2
  190. package/lib/modules/OpenData/utils.js +0 -111
  191. package/lib/modules/Quotation/index.d.ts +0 -48
  192. package/lib/modules/Quotation/index.js +0 -152
  193. package/lib/modules/Quotation/types.d.ts +0 -42
  194. package/lib/modules/Quotation/types.js +0 -17
  195. package/lib/modules/SalesSummary/index.d.ts +0 -63
  196. package/lib/modules/SalesSummary/index.js +0 -105
  197. package/lib/modules/SalesSummary/types.d.ts +0 -60
  198. package/lib/modules/SalesSummary/types.js +0 -17
  199. package/lib/modules/SalesSummary/utils.d.ts +0 -30
  200. package/lib/modules/SalesSummary/utils.js +0 -420
  201. package/lib/modules/ScanOrderLogger/index.d.ts +0 -23
  202. package/lib/modules/ScanOrderLogger/index.js +0 -147
  203. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  204. package/lib/modules/ScanOrderLogger/providers/feishu.js +0 -157
  205. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  206. package/lib/modules/ScanOrderLogger/providers/grafana.js +0 -52
  207. package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
  208. package/lib/modules/ScanOrderLogger/types.js +0 -17
  209. package/lib/solution/ScanOrder/index.d.ts +0 -158
  210. package/lib/solution/ScanOrder/index.js +0 -2135
  211. package/lib/solution/ScanOrder/types.d.ts +0 -306
  212. package/lib/solution/ScanOrder/types.js +0 -36
  213. package/lib/solution/ScanOrder/utils.d.ts +0 -172
  214. package/lib/solution/ScanOrder/utils.js +0 -658
  215. package/lib/solution/VenueBooking/index.d.ts +0 -252
  216. package/lib/solution/VenueBooking/index.js +0 -2204
  217. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
  218. package/lib/solution/VenueBooking/types.d.ts +0 -156
  219. package/lib/solution/VenueBooking/types.js +0 -45
  220. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
  221. package/lib/solution/VenueBooking/utils/dateSummary.js +0 -105
  222. package/lib/solution/VenueBooking/utils/resource.d.ts +0 -14
  223. package/lib/solution/VenueBooking/utils/resource.js +0 -92
  224. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -32
  225. package/lib/solution/VenueBooking/utils/slotMerge.js +0 -236
  226. package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
  227. package/lib/solution/VenueBooking/utils/smartPricing.js +0 -225
  228. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
  229. package/lib/solution/VenueBooking/utils/timeSlot.js +0 -343
  230. package/lib/solution/VenueBooking/utils.d.ts +0 -1
  231. package/lib/solution/VenueBooking/utils.js +0 -69
@@ -28,6 +28,7 @@ export interface RulesModuleAPI {
28
28
  calcDiscount: (params: {
29
29
  discountList: any[];
30
30
  productList: any[];
31
+ orderTotalAmount: number;
31
32
  holders: {
32
33
  form_record_id: number;
33
34
  }[];
@@ -66,6 +67,7 @@ export interface RulesParamsHooks {
66
67
  quantity?: number;
67
68
  bundle?: any[];
68
69
  main_product_selling_price?: string | number;
70
+ options?: any[];
69
71
  }) => Record<string, any>;
70
72
  }
71
73
  export {};
@@ -6,11 +6,6 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
6
6
  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); }
7
7
  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; }
8
8
  import dayjs from "dayjs";
9
- import isSameOrAfter from "dayjs/plugin/isSameOrAfter";
10
- import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
11
- dayjs.extend(isSameOrAfter);
12
- dayjs.extend(isSameOrBefore);
13
-
14
9
  // 获取时间是否在日程范围内
15
10
  export var getDateIsInSchedule = function getDateIsInSchedule(dateTime, scheduleList) {
16
11
  if (!dateTime || !scheduleList || scheduleList.length === 0) {
@@ -65,8 +60,8 @@ var isInStandardSchedule = function isInStandardSchedule(targetDate, targetDateS
65
60
  var startDate = dayjs(schedule.start_time);
66
61
  var endDate = dayjs(schedule.end_time);
67
62
 
68
- // 先检查是否在基础时间范围内(不考虑重复),end 为开区间
69
- var isInBasicRange = targetDate.isSameOrAfter(startDate) && targetDate.isBefore(endDate);
63
+ // 先检查是否在基础时间范围内(不考虑重复)
64
+ var isInBasicRange = targetDate.isSameOrAfter(startDate) && targetDate.isSameOrBefore(endDate);
70
65
  if (schedule.repeat_type === 'none') {
71
66
  return isInBasicRange;
72
67
  }
@@ -80,18 +75,24 @@ var isInTimeSlotsSchedule = function isInTimeSlotsSchedule(targetDate, targetDat
80
75
  if (!schedule.start_time) {
81
76
  return false;
82
77
  }
83
- var scheduleStartDate = dayjs(schedule.start_time.split(' ')[0]);
84
- if (!isDateInTimeSlotsSchedule(targetDate, schedule, scheduleStartDate)) {
78
+ var scheduleDate = schedule.start_time.split(' ')[0];
79
+
80
+ // 检查日期是否匹配
81
+ if (targetDateString !== scheduleDate) {
85
82
  return false;
86
83
  }
84
+
85
+ // 检查是否在任一时间段内
87
86
  var _iterator2 = _createForOfIteratorHelper(schedule.time_slot),
88
87
  _step2;
89
88
  try {
90
89
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
91
90
  var timeSlot = _step2.value;
92
- var slotStart = dayjs("".concat(targetDateString, " ").concat(timeSlot.start_time, ":00"));
93
- var slotEnd = dayjs("".concat(targetDateString, " ").concat(timeSlot.end_time, ":00"));
94
- if (targetDate.isSameOrAfter(slotStart) && targetDate.isBefore(slotEnd)) {
91
+ var slotStart = "".concat(scheduleDate, " ").concat(timeSlot.start_time, ":00");
92
+ var slotEnd = "".concat(scheduleDate, " ").concat(timeSlot.end_time, ":00");
93
+ var slotStartDate = dayjs(slotStart);
94
+ var slotEndDate = dayjs(slotEnd);
95
+ if (targetDate.isSameOrAfter(slotStartDate) && targetDate.isSameOrBefore(slotEndDate)) {
95
96
  return true;
96
97
  }
97
98
  }
@@ -119,7 +120,7 @@ var isInDesignationSchedule = function isInDesignationSchedule(targetDate, targe
119
120
  var endDateTime = "".concat(designation.end_date, " ").concat(designation.end_time, ":00");
120
121
  var startDate = dayjs(startDateTime);
121
122
  var endDate = dayjs(endDateTime);
122
- if (targetDate.isSameOrAfter(startDate) && targetDate.isBefore(endDate)) {
123
+ if (targetDate.isSameOrAfter(startDate) && targetDate.isSameOrBefore(endDate)) {
123
124
  return true;
124
125
  }
125
126
  }
@@ -217,8 +218,9 @@ var isInDailyRepeat = function isInDailyRepeat(targetDate, startDate, endDate, r
217
218
  var startTimeOfDay = startDate.hour() * 3600 + startDate.minute() * 60 + startDate.second();
218
219
  var endTimeOfDay = endDate.hour() * 3600 + endDate.minute() * 60 + endDate.second();
219
220
 
220
- // 每日重复:每天都在相同的时间段内有效 [start, end)
221
- return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay < endTimeOfDay;
221
+ // 每日重复:每天都在相同的时间段内有效
222
+ // 例如:01:00:00 - 16:00:00,每天都是这个时间段
223
+ return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay <= endTimeOfDay;
222
224
  };
223
225
 
224
226
  // 每周重复逻辑
@@ -245,7 +247,7 @@ var isInWeeklyRepeat = function isInWeeklyRepeat(targetDate, startDate, endDate,
245
247
  var targetTimeOfDay = targetDate.hour() * 3600 + targetDate.minute() * 60 + targetDate.second();
246
248
  var startTimeOfDay = startDate.hour() * 3600 + startDate.minute() * 60 + startDate.second();
247
249
  var endTimeOfDay = endDate.hour() * 3600 + endDate.minute() * 60 + endDate.second();
248
- return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay < endTimeOfDay;
250
+ return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay <= endTimeOfDay;
249
251
  };
250
252
 
251
253
  // 日程时间段类型
@@ -46,7 +46,7 @@ export declare const formatScheduleResult: (schedule: ScheduleItem) => {
46
46
  };
47
47
  export declare const calcScheduleDateRange: (schedule: ScheduleItem) => any[];
48
48
  export declare const calcCalendarDataBySchedules: (schedules: ScheduleItem[]) => unknown[];
49
- export declare const calcMinTimeMaxTimeBySchedules: (schedules: ScheduleItem[], scheduleAllMap?: ScheduleAllMap, selectDate?: string) => ScheduleAllMap;
49
+ export declare const calcMinTimeMaxTimeBySchedules: (schedules: ScheduleItem[], scheduleAllMap?: ScheduleAllMap, selectDate?: string) => {};
50
50
  /**
51
51
  * @title: 格式化日程数据
52
52
  * @description:
@@ -6,6 +6,8 @@ export interface ISummaryState {
6
6
  subtotal: string | number;
7
7
  /** 最终总价 */
8
8
  total: string | number;
9
+ /** 最终原始价格 不包含折扣卡商品券折扣 */
10
+ originTotal: string | number;
9
11
  /** 税率标题 */
10
12
  taxTitle?: string;
11
13
  /** 商品总费率 */
@@ -7,8 +7,8 @@ export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[], i
7
7
  * @param item
8
8
  */
9
9
  export declare const getBundleDiscountList: (bundle: any[]) => any[];
10
- export declare const calcDiscountListDifference: (discountList: any[]) => number;
11
- export declare const getProductDiscountProductDiscountDifference: (item: CartItem) => number;
10
+ export declare const calcDiscountListDifference: (discountList: any[]) => any;
11
+ export declare const getProductDiscountProductDiscountDifference: (item: CartItem) => any;
12
12
  /**
13
13
  * 计算订单税费(折扣前/折扣后),并把单品税费信息回写到商品数据上(用于明细展示/后续计算)。
14
14
  *
@@ -58,6 +58,12 @@ export declare const getTax: ({ service, addons, bookingDetail, bookingId }: {
58
58
  * @returns 商品总价字符串,保留2位小数
59
59
  */
60
60
  export declare const calculateSubtotal: (items: CartItem[]) => string;
61
+ /**
62
+ * 计算商品小计(不含其他费用 不包含折扣卡商品券抵扣金额)
63
+ * @param items - 购物车商品数组
64
+ * @returns 商品总价字符串,保留2位小数
65
+ */
66
+ export declare const calculateOriginSubtotal: (items: CartItem[]) => string;
61
67
  /**
62
68
  * @title: 单个商品的税费
63
69
  * @description:
@@ -94,7 +100,7 @@ export declare const calculateDeposit: (items: CartItem[]) => {
94
100
  export declare const getSurchargeAmount: ({ bookingDetail, bookingId }: {
95
101
  bookingDetail?: any;
96
102
  bookingId?: number | undefined;
97
- }, surcharge: any[], options: any) => number;
103
+ }, surcharge: any[], options: any) => any;
98
104
  /**
99
105
  * 订单附加费各项信息
100
106
  *
@@ -20,6 +20,7 @@ import { isNormalProduct } from "../Product/utils";
20
20
  import dayjs from 'dayjs';
21
21
  export var calculatePriceDetails = function calculatePriceDetails(shopInfo, items, isInScheduleByDate, surchargeList, scheduleById) {
22
22
  var subtotal = new Decimal(calculateSubtotal(items));
23
+ var subOriginTotal = new Decimal(calculateOriginSubtotal(items));
23
24
  var totalTaxFee = new Decimal(calculateTaxFee(shopInfo, items));
24
25
  // 订单附加费列表
25
26
  var surcharge = getSurcharge({
@@ -58,11 +59,15 @@ export var calculatePriceDetails = function calculatePriceDetails(shopInfo, item
58
59
  originTax = _getTax.originTax;
59
60
  var total = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subtotal.plus(surchargeAmount) : subtotal.plus(tax).plus(surchargeAmount);
60
61
 
62
+ // 计算总价 不包含折扣卡商品券折扣信息价格
63
+ var originTotal = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subOriginTotal : subOriginTotal.plus(totalTaxFee);
64
+
61
65
  // 计算定金
62
66
  var deposit = calculateDeposit(items);
63
67
  return {
64
68
  subtotal: subtotal.toFixed(2),
65
69
  total: total.toFixed(2),
70
+ originTotal: originTotal.toFixed(2),
66
71
  taxTitle: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_title,
67
72
  taxRate: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_rate,
68
73
  totalTaxFee: tax,
@@ -94,8 +99,8 @@ export var getBundleDiscountList = function getBundleDiscountList(bundle) {
94
99
  export var calcDiscountListDifference = function calcDiscountListDifference(discountList) {
95
100
  return discountList.reduce(function (pre, cur) {
96
101
  var _cur$metadata;
97
- return pre.plus((cur === null || cur === void 0 || (_cur$metadata = cur.metadata) === null || _cur$metadata === void 0 ? void 0 : _cur$metadata.product_discount_difference) || 0);
98
- }, new Decimal(0)).toNumber();
102
+ return pre + ((cur === null || cur === void 0 || (_cur$metadata = cur.metadata) === null || _cur$metadata === void 0 ? void 0 : _cur$metadata.product_discount_difference) || 0);
103
+ }, 0);
99
104
  };
100
105
  export var getProductDiscountProductDiscountDifference = function getProductDiscountProductDiscountDifference(item) {
101
106
  var _item$_origin, _item$_origin2;
@@ -572,6 +577,22 @@ export var calculateSubtotal = function calculateSubtotal(items) {
572
577
  return subtotal.toFixed(2);
573
578
  };
574
579
 
580
+ /**
581
+ * 计算商品小计(不含其他费用 不包含折扣卡商品券抵扣金额)
582
+ * @param items - 购物车商品数组
583
+ * @returns 商品总价字符串,保留2位小数
584
+ */
585
+ export var calculateOriginSubtotal = function calculateOriginSubtotal(items) {
586
+ if (!(items !== null && items !== void 0 && items.length)) {
587
+ return '0.00';
588
+ }
589
+ var subtotal = items.reduce(function (sum, item) {
590
+ var cartItemTotalPrice = new Decimal(item.summaryOriginTotal || 0);
591
+ return sum.plus(cartItemTotalPrice);
592
+ }, new Decimal(0));
593
+ return subtotal.toFixed(2);
594
+ };
595
+
575
596
  /**
576
597
  * @title: 单个商品的税费
577
598
  * @description:
@@ -595,27 +616,6 @@ export var calculateTaxFee = function calculateTaxFee(shopInfo, items) {
595
616
  }, new Decimal(0));
596
617
  return totalTaxFee;
597
618
  };
598
- var getCartItemDepositData = function getCartItemDepositData(item) {
599
- var _target$_productOrigi, _target$_origin, _target$_origin2;
600
- var target = item;
601
- return (target === null || target === void 0 || (_target$_productOrigi = target._productOrigin) === null || _target$_productOrigi === void 0 ? void 0 : _target$_productOrigi.custom_deposit_data) || (target === null || target === void 0 || (_target$_origin = target._origin) === null || _target$_origin === void 0 ? void 0 : _target$_origin.custom_deposit_data) || (target === null || target === void 0 || (_target$_origin2 = target._origin) === null || _target$_origin2 === void 0 || (_target$_origin2 = _target$_origin2.product) === null || _target$_origin2 === void 0 ? void 0 : _target$_origin2.custom_deposit_data);
602
- };
603
- var getCartItemQuantity = function getCartItemQuantity(item) {
604
- return new Decimal((item === null || item === void 0 ? void 0 : item.num) || 1);
605
- };
606
- var calculateCartItemDepositTotal = function calculateCartItemDepositTotal(item) {
607
- var _item$deposit;
608
- var depositData = getCartItemDepositData(item);
609
- if ((depositData === null || depositData === void 0 ? void 0 : depositData.has_deposit) == 1 && typeof (depositData === null || depositData === void 0 ? void 0 : depositData.deposit_fixed) === 'string' && typeof (depositData === null || depositData === void 0 ? void 0 : depositData.deposit_percentage) === 'string') {
610
- var _ref7, _summaryTotal;
611
- var lineTotal = new Decimal((_ref7 = (_summaryTotal = item.summaryTotal) !== null && _summaryTotal !== void 0 ? _summaryTotal : item.total) !== null && _ref7 !== void 0 ? _ref7 : 0);
612
- var quantity = getCartItemQuantity(item);
613
- var fixedTotal = new Decimal(depositData.deposit_fixed || 0).times(quantity);
614
- var percentageTotal = new Decimal(depositData.deposit_percentage || 0).times(lineTotal);
615
- return fixedTotal.plus(percentageTotal);
616
- }
617
- return new Decimal((item === null || item === void 0 || (_item$deposit = item.deposit) === null || _item$deposit === void 0 ? void 0 : _item$deposit.total) || 0);
618
- };
619
619
 
620
620
  /**
621
621
  * @title: 计算定金
@@ -630,9 +630,9 @@ export var calculateDeposit = function calculateDeposit(items) {
630
630
  var hasDeposit = false;
631
631
  var total = items.reduce(function (sum, item) {
632
632
  if (item !== null && item !== void 0 && item.deposit) {
633
- var _item$deposit2;
633
+ var _item$deposit, _item$deposit2;
634
634
  hasDeposit = true;
635
- var cartItemTotalPrice = calculateCartItemDepositTotal(item);
635
+ var cartItemTotalPrice = new Decimal((item === null || item === void 0 || (_item$deposit = item.deposit) === null || _item$deposit === void 0 ? void 0 : _item$deposit.total) || 0);
636
636
  // 将协议数据去重合并
637
637
  item === null || item === void 0 || (_item$deposit2 = item.deposit) === null || _item$deposit2 === void 0 || (_item$deposit2 = _item$deposit2.protocols) === null || _item$deposit2 === void 0 || _item$deposit2.forEach(function (protocol) {
638
638
  if (protocols.findIndex(function (p) {
@@ -669,9 +669,9 @@ export var calculateDeposit = function calculateDeposit(items) {
669
669
  * @param options.isEdit 是否处于“编辑中”。`false` 时会优先走后端金额直取逻辑(若存在)
670
670
  * @returns 订单附加费金额(number,金额单位与商品价格一致)
671
671
  */
672
- export var getSurchargeAmount = function getSurchargeAmount(_ref8, surcharge, options) {
673
- var bookingDetail = _ref8.bookingDetail,
674
- bookingId = _ref8.bookingId;
672
+ export var getSurchargeAmount = function getSurchargeAmount(_ref7, surcharge, options) {
673
+ var bookingDetail = _ref7.bookingDetail,
674
+ bookingId = _ref7.bookingId;
675
675
  var isEdit = options.isEdit;
676
676
  // 订单未变更过
677
677
  if (!isEdit) {
@@ -683,8 +683,8 @@ export var getSurchargeAmount = function getSurchargeAmount(_ref8, surcharge, op
683
683
  if (!Array.isArray(surcharge)) return 0;
684
684
  // 新增状态使用 getSurcharge 的返回值进行求和
685
685
  return surcharge.reduce(function (total, item) {
686
- return total.plus(item.value || 0);
687
- }, new Decimal(0)).toNumber();
686
+ return total + (item.value || 0);
687
+ }, 0);
688
688
  };
689
689
 
690
690
  // bundle商品是否是原价
@@ -716,30 +716,20 @@ var getDiscountAmount = function getDiscountAmount(discounts) {
716
716
  * 获取主商品加价减价后的总价 (主商品价格 + 子商品加价减价)
717
717
  */
718
718
  var getMainProductTotal = function getMainProductTotal(item) {
719
- var _ref9, _ref10, _item$main_product_se, _item$metadata, _item$metadata2, _item$metadata3, _item$metadata4;
720
- // 新语义 v2 下 `main_product_selling_price` / `metadata.main_product_selling_price`
721
- // 已经是"含 option、含主商品折扣"的主价,直接作为主商品基准,无需再减折扣或加 option。
722
- // 仅需叠加 markup / markdown 类 bundle(原价 bundle 的税费单独处理)。
723
- var total = new Decimal((_ref9 = (_ref10 = (_item$main_product_se = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se !== void 0 ? _item$main_product_se : item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.main_product_selling_price) !== null && _ref10 !== void 0 ? _ref10 : item === null || item === void 0 || (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.main_product_original_price) !== null && _ref9 !== void 0 ? _ref9 : 0);
724
-
725
- // 做个兜底 如果新语义价格字段都没有,则切换回老逻辑
726
- var hasMainProductPrice = (item === null || item === void 0 ? void 0 : item.main_product_selling_price) != null || (item === null || item === void 0 || (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.main_product_selling_price) != null || (item === null || item === void 0 || (_item$metadata4 = item.metadata) === null || _item$metadata4 === void 0 ? void 0 : _item$metadata4.main_product_original_price) != null;
727
- if (!hasMainProductPrice) {
728
- var _ref11, _ref12, _item$main_product_se2, _item$metadata5, _item$_origin3, _item$_originData;
729
- total = new Decimal((_ref11 = (_ref12 = (_item$main_product_se2 = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se2 !== void 0 ? _item$main_product_se2 : item === null || item === void 0 || (_item$metadata5 = item.metadata) === null || _item$metadata5 === void 0 ? void 0 : _item$metadata5.main_product_selling_price) !== null && _ref12 !== void 0 ? _ref12 : item.price) !== null && _ref11 !== void 0 ? _ref11 : 0);
730
- var discount = (item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.discount_list) || (item === null || item === void 0 || (_item$_originData = item._originData) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.product) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.discount_list) === null || _item$_originData === void 0 ? void 0 : _item$_originData.filter(function (item) {
731
- var _item$metadata6;
732
- return !(item !== null && item !== void 0 && (_item$metadata6 = item.metadata) !== null && _item$metadata6 !== void 0 && _item$metadata6.custom_product_bundle_map_id);
733
- })) || [];
734
- var mainProductDiscountAmount = getDiscountAmount(discount);
735
- total = total.minus(mainProductDiscountAmount);
736
-
737
- // 单规格
738
- if (item !== null && item !== void 0 && item.option && Array.isArray(item === null || item === void 0 ? void 0 : item.option)) {
739
- total = total.add(item === null || item === void 0 ? void 0 : item.option.reduce(function (t, option) {
740
- return t.add(new Decimal(option.price || 0).mul(option.num || 1));
741
- }, new Decimal(0)));
742
- }
719
+ var _ref8, _ref9, _item$main_product_se, _item$metadata, _item$_origin3, _item$_originData;
720
+ var total = new Decimal((_ref8 = (_ref9 = (_item$main_product_se = item === null || item === void 0 ? void 0 : item.main_product_selling_price) !== null && _item$main_product_se !== void 0 ? _item$main_product_se : item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.main_product_selling_price) !== null && _ref9 !== void 0 ? _ref9 : item.price) !== null && _ref8 !== void 0 ? _ref8 : 0);
721
+ var discount = (item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.discount_list) || (item === null || item === void 0 || (_item$_originData = item._originData) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.product) === null || _item$_originData === void 0 || (_item$_originData = _item$_originData.discount_list) === null || _item$_originData === void 0 ? void 0 : _item$_originData.filter(function (item) {
722
+ var _item$metadata2;
723
+ return !(item !== null && item !== void 0 && (_item$metadata2 = item.metadata) !== null && _item$metadata2 !== void 0 && _item$metadata2.custom_product_bundle_map_id);
724
+ })) || [];
725
+ var mainProductDiscountAmount = getDiscountAmount(discount);
726
+ total = total.minus(mainProductDiscountAmount);
727
+
728
+ // 单规格
729
+ if (item !== null && item !== void 0 && item.option && Array.isArray(item === null || item === void 0 ? void 0 : item.option)) {
730
+ total = total.add(item === null || item === void 0 ? void 0 : item.option.reduce(function (t, option) {
731
+ return t.add(new Decimal(option.price || 0).mul(option.num || 1));
732
+ }, new Decimal(0)));
743
733
  }
744
734
  var _iterator4 = _createForOfIteratorHelper((item === null || item === void 0 ? void 0 : item.bundle) || []),
745
735
  _step4;
@@ -747,9 +737,9 @@ var getMainProductTotal = function getMainProductTotal(item) {
747
737
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
748
738
  var bundleItem = _step4.value;
749
739
  if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
750
- var _ref13, _bundleItem$bundle_se2;
751
- // IMPORTANT: 套餐子商品如果应用了 discount,bundle_selling_price 和 price 其实都已经是折后价格了,不需要单独再减一次
752
- var bundleItemTotal = new Decimal((_ref13 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref13 !== void 0 ? _ref13 : 0);
740
+ var _ref10, _bundleItem$bundle_se2;
741
+ // IMPORTANT: 套餐子商品如果应用了 discount,bundle_selling_price和 price 其实都已经是折后价格了,不需要单独再减一次
742
+ var bundleItemTotal = new Decimal((_ref10 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref10 !== void 0 ? _ref10 : 0);
753
743
  total = total.add(bundleItemTotal);
754
744
  }
755
745
  }
@@ -869,12 +859,12 @@ var isProductMatchSurchargeCondition = function isProductMatchSurchargeCondition
869
859
  * @param options.scheduleById schedule 映射表:`{ [scheduleId]: schedule }`(用于根据配置的 `available_schedule_ids` 做日程匹配)
870
860
  * @returns 附加费列表(仅返回金额 > 0 的项)
871
861
  */
872
- export var getSurcharge = function getSurcharge(_ref14, options) {
862
+ export var getSurcharge = function getSurcharge(_ref11, options) {
873
863
  var _service$filter;
874
- var service = _ref14.service,
875
- addons = _ref14.addons,
876
- bookingDetail = _ref14.bookingDetail,
877
- bookingId = _ref14.bookingId;
864
+ var service = _ref11.service,
865
+ addons = _ref11.addons,
866
+ bookingDetail = _ref11.bookingDetail,
867
+ bookingId = _ref11.bookingId;
878
868
  var isEdit = options.isEdit,
879
869
  isInScheduleByDate = options.isInScheduleByDate,
880
870
  surcharge_list = options.surcharge_list,
@@ -996,11 +986,11 @@ export var getSurcharge = function getSurcharge(_ref14, options) {
996
986
  scheduleById: scheduleById || {},
997
987
  isInScheduleByDate: isInScheduleByDate
998
988
  })) {
999
- var _ref15, _bundleItem$bundle_se3;
989
+ var _ref12, _bundleItem$bundle_se3;
1000
990
  var _mainQuantity = item.num || 1;
1001
991
  matchedItems.push({
1002
992
  isMain: false,
1003
- total: Number((_ref15 = (_bundleItem$bundle_se3 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se3 !== void 0 ? _bundleItem$bundle_se3 : bundleItem.price) !== null && _ref15 !== void 0 ? _ref15 : 0),
993
+ total: Number((_ref12 = (_bundleItem$bundle_se3 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se3 !== void 0 ? _bundleItem$bundle_se3 : bundleItem.price) !== null && _ref12 !== void 0 ? _ref12 : 0),
1004
994
  quantity: bundleItem.num || bundleItem.quantity || 1,
1005
995
  item: bundleItem,
1006
996
  mainQuantity: _mainQuantity // 子商品的mainQuantity是所属主商品的quantity
@@ -1216,9 +1206,9 @@ export var getSurcharge = function getSurcharge(_ref14, options) {
1216
1206
  }
1217
1207
  return surchargeWithAmount;
1218
1208
  };
1219
- function resetItemsSurchargeSideEffects(_ref16) {
1220
- var service = _ref16.service,
1221
- addons = _ref16.addons;
1209
+ function resetItemsSurchargeSideEffects(_ref13) {
1210
+ var service = _ref13.service,
1211
+ addons = _ref13.addons;
1222
1212
  var resetItem = function resetItem(item) {
1223
1213
  if (!item) return;
1224
1214
  item.surcharge_fee = 0;
@@ -11,8 +11,4 @@ export * from './Payment';
11
11
  export * from './Resource';
12
12
  export * from './Step';
13
13
  export * from './Summary';
14
- export * from './SalesSummary';
15
14
  export * from './Schedule';
16
- export * from './Quotation';
17
- export * from './ScanOrderLogger';
18
- export * from './OpenData';
@@ -11,8 +11,4 @@ export * from "./Payment";
11
11
  export * from "./Resource";
12
12
  export * from "./Step";
13
13
  export * from "./Summary";
14
- export * from "./SalesSummary";
15
- export * from "./Schedule";
16
- export * from "./Quotation";
17
- export * from "./ScanOrderLogger";
18
- export * from "./OpenData";
14
+ export * from "./Schedule";
@@ -1,3 +1,4 @@
1
+ import { WalletPassEvaluator } from '../model';
1
2
  import { Plugin } from '../types';
2
3
  /**
3
4
  * WindowPlugin 接口定义
@@ -14,6 +15,7 @@ export interface WindowPlugin extends Plugin {
14
15
  document: Partial<Document>;
15
16
  history: History;
16
17
  interaction?: any;
18
+ getWalletPassEvaluator?: () => WalletPassEvaluator;
17
19
  }
18
20
  /**
19
21
  * 简单的 Storage 接口实现
@@ -144,6 +144,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
144
144
  getSummary(): Promise<{
145
145
  subtotal: string | number;
146
146
  total: string | number;
147
+ originTotal: string | number;
147
148
  taxTitle?: string | undefined;
148
149
  totalTaxFee?: string | number | undefined;
149
150
  isPriceIncludeTax?: 0 | 1 | undefined;
@@ -301,7 +302,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
301
302
  autoSelectAllProductResources(resources_code: string, timeSlots?: TimeSliceItem): {
302
303
  errorList: any[];
303
304
  };
304
- getTimeSlotByAllResources(resources_code: string, split?: number): any[];
305
+ getTimeSlotByAllResources(resources_code: string): any[];
305
306
  getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
306
307
  resources_code: string;
307
308
  startDate: string;
@@ -310,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
310
311
  date: string;
311
312
  status: string;
312
313
  week: string;
313
- weekNum: 0 | 2 | 1 | 5 | 4 | 3 | 6;
314
+ weekNum: 0 | 1 | 2 | 5 | 3 | 4 | 6;
314
315
  }[]>;
315
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
316
317
  private getScheduleDataByIds;