@pisell/pisellos 0.0.28 → 0.0.29
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.
|
@@ -1045,6 +1045,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1045
1045
|
selectResourcesMap[res.selectedResource.id]++;
|
|
1046
1046
|
}
|
|
1047
1047
|
console.log(_this7.store.cart.getItems());
|
|
1048
|
+
res.selectedResource.capacity = 1;
|
|
1048
1049
|
_this7.store.cart.updateItem({
|
|
1049
1050
|
_id: item._id,
|
|
1050
1051
|
// 这里要做去重,避免出现同样类型的资源被塞进同一个商品
|
|
@@ -1066,11 +1067,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1066
1067
|
return n.code === resources_code;
|
|
1067
1068
|
})) === null || _productResources$fin === void 0 ? void 0 : _productResources$fin.renderList;
|
|
1068
1069
|
if (targetRenderList && targetRenderList.length > 0) {
|
|
1070
|
+
var targetResource = targetRenderList[0];
|
|
1071
|
+
targetResource.capacity = 1;
|
|
1069
1072
|
_this7.store.cart.updateItem({
|
|
1070
1073
|
_id: item._id,
|
|
1071
1074
|
resources: [].concat(_toConsumableArray((item._origin.resources || []).filter(function (existingRes) {
|
|
1072
1075
|
return existingRes.resourceType !== targetRenderList[0].resourceType;
|
|
1073
|
-
})), [
|
|
1076
|
+
})), [targetResource])
|
|
1074
1077
|
});
|
|
1075
1078
|
} else {
|
|
1076
1079
|
// 如果没有可用的技师了,推到错误列表里让 UI 去提示
|
|
@@ -574,6 +574,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
574
574
|
selectResourcesMap[res.selectedResource.id]++;
|
|
575
575
|
}
|
|
576
576
|
console.log(this.store.cart.getItems());
|
|
577
|
+
res.selectedResource.capacity = 1;
|
|
577
578
|
this.store.cart.updateItem({
|
|
578
579
|
_id: item._id,
|
|
579
580
|
// 这里要做去重,避免出现同样类型的资源被塞进同一个商品
|
|
@@ -592,13 +593,15 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
592
593
|
const productResources = (0, import_resources.getResourcesByProduct)(resourcesMap, item, allCartItems);
|
|
593
594
|
const targetRenderList = (_a = productResources.find((n) => n.code === resources_code)) == null ? void 0 : _a.renderList;
|
|
594
595
|
if (targetRenderList && targetRenderList.length > 0) {
|
|
596
|
+
const targetResource = targetRenderList[0];
|
|
597
|
+
targetResource.capacity = 1;
|
|
595
598
|
this.store.cart.updateItem({
|
|
596
599
|
_id: item._id,
|
|
597
600
|
resources: [
|
|
598
601
|
...(item._origin.resources || []).filter(
|
|
599
602
|
(existingRes) => existingRes.resourceType !== targetRenderList[0].resourceType
|
|
600
603
|
),
|
|
601
|
-
|
|
604
|
+
targetResource
|
|
602
605
|
]
|
|
603
606
|
});
|
|
604
607
|
} else {
|