@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.
Files changed (47) hide show
  1. package/dist/modules/Cart/types.d.ts +0 -4
  2. package/dist/modules/Cart/utils.d.ts +0 -1
  3. package/dist/modules/Cart/utils.js +12 -23
  4. package/dist/modules/Product/index.d.ts +0 -10
  5. package/dist/modules/Product/index.js +0 -13
  6. package/dist/modules/Product/types.d.ts +0 -4
  7. package/dist/modules/Resource/types.d.ts +0 -1
  8. package/dist/modules/index.d.ts +0 -9
  9. package/dist/modules/index.js +1 -10
  10. package/dist/solution/BookingByStep/index.d.ts +5 -14
  11. package/dist/solution/BookingByStep/index.js +163 -284
  12. package/dist/solution/BookingByStep/types.d.ts +10 -2
  13. package/dist/solution/BookingByStep/types.js +7 -1
  14. package/dist/solution/BookingByStep/utils/resources.d.ts +4 -45
  15. package/dist/solution/BookingByStep/utils/resources.js +32 -153
  16. package/lib/modules/Cart/types.d.ts +0 -4
  17. package/lib/modules/Cart/utils.d.ts +0 -1
  18. package/lib/modules/Cart/utils.js +12 -24
  19. package/lib/modules/Product/index.d.ts +0 -10
  20. package/lib/modules/Product/index.js +0 -3
  21. package/lib/modules/Product/types.d.ts +0 -4
  22. package/lib/modules/Resource/types.d.ts +0 -1
  23. package/lib/modules/index.d.ts +0 -9
  24. package/lib/modules/index.js +1 -19
  25. package/lib/solution/BookingByStep/index.d.ts +5 -14
  26. package/lib/solution/BookingByStep/index.js +35 -84
  27. package/lib/solution/BookingByStep/types.d.ts +10 -2
  28. package/lib/solution/BookingByStep/types.js +12 -6
  29. package/lib/solution/BookingByStep/utils/resources.d.ts +4 -45
  30. package/lib/solution/BookingByStep/utils/resources.js +24 -101
  31. package/package.json +2 -2
  32. package/dist/modules/Schedule/index.d.ts +0 -10
  33. package/dist/modules/Schedule/index.js +0 -56
  34. package/dist/modules/Schedule/type.d.ts +0 -157
  35. package/dist/modules/Schedule/type.js +0 -1
  36. package/dist/modules/Schedule/types.d.ts +0 -177
  37. package/dist/modules/Schedule/types.js +0 -1
  38. package/dist/modules/Schedule/utils.d.ts +0 -61
  39. package/dist/modules/Schedule/utils.js +0 -700
  40. package/lib/modules/Schedule/index.d.ts +0 -10
  41. package/lib/modules/Schedule/index.js +0 -41
  42. package/lib/modules/Schedule/type.d.ts +0 -157
  43. package/lib/modules/Schedule/type.js +0 -17
  44. package/lib/modules/Schedule/types.d.ts +0 -177
  45. package/lib/modules/Schedule/types.js +0 -17
  46. package/lib/modules/Schedule/utils.d.ts +0 -61
  47. package/lib/modules/Schedule/utils.js +0 -572
@@ -90,10 +90,6 @@ export interface CartItem {
90
90
  _productOrigin?: ProductData;
91
91
  /** 资源原始数据 */
92
92
  _resourceOrigin?: Resource[];
93
- /** 容量 */
94
- capacity?: any;
95
- /** 商品套餐 */
96
- product_bundle?: any;
97
93
  }
98
94
  /**
99
95
  * 购物车状态接口
@@ -19,7 +19,6 @@ export declare const createCartItemOrigin: () => {
19
19
  sub_type: null;
20
20
  duration: null;
21
21
  like_status: string;
22
- relation_type: string;
23
22
  resources: null;
24
23
  schedule_id: number;
25
24
  start_date: null;
@@ -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
- var checkResourcesFormat = function checkResourcesFormat(resources, arr) {
230
- resources.forEach(function (resource) {
231
- var _resource$children;
232
- var childArr = [];
233
- if (resource !== null && resource !== void 0 && (_resource$children = resource.children) !== null && _resource$children !== void 0 && _resource$children.length) {
234
- checkResourcesFormat(resource.children, childArr);
235
- }
236
- arr.push({
237
- relation_type: "form",
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, [{
@@ -152,10 +152,6 @@ export interface ProductData {
152
152
  options?: any[];
153
153
  /** 商品原信息 */
154
154
  origin?: any;
155
- /** 容量 */
156
- capacity?: any;
157
- /** 商品套餐 */
158
- product_bundle?: any;
159
155
  }
160
156
  /**
161
157
  * 商品媒体信息接口
@@ -26,7 +26,6 @@ export interface Resource {
26
26
  startTime?: string;
27
27
  endTime?: string;
28
28
  resourceType?: string;
29
- children?: Resource[];
30
29
  }
31
30
  /**
32
31
  * 资源列表状态
@@ -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';
@@ -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, ResourceItem } from "./utils/resources";
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, schedule_ids }: {
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, capacity }: {
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
  }