import React, { Component } from 'react';
import './index.less';
import { Icon } from 'antd';
import Page from '@src/containers/Page';
import Button from '../../../components/Button';
import Tabs from '../../../components/Tabs';
import UserAction from '../../../components/UserAction';
import UserPagination from '../../../components/UserPagination';
export default class extends Page {
initState() {
return {
list: [{}, {}, {}],
searchList: [123, 123, 123],
historyList: [321, 321, 321],
searchValue: '',
search: false,
tab: '1',
filterMap: {},
sortMap: {},
focus: false,
};
}
onTabChange(tab) {
this.setState({ tab });
}
onChangeSearch(value) {
this.setState({ searchValue: value });
}
renderView() {
const { search } = this.state;
return (
{this.renderSearch()}
{search ? this.renderResult() : this.renderFilter()}
);
}
renderSearch() {
const { searchList, searchValue, historyList, focus } = this.state;
return (
this.onChangeSearch(e.target.value)}
onFocus={() => this.setState({ focus: true })}
onBlur={() => this.setState({ focus: false })}
/>
搜索题目
{focus && (
{searchList.map(item => {
return
{item}
;
})}
)}
{focus && (
{historyList.map(item => {
return (
);
})}
删除历史
)}
);
}
renderFilter() {
const { tab, filterMap, sortMap } = this.state;
return (
this.onTabChange(key)}
/>
this.onFilter(value)}
/>
{this.renderList()}
);
}
renderResult() {
return (
搜索结果:
共12条
{this.renderList()}
);
}
renderList() {
const { list } = this.state;
return list.map(item => {
return ;
});
}
}
class SearchItem extends Component {
render() {
return (
阅读RC
PREP07#124、PREP08#332、PREP07#124、PREP08#332、PREP07#124
Medium
用时: 1m 39s
80%
收藏 20313
Margaret Mead, the best-known anthropologist of the twentieth century, helped shape public opinion on
fundamentally important areas like attitudes toward children and families, along with the relative merits of
competition and cooperation. A. shape public opinion on fundamentally important areas like attitudes toward
children and families, along with
);
}
}