@pisell/pisellos 2.2.34 → 2.2.36

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.
@@ -22,6 +22,7 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
22
22
  with_discount_card: 0 | 1;
23
23
  customer_id: number;
24
24
  with_wallet_pass_holder: 0 | 1;
25
+ request_timezone: string;
25
26
  }): Promise<Discount[]>;
26
27
  batchSearch(code: string, customerId?: number): Promise<Discount[]>;
27
28
  filterEnabledDiscountList(discountList: Discount[]): Discount[];
@@ -190,7 +190,8 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
190
190
  relation_product: 1,
191
191
  with: ['extensionData', 'customScheduleSnapshot', 'holder.detail'],
192
192
  order_behavior_count: 1,
193
- order_behavior_count_customer_id: customerId || 1
193
+ order_behavior_count_customer_id: customerId || 1,
194
+ request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
194
195
  });
195
196
  case 2:
196
197
  result = _context5.sent;
@@ -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(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -7,7 +7,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
9
  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); }
10
- import Decimal from 'decimal.js';
11
10
  import { getScheduleStartEndTimePoints } from "../modules/schedule/utils";
12
11
  import { getUniqueId } from "../../modules/Cart/utils";
13
12
 
@@ -121,9 +120,6 @@ export function applyPriceDataToProducts(products, priceData) {
121
120
  if (priceBi) {
122
121
  // 处理 markdown 类型
123
122
  var price = priceBi.price;
124
- if (priceBi.price_type === 'markdown') {
125
- price = new Decimal(price || 0).mul(-1).toNumber();
126
- }
127
123
  return _objectSpread(_objectSpread({}, bi), {}, {
128
124
  price: String(price),
129
125
  base_price: String(priceBi.base_price)
@@ -343,7 +343,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
343
343
  };
344
344
  setOtherData(key: string, value: any): void;
345
345
  getOtherData(key: string): any;
346
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
346
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
347
347
  /**
348
348
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
349
349
  *
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
@@ -741,7 +741,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
741
741
  action: 'create',
742
742
  with_good_pass: 1,
743
743
  with_discount_card: 1,
744
- with_wallet_pass_holder: 1
744
+ with_wallet_pass_holder: 1,
745
+ request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
745
746
  });
746
747
  case 4:
747
748
  goodPassList = _context9.sent;
@@ -22,6 +22,7 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
22
22
  with_discount_card: 0 | 1;
23
23
  customer_id: number;
24
24
  with_wallet_pass_holder: 0 | 1;
25
+ request_timezone: string;
25
26
  }): Promise<Discount[]>;
26
27
  batchSearch(code: string, customerId?: number): Promise<Discount[]>;
27
28
  filterEnabledDiscountList(discountList: Discount[]): Discount[];
@@ -111,7 +111,8 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
111
111
  relation_product: 1,
112
112
  with: ["extensionData", "customScheduleSnapshot", "holder.detail"],
113
113
  order_behavior_count: 1,
114
- order_behavior_count_customer_id: customerId || 1
114
+ order_behavior_count_customer_id: customerId || 1,
115
+ request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
115
116
  });
116
117
  const resultDiscountList = this.filterEnabledDiscountList((result == null ? void 0 : result.data) || []) || [];
117
118
  return resultDiscountList;
@@ -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(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/server/utils/product.ts
@@ -34,7 +24,6 @@ __export(product_exports, {
34
24
  getIsSessionProduct: () => getIsSessionProduct
35
25
  });
36
26
  module.exports = __toCommonJS(product_exports);
37
- var import_decimal = __toESM(require("decimal.js"));
38
27
  var import_utils = require("../modules/schedule/utils");
39
28
  var import_utils2 = require("../../modules/Cart/utils");
40
29
  function buildPriceIndexMap(priceData) {
@@ -108,9 +97,6 @@ function applyPriceDataToProducts(products, priceData) {
108
97
  const priceBi = groupItemMap.get(bi.id);
109
98
  if (priceBi) {
110
99
  let price = priceBi.price;
111
- if (priceBi.price_type === "markdown") {
112
- price = new import_decimal.default(price || 0).mul(-1).toNumber();
113
- }
114
100
  return {
115
101
  ...bi,
116
102
  price: String(price),
@@ -343,7 +343,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
343
343
  };
344
344
  setOtherData(key: string, value: any): void;
345
345
  getOtherData(key: string): any;
346
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
346
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
347
347
  /**
348
348
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
349
349
  *
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
@@ -490,7 +490,8 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
490
490
  action: "create",
491
491
  with_good_pass: 1,
492
492
  with_discount_card: 1,
493
- with_wallet_pass_holder: 1
493
+ with_wallet_pass_holder: 1,
494
+ request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
494
495
  }));
495
496
  const scanDiscount = (_c = this.getDiscountList()) == null ? void 0 : _c.filter(
496
497
  (item) => item.isScan
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.34",
4
+ "version": "2.2.36",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",