|
@@ -21,6 +21,7 @@ export default class Index extends Component {
|
21
|
21
|
|
22
|
22
|
componentWillMount() {
|
23
|
23
|
this.initData()
|
|
24
|
+ console.log(this.props,"this.props.citylist")
|
24
|
25
|
}
|
25
|
26
|
|
26
|
27
|
initData() {
|
|
@@ -52,7 +53,7 @@ export default class Index extends Component {
|
52
|
53
|
const { cityList } = this.props
|
53
|
54
|
|
54
|
55
|
const searchList = cityList.filter(item => (item.name.includes(keywords)))
|
55
|
|
-
|
|
56
|
+ console.log(searchList, "-----------searchList----------")
|
56
|
57
|
this.setState({
|
57
|
58
|
searchList,
|
58
|
59
|
keywords
|
|
@@ -73,6 +74,7 @@ export default class Index extends Component {
|
73
|
74
|
scrollY>
|
74
|
75
|
|
75
|
76
|
<View className="search-wrap">
|
|
77
|
+ {console.log(searchList, "-----------searchListview----------")}
|
76
|
78
|
<Search placeholder="搜索意向城市" onInput={this.handleSearch} onSearch={this.handleSearch}></Search>
|
77
|
79
|
{
|
78
|
80
|
keywords && (
|
|
@@ -80,7 +82,9 @@ export default class Index extends Component {
|
80
|
82
|
{
|
81
|
83
|
searchList.length > 0 ? (
|
82
|
84
|
searchList.map(item => (
|
83
|
|
- <View key={item.id} className="list-item" onClick={this.handleSelected.bind(this, item)}>{item.name}</View>
|
|
85
|
+ <View key={item.id} className="list-item" onClick={this.handleSelected.bind(this, item)}>{item.name}
|
|
86
|
+ {console.log(item, "-------item------")}
|
|
87
|
+ </View>
|
84
|
88
|
))
|
85
|
89
|
) : <View className="empty">暂无结果</View>
|
86
|
90
|
}
|