@pisell/pisellos 0.0.38 → 2.0.1
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/Cart/types.d.ts +0 -4
- package/dist/modules/Cart/utils.js +11 -25
- package/dist/modules/Product/index.d.ts +0 -10
- package/dist/modules/Product/index.js +0 -13
- package/dist/modules/Product/types.d.ts +0 -4
- package/dist/modules/Resource/types.d.ts +0 -1
- package/dist/modules/index.d.ts +0 -10
- package/dist/modules/index.js +1 -11
- package/dist/solution/BookingByStep/index.d.ts +3 -13
- package/dist/solution/BookingByStep/index.js +163 -300
- package/dist/solution/BookingByStep/types.d.ts +10 -3
- package/dist/solution/BookingByStep/types.js +7 -3
- package/dist/solution/BookingByStep/utils/resources.d.ts +4 -45
- package/dist/solution/BookingByStep/utils/resources.js +33 -167
- package/lib/modules/Cart/types.d.ts +0 -4
- package/lib/modules/Cart/utils.js +11 -26
- package/lib/modules/Product/index.d.ts +0 -10
- package/lib/modules/Product/index.js +0 -3
- package/lib/modules/Product/types.d.ts +0 -4
- package/lib/modules/Resource/types.d.ts +0 -1
- package/lib/modules/index.d.ts +0 -10
- package/lib/modules/index.js +1 -21
- package/lib/solution/BookingByStep/index.d.ts +3 -13
- package/lib/solution/BookingByStep/index.js +36 -91
- package/lib/solution/BookingByStep/types.d.ts +10 -3
- package/lib/solution/BookingByStep/types.js +12 -8
- package/lib/solution/BookingByStep/utils/resources.d.ts +4 -45
- package/lib/solution/BookingByStep/utils/resources.js +25 -115
- package/package.json +2 -2
- package/dist/modules/Schedule/index.d.ts +0 -13
- package/dist/modules/Schedule/index.js +0 -71
- package/dist/modules/Schedule/type.d.ts +0 -157
- package/dist/modules/Schedule/type.js +0 -1
- package/dist/modules/Schedule/types.d.ts +0 -182
- package/dist/modules/Schedule/types.js +0 -1
- package/dist/modules/Schedule/utils.d.ts +0 -61
- package/dist/modules/Schedule/utils.js +0 -700
- package/lib/modules/Schedule/index.d.ts +0 -13
- package/lib/modules/Schedule/index.js +0 -50
- package/lib/modules/Schedule/type.d.ts +0 -157
- package/lib/modules/Schedule/type.js +0 -17
- package/lib/modules/Schedule/types.d.ts +0 -182
- package/lib/modules/Schedule/types.js +0 -17
- package/lib/modules/Schedule/utils.d.ts +0 -61
- package/lib/modules/Schedule/utils.js +0 -572
|
@@ -38,7 +38,7 @@ export var createCartItemOrigin = function createCartItemOrigin() {
|
|
|
38
38
|
// 资源相关
|
|
39
39
|
// 资源状态 -固定
|
|
40
40
|
like_status: "common",
|
|
41
|
-
// 资源类型 -
|
|
41
|
+
// // 资源类型 - 固定----谭景琳备注:马天宇说现在平行资源是不传这个的
|
|
42
42
|
// relation_type: "form",
|
|
43
43
|
// 所选资源
|
|
44
44
|
resources: null,
|
|
@@ -226,31 +226,17 @@ export var formatResourceToCartItemOrigin = function formatResourceToCartItemOri
|
|
|
226
226
|
if (resources && resources !== null && resources !== void 0 && resources.length) {
|
|
227
227
|
origin.resources = [];
|
|
228
228
|
// 接口只需要部分字段,需要处理
|
|
229
|
-
|
|
230
|
-
resources.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
like_status: "common",
|
|
239
|
-
id: resource.id,
|
|
240
|
-
main_field: resource.main_field,
|
|
241
|
-
resourceType: resource.resourceType,
|
|
242
|
-
form_id: resource.form_id,
|
|
243
|
-
relation_id: resource.id,
|
|
244
|
-
capacity: (resource === null || resource === void 0 ? void 0 : resource.capacity) || 0,
|
|
245
|
-
metadata: (resource === null || resource === void 0 ? void 0 : resource.metadata) || {} // 后端可以在这里挂一个前端用于计算的数据
|
|
246
|
-
};
|
|
247
|
-
if (childArr.length) {
|
|
248
|
-
obj.children = childArr;
|
|
249
|
-
}
|
|
250
|
-
arr.push(obj);
|
|
229
|
+
resources.forEach(function (resource) {
|
|
230
|
+
origin.resources.push({
|
|
231
|
+
like_status: "common",
|
|
232
|
+
id: resource.id,
|
|
233
|
+
main_field: resource.main_field,
|
|
234
|
+
resourceType: resource.resourceType,
|
|
235
|
+
form_id: resource.form_id,
|
|
236
|
+
relation_id: resource.id,
|
|
237
|
+
capacity: (resource === null || resource === void 0 ? void 0 : resource.capacity) || 0
|
|
251
238
|
});
|
|
252
|
-
};
|
|
253
|
-
checkResourcesFormat(resources, origin.resources);
|
|
239
|
+
});
|
|
254
240
|
var _resources$ = resources[0],
|
|
255
241
|
startTime = _resources$.startTime,
|
|
256
242
|
endTime = _resources$.endTime;
|
|
@@ -2,20 +2,10 @@ import { Module, PisellCore } from '../../types';
|
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
3
|
import { ProductData, ProductMedia, ProductTag, ProductCategory, ProductBundleGroup } from './types';
|
|
4
4
|
export * from './types';
|
|
5
|
-
/**
|
|
6
|
-
* 商品详情模块
|
|
7
|
-
* 除了跟商品列表模块组合外,还会提供单独的商品详情页的一些方法
|
|
8
|
-
*
|
|
9
|
-
* @export
|
|
10
|
-
* @class Product
|
|
11
|
-
* @extends {BaseModule}
|
|
12
|
-
* @implements {Module}
|
|
13
|
-
*/
|
|
14
5
|
export declare class Product extends BaseModule implements Module {
|
|
15
6
|
protected defaultName: string;
|
|
16
7
|
protected defaultVersion: string;
|
|
17
8
|
private store;
|
|
18
|
-
protected otherParams: any;
|
|
19
9
|
constructor(name?: string, version?: string);
|
|
20
10
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
21
11
|
/**
|
|
@@ -17,16 +17,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
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
19
|
export * from "./types";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 商品详情模块
|
|
23
|
-
* 除了跟商品列表模块组合外,还会提供单独的商品详情页的一些方法
|
|
24
|
-
*
|
|
25
|
-
* @export
|
|
26
|
-
* @class Product
|
|
27
|
-
* @extends {BaseModule}
|
|
28
|
-
* @implements {Module}
|
|
29
|
-
*/
|
|
30
20
|
export var Product = /*#__PURE__*/function (_BaseModule) {
|
|
31
21
|
_inherits(Product, _BaseModule);
|
|
32
22
|
var _super = _createSuper(Product);
|
|
@@ -37,9 +27,6 @@ export var Product = /*#__PURE__*/function (_BaseModule) {
|
|
|
37
27
|
_defineProperty(_assertThisInitialized(_this), "defaultName", 'product');
|
|
38
28
|
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
39
29
|
_defineProperty(_assertThisInitialized(_this), "store", void 0);
|
|
40
|
-
_defineProperty(_assertThisInitialized(_this), "otherParams", {
|
|
41
|
-
scheduler: []
|
|
42
|
-
});
|
|
43
30
|
return _this;
|
|
44
31
|
}
|
|
45
32
|
_createClass(Product, [{
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
export * from './Product';
|
|
2
2
|
export * from './ProductList';
|
|
3
3
|
export * from './Cart';
|
|
4
|
-
export * from './Account';
|
|
5
|
-
export * from './AccountList';
|
|
6
|
-
export * from './Date';
|
|
7
|
-
export * from './Guests';
|
|
8
|
-
export * from './Order';
|
|
9
|
-
export * from './Payment';
|
|
10
|
-
export * from './Resource';
|
|
11
|
-
export * from './Step';
|
|
12
|
-
export * from './Summary';
|
|
13
|
-
export * from './Schedule';
|
package/dist/modules/index.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
export * from "./Product";
|
|
2
2
|
export * from "./ProductList";
|
|
3
|
-
export * from "./Cart";
|
|
4
|
-
export * from "./Account";
|
|
5
|
-
export * from "./AccountList";
|
|
6
|
-
export * from "./Date";
|
|
7
|
-
export * from "./Guests";
|
|
8
|
-
export * from "./Order";
|
|
9
|
-
export * from "./Payment";
|
|
10
|
-
export * from "./Resource";
|
|
11
|
-
export * from "./Step";
|
|
12
|
-
export * from "./Summary";
|
|
13
|
-
export * from "./Schedule";
|
|
3
|
+
export * from "./Cart";
|
|
@@ -27,19 +27,11 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
27
27
|
back(): void;
|
|
28
28
|
gotoStep(index: number): void;
|
|
29
29
|
getStepList(): IStep[];
|
|
30
|
-
loadProducts({ category_ids, product_ids, collection,
|
|
30
|
+
loadProducts({ category_ids, product_ids, collection, }: {
|
|
31
31
|
category_ids?: number[];
|
|
32
32
|
product_ids?: number[];
|
|
33
33
|
collection?: number | string[];
|
|
34
|
-
schedule_ids?: number[];
|
|
35
34
|
}): Promise<any>;
|
|
36
|
-
loadProductByScheduleDate(date: string): void;
|
|
37
|
-
loadAllSchedule(): Promise<void>;
|
|
38
|
-
loadAvailableDate({ startDate, endDate, custom_page_id }: {
|
|
39
|
-
startDate: string;
|
|
40
|
-
endDate: string;
|
|
41
|
-
custom_page_id?: number;
|
|
42
|
-
}): Promise<void>;
|
|
43
35
|
storeProduct(productData: ProductData): Promise<void>;
|
|
44
36
|
addAccount(accounts: Account[]): Promise<void>;
|
|
45
37
|
getAccounts(): Promise<(Account | null)[]>;
|
|
@@ -96,7 +88,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
96
88
|
_id: string;
|
|
97
89
|
product: ProductData | undefined;
|
|
98
90
|
resources: import("./utils/resources").ResourceItem[];
|
|
99
|
-
holder_id: string | number;
|
|
91
|
+
holder_id: string | number | undefined;
|
|
100
92
|
holder_name: string | undefined;
|
|
101
93
|
} | undefined;
|
|
102
94
|
getResourceTimeSlot({ product, resources, currentResourceId, }: {
|
|
@@ -115,12 +107,11 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
115
107
|
timeSlots: any[];
|
|
116
108
|
selectedResource: any;
|
|
117
109
|
} | undefined;
|
|
118
|
-
autoSelectAccountResources({ holder_id, resources_code, timeSlots, countMap,
|
|
110
|
+
autoSelectAccountResources({ holder_id, resources_code, timeSlots, countMap, }: {
|
|
119
111
|
holder_id: string;
|
|
120
112
|
resources_code: string | number;
|
|
121
113
|
timeSlots?: TimeSliceItem;
|
|
122
114
|
countMap: Record<number, number>;
|
|
123
|
-
capacity?: number;
|
|
124
115
|
}): {
|
|
125
116
|
selectedResource: any;
|
|
126
117
|
timeSlots?: undefined;
|
|
@@ -135,5 +126,4 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
135
126
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
136
127
|
clearCache(): void;
|
|
137
128
|
clearCacheByModule(module: string): void;
|
|
138
|
-
openProductDetail(productId: number): Promise<void>;
|
|
139
129
|
}
|