From abc729af135413d17593ed9775b6ca55723ebcde Mon Sep 17 00:00:00 2001 From: fanfan Date: Thu, 29 Feb 2024 16:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/news3/components/category.vue | 1 - pages/news3/vipPrice.vue | 15 +++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pages/news3/components/category.vue b/pages/news3/components/category.vue index 8a542bf..89e0f43 100644 --- a/pages/news3/components/category.vue +++ b/pages/news3/components/category.vue @@ -70,7 +70,6 @@ } }, findElementsById(arr, ids) { - console.log(ids) let result = [] arr.forEach(item => { if (ids.indexOf(item.category_id) > -1) { diff --git a/pages/news3/vipPrice.vue b/pages/news3/vipPrice.vue index 01da63b..6819793 100644 --- a/pages/news3/vipPrice.vue +++ b/pages/news3/vipPrice.vue @@ -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