12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- import Taro, { Component } from '@tarojs/taro'
- import { View, Input, Picker, ScrollView, Button } from '@tarojs/components'
- import { Loading } from '@components'
- import { connect } from '@tarojs/redux'
- import * as actions from '@actions/list'
- // import { dispatchCartNum } from '@actions/list'
- import ItemList from './itemlist'
- import { getWindowHeight } from '@utils/style'
- import './list.scss'
- // @connect(state => state.home, { ...actions, })
- class List extends Component {
- config = {
- navigationBarTitleText: '报告列表'
- }
- state = {
- loaded: false,
- loading: false,
- lastItemId: 0,
- hasMore: true,
- selectorChecked: { id: 0, key: "按报告类型", value: 'title' },
- selector: [{ id: 0, key: "按报告类型", value: 'title' },
- { id: 1, key: "按企业名称", value: 'companyName' },
- { id: 2, key: "按项目名称", value: 'reportName' },
- { id: 3, key: "按关键词", value: 'keyword' },],
- keyword: "",
- }
- componentDidMount() {
- }
- // field:this.state.selectorChecked.value
- onChange = e => {
- this.setState({
- selectorChecked: this.state.selector[e.detail.value],
- })
- }
- onInput(e) {
- this.setState({
- keyword: e.detail.value
- })
- }
- onSearch() {
- if (!this.state.keyword) {
-
- }
- }
- render() {
- // if (!this.state.loaded) {
- // return <Loading />
- // }
- const { } = this.props
- return (
- <View className='home'>
- <View className='home_head'>
- <Picker
- mode='selector'
- range={this.state.selector}
- rangeKey="key"
- value={this.state.selectorChecked.id}
- onChange={this.onChange}>
- <View className='picker'>
- {this.state.selectorChecked.key} ▼
- </View>
- </Picker>
- <Input className='input' type='text' placeholder='请输入关键词进行查询' onInput={this.onInput} />
- <View className='button'
- onClick={() => {
- }}
- >搜索</View>
- </View>
- <ScrollView
- scrollY
- className='home__wrap'
- onScrollToLower={() => { console.log("----滑到底部") }}
- style={{ height: (getWindowHeight().substring(0, getWindowHeight().length - 2) - 55) + "px" }}
- >
- <ItemList />
- </ScrollView>
- </View>
- )
- }
- }
- export default List
|