@pisell/pisellos 3.0.54 → 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.
- package/dist/modules/ProductList/index.d.ts +1 -0
- package/dist/modules/ProductList/index.js +6 -2
- package/dist/solution/BookingByStep/utils/resources.js +12 -4
- package/lib/modules/ProductList/index.d.ts +1 -0
- package/lib/modules/ProductList/index.js +5 -2
- package/lib/solution/BookingByStep/utils/resources.js +12 -4
- package/package.json +1 -1
|
@@ -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
|
|
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
|
});
|
|
@@ -281,7 +281,9 @@ export var getResourcesByProduct = function getResourcesByProduct(resourcesMap,
|
|
|
281
281
|
onlyComputed: true,
|
|
282
282
|
// 是否是只用来计算用,组合资源里,假设商品只关联了组合资源没关联子资源,需要通过这个计算来在后面从 renderList 里删除这个资源
|
|
283
283
|
metadata: _objectSpread(_objectSpread({}, resourcesMap[id].metadata), {}, {
|
|
284
|
-
combined_resource: resourcesMap[id].combined_resource
|
|
284
|
+
combined_resource: resourcesMap[id].combined_resource,
|
|
285
|
+
form_name: item.title,
|
|
286
|
+
resource_name: resourcesMap[id].main_field
|
|
285
287
|
})
|
|
286
288
|
}));
|
|
287
289
|
}
|
|
@@ -292,7 +294,9 @@ export var getResourcesByProduct = function getResourcesByProduct(resourcesMap,
|
|
|
292
294
|
resourceType: item.type,
|
|
293
295
|
children: combiningResources,
|
|
294
296
|
metadata: _objectSpread(_objectSpread({}, resourcesMap[d].metadata), {}, {
|
|
295
|
-
combined_resource: resourcesMap[d].combined_resource
|
|
297
|
+
combined_resource: resourcesMap[d].combined_resource,
|
|
298
|
+
form_name: item.title,
|
|
299
|
+
resource_name: resourcesMap[d].main_field
|
|
296
300
|
})
|
|
297
301
|
}));
|
|
298
302
|
}
|
|
@@ -315,7 +319,9 @@ export var getResourcesByProduct = function getResourcesByProduct(resourcesMap,
|
|
|
315
319
|
onlyComputed: true,
|
|
316
320
|
// 是否是只用来计算用,组合资源里,假设商品只关联了组合资源没关联子资源,需要通过这个计算来在后面从 renderList 里删除这个资源
|
|
317
321
|
metadata: _objectSpread(_objectSpread({}, resourcesMap[id].metadata), {}, {
|
|
318
|
-
combined_resource: resourcesMap[id].combined_resource
|
|
322
|
+
combined_resource: resourcesMap[id].combined_resource,
|
|
323
|
+
form_name: item.title,
|
|
324
|
+
resource_name: resourcesMap[id].main_field
|
|
319
325
|
})
|
|
320
326
|
}));
|
|
321
327
|
}
|
|
@@ -327,7 +333,9 @@ export var getResourcesByProduct = function getResourcesByProduct(resourcesMap,
|
|
|
327
333
|
is_default: 1,
|
|
328
334
|
children: combiningResources,
|
|
329
335
|
metadata: _objectSpread(_objectSpread({}, resourcesMap[d].metadata), {}, {
|
|
330
|
-
combined_resource: resourcesMap[d].combined_resource
|
|
336
|
+
combined_resource: resourcesMap[d].combined_resource,
|
|
337
|
+
form_name: item.title,
|
|
338
|
+
resource_name: resourcesMap[d].main_field
|
|
331
339
|
})
|
|
332
340
|
}));
|
|
333
341
|
}
|
|
@@ -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
|
);
|
|
@@ -215,7 +215,9 @@ var getResourcesByProduct = (resourcesMap, resources, selectedResources, capacit
|
|
|
215
215
|
// 是否是只用来计算用,组合资源里,假设商品只关联了组合资源没关联子资源,需要通过这个计算来在后面从 renderList 里删除这个资源
|
|
216
216
|
metadata: {
|
|
217
217
|
...resourcesMap[id].metadata,
|
|
218
|
-
combined_resource: resourcesMap[id].combined_resource
|
|
218
|
+
combined_resource: resourcesMap[id].combined_resource,
|
|
219
|
+
form_name: item.title,
|
|
220
|
+
resource_name: resourcesMap[id].main_field
|
|
219
221
|
}
|
|
220
222
|
})
|
|
221
223
|
);
|
|
@@ -230,7 +232,9 @@ var getResourcesByProduct = (resourcesMap, resources, selectedResources, capacit
|
|
|
230
232
|
children: combiningResources,
|
|
231
233
|
metadata: {
|
|
232
234
|
...resourcesMap[d].metadata,
|
|
233
|
-
combined_resource: resourcesMap[d].combined_resource
|
|
235
|
+
combined_resource: resourcesMap[d].combined_resource,
|
|
236
|
+
form_name: item.title,
|
|
237
|
+
resource_name: resourcesMap[d].main_field
|
|
234
238
|
}
|
|
235
239
|
})
|
|
236
240
|
);
|
|
@@ -259,7 +263,9 @@ var getResourcesByProduct = (resourcesMap, resources, selectedResources, capacit
|
|
|
259
263
|
// 是否是只用来计算用,组合资源里,假设商品只关联了组合资源没关联子资源,需要通过这个计算来在后面从 renderList 里删除这个资源
|
|
260
264
|
metadata: {
|
|
261
265
|
...resourcesMap[id].metadata,
|
|
262
|
-
combined_resource: resourcesMap[id].combined_resource
|
|
266
|
+
combined_resource: resourcesMap[id].combined_resource,
|
|
267
|
+
form_name: item.title,
|
|
268
|
+
resource_name: resourcesMap[id].main_field
|
|
263
269
|
}
|
|
264
270
|
})
|
|
265
271
|
);
|
|
@@ -275,7 +281,9 @@ var getResourcesByProduct = (resourcesMap, resources, selectedResources, capacit
|
|
|
275
281
|
children: combiningResources,
|
|
276
282
|
metadata: {
|
|
277
283
|
...resourcesMap[d].metadata,
|
|
278
|
-
combined_resource: resourcesMap[d].combined_resource
|
|
284
|
+
combined_resource: resourcesMap[d].combined_resource,
|
|
285
|
+
form_name: item.title,
|
|
286
|
+
resource_name: resourcesMap[d].main_field
|
|
279
287
|
}
|
|
280
288
|
})
|
|
281
289
|
);
|