@pisell/pisellos 3.0.5 → 3.0.6
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/modules/Account/index.d.ts +2 -6
- package/dist/modules/Account/index.js +21 -103
- package/dist/modules/Account/types.d.ts +12 -1
- package/dist/modules/AccountList/index.d.ts +20 -1
- package/dist/modules/AccountList/index.js +243 -75
- package/dist/modules/AccountList/types.d.ts +33 -1
- package/dist/modules/AccountList/types.js +8 -0
- package/dist/modules/AccountList/utils.d.ts +9 -0
- package/dist/modules/AccountList/utils.js +25 -0
- package/dist/modules/BaseModule.d.ts +2 -2
- package/dist/modules/BaseModule.js +1 -1
- package/dist/modules/Cart/index.d.ts +8 -5
- package/dist/modules/Cart/index.js +101 -25
- package/dist/modules/Cart/types.d.ts +82 -5
- package/dist/modules/Cart/types.js +22 -0
- package/dist/modules/Cart/utils.d.ts +106 -13
- package/dist/modules/Cart/utils.js +289 -76
- package/dist/modules/Date/index.d.ts +6 -6
- package/dist/modules/Date/index.js +41 -58
- package/dist/modules/Date/types.d.ts +22 -6
- package/dist/modules/Date/utils.d.ts +4 -3
- package/dist/modules/Date/utils.js +81 -30
- package/dist/modules/Discount/index.d.ts +4 -4
- package/dist/modules/Discount/index.js +11 -11
- package/dist/modules/Order/index.d.ts +11 -5
- package/dist/modules/Order/index.js +47 -18
- package/dist/modules/Order/types.d.ts +10 -3
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +15 -0
- package/dist/modules/Product/index.d.ts +14 -1
- package/dist/modules/Product/index.js +35 -0
- package/dist/modules/Product/types.d.ts +27 -3
- package/dist/modules/ProductList/index.js +11 -5
- package/dist/modules/Resource/types.d.ts +1 -0
- package/dist/modules/Resource/utils.js +1 -1
- package/dist/modules/Rules/index.d.ts +3 -3
- package/dist/modules/Rules/index.js +121 -53
- package/dist/modules/Rules/types.d.ts +5 -1
- package/dist/modules/Schedule/index.d.ts +18 -0
- package/dist/modules/Schedule/index.js +111 -0
- package/dist/modules/Schedule/type.d.ts +157 -0
- package/dist/modules/Schedule/type.js +1 -0
- package/dist/modules/Schedule/types.d.ts +182 -0
- package/dist/modules/Schedule/types.js +1 -0
- package/dist/modules/Schedule/utils.d.ts +67 -0
- package/dist/modules/Schedule/utils.js +729 -0
- package/dist/modules/Step/index.d.ts +14 -3
- package/dist/modules/Step/index.js +54 -2
- package/dist/modules/Summary/index.d.ts +12 -5
- package/dist/modules/Summary/index.js +33 -7
- package/dist/modules/Summary/types.d.ts +23 -2
- package/dist/modules/Summary/utils.d.ts +14 -4
- package/dist/modules/Summary/utils.js +46 -4
- package/dist/modules/index.d.ts +10 -0
- package/dist/modules/index.js +11 -1
- package/dist/plugins/index.d.ts +3 -3
- package/dist/plugins/request.d.ts +3 -3
- package/dist/plugins/request.js +30 -30
- package/dist/plugins/shopStore.d.ts +1 -1
- package/dist/solution/BookingByStep/index.d.ts +97 -24
- package/dist/solution/BookingByStep/index.js +1024 -322
- package/dist/solution/BookingByStep/types.d.ts +3 -10
- package/dist/solution/BookingByStep/types.js +11 -15
- package/dist/solution/BookingByStep/utils/products.d.ts +1 -1
- package/dist/solution/BookingByStep/utils/products.js +3 -0
- package/dist/solution/BookingByStep/utils/resources.d.ts +60 -6
- package/dist/solution/BookingByStep/utils/resources.js +293 -52
- package/dist/solution/ShopDiscount/index.d.ts +4 -4
- package/dist/solution/ShopDiscount/index.js +16 -16
- package/dist/solution/ShopDiscount/types.d.ts +2 -2
- package/dist/solution/ShopDiscount/utils.js +1 -1
- package/lib/core/index.js +7 -2
- package/lib/modules/Account/index.d.ts +2 -6
- package/lib/modules/Account/index.js +15 -30
- package/lib/modules/Account/types.d.ts +12 -1
- package/lib/modules/AccountList/index.d.ts +20 -1
- package/lib/modules/AccountList/index.js +122 -13
- package/lib/modules/AccountList/types.d.ts +33 -1
- package/lib/modules/AccountList/utils.d.ts +9 -0
- package/lib/modules/AccountList/utils.js +39 -0
- package/lib/modules/BaseModule.d.ts +2 -2
- package/lib/modules/BaseModule.js +14 -3
- package/lib/modules/Cart/index.d.ts +8 -5
- package/lib/modules/Cart/index.js +81 -8
- package/lib/modules/Cart/types.d.ts +82 -5
- package/lib/modules/Cart/types.js +20 -2
- package/lib/modules/Cart/utils.d.ts +106 -13
- package/lib/modules/Cart/utils.js +188 -45
- package/lib/modules/Date/index.d.ts +6 -6
- package/lib/modules/Date/index.js +13 -28
- package/lib/modules/Date/types.d.ts +22 -6
- package/lib/modules/Date/utils.d.ts +4 -3
- package/lib/modules/Date/utils.js +47 -13
- package/lib/modules/Discount/index.d.ts +4 -4
- package/lib/modules/Discount/index.js +9 -2
- package/lib/modules/Guests/index.js +4 -1
- package/lib/modules/Order/index.d.ts +11 -5
- package/lib/modules/Order/index.js +24 -3
- package/lib/modules/Order/types.d.ts +10 -3
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +45 -0
- package/lib/modules/Payment/index.js +1 -6
- package/lib/modules/Product/index.d.ts +14 -1
- package/lib/modules/Product/index.js +19 -0
- package/lib/modules/Product/types.d.ts +27 -3
- package/lib/modules/ProductList/index.js +21 -7
- package/lib/modules/Resource/index.js +4 -1
- package/lib/modules/Resource/types.d.ts +1 -0
- package/lib/modules/Resource/utils.js +7 -4
- package/lib/modules/Rules/index.d.ts +3 -3
- package/lib/modules/Rules/index.js +118 -43
- package/lib/modules/Rules/types.d.ts +5 -1
- package/lib/modules/Schedule/index.d.ts +18 -0
- package/lib/modules/Schedule/index.js +81 -0
- package/lib/modules/Schedule/type.d.ts +157 -0
- package/lib/modules/Schedule/type.js +17 -0
- package/lib/modules/Schedule/types.d.ts +182 -0
- package/lib/modules/Schedule/types.js +17 -0
- package/lib/modules/Schedule/utils.d.ts +67 -0
- package/lib/modules/Schedule/utils.js +600 -0
- package/lib/modules/Step/index.d.ts +14 -3
- package/lib/modules/Step/index.js +38 -1
- package/lib/modules/Summary/index.d.ts +12 -5
- package/lib/modules/Summary/index.js +15 -1
- package/lib/modules/Summary/types.d.ts +23 -2
- package/lib/modules/Summary/utils.d.ts +14 -4
- package/lib/modules/Summary/utils.js +30 -1
- package/lib/modules/index.d.ts +10 -0
- package/lib/modules/index.js +21 -1
- package/lib/plugins/index.d.ts +3 -3
- package/lib/plugins/request.d.ts +3 -3
- package/lib/plugins/request.js +48 -11
- package/lib/plugins/shopStore.d.ts +1 -1
- package/lib/solution/BookingByStep/index.d.ts +97 -24
- package/lib/solution/BookingByStep/index.js +693 -145
- package/lib/solution/BookingByStep/types.d.ts +3 -10
- package/lib/solution/BookingByStep/types.js +37 -14
- package/lib/solution/BookingByStep/utils/products.d.ts +1 -1
- package/lib/solution/BookingByStep/utils/products.js +3 -0
- package/lib/solution/BookingByStep/utils/resources.d.ts +60 -6
- package/lib/solution/BookingByStep/utils/resources.js +286 -54
- package/lib/solution/BuyTickets/index.js +34 -20
- package/lib/solution/ShopDiscount/index.d.ts +4 -4
- package/lib/solution/ShopDiscount/index.js +10 -2
- package/lib/solution/ShopDiscount/types.d.ts +2 -2
- package/package.json +4 -2
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Module, PisellCore } from
|
|
2
|
-
import { BaseModule } from
|
|
3
|
-
import { Response } from
|
|
4
|
-
import { BookingByStepState } from
|
|
5
|
-
import { CartItem, IUpdateItemParams, ProductData } from
|
|
6
|
-
import { Account } from
|
|
7
|
-
import { IStep } from
|
|
8
|
-
import { TimeSliceItem } from
|
|
9
|
-
import { ITime } from
|
|
1
|
+
import { Module, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { Response } from '../../plugins';
|
|
4
|
+
import { BookingByStepState } from './types';
|
|
5
|
+
import { CartItem, IUpdateItemParams, ProductData, ProductResourceItem, ECartItemInfoType, ECartItemCheckType } from '../../modules';
|
|
6
|
+
import { Account } from '../../modules/Account/types';
|
|
7
|
+
import { IStep } from '../../modules/Step/tyeps';
|
|
8
|
+
import { TimeSliceItem } from './utils/resources';
|
|
9
|
+
import { ITime } from '../../modules/Date/types';
|
|
10
|
+
import dayjs from 'dayjs';
|
|
11
|
+
import { IHolder, IFetchHolderAccountsParams } from '../../modules/AccountList/types';
|
|
10
12
|
export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
11
13
|
protected defaultName: string;
|
|
12
14
|
protected defaultVersion: string;
|
|
@@ -17,6 +19,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
17
19
|
private store;
|
|
18
20
|
private otherParams;
|
|
19
21
|
private cacheId;
|
|
22
|
+
private otherData;
|
|
20
23
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
21
24
|
initStep(stepList: (keyof BookingByStepState)[]): void;
|
|
22
25
|
getCurrentStep(): {
|
|
@@ -27,26 +30,60 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
27
30
|
back(): void;
|
|
28
31
|
gotoStep(index: number): void;
|
|
29
32
|
getStepList(): IStep[];
|
|
30
|
-
|
|
33
|
+
/**
|
|
34
|
+
* 添加step
|
|
35
|
+
*/
|
|
36
|
+
addStep(step: IStep, key?: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* 删除step
|
|
39
|
+
*/
|
|
40
|
+
removeStep(key: string): void;
|
|
41
|
+
loadProducts({ category_ids, product_ids, collection, schedule_ids, }: {
|
|
31
42
|
category_ids?: number[];
|
|
32
43
|
product_ids?: number[];
|
|
33
44
|
collection?: number | string[];
|
|
45
|
+
schedule_ids?: number[];
|
|
46
|
+
}): Promise<any>;
|
|
47
|
+
loadProductByScheduleDate({ date, product_ids, category_ids, }: {
|
|
48
|
+
date: string;
|
|
49
|
+
product_ids?: number[];
|
|
50
|
+
category_ids?: number[];
|
|
34
51
|
}): Promise<any>;
|
|
52
|
+
loadAllSchedule(): Promise<void>;
|
|
53
|
+
loadScheduleAvailableDate({ startDate, endDate, custom_page_id, }: {
|
|
54
|
+
startDate: string;
|
|
55
|
+
endDate: string;
|
|
56
|
+
custom_page_id?: number;
|
|
57
|
+
}): Promise<ITime[]>;
|
|
35
58
|
storeProduct(productData: ProductData): Promise<void>;
|
|
36
|
-
addAccount(
|
|
59
|
+
addAccount(account: Account | IHolder, extra?: {
|
|
60
|
+
type: 'account' | 'holder';
|
|
61
|
+
customerId: number;
|
|
62
|
+
}): Promise<Account | null>;
|
|
63
|
+
addAccounts(accounts: Account[] | IHolder[], extra?: {
|
|
64
|
+
type: 'account' | 'holder';
|
|
65
|
+
customerId: number;
|
|
66
|
+
}): Promise<Account[] | undefined>;
|
|
37
67
|
getAccounts(): Promise<(Account | null)[]>;
|
|
38
68
|
checkHasLoginAccount(): boolean;
|
|
39
69
|
setActiveAccount(id: string): void;
|
|
40
70
|
getActiveAccount(): Account | null;
|
|
41
71
|
removeAccount(id: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* 获取holder类型账户列表
|
|
74
|
+
* @param params
|
|
75
|
+
*/
|
|
76
|
+
fetchHolderAccountsAsync(params: IFetchHolderAccountsParams): Promise<void>;
|
|
42
77
|
setDateRange(dateRange: ITime[]): Promise<void>;
|
|
43
78
|
clearDateRange(): void;
|
|
44
79
|
getDateRange(): Promise<ITime[]>;
|
|
45
80
|
getCart(): CartItem[];
|
|
46
81
|
getAvailableDate(params?: {
|
|
82
|
+
url?: string;
|
|
47
83
|
products?: ProductData[];
|
|
48
84
|
startDate?: string;
|
|
49
85
|
endDate?: string;
|
|
86
|
+
type?: 'month' | 'day';
|
|
50
87
|
}): Promise<ITime[]>;
|
|
51
88
|
/**
|
|
52
89
|
* 获取购物车汇总信息
|
|
@@ -57,11 +94,25 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
57
94
|
taxTitle?: string | undefined;
|
|
58
95
|
totalTaxFee?: string | number | undefined;
|
|
59
96
|
isPriceIncludeTax?: 0 | 1 | undefined;
|
|
97
|
+
deposit?: {
|
|
98
|
+
total?: string | number | undefined;
|
|
99
|
+
policies?: import("../../modules/Summary/types").IProtocol[] | undefined;
|
|
100
|
+
} | undefined;
|
|
60
101
|
}>;
|
|
102
|
+
/**
|
|
103
|
+
* 获取协议
|
|
104
|
+
*/
|
|
105
|
+
getProtocol(protocolId: string): Promise<any>;
|
|
61
106
|
getProducts(): Promise<ProductData[]>;
|
|
62
107
|
setLoginAccount(accountId: string, accountInfo: Account): Promise<void>;
|
|
63
108
|
generateCartData(): Promise<void>;
|
|
64
109
|
getFreeProduct(id: string | number): Promise<Response<any>>;
|
|
110
|
+
/**
|
|
111
|
+
* 检查购物车提交订单前是否符合条件
|
|
112
|
+
* @param type 类型 "holder" | "account"
|
|
113
|
+
* @returns boolean
|
|
114
|
+
*/
|
|
115
|
+
checkBeforeSubmitOrder(type: 'holder' | 'account'): boolean;
|
|
65
116
|
submitOrder(): Promise<void>;
|
|
66
117
|
pay(): Promise<void>;
|
|
67
118
|
getPayInfo(): Promise<void>;
|
|
@@ -80,7 +131,14 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
80
131
|
/**
|
|
81
132
|
* 从购物车中按类别删除信息
|
|
82
133
|
*/
|
|
83
|
-
deleteCartItemInfo(
|
|
134
|
+
deleteCartItemInfo(type: ECartItemInfoType, _id?: string): void;
|
|
135
|
+
checkCartItemByType(cartItem: CartItem, type: ECartItemCheckType): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* 检查购物车商品是否符合条件
|
|
138
|
+
* @param type 类型
|
|
139
|
+
* @returns 不符合条件的购物车商品ID列表
|
|
140
|
+
*/
|
|
141
|
+
checkCartItems(type: ECartItemCheckType): string[];
|
|
84
142
|
destroy(): void;
|
|
85
143
|
getResourcesList(): any[];
|
|
86
144
|
getResourcesListByCartItem(id: string | number): {
|
|
@@ -96,22 +154,12 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
96
154
|
resources: any[];
|
|
97
155
|
currentResourceId: number;
|
|
98
156
|
}): TimeSliceItem[];
|
|
99
|
-
|
|
100
|
-
resourceProductData: any;
|
|
101
|
-
resources: any[];
|
|
102
|
-
timeSlots?: TimeSliceItem;
|
|
103
|
-
}): {
|
|
104
|
-
selectedResource: any;
|
|
105
|
-
timeSlots?: undefined;
|
|
106
|
-
} | {
|
|
107
|
-
timeSlots: any[];
|
|
108
|
-
selectedResource: any;
|
|
109
|
-
} | undefined;
|
|
110
|
-
autoSelectAccountResources({ holder_id, resources_code, timeSlots, countMap, }: {
|
|
157
|
+
autoSelectAccountResources({ holder_id, resources_code, timeSlots, countMap, capacity, }: {
|
|
111
158
|
holder_id: string;
|
|
112
159
|
resources_code: string | number;
|
|
113
160
|
timeSlots?: TimeSliceItem;
|
|
114
161
|
countMap: Record<number, number>;
|
|
162
|
+
capacity?: number;
|
|
115
163
|
}): {
|
|
116
164
|
selectedResource: any;
|
|
117
165
|
timeSlots?: undefined;
|
|
@@ -126,4 +174,29 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
126
174
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
127
175
|
clearCache(): void;
|
|
128
176
|
clearCacheByModule(module: string): void;
|
|
177
|
+
private getScheduleDataByIds;
|
|
178
|
+
openProductDetail(productId: number): Promise<void>;
|
|
179
|
+
closeProductDetail(): void;
|
|
180
|
+
getTimeslotBySchedule({ date, scheduleIds, resources, }: {
|
|
181
|
+
date: string;
|
|
182
|
+
scheduleIds?: number[];
|
|
183
|
+
resources?: ProductResourceItem[];
|
|
184
|
+
}): {
|
|
185
|
+
start_time: string;
|
|
186
|
+
end_time: string;
|
|
187
|
+
start_at: dayjs.Dayjs;
|
|
188
|
+
end_at: dayjs.Dayjs;
|
|
189
|
+
count: number;
|
|
190
|
+
}[];
|
|
191
|
+
addProductToCart({ product, date, account, }: {
|
|
192
|
+
product: ProductData;
|
|
193
|
+
date: {
|
|
194
|
+
startTime: string;
|
|
195
|
+
endTime: string;
|
|
196
|
+
};
|
|
197
|
+
account: Account;
|
|
198
|
+
}): void;
|
|
199
|
+
setOtherData(key: string, value: any): void;
|
|
200
|
+
getOtherData(key: string): any;
|
|
201
|
+
getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
|
|
129
202
|
}
|