Fix:5176 【商城小程序】省级导航在搜索无效名称时无反馈

This commit is contained in:
linxi
2026-07-14 14:28:00 +08:00
parent 62e7776b64
commit 956d7bf70b
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -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
+4
View File
@@ -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