@pisell/pisellos 1.0.49 → 1.0.50
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 +4 -3
- package/dist/effects/index.js +15 -6
- 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/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 +697 -0
- package/dist/modules/Customer/types.d.ts +146 -0
- package/dist/modules/Customer/types.js +41 -0
- package/dist/modules/ProductList/index.d.ts +12 -1
- package/dist/modules/ProductList/index.js +28 -4
- package/dist/modules/Rules/index.js +7 -5
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingTicket/index.d.ts +160 -0
- package/dist/solution/BookingTicket/index.js +640 -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 +19 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +182 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +59 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +201 -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/ShopDiscount/index.js +4 -2
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/utils/task.d.ts +31 -0
- package/dist/utils/task.js +150 -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 +4 -3
- package/lib/effects/index.js +4 -1
- 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/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 +440 -0
- package/lib/modules/Customer/types.d.ts +146 -0
- package/lib/modules/Customer/types.js +37 -0
- package/lib/modules/ProductList/index.d.ts +12 -1
- package/lib/modules/ProductList/index.js +30 -3
- package/lib/modules/Rules/index.js +4 -3
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -0
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingTicket/index.d.ts +160 -0
- package/lib/solution/BookingTicket/index.js +381 -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 +19 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +137 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +59 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +149 -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/ShopDiscount/index.js +2 -1
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +2 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/utils/task.d.ts +31 -0
- package/lib/utils/task.js +84 -0
- package/lib/utils/watch.d.ts +102 -0
- package/lib/utils/watch.js +217 -0
- package/package.json +1 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ICustomer } from "../AccountList/types";
|
|
2
|
+
export declare enum CustomerHooks {
|
|
3
|
+
OnCustomerListUpdate = "customer:onUpdate",
|
|
4
|
+
OnCustomerListError = "customer:onError",
|
|
5
|
+
OnCustomerSelected = "customer:onSelected",
|
|
6
|
+
OnPaginationChange = "customer:onPaginationChange",
|
|
7
|
+
OnScrollLoadMore = "customer:onScrollLoadMore",
|
|
8
|
+
OnScrollLoadComplete = "customer:onScrollLoadComplete"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 客户数据
|
|
12
|
+
*/
|
|
13
|
+
export interface ShopCustomer extends ICustomer {
|
|
14
|
+
/** 客户ID */
|
|
15
|
+
id: string | number;
|
|
16
|
+
/** 客户姓名 */
|
|
17
|
+
name: string;
|
|
18
|
+
/** 客户电话 */
|
|
19
|
+
phone?: string;
|
|
20
|
+
/** 客户邮箱 */
|
|
21
|
+
email?: string;
|
|
22
|
+
/** 客户创建时间 */
|
|
23
|
+
created_at?: string;
|
|
24
|
+
/** 客户更新时间 */
|
|
25
|
+
updated_at?: string;
|
|
26
|
+
/** 其他客户信息 */
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 客户列表关联查询参数
|
|
31
|
+
*
|
|
32
|
+
* formRecord: 用户表单记录
|
|
33
|
+
* walletDetails.wallet: 用户所有wallet
|
|
34
|
+
* latestWalletDetail.wallet: 用户最新wallet
|
|
35
|
+
*/
|
|
36
|
+
type CustomerWith = 'formRecord' | 'walletDetails.wallet' | 'latestWalletDetail.wallet';
|
|
37
|
+
/**
|
|
38
|
+
* 获取客户列表参数
|
|
39
|
+
*/
|
|
40
|
+
export interface ShopGetCustomerListParams {
|
|
41
|
+
/** 页码 */
|
|
42
|
+
skip?: number;
|
|
43
|
+
/** 每页数量 */
|
|
44
|
+
num?: number;
|
|
45
|
+
/** 搜索关键词 */
|
|
46
|
+
search?: string;
|
|
47
|
+
/** 关联查询参数 */
|
|
48
|
+
with?: CustomerWith[];
|
|
49
|
+
/** wallet搜索标识 */
|
|
50
|
+
search_wallet_flag?: 0 | 1;
|
|
51
|
+
/** wallet pass搜索标识 */
|
|
52
|
+
search_wallet_pass_flag?: 0 | 1;
|
|
53
|
+
/** 其他筛选参数 */
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 分页信息
|
|
58
|
+
*/
|
|
59
|
+
export interface IPaginationInfo {
|
|
60
|
+
/** 当前页码 */
|
|
61
|
+
page: number;
|
|
62
|
+
/** 每页数量 */
|
|
63
|
+
pageSize: number;
|
|
64
|
+
/** 总数 */
|
|
65
|
+
total: number;
|
|
66
|
+
/** 总页数 */
|
|
67
|
+
totalPages: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 客户列表响应
|
|
71
|
+
*/
|
|
72
|
+
export interface ICustomerListResponse {
|
|
73
|
+
/** 客户列表 */
|
|
74
|
+
list: ShopCustomer[];
|
|
75
|
+
/** 总数 */
|
|
76
|
+
total: number;
|
|
77
|
+
/** 当前页 */
|
|
78
|
+
page?: number;
|
|
79
|
+
/** 每页数量 */
|
|
80
|
+
pageSize?: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 客户列表状态
|
|
84
|
+
*/
|
|
85
|
+
export interface CustomerState {
|
|
86
|
+
/** 客户列表 */
|
|
87
|
+
customerList: ShopCustomer[];
|
|
88
|
+
/** 当前选择的客户 */
|
|
89
|
+
selectedCustomer: ShopCustomer | null;
|
|
90
|
+
/** 列表总数 */
|
|
91
|
+
total: number;
|
|
92
|
+
/** 当前页码 */
|
|
93
|
+
currentPage: number;
|
|
94
|
+
/** 每页数量 */
|
|
95
|
+
pageSize: number;
|
|
96
|
+
/** 加载状态 */
|
|
97
|
+
loading: boolean;
|
|
98
|
+
/** 错误信息 */
|
|
99
|
+
error: string | null;
|
|
100
|
+
/** 是否支持滚动加载更多 */
|
|
101
|
+
hasMore: boolean;
|
|
102
|
+
/** 滚动加载状态 */
|
|
103
|
+
loadingMore: boolean;
|
|
104
|
+
/** 当前搜索条件 */
|
|
105
|
+
searchParams: Omit<ShopGetCustomerListParams, 'skip' | 'num'>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 客户模块 API
|
|
109
|
+
*/
|
|
110
|
+
export interface CustomerModuleAPI {
|
|
111
|
+
/** 获取客户列表 */
|
|
112
|
+
getCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
113
|
+
/** 设置客户列表 */
|
|
114
|
+
setCustomerList: (customers: ShopCustomer[], total?: number) => void;
|
|
115
|
+
/** 设置当前选择的客户 */
|
|
116
|
+
setSelectedCustomer: (customer: ShopCustomer | null) => void;
|
|
117
|
+
/** 获取当前选择的客户 */
|
|
118
|
+
getSelectedCustomer: () => ShopCustomer | null;
|
|
119
|
+
/** 获取客户列表 */
|
|
120
|
+
getCustomers: () => ShopCustomer[];
|
|
121
|
+
/** 根据ID查找客户 */
|
|
122
|
+
getCustomerById: (id: string | number) => ShopCustomer | null;
|
|
123
|
+
/** 清空客户列表 */
|
|
124
|
+
clearCustomers: () => void;
|
|
125
|
+
/** 添加客户到列表第一位 */
|
|
126
|
+
addCustomerToFirst: (customer: ShopCustomer) => void;
|
|
127
|
+
/** 获取当前状态 */
|
|
128
|
+
getState: () => CustomerState;
|
|
129
|
+
/** 获取分页信息 */
|
|
130
|
+
getPaginationInfo: () => IPaginationInfo;
|
|
131
|
+
/** 触发分页变化事件 */
|
|
132
|
+
triggerPaginationChange: (pagination: IPaginationInfo) => void;
|
|
133
|
+
/** 设置分页信息 */
|
|
134
|
+
setPaginationInfo: (page: number, pageSize: number) => void;
|
|
135
|
+
/** 便捷方法:切换分页并自动获取数据 */
|
|
136
|
+
changeCustomerPage: (page: number, pageSize?: number) => Promise<ICustomerListResponse>;
|
|
137
|
+
/** 滚动加载更多客户数据 */
|
|
138
|
+
loadMoreCustomers: () => Promise<ICustomerListResponse>;
|
|
139
|
+
/** 重置并重新开始滚动加载 */
|
|
140
|
+
resetAndLoadCustomers: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
141
|
+
/** 检查是否还有更多数据可以加载 */
|
|
142
|
+
hasMoreCustomers: () => boolean;
|
|
143
|
+
/** 获取当前的搜索条件 */
|
|
144
|
+
getCurrentSearchParams: () => Omit<ShopGetCustomerListParams, 'skip' | 'num'>;
|
|
145
|
+
}
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
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/types.ts
|
|
20
|
+
var types_exports = {};
|
|
21
|
+
__export(types_exports, {
|
|
22
|
+
CustomerHooks: () => CustomerHooks
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(types_exports);
|
|
25
|
+
var CustomerHooks = /* @__PURE__ */ ((CustomerHooks2) => {
|
|
26
|
+
CustomerHooks2["OnCustomerListUpdate"] = "customer:onUpdate";
|
|
27
|
+
CustomerHooks2["OnCustomerListError"] = "customer:onError";
|
|
28
|
+
CustomerHooks2["OnCustomerSelected"] = "customer:onSelected";
|
|
29
|
+
CustomerHooks2["OnPaginationChange"] = "customer:onPaginationChange";
|
|
30
|
+
CustomerHooks2["OnScrollLoadMore"] = "customer:onScrollLoadMore";
|
|
31
|
+
CustomerHooks2["OnScrollLoadComplete"] = "customer:onScrollLoadComplete";
|
|
32
|
+
return CustomerHooks2;
|
|
33
|
+
})(CustomerHooks || {});
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
CustomerHooks
|
|
37
|
+
});
|
|
@@ -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<Product | 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
|
}
|
|
@@ -68,14 +68,19 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
68
68
|
category_ids = [],
|
|
69
69
|
product_ids = [],
|
|
70
70
|
collection = [],
|
|
71
|
+
menu_list_ids = [],
|
|
72
|
+
customer_id: paramsCustomerId,
|
|
73
|
+
with_count = [],
|
|
74
|
+
schedule_datetime,
|
|
71
75
|
schedule_date,
|
|
72
|
-
cacheId
|
|
76
|
+
cacheId,
|
|
77
|
+
with_schedule
|
|
73
78
|
}) {
|
|
74
79
|
var _a;
|
|
75
80
|
let userPlugin = this.core.getPlugin("user");
|
|
76
81
|
let customer_id = void 0;
|
|
77
82
|
try {
|
|
78
|
-
customer_id = (_a = userPlugin == null ? void 0 : userPlugin.get()) == null ? void 0 : _a.id;
|
|
83
|
+
customer_id = paramsCustomerId || ((_a = userPlugin == null ? void 0 : userPlugin.get()) == null ? void 0 : _a.id);
|
|
79
84
|
} catch (error) {
|
|
80
85
|
console.error(error);
|
|
81
86
|
}
|
|
@@ -101,8 +106,12 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
101
106
|
ids: product_ids,
|
|
102
107
|
collection,
|
|
103
108
|
front_end_cache_id: cacheId,
|
|
109
|
+
menu_list_ids,
|
|
110
|
+
with_count,
|
|
104
111
|
// client_schedule_ids: schedule_ids,
|
|
105
|
-
schedule_date
|
|
112
|
+
schedule_date,
|
|
113
|
+
with_schedule,
|
|
114
|
+
schedule_datetime
|
|
106
115
|
},
|
|
107
116
|
{ useCache: true }
|
|
108
117
|
);
|
|
@@ -161,6 +170,24 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
161
170
|
async selectProducts(products) {
|
|
162
171
|
this.store.selectProducts = products;
|
|
163
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* 根据商品编码或条码搜索商品
|
|
175
|
+
* @param code 商品编码或条码
|
|
176
|
+
* @returns 匹配的商品列表,如果没有匹配则返回空数组
|
|
177
|
+
*/
|
|
178
|
+
findProductsByCodeOrBarcode(code) {
|
|
179
|
+
if (!code || typeof code !== "string") {
|
|
180
|
+
return [];
|
|
181
|
+
}
|
|
182
|
+
const trimmedCode = code.trim();
|
|
183
|
+
if (!trimmedCode) {
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
const matchingProducts = this.store.list.filter((product) => {
|
|
187
|
+
return product.code && product.code.trim() === trimmedCode || product.barcode && product.barcode.trim() === trimmedCode;
|
|
188
|
+
});
|
|
189
|
+
return (0, import_lodash_es.cloneDeep)(matchingProducts);
|
|
190
|
+
}
|
|
164
191
|
};
|
|
165
192
|
// Annotate the CommonJS export names for ESM import in node:
|
|
166
193
|
0 && (module.exports = {
|
|
@@ -37,6 +37,7 @@ var import_types = require("./types");
|
|
|
37
37
|
var import_utils = require("../../solution/ShopDiscount/utils");
|
|
38
38
|
var import_utils2 = require("../Cart/utils");
|
|
39
39
|
var import_decimal = __toESM(require("decimal.js"));
|
|
40
|
+
var import_lodash_es = require("lodash-es");
|
|
40
41
|
var RulesModule = class extends import_BaseModule.BaseModule {
|
|
41
42
|
constructor(name, version) {
|
|
42
43
|
super(name, version);
|
|
@@ -215,9 +216,9 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
215
216
|
}
|
|
216
217
|
const applicableDiscounts = sortedDiscountList.filter((discount) => {
|
|
217
218
|
var _a2;
|
|
218
|
-
if ((Number(product.price)
|
|
219
|
+
if ((Number(product.price) <= 0 || !product.price) && (discount.tag || discount.type) === "good_pass")
|
|
219
220
|
return false;
|
|
220
|
-
if ((Number(product.total)
|
|
221
|
+
if ((Number(product.total) <= 0 || !product.total) && !((_a2 = product.discount_list) == null ? void 0 : _a2.find((n) => {
|
|
221
222
|
var _a3;
|
|
222
223
|
return ((_a3 = n.discount) == null ? void 0 : _a3.resource_id) === discount.id;
|
|
223
224
|
})) && (discount.tag || discount.type) !== "good_pass")
|
|
@@ -242,7 +243,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
242
243
|
}))) {
|
|
243
244
|
isManualDiscount = false;
|
|
244
245
|
}
|
|
245
|
-
if (applicableDiscounts.length === 0 || isManualDiscount) {
|
|
246
|
+
if (applicableDiscounts.length === 0 || isManualDiscount || (0, import_lodash_es.isBoolean)(product.vouchersApplicable) && !product.vouchersApplicable) {
|
|
246
247
|
if (product.isClient) {
|
|
247
248
|
processedProductsMap.set(
|
|
248
249
|
product._id,
|
package/lib/modules/index.d.ts
CHANGED
package/lib/modules/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __reExport(modules_exports, require("./ProductList"), module.exports);
|
|
|
21
21
|
__reExport(modules_exports, require("./Cart"), module.exports);
|
|
22
22
|
__reExport(modules_exports, require("./Account"), module.exports);
|
|
23
23
|
__reExport(modules_exports, require("./AccountList"), module.exports);
|
|
24
|
+
__reExport(modules_exports, require("./Customer"), module.exports);
|
|
24
25
|
__reExport(modules_exports, require("./Date"), module.exports);
|
|
25
26
|
__reExport(modules_exports, require("./Guests"), module.exports);
|
|
26
27
|
__reExport(modules_exports, require("./Order"), module.exports);
|
|
@@ -36,6 +37,7 @@ __reExport(modules_exports, require("./Schedule"), module.exports);
|
|
|
36
37
|
...require("./Cart"),
|
|
37
38
|
...require("./Account"),
|
|
38
39
|
...require("./AccountList"),
|
|
40
|
+
...require("./Customer"),
|
|
39
41
|
...require("./Date"),
|
|
40
42
|
...require("./Guests"),
|
|
41
43
|
...require("./Order"),
|
package/lib/plugins/window.d.ts
CHANGED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Module, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
4
|
+
import { IGetCustomerListParams, ICustomer, ILoadProductsParams, IScanResult } from './types';
|
|
5
|
+
import { ProductData } from '../../modules';
|
|
6
|
+
export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
7
|
+
protected defaultName: string;
|
|
8
|
+
protected defaultVersion: string;
|
|
9
|
+
isSolution: boolean;
|
|
10
|
+
request: RequestPlugin;
|
|
11
|
+
window: WindowPlugin;
|
|
12
|
+
private shopStore;
|
|
13
|
+
private store;
|
|
14
|
+
private otherParams;
|
|
15
|
+
private cacheId;
|
|
16
|
+
private platform;
|
|
17
|
+
private scan;
|
|
18
|
+
initialize(core: PisellCore, options: any): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* 获取商品列表
|
|
21
|
+
* @param params 包含 schedule_date 的参数
|
|
22
|
+
* @returns 商品列表
|
|
23
|
+
*/
|
|
24
|
+
loadProducts(params?: ILoadProductsParams): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* 获取商品列表(不加载到模块中)
|
|
27
|
+
* @returns 商品列表
|
|
28
|
+
*/
|
|
29
|
+
getProducts(): Promise<ProductData[]>;
|
|
30
|
+
/**
|
|
31
|
+
* 获取客户列表
|
|
32
|
+
* @param params 查询参数
|
|
33
|
+
* @returns 客户列表响应
|
|
34
|
+
*/
|
|
35
|
+
getCustomerList(params?: IGetCustomerListParams): Promise<import("../../modules").ICustomerListResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* 设置活跃客户
|
|
38
|
+
* @param customer 客户信息
|
|
39
|
+
*/
|
|
40
|
+
setActiveCustomer(customer: ICustomer): void;
|
|
41
|
+
/**
|
|
42
|
+
* 获取当前活跃客户
|
|
43
|
+
* @returns 当前活跃客户
|
|
44
|
+
*/
|
|
45
|
+
getActiveCustomer(): ICustomer | null;
|
|
46
|
+
/**
|
|
47
|
+
* 根据ID设置选中的客户
|
|
48
|
+
* @param customerId 客户ID
|
|
49
|
+
*/
|
|
50
|
+
setSelectedCustomerById(customerId: string | number): void;
|
|
51
|
+
/**
|
|
52
|
+
* 获取所有客户
|
|
53
|
+
* @returns 客户列表
|
|
54
|
+
*/
|
|
55
|
+
getCustomers(): ICustomer[];
|
|
56
|
+
/**
|
|
57
|
+
* 根据ID获取客户
|
|
58
|
+
* @param customerId 客户ID
|
|
59
|
+
* @returns 客户信息
|
|
60
|
+
*/
|
|
61
|
+
getCustomerById(customerId: string | number): ICustomer | null;
|
|
62
|
+
/**
|
|
63
|
+
* 清空客户列表
|
|
64
|
+
*/
|
|
65
|
+
clearCustomers(): void;
|
|
66
|
+
/**
|
|
67
|
+
* 添加客户到列表第一位
|
|
68
|
+
* @param customer 要添加的客户信息
|
|
69
|
+
*/
|
|
70
|
+
addCustomerToFirst(customer: ICustomer): void;
|
|
71
|
+
/**
|
|
72
|
+
* 获取客户分页信息
|
|
73
|
+
* @returns 分页信息
|
|
74
|
+
*/
|
|
75
|
+
getCustomerPaginationInfo(): import("../../modules").IPaginationInfo;
|
|
76
|
+
/**
|
|
77
|
+
* 获取客户列表总数
|
|
78
|
+
* @returns 总数
|
|
79
|
+
*/
|
|
80
|
+
getCustomerTotal(): number;
|
|
81
|
+
/**
|
|
82
|
+
* 设置客户分页信息
|
|
83
|
+
* @param page 页码
|
|
84
|
+
* @param pageSize 每页数量
|
|
85
|
+
*/
|
|
86
|
+
setCustomerPaginationInfo(page: number, pageSize: number): void;
|
|
87
|
+
/**
|
|
88
|
+
* 便捷方法:切换客户分页并自动获取数据
|
|
89
|
+
* @param page 页码
|
|
90
|
+
* @param pageSize 每页数量(可选)
|
|
91
|
+
* @returns 客户列表响应
|
|
92
|
+
*/
|
|
93
|
+
changeCustomerPage(page: number, pageSize?: number): Promise<import("../../modules").ICustomerListResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* 滚动加载更多客户数据 - 数据会追加到现有列表中
|
|
96
|
+
* @returns 客户列表响应
|
|
97
|
+
*/
|
|
98
|
+
loadMoreCustomers(): Promise<import("../../modules").ICustomerListResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* 重置并重新开始滚动加载客户数据
|
|
101
|
+
* @param params 查询参数
|
|
102
|
+
* @returns 客户列表响应
|
|
103
|
+
*/
|
|
104
|
+
resetAndLoadCustomers(params?: IGetCustomerListParams): Promise<import("../../modules").ICustomerListResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* 检查是否还有更多客户数据可以加载
|
|
107
|
+
* @returns 是否还有更多数据
|
|
108
|
+
*/
|
|
109
|
+
hasMoreCustomers(): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* 获取当前的客户搜索条件
|
|
112
|
+
* @returns 当前搜索条件
|
|
113
|
+
*/
|
|
114
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
115
|
+
/**
|
|
116
|
+
* 获取客户列表状态(包含滚动加载相关状态)
|
|
117
|
+
* @returns 客户状态
|
|
118
|
+
*/
|
|
119
|
+
getCustomerState(): import("../../modules").CustomerState;
|
|
120
|
+
/**
|
|
121
|
+
* 全局扫描监听
|
|
122
|
+
* @param callback 回调
|
|
123
|
+
*/
|
|
124
|
+
scanGlobalListener(callback: (data: IScanResult) => void): {
|
|
125
|
+
remove: () => void;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* 客户扫描监听
|
|
129
|
+
* @param callback 回调
|
|
130
|
+
*/
|
|
131
|
+
scanCustomerListener(callback: (data: IScanResult) => void): {
|
|
132
|
+
remove: () => void;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* 调用摄像头
|
|
136
|
+
* @param data 用户自定义数据
|
|
137
|
+
*/
|
|
138
|
+
activateCamera(data?: {
|
|
139
|
+
[key: string]: any;
|
|
140
|
+
}): void;
|
|
141
|
+
/**
|
|
142
|
+
* 设置其他参数
|
|
143
|
+
* @param params 参数
|
|
144
|
+
* @param options 选项
|
|
145
|
+
*/
|
|
146
|
+
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
147
|
+
cover?: boolean;
|
|
148
|
+
}): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* 获取其他参数
|
|
151
|
+
* @returns 其他参数
|
|
152
|
+
*/
|
|
153
|
+
getOtherParams(): Promise<Record<string, any>>;
|
|
154
|
+
/**
|
|
155
|
+
* 销毁模块
|
|
156
|
+
*/
|
|
157
|
+
destroy(): void;
|
|
158
|
+
}
|
|
159
|
+
export * from './types';
|
|
160
|
+
export { BookingTicketImpl as BookingTicket };
|