@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { AccountModule, Account } from '../Account';
|
|
3
3
|
import { BaseModule } from '../BaseModule';
|
|
4
|
-
import { IFetchHolderAccountsParams, IHolder } from './types';
|
|
4
|
+
import { IFetchHolderAccountsParams, IHolder, IGetCustomerListParams } from './types';
|
|
5
5
|
export declare class AccountListModule extends BaseModule implements Module {
|
|
6
6
|
protected defaultName: string;
|
|
7
7
|
protected defaultVersion: string;
|
|
@@ -37,6 +37,12 @@ export declare class AccountListModule extends BaseModule implements Module {
|
|
|
37
37
|
customerId: number;
|
|
38
38
|
type?: 'unshift' | 'push';
|
|
39
39
|
}): Promise<AccountModule[]>;
|
|
40
|
+
/**
|
|
41
|
+
* 获取客户列表
|
|
42
|
+
* @param params 查询参数
|
|
43
|
+
* @returns 客户列表
|
|
44
|
+
*/
|
|
45
|
+
getCustomerList(params?: IGetCustomerListParams): Promise<any>;
|
|
40
46
|
/**
|
|
41
47
|
* 获取holder类型账户列表
|
|
42
48
|
* @param params
|
|
@@ -288,6 +288,33 @@ var AccountListModule = class extends import_BaseModule.BaseModule {
|
|
|
288
288
|
);
|
|
289
289
|
return accountModules;
|
|
290
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* 获取客户列表
|
|
293
|
+
* @param params 查询参数
|
|
294
|
+
* @returns 客户列表
|
|
295
|
+
*/
|
|
296
|
+
async getCustomerList(params = {}) {
|
|
297
|
+
const url = "/customer/es/data";
|
|
298
|
+
const { page = 1, pageSize = 20, keyword, ...otherParams } = params;
|
|
299
|
+
try {
|
|
300
|
+
this.store.isLoading = true;
|
|
301
|
+
this.store.error = null;
|
|
302
|
+
const queryParams = {
|
|
303
|
+
page,
|
|
304
|
+
pageSize,
|
|
305
|
+
...keyword && { keyword },
|
|
306
|
+
...otherParams
|
|
307
|
+
};
|
|
308
|
+
const res = await this.request.get(url, queryParams);
|
|
309
|
+
return (res == null ? void 0 : res.data) || [];
|
|
310
|
+
} catch (error) {
|
|
311
|
+
console.error("Failed to fetch customer list:", error);
|
|
312
|
+
this.store.error = error instanceof Error ? error.message : "Failed to fetch customer list";
|
|
313
|
+
throw error;
|
|
314
|
+
} finally {
|
|
315
|
+
this.store.isLoading = false;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
291
318
|
/**
|
|
292
319
|
* 获取holder类型账户列表
|
|
293
320
|
* @param params
|
|
@@ -67,3 +67,31 @@ export interface IHolder {
|
|
|
67
67
|
main_field: string;
|
|
68
68
|
customer_cover?: string;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* 获取客户列表参数
|
|
72
|
+
*/
|
|
73
|
+
export interface IGetCustomerListParams {
|
|
74
|
+
/** 页码 */
|
|
75
|
+
page?: number;
|
|
76
|
+
/** 每页数量 */
|
|
77
|
+
pageSize?: number;
|
|
78
|
+
/** 搜索关键词 */
|
|
79
|
+
keyword?: string;
|
|
80
|
+
/** 其他筛选参数 */
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 客户数据
|
|
85
|
+
*/
|
|
86
|
+
export interface ICustomer {
|
|
87
|
+
/** 客户ID */
|
|
88
|
+
id: string | number;
|
|
89
|
+
/** 客户姓名 */
|
|
90
|
+
name: string;
|
|
91
|
+
/** 客户电话 */
|
|
92
|
+
phone?: string;
|
|
93
|
+
/** 客户邮箱 */
|
|
94
|
+
email?: string;
|
|
95
|
+
/** 其他客户信息 */
|
|
96
|
+
[key: string]: any;
|
|
97
|
+
}
|
|
@@ -14,4 +14,7 @@ export declare class BaseModule {
|
|
|
14
14
|
store: any;
|
|
15
15
|
cacheKey: string[];
|
|
16
16
|
}): void;
|
|
17
|
+
effectsOn(eventType: string, callback: (payload: any) => void): () => void;
|
|
18
|
+
effectsOff(eventType: string, callback: (payload: any) => void): void;
|
|
19
|
+
effectsOnce(eventType: string, callback: (payload: any) => void): () => void;
|
|
17
20
|
}
|
|
@@ -82,6 +82,15 @@ var BaseModule = class {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
effectsOn(eventType, callback) {
|
|
86
|
+
return this.core.effects.on(`${this.name}:${eventType}`, callback);
|
|
87
|
+
}
|
|
88
|
+
effectsOff(eventType, callback) {
|
|
89
|
+
return this.core.effects.off(`${this.name}:${eventType}`, callback);
|
|
90
|
+
}
|
|
91
|
+
effectsOnce(eventType, callback) {
|
|
92
|
+
return this.core.effects.once(`${this.name}:${eventType}`, callback);
|
|
93
|
+
}
|
|
85
94
|
};
|
|
86
95
|
// Annotate the CommonJS export names for ESM import in node:
|
|
87
96
|
0 && (module.exports = {
|
|
@@ -3,6 +3,7 @@ import { BaseModule } from '../BaseModule';
|
|
|
3
3
|
import { CartItem, CartModuleAPI, ECartItemCheckType, ECartItemInfoType, IAddItemParams, IUpdateItemParams } from './types';
|
|
4
4
|
import { Account } from '../Account';
|
|
5
5
|
export * from './types';
|
|
6
|
+
export { getProductDeposit } from './utils';
|
|
6
7
|
/**
|
|
7
8
|
* 购物车模块实现
|
|
8
9
|
*/
|
|
@@ -20,7 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/modules/Cart/index.ts
|
|
21
21
|
var Cart_exports = {};
|
|
22
22
|
__export(Cart_exports, {
|
|
23
|
-
CartModule: () => CartModule
|
|
23
|
+
CartModule: () => CartModule,
|
|
24
|
+
getProductDeposit: () => import_utils3.getProductDeposit
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(Cart_exports);
|
|
26
27
|
var import_BaseModule = require("../BaseModule");
|
|
@@ -29,9 +30,10 @@ var import_utils = require("./utils");
|
|
|
29
30
|
var import_lodash_es = require("lodash-es");
|
|
30
31
|
var import_utils2 = require("../Product/utils");
|
|
31
32
|
__reExport(Cart_exports, require("./types"), module.exports);
|
|
33
|
+
var import_utils3 = require("./utils");
|
|
32
34
|
var CartModule = class extends import_BaseModule.BaseModule {
|
|
33
35
|
constructor(name, version) {
|
|
34
|
-
super(name, version);
|
|
36
|
+
super(name || "cart", version || "1.0.0");
|
|
35
37
|
// 提供给 baseModule 用的默认名称 和 默认版本
|
|
36
38
|
this.defaultName = "cart";
|
|
37
39
|
this.defaultVersion = "1.0.0";
|
|
@@ -361,5 +363,6 @@ var CartModule = class extends import_BaseModule.BaseModule {
|
|
|
361
363
|
// Annotate the CommonJS export names for ESM import in node:
|
|
362
364
|
0 && (module.exports = {
|
|
363
365
|
CartModule,
|
|
366
|
+
getProductDeposit,
|
|
364
367
|
...require("./types")
|
|
365
368
|
});
|
|
@@ -139,7 +139,7 @@ var formatProductToCartItem = (params) => {
|
|
|
139
139
|
return cartItem;
|
|
140
140
|
};
|
|
141
141
|
var formatProductToCartItemOrigin = (params) => {
|
|
142
|
-
var _a, _b, _c, _d;
|
|
142
|
+
var _a, _b, _c, _d, _e;
|
|
143
143
|
const {
|
|
144
144
|
cartItem,
|
|
145
145
|
product,
|
|
@@ -149,17 +149,27 @@ var formatProductToCartItemOrigin = (params) => {
|
|
|
149
149
|
quantity = 1
|
|
150
150
|
} = params;
|
|
151
151
|
let origin = cartItem._origin;
|
|
152
|
+
const product_discount_difference = (((_a = origin.product) == null ? void 0 : _a.discount_list) || []).filter((item) => {
|
|
153
|
+
var _a2;
|
|
154
|
+
return !((_a2 = item == null ? void 0 : item.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id);
|
|
155
|
+
}).reduce((pre, cur) => {
|
|
156
|
+
var _a2;
|
|
157
|
+
return pre + (((_a2 = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a2.product_discount_difference) || 0);
|
|
158
|
+
}, 0);
|
|
152
159
|
if (product) {
|
|
153
160
|
origin.product = {
|
|
154
161
|
...origin.product || {},
|
|
155
162
|
num: quantity,
|
|
156
163
|
product_id: product.id,
|
|
157
164
|
product_variant_id: product_variant_id || 0,
|
|
158
|
-
product_bundle: ((
|
|
159
|
-
product_option_item: ((
|
|
165
|
+
product_bundle: ((_b = origin.product) == null ? void 0 : _b.product_bundle) || [],
|
|
166
|
+
product_option_item: ((_c = origin.product) == null ? void 0 : _c.product_option_item) || [],
|
|
167
|
+
metadata: {
|
|
168
|
+
product_discount_difference
|
|
169
|
+
}
|
|
160
170
|
};
|
|
161
|
-
origin.sub_type = (
|
|
162
|
-
origin.duration = (
|
|
171
|
+
origin.sub_type = (_d = product == null ? void 0 : product.duration) == null ? void 0 : _d.type;
|
|
172
|
+
origin.duration = (_e = product == null ? void 0 : product.duration) == null ? void 0 : _e.value;
|
|
163
173
|
if (bundle == null ? void 0 : bundle.length) {
|
|
164
174
|
origin.product.product_bundle = formatBundleToOrigin(bundle);
|
|
165
175
|
}
|
|
@@ -176,6 +186,7 @@ var getProductTotalPrice = (params) => {
|
|
|
176
186
|
discounts.forEach((currentValue) => {
|
|
177
187
|
var _a;
|
|
178
188
|
price = (0, import_utils2.getDiscountAmount)({
|
|
189
|
+
amount: currentValue.amount,
|
|
179
190
|
tag: currentValue.type,
|
|
180
191
|
par_value: currentValue.discount.percent,
|
|
181
192
|
metadata: {
|
|
@@ -272,6 +283,10 @@ var formatBundleToOrigin = (bundle) => {
|
|
|
272
283
|
var _a;
|
|
273
284
|
return (d == null ? void 0 : d[key]) || ((_a = d == null ? void 0 : d.originBundleItem) == null ? void 0 : _a[key]);
|
|
274
285
|
};
|
|
286
|
+
const product_discount_difference = ((d == null ? void 0 : d.discount_list) || []).reduce((pre, cur) => {
|
|
287
|
+
var _a;
|
|
288
|
+
return pre + (((_a = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a.product_discount_difference) || 0);
|
|
289
|
+
}, 0);
|
|
275
290
|
return {
|
|
276
291
|
bundle_group_id: getBundleValueByKey("group_id"),
|
|
277
292
|
bundle_id: d.id,
|
|
@@ -284,7 +299,8 @@ var formatBundleToOrigin = (bundle) => {
|
|
|
284
299
|
discount_list: d.discount_list,
|
|
285
300
|
"bundle_selling_price": d == null ? void 0 : d.price,
|
|
286
301
|
metadata: {
|
|
287
|
-
custom_product_bundle_map_id: d._id
|
|
302
|
+
custom_product_bundle_map_id: d._id,
|
|
303
|
+
product_discount_difference
|
|
288
304
|
}
|
|
289
305
|
};
|
|
290
306
|
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/modules/Customer/constants.ts
|
|
20
|
+
var constants_exports = {};
|
|
21
|
+
__export(constants_exports, {
|
|
22
|
+
DEFAULT_CUSTOMER: () => DEFAULT_CUSTOMER,
|
|
23
|
+
DEFAULT_PAGE_SIZE: () => DEFAULT_PAGE_SIZE,
|
|
24
|
+
SORT_BY: () => SORT_BY
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(constants_exports);
|
|
27
|
+
var SORT_BY = "id";
|
|
28
|
+
var DEFAULT_PAGE_SIZE = 20;
|
|
29
|
+
var DEFAULT_CUSTOMER = {
|
|
30
|
+
"id": 1,
|
|
31
|
+
"nickname": "Select a customer",
|
|
32
|
+
"name": "选择一个客户"
|
|
33
|
+
};
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
DEFAULT_CUSTOMER,
|
|
37
|
+
DEFAULT_PAGE_SIZE,
|
|
38
|
+
SORT_BY
|
|
39
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
|
+
import { BaseModule } from '../BaseModule';
|
|
3
|
+
import { CustomerState, ShopCustomer, ShopGetCustomerListParams, CustomerModuleAPI, IPaginationInfo, ICustomerListResponse } from './types';
|
|
4
|
+
export declare class CustomerModule extends BaseModule implements Module, CustomerModuleAPI {
|
|
5
|
+
protected defaultName: string;
|
|
6
|
+
protected defaultVersion: string;
|
|
7
|
+
private store;
|
|
8
|
+
private request;
|
|
9
|
+
private cacheId;
|
|
10
|
+
private openCache;
|
|
11
|
+
private fatherModule;
|
|
12
|
+
constructor(name?: string, version?: string);
|
|
13
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* 获取客户列表数据(内部方法)
|
|
16
|
+
* @param params 查询参数
|
|
17
|
+
* @returns API响应数据
|
|
18
|
+
*/
|
|
19
|
+
private fetchCustomerListData;
|
|
20
|
+
/**
|
|
21
|
+
* 处理客户列表操作的错误(内部方法)
|
|
22
|
+
* @param error 错误对象
|
|
23
|
+
* @param operation 操作名称
|
|
24
|
+
*/
|
|
25
|
+
private handleCustomerListError;
|
|
26
|
+
/**
|
|
27
|
+
* 获取客户列表
|
|
28
|
+
* @param params 查询参数
|
|
29
|
+
* @returns 客户列表响应
|
|
30
|
+
*/
|
|
31
|
+
getCustomerList(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* 设置客户列表
|
|
34
|
+
* @param customers 客户列表
|
|
35
|
+
* @param total 总数
|
|
36
|
+
*/
|
|
37
|
+
setCustomerList(customers: ShopCustomer[], total?: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* 设置当前选择的客户
|
|
40
|
+
* @param customer 选择的客户
|
|
41
|
+
*/
|
|
42
|
+
setSelectedCustomer(customer: ShopCustomer | null): void;
|
|
43
|
+
/**
|
|
44
|
+
* 获取当前选择的客户
|
|
45
|
+
* @returns 当前选择的客户
|
|
46
|
+
*/
|
|
47
|
+
getSelectedCustomer(): ShopCustomer | null;
|
|
48
|
+
/**
|
|
49
|
+
* 获取客户列表
|
|
50
|
+
* @returns 客户列表
|
|
51
|
+
*/
|
|
52
|
+
getCustomers(): ShopCustomer[];
|
|
53
|
+
/**
|
|
54
|
+
* 根据ID查找客户
|
|
55
|
+
* @param id 客户ID
|
|
56
|
+
* @returns 客户信息
|
|
57
|
+
*/
|
|
58
|
+
getCustomerById(id: string | number): ShopCustomer | null;
|
|
59
|
+
/**
|
|
60
|
+
* 清空客户列表
|
|
61
|
+
*/
|
|
62
|
+
clearCustomers(): void;
|
|
63
|
+
/**
|
|
64
|
+
* 添加客户到列表第一位
|
|
65
|
+
* @param customer 要添加的客户信息
|
|
66
|
+
*/
|
|
67
|
+
addCustomerToFirst(customer: ShopCustomer): void;
|
|
68
|
+
/**
|
|
69
|
+
* 获取当前状态
|
|
70
|
+
* @returns 当前状态
|
|
71
|
+
*/
|
|
72
|
+
getState(): CustomerState;
|
|
73
|
+
/**
|
|
74
|
+
* 获取分页信息
|
|
75
|
+
* @returns 分页信息
|
|
76
|
+
*/
|
|
77
|
+
getPaginationInfo(): IPaginationInfo;
|
|
78
|
+
/**
|
|
79
|
+
* 触发分页变化事件
|
|
80
|
+
* @param pagination 分页信息
|
|
81
|
+
*/
|
|
82
|
+
triggerPaginationChange(pagination: IPaginationInfo): void;
|
|
83
|
+
/**
|
|
84
|
+
* 设置分页信息
|
|
85
|
+
* @param page 页码
|
|
86
|
+
* @param pageSize 每页数量
|
|
87
|
+
*/
|
|
88
|
+
setPaginationInfo(page: number, pageSize: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* 便捷方法:切换分页并自动获取数据
|
|
91
|
+
* @param page 页码
|
|
92
|
+
* @param pageSize 每页数量(可选,不传则使用当前pageSize)
|
|
93
|
+
* @returns 客户列表响应
|
|
94
|
+
*/
|
|
95
|
+
changeCustomerPage(page: number, pageSize?: number): Promise<ICustomerListResponse>;
|
|
96
|
+
/**
|
|
97
|
+
* 滚动加载更多客户数据 - 数据会追加到现有列表中
|
|
98
|
+
* @returns 客户列表响应
|
|
99
|
+
*/
|
|
100
|
+
loadMoreCustomers(): Promise<ICustomerListResponse>;
|
|
101
|
+
/**
|
|
102
|
+
* 重置并重新开始滚动加载
|
|
103
|
+
* @param params 查询参数
|
|
104
|
+
* @returns 客户列表响应
|
|
105
|
+
*/
|
|
106
|
+
resetAndLoadCustomers(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* 检查是否还有更多数据可以加载
|
|
109
|
+
* @returns 是否还有更多数据
|
|
110
|
+
*/
|
|
111
|
+
hasMoreCustomers(): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* 获取当前的搜索条件
|
|
114
|
+
* @returns 当前搜索条件
|
|
115
|
+
*/
|
|
116
|
+
getCurrentSearchParams(): Omit<ShopGetCustomerListParams, 'skip' | 'num'>;
|
|
117
|
+
/**
|
|
118
|
+
* 缓存状态变化
|
|
119
|
+
*/
|
|
120
|
+
private storeChange;
|
|
121
|
+
}
|
|
122
|
+
export * from './types';
|