@pisell/pisellos 3.0.74 → 3.0.76
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.
- package/dist/core/index.js +2 -1
- package/dist/effects/index.d.ts +5 -3
- package/dist/effects/index.js +40 -8
- package/dist/modules/Account/index.js +2 -3
- package/dist/modules/AccountList/index.d.ts +7 -1
- package/dist/modules/AccountList/index.js +81 -14
- package/dist/modules/AccountList/types.d.ts +28 -0
- package/dist/modules/AccountList/types.js +8 -0
- package/dist/modules/BaseModule.d.ts +3 -0
- package/dist/modules/BaseModule.js +15 -0
- package/dist/modules/Cart/index.d.ts +1 -0
- package/dist/modules/Cart/index.js +2 -1
- package/dist/modules/Cart/utils/cartProduct.js +21 -4
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Customer/constants.js +12 -0
- package/dist/modules/Customer/index.d.ts +122 -0
- package/dist/modules/Customer/index.js +696 -0
- package/dist/modules/Customer/types.d.ts +146 -0
- package/dist/modules/Customer/types.js +41 -0
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +3 -3
- package/dist/modules/Discount/types.d.ts +9 -0
- package/dist/modules/Guests/index.js +9 -9
- package/dist/modules/Order/index.d.ts +25 -1
- package/dist/modules/Order/index.js +224 -3
- package/dist/modules/Order/types.d.ts +45 -0
- package/dist/modules/Order/types.js +8 -0
- package/dist/modules/Order/utils.js +1 -1
- package/dist/modules/Payment/cash.d.ts +19 -0
- package/dist/modules/Payment/cash.js +97 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -0
- package/dist/modules/Payment/eftpos.d.ts +11 -0
- package/dist/modules/Payment/eftpos.js +80 -0
- package/dist/modules/Payment/index.d.ts +184 -9
- package/dist/modules/Payment/index.js +2084 -109
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/mx51.js +0 -0
- package/dist/modules/Payment/types.d.ts +772 -30
- package/dist/modules/Payment/types.js +236 -12
- package/dist/modules/Payment/utils.d.ts +17 -0
- package/dist/modules/Payment/utils.js +62 -0
- package/dist/modules/Payment/walletpass.d.ts +99 -0
- package/dist/modules/Payment/walletpass.js +711 -0
- package/dist/modules/ProductList/index.d.ts +12 -1
- package/dist/modules/ProductList/index.js +37 -15
- package/dist/modules/Resource/index.js +1 -1
- package/dist/modules/Rules/index.d.ts +2 -1
- package/dist/modules/Rules/index.js +470 -127
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +9 -0
- package/dist/modules/Schedule/index.js +77 -0
- package/dist/modules/Summary/utils.d.ts +5 -0
- package/dist/modules/Summary/utils.js +36 -1
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/app-types/app/app.d.ts +83 -0
- package/dist/plugins/app-types/app/const.d.ts +4 -0
- package/dist/plugins/app-types/app/index.d.ts +14 -0
- package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/dist/plugins/app-types/config.d.ts +3 -0
- package/dist/plugins/app-types/cookie/index.d.ts +13 -0
- package/dist/plugins/app-types/data/index.d.ts +8 -0
- package/dist/plugins/app-types/history/config.d.ts +24 -0
- package/dist/plugins/app-types/history/index.d.ts +20 -0
- package/dist/plugins/app-types/history/type.d.ts +2 -0
- package/dist/plugins/app-types/hooks/index.d.ts +12 -0
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/dist/plugins/app-types/index.d.ts +6 -0
- package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
- package/dist/plugins/app-types/locales/en.d.ts +3 -0
- package/dist/plugins/app-types/locales/index.d.ts +37 -0
- package/dist/plugins/app-types/locales/original.d.ts +3 -0
- package/dist/plugins/app-types/locales/type.d.ts +19 -0
- package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
- package/dist/plugins/app-types/logger/index.d.ts +122 -0
- package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
- package/dist/plugins/app-types/models/global.d.ts +32 -0
- package/dist/plugins/app-types/models/index.d.ts +45 -0
- package/dist/plugins/app-types/models/type.d.ts +2 -0
- package/dist/plugins/app-types/package.json +15 -0
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
- package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
- package/dist/plugins/app-types/request/cache.d.ts +46 -0
- package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/dist/plugins/app-types/request/config.d.ts +3 -0
- package/dist/plugins/app-types/request/constants.d.ts +2 -0
- package/dist/plugins/app-types/request/index.d.ts +24 -0
- package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/dist/plugins/app-types/request/type.d.ts +41 -0
- package/dist/plugins/app-types/request/utils.d.ts +46 -0
- package/dist/plugins/app-types/routes/config.d.ts +7 -0
- package/dist/plugins/app-types/routes/index.d.ts +28 -0
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
- package/dist/plugins/app-types/socket/constants.d.ts +33 -0
- package/dist/plugins/app-types/socket/events.d.ts +31 -0
- package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/dist/plugins/app-types/socket/index.d.ts +61 -0
- package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
- package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/dist/plugins/app-types/socket/socket.d.ts +129 -0
- package/dist/plugins/app-types/socket/types.d.ts +85 -0
- package/dist/plugins/app-types/storage/index.d.ts +17 -0
- package/dist/plugins/app-types/tasks/index.d.ts +77 -0
- package/dist/plugins/app-types/tasks/type.d.ts +62 -0
- package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/dist/plugins/app-types/type.d.ts +2 -0
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/dist/plugins/app-types/variables/config.d.ts +3 -0
- package/dist/plugins/app-types/variables/index.d.ts +6 -0
- package/dist/plugins/app-types/variables/type.d.ts +2 -0
- package/dist/plugins/app-types/website/index.d.ts +6 -0
- package/dist/plugins/app.d.ts +8 -0
- package/dist/plugins/app.js +1 -0
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingByStep/index.js +43 -13
- package/dist/solution/BookingByStep/utils/capacity.js +1 -1
- package/dist/solution/BookingByStep/utils/products.d.ts +6 -0
- package/dist/solution/BookingByStep/utils/products.js +10 -0
- package/dist/solution/BookingTicket/index.d.ts +184 -0
- package/dist/solution/BookingTicket/index.js +698 -0
- package/dist/solution/BookingTicket/types.d.ts +68 -0
- package/dist/solution/BookingTicket/types.js +43 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +189 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +85 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +294 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
- package/dist/solution/BuyTickets/index.js +7 -8
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +432 -0
- package/dist/solution/Checkout/index.js +4452 -0
- package/dist/solution/Checkout/types.d.ts +727 -0
- package/dist/solution/Checkout/types.js +104 -0
- package/dist/solution/Checkout/utils/index.d.ts +121 -0
- package/dist/solution/Checkout/utils/index.js +511 -0
- package/dist/solution/ShopDiscount/index.d.ts +10 -10
- package/dist/solution/ShopDiscount/index.js +111 -60
- package/dist/solution/ShopDiscount/types.d.ts +8 -0
- package/dist/solution/ShopDiscount/utils.d.ts +24 -0
- package/dist/solution/ShopDiscount/utils.js +135 -1
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/utils/task.d.ts +40 -0
- package/dist/utils/task.js +171 -0
- package/dist/utils/watch.d.ts +102 -0
- package/dist/utils/watch.js +294 -0
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +5 -3
- package/lib/effects/index.js +17 -1
- package/lib/modules/Account/index.js +2 -3
- package/lib/modules/AccountList/index.d.ts +7 -1
- package/lib/modules/AccountList/index.js +27 -0
- package/lib/modules/AccountList/types.d.ts +28 -0
- package/lib/modules/BaseModule.d.ts +3 -0
- package/lib/modules/BaseModule.js +9 -0
- package/lib/modules/Cart/index.d.ts +1 -0
- package/lib/modules/Cart/index.js +5 -2
- package/lib/modules/Cart/utils/cartProduct.js +22 -6
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Customer/constants.js +39 -0
- package/lib/modules/Customer/index.d.ts +122 -0
- package/lib/modules/Customer/index.js +439 -0
- package/lib/modules/Customer/types.d.ts +146 -0
- package/lib/modules/Customer/types.js +37 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +3 -3
- package/lib/modules/Discount/types.d.ts +9 -0
- package/lib/modules/Guests/index.js +9 -9
- package/lib/modules/Order/index.d.ts +25 -1
- package/lib/modules/Order/index.js +186 -1
- package/lib/modules/Order/types.d.ts +45 -0
- package/lib/modules/Order/utils.js +1 -1
- package/lib/modules/Payment/cash.d.ts +19 -0
- package/lib/modules/Payment/cash.js +64 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -0
- package/lib/modules/Payment/eftpos.d.ts +11 -0
- package/lib/modules/Payment/eftpos.js +51 -0
- package/lib/modules/Payment/index.d.ts +184 -9
- package/lib/modules/Payment/index.js +1084 -51
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/mx51.js +0 -0
- package/lib/modules/Payment/types.d.ts +772 -30
- package/lib/modules/Payment/types.js +79 -6
- package/lib/modules/Payment/utils.d.ts +17 -0
- package/lib/modules/Payment/utils.js +67 -0
- package/lib/modules/Payment/walletpass.d.ts +99 -0
- package/lib/modules/Payment/walletpass.js +484 -0
- package/lib/modules/ProductList/index.d.ts +12 -1
- package/lib/modules/ProductList/index.js +31 -12
- package/lib/modules/Resource/index.js +1 -1
- package/lib/modules/Rules/index.d.ts +2 -1
- package/lib/modules/Rules/index.js +318 -72
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +9 -0
- package/lib/modules/Schedule/index.js +60 -0
- package/lib/modules/Summary/utils.d.ts +5 -0
- package/lib/modules/Summary/utils.js +27 -3
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -0
- package/lib/plugins/app-types/app/app.d.ts +83 -0
- package/lib/plugins/app-types/app/const.d.ts +4 -0
- package/lib/plugins/app-types/app/index.d.ts +14 -0
- package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/lib/plugins/app-types/config.d.ts +3 -0
- package/lib/plugins/app-types/cookie/index.d.ts +13 -0
- package/lib/plugins/app-types/data/index.d.ts +8 -0
- package/lib/plugins/app-types/history/config.d.ts +24 -0
- package/lib/plugins/app-types/history/index.d.ts +20 -0
- package/lib/plugins/app-types/history/type.d.ts +2 -0
- package/lib/plugins/app-types/hooks/index.d.ts +12 -0
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/lib/plugins/app-types/index.d.ts +6 -0
- package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
- package/lib/plugins/app-types/locales/en.d.ts +3 -0
- package/lib/plugins/app-types/locales/index.d.ts +37 -0
- package/lib/plugins/app-types/locales/original.d.ts +3 -0
- package/lib/plugins/app-types/locales/type.d.ts +19 -0
- package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
- package/lib/plugins/app-types/logger/index.d.ts +122 -0
- package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
- package/lib/plugins/app-types/models/global.d.ts +32 -0
- package/lib/plugins/app-types/models/index.d.ts +45 -0
- package/lib/plugins/app-types/models/type.d.ts +2 -0
- package/lib/plugins/app-types/package.json +15 -0
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
- package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
- package/lib/plugins/app-types/request/cache.d.ts +46 -0
- package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/lib/plugins/app-types/request/config.d.ts +3 -0
- package/lib/plugins/app-types/request/constants.d.ts +2 -0
- package/lib/plugins/app-types/request/index.d.ts +24 -0
- package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/lib/plugins/app-types/request/type.d.ts +41 -0
- package/lib/plugins/app-types/request/utils.d.ts +46 -0
- package/lib/plugins/app-types/routes/config.d.ts +7 -0
- package/lib/plugins/app-types/routes/index.d.ts +28 -0
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
- package/lib/plugins/app-types/socket/constants.d.ts +33 -0
- package/lib/plugins/app-types/socket/events.d.ts +31 -0
- package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/lib/plugins/app-types/socket/index.d.ts +61 -0
- package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
- package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/lib/plugins/app-types/socket/socket.d.ts +129 -0
- package/lib/plugins/app-types/socket/types.d.ts +85 -0
- package/lib/plugins/app-types/storage/index.d.ts +17 -0
- package/lib/plugins/app-types/tasks/index.d.ts +77 -0
- package/lib/plugins/app-types/tasks/type.d.ts +62 -0
- package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/lib/plugins/app-types/type.d.ts +2 -0
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/lib/plugins/app-types/variables/config.d.ts +3 -0
- package/lib/plugins/app-types/variables/index.d.ts +6 -0
- package/lib/plugins/app-types/variables/type.d.ts +2 -0
- package/lib/plugins/app-types/website/index.d.ts +6 -0
- package/lib/plugins/app.d.ts +8 -0
- package/lib/plugins/app.js +17 -0
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingByStep/index.js +18 -6
- package/lib/solution/BookingByStep/utils/capacity.js +1 -1
- package/lib/solution/BookingByStep/utils/products.d.ts +6 -0
- package/lib/solution/BookingByStep/utils/products.js +8 -2
- package/lib/solution/BookingTicket/index.d.ts +184 -0
- package/lib/solution/BookingTicket/index.js +426 -0
- package/lib/solution/BookingTicket/types.d.ts +68 -0
- package/lib/solution/BookingTicket/types.js +72 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +132 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +85 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +216 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
- package/lib/solution/BuyTickets/index.js +7 -8
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +432 -0
- package/lib/solution/Checkout/index.js +2776 -0
- package/lib/solution/Checkout/types.d.ts +727 -0
- package/lib/solution/Checkout/types.js +63 -0
- package/lib/solution/Checkout/utils/index.d.ts +121 -0
- package/lib/solution/Checkout/utils/index.js +362 -0
- package/lib/solution/ShopDiscount/index.d.ts +10 -10
- package/lib/solution/ShopDiscount/index.js +53 -27
- package/lib/solution/ShopDiscount/types.d.ts +8 -0
- package/lib/solution/ShopDiscount/utils.d.ts +24 -0
- package/lib/solution/ShopDiscount/utils.js +88 -1
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/lib/types/index.d.ts +4 -1
- package/lib/utils/task.d.ts +40 -0
- package/lib/utils/task.js +109 -0
- package/lib/utils/watch.d.ts +102 -0
- package/lib/utils/watch.js +217 -0
- package/package.json +3 -1
|
@@ -11,12 +11,17 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
11
11
|
constructor(name?: string, version?: string);
|
|
12
12
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
13
13
|
storeChange(path?: string, value?: any): Promise<void>;
|
|
14
|
-
loadProducts({ category_ids, product_ids, collection, schedule_date, cacheId }: {
|
|
14
|
+
loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, }: {
|
|
15
15
|
category_ids?: number[];
|
|
16
16
|
product_ids?: number[];
|
|
17
17
|
collection?: number | string[];
|
|
18
18
|
schedule_date?: string;
|
|
19
19
|
cacheId?: string;
|
|
20
|
+
customer_id?: number;
|
|
21
|
+
menu_list_ids?: number[];
|
|
22
|
+
schedule_datetime?: string;
|
|
23
|
+
with_count?: string[];
|
|
24
|
+
with_schedule?: number;
|
|
20
25
|
}): Promise<any>;
|
|
21
26
|
loadProductsPrice({ ids, customer_id, schedule_date, channel, }: {
|
|
22
27
|
ids?: number[];
|
|
@@ -28,4 +33,10 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
28
33
|
getProduct(id: number): Promise<ProductData | undefined>;
|
|
29
34
|
addProduct(products: ProductData[]): Promise<void>;
|
|
30
35
|
selectProducts(products: ProductData[]): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* 根据商品编码或条码搜索商品
|
|
38
|
+
* @param code 商品编码或条码
|
|
39
|
+
* @returns 匹配的商品列表,如果没有匹配则返回空数组
|
|
40
|
+
*/
|
|
41
|
+
findProductsByCodeOrBarcode(code: string): ProductData[];
|
|
31
42
|
}
|
|
@@ -16,7 +16,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
18
|
import { BaseModule } from "../BaseModule";
|
|
19
|
-
import { ProductListHooks } from "./types";
|
|
20
19
|
import { cloneDeep } from 'lodash-es';
|
|
21
20
|
export * from "./types";
|
|
22
21
|
export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
@@ -87,11 +86,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
87
86
|
value: function () {
|
|
88
87
|
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
|
|
89
88
|
var _this$otherParams;
|
|
90
|
-
var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection, schedule_date, cacheId, userPlugin, customer_id, _userPlugin$get, productsData, sortedList;
|
|
89
|
+
var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection, _ref$menu_list_ids, menu_list_ids, paramsCustomerId, _ref$with_count, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, userPlugin, customer_id, _userPlugin$get, productsData, sortedList;
|
|
91
90
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
92
91
|
while (1) switch (_context3.prev = _context3.next) {
|
|
93
92
|
case 0:
|
|
94
|
-
_ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId;
|
|
93
|
+
_ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule;
|
|
95
94
|
// // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
|
|
96
95
|
// if (!schedule_ids?.length) {
|
|
97
96
|
// const schedule_ids_data = this.store.schedule
|
|
@@ -107,7 +106,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
107
106
|
userPlugin = this.core.getPlugin('user');
|
|
108
107
|
customer_id = undefined;
|
|
109
108
|
try {
|
|
110
|
-
customer_id = userPlugin === null || userPlugin === void 0 || (_userPlugin$get = userPlugin.get()) === null || _userPlugin$get === void 0 ? void 0 : _userPlugin$get.id;
|
|
109
|
+
customer_id = paramsCustomerId || (userPlugin === null || userPlugin === void 0 || (_userPlugin$get = userPlugin.get()) === null || _userPlugin$get === void 0 ? void 0 : _userPlugin$get.id);
|
|
111
110
|
} catch (error) {
|
|
112
111
|
console.error(error);
|
|
113
112
|
}
|
|
@@ -126,9 +125,13 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
126
125
|
ids: product_ids,
|
|
127
126
|
collection: collection,
|
|
128
127
|
front_end_cache_id: cacheId,
|
|
128
|
+
menu_list_ids: menu_list_ids,
|
|
129
|
+
with_count: with_count,
|
|
129
130
|
// client_schedule_ids: schedule_ids,
|
|
130
131
|
schedule_date: schedule_date,
|
|
131
132
|
application_code: (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel,
|
|
133
|
+
with_schedule: with_schedule,
|
|
134
|
+
schedule_datetime: schedule_datetime,
|
|
132
135
|
is_eject: 1
|
|
133
136
|
}, {
|
|
134
137
|
useCache: true
|
|
@@ -137,17 +140,16 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
137
140
|
productsData = _context3.sent;
|
|
138
141
|
sortedList = (productsData.data.list || []).slice().sort(function (a, b) {
|
|
139
142
|
return Number(b.sort) - Number(a.sort);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
143
|
+
}); // if (sortedList.length) {
|
|
144
|
+
// sortedList.forEach((n: any) => {
|
|
145
|
+
// if (n.is_eject !== 1 && n['schedule.ids'] && n['schedule.ids'].length) {
|
|
146
|
+
// n.is_eject = 1
|
|
147
|
+
// }
|
|
148
|
+
// })
|
|
149
|
+
// }
|
|
148
150
|
this.addProduct(sortedList);
|
|
149
151
|
return _context3.abrupt("return", sortedList);
|
|
150
|
-
case
|
|
152
|
+
case 10:
|
|
151
153
|
case "end":
|
|
152
154
|
return _context3.stop();
|
|
153
155
|
}
|
|
@@ -198,7 +200,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
198
200
|
while (1) switch (_context5.prev = _context5.next) {
|
|
199
201
|
case 0:
|
|
200
202
|
_context5.next = 2;
|
|
201
|
-
return this.core.effects.emit(
|
|
203
|
+
return this.core.effects.emit("".concat(this.name, ":onGetProducts"), this.store.list);
|
|
202
204
|
case 2:
|
|
203
205
|
return _context5.abrupt("return", cloneDeep(this.store.list));
|
|
204
206
|
case 3:
|
|
@@ -221,7 +223,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
221
223
|
while (1) switch (_context6.prev = _context6.next) {
|
|
222
224
|
case 0:
|
|
223
225
|
_context6.next = 2;
|
|
224
|
-
return this.core.effects.emit(
|
|
226
|
+
return this.core.effects.emit("".concat(this.name, ":onGetProduct"), this.store.list);
|
|
225
227
|
case 2:
|
|
226
228
|
product = this.store.list.find(function (product) {
|
|
227
229
|
return product.id === id;
|
|
@@ -295,6 +297,26 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
295
297
|
}
|
|
296
298
|
return selectProducts;
|
|
297
299
|
}()
|
|
300
|
+
/**
|
|
301
|
+
* 根据商品编码或条码搜索商品
|
|
302
|
+
* @param code 商品编码或条码
|
|
303
|
+
* @returns 匹配的商品列表,如果没有匹配则返回空数组
|
|
304
|
+
*/
|
|
305
|
+
}, {
|
|
306
|
+
key: "findProductsByCodeOrBarcode",
|
|
307
|
+
value: function findProductsByCodeOrBarcode(code) {
|
|
308
|
+
if (!code || typeof code !== 'string') {
|
|
309
|
+
return [];
|
|
310
|
+
}
|
|
311
|
+
var trimmedCode = code.trim();
|
|
312
|
+
if (!trimmedCode) {
|
|
313
|
+
return [];
|
|
314
|
+
}
|
|
315
|
+
var matchingProducts = this.store.list.filter(function (product) {
|
|
316
|
+
return product.code && product.code.trim() === trimmedCode || product.barcode && product.barcode.trim() === trimmedCode;
|
|
317
|
+
});
|
|
318
|
+
return cloneDeep(matchingProducts);
|
|
319
|
+
}
|
|
298
320
|
}]);
|
|
299
321
|
return ProductList;
|
|
300
322
|
}(BaseModule);
|
|
@@ -89,7 +89,7 @@ export var ResourceListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
89
89
|
case 3:
|
|
90
90
|
this.store.selectedResource = resource;
|
|
91
91
|
_context3.next = 6;
|
|
92
|
-
return this.core.effects.emit(
|
|
92
|
+
return this.core.effects.emit("".concat(this.name, ":onResourceSelect"), resource);
|
|
93
93
|
case 6:
|
|
94
94
|
case "end":
|
|
95
95
|
return _context3.stop();
|
|
@@ -2,6 +2,7 @@ import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
3
|
import { Rules, RulesModuleAPI, DiscountResult } from './types';
|
|
4
4
|
import { Discount } from "../Discount/types";
|
|
5
|
+
import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
|
|
5
6
|
export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
|
|
6
7
|
protected defaultName: string;
|
|
7
8
|
protected defaultVersion: string;
|
|
@@ -35,7 +36,7 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
35
36
|
}, options?: {
|
|
36
37
|
isSelected?: boolean;
|
|
37
38
|
discountId?: number;
|
|
38
|
-
selectedList?:
|
|
39
|
+
selectedList?: SetDiscountSelectedParams[];
|
|
39
40
|
scan?: boolean;
|
|
40
41
|
}): DiscountResult;
|
|
41
42
|
/**
|