@pisell/private-materials 6.3.139 → 6.3.141

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 (153) 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 +5 -5
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +6 -6
  11. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  12. package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  14. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  16. package/es/components/booking/forms/footer.d.ts +1 -0
  17. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  18. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  19. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  20. package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
  21. package/es/components/ecocup/components/AddCustomerModal/index.d.ts +1 -0
  22. package/es/components/ecocup/components/CupActionList/index.d.ts +1 -0
  23. package/es/components/ecocup/components/CupActionModal/index.d.ts +1 -0
  24. package/es/components/ecocup/components/CupStatusModal/index.d.ts +1 -0
  25. package/es/components/ecocup/components/CustomerAndCupModal/index.d.ts +1 -0
  26. package/es/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
  27. package/es/components/ecocup/components/SearchBar/index.d.ts +1 -0
  28. package/es/components/ecocup/components/SettingModal/index.d.ts +1 -0
  29. package/es/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
  30. package/es/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
  31. package/es/components/ecocup/cupList/index.d.ts +1 -0
  32. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  33. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  34. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  35. package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  36. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  37. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  38. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  39. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  40. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  41. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  42. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  43. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  44. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  45. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  46. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  47. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  48. package/es/components/scanOrder/components/Cart/index.js +127 -56
  49. package/es/components/scanOrder/components/Cart/index.less +11 -5
  50. package/es/components/scanOrder/components/Check/index.js +85 -80
  51. package/es/components/scanOrder/components/Content/index.js +356 -164
  52. package/es/components/scanOrder/components/Menu/index.d.ts +11 -0
  53. package/es/components/scanOrder/components/Menu/index.js +140 -169
  54. package/es/components/scanOrder/components/Voucher/index.d.ts +8 -0
  55. package/es/components/scanOrder/components/Voucher/index.js +250 -0
  56. package/es/components/scanOrder/context.js +38 -13
  57. package/es/components/scanOrder/hooks.js +4 -1
  58. package/es/components/scanOrder/locales.d.ts +65 -0
  59. package/es/components/scanOrder/locales.js +65 -0
  60. package/es/components/scanOrder/types.d.ts +10 -0
  61. package/es/components/scanOrder/utils/toShoppingCartProducts.d.ts +1 -0
  62. package/es/components/scanOrder/utils/toShoppingCartProducts.js +137 -9
  63. package/es/components/scanOrder/utils/transformProductDetail.js +21 -4
  64. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  65. package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  66. package/es/components/venueBooking/components/Addons/index.js +42 -33
  67. package/es/components/venueBooking/components/Cart/index.js +26 -14
  68. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  69. package/es/plus/orderList/components/HandleActions.d.ts +1 -0
  70. package/es/plus/orderList/components/QuickFilter.d.ts +1 -0
  71. package/es/plus/orderList/components/Reset.d.ts +1 -0
  72. package/es/plus/orderList/components/Toolbar.d.ts +1 -0
  73. package/es/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +1 -0
  74. package/es/plus/saasAttendance/settings/components/membersField/index.d.ts +1 -0
  75. package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  76. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
  77. package/es/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
  78. package/es/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
  79. package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
  80. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  81. package/es/pro/pisellPhoneKeyboard/index.d.ts +1 -0
  82. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  83. package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  84. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  85. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  86. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  87. package/lib/components/booking/forms/footer.d.ts +1 -0
  88. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  89. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  90. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  91. package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
  92. package/lib/components/ecocup/components/AddCustomerModal/index.d.ts +1 -0
  93. package/lib/components/ecocup/components/CupActionList/index.d.ts +1 -0
  94. package/lib/components/ecocup/components/CupActionModal/index.d.ts +1 -0
  95. package/lib/components/ecocup/components/CupStatusModal/index.d.ts +1 -0
  96. package/lib/components/ecocup/components/CustomerAndCupModal/index.d.ts +1 -0
  97. package/lib/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
  98. package/lib/components/ecocup/components/SearchBar/index.d.ts +1 -0
  99. package/lib/components/ecocup/components/SettingModal/index.d.ts +1 -0
  100. package/lib/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
  101. package/lib/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
  102. package/lib/components/ecocup/cupList/index.d.ts +1 -0
  103. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  104. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  105. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  106. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  107. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  108. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  109. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  110. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  111. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  112. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  113. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  114. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  115. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  116. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  117. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  118. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  119. package/lib/components/scanOrder/components/Cart/index.js +79 -24
  120. package/lib/components/scanOrder/components/Cart/index.less +11 -5
  121. package/lib/components/scanOrder/components/Check/index.js +28 -23
  122. package/lib/components/scanOrder/components/Content/index.js +136 -42
  123. package/lib/components/scanOrder/components/Menu/index.d.ts +11 -0
  124. package/lib/components/scanOrder/components/Menu/index.js +23 -36
  125. package/lib/components/scanOrder/components/Voucher/index.d.ts +8 -0
  126. package/lib/components/scanOrder/components/Voucher/index.js +162 -0
  127. package/lib/components/scanOrder/context.js +21 -10
  128. package/lib/components/scanOrder/hooks.js +4 -1
  129. package/lib/components/scanOrder/locales.d.ts +65 -0
  130. package/lib/components/scanOrder/locales.js +65 -0
  131. package/lib/components/scanOrder/types.d.ts +10 -0
  132. package/lib/components/scanOrder/utils/toShoppingCartProducts.d.ts +1 -0
  133. package/lib/components/scanOrder/utils/toShoppingCartProducts.js +88 -6
  134. package/lib/components/scanOrder/utils/transformProductDetail.js +10 -3
  135. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  136. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  137. package/lib/components/venueBooking/components/Addons/index.js +15 -8
  138. package/lib/components/venueBooking/components/Cart/index.js +8 -2
  139. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  140. package/lib/plus/orderList/components/HandleActions.d.ts +1 -0
  141. package/lib/plus/orderList/components/QuickFilter.d.ts +1 -0
  142. package/lib/plus/orderList/components/Reset.d.ts +1 -0
  143. package/lib/plus/orderList/components/Toolbar.d.ts +1 -0
  144. package/lib/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +1 -0
  145. package/lib/plus/saasAttendance/settings/components/membersField/index.d.ts +1 -0
  146. package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  147. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
  148. package/lib/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
  149. package/lib/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
  150. package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
  151. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  152. package/lib/pro/pisellPhoneKeyboard/index.d.ts +1 -0
  153. package/package.json +1 -1
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useClearCart: (state: any, dispatch: any) => JSX.Element;
2
3
  export default useClearCart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  export declare const disabledDate: (current: any, position: any, currentDate: any) => any;
3
4
  declare const DateRange: ({ state, dispatch, key }: any) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  export interface InfoProps {
3
4
  title?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface IProps {
3
4
  visible: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ECupActionType, ICup, ICustomer } from '../../types';
2
3
  import './index.less';
3
4
  interface IProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  import { ICustomer, ICup, ECupActionType } from '../../types';
3
4
  interface IProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ECupScanStatus, ICup } from '../../types';
2
3
  import './index.less';
3
4
  interface IProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  import { ICup, ICustomer } from '../../types';
3
4
  interface IProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface MoreDropdownProps {
2
3
  locales: any;
3
4
  onClick?: (key: string) => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface SearchBarProps {
3
4
  scanListenerKey: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface IProps {
3
4
  visible: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../index.less';
2
3
  interface IProps {
3
4
  onClickAction: (type: string, record: any) => void;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import '../index.less';
2
3
  export declare const useSummary: (locales: any, staticsData: any, isPartner?: boolean) => () => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface CupListProps {
3
4
  data: any[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ErrorTip: ({ text }: any) => JSX.Element;
3
4
  export default ErrorTip;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Cart: ({ open, onCancel }: any) => JSX.Element;
3
4
  export default Cart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const EmptyHolderModal: (props: any) => JSX.Element;
3
4
  export default EmptyHolderModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Event: () => JSX.Element;
3
4
  export default Event;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Footer: () => JSX.Element;
3
4
  export default Footer;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const InformationOptionsModal: (props: any) => JSX.Element;
3
4
  export default InformationOptionsModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const OrderProductModal: (props: any) => JSX.Element;
3
4
  export default OrderProductModal;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const RemoveOptionConfirmModal: (props: any) => JSX.Element;
2
3
  export default RemoveOptionConfirmModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Resource: () => JSX.Element;
3
4
  export default Resource;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const WeekItem: (props: any) => JSX.Element;
3
4
  export default WeekItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare type CalenDateWeekProps = {
3
4
  currentDate: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const BookingOptions: (props: {
2
3
  onChangeBookingOption?: ((bookingOption: any) => void) | undefined;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ScheduleTimeItem: ({ timeList }: any) => JSX.Element;
3
4
  export default ScheduleTimeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const SetupForm: ({ onReady, amount, order_id, payment_method, scene, }: any) => JSX.Element;
3
4
  export default SetupForm;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { WalletPassDataType } from '../../../PaymentMethods/WalletPass/serve';
2
3
  import './index.less';
3
4
  interface WalletUseListProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface CustomerListProps {
3
4
  value: any;
@@ -37,9 +37,12 @@ var import_materials = require("@pisell/materials");
37
37
  var import_utils = require("@pisell/utils");
38
38
  var import_shoppingCart = __toESM(require("../../../shoppingCart"));
39
39
  var import_context = require("../../context");
40
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
40
41
  var import_subTotal = __toESM(require("../../../subTotal"));
42
+ var import_Voucher = __toESM(require("../Voucher"));
41
43
  var import_index = require("./index.less");
42
44
  function Cart(props) {
45
+ var _a, _b, _c, _d, _e, _f;
43
46
  const {
44
47
  open,
45
48
  onCancel,
@@ -52,16 +55,24 @@ function Cart(props) {
52
55
  disabled = false
53
56
  } = props;
54
57
  const { runModuleAction, refreshViewModel, scanOrderModule } = (0, import_context.useScanOrderContext)();
58
+ const engineContext = (0, import_useEngineContext.default)();
59
+ const businessUtils = (_b = (_a = engineContext == null ? void 0 : engineContext.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.businessUtils;
60
+ const locale = ((_d = (_c = engineContext == null ? void 0 : engineContext.engine) == null ? void 0 : _c.props) == null ? void 0 : _d.locale) || "en";
61
+ const hasGoodPassApp = !!((_e = businessUtils == null ? void 0 : businessUtils.getAppByModal) == null ? void 0 : _e.call(businessUtils, "goodpass"));
62
+ const hasDiscountCardApp = !!((_f = businessUtils == null ? void 0 : businessUtils.getAppByModal) == null ? void 0 : _f.call(businessUtils, "discountcard"));
63
+ const showVoucher = hasGoodPassApp || hasDiscountCardApp;
55
64
  const isVisible = embedded || open;
56
65
  if (!isVisible) return null;
57
66
  const [dineInConfig, setDineInConfig] = (0, import_react.useState)(null);
58
- const getConfig = async () => {
67
+ const getConfig = (0, import_react.useCallback)(async () => {
59
68
  const otherParams = await runModuleAction("getOtherParams");
60
69
  console.log("otherParams >>>>> ", otherParams);
61
70
  const dineInConfig2 = (otherParams == null ? void 0 : otherParams.dineInConfig) ?? {};
62
71
  setDineInConfig(dineInConfig2);
63
- };
64
- getConfig();
72
+ }, [runModuleAction]);
73
+ (0, import_react.useEffect)(() => {
74
+ getConfig();
75
+ }, []);
65
76
  const isShowNote = (0, import_react.useMemo)(() => {
66
77
  return dineInConfig == null ? void 0 : dineInConfig["sale.allow_item_notes"];
67
78
  }, [dineInConfig]);
@@ -75,11 +86,11 @@ function Cart(props) {
75
86
  import_utils.locales.getText("pisell2.scan.order.action.confirm.order") || import_utils.locales.getText("pisell2.event.confirm") || "Confirm"
76
87
  );
77
88
  const subTotalList = (0, import_react.useMemo)(() => {
78
- var _a;
89
+ var _a2;
79
90
  const subTotal = Number((summary == null ? void 0 : summary.product_amount) ?? 0);
80
91
  const totalTaxFee = Number((summary == null ? void 0 : summary.tax_fee) ?? 0);
81
92
  const total = Number((summary == null ? void 0 : summary.total_amount) ?? (summary == null ? void 0 : summary.expect_amount) ?? 0);
82
- const tempOrder = (_a = scanOrderModule == null ? void 0 : scanOrderModule.getTempOrder) == null ? void 0 : _a.call(scanOrderModule);
93
+ const tempOrder = (_a2 = scanOrderModule == null ? void 0 : scanOrderModule.getTempOrder) == null ? void 0 : _a2.call(scanOrderModule);
83
94
  const tempSummary = (tempOrder == null ? void 0 : tempOrder.summary) || {};
84
95
  const taxTitle = String(
85
96
  (tempSummary == null ? void 0 : tempSummary.tax_title) || (summary == null ? void 0 : summary.tax_title) || "GST/Tax"
@@ -89,11 +100,21 @@ function Cart(props) {
89
100
  const isPriceIncludeTax = Boolean(
90
101
  (tempSummary == null ? void 0 : tempSummary.is_price_include_tax) ?? (tempSummary == null ? void 0 : tempSummary.isPriceIncludeTax) ?? (summary == null ? void 0 : summary.is_price_include_tax)
91
102
  );
103
+ const surchargeItems = ((summary == null ? void 0 : summary.surcharges) || []).filter((s) => Number(s == null ? void 0 : s.amount) > 0).map((s) => {
104
+ const labelObj = (s == null ? void 0 : s.label) || (s == null ? void 0 : s.name) || {};
105
+ const label = labelObj[locale] || labelObj.en || labelObj.original || (s == null ? void 0 : s.key) || "";
106
+ return {
107
+ key: (s == null ? void 0 : s.key) || `surcharge_${s == null ? void 0 : s.surcharge_id}`,
108
+ label,
109
+ value: Number(s == null ? void 0 : s.amount)
110
+ };
111
+ });
92
112
  return [
93
113
  {
94
114
  key: "sub_total",
95
115
  value: Number.isNaN(subTotal) ? 0 : subTotal
96
116
  },
117
+ ...surchargeItems,
97
118
  {
98
119
  key: "tax",
99
120
  value: Number.isNaN(totalTaxFee) ? 0 : totalTaxFee,
@@ -111,25 +132,58 @@ function Cart(props) {
111
132
  bold: true
112
133
  }
113
134
  ];
114
- }, [summary, scanOrderModule]);
135
+ }, [summary, scanOrderModule, locale]);
115
136
  const handleCartChange = async (item, type) => {
116
- if (type !== "delete") return;
117
- const productId = (item == null ? void 0 : item.product_id) ?? (item == null ? void 0 : item.id) ?? null;
118
- const productVariantId = Number((item == null ? void 0 : item.product_variant_id) ?? 0);
119
- const identityKey = (item == null ? void 0 : item.identity_key) || (item == null ? void 0 : item.rowKey) || void 0;
120
- if (productId === null && Number.isNaN(productVariantId)) return;
121
- try {
122
- await runModuleAction("removeProductFromOrder", {
137
+ if (type === "note") {
138
+ const productId = (item == null ? void 0 : item.product_id) ?? (item == null ? void 0 : item.id) ?? null;
139
+ const productVariantId = Number((item == null ? void 0 : item.product_variant_id) ?? 0);
140
+ const identityKey = item == null ? void 0 : item.identity_key;
141
+ if (productId === null && Number.isNaN(productVariantId)) return;
142
+ const identity = {
123
143
  product_id: productId,
124
- product_variant_id: Number.isNaN(productVariantId) ? 0 : productVariantId,
125
- identity_key: identityKey
126
- });
127
- await refreshViewModel();
128
- } catch (error) {
129
- console.error("[scanOrder] removeProductFromOrder failed", {
130
- error,
131
- item
132
- });
144
+ product_variant_id: Number.isNaN(productVariantId) ? 0 : productVariantId
145
+ };
146
+ if (typeof identityKey === "string" && identityKey.length > 0) {
147
+ identity.identity_key = identityKey;
148
+ }
149
+ try {
150
+ await runModuleAction(
151
+ "setOrderProductLineNote",
152
+ identity,
153
+ String((item == null ? void 0 : item.note) ?? "")
154
+ );
155
+ await refreshViewModel();
156
+ } catch (error) {
157
+ console.error("[scanOrder] setOrderProductLineNote failed", {
158
+ error,
159
+ item
160
+ });
161
+ }
162
+ return;
163
+ } else if (type === "delete") {
164
+ const productId = (item == null ? void 0 : item.product_id) ?? (item == null ? void 0 : item.id) ?? null;
165
+ const productVariantId = Number((item == null ? void 0 : item.product_variant_id) ?? 0);
166
+ const identityKey = item == null ? void 0 : item.identity_key;
167
+ if (productId === null && Number.isNaN(productVariantId)) return;
168
+ if (typeof identityKey !== "string" || identityKey.length === 0) {
169
+ console.error("[scanOrder] removeProductFromOrder skipped: missing identity_key", {
170
+ item
171
+ });
172
+ return;
173
+ }
174
+ try {
175
+ await runModuleAction("removeProductFromOrder", {
176
+ product_id: productId,
177
+ product_variant_id: Number.isNaN(productVariantId) ? 0 : productVariantId,
178
+ identity_key: identityKey
179
+ });
180
+ await refreshViewModel();
181
+ } catch (error) {
182
+ console.error("[scanOrder] removeProductFromOrder failed", {
183
+ error,
184
+ item
185
+ });
186
+ }
133
187
  }
134
188
  };
135
189
  (0, import_react.useEffect)(() => {
@@ -157,8 +211,9 @@ function Cart(props) {
157
211
  onChange: handleCartChange
158
212
  }
159
213
  );
160
- const cartSubtotalSection = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_subTotal.default, { list: subTotalList, style: { padding: 0 } }), extraContent ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-cart-extra-content" }, extraContent) : null);
161
- const cartBodyContent = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-cart-body" }, cartLineItems, cartSubtotalSection);
214
+ const cartSubtotalSection = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, showVoucher ? /* @__PURE__ */ import_react.default.createElement(import_Voucher.default, null) : null, /* @__PURE__ */ import_react.default.createElement(import_subTotal.default, { list: subTotalList, style: { padding: 0 } }), extraContent ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-cart-extra-content" }, extraContent) : null);
215
+ const cartBodyClassName = embedded ? "pisell-scan-order-cart-body pisell-scan-order-cart-body-embedded" : "pisell-scan-order-cart-body";
216
+ const cartBodyContent = /* @__PURE__ */ import_react.default.createElement("div", { className: cartBodyClassName }, cartLineItems, cartSubtotalSection);
162
217
  if (embedded) {
163
218
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, cartBodyContent, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-cart-embedded-footer" }, /* @__PURE__ */ import_react.default.createElement(
164
219
  import_materials.Button,
@@ -118,16 +118,22 @@
118
118
  cursor: not-allowed;
119
119
  }
120
120
 
121
+ /* 移动端:结算内嵌卡 — 与 pisell-scan-order-content-mobile-wrap 的底部留白配合;
122
+ * 不再在 cart-body 上重复 96px,否则与外层叠加会出现大块空白,sticky 在整页滚动时也会与内容同步位移 */
121
123
  .pisell-scan-order-content-mobile-wrap {
122
- .pisell-scan-order-cart-body {
123
- padding-bottom: 96px;
124
+ .pisell-scan-order-cart-body-embedded {
125
+ padding-bottom: 16px;
124
126
  }
125
127
 
126
128
  .pisell-scan-order-cart-embedded-footer {
127
- position: sticky;
129
+ position: fixed;
130
+ left: 0;
131
+ right: 0;
128
132
  bottom: 0;
129
- z-index: 5;
130
- padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
133
+ z-index: 28;
134
+ padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
135
+ border-top: 1px solid #eaecf0;
136
+ background: #fff;
131
137
  box-shadow: 0 -4px 10px rgba(16, 24, 40, 0.06);
132
138
  }
133
139
  }
@@ -35,7 +35,6 @@ module.exports = __toCommonJS(Check_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_utils = require("@pisell/utils");
38
- var import_materials = require("@pisell/materials");
39
38
  var import_Cart = __toESM(require("../Cart"));
40
39
  var import_FulfillmentMode = __toESM(require("../FulfillmentMode"));
41
40
  var import_ManualPickupRefModal = __toESM(require("../ManualPickupRefModal"));
@@ -50,13 +49,15 @@ function Check() {
50
49
  const [pickupRefOpen, setPickupRefOpen] = (0, import_react.useState)(false);
51
50
  const utils = (0, import_hooks.contextUtils)();
52
51
  const [dineInConfig, setDineInConfig] = (0, import_react.useState)(null);
53
- const getConfig = async () => {
52
+ const getConfig = (0, import_react.useCallback)(async () => {
54
53
  const otherParams = await runModuleAction("getOtherParams");
55
54
  console.log("otherParams >>>>> ", otherParams);
56
55
  const dineInConfig2 = (otherParams == null ? void 0 : otherParams.dineInConfig) ?? {};
57
56
  setDineInConfig(dineInConfig2);
58
- };
59
- getConfig();
57
+ }, [runModuleAction]);
58
+ (0, import_react.useEffect)(() => {
59
+ getConfig();
60
+ }, []);
60
61
  const isShowOrderNote = (0, import_react.useMemo)(() => {
61
62
  return dineInConfig == null ? void 0 : dineInConfig["sale.allow_order_notes"];
62
63
  }, [dineInConfig]);
@@ -80,41 +81,50 @@ function Check() {
80
81
  () => String(import_utils.locales.getText("pisell2.scan.order.products.title") || "Products"),
81
82
  []
82
83
  );
84
+ const showCheckStepEmptyCartTip = () => {
85
+ import_antd.message.error(import_utils.locales.getText("pisell2.scan.order.check.cart.empty.tip") || "Please go back to add products");
86
+ };
83
87
  const doSubmit = async () => {
84
- var _a, _b, _c, _d, _e, _f, _g;
88
+ var _a, _b, _c, _d, _e, _f, _g, _h;
89
+ const items = (viewModel == null ? void 0 : viewModel.cartItems) || [];
90
+ if (items.length === 0) {
91
+ showCheckStepEmptyCartTip();
92
+ setSubmitting(false);
93
+ return;
94
+ }
85
95
  try {
86
96
  setSubmitting(true);
87
97
  await runModuleAction("updateTempOrderNote", note);
88
98
  const res = await runModuleAction("submitScanOrder");
89
99
  console.log("submitScanOrder >>>>> ", res);
90
100
  clearStepCache();
91
- if (dineInConfig == null ? void 0 : dineInConfig["workflow.require_payment_on_submit"]) {
101
+ if ((dineInConfig == null ? void 0 : dineInConfig["sale.require_payment_on_submit"]) && !isAdditionalOrder) {
102
+ try {
103
+ await runModuleAction("restoreOrder");
104
+ } catch (error) {
105
+ console.warn("[scanOrder] restoreOrder after payment failed", error);
106
+ }
92
107
  utils.action({
93
108
  type: "pisell1.payment",
94
109
  data: {
95
110
  order_id: (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.order_id,
96
- total_amount: (_b = viewModel == null ? void 0 : viewModel.summary) == null ? void 0 : _b.total_amount
111
+ total_amount: ((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.order_wait_pay_amount) || ((_c = viewModel == null ? void 0 : viewModel.summary) == null ? void 0 : _c.total_amount)
97
112
  },
98
113
  callback: async (_e2) => {
99
- try {
100
- await runModuleAction("restoreOrder");
101
- } catch (error) {
102
- console.warn("[scanOrder] restoreOrder after payment failed", error);
103
- }
104
114
  }
105
115
  });
106
116
  } else {
107
- if ((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.order_id) {
117
+ if ((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.order_id) {
108
118
  try {
109
119
  await runModuleAction("restoreOrder");
110
120
  } catch (error) {
111
121
  console.warn("[scanOrder] restoreOrder before redirect failed", error);
112
122
  }
113
- const link = `/order/details?id=${(_d = res == null ? void 0 : res.data) == null ? void 0 : _d.order_id}`;
114
- const app = (_e = utils == null ? void 0 : utils.getApp) == null ? void 0 : _e.call(utils);
115
- if ((_f = app == null ? void 0 : app.history) == null ? void 0 : _f.replace) {
123
+ const link = `/order/details?id=${(_e = res == null ? void 0 : res.data) == null ? void 0 : _e.order_id}`;
124
+ const app = (_f = utils == null ? void 0 : utils.getApp) == null ? void 0 : _f.call(utils);
125
+ if ((_g = app == null ? void 0 : app.history) == null ? void 0 : _g.replace) {
116
126
  app.history.replace(link);
117
- } else if ((_g = app == null ? void 0 : app.history) == null ? void 0 : _g.push) {
127
+ } else if ((_h = app == null ? void 0 : app.history) == null ? void 0 : _h.push) {
118
128
  app.history.push(link);
119
129
  } else {
120
130
  location.replace(link);
@@ -133,12 +143,7 @@ function Check() {
133
143
  if (submitting) return;
134
144
  const cartItems = (viewModel == null ? void 0 : viewModel.cartItems) || [];
135
145
  if (cartItems.length === 0) {
136
- (0, import_materials.PisellToast)({
137
- content: String(
138
- import_utils.locales.getText("pisell2.scan.order.products.empty.tip") || "Please select products"
139
- ),
140
- duration: 2
141
- });
146
+ showCheckStepEmptyCartTip();
142
147
  return;
143
148
  }
144
149
  if (isAdditionalOrder) {