@pisell/pisellos 2.2.131 → 2.2.133
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/core/index.js +0 -1
- package/dist/modules/Discount/types.d.ts +1 -1
- package/dist/modules/Rules/index.js +7 -6
- package/dist/server/index.d.ts +5 -0
- package/dist/server/index.js +530 -416
- package/dist/solution/ShopDiscount/index.js +1 -1
- package/lib/core/index.js +0 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/Discount/types.d.ts +1 -1
- package/lib/modules/Rules/index.js +7 -7
- package/lib/server/index.d.ts +5 -0
- package/lib/server/index.js +78 -2
- package/lib/solution/ShopDiscount/index.js +1 -1
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -19,7 +19,7 @@ interface PackageSubItemUsageRules {
|
|
|
19
19
|
type: 'universal_discount' | 'package_exclusive' | 'single_item_promo' | 'custom_usage_rules';
|
|
20
20
|
rules: ("original_price" | "markup_price")[];
|
|
21
21
|
package_scope?: {
|
|
22
|
-
type: 'all_packages' | 'specific_packages';
|
|
22
|
+
type: 'all_packages' | 'specific_packages' | 'product_all' | 'products';
|
|
23
23
|
exclude_bundle_product_ids: number[];
|
|
24
24
|
include_bundle_product_ids: number[];
|
|
25
25
|
filter: 0 | 1;
|
|
@@ -159,10 +159,11 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
// 合并新旧折扣列表,并计算折扣结果,注意,如果旧折扣里有 isEditMode 为 true 的优惠券,则不合并
|
|
162
|
+
// 保留之前扫码得到的商品券(isScan: true)
|
|
162
163
|
var filteredOldDiscountList = oldDiscountList.filter(function (discount) {
|
|
163
|
-
return !discount.isEditMode && discount.tag !== 'good_pass';
|
|
164
|
+
return !discount.isEditMode && (discount.tag !== 'good_pass' || discount.isScan);
|
|
164
165
|
});
|
|
165
|
-
var mergedDiscountList = uniqueById(
|
|
166
|
+
var mergedDiscountList = uniqueById([].concat(_toConsumableArray(filteredOldDiscountList), _toConsumableArray(newDiscountList)));
|
|
166
167
|
var result = this.calcDiscount({
|
|
167
168
|
discountList: mergedDiscountList,
|
|
168
169
|
productList: _toConsumableArray(productList),
|
|
@@ -2006,8 +2007,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2006
2007
|
// 套餐适用范围校验
|
|
2007
2008
|
var isScopeValid = false;
|
|
2008
2009
|
|
|
2009
|
-
//
|
|
2010
|
-
if (scopeType === 'all_packages') {
|
|
2010
|
+
// 排除套餐判断, product_all值兼容旧数据
|
|
2011
|
+
if (scopeType === 'all_packages' || scopeType === 'product_all') {
|
|
2011
2012
|
// 所有套餐可用
|
|
2012
2013
|
if (!filter) {
|
|
2013
2014
|
isScopeValid = true;
|
|
@@ -2016,8 +2017,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2016
2017
|
}
|
|
2017
2018
|
}
|
|
2018
2019
|
|
|
2019
|
-
//
|
|
2020
|
-
if (scopeType === 'specific_packages') {
|
|
2020
|
+
// 包含套餐判断, products值兼容旧数据
|
|
2021
|
+
if (scopeType === 'specific_packages' || scopeType === 'products') {
|
|
2021
2022
|
isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
2022
2023
|
}
|
|
2023
2024
|
|
package/dist/server/index.d.ts
CHANGED
|
@@ -166,6 +166,11 @@ declare class Server {
|
|
|
166
166
|
* 存储订阅者信息,便于数据变更时推送最新结果
|
|
167
167
|
*/
|
|
168
168
|
private handleProductQuery;
|
|
169
|
+
/**
|
|
170
|
+
* 按商品 id 查询单条(GET /shop/product/query/:productId)
|
|
171
|
+
* schedule_date 必填:query 或 data;schedule_datetime 可选。不走订阅。
|
|
172
|
+
*/
|
|
173
|
+
private handleProductQueryById;
|
|
169
174
|
/**
|
|
170
175
|
* 取消商品查询订阅(HTTP 路由入口)
|
|
171
176
|
*/
|