@pisell/pisellos 2.1.172 → 2.1.174

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 (238) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/apis/picoding.js +1 -0
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +0 -1
  5. package/dist/model/strategy/adapter/promotion/evaluator.js +26 -99
  6. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  7. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -2
  8. package/dist/model/strategy/adapter/walletPass/evaluator.js +12 -63
  9. package/dist/model/strategy/adapter/walletPass/locales.js +3 -12
  10. package/dist/model/strategy/engine.d.ts +5 -18
  11. package/dist/model/strategy/engine.js +45 -145
  12. package/dist/model/strategy/type.d.ts +0 -17
  13. package/dist/model/strategy/type.js +0 -4
  14. package/dist/modules/Cart/types.d.ts +0 -2
  15. package/dist/modules/Cart/utils/cartProduct.js +25 -56
  16. package/dist/modules/Cart/utils/changePrice.js +16 -9
  17. package/dist/modules/Discount/availability.d.ts +7 -0
  18. package/dist/modules/Discount/availability.js +52 -0
  19. package/dist/modules/Discount/entitlementPass.d.ts +34 -0
  20. package/dist/modules/Discount/entitlementPass.js +147 -0
  21. package/dist/modules/Discount/entitlementState.d.ts +8 -0
  22. package/dist/modules/Discount/entitlementState.js +205 -0
  23. package/dist/modules/Discount/index.d.ts +12 -3
  24. package/dist/modules/Discount/index.js +211 -17
  25. package/dist/modules/Discount/types.d.ts +42 -22
  26. package/dist/modules/Holder/index.d.ts +48 -0
  27. package/dist/modules/Holder/index.js +640 -0
  28. package/dist/modules/Holder/types.d.ts +123 -0
  29. package/dist/modules/Holder/types.js +1 -0
  30. package/dist/modules/Holder/utils.d.ts +13 -0
  31. package/dist/modules/Holder/utils.js +34 -0
  32. package/dist/modules/OpenData/index.d.ts +24 -0
  33. package/dist/modules/OpenData/index.js +173 -0
  34. package/dist/modules/OpenData/types.d.ts +73 -0
  35. package/dist/modules/OpenData/types.js +1 -0
  36. package/dist/modules/OpenData/utils.d.ts +2 -0
  37. package/dist/modules/OpenData/utils.js +75 -0
  38. package/dist/modules/Order/index.d.ts +67 -1
  39. package/dist/modules/Order/index.js +923 -30
  40. package/dist/modules/Order/types.d.ts +176 -12
  41. package/dist/modules/Order/types.js +2 -0
  42. package/dist/modules/Order/utils.d.ts +128 -0
  43. package/dist/modules/Order/utils.js +621 -5
  44. package/dist/modules/Payment/index.d.ts +1 -2
  45. package/dist/modules/Payment/index.js +7 -10
  46. package/dist/modules/Payment/utils.js +0 -3
  47. package/dist/modules/Payment/walletpass.d.ts +0 -23
  48. package/dist/modules/Payment/walletpass.js +95 -191
  49. package/dist/modules/Product/types.d.ts +7 -0
  50. package/dist/modules/Product/utils.js +2 -2
  51. package/dist/modules/ProductList/index.d.ts +1 -1
  52. package/dist/modules/ProductList/index.js +4 -3
  53. package/dist/modules/Quotation/index.d.ts +48 -0
  54. package/dist/modules/Quotation/index.js +248 -0
  55. package/dist/modules/Quotation/types.d.ts +42 -0
  56. package/dist/modules/Quotation/types.js +1 -0
  57. package/dist/modules/Rules/entitlementLines.d.ts +8 -0
  58. package/dist/modules/Rules/entitlementLines.js +157 -0
  59. package/dist/modules/Rules/index.d.ts +17 -11
  60. package/dist/modules/Rules/index.js +495 -726
  61. package/dist/modules/Rules/types.d.ts +2 -4
  62. package/dist/modules/SalesSummary/index.d.ts +63 -0
  63. package/dist/modules/SalesSummary/index.js +174 -0
  64. package/dist/modules/SalesSummary/types.d.ts +60 -0
  65. package/dist/modules/SalesSummary/types.js +1 -0
  66. package/dist/modules/SalesSummary/utils.d.ts +30 -0
  67. package/dist/modules/SalesSummary/utils.js +480 -0
  68. package/dist/modules/ScanOrderLogger/index.d.ts +23 -0
  69. package/dist/modules/ScanOrderLogger/index.js +174 -0
  70. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  71. package/dist/modules/ScanOrderLogger/providers/feishu.js +221 -0
  72. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  73. package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
  74. package/dist/modules/ScanOrderLogger/types.d.ts +53 -0
  75. package/dist/modules/ScanOrderLogger/types.js +1 -0
  76. package/dist/modules/Schedule/getDateIsInSchedule.js +11 -18
  77. package/dist/modules/Schedule/utils.d.ts +1 -1
  78. package/dist/modules/Summary/types.d.ts +0 -2
  79. package/dist/modules/Summary/utils.d.ts +3 -9
  80. package/dist/modules/Summary/utils.js +67 -57
  81. package/dist/modules/index.d.ts +5 -0
  82. package/dist/modules/index.js +6 -1
  83. package/dist/plugins/window.d.ts +3 -2
  84. package/dist/solution/BookingByStep/index.d.ts +17 -3
  85. package/dist/solution/BookingByStep/index.js +322 -247
  86. package/dist/solution/BookingByStep/types.d.ts +4 -1
  87. package/dist/solution/BookingByStep/types.js +7 -1
  88. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  89. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  90. package/dist/solution/Checkout/index.js +0 -2
  91. package/dist/solution/ScanOrder/index.d.ts +158 -0
  92. package/dist/solution/ScanOrder/index.js +3474 -0
  93. package/dist/solution/ScanOrder/types.d.ts +307 -0
  94. package/dist/solution/ScanOrder/types.js +35 -0
  95. package/dist/solution/ScanOrder/utils.d.ts +172 -0
  96. package/dist/solution/ScanOrder/utils.js +796 -0
  97. package/dist/solution/ShopDiscount/index.d.ts +6 -2
  98. package/dist/solution/ShopDiscount/index.js +194 -110
  99. package/dist/solution/ShopDiscount/types.d.ts +1 -1
  100. package/dist/solution/ShopDiscount/types.js +1 -2
  101. package/dist/solution/ShopDiscount/utils.d.ts +1 -0
  102. package/dist/solution/ShopDiscount/utils.js +52 -27
  103. package/dist/solution/VenueBooking/index.d.ts +225 -0
  104. package/dist/solution/VenueBooking/index.js +3749 -0
  105. package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  106. package/dist/solution/VenueBooking/types.d.ts +156 -0
  107. package/dist/solution/VenueBooking/types.js +21 -0
  108. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  109. package/dist/solution/VenueBooking/utils/dateSummary.js +104 -0
  110. package/dist/solution/VenueBooking/utils/resource.d.ts +14 -0
  111. package/dist/solution/VenueBooking/utils/resource.js +131 -0
  112. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +38 -0
  113. package/dist/solution/VenueBooking/utils/slotMerge.js +239 -0
  114. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  115. package/dist/solution/VenueBooking/utils/timeSlot.js +453 -0
  116. package/dist/solution/VenueBooking/utils.d.ts +1 -0
  117. package/dist/solution/VenueBooking/utils.js +1 -0
  118. package/dist/solution/index.d.ts +2 -0
  119. package/dist/solution/index.js +3 -1
  120. package/dist/types/index.d.ts +1 -0
  121. package/lib/apis/picoding.d.ts +0 -0
  122. package/lib/apis/picoding.js +0 -0
  123. package/lib/index.d.ts +0 -1
  124. package/lib/index.js +1 -3
  125. package/lib/model/strategy/adapter/promotion/evaluator.js +8 -57
  126. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  127. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -2
  128. package/lib/model/strategy/adapter/walletPass/evaluator.js +7 -36
  129. package/lib/model/strategy/adapter/walletPass/locales.js +3 -12
  130. package/lib/model/strategy/engine.d.ts +5 -18
  131. package/lib/model/strategy/engine.js +21 -85
  132. package/lib/model/strategy/type.d.ts +0 -17
  133. package/lib/modules/Cart/types.d.ts +0 -2
  134. package/lib/modules/Cart/utils/cartProduct.js +12 -39
  135. package/lib/modules/Cart/utils/changePrice.js +13 -9
  136. package/lib/modules/Discount/availability.d.ts +7 -0
  137. package/lib/modules/Discount/availability.js +91 -0
  138. package/lib/modules/Discount/entitlementPass.d.ts +34 -0
  139. package/lib/modules/Discount/entitlementPass.js +184 -0
  140. package/lib/modules/Discount/entitlementState.d.ts +8 -0
  141. package/lib/modules/Discount/entitlementState.js +206 -0
  142. package/lib/modules/Discount/index.d.ts +12 -3
  143. package/lib/modules/Discount/index.js +123 -12
  144. package/lib/modules/Discount/types.d.ts +42 -22
  145. package/lib/modules/Holder/index.d.ts +48 -0
  146. package/lib/modules/Holder/index.js +402 -0
  147. package/lib/modules/Holder/types.d.ts +123 -0
  148. package/lib/modules/Holder/types.js +17 -0
  149. package/lib/modules/Holder/utils.d.ts +13 -0
  150. package/lib/modules/Holder/utils.js +71 -0
  151. package/lib/modules/OpenData/index.d.ts +24 -0
  152. package/lib/modules/OpenData/index.js +119 -0
  153. package/lib/modules/OpenData/types.d.ts +73 -0
  154. package/lib/modules/OpenData/types.js +17 -0
  155. package/lib/modules/OpenData/utils.d.ts +2 -0
  156. package/lib/modules/OpenData/utils.js +111 -0
  157. package/lib/modules/Order/index.d.ts +67 -1
  158. package/lib/modules/Order/index.js +529 -1
  159. package/lib/modules/Order/types.d.ts +176 -12
  160. package/lib/modules/Order/utils.d.ts +128 -0
  161. package/lib/modules/Order/utils.js +514 -2
  162. package/lib/modules/Payment/index.d.ts +1 -2
  163. package/lib/modules/Payment/index.js +0 -1
  164. package/lib/modules/Payment/utils.js +0 -3
  165. package/lib/modules/Payment/walletpass.d.ts +0 -23
  166. package/lib/modules/Payment/walletpass.js +17 -94
  167. package/lib/modules/Product/types.d.ts +7 -0
  168. package/lib/modules/Product/utils.js +2 -2
  169. package/lib/modules/ProductList/index.d.ts +1 -1
  170. package/lib/modules/ProductList/index.js +5 -4
  171. package/lib/modules/Quotation/index.d.ts +48 -0
  172. package/lib/modules/Quotation/index.js +152 -0
  173. package/lib/modules/Quotation/types.d.ts +42 -0
  174. package/lib/modules/Quotation/types.js +17 -0
  175. package/lib/modules/Rules/entitlementLines.d.ts +8 -0
  176. package/lib/modules/Rules/entitlementLines.js +158 -0
  177. package/lib/modules/Rules/index.d.ts +17 -11
  178. package/lib/modules/Rules/index.js +548 -798
  179. package/lib/modules/Rules/types.d.ts +2 -4
  180. package/lib/modules/SalesSummary/index.d.ts +63 -0
  181. package/lib/modules/SalesSummary/index.js +105 -0
  182. package/lib/modules/SalesSummary/types.d.ts +60 -0
  183. package/lib/modules/SalesSummary/types.js +17 -0
  184. package/lib/modules/SalesSummary/utils.d.ts +30 -0
  185. package/lib/modules/SalesSummary/utils.js +420 -0
  186. package/lib/modules/ScanOrderLogger/index.d.ts +23 -0
  187. package/lib/modules/ScanOrderLogger/index.js +147 -0
  188. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  189. package/lib/modules/ScanOrderLogger/providers/feishu.js +157 -0
  190. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  191. package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
  192. package/lib/modules/ScanOrderLogger/types.d.ts +53 -0
  193. package/lib/modules/ScanOrderLogger/types.js +17 -0
  194. package/lib/modules/Schedule/getDateIsInSchedule.js +9 -11
  195. package/lib/modules/Schedule/utils.d.ts +1 -1
  196. package/lib/modules/Summary/types.d.ts +0 -2
  197. package/lib/modules/Summary/utils.d.ts +3 -9
  198. package/lib/modules/Summary/utils.js +45 -34
  199. package/lib/modules/index.d.ts +5 -0
  200. package/lib/modules/index.js +11 -1
  201. package/lib/plugins/window.d.ts +3 -2
  202. package/lib/solution/BookingByStep/index.d.ts +17 -3
  203. package/lib/solution/BookingByStep/index.js +45 -4
  204. package/lib/solution/BookingByStep/types.d.ts +4 -1
  205. package/lib/solution/BookingByStep/types.js +15 -0
  206. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  207. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  208. package/lib/solution/Checkout/index.js +0 -2
  209. package/lib/solution/ScanOrder/index.d.ts +158 -0
  210. package/lib/solution/ScanOrder/index.js +2135 -0
  211. package/lib/solution/ScanOrder/types.d.ts +307 -0
  212. package/lib/solution/ScanOrder/types.js +36 -0
  213. package/lib/solution/ScanOrder/utils.d.ts +172 -0
  214. package/lib/solution/ScanOrder/utils.js +658 -0
  215. package/lib/solution/ShopDiscount/index.d.ts +6 -2
  216. package/lib/solution/ShopDiscount/index.js +94 -50
  217. package/lib/solution/ShopDiscount/types.d.ts +1 -1
  218. package/lib/solution/ShopDiscount/utils.d.ts +1 -0
  219. package/lib/solution/ShopDiscount/utils.js +48 -11
  220. package/lib/solution/VenueBooking/index.d.ts +225 -0
  221. package/lib/solution/VenueBooking/index.js +2073 -0
  222. package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  223. package/lib/solution/VenueBooking/types.d.ts +156 -0
  224. package/lib/solution/VenueBooking/types.js +44 -0
  225. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  226. package/lib/solution/VenueBooking/utils/dateSummary.js +110 -0
  227. package/lib/solution/VenueBooking/utils/resource.d.ts +14 -0
  228. package/lib/solution/VenueBooking/utils/resource.js +92 -0
  229. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +38 -0
  230. package/lib/solution/VenueBooking/utils/slotMerge.js +237 -0
  231. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  232. package/lib/solution/VenueBooking/utils/timeSlot.js +339 -0
  233. package/lib/solution/VenueBooking/utils.d.ts +1 -0
  234. package/lib/solution/VenueBooking/utils.js +69 -0
  235. package/lib/solution/index.d.ts +2 -0
  236. package/lib/solution/index.js +5 -1
  237. package/lib/types/index.d.ts +1 -0
  238. package/package.json +1 -1
@@ -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) => {};
49
+ export declare const calcMinTimeMaxTimeBySchedules: (schedules: ScheduleItem[], scheduleAllMap?: ScheduleAllMap, selectDate?: string) => ScheduleAllMap;
50
50
  /**
51
51
  * @title: 格式化日程数据
52
52
  * @description:
@@ -6,8 +6,6 @@ export interface ISummaryState {
6
6
  subtotal: string | number;
7
7
  /** 最终总价 */
8
8
  total: string | number;
9
- /** 最终原始价格 不包含折扣卡商品券折扣 */
10
- originTotal: string | number;
11
9
  /** 税率标题 */
12
10
  taxTitle?: string;
13
11
  /** 商品总费率 */
@@ -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[]) => any;
11
- export declare const getProductDiscountProductDiscountDifference: (item: CartItem) => any;
10
+ export declare const calcDiscountListDifference: (discountList: any[]) => number;
11
+ export declare const getProductDiscountProductDiscountDifference: (item: CartItem) => number;
12
12
  /**
13
13
  * 计算订单税费(折扣前/折扣后),并把单品税费信息回写到商品数据上(用于明细展示/后续计算)。
14
14
  *
@@ -58,12 +58,6 @@ 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;
67
61
  /**
68
62
  * @title: 单个商品的税费
69
63
  * @description:
@@ -100,7 +94,7 @@ export declare const calculateDeposit: (items: CartItem[]) => {
100
94
  export declare const getSurchargeAmount: ({ bookingDetail, bookingId }: {
101
95
  bookingDetail?: any;
102
96
  bookingId?: number | undefined;
103
- }, surcharge: any[], options: any) => any;
97
+ }, surcharge: any[], options: any) => number;
104
98
  /**
105
99
  * 订单附加费各项信息
106
100
  *
@@ -20,7 +20,6 @@ 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));
24
23
  var totalTaxFee = new Decimal(calculateTaxFee(shopInfo, items));
25
24
  // 订单附加费列表
26
25
  var surcharge = getSurcharge({
@@ -59,15 +58,11 @@ export var calculatePriceDetails = function calculatePriceDetails(shopInfo, item
59
58
  originTax = _getTax.originTax;
60
59
  var total = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subtotal.plus(surchargeAmount) : subtotal.plus(tax).plus(surchargeAmount);
61
60
 
62
- // 计算总价 不包含折扣卡商品券折扣信息价格
63
- var originTotal = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subOriginTotal : subOriginTotal.plus(totalTaxFee);
64
-
65
61
  // 计算定金
66
62
  var deposit = calculateDeposit(items);
67
63
  return {
68
64
  subtotal: subtotal.toFixed(2),
69
65
  total: total.toFixed(2),
70
- originTotal: originTotal.toFixed(2),
71
66
  taxTitle: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_title,
72
67
  taxRate: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_rate,
73
68
  totalTaxFee: tax,
@@ -99,8 +94,8 @@ export var getBundleDiscountList = function getBundleDiscountList(bundle) {
99
94
  export var calcDiscountListDifference = function calcDiscountListDifference(discountList) {
100
95
  return discountList.reduce(function (pre, cur) {
101
96
  var _cur$metadata;
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);
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();
104
99
  };
105
100
  export var getProductDiscountProductDiscountDifference = function getProductDiscountProductDiscountDifference(item) {
106
101
  var _item$_origin, _item$_origin2;
@@ -577,22 +572,6 @@ export var calculateSubtotal = function calculateSubtotal(items) {
577
572
  return subtotal.toFixed(2);
578
573
  };
579
574
 
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
-
596
575
  /**
597
576
  * @title: 单个商品的税费
598
577
  * @description:
@@ -616,6 +595,27 @@ export var calculateTaxFee = function calculateTaxFee(shopInfo, items) {
616
595
  }, new Decimal(0));
617
596
  return totalTaxFee;
618
597
  };
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$deposit, _item$deposit2;
633
+ var _item$deposit2;
634
634
  hasDeposit = true;
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);
635
+ var cartItemTotalPrice = calculateCartItemDepositTotal(item);
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(_ref7, surcharge, options) {
673
- var bookingDetail = _ref7.bookingDetail,
674
- bookingId = _ref7.bookingId;
672
+ export var getSurchargeAmount = function getSurchargeAmount(_ref8, surcharge, options) {
673
+ var bookingDetail = _ref8.bookingDetail,
674
+ bookingId = _ref8.bookingId;
675
675
  var isEdit = options.isEdit;
676
676
  // 订单未变更过
677
677
  if (!isEdit) {
@@ -683,8 +683,8 @@ export var getSurchargeAmount = function getSurchargeAmount(_ref7, surcharge, op
683
683
  if (!Array.isArray(surcharge)) return 0;
684
684
  // 新增状态使用 getSurcharge 的返回值进行求和
685
685
  return surcharge.reduce(function (total, item) {
686
- return total + (item.value || 0);
687
- }, 0);
686
+ return total.plus(item.value || 0);
687
+ }, new Decimal(0)).toNumber();
688
688
  };
689
689
 
690
690
  // bundle商品是否是原价
@@ -716,20 +716,30 @@ var getDiscountAmount = function getDiscountAmount(discounts) {
716
716
  * 获取主商品加价减价后的总价 (主商品价格 + 子商品加价减价)
717
717
  */
718
718
  var getMainProductTotal = function getMainProductTotal(item) {
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)));
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
+ }
733
743
  }
734
744
  var _iterator4 = _createForOfIteratorHelper((item === null || item === void 0 ? void 0 : item.bundle) || []),
735
745
  _step4;
@@ -737,9 +747,9 @@ var getMainProductTotal = function getMainProductTotal(item) {
737
747
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
738
748
  var bundleItem = _step4.value;
739
749
  if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
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);
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);
743
753
  total = total.add(bundleItemTotal);
744
754
  }
745
755
  }
@@ -859,12 +869,12 @@ var isProductMatchSurchargeCondition = function isProductMatchSurchargeCondition
859
869
  * @param options.scheduleById schedule 映射表:`{ [scheduleId]: schedule }`(用于根据配置的 `available_schedule_ids` 做日程匹配)
860
870
  * @returns 附加费列表(仅返回金额 > 0 的项)
861
871
  */
862
- export var getSurcharge = function getSurcharge(_ref11, options) {
872
+ export var getSurcharge = function getSurcharge(_ref14, options) {
863
873
  var _service$filter;
864
- var service = _ref11.service,
865
- addons = _ref11.addons,
866
- bookingDetail = _ref11.bookingDetail,
867
- bookingId = _ref11.bookingId;
874
+ var service = _ref14.service,
875
+ addons = _ref14.addons,
876
+ bookingDetail = _ref14.bookingDetail,
877
+ bookingId = _ref14.bookingId;
868
878
  var isEdit = options.isEdit,
869
879
  isInScheduleByDate = options.isInScheduleByDate,
870
880
  surcharge_list = options.surcharge_list,
@@ -986,11 +996,11 @@ export var getSurcharge = function getSurcharge(_ref11, options) {
986
996
  scheduleById: scheduleById || {},
987
997
  isInScheduleByDate: isInScheduleByDate
988
998
  })) {
989
- var _ref12, _bundleItem$bundle_se3;
999
+ var _ref15, _bundleItem$bundle_se3;
990
1000
  var _mainQuantity = item.num || 1;
991
1001
  matchedItems.push({
992
1002
  isMain: false,
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),
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),
994
1004
  quantity: bundleItem.num || bundleItem.quantity || 1,
995
1005
  item: bundleItem,
996
1006
  mainQuantity: _mainQuantity // 子商品的mainQuantity是所属主商品的quantity
@@ -1206,9 +1216,9 @@ export var getSurcharge = function getSurcharge(_ref11, options) {
1206
1216
  }
1207
1217
  return surchargeWithAmount;
1208
1218
  };
1209
- function resetItemsSurchargeSideEffects(_ref13) {
1210
- var service = _ref13.service,
1211
- addons = _ref13.addons;
1219
+ function resetItemsSurchargeSideEffects(_ref16) {
1220
+ var service = _ref16.service,
1221
+ addons = _ref16.addons;
1212
1222
  var resetItem = function resetItem(item) {
1213
1223
  if (!item) return;
1214
1224
  item.surcharge_fee = 0;
@@ -11,4 +11,9 @@ export * from './Payment';
11
11
  export * from './Resource';
12
12
  export * from './Step';
13
13
  export * from './Summary';
14
+ export * from './SalesSummary';
14
15
  export * from './Schedule';
16
+ export * from './Quotation';
17
+ export * from './ScanOrderLogger';
18
+ export * from './OpenData';
19
+ export * from './Holder';
@@ -11,4 +11,9 @@ export * from "./Payment";
11
11
  export * from "./Resource";
12
12
  export * from "./Step";
13
13
  export * from "./Summary";
14
- export * from "./Schedule";
14
+ export * from "./SalesSummary";
15
+ export * from "./Schedule";
16
+ export * from "./Quotation";
17
+ export * from "./ScanOrderLogger";
18
+ export * from "./OpenData";
19
+ export * from "./Holder";
@@ -1,5 +1,5 @@
1
- import { WalletPassEvaluator } from '../model';
2
1
  import { Plugin } from '../types';
2
+ import type { WalletPassEvaluator } from '../model/strategy/adapter/walletPass/evaluator';
3
3
  /**
4
4
  * WindowPlugin 接口定义
5
5
  */
@@ -15,7 +15,8 @@ export interface WindowPlugin extends Plugin {
15
15
  document: Partial<Document>;
16
16
  history: History;
17
17
  interaction?: any;
18
- getWalletPassEvaluator?: () => WalletPassEvaluator;
18
+ getWalletPassEvaluator?: () => WalletPassEvaluator | undefined;
19
+ getLocalStorage?: (key: string) => string | null;
19
20
  }
20
21
  /**
21
22
  * 简单的 Storage 接口实现
@@ -10,6 +10,7 @@ import { ITime } from '../../modules/Date/types';
10
10
  import dayjs from 'dayjs';
11
11
  import { LoadScheduleAvailableDateParams } from '../../modules/Schedule/types';
12
12
  import { IHolder, IFetchHolderAccountsParams } from '../../modules/AccountList/types';
13
+ import { IAppendFormRecordParams } from '../../modules/Holder/types';
13
14
  export declare class BookingByStepImpl extends BaseModule implements Module {
14
15
  protected defaultName: string;
15
16
  protected defaultVersion: string;
@@ -126,6 +127,20 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
126
127
  * @param params
127
128
  */
128
129
  fetchHolderAccountsAsync(params: IFetchHolderAccountsParams): Promise<void>;
130
+ /**
131
+ * 获取 holder 表单 map
132
+ */
133
+ getHolderFormMap(): import("../../modules").HolderFormMap;
134
+ /**
135
+ * 登录后或外部触发时,按当前 holderMap 批量刷新所有表单的 records
136
+ */
137
+ refreshAllHolderFormRecords(params?: {
138
+ customer_id?: number;
139
+ }): Promise<import("../../modules").HolderFormMap>;
140
+ /**
141
+ * 添加表单记录
142
+ */
143
+ appendFormRecord(params: IAppendFormRecordParams): import("../../modules").IFormRecord;
129
144
  setDateRange(dateRange: ITime[]): Promise<void>;
130
145
  clearDateRange(): void;
131
146
  getDateRange(): Promise<ITime[]>;
@@ -144,7 +159,6 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
144
159
  getSummary(): Promise<{
145
160
  subtotal: string | number;
146
161
  total: string | number;
147
- originTotal: string | number;
148
162
  taxTitle?: string | undefined;
149
163
  totalTaxFee?: string | number | undefined;
150
164
  isPriceIncludeTax?: 0 | 1 | undefined;
@@ -302,7 +316,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
302
316
  autoSelectAllProductResources(resources_code: string, timeSlots?: TimeSliceItem): {
303
317
  errorList: any[];
304
318
  };
305
- getTimeSlotByAllResources(resources_code: string): any[];
319
+ getTimeSlotByAllResources(resources_code: string, split?: number): any[];
306
320
  getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
307
321
  resources_code: string;
308
322
  startDate: string;
@@ -311,7 +325,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
325
  date: string;
312
326
  status: string;
313
327
  week: string;
314
- weekNum: 0 | 1 | 2 | 5 | 3 | 4 | 6;
328
+ weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
315
329
  }[]>;
316
330
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
331
  private getScheduleDataByIds;