increase.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import Taro, { canIUse, Component } from '@tarojs/taro'
  2. import { View, Picker, ScrollView } from '@tarojs/components'
  3. import { Loading } from '@components'
  4. import { connect } from '@tarojs/redux'
  5. import * as actions from '@actions/increase'
  6. import { getWindowHeight } from '@utils/style'
  7. import './increase.scss'
  8. const RECOMMEND_SIZE = 20
  9. // @connect(state => state.home, { ...actions })
  10. class Increase extends Component {
  11. config = {
  12. navigationBarTitleText: '生成报告'
  13. }
  14. state = {
  15. selector: [{ key: "项目验收申请单", value: 1 },
  16. { key: "立项报告模板", value: 2 },
  17. { key: "高新认定模板", value: 3 },
  18. { key: "空白模板", value: 0 },],
  19. loaded: false,
  20. loading: false,
  21. lastItemId: 0,
  22. hasMore: true
  23. }
  24. componentDidMount() {
  25. // NOTE 暂时去掉不适配的内容
  26. // Taro.showToast({
  27. // title: '注意,由于严选小程序首页界面、接口大幅变动,暂时去掉不相符的部分,后续再跟进改动',
  28. // icon: 'none',
  29. // duration: 6000
  30. // })
  31. }
  32. onChange = e => {
  33. console.log(e.detail.value, "e===", e)
  34. this.setState({
  35. selectorChecked: this.state.selector[e.detail.value]
  36. })
  37. }
  38. render() {
  39. // if (!this.state.loaded) {
  40. // return <Loading />
  41. // }
  42. const { } = this.props
  43. return (
  44. <View className='home'>
  45. <ScrollView
  46. scrollY
  47. className='home__wrap'
  48. onScrollToLower={this.loadRecommend}
  49. style={{ height: getWindowHeight() }}
  50. >
  51. <View className='increase'>
  52. <View className='increase__item'>
  53. <Picker
  54. mode='selector'
  55. rangeKey="key"
  56. range={this.state.selector}
  57. onChange={this.onChange}>
  58. <View className='increase__item-buttom'>
  59. + 新建报告
  60. </View>
  61. </Picker>
  62. </View>
  63. </View>
  64. </ScrollView>
  65. </View>
  66. )
  67. }
  68. }
  69. export default Increase