Commit 3c90436f authored by 陈万宝's avatar 陈万宝

feat: 修改编辑引导

parent b78fbcf3
......@@ -486,14 +486,14 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
if (customer.isEdit || customer.isUseCache) {
if (!editData) return;
let { label, firstCategoryId, secondCategoryId, thirdCategoryId, id } = editData;
editData.label = label.split(',').map(item => +item);
editData.label =label && label.split(',')?.map(item => +item);
let specList = editData?.specList;
let weight = specList.filter(item => item.specGroupName === '份量');
let specs = specList.filter(item => item.specGroupName !== '份量');
let weight = specList?.filter(item => item.specGroupName === '份量');
let specs = specList?.filter(item => item.specGroupName !== '份量');
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
weight.forEach(item => {
weight?.forEach(item => {
if (item?.specs?.length) {
item.specs.forEach(itm => {
item?.specs?.forEach(itm => {
if (tempWeightName.includes(itm.unit)) {
itm.quantity =
itm?.quantity.indexOf('约') > -1 ? itm?.quantity.slice(1) : itm?.quantity || '';
......@@ -501,7 +501,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
});
}
});
if (editData?.skuList.length) {
if (editData?.skuList?.length) {
editData.minPurchaseNum = editData?.skuList[0]?.serviceItem.minPurchaseNum;
// 单规格
if (specs.length === 0 && !editData?.specList[0]?.specs[0]?.activityPrice) {
......@@ -540,12 +540,12 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
let specList = editData?.specList;
let weight = specList.filter(item => item.specGroupName === '份量');
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
weight.forEach(item => {
weight?.forEach(item => {
if (item?.specs?.length) {
item.specs.forEach(itm => {
item.specs?.forEach(itm => {
if (tempWeightName.includes(itm.unit)) {
itm.quantity =
itm?.quantity.indexOf('约') > -1 ? itm?.quantity.slice(1) : itm?.quantity || '';
itm?.quantity?.indexOf('约') > -1 ? itm?.quantity.slice(1) : itm?.quantity || '';
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment