@pisell/pisellos 0.0.44 → 0.0.46
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 +5 -5
- package/dist/modules/Cart/index.js +33 -19
- package/dist/modules/Cart/types.d.ts +21 -7
- package/dist/modules/Cart/utils.d.ts +29 -5
- package/dist/modules/Cart/utils.js +72 -26
- package/dist/modules/Date/index.d.ts +6 -6
- package/dist/modules/Date/index.js +41 -55
- package/dist/modules/Date/types.d.ts +22 -6
- package/dist/modules/Date/utils.d.ts +4 -3
- package/dist/modules/Date/utils.js +74 -23
- package/dist/modules/Discount/index.d.ts +4 -4
- package/dist/modules/Discount/index.js +11 -11
- package/dist/modules/Order/index.d.ts +10 -5
- package/dist/modules/Order/index.js +32 -16
- package/dist/modules/Order/types.d.ts +10 -3
- package/dist/modules/Product/index.d.ts +4 -1
- package/dist/modules/Product/index.js +22 -0
- package/dist/modules/Product/types.d.ts +7 -3
- package/dist/modules/ProductList/index.js +11 -5
- package/dist/modules/Resource/utils.js +1 -1
- package/dist/modules/Rules/index.d.ts +4 -4
- package/dist/modules/Rules/index.js +11 -11
- package/dist/modules/Rules/types.d.ts +1 -1
- package/dist/modules/Schedule/index.d.ts +8 -3
- package/dist/modules/Schedule/index.js +45 -5
- package/dist/modules/Schedule/type.d.ts +7 -7
- package/dist/modules/Schedule/types.d.ts +8 -8
- package/dist/modules/Schedule/utils.d.ts +9 -3
- package/dist/modules/Schedule/utils.js +77 -48
- package/dist/modules/Step/index.d.ts +14 -3
- package/dist/modules/Step/index.js +54 -2
- package/dist/modules/Summary/index.d.ts +5 -5
- package/dist/modules/Summary/index.js +7 -7
- package/dist/modules/Summary/types.d.ts +2 -2
- package/dist/modules/Summary/utils.d.ts +4 -4
- package/dist/modules/Summary/utils.js +3 -3
- 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 +71 -16
- package/dist/solution/BookingByStep/index.js +643 -227
- package/dist/solution/BookingByStep/types.d.ts +2 -2
- package/dist/solution/BookingByStep/types.js +9 -9
- 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 +6 -5
- package/dist/solution/BookingByStep/utils/resources.js +37 -19
- 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 +5 -5
- package/lib/modules/Cart/index.js +28 -6
- package/lib/modules/Cart/types.d.ts +21 -7
- package/lib/modules/Cart/utils.d.ts +29 -5
- package/lib/modules/Cart/utils.js +47 -3
- package/lib/modules/Date/index.d.ts +6 -6
- package/lib/modules/Date/index.js +6 -6
- package/lib/modules/Date/types.d.ts +22 -6
- package/lib/modules/Date/utils.d.ts +4 -3
- package/lib/modules/Date/utils.js +37 -6
- 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 +10 -5
- package/lib/modules/Order/index.js +11 -1
- package/lib/modules/Order/types.d.ts +10 -3
- package/lib/modules/Payment/index.js +1 -6
- package/lib/modules/Product/index.d.ts +4 -1
- package/lib/modules/Product/index.js +16 -0
- package/lib/modules/Product/types.d.ts +7 -3
- package/lib/modules/ProductList/index.js +21 -7
- package/lib/modules/Resource/index.js +4 -1
- package/lib/modules/Resource/utils.js +7 -4
- package/lib/modules/Rules/index.d.ts +4 -4
- package/lib/modules/Rules/types.d.ts +1 -1
- package/lib/modules/Schedule/index.d.ts +8 -3
- package/lib/modules/Schedule/index.js +33 -2
- package/lib/modules/Schedule/type.d.ts +7 -7
- package/lib/modules/Schedule/types.d.ts +8 -8
- package/lib/modules/Schedule/utils.d.ts +9 -3
- package/lib/modules/Schedule/utils.js +32 -4
- package/lib/modules/Step/index.d.ts +14 -3
- package/lib/modules/Step/index.js +38 -1
- package/lib/modules/Summary/index.d.ts +5 -5
- package/lib/modules/Summary/types.d.ts +2 -2
- package/lib/modules/Summary/utils.d.ts +4 -4
- 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 +71 -16
- package/lib/solution/BookingByStep/index.js +396 -48
- package/lib/solution/BookingByStep/types.d.ts +2 -2
- package/lib/solution/BookingByStep/types.js +36 -9
- 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 +6 -5
- package/lib/solution/BookingByStep/utils/resources.js +128 -58
- 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 } 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,34 +30,56 @@ 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[];
|
|
34
45
|
schedule_ids?: number[];
|
|
35
46
|
}): Promise<any>;
|
|
36
|
-
loadProductByScheduleDate(date: string):
|
|
47
|
+
loadProductByScheduleDate(date: string): Promise<any>;
|
|
37
48
|
loadAllSchedule(): Promise<void>;
|
|
38
|
-
|
|
49
|
+
loadScheduleAvailableDate({ startDate, endDate, custom_page_id, }: {
|
|
39
50
|
startDate: string;
|
|
40
51
|
endDate: string;
|
|
41
52
|
custom_page_id?: number;
|
|
42
|
-
}): Promise<
|
|
53
|
+
}): Promise<ITime[]>;
|
|
43
54
|
storeProduct(productData: ProductData): Promise<void>;
|
|
44
|
-
addAccount(
|
|
55
|
+
addAccount(account: Account | IHolder, extra?: {
|
|
56
|
+
type: 'account' | 'holder';
|
|
57
|
+
customerId: number;
|
|
58
|
+
}): Promise<Account | null>;
|
|
59
|
+
addAccounts(accounts: Account[] | IHolder[], extra?: {
|
|
60
|
+
type: 'account' | 'holder';
|
|
61
|
+
customerId: number;
|
|
62
|
+
}): Promise<Account[] | undefined>;
|
|
45
63
|
getAccounts(): Promise<(Account | null)[]>;
|
|
46
64
|
checkHasLoginAccount(): boolean;
|
|
47
65
|
setActiveAccount(id: string): void;
|
|
48
66
|
getActiveAccount(): Account | null;
|
|
49
67
|
removeAccount(id: string): void;
|
|
68
|
+
/**
|
|
69
|
+
* 获取holder类型账户列表
|
|
70
|
+
* @param params
|
|
71
|
+
*/
|
|
72
|
+
fetchHolderAccountsAsync(params: IFetchHolderAccountsParams): Promise<void>;
|
|
50
73
|
setDateRange(dateRange: ITime[]): Promise<void>;
|
|
51
74
|
clearDateRange(): void;
|
|
52
75
|
getDateRange(): Promise<ITime[]>;
|
|
53
76
|
getCart(): CartItem[];
|
|
54
77
|
getAvailableDate(params?: {
|
|
78
|
+
url?: string;
|
|
55
79
|
products?: ProductData[];
|
|
56
80
|
startDate?: string;
|
|
57
81
|
endDate?: string;
|
|
82
|
+
type?: 'month' | 'day';
|
|
58
83
|
}): Promise<ITime[]>;
|
|
59
84
|
/**
|
|
60
85
|
* 获取购物车汇总信息
|
|
@@ -78,6 +103,12 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
78
103
|
setLoginAccount(accountId: string, accountInfo: Account): Promise<void>;
|
|
79
104
|
generateCartData(): Promise<void>;
|
|
80
105
|
getFreeProduct(id: string | number): Promise<Response<any>>;
|
|
106
|
+
/**
|
|
107
|
+
* 检查购物车提交订单前是否符合条件
|
|
108
|
+
* @param type 类型 "holder" | "account"
|
|
109
|
+
* @returns boolean
|
|
110
|
+
*/
|
|
111
|
+
checkBeforeSubmitOrder(type: 'holder' | 'account'): boolean;
|
|
81
112
|
submitOrder(): Promise<void>;
|
|
82
113
|
pay(): Promise<void>;
|
|
83
114
|
getPayInfo(): Promise<void>;
|
|
@@ -96,7 +127,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
96
127
|
/**
|
|
97
128
|
* 从购物车中按类别删除信息
|
|
98
129
|
*/
|
|
99
|
-
deleteCartItemInfo(types:
|
|
130
|
+
deleteCartItemInfo(types: 'resource' | 'time'): void;
|
|
100
131
|
destroy(): void;
|
|
101
132
|
getResourcesList(): any[];
|
|
102
133
|
getResourcesListByCartItem(id: string | number): {
|
|
@@ -123,7 +154,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
123
154
|
timeSlots: any[];
|
|
124
155
|
selectedResource: any;
|
|
125
156
|
} | undefined;
|
|
126
|
-
autoSelectAccountResources({ holder_id, resources_code, timeSlots, countMap, capacity }: {
|
|
157
|
+
autoSelectAccountResources({ holder_id, resources_code, timeSlots, countMap, capacity, }: {
|
|
127
158
|
holder_id: string;
|
|
128
159
|
resources_code: string | number;
|
|
129
160
|
timeSlots?: TimeSliceItem;
|
|
@@ -143,5 +174,29 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
143
174
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
144
175
|
clearCache(): void;
|
|
145
176
|
clearCacheByModule(module: string): void;
|
|
177
|
+
private getScheduleDataByIds;
|
|
146
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">;
|
|
147
202
|
}
|