@pisell/pisellos 0.0.37 → 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.d.ts +0 -1
- package/dist/modules/Cart/utils.js +12 -23
- 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 -9
- package/dist/modules/index.js +1 -10
- package/dist/solution/BookingByStep/index.d.ts +5 -14
- package/dist/solution/BookingByStep/index.js +163 -284
- package/dist/solution/BookingByStep/types.d.ts +10 -2
- package/dist/solution/BookingByStep/types.js +7 -1
- package/dist/solution/BookingByStep/utils/resources.d.ts +4 -45
- package/dist/solution/BookingByStep/utils/resources.js +32 -153
- package/lib/modules/Cart/types.d.ts +0 -4
- package/lib/modules/Cart/utils.d.ts +0 -1
- package/lib/modules/Cart/utils.js +12 -24
- 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 -9
- package/lib/modules/index.js +1 -19
- package/lib/solution/BookingByStep/index.d.ts +5 -14
- package/lib/solution/BookingByStep/index.js +35 -84
- package/lib/solution/BookingByStep/types.d.ts +10 -2
- package/lib/solution/BookingByStep/types.js +12 -6
- package/lib/solution/BookingByStep/utils/resources.d.ts +4 -45
- package/lib/solution/BookingByStep/utils/resources.js +24 -101
- package/package.json +2 -2
- package/dist/modules/Schedule/index.d.ts +0 -10
- package/dist/modules/Schedule/index.js +0 -56
- 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 -177
- 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 -10
- package/lib/modules/Schedule/index.js +0 -41
- 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 -177
- 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,8 +38,8 @@ export var createCartItemOrigin = function createCartItemOrigin() {
|
|
|
38
38
|
// 资源相关
|
|
39
39
|
// 资源状态 -固定
|
|
40
40
|
like_status: "common",
|
|
41
|
-
// 资源类型 -
|
|
42
|
-
relation_type: "form",
|
|
41
|
+
// // 资源类型 - 固定----谭景琳备注:马天宇说现在平行资源是不传这个的
|
|
42
|
+
// relation_type: "form",
|
|
43
43
|
// 所选资源
|
|
44
44
|
resources: null,
|
|
45
45
|
// 日程id - 固定
|
|
@@ -226,28 +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
|
-
children: childArr,
|
|
246
|
-
metadata: (resource === null || resource === void 0 ? void 0 : resource.metadata) || {} // 后端可以在这里挂一个前端用于计算的数据
|
|
247
|
-
});
|
|
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
|
|
248
238
|
});
|
|
249
|
-
};
|
|
250
|
-
checkResourcesFormat(resources, origin.resources);
|
|
239
|
+
});
|
|
251
240
|
var _resources$ = resources[0],
|
|
252
241
|
startTime = _resources$.startTime,
|
|
253
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,12 +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';
|
package/dist/modules/index.js
CHANGED
|
@@ -1,12 +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";
|
|
3
|
+
export * from "./Cart";
|
|
@@ -5,7 +5,7 @@ import { BookingByStepState } from "./types";
|
|
|
5
5
|
import { CartItem, IUpdateItemParams, ProductData } from "../../modules";
|
|
6
6
|
import { Account } from "../../modules/Account/types";
|
|
7
7
|
import { IStep } from "../../modules/Step/tyeps";
|
|
8
|
-
import { TimeSliceItem
|
|
8
|
+
import { TimeSliceItem } from "./utils/resources";
|
|
9
9
|
import { ITime } from "../../modules/Date/types";
|
|
10
10
|
export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
11
11
|
protected defaultName: string;
|
|
@@ -27,17 +27,10 @@ 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
|
-
}): Promise<any>;
|
|
36
|
-
loadAllSchedule(): Promise<void>;
|
|
37
|
-
loadAvailableDate({ startDate, endDate, custom_page_id }: {
|
|
38
|
-
startDate: string;
|
|
39
|
-
endDate: string;
|
|
40
|
-
custom_page_id?: number;
|
|
41
34
|
}): Promise<any>;
|
|
42
35
|
storeProduct(productData: ProductData): Promise<void>;
|
|
43
36
|
addAccount(accounts: Account[]): Promise<void>;
|
|
@@ -94,8 +87,8 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
94
87
|
id: number | undefined;
|
|
95
88
|
_id: string;
|
|
96
89
|
product: ProductData | undefined;
|
|
97
|
-
resources: ResourceItem[];
|
|
98
|
-
holder_id: string | number;
|
|
90
|
+
resources: import("./utils/resources").ResourceItem[];
|
|
91
|
+
holder_id: string | number | undefined;
|
|
99
92
|
holder_name: string | undefined;
|
|
100
93
|
} | undefined;
|
|
101
94
|
getResourceTimeSlot({ product, resources, currentResourceId, }: {
|
|
@@ -114,12 +107,11 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
114
107
|
timeSlots: any[];
|
|
115
108
|
selectedResource: any;
|
|
116
109
|
} | undefined;
|
|
117
|
-
autoSelectAccountResources({ holder_id, resources_code, timeSlots, countMap,
|
|
110
|
+
autoSelectAccountResources({ holder_id, resources_code, timeSlots, countMap, }: {
|
|
118
111
|
holder_id: string;
|
|
119
112
|
resources_code: string | number;
|
|
120
113
|
timeSlots?: TimeSliceItem;
|
|
121
114
|
countMap: Record<number, number>;
|
|
122
|
-
capacity?: number;
|
|
123
115
|
}): {
|
|
124
116
|
selectedResource: any;
|
|
125
117
|
timeSlots?: undefined;
|
|
@@ -134,5 +126,4 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
134
126
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
135
127
|
clearCache(): void;
|
|
136
128
|
clearCacheByModule(module: string): void;
|
|
137
|
-
openProductDetail(productId: number): Promise<void>;
|
|
138
129
|
}
|