@pisell/pisellos 0.0.351 → 0.0.352
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.
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -1154,8 +1154,9 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1154
1154
|
|
|
1155
1155
|
// 如果是手动折扣,使用原有的total和origin_total,不重新计算
|
|
1156
1156
|
if (isManualDiscount) {
|
|
1157
|
-
|
|
1158
|
-
|
|
1157
|
+
var _mainProductData$tota, _mainProductData$orig;
|
|
1158
|
+
newTotal = (_mainProductData$tota = mainProductData.total) !== null && _mainProductData$tota !== void 0 ? _mainProductData$tota : newTotal;
|
|
1159
|
+
newOriginTotal = (_mainProductData$orig = mainProductData.origin_total) !== null && _mainProductData$orig !== void 0 ? _mainProductData$orig : newOriginTotal;
|
|
1159
1160
|
} else {
|
|
1160
1161
|
// 不是手动折扣时,才重新计算
|
|
1161
1162
|
var _mainDiscountList = mainProductData.discount_list.filter(function (item) {
|
|
@@ -383,43 +383,41 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
383
383
|
return pre + (item.amount || 0);
|
|
384
384
|
}, 0);
|
|
385
385
|
};
|
|
386
|
-
var
|
|
387
|
-
return {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
};
|
|
422
|
-
})) || [];
|
|
386
|
+
var formatProduct = function formatProduct(items) {
|
|
387
|
+
return items.map(function (item) {
|
|
388
|
+
return {
|
|
389
|
+
product_id: item.product_id,
|
|
390
|
+
product_variant_id: item.product_variant_id,
|
|
391
|
+
quantity: item.num,
|
|
392
|
+
// 整个商品折扣后的总金额
|
|
393
|
+
selling_price: item.calculated_selling_price,
|
|
394
|
+
// 整个商品折扣前的总金额
|
|
395
|
+
original_price: item.calculated_original_price,
|
|
396
|
+
// 主商品折扣前金额,不包含套餐子商品
|
|
397
|
+
main_product_original_price: item.price,
|
|
398
|
+
// 主商品折扣后金额,不包含套餐子商品
|
|
399
|
+
main_product_selling_price: item.main_product_selling_price,
|
|
400
|
+
product_bundle: item.product_bundle.map(function (bundle) {
|
|
401
|
+
return {
|
|
402
|
+
bundle_id: bundle.bundle_id,
|
|
403
|
+
bundle_product_id: bundle.bundle_product_id,
|
|
404
|
+
bundle_variant_id: bundle.bundle_variant_id,
|
|
405
|
+
price_type: bundle.price_type,
|
|
406
|
+
price_type_ext: bundle.price_type_ext,
|
|
407
|
+
// 套餐子商品总价,不包含折扣金额
|
|
408
|
+
bundle_sum_price: bundle.bundle_sum_price,
|
|
409
|
+
// 套餐子商品折扣后金额
|
|
410
|
+
bundle_selling_price: bundle.bundle_selling_price,
|
|
411
|
+
num: bundle.num
|
|
412
|
+
};
|
|
413
|
+
})
|
|
414
|
+
};
|
|
415
|
+
}) || [];
|
|
416
|
+
};
|
|
417
|
+
var productList = formatProduct(((_this$store$currentOr = this.store.currentOrder.order_info) === null || _this$store$currentOr === void 0 || (_this$store$currentOr = _this$store$currentOr.original_order_data) === null || _this$store$currentOr === void 0 || (_this$store$currentOr = _this$store$currentOr.bookings) === null || _this$store$currentOr === void 0 ? void 0 : _this$store$currentOr.map(function (item) {
|
|
418
|
+
return item.product;
|
|
419
|
+
})) || []);
|
|
420
|
+
var relationProducts = formatProduct(((_this$store$currentOr2 = this.store.currentOrder.order_info) === null || _this$store$currentOr2 === void 0 || (_this$store$currentOr2 = _this$store$currentOr2.original_order_data) === null || _this$store$currentOr2 === void 0 ? void 0 : _this$store$currentOr2.relation_products) || []);
|
|
423
421
|
return [].concat(_toConsumableArray(productList), _toConsumableArray(relationProducts));
|
|
424
422
|
}
|
|
425
423
|
}, {
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -877,8 +877,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
877
877
|
let newOriginTotal = Number(mainProductData.original_price || mainProductData.price || 0);
|
|
878
878
|
const isManualDiscount = typeof mainProductData.isManualDiscount === "boolean" ? mainProductData.isManualDiscount : mainProductData.total != mainProductData.origin_total && (!((_a = mainProductData.discount_list) == null ? void 0 : _a.length) || ((_c = (_b = mainProductData == null ? void 0 : mainProductData.discount_list) == null ? void 0 : _b.every) == null ? void 0 : _c.call(_b, (item) => item.type === "product")));
|
|
879
879
|
if (isManualDiscount) {
|
|
880
|
-
newTotal = mainProductData.total
|
|
881
|
-
newOriginTotal = mainProductData.origin_total
|
|
880
|
+
newTotal = mainProductData.total ?? newTotal;
|
|
881
|
+
newOriginTotal = mainProductData.origin_total ?? newOriginTotal;
|
|
882
882
|
} else {
|
|
883
883
|
const mainDiscountList = mainProductData.discount_list.filter((item) => {
|
|
884
884
|
var _a2;
|
|
@@ -206,43 +206,39 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
206
206
|
return pre + (item.amount || 0);
|
|
207
207
|
}, 0);
|
|
208
208
|
};
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
209
|
+
const formatProduct = (items) => {
|
|
210
|
+
return items.map(
|
|
211
|
+
(item) => ({
|
|
212
|
+
product_id: item.product_id,
|
|
213
|
+
product_variant_id: item.product_variant_id,
|
|
214
|
+
quantity: item.num,
|
|
215
|
+
// 整个商品折扣后的总金额
|
|
216
|
+
selling_price: item.calculated_selling_price,
|
|
217
|
+
// 整个商品折扣前的总金额
|
|
218
|
+
original_price: item.calculated_original_price,
|
|
219
|
+
// 主商品折扣前金额,不包含套餐子商品
|
|
220
|
+
main_product_original_price: item.price,
|
|
221
|
+
// 主商品折扣后金额,不包含套餐子商品
|
|
222
|
+
main_product_selling_price: item.main_product_selling_price,
|
|
223
|
+
product_bundle: item.product_bundle.map((bundle) => {
|
|
224
|
+
return {
|
|
225
|
+
bundle_id: bundle.bundle_id,
|
|
226
|
+
bundle_product_id: bundle.bundle_product_id,
|
|
227
|
+
bundle_variant_id: bundle.bundle_variant_id,
|
|
228
|
+
price_type: bundle.price_type,
|
|
229
|
+
price_type_ext: bundle.price_type_ext,
|
|
230
|
+
// 套餐子商品总价,不包含折扣金额
|
|
231
|
+
bundle_sum_price: bundle.bundle_sum_price,
|
|
232
|
+
// 套餐子商品折扣后金额
|
|
233
|
+
bundle_selling_price: bundle.bundle_selling_price,
|
|
234
|
+
num: bundle.num
|
|
235
|
+
};
|
|
236
|
+
})
|
|
235
237
|
})
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
product_id: item.product_id,
|
|
241
|
-
product_variant_id: item.product_variant_id,
|
|
242
|
-
quantity: item.num,
|
|
243
|
-
selling_price: item.source_product_price
|
|
244
|
-
})
|
|
245
|
-
)) || [];
|
|
238
|
+
) || [];
|
|
239
|
+
};
|
|
240
|
+
const productList = formatProduct(((_c = (_b = (_a = this.store.currentOrder.order_info) == null ? void 0 : _a.original_order_data) == null ? void 0 : _b.bookings) == null ? void 0 : _c.map((item) => item.product)) || []);
|
|
241
|
+
const relationProducts = formatProduct(((_e = (_d = this.store.currentOrder.order_info) == null ? void 0 : _d.original_order_data) == null ? void 0 : _e.relation_products) || []);
|
|
246
242
|
return [...productList, ...relationProducts];
|
|
247
243
|
}
|
|
248
244
|
async initWalletData(params) {
|