@pisell/pisellos 3.0.55 → 3.0.56

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.
@@ -8,6 +8,7 @@ export declare class ProductList extends BaseModule implements Module {
8
8
  protected defaultVersion: string;
9
9
  private store;
10
10
  private request;
11
+ private otherParams;
11
12
  constructor(name?: string, version?: string);
12
13
  initialize(core: PisellCore, options: any): Promise<void>;
13
14
  storeChange(path?: string, value?: any): Promise<void>;
@@ -31,6 +31,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
31
31
  _defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
32
32
  _defineProperty(_assertThisInitialized(_this), "store", void 0);
33
33
  _defineProperty(_assertThisInitialized(_this), "request", void 0);
34
+ _defineProperty(_assertThisInitialized(_this), "otherParams", {});
34
35
  return _this;
35
36
  }
36
37
  _createClass(ProductList, [{
@@ -43,6 +44,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
43
44
  case 0:
44
45
  this.core = core;
45
46
  this.store = options.store;
47
+ this.otherParams = options.otherParams || {};
46
48
  if (Array.isArray((_options$initialState = options.initialState) === null || _options$initialState === void 0 ? void 0 : _options$initialState.list)) {
47
49
  this.store.list = options.initialState.list;
48
50
  this.core.effects.emit("".concat(this.name, ":changed"), this.store.list);
@@ -53,7 +55,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
53
55
  this.store.selectProducts = [];
54
56
  }
55
57
  this.request = core.getPlugin('request');
56
- case 4:
58
+ case 5:
57
59
  case "end":
58
60
  return _context.stop();
59
61
  }
@@ -100,6 +102,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
100
102
  key: "loadProducts",
101
103
  value: function () {
102
104
  var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
105
+ var _this$otherParams;
103
106
  var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection, schedule_date, cacheId, userPlugin, customer_id, _userPlugin$get, productsData;
104
107
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
105
108
  while (1) switch (_context3.prev = _context3.next) {
@@ -140,7 +143,8 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
140
143
  collection: collection,
141
144
  front_end_cache_id: cacheId,
142
145
  // client_schedule_ids: schedule_ids,
143
- schedule_date: schedule_date
146
+ schedule_date: schedule_date,
147
+ application_code: (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel
144
148
  }, {
145
149
  useCache: true
146
150
  });
@@ -8,6 +8,7 @@ export declare class ProductList extends BaseModule implements Module {
8
8
  protected defaultVersion: string;
9
9
  private store;
10
10
  private request;
11
+ private otherParams;
11
12
  constructor(name?: string, version?: string);
12
13
  initialize(core: PisellCore, options: any): Promise<void>;
13
14
  storeChange(path?: string, value?: any): Promise<void>;
@@ -33,11 +33,13 @@ var ProductList = class extends import_BaseModule.BaseModule {
33
33
  super(name, version);
34
34
  this.defaultName = "productList";
35
35
  this.defaultVersion = "1.0.0";
36
+ this.otherParams = {};
36
37
  }
37
38
  async initialize(core, options) {
38
39
  var _a;
39
40
  this.core = core;
40
41
  this.store = options.store;
42
+ this.otherParams = options.otherParams || {};
41
43
  if (Array.isArray((_a = options.initialState) == null ? void 0 : _a.list)) {
42
44
  this.store.list = options.initialState.list;
43
45
  this.core.effects.emit(`${this.name}:changed`, this.store.list);
@@ -71,7 +73,7 @@ var ProductList = class extends import_BaseModule.BaseModule {
71
73
  schedule_date,
72
74
  cacheId
73
75
  }) {
74
- var _a;
76
+ var _a, _b;
75
77
  let userPlugin = this.core.getPlugin("user");
76
78
  let customer_id = void 0;
77
79
  try {
@@ -102,7 +104,8 @@ var ProductList = class extends import_BaseModule.BaseModule {
102
104
  collection,
103
105
  front_end_cache_id: cacheId,
104
106
  // client_schedule_ids: schedule_ids,
105
- schedule_date
107
+ schedule_date,
108
+ application_code: (_b = this.otherParams) == null ? void 0 : _b.channel
106
109
  },
107
110
  { useCache: true }
108
111
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "3.0.55",
4
+ "version": "3.0.56",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",