update
This commit is contained in:
parent
e330a8fef4
commit
3b44d72f79
@ -1423,24 +1423,64 @@ export default {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// thisAllType 里面的值 才是当前商城分类的实际 类型 所以应该是把对应的商品拼到 thisAllType 里面去
|
||||
// let COMMODITYLISTList = []
|
||||
// let COMMODITYLISTList = []
|
||||
|
||||
console.log('thisAllTypethisAllTypethisAllType', JSON.parse(JSON.stringify(thisAllType)));
|
||||
console.log('listlistlist', JSON.parse(JSON.stringify(list)));
|
||||
|
||||
if (thisAllType && thisAllType.length > 0) {
|
||||
// 记录一下 当前找的到 分类id的 id列表
|
||||
let haveFindTypeShop = []
|
||||
// 已经在小类里面出现过的商品id
|
||||
let showShopInSmallType = []
|
||||
|
||||
thisAllType.forEach((item) => {
|
||||
if (list && list.length > 0) {
|
||||
list.forEach((subItem) => {
|
||||
if (item.UserdefinedType_Id === subItem.USERDEFINEDTYPE_ID) {
|
||||
haveFindTypeShop.push(item.UserdefinedType_Id)
|
||||
item.COMMODITYLIST = subItem.COMMODITYLIST;
|
||||
// if (subItem.COMMODITYLIST && subItem.COMMODITYLIST.length > 0) {
|
||||
// subItem.COMMODITYLIST.forEach((thirdItem) => {
|
||||
// COMMODITYLISTList.push(thirdItem.COMMODITY_NAME)
|
||||
// })
|
||||
// }
|
||||
|
||||
// 拿到已经在小类里面出现过的商品id
|
||||
if (subItem.COMMODITYLIST && subItem.COMMODITYLIST.length > 0) {
|
||||
subItem.COMMODITYLIST.forEach((thirdItem) => {
|
||||
// COMMODITYLISTList.push(thirdItem.COMMODITY_NAME)
|
||||
showShopInSmallType.push(thirdItem.COMMODITY_ID)
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// 再遍历一遍 将没有匹配到商品的 小类里面的商品 全部到一个数组里面去
|
||||
let noFindTypeShopList = []
|
||||
list.forEach((item) => {
|
||||
if (haveFindTypeShop.indexOf(item.USERDEFINEDTYPE_ID) === -1) {
|
||||
if (item.COMMODITYLIST && item.COMMODITYLIST.length > 0) {
|
||||
item.COMMODITYLIST.forEach((subItem) => {
|
||||
noFindTypeShopList.push(subItem)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 若已经找到实际有找不到小类的商品的话 就将这些商品赋值给 全部分类下
|
||||
|
||||
// 这里再加一步去重 若 现在想要放在全部下面的商品 已经在别的小类里面出现了 那么就不再这个里面
|
||||
// console.log('全部小类中出现过的商品id', showShopInSmallType);
|
||||
|
||||
noFindTypeShopList = noFindTypeShopList.filter(item => showShopInSmallType.indexOf(item.COMMODITY_ID) === -1)
|
||||
|
||||
// console.log('noFindTypeShopListnoFindTypeShopListnoFindTypeShopList', noFindTypeShopList);
|
||||
thisAllType.forEach((item) => {
|
||||
if (item.UserdefinedType_Name === '全部') {
|
||||
item.COMMODITYLIST = noFindTypeShopList
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let leftIndex = -1;
|
||||
@ -1480,6 +1520,9 @@ export default {
|
||||
// 当前选中的商品列表
|
||||
let shopList = [];
|
||||
|
||||
console.log('thisAllTypethisAllTypethisAllType', JSON.parse(JSON.stringify(thisAllType)));
|
||||
|
||||
|
||||
if (thisAllType && thisAllType.length > 0) {
|
||||
// 这一大类的全部商品
|
||||
let thisTypeAllShop = [];
|
||||
@ -1505,7 +1548,12 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
thisAllType[0].COMMODITYLIST = thisTypeAllShop;
|
||||
// 判断原先是不是有值的 有值的话 新的全部商品 拼在后面
|
||||
if (thisAllType[0].COMMODITYLIST && thisAllType[0].COMMODITYLIST.length > 0) {
|
||||
thisAllType[0].COMMODITYLIST = thisAllType[0].COMMODITYLIST.concat(thisTypeAllShop);
|
||||
} else {
|
||||
thisAllType[0].COMMODITYLIST = thisTypeAllShop;
|
||||
}
|
||||
|
||||
if (
|
||||
leftIndex !== -1 &&
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@ -1241,7 +1241,7 @@ var _default = {
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGetAllShopItem", function handleGetAllShopItem(id, type) {
|
||||
var _this11 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
||||
var data, url, list, thisAllType, haveAll, leftIndex, shopList, thisTypeAllShop, allShopID, obj, newList, allShopList, allShopID2;
|
||||
var data, url, list, thisAllType, haveAll, haveFindTypeShop, showShopInSmallType, noFindTypeShopList, leftIndex, shopList, thisTypeAllShop, allShopID, obj, newList, allShopList, allShopID2;
|
||||
return _regenerator.default.wrap(function _callee8$(_context8) {
|
||||
while (1) {
|
||||
switch (_context8.prev = _context8.next) {
|
||||
@ -1319,22 +1319,59 @@ var _default = {
|
||||
}
|
||||
|
||||
// thisAllType 里面的值 才是当前商城分类的实际 类型 所以应该是把对应的商品拼到 thisAllType 里面去
|
||||
// let COMMODITYLISTList = []
|
||||
// let COMMODITYLISTList = []
|
||||
|
||||
console.log('thisAllTypethisAllTypethisAllType', JSON.parse(JSON.stringify(thisAllType)));
|
||||
console.log('listlistlist', JSON.parse(JSON.stringify(list)));
|
||||
if (thisAllType && thisAllType.length > 0) {
|
||||
// 记录一下 当前找的到 分类id的 id列表
|
||||
haveFindTypeShop = []; // 已经在小类里面出现过的商品id
|
||||
showShopInSmallType = [];
|
||||
thisAllType.forEach(function (item) {
|
||||
if (list && list.length > 0) {
|
||||
list.forEach(function (subItem) {
|
||||
if (item.UserdefinedType_Id === subItem.USERDEFINEDTYPE_ID) {
|
||||
haveFindTypeShop.push(item.UserdefinedType_Id);
|
||||
item.COMMODITYLIST = subItem.COMMODITYLIST;
|
||||
// if (subItem.COMMODITYLIST && subItem.COMMODITYLIST.length > 0) {
|
||||
// subItem.COMMODITYLIST.forEach((thirdItem) => {
|
||||
// COMMODITYLISTList.push(thirdItem.COMMODITY_NAME)
|
||||
// })
|
||||
// }
|
||||
// 拿到已经在小类里面出现过的商品id
|
||||
if (subItem.COMMODITYLIST && subItem.COMMODITYLIST.length > 0) {
|
||||
subItem.COMMODITYLIST.forEach(function (thirdItem) {
|
||||
// COMMODITYLISTList.push(thirdItem.COMMODITY_NAME)
|
||||
showShopInSmallType.push(thirdItem.COMMODITY_ID);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 再遍历一遍 将没有匹配到商品的 小类里面的商品 全部到一个数组里面去
|
||||
noFindTypeShopList = [];
|
||||
list.forEach(function (item) {
|
||||
if (haveFindTypeShop.indexOf(item.USERDEFINEDTYPE_ID) === -1) {
|
||||
if (item.COMMODITYLIST && item.COMMODITYLIST.length > 0) {
|
||||
item.COMMODITYLIST.forEach(function (subItem) {
|
||||
noFindTypeShopList.push(subItem);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 若已经找到实际有找不到小类的商品的话 就将这些商品赋值给 全部分类下
|
||||
|
||||
// 这里再加一步去重 若 现在想要放在全部下面的商品 已经在别的小类里面出现了 那么就不再这个里面
|
||||
// console.log('全部小类中出现过的商品id', showShopInSmallType);
|
||||
|
||||
noFindTypeShopList = noFindTypeShopList.filter(function (item) {
|
||||
return showShopInSmallType.indexOf(item.COMMODITY_ID) === -1;
|
||||
});
|
||||
|
||||
// console.log('noFindTypeShopListnoFindTypeShopListnoFindTypeShopList', noFindTypeShopList);
|
||||
thisAllType.forEach(function (item) {
|
||||
if (item.UserdefinedType_Name === '全部') {
|
||||
item.COMMODITYLIST = noFindTypeShopList;
|
||||
}
|
||||
});
|
||||
}
|
||||
leftIndex = -1; // if (this.pageType === "UnionMall" && this.leftId) {
|
||||
// if (thisAllType && thisAllType.length > 0) {
|
||||
@ -1369,6 +1406,7 @@ var _default = {
|
||||
|
||||
// 当前选中的商品列表
|
||||
shopList = [];
|
||||
console.log('thisAllTypethisAllTypethisAllType', JSON.parse(JSON.stringify(thisAllType)));
|
||||
if (thisAllType && thisAllType.length > 0) {
|
||||
// 这一大类的全部商品
|
||||
thisTypeAllShop = []; // 当前的全部商品id
|
||||
@ -1386,7 +1424,13 @@ var _default = {
|
||||
}
|
||||
}
|
||||
});
|
||||
thisAllType[0].COMMODITYLIST = thisTypeAllShop;
|
||||
|
||||
// 判断原先是不是有值的 有值的话 新的全部商品 拼在后面
|
||||
if (thisAllType[0].COMMODITYLIST && thisAllType[0].COMMODITYLIST.length > 0) {
|
||||
thisAllType[0].COMMODITYLIST = thisAllType[0].COMMODITYLIST.concat(thisTypeAllShop);
|
||||
} else {
|
||||
thisAllType[0].COMMODITYLIST = thisTypeAllShop;
|
||||
}
|
||||
if (leftIndex !== -1 && thisAllType[leftIndex] && thisAllType[leftIndex].COMMODITYLIST && thisAllType[leftIndex].COMMODITYLIST.length > 0) {
|
||||
if (_this11.pageType === "UnionMall" && _this11.leftId) {
|
||||
if (_this11.leftId) {
|
||||
@ -1493,7 +1537,7 @@ var _default = {
|
||||
_this11.rightShopList = [];
|
||||
}
|
||||
uni.hideLoading();
|
||||
case 27:
|
||||
case 30:
|
||||
case "end":
|
||||
return _context8.stop();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user