@pisell/private-materials 6.3.139 → 6.3.140

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 (47) 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/scanOrder/components/Cart/index.js +127 -56
  12. package/es/components/scanOrder/components/Cart/index.less +11 -5
  13. package/es/components/scanOrder/components/Check/index.js +85 -80
  14. package/es/components/scanOrder/components/Content/index.js +345 -162
  15. package/es/components/scanOrder/components/Menu/index.d.ts +11 -0
  16. package/es/components/scanOrder/components/Menu/index.js +140 -169
  17. package/es/components/scanOrder/components/Voucher/index.d.ts +8 -0
  18. package/es/components/scanOrder/components/Voucher/index.js +250 -0
  19. package/es/components/scanOrder/context.js +38 -13
  20. package/es/components/scanOrder/hooks.js +4 -1
  21. package/es/components/scanOrder/locales.d.ts +65 -0
  22. package/es/components/scanOrder/locales.js +65 -0
  23. package/es/components/scanOrder/types.d.ts +10 -0
  24. package/es/components/scanOrder/utils/toShoppingCartProducts.d.ts +1 -0
  25. package/es/components/scanOrder/utils/toShoppingCartProducts.js +137 -9
  26. package/es/components/scanOrder/utils/transformProductDetail.js +21 -4
  27. package/es/components/venueBooking/components/Addons/index.js +42 -33
  28. package/es/components/venueBooking/components/Cart/index.js +26 -14
  29. package/lib/components/scanOrder/components/Cart/index.js +79 -24
  30. package/lib/components/scanOrder/components/Cart/index.less +11 -5
  31. package/lib/components/scanOrder/components/Check/index.js +28 -23
  32. package/lib/components/scanOrder/components/Content/index.js +132 -42
  33. package/lib/components/scanOrder/components/Menu/index.d.ts +11 -0
  34. package/lib/components/scanOrder/components/Menu/index.js +23 -36
  35. package/lib/components/scanOrder/components/Voucher/index.d.ts +8 -0
  36. package/lib/components/scanOrder/components/Voucher/index.js +162 -0
  37. package/lib/components/scanOrder/context.js +21 -10
  38. package/lib/components/scanOrder/hooks.js +4 -1
  39. package/lib/components/scanOrder/locales.d.ts +65 -0
  40. package/lib/components/scanOrder/locales.js +65 -0
  41. package/lib/components/scanOrder/types.d.ts +10 -0
  42. package/lib/components/scanOrder/utils/toShoppingCartProducts.d.ts +1 -0
  43. package/lib/components/scanOrder/utils/toShoppingCartProducts.js +88 -6
  44. package/lib/components/scanOrder/utils/transformProductDetail.js +10 -3
  45. package/lib/components/venueBooking/components/Addons/index.js +15 -8
  46. package/lib/components/venueBooking/components/Cart/index.js +8 -2
  47. package/package.json +1 -1
@@ -37,12 +37,11 @@ var import_productSelect = __toESM(require("../../../../plus/productSelect"));
37
37
  var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
38
38
  var import_context = require("../../context");
39
39
  var import_utils = require("@pisell/utils");
40
- var import_antd = require("antd");
41
40
  var import_materials = require("@pisell/materials");
42
41
  var import_transformProductDetail = require("../../utils/transformProductDetail");
43
42
  function Menu(props) {
44
43
  var _a;
45
- const { onCheckout } = props;
44
+ const { onCheckout, productList, onEnsureProductList } = props;
46
45
  const context = (0, import_useEngineContext.default)();
47
46
  const { utils } = context.appHelper || {};
48
47
  const {
@@ -51,34 +50,18 @@ function Menu(props) {
51
50
  viewModel
52
51
  } = (0, import_context.useScanOrderContext)();
53
52
  const [dineInConfig, setDineInConfig] = (0, import_react.useState)(null);
54
- const getConfig = async () => {
53
+ const getConfig = (0, import_react.useCallback)(async () => {
55
54
  const otherParams = await runModuleAction("getOtherParams");
56
55
  console.log("otherParams >>>>> ", otherParams);
57
56
  const dineInConfig2 = (otherParams == null ? void 0 : otherParams.dineInConfig) ?? {};
58
57
  setDineInConfig(dineInConfig2);
59
- };
60
- getConfig();
61
- const [productList, setProductList] = (0, import_react.useState)([]);
58
+ }, [runModuleAction]);
62
59
  (0, import_react.useEffect)(() => {
63
- const fetchProductList = async () => {
64
- const res = await runModuleAction("getProductList");
65
- console.log("getProductList >>>>> ", res);
66
- if (Array.isArray(res)) {
67
- setProductList(res);
68
- } else {
69
- import_antd.Modal.confirm({
70
- title: res.message,
71
- okText: String(import_utils.locales.getText("pisell2.event.confirm") || "OK"),
72
- cancelButtonProps: { style: { display: "none" } },
73
- maskClosable: false,
74
- onOk: () => {
75
- location.replace("/");
76
- }
77
- });
78
- }
79
- };
80
- fetchProductList();
60
+ getConfig();
81
61
  }, []);
62
+ (0, import_react.useEffect)(() => {
63
+ void onEnsureProductList();
64
+ }, [onEnsureProductList]);
82
65
  const scrollRef = (0, import_react.useRef)(null);
83
66
  const isMobileView = (0, import_utils.isMobile)();
84
67
  const height = window.innerHeight - 100;
@@ -96,11 +79,12 @@ function Menu(props) {
96
79
  }
97
80
  };
98
81
  const removeOrderProduct = async (params) => {
99
- const { product_id, product_variant_id, sourceData } = params;
82
+ const { product_id, product_variant_id, identity_key, sourceData } = params;
100
83
  try {
101
84
  await runModuleAction("removeProductFromOrder", {
102
85
  product_id,
103
- product_variant_id
86
+ product_variant_id,
87
+ ...identity_key ? { identity_key } : {}
104
88
  });
105
89
  await refreshViewModel();
106
90
  } catch (error) {
@@ -108,16 +92,18 @@ function Menu(props) {
108
92
  error,
109
93
  sourceData,
110
94
  product_id,
111
- product_variant_id
95
+ product_variant_id,
96
+ identity_key
112
97
  });
113
98
  }
114
99
  };
115
100
  const updateOrderProduct = async (params) => {
116
- const { product_id, product_variant_id, updates, sourceData } = params;
101
+ const { product_id, product_variant_id, identity_key, updates, sourceData } = params;
117
102
  try {
118
103
  await runModuleAction("updateProductInOrder", {
119
104
  product_id,
120
105
  product_variant_id,
106
+ ...identity_key ? { identity_key } : {},
121
107
  updates
122
108
  });
123
109
  await refreshViewModel();
@@ -127,6 +113,7 @@ function Menu(props) {
127
113
  sourceData,
128
114
  product_id,
129
115
  product_variant_id,
116
+ identity_key,
130
117
  updates
131
118
  });
132
119
  }
@@ -162,18 +149,20 @@ function Menu(props) {
162
149
  return;
163
150
  }
164
151
  const normalizedQuantity = Number.isNaN(nextQuantity) ? 0 : Math.max(0, Math.floor(nextQuantity));
152
+ const cartItems = Array.isArray(viewModel == null ? void 0 : viewModel.cartItems) ? viewModel.cartItems : [];
153
+ const existedCartItem = cartItems.find((cartItem) => {
154
+ return String((cartItem == null ? void 0 : cartItem.product_id) ?? null) === String((orderProduct == null ? void 0 : orderProduct.product_id) ?? null) && Number((cartItem == null ? void 0 : cartItem.product_variant_id) ?? 0) === productVariantId;
155
+ });
156
+ const existedIdentityKey = typeof (existedCartItem == null ? void 0 : existedCartItem.identity_key) === "string" && existedCartItem.identity_key.length > 0 ? existedCartItem.identity_key : void 0;
165
157
  if (normalizedQuantity <= 0) {
166
158
  await removeOrderProduct({
167
159
  product_id: (orderProduct == null ? void 0 : orderProduct.product_id) ?? null,
168
160
  product_variant_id: productVariantId,
161
+ identity_key: existedIdentityKey,
169
162
  sourceData: quantityData
170
163
  });
171
164
  return;
172
165
  }
173
- const cartItems = Array.isArray(viewModel == null ? void 0 : viewModel.cartItems) ? viewModel.cartItems : [];
174
- const existedCartItem = cartItems.find((cartItem) => {
175
- return String((cartItem == null ? void 0 : cartItem.product_id) ?? null) === String((orderProduct == null ? void 0 : orderProduct.product_id) ?? null) && Number((cartItem == null ? void 0 : cartItem.product_variant_id) ?? 0) === productVariantId;
176
- });
177
166
  if (!existedCartItem) {
178
167
  await addOrderProduct({
179
168
  orderProduct: {
@@ -187,6 +176,7 @@ function Menu(props) {
187
176
  await updateOrderProduct({
188
177
  product_id: (orderProduct == null ? void 0 : orderProduct.product_id) ?? null,
189
178
  product_variant_id: productVariantId,
179
+ identity_key: existedIdentityKey,
190
180
  updates: {
191
181
  num: normalizedQuantity,
192
182
  _origin: orderProduct == null ? void 0 : orderProduct._origin
@@ -198,7 +188,7 @@ function Menu(props) {
198
188
  type: "pisell1.productDetail",
199
189
  data: {
200
190
  detail: { ...sourceItem, open_deposit: 1 },
201
- setting: { can_input: true, item_max_length: 1, is_detail_open: true }
191
+ setting: { can_input: true, item_max_length: 1, is_detail_open: false }
202
192
  },
203
193
  callback: async (data) => {
204
194
  if (data == null ? void 0 : data.isCancel) return;
@@ -248,8 +238,5 @@ function Menu(props) {
248
238
  cartElementId: "#scan-order-v2-cart-btn"
249
239
  }
250
240
  );
251
- if (isMobileView) {
252
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-menu pisell-scan-menu-mobile" }, productSelectNode);
253
- }
254
241
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-menu" }, /* @__PURE__ */ import_react.default.createElement(import_materials.PisellScrollView, { height, overflow: "y", ref: scrollRef }, productSelectNode));
255
242
  }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import '../../../booking/components/voucher/index.less';
3
+ import '../../../appointmentBooking/components/Voucher/index.less';
4
+ /**
5
+ * VoucherCard -- 优惠券/Promotion 区块
6
+ * 嵌入购物车底部,提供券列表展示、勾选、扫码兑码、未登录引导等能力
7
+ */
8
+ export default function VoucherCard(): JSX.Element;
@@ -0,0 +1,162 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/scanOrder/components/Voucher/index.tsx
30
+ var Voucher_exports = {};
31
+ __export(Voucher_exports, {
32
+ default: () => VoucherCard
33
+ });
34
+ module.exports = __toCommonJS(Voucher_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_ChevronDown = __toESM(require("@pisell/icon/es/ChevronDown"));
37
+ var import_UserCircle = __toESM(require("@pisell/icon/es/UserCircle"));
38
+ var import_classnames = __toESM(require("classnames"));
39
+ var import_antd = require("antd");
40
+ var import_utils = require("@pisell/utils");
41
+ var import_materials = require("@pisell/materials");
42
+ var import_context = require("../../context");
43
+ var import_hooks = require("../../hooks");
44
+ var import_voucher = require("../../../booking/components/voucher/index.less");
45
+ var import_Voucher = require("../../../appointmentBooking/components/Voucher/index.less");
46
+ function VoucherCard() {
47
+ const {
48
+ discountList,
49
+ runModuleAction,
50
+ refreshViewModel,
51
+ scanOrderModule
52
+ } = (0, import_context.useScanOrderContext)();
53
+ const { isLogin, openLoginModal } = (0, import_hooks.useScanOrderLogin)();
54
+ const [showDetail, setShowDetail] = (0, import_react.useState)(true);
55
+ const [code, setCode] = (0, import_react.useState)("");
56
+ const availableData = (0, import_react.useMemo)(() => {
57
+ return (discountList || []).filter((item) => !!item.isAvailable).map((discount) => ({
58
+ ...discount,
59
+ isDisabled: discount.isDisabled || discount.isDisabledForProductUsed
60
+ }));
61
+ }, [discountList]);
62
+ const syncAfterDiscountChange = (0, import_react.useCallback)(async () => {
63
+ await refreshViewModel();
64
+ }, [refreshViewModel]);
65
+ const onScanCode = (0, import_react.useCallback)(async () => {
66
+ var _a;
67
+ if (!code.trim()) return;
68
+ try {
69
+ const tempOrder = (_a = scanOrderModule == null ? void 0 : scanOrderModule.getTempOrder) == null ? void 0 : _a.call(scanOrderModule);
70
+ const customerId = (tempOrder == null ? void 0 : tempOrder.customer_id) || void 0;
71
+ const result = await runModuleAction("scanCode", code, customerId);
72
+ if (result == null ? void 0 : result.isAvailable) {
73
+ setCode("");
74
+ await syncAfterDiscountChange();
75
+ } else {
76
+ const content = {
77
+ time_limit: import_utils.locales.getText("pisell2.text.goodpass.code-invalid-expired")
78
+ };
79
+ import_antd.message.error({
80
+ content: String(
81
+ (result == null ? void 0 : result.type) === "server" ? import_utils.locales.getText("pisell2.text.goodpass.code-invalid") : content[result == null ? void 0 : result.unavailableReason] || import_utils.locales.getText("pisell2.text.goodpass.code-invalid-cart")
82
+ )
83
+ });
84
+ }
85
+ } catch (error) {
86
+ console.warn("[scanOrder] scanCode failed", error);
87
+ import_antd.message.error({
88
+ content: String(
89
+ import_utils.locales.getText("pisell2.text.goodpass.code-invalid") || "兑换码无效"
90
+ )
91
+ });
92
+ }
93
+ }, [code, scanOrderModule, runModuleAction, syncAfterDiscountChange]);
94
+ const onDiscountChange = (0, import_react.useCallback)(
95
+ async (val) => {
96
+ try {
97
+ await runModuleAction("setDiscountSelected", {
98
+ discountId: val.id,
99
+ isSelected: val.isSelected
100
+ });
101
+ await syncAfterDiscountChange();
102
+ } catch (error) {
103
+ console.warn("[scanOrder] setDiscountSelected failed", error);
104
+ }
105
+ },
106
+ [runModuleAction, syncAfterDiscountChange]
107
+ );
108
+ const mixedSort = (0, import_react.useCallback)((val) => {
109
+ return [...val].sort((a, b) => Number(b == null ? void 0 : b.isSelected) - Number(a == null ? void 0 : a.isSelected));
110
+ }, []);
111
+ const renderLoginCard = () => {
112
+ if (isLogin) return null;
113
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "login-card" }, /* @__PURE__ */ import_react.default.createElement(import_UserCircle.default, { style: { fontSize: 28 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: "text-wrapper", style: { maxWidth: "none" } }, /* @__PURE__ */ import_react.default.createElement(
114
+ import_materials.PisellText,
115
+ {
116
+ className: "login-btn",
117
+ onClick: () => {
118
+ openLoginModal({
119
+ callback: () => {
120
+ }
121
+ });
122
+ }
123
+ },
124
+ import_utils.locales.getText("pisell2.text.goodpass.login")
125
+ ), " ", /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.text.goodpass.login-tip"))));
126
+ };
127
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__appointment-booking-voucher-container", style: { marginTop: "10px" } }, /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-title" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "voucher-title-left" }, import_utils.locales.getText("pisell2.text.goodpass")), /* @__PURE__ */ import_react.default.createElement(
128
+ "span",
129
+ {
130
+ className: "voucher-title-right",
131
+ onClick: () => setShowDetail(!showDetail)
132
+ },
133
+ import_utils.locales.getText("pisell2.text.details"),
134
+ " ",
135
+ /* @__PURE__ */ import_react.default.createElement(
136
+ import_ChevronDown.default,
137
+ {
138
+ className: (0, import_classnames.default)("voucher-right-icon", { show: showDetail })
139
+ }
140
+ )
141
+ )), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("voucher-detail", { show: showDetail }) }, availableData.length > 0 ? /* @__PURE__ */ import_react.default.createElement(
142
+ import_materials.PisellGoodPassCard,
143
+ {
144
+ style: { width: "100%" },
145
+ dataSource: availableData,
146
+ mixedSort,
147
+ onChange: onDiscountChange
148
+ }
149
+ ) : null, renderLoginCard(), /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-code-input-wrapper" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-code-input" }, /* @__PURE__ */ import_react.default.createElement("div", { style: { whiteSpace: "nowrap" } }, import_utils.locales.getText("pisell2.text.goodpass.code"), ":"), /* @__PURE__ */ import_react.default.createElement(
150
+ import_materials.PisellInput,
151
+ {
152
+ value: code,
153
+ allowClear: true,
154
+ onChange: (e) => {
155
+ var _a;
156
+ return setCode(((_a = e.target) == null ? void 0 : _a.value) || "");
157
+ },
158
+ size: "small",
159
+ placeholder: import_utils.locales.getText("pisell2.text.goodpass.enter-code")
160
+ }
161
+ )), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { size: "small", onClick: onScanCode, disabled: !code.trim() }, import_utils.locales.getText("pisell2.text.apply")))));
162
+ }
@@ -67,6 +67,7 @@ function ScanOrderProvider({
67
67
  const [entryMode, setEntryMode] = (0, import_react.useState)("default");
68
68
  const [submitDisabledTips, setSubmitDisabledTips] = (0, import_react.useState)("");
69
69
  const [isCacheHydrated, setIsCacheHydrated] = (0, import_react.useState)(false);
70
+ const [resumeStep, setResumeStep] = (0, import_react.useState)(null);
70
71
  const hydratedRef = (0, import_react.useRef)(false);
71
72
  const stepList = [...import_hooks.SCAN_ORDER_STEPS];
72
73
  const isGatePassed = (0, import_react.useCallback)(
@@ -89,7 +90,11 @@ function ScanOrderProvider({
89
90
  const clearStepCache = (0, import_react.useCallback)(() => {
90
91
  var _a;
91
92
  (_a = scanOrderModule == null ? void 0 : scanOrderModule.clearUIState) == null ? void 0 : _a.call(scanOrderModule);
93
+ setResumeStep(null);
92
94
  }, [scanOrderModule]);
95
+ const consumeResumeStep = (0, import_react.useCallback)(() => {
96
+ setResumeStep(null);
97
+ }, []);
93
98
  const refreshViewModel = async () => {
94
99
  if (scanOrderModule && typeof scanOrderModule.getSummary === "function") {
95
100
  try {
@@ -126,35 +131,37 @@ function ScanOrderProvider({
126
131
  var _a, _b, _c, _d, _e, _f;
127
132
  if (hydratedRef.current || !scanOrderModule) return;
128
133
  hydratedRef.current = true;
129
- const currentResourceId = entryContext == null ? void 0 : entryContext.resource_id;
134
+ const normalizedResourceId = String((entryContext == null ? void 0 : entryContext.resource_id) ?? "");
135
+ const normalizedBiz = String((entryContext == null ? void 0 : entryContext.biz) ?? "");
130
136
  const currentHasOrderId = Boolean(entryContext == null ? void 0 : entryContext.order_id);
131
- const currentBiz = entryContext == null ? void 0 : entryContext.biz;
132
137
  const cachedEntry = (_a = scanOrderModule.getUIState) == null ? void 0 : _a.call(scanOrderModule, "entryContext");
133
- const entrySame = cachedEntry && cachedEntry.resourceId === currentResourceId && cachedEntry.biz === currentBiz;
138
+ const entrySame = Boolean(cachedEntry) && String((cachedEntry == null ? void 0 : cachedEntry.resourceId) ?? "") === normalizedResourceId && String((cachedEntry == null ? void 0 : cachedEntry.biz) ?? "") === normalizedBiz;
134
139
  if (!entrySame) {
135
140
  (_b = scanOrderModule.clearUIState) == null ? void 0 : _b.call(scanOrderModule);
136
141
  (_c = scanOrderModule.setUIState) == null ? void 0 : _c.call(scanOrderModule, "entryContext", {
137
- resourceId: currentResourceId,
142
+ resourceId: normalizedResourceId,
138
143
  hasOrderId: currentHasOrderId,
139
- biz: currentBiz
144
+ biz: normalizedBiz
140
145
  });
141
146
  setIsCacheHydrated(true);
142
147
  return;
143
148
  }
149
+ const isResumable = (s) => s === "product" || s === "check";
144
150
  const pending = (_d = scanOrderModule.getUIState) == null ? void 0 : _d.call(scanOrderModule, "pendingStep");
145
- if (pending && stepList.includes(pending)) {
151
+ if (isResumable(pending)) {
146
152
  (_e = scanOrderModule.deleteUIState) == null ? void 0 : _e.call(scanOrderModule, "pendingStep");
147
- setCurrentStep(pending);
153
+ setResumeStep(pending);
148
154
  setIsCacheHydrated(true);
149
155
  return;
150
156
  }
151
157
  const cached = (_f = scanOrderModule.getUIState) == null ? void 0 : _f.call(scanOrderModule, "step");
152
- if (cached && stepList.includes(cached)) setCurrentStep(cached);
158
+ if (isResumable(cached)) setResumeStep(cached);
153
159
  setIsCacheHydrated(true);
154
160
  }, [scanOrderModule, entryContext == null ? void 0 : entryContext.resource_id, entryContext == null ? void 0 : entryContext.order_id, entryContext == null ? void 0 : entryContext.biz]);
155
161
  (0, import_react.useEffect)(() => {
156
162
  var _a;
157
163
  if (!hydratedRef.current || !isCacheHydrated || !scanOrderModule) return;
164
+ if (currentStep === "init") return;
158
165
  (_a = scanOrderModule.setUIState) == null ? void 0 : _a.call(scanOrderModule, "step", currentStep);
159
166
  }, [currentStep, isCacheHydrated, scanOrderModule]);
160
167
  (0, import_react.useEffect)(() => {
@@ -256,7 +263,9 @@ function ScanOrderProvider({
256
263
  isCacheHydrated,
257
264
  markGate,
258
265
  isGatePassed,
259
- clearStepCache
266
+ clearStepCache,
267
+ resumeStep,
268
+ consumeResumeStep
260
269
  };
261
270
  }, [
262
271
  entryContext,
@@ -274,7 +283,9 @@ function ScanOrderProvider({
274
283
  isCacheHydrated,
275
284
  markGate,
276
285
  isGatePassed,
277
- clearStepCache
286
+ clearStepCache,
287
+ resumeStep,
288
+ consumeResumeStep
278
289
  ]);
279
290
  return /* @__PURE__ */ import_react.default.createElement(ScanOrderContext.Provider, { value }, children);
280
291
  }
@@ -103,7 +103,10 @@ var useScanOrderLogin = () => {
103
103
  const { callback } = params || {};
104
104
  utils.action({
105
105
  type: "pisell1.login",
106
- data: {},
106
+ data: {
107
+ notReload: true,
108
+ type: "plugin"
109
+ },
107
110
  callback
108
111
  });
109
112
  };
@@ -27,7 +27,20 @@ declare const _default: {
27
27
  'pisell2.scan.order.pickup.ref.placeholder': string;
28
28
  'pisell2.scan.order.products.title': string;
29
29
  'pisell2.scan.order.products.empty.tip': string;
30
+ 'pisell2.scan.order.check.cart.empty.tip': string;
30
31
  'pisell2.scan.order.submit.disabled.default': string;
32
+ 'pisell2.text.goodpass': string;
33
+ 'pisell2.text.goodpass.product-vouchers': string;
34
+ 'pisell2.text.goodpass.view-more': string;
35
+ 'pisell2.text.goodpass.code': string;
36
+ 'pisell2.text.goodpass.enter-code': string;
37
+ 'pisell2.text.goodpass.code-invalid': string;
38
+ 'pisell2.text.goodpass.code-invalid-cart': string;
39
+ 'pisell2.text.goodpass.code-invalid-expired': string;
40
+ 'pisell2.text.goodpass.login': string;
41
+ 'pisell2.text.goodpass.login-tip': string;
42
+ 'pisell2.text.apply': string;
43
+ 'pisell2.text.details': string;
31
44
  'pisell2.appointment.booking.empty.data': string;
32
45
  'pisell2.appointment.deposit.close': string;
33
46
  'pisell2.appointment.policy': string;
@@ -62,7 +75,20 @@ declare const _default: {
62
75
  'pisell2.scan.order.pickup.ref.placeholder': string;
63
76
  'pisell2.scan.order.products.title': string;
64
77
  'pisell2.scan.order.products.empty.tip': string;
78
+ 'pisell2.scan.order.check.cart.empty.tip': string;
65
79
  'pisell2.scan.order.submit.disabled.default': string;
80
+ 'pisell2.text.goodpass': string;
81
+ 'pisell2.text.goodpass.product-vouchers': string;
82
+ 'pisell2.text.goodpass.view-more': string;
83
+ 'pisell2.text.goodpass.code': string;
84
+ 'pisell2.text.goodpass.enter-code': string;
85
+ 'pisell2.text.goodpass.code-invalid': string;
86
+ 'pisell2.text.goodpass.code-invalid-cart': string;
87
+ 'pisell2.text.goodpass.code-invalid-expired': string;
88
+ 'pisell2.text.goodpass.login': string;
89
+ 'pisell2.text.goodpass.login-tip': string;
90
+ 'pisell2.text.apply': string;
91
+ 'pisell2.text.details': string;
66
92
  'pisell2.appointment.booking.empty.data': string;
67
93
  'pisell2.appointment.deposit.close': string;
68
94
  'pisell2.appointment.policy': string;
@@ -97,7 +123,20 @@ declare const _default: {
97
123
  'pisell2.scan.order.pickup.ref.placeholder': string;
98
124
  'pisell2.scan.order.products.title': string;
99
125
  'pisell2.scan.order.products.empty.tip': string;
126
+ 'pisell2.scan.order.check.cart.empty.tip': string;
100
127
  'pisell2.scan.order.submit.disabled.default': string;
128
+ 'pisell2.text.goodpass': string;
129
+ 'pisell2.text.goodpass.product-vouchers': string;
130
+ 'pisell2.text.goodpass.view-more': string;
131
+ 'pisell2.text.goodpass.code': string;
132
+ 'pisell2.text.goodpass.enter-code': string;
133
+ 'pisell2.text.goodpass.code-invalid': string;
134
+ 'pisell2.text.goodpass.code-invalid-cart': string;
135
+ 'pisell2.text.goodpass.code-invalid-expired': string;
136
+ 'pisell2.text.goodpass.login': string;
137
+ 'pisell2.text.goodpass.login-tip': string;
138
+ 'pisell2.text.apply': string;
139
+ 'pisell2.text.details': string;
101
140
  'pisell2.appointment.booking.empty.data': string;
102
141
  'pisell2.appointment.deposit.close': string;
103
142
  'pisell2.appointment.policy': string;
@@ -132,7 +171,20 @@ declare const _default: {
132
171
  'pisell2.scan.order.pickup.ref.placeholder': string;
133
172
  'pisell2.scan.order.products.title': string;
134
173
  'pisell2.scan.order.products.empty.tip': string;
174
+ 'pisell2.scan.order.check.cart.empty.tip': string;
135
175
  'pisell2.scan.order.submit.disabled.default': string;
176
+ 'pisell2.text.goodpass': string;
177
+ 'pisell2.text.goodpass.product-vouchers': string;
178
+ 'pisell2.text.goodpass.view-more': string;
179
+ 'pisell2.text.goodpass.code': string;
180
+ 'pisell2.text.goodpass.enter-code': string;
181
+ 'pisell2.text.goodpass.code-invalid': string;
182
+ 'pisell2.text.goodpass.code-invalid-cart': string;
183
+ 'pisell2.text.goodpass.code-invalid-expired': string;
184
+ 'pisell2.text.goodpass.login': string;
185
+ 'pisell2.text.goodpass.login-tip': string;
186
+ 'pisell2.text.apply': string;
187
+ 'pisell2.text.details': string;
136
188
  'pisell2.appointment.booking.empty.data': string;
137
189
  'pisell2.appointment.deposit.close': string;
138
190
  'pisell2.appointment.policy': string;
@@ -167,7 +219,20 @@ declare const _default: {
167
219
  'pisell2.scan.order.pickup.ref.placeholder': string;
168
220
  'pisell2.scan.order.products.title': string;
169
221
  'pisell2.scan.order.products.empty.tip': string;
222
+ 'pisell2.scan.order.check.cart.empty.tip': string;
170
223
  'pisell2.scan.order.submit.disabled.default': string;
224
+ 'pisell2.text.goodpass': string;
225
+ 'pisell2.text.goodpass.product-vouchers': string;
226
+ 'pisell2.text.goodpass.view-more': string;
227
+ 'pisell2.text.goodpass.code': string;
228
+ 'pisell2.text.goodpass.enter-code': string;
229
+ 'pisell2.text.goodpass.code-invalid': string;
230
+ 'pisell2.text.goodpass.code-invalid-cart': string;
231
+ 'pisell2.text.goodpass.code-invalid-expired': string;
232
+ 'pisell2.text.goodpass.login': string;
233
+ 'pisell2.text.goodpass.login-tip': string;
234
+ 'pisell2.text.apply': string;
235
+ 'pisell2.text.details': string;
171
236
  'pisell2.appointment.booking.empty.data': string;
172
237
  'pisell2.appointment.deposit.close': string;
173
238
  'pisell2.appointment.policy': string;
@@ -51,7 +51,20 @@ var locales_default = {
51
51
  "pisell2.scan.order.pickup.ref.placeholder": "e.g. John",
52
52
  "pisell2.scan.order.products.title": "Products",
53
53
  "pisell2.scan.order.products.empty.tip": "Please select products",
54
+ "pisell2.scan.order.check.cart.empty.tip": "Please go back to add products",
54
55
  "pisell2.scan.order.submit.disabled.default": "Order submission is currently disabled.",
56
+ "pisell2.text.goodpass": "Promotion",
57
+ "pisell2.text.goodpass.product-vouchers": "Product Vouchers",
58
+ "pisell2.text.goodpass.view-more": "View More",
59
+ "pisell2.text.goodpass.code": "Code",
60
+ "pisell2.text.goodpass.enter-code": "Enter Code",
61
+ "pisell2.text.goodpass.code-invalid": "Current code is invalid",
62
+ "pisell2.text.goodpass.code-invalid-cart": "No eligible items in the cart",
63
+ "pisell2.text.goodpass.code-invalid-expired": "Current coupon is not valid in use",
64
+ "pisell2.text.goodpass.login": "Login",
65
+ "pisell2.text.goodpass.login-tip": "to access your promotions",
66
+ "pisell2.text.apply": "Apply",
67
+ "pisell2.text.details": "Details",
55
68
  "pisell2.appointment.booking.empty.data": "No data",
56
69
  "pisell2.appointment.deposit.close": "Close",
57
70
  "pisell2.appointment.policy": "You have read and agreed to this policy",
@@ -86,7 +99,20 @@ var locales_default = {
86
99
  "pisell2.scan.order.pickup.ref.placeholder": "例如:小明",
87
100
  "pisell2.scan.order.products.title": "商品",
88
101
  "pisell2.scan.order.products.empty.tip": "请选择商品",
102
+ "pisell2.scan.order.check.cart.empty.tip": "请返回添加商品",
89
103
  "pisell2.scan.order.submit.disabled.default": "当前暂不可下单",
104
+ "pisell2.text.goodpass": "促销",
105
+ "pisell2.text.goodpass.product-vouchers": "商品兑换券",
106
+ "pisell2.text.goodpass.view-more": "查看更多",
107
+ "pisell2.text.goodpass.code": "券码",
108
+ "pisell2.text.goodpass.enter-code": "请输入券码",
109
+ "pisell2.text.goodpass.code-invalid": "当前券码不可用",
110
+ "pisell2.text.goodpass.code-invalid-cart": "当前购物车中无可用商品",
111
+ "pisell2.text.goodpass.code-invalid-expired": "当前优惠券不在使用期限内",
112
+ "pisell2.text.goodpass.login": "登录",
113
+ "pisell2.text.goodpass.login-tip": "以获取会员福利或使用账户积分",
114
+ "pisell2.text.apply": "应用",
115
+ "pisell2.text.details": "详情",
90
116
  "pisell2.appointment.booking.empty.data": "暂无数据",
91
117
  "pisell2.appointment.deposit.close": "关闭",
92
118
  "pisell2.appointment.policy": "您已仔细阅读并同意此协议",
@@ -121,7 +147,20 @@ var locales_default = {
121
147
  "pisell2.scan.order.pickup.ref.placeholder": "例如:小明",
122
148
  "pisell2.scan.order.products.title": "商品",
123
149
  "pisell2.scan.order.products.empty.tip": "請選擇商品",
150
+ "pisell2.scan.order.check.cart.empty.tip": "請返回添加商品",
124
151
  "pisell2.scan.order.submit.disabled.default": "當前暫不可下單",
152
+ "pisell2.text.goodpass": "促銷",
153
+ "pisell2.text.goodpass.product-vouchers": "商品兌換券",
154
+ "pisell2.text.goodpass.view-more": "查看更多",
155
+ "pisell2.text.goodpass.code": "券碼",
156
+ "pisell2.text.goodpass.enter-code": "請輸入券碼",
157
+ "pisell2.text.goodpass.code-invalid": "當前券碼不可用",
158
+ "pisell2.text.goodpass.code-invalid-cart": "當前購物車中無可用商品",
159
+ "pisell2.text.goodpass.code-invalid-expired": "當前優惠券不在使用期限內",
160
+ "pisell2.text.goodpass.login": "登錄",
161
+ "pisell2.text.goodpass.login-tip": "以獲取會員福利或使用賬戶積分",
162
+ "pisell2.text.apply": "應用",
163
+ "pisell2.text.details": "詳情",
125
164
  "pisell2.appointment.booking.empty.data": "暫無數據",
126
165
  "pisell2.appointment.deposit.close": "关闭",
127
166
  "pisell2.appointment.policy": "您已仔細閱讀並同意此協議",
@@ -156,7 +195,20 @@ var locales_default = {
156
195
  "pisell2.scan.order.pickup.ref.placeholder": "例: ジョン",
157
196
  "pisell2.scan.order.products.title": "商品",
158
197
  "pisell2.scan.order.products.empty.tip": "商品を選択してください",
198
+ "pisell2.scan.order.check.cart.empty.tip": "商品を追加するには、前の画面に戻ってください",
159
199
  "pisell2.scan.order.submit.disabled.default": "現在、注文を送信できません。",
200
+ "pisell2.text.goodpass": "プロモーション",
201
+ "pisell2.text.goodpass.product-vouchers": "商品バウチャー",
202
+ "pisell2.text.goodpass.view-more": "もっと見る",
203
+ "pisell2.text.goodpass.code": "コード",
204
+ "pisell2.text.goodpass.enter-code": "コードを入力",
205
+ "pisell2.text.goodpass.code-invalid": "現在のコードは無効です",
206
+ "pisell2.text.goodpass.code-invalid-cart": "カートに適格な項目がありません",
207
+ "pisell2.text.goodpass.code-invalid-expired": "現在のクーポンは使用期限外です",
208
+ "pisell2.text.goodpass.login": "ログイン",
209
+ "pisell2.text.goodpass.login-tip": "プロモーションにアクセスするため",
210
+ "pisell2.text.apply": "適用",
211
+ "pisell2.text.details": "詳細",
160
212
  "pisell2.appointment.booking.empty.data": "データなし",
161
213
  "pisell2.appointment.deposit.close": "閉じる",
162
214
  "pisell2.appointment.policy": "このポリシーを読み、同意しました",
@@ -191,7 +243,20 @@ var locales_default = {
191
243
  "pisell2.scan.order.pickup.ref.placeholder": "Ex.: João",
192
244
  "pisell2.scan.order.products.title": "Produtos",
193
245
  "pisell2.scan.order.products.empty.tip": "Selecione produtos",
246
+ "pisell2.scan.order.check.cart.empty.tip": "Volte para adicionar produtos",
194
247
  "pisell2.scan.order.submit.disabled.default": "No momento, não é possível enviar pedidos.",
248
+ "pisell2.text.goodpass": "Promoção",
249
+ "pisell2.text.goodpass.product-vouchers": "Vales de Produto",
250
+ "pisell2.text.goodpass.view-more": "Ver Mais",
251
+ "pisell2.text.goodpass.code": "Código",
252
+ "pisell2.text.goodpass.enter-code": "Digite o Código",
253
+ "pisell2.text.goodpass.code-invalid": "Código atual é inválido",
254
+ "pisell2.text.goodpass.code-invalid-cart": "Nenhum item elegível no carrinho",
255
+ "pisell2.text.goodpass.code-invalid-expired": "Cupom atual não está no período de uso",
256
+ "pisell2.text.goodpass.login": "Entrar",
257
+ "pisell2.text.goodpass.login-tip": "para acessar suas promoções",
258
+ "pisell2.text.apply": "Aplicar",
259
+ "pisell2.text.details": "Detalhes",
195
260
  "pisell2.appointment.booking.empty.data": "Sem dados",
196
261
  "pisell2.appointment.deposit.close": "Fechar",
197
262
  "pisell2.appointment.policy": "Você leu e concordou com esta política",
@@ -42,6 +42,8 @@ export interface ScanOrderContextValue {
42
42
  tableName: string;
43
43
  entryMode: ScanOrderEntryMode;
44
44
  submitDisabledTips: string;
45
+ /** 折扣/优惠券列表(来自 scanOrder 模块 getDiscountList) */
46
+ discountList: any[];
45
47
  isReady: boolean;
46
48
  setCurrentStep: (step: ScanOrderStepKey) => void;
47
49
  setTableName: (name: string) => void;
@@ -62,6 +64,14 @@ export interface ScanOrderContextValue {
62
64
  isGatePassed: (flag: ScanOrderGateKey) => boolean;
63
65
  /** 整桶清空(提交成功 / restoreOrder 等场景) */
64
66
  clearStepCache: () => void;
67
+ /**
68
+ * bootstrap 结束后要恢复到的目标 step(仅记录 `'product' | 'check'`)。
69
+ * hydrate 阶段不直接 `setCurrentStep`,避免在 checkResourceAvailable 之前让
70
+ * `<Menu>` / `<Check>` mount、提前发出缺 menu_list_ids 的请求。
71
+ */
72
+ resumeStep: ScanOrderStepKey | null;
73
+ /** 消费并清空 resumeStep;建议在完成 goToStep 后立刻调用 */
74
+ consumeResumeStep: () => void;
65
75
  }
66
76
  export interface ScanOrderProviderProps {
67
77
  entryContext: ScanOrderEntryContext;
@@ -9,6 +9,7 @@ interface ScanOrderOrderProduct {
9
9
  product_option_item?: any[];
10
10
  product_bundle?: any[];
11
11
  identity_key?: string;
12
+ note?: string;
12
13
  metadata?: Record<string, any>;
13
14
  _origin?: Record<string, any>;
14
15
  [key: string]: any;