@pisell/private-materials 6.11.55 → 6.11.57

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 (33) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +1 -1
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +1 -1
  9. package/es/components/booking/components/footer/amount.js +5 -0
  10. package/es/components/booking/hooks/usePromotion.js +4 -2
  11. package/es/components/checkout/PaymentModal.js +6 -11
  12. package/es/components/list/hooks/useListState.js +3 -15
  13. package/es/components/shoppingCart/components/Cart/Product.js +8 -3
  14. package/es/components/shoppingCart/components/Cart/index.js +35 -16
  15. package/es/components/shoppingCart/components/Cart/index.less +3 -2
  16. package/es/components/shoppingCart/hooks/usePromotionModal.js +1 -1
  17. package/es/components/shoppingCart/type.d.ts +1 -0
  18. package/es/components/shoppingCart/utils.js +4 -1
  19. package/es/components/ticketBooking/components/ticketBooking/index.less +1 -0
  20. package/es/components/ticketBooking/hooks/pisellos/useProducts.js +1 -18
  21. package/lib/components/booking/components/footer/amount.js +5 -0
  22. package/lib/components/booking/hooks/usePromotion.js +3 -3
  23. package/lib/components/checkout/PaymentModal.js +1 -4
  24. package/lib/components/list/hooks/useListState.js +0 -9
  25. package/lib/components/shoppingCart/components/Cart/Product.js +4 -3
  26. package/lib/components/shoppingCart/components/Cart/index.js +42 -40
  27. package/lib/components/shoppingCart/components/Cart/index.less +3 -2
  28. package/lib/components/shoppingCart/hooks/usePromotionModal.js +1 -1
  29. package/lib/components/shoppingCart/type.d.ts +1 -0
  30. package/lib/components/shoppingCart/utils.js +3 -1
  31. package/lib/components/ticketBooking/components/ticketBooking/index.less +1 -0
  32. package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +1 -17
  33. package/package.json +3 -3
@@ -374,7 +374,7 @@ var usePromotionModal = (options) => {
374
374
  try {
375
375
  const selectedIds = Array.isArray(selected) ? selected.map((item) => (item == null ? void 0 : item.value) || item) : [selected];
376
376
  const _selectedProduct = (0, import_utils4.findSelectedProductsFromList)(
377
- products,
377
+ productsRef.current,
378
378
  selectedIds
379
379
  );
380
380
  if (!(_selectedProduct == null ? void 0 : _selectedProduct.length)) return;
@@ -54,5 +54,6 @@ export interface ProductProps {
54
54
  isAdd?: boolean;
55
55
  openPromotionModal?: (products: any[]) => void;
56
56
  promotionProducts?: any[];
57
+ isShowPromotionAlert?: boolean;
57
58
  }
58
59
  export {};
@@ -338,7 +338,9 @@ var updateProductInList = (props) => {
338
338
  let _products = (products || []).map((item) => {
339
339
  if (item.id === productId) {
340
340
  return {
341
- ...cacheItem
341
+ ...cacheItem,
342
+ // 增加初始价格,用于赠品处理
343
+ _initPrice: item == null ? void 0 : item._initPrice
342
344
  };
343
345
  }
344
346
  return item;
@@ -20,6 +20,7 @@
20
20
  padding-top: 10px;
21
21
  display: flex;
22
22
  flex-direction: column;
23
+ position: relative;
23
24
 
24
25
  .pisell-lowcode__booking-service-wrap {
25
26
  flex: 1;
@@ -39,7 +39,6 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
39
39
  var import_dayjs = __toESM(require("dayjs"));
40
40
  var import_useLogger = __toESM(require("../../../../hooks/useLogger"));
41
41
  var import_usePromotion = __toESM(require("../../../booking/hooks/usePromotion"));
42
- var import_utils = require("@pisell/utils");
43
42
  var useProducts = (notAvailableRef) => {
44
43
  var _a;
45
44
  const bookingTicket = (0, import_bookingTicket.useBookingTicket)();
@@ -52,7 +51,6 @@ var useProducts = (notAvailableRef) => {
52
51
  const { getApp } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
53
52
  const logger = (0, import_useLogger.default)();
54
53
  const { formatProductList } = (0, import_usePromotion.default)();
55
- const useCurrentId = (0, import_react.useRef)((0, import_utils.getUniqueId)());
56
54
  const app = getApp();
57
55
  const [scheduleTimePoints, setScheduleTimePoints] = (0, import_react.useState)([]);
58
56
  const scheduledTaskQueueIdRef = (0, import_react.useRef)("booking-schedule-products");
@@ -68,16 +66,7 @@ var useProducts = (notAvailableRef) => {
68
66
  params
69
67
  }
70
68
  });
71
- const products2 = await bookingTicket.loadProducts(params, {
72
- callback: (res) => {
73
- var _a3, _b;
74
- console.log(res, "1234321");
75
- if ((_a3 = res == null ? void 0 : res.data) == null ? void 0 : _a3.list) {
76
- setProducts(formatProductList((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.list));
77
- }
78
- },
79
- subscriberId: useCurrentId
80
- });
69
+ const products2 = await bookingTicket.loadProducts(params);
81
70
  logger.addLog({
82
71
  title: "useProducts: getProducts 返回",
83
72
  metadata: {
@@ -101,11 +90,6 @@ var useProducts = (notAvailableRef) => {
101
90
  isFirstLoadRef.current = false;
102
91
  }
103
92
  });
104
- (0, import_react.useEffect)(() => {
105
- return () => {
106
- bookingTicket.unsubscribeProductQuery(useCurrentId);
107
- };
108
- }, []);
109
93
  (0, import_react.useEffect)(() => {
110
94
  var _a2, _b, _c;
111
95
  if (platform === "shop") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.11.55",
3
+ "version": "6.11.57",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -67,10 +67,10 @@
67
67
  "react-infinite-scroll-component": "^6.1.0",
68
68
  "react-resizable": "^3.0.5",
69
69
  "styled-components": "^6.0.0-rc.3",
70
- "@pisell/utils": "3.0.2",
71
70
  "@pisell/materials": "6.11.17",
72
71
  "@pisell/icon": "0.0.11",
73
- "@pisell/date-picker": "3.0.8"
72
+ "@pisell/date-picker": "3.0.8",
73
+ "@pisell/utils": "3.0.2"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "react": "^18.0.0",