@pisell/pisellos 2.1.68 → 2.1.72

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.
@@ -20,7 +20,9 @@ export interface ITime {
20
20
  date: string;
21
21
  week: string;
22
22
  weekNum: number;
23
- status: 'unavailable' | 'available';
23
+ status: 'unavailable' | 'available' | 'lots_of_space' | 'filling_up_fast' | 'sold_out';
24
+ summaryCount?: number;
25
+ availableCount?: number;
24
26
  resource?: any[];
25
27
  color?: string[];
26
28
  }
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -108,7 +108,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
108
108
  if (!product.isNeedHolder) return true;
109
109
  // 商品需要holder,但父预约及商品都无holder,返回false
110
110
  if (!orderHolderId && !productHolderId) return false;
111
-
112
111
  // 最终直接匹配 holder 是否相同
113
112
  return (productHolderId || orderHolderId) === discount.holder.holder_id;
114
113
  }
@@ -146,10 +145,11 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
146
145
  }
147
146
 
148
147
  // 合并新旧折扣列表,并计算折扣结果,注意,如果旧折扣里有 isEditMode 为 true 的优惠券,则不合并
148
+ // 保留之前扫码得到的商品券(isScan: true)
149
149
  var filteredOldDiscountList = oldDiscountList.filter(function (discount) {
150
- return !discount.isEditMode && discount.tag !== 'good_pass';
150
+ return !discount.isEditMode && (discount.tag !== 'good_pass' || discount.isScan);
151
151
  });
152
- var mergedDiscountList = uniqueById(uniqueById([].concat(_toConsumableArray(filteredOldDiscountList), _toConsumableArray(newDiscountList))), 'product_id');
152
+ var mergedDiscountList = uniqueById([].concat(_toConsumableArray(filteredOldDiscountList), _toConsumableArray(newDiscountList)));
153
153
  var result = this.calcDiscount({
154
154
  discountList: mergedDiscountList,
155
155
  productList: _toConsumableArray(productList),
@@ -299,6 +299,16 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
299
299
  errorList: any[];
300
300
  };
301
301
  getTimeSlotByAllResources(resources_code: string): any[];
302
+ getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
303
+ resources_code: string;
304
+ startDate: string;
305
+ endDate: string;
306
+ }): Promise<{
307
+ date: string;
308
+ status: string;
309
+ week: string;
310
+ weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
311
+ }[]>;
302
312
  submitTimeSlot(timeSlots: TimeSliceItem): void;
303
313
  private getScheduleDataByIds;
304
314
  openProductDetail(productId: number): Promise<void>;
@@ -316,6 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
316
326
  count: number;
317
327
  left: number;
318
328
  summaryCount: number;
329
+ status: keyof TimeStatusMap;
319
330
  }[];
320
331
  /**
321
332
  * 找到多个资源的公共可用时间段
@@ -343,7 +354,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
343
354
  };
344
355
  setOtherData(key: string, value: any): void;
345
356
  getOtherData(key: string): any;
346
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
357
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
347
358
  /**
348
359
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
349
360
  *
@@ -380,3 +391,9 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
380
391
  */
381
392
  getContactInfo(params: any): Promise<any>;
382
393
  }
394
+ interface TimeStatusMap {
395
+ lots_of_space: true;
396
+ filling_up_fast: true;
397
+ sold_out: true;
398
+ }
399
+ export {};