@@ -385,7 +385,7 @@ export default {
|
|||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
if(this.keyword === '') return
|
if(this.keyword === '') return
|
||||||
this.listGroup.findIndex((group, index) => {
|
const matchIndex = this.listGroup.findIndex((group, index) => {
|
||||||
let result
|
let result
|
||||||
group.city.forEach(item => {
|
group.city.forEach(item => {
|
||||||
result = item.cityName.indexOf(this.keyword, 0)
|
result = item.cityName.indexOf(this.keyword, 0)
|
||||||
@@ -398,6 +398,12 @@ export default {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (matchIndex === -1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未找到该城市,请重新输入城市名称',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
select(item) {
|
select(item) {
|
||||||
if (this.type === 0 && item.hasData === 0) return
|
if (this.type === 0 && item.hasData === 0) return
|
||||||
|
|||||||
@@ -309,6 +309,10 @@ export default {
|
|||||||
// console.log(searchMap);
|
// console.log(searchMap);
|
||||||
const filterMap = searchMap.filter(el => el.cityName.includes(this.keyword))
|
const filterMap = searchMap.filter(el => el.cityName.includes(this.keyword))
|
||||||
if(filterMap.length === 0) {
|
if(filterMap.length === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未找到该城市,请重新输入城市名称',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
this.asideIndex = filterMap[0].index
|
this.asideIndex = filterMap[0].index
|
||||||
|
|||||||
Reference in New Issue
Block a user