@pisell/pisellos 2.3.134 → 2.3.135

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.
@@ -156,7 +156,10 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
156
156
  value: function () {
157
157
  var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
158
158
  var _this$otherParams,
159
+ _this$otherParams$bus,
159
160
  _this$otherParams2,
161
+ _this$otherParams3,
162
+ _this$otherParams4,
160
163
  _this2 = this;
161
164
  var _ref,
162
165
  _ref$category_ids,
@@ -185,6 +188,8 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
185
188
  channelMap,
186
189
  rawApplicationCode,
187
190
  mappedApplicationCode,
191
+ configuredBusinessCode,
192
+ resolvedStrategyContext,
188
193
  queryPayload,
189
194
  handledByOsServer,
190
195
  originalCallback,
@@ -227,7 +232,15 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
227
232
  };
228
233
  rawApplicationCode = (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel;
229
234
  mappedApplicationCode = typeof rawApplicationCode === 'string' ? channelMap[rawApplicationCode] || rawApplicationCode : rawApplicationCode;
230
- queryPayload = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, isCustomerUserPlatform((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.platform) ? {} : {
235
+ configuredBusinessCode = (_this$otherParams$bus = (_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : (_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.business_code; // application_code 是后端商品筛选字段;智能定价评估器则只读取
236
+ // strategy_context 中的 channel / business_code。默认补齐两者,
237
+ // 但允许调用方显式传入的上下文覆盖默认值。
238
+ resolvedStrategyContext = _objectSpread(_objectSpread(_objectSpread({}, mappedApplicationCode ? {
239
+ channel: mappedApplicationCode
240
+ } : {}), configuredBusinessCode ? {
241
+ business_code: configuredBusinessCode
242
+ } : {}), strategy_context || {});
243
+ queryPayload = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, isCustomerUserPlatform((_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.platform) ? {} : {
231
244
  open_quotation: 1
232
245
  }), {}, {
233
246
  open_bundle: 0,
@@ -256,7 +269,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
256
269
  with_schedule: with_schedule,
257
270
  schedule_datetime: schedule_datetime,
258
271
  extension_type: extension_type,
259
- strategy_context: strategy_context
272
+ strategy_context: Object.keys(resolvedStrategyContext).length ? resolvedStrategyContext : undefined
260
273
  });
261
274
  handledByOsServer = isProductQueryHandledByOsServer(this.core, this.request);
262
275
  originalCallback = options === null || options === void 0 ? void 0 : options.callback;
@@ -305,14 +318,14 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
305
318
  return _ref2.apply(this, arguments);
306
319
  };
307
320
  }()) : undefined;
308
- _context5.next = 14;
321
+ _context5.next = 16;
309
322
  return this.request.post("/product/query", queryPayload, {
310
323
  osServer: true,
311
324
  callback: subscriptionCallback,
312
325
  subscriberId: options === null || options === void 0 ? void 0 : options.subscriberId,
313
326
  customToast: function customToast() {}
314
327
  });
315
- case 14:
328
+ case 16:
316
329
  productsData = _context5.sent;
317
330
  if (!handledByOsServer && Array.isArray(productsData.data.list)) {
318
331
  this.replaceRawProductQueryResult(productsData.data.list, product_ids);
@@ -335,7 +348,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
335
348
  // }
336
349
  this.addProduct(sortedList);
337
350
  return _context5.abrupt("return", sortedList);
338
- case 20:
351
+ case 22:
339
352
  case "end":
340
353
  return _context5.stop();
341
354
  }
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
329
+ weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -130,6 +130,19 @@ class ProductList extends _BaseModule.BaseModule {
130
130
  };
131
131
  const rawApplicationCode = this.otherParams?.channel;
132
132
  const mappedApplicationCode = typeof rawApplicationCode === 'string' ? channelMap[rawApplicationCode] || rawApplicationCode : rawApplicationCode;
133
+ const configuredBusinessCode = this.otherParams?.businessCode ?? this.otherParams?.business_code;
134
+ // application_code 是后端商品筛选字段;智能定价评估器则只读取
135
+ // strategy_context 中的 channel / business_code。默认补齐两者,
136
+ // 但允许调用方显式传入的上下文覆盖默认值。
137
+ const resolvedStrategyContext = {
138
+ ...(mappedApplicationCode ? {
139
+ channel: mappedApplicationCode
140
+ } : {}),
141
+ ...(configuredBusinessCode ? {
142
+ business_code: configuredBusinessCode
143
+ } : {}),
144
+ ...(strategy_context || {})
145
+ };
133
146
  const queryPayload = {
134
147
  ...((0, _platform.isCustomerUserPlatform)(this.otherParams?.platform) ? {} : {
135
148
  open_quotation: 1
@@ -162,7 +175,7 @@ class ProductList extends _BaseModule.BaseModule {
162
175
  with_schedule,
163
176
  schedule_datetime,
164
177
  extension_type,
165
- strategy_context
178
+ strategy_context: Object.keys(resolvedStrategyContext).length ? resolvedStrategyContext : undefined
166
179
  };
167
180
  const handledByOsServer = (0, _clientDataVariants.isProductQueryHandledByOsServer)(this.core, this.request);
168
181
  const originalCallback = options?.callback;
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
329
+ weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.3.134",
4
+ "version": "2.3.135",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",