Commit e8768d9f authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents f91e8e40 3c67e3ad
......@@ -265,12 +265,28 @@ const chooseShopType = (id, name) => {
});
if (!hasSameData) {
choosedShopInfo.value.push({ areaId: id, areaName: name, qualifications: '' });
tempChoosedData.value.push(id);
tempChoosedData.value.push({ areaId: id, areaName: name, qualifications: '', tag: 'add' });
} else {
choosedShopInfo.value = choosedShopInfo.value.filter((item) => {
if (item.areaId === id) {
/* tempChoosedData.value.push({
areaId: id,
areaName: name,
qualifications: item.qualifications,
tag: 'delete',
}); */
// tempChoosedData.value.forEach(())
tempChoosedData.value.filter((sitem) => sitem.tag !== 'add');
console.log('tempChoosedData');
console.log(tempChoosedData.value);
console.log('choosedShopInfo');
console.log(choosedShopInfo.value);
}
return item.areaId !== id;
});
}
console.log('临时数组');
console.log(tempChoosedData.value);
};
// 删除图片之前的提示
......@@ -489,6 +505,41 @@ const show = ref(false);
// 关闭店铺分类弹出层
const handleClose = () => {
show.value = false;
tempChoosedData.value.forEach((item) => {
if (item.tag === 'add') {
// 删除
// console.log('应该删除' + item.areaName);
// console.log('删除前的choosedShopInfo');
// console.log(choosedShopInfo.value);
for (let i = 0; i < choosedShopInfo.value.length; i++) {
if (item.areaId === choosedShopInfo.value[i].areaId) {
choosedShopInfo.value.splice(i, 1);
}
}
} else {
// 添加
choosedShopInfo.value.push(
reactive({
areaId: item.areaId,
areaName: item.areaName,
qualifications: item.qualifications,
}),
);
}
});
console.log('删除后的choosedShopInfo');
console.log(choosedShopInfo.value);
setTimeout(() => {
testFileList.value = choosedShopInfo.value.reduce((obj, item) => {
if (item.qualifications === '') {
obj[item.areaId] = [];
} else {
obj[item.areaId] = [{ url: fileDomain + item.qualifications }];
}
return obj;
}, {});
}, 1000);
};
// 原添加的店铺分类个数
const originChooseCategoryLength = 0;
......@@ -512,6 +563,7 @@ const chooseCategory = () => {
// 显示店铺分类弹窗
const showclass = () => {
show.value = true;
tempChoosedData.value = [];
};
const isCategoryNull = ref(false);
......@@ -824,6 +876,7 @@ page {
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
color: var(--wot-input-placeholder-color, #bfbfbf);
}
.text.shopcateboxtxt {
margin-left: 0px;
}
......@@ -866,8 +919,10 @@ page {
.newAddCertification {
margin-top: 40rpx;
.citem {
margin-bottom: 20rpx;
.titleOfC {
margin-bottom: 10rpx;
display: block;
......
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