更新商家入驻页

parent 14350536
......@@ -253,8 +253,7 @@ const cardBackwardNull = ref(false);
const qualificationsNull = ref(false);
// 用户选择的分类
const choosedShopInfo = ref([]);
// 临时创建的用户选择分类
const tempChoosedData = ref([]);
// 确保choosedShopInfo内是用户最新选择的分类
const chooseShopType = (id, name) => {
let hasSameData = false;
......@@ -265,35 +264,18 @@ const chooseShopType = (id, name) => {
});
if (!hasSameData) {
choosedShopInfo.value.push({ areaId: id, areaName: name, qualifications: '' });
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);
};
// 删除图片之前的提示
const beforeRemove = ({ file, fileList, resolve }) => {
xma.showModal({
title: '提示',
content: '确定删除图片' + file.name + '吗',
content: '确定删除图片吗?',
success: function (res) {
if (res.confirm) {
xma.showToast({ title: '删除成功', duration: 2000 });
......@@ -505,30 +487,7 @@ 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 === '') {
......@@ -563,7 +522,6 @@ const chooseCategory = () => {
// 显示店铺分类弹窗
const showclass = () => {
show.value = true;
tempChoosedData.value = [];
};
const isCategoryNull = ref(false);
......@@ -876,7 +834,6 @@ 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;
}
......@@ -919,10 +876,8 @@ 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