@pisell/pisellos 2.3.134 → 2.3.136
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/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/ProductList/index.js +18 -5
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/RegisterAndLogin/config.js +19 -0
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/ProductList/index.js +14 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/RegisterAndLogin/config.js +20 -0
- package/package.json +1 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -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
|
-
|
|
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:
|
|
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 =
|
|
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
|
|
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
|
|
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 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -387,6 +387,24 @@ function withH5AuthPrefix(config) {
|
|
|
387
387
|
}
|
|
388
388
|
var h5OnlineStoreConfig = withH5AuthPrefix(onlineStoreConfig);
|
|
389
389
|
|
|
390
|
+
// Kiosk 复用网店顾客认证接口,通过注册参数独立标识会员归属渠道。
|
|
391
|
+
var kioskConfig = _objectSpread(_objectSpread({}, h5OnlineStoreConfig), {}, {
|
|
392
|
+
emailCodeRegister: _objectSpread(_objectSpread({}, h5OnlineStoreConfig.emailCodeRegister), {}, {
|
|
393
|
+
transformParams: function transformParams(params) {
|
|
394
|
+
return _objectSpread(_objectSpread({}, h5OnlineStoreConfig.emailCodeRegister.transformParams(params)), {}, {
|
|
395
|
+
login_channel: 'kiosk'
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}),
|
|
399
|
+
phoneCodeRegister: _objectSpread(_objectSpread({}, h5OnlineStoreConfig.phoneCodeRegister), {}, {
|
|
400
|
+
transformParams: function transformParams(params) {
|
|
401
|
+
return _objectSpread(_objectSpread({}, h5OnlineStoreConfig.phoneCodeRegister.transformParams(params)), {}, {
|
|
402
|
+
login_channel: 'kiosk'
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
})
|
|
406
|
+
});
|
|
407
|
+
|
|
390
408
|
/**
|
|
391
409
|
* 默认配置(通用配置)
|
|
392
410
|
*/
|
|
@@ -1383,6 +1401,7 @@ var shopWebposConfig = {
|
|
|
1383
1401
|
export var channelConfigMap = {
|
|
1384
1402
|
'online-store': onlineStoreConfig,
|
|
1385
1403
|
'online-store-h5': h5OnlineStoreConfig,
|
|
1404
|
+
'kiosk': kioskConfig,
|
|
1386
1405
|
'default': defaultConfig,
|
|
1387
1406
|
'webpos': webposConfig,
|
|
1388
1407
|
'shop.webpos': shopWebposConfig
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _examples.BUY_X_GET_Y_FREE_STRATEGY;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _examples.ITEM_REWARD_STRATEGY;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "PromotionAdapter", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _adapter.PromotionAdapter;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "PromotionEvaluator", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _evaluator.PromotionEvaluator;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "default", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _adapter.default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
var _evaluator = require("./evaluator");
|
|
43
|
-
var _adapter = _interopRequireWildcard(require("./adapter"));
|
|
44
|
-
var _examples = require("./examples");
|
|
45
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
46
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
1
|
+
"use strict";
|
|
@@ -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 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -306,6 +306,25 @@ function withH5AuthPrefix(config) {
|
|
|
306
306
|
}
|
|
307
307
|
const h5OnlineStoreConfig = withH5AuthPrefix(onlineStoreConfig);
|
|
308
308
|
|
|
309
|
+
// Kiosk 复用网店顾客认证接口,通过注册参数独立标识会员归属渠道。
|
|
310
|
+
const kioskConfig = {
|
|
311
|
+
...h5OnlineStoreConfig,
|
|
312
|
+
emailCodeRegister: {
|
|
313
|
+
...h5OnlineStoreConfig.emailCodeRegister,
|
|
314
|
+
transformParams: params => ({
|
|
315
|
+
...h5OnlineStoreConfig.emailCodeRegister.transformParams(params),
|
|
316
|
+
login_channel: 'kiosk'
|
|
317
|
+
})
|
|
318
|
+
},
|
|
319
|
+
phoneCodeRegister: {
|
|
320
|
+
...h5OnlineStoreConfig.phoneCodeRegister,
|
|
321
|
+
transformParams: params => ({
|
|
322
|
+
...h5OnlineStoreConfig.phoneCodeRegister.transformParams(params),
|
|
323
|
+
login_channel: 'kiosk'
|
|
324
|
+
})
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
|
|
309
328
|
/**
|
|
310
329
|
* 默认配置(通用配置)
|
|
311
330
|
*/
|
|
@@ -1094,6 +1113,7 @@ const shopWebposConfig = {
|
|
|
1094
1113
|
const channelConfigMap = exports.channelConfigMap = {
|
|
1095
1114
|
'online-store': onlineStoreConfig,
|
|
1096
1115
|
'online-store-h5': h5OnlineStoreConfig,
|
|
1116
|
+
'kiosk': kioskConfig,
|
|
1097
1117
|
'default': defaultConfig,
|
|
1098
1118
|
'webpos': webposConfig,
|
|
1099
1119
|
'shop.webpos': shopWebposConfig
|