version/0412
fanfan 9 months ago
parent ec4e5b023c
commit abc729af13
  1. 1
      pages/news3/components/category.vue
  2. 15
      pages/news3/vipPrice.vue

@ -70,7 +70,6 @@
}
},
findElementsById(arr, ids) {
console.log(ids)
let result = []
arr.forEach(item => {
if (ids.indexOf(item.category_id) > -1) {

@ -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

Loading…
Cancel
Save