|
|
|
@ -109,12 +109,10 @@ |
|
|
|
|
if (status == 200) { |
|
|
|
|
if (data.list.length > 0) { |
|
|
|
|
data.list.forEach((item_1, index_1) => { |
|
|
|
|
if (typeof item_1.category == 'string') { |
|
|
|
|
item_1.category = item_1.category.split(",").map(item => Number(item)) |
|
|
|
|
} else { |
|
|
|
|
item_1.category = [item_1.category] |
|
|
|
|
if(typeof item_1.category == 'number'){ |
|
|
|
|
item_1.category=item_1.category.toString() |
|
|
|
|
} |
|
|
|
|
let name = this.findElementsById(this.categoryList,item_1.category) |
|
|
|
|
let name = this.findElementsById(this.categoryList,item_1.category.split(",").map(item => Number(item))) |
|
|
|
|
item_1.category_name = name.join(',') + (name.length > 0 ? '等' : ''); |
|
|
|
|
item_1.price_list.forEach((item_2, index_2) => { |
|
|
|
|
item_2.startProfit = Number((Number(item_2.min) * (Number(item_2 |
|
|
|
@ -317,16 +315,17 @@ |
|
|
|
|
this.activeIndex = []; |
|
|
|
|
this.list.forEach((item, index) => { |
|
|
|
|
if (item.category) { |
|
|
|
|
newId = newId.concat(item.category) |
|
|
|
|
newId = newId.concat(item.category.split(",").map(item => Number(item))) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
let list = Array.from(new Set(newId)); //所有以选中的 |
|
|
|
|
// 找到除了当前分类的id集合 |
|
|
|
|
let currentList = []; |
|
|
|
|
if (this.list[index].category) { |
|
|
|
|
currentList = this.list[index].category |
|
|
|
|
currentList = this.list[index].category.split(",").map(item => Number(item)) |
|
|
|
|
} |
|
|
|
|
if (currentList.length > 0 && list.length > 0) { |
|
|
|
|
if (list.length > 0) { |
|
|
|
|
uni.removeStorageSync('beyondList'); |
|
|
|
|
uni.setStorageSync('beyondList', this.mergeArrays(list, currentList)) |
|
|
|
|
} |
|
|
|
|
this.activeIndex = list |
|
|
|
|