From 7f735577be2674b0d0343ec3539700a0b9856294 Mon Sep 17 00:00:00 2001 From: Default User Date: Thu, 8 Jan 2026 16:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=EF=BC=9A=E9=94=80=E5=94=AE=E4=BB=B7=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E4=B8=94=E6=B2=A1=E6=9C=89=E8=81=94=E7=B3=BB=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E8=B4=A7=E6=BA=90=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=9C=A8=E4=B8=BB=E9=A1=B5=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pages/index/index.js b/pages/index/index.js index d7feeb9..1f8a728 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1300,6 +1300,20 @@ Page({ console.log('applyFilters - 开始过滤,原始商品数量:', goods.length, '关键词:', this.data.searchKeyword); + // 筛选条件:销售价为空并且没有联系人信息的不显示在主页上 + filtered = filtered.filter(item => { + // 广告位不受影响 + if (item.isAd) { + return true; + } + // 销售价为空 + const hasEmptyPrice = !item.price || item.price === '' || parseFloat(item.price) === 0; + // 没有联系人信息 + const hasNoContact = !item.product_contact || item.product_contact === '' || !item.contact_phone || item.contact_phone === ''; + // 只保留:销售价不为空 或 有联系人信息 的商品 + return !(hasEmptyPrice && hasNoContact); + }); + if (this.data.selectedCategory !== '全部') { const category = this.data.selectedCategory filtered = filtered.filter(item => item.isAd || (item.category === category))