From 956d7bf70b286eb40cdb474a50c99e336b7e25d0 Mon Sep 17 00:00:00 2001 From: linxi <957440651@qq.com> Date: Tue, 14 Jul 2026 14:28:00 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A5176=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E7=9C=81=E7=BA=A7=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E5=9C=A8=E6=90=9C=E7=B4=A2=E6=97=A0=E6=95=88=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=97=B6=E6=97=A0=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/chose-city/chose-city.vue | 8 +++++++- pkg_product/views/healthList.vue | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pages/chose-city/chose-city.vue b/pages/chose-city/chose-city.vue index ce34a9c..189d361 100644 --- a/pages/chose-city/chose-city.vue +++ b/pages/chose-city/chose-city.vue @@ -385,7 +385,7 @@ export default { }, search() { if(this.keyword === '') return - this.listGroup.findIndex((group, index) => { + const matchIndex = this.listGroup.findIndex((group, index) => { let result group.city.forEach(item => { result = item.cityName.indexOf(this.keyword, 0) @@ -398,6 +398,12 @@ export default { return result } }) + if (matchIndex === -1) { + uni.showToast({ + title: '未找到该城市,请重新输入城市名称', + icon: 'none' + }) + } }, select(item) { if (this.type === 0 && item.hasData === 0) return diff --git a/pkg_product/views/healthList.vue b/pkg_product/views/healthList.vue index 86837c3..0224766 100644 --- a/pkg_product/views/healthList.vue +++ b/pkg_product/views/healthList.vue @@ -309,6 +309,10 @@ export default { // console.log(searchMap); const filterMap = searchMap.filter(el => el.cityName.includes(this.keyword)) if(filterMap.length === 0) { + uni.showToast({ + title: '未找到该城市,请重新输入城市名称', + icon: 'none' + }) return } else { this.asideIndex = filterMap[0].index