myList.jsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { Component } from 'react';
  2. import Taro from '@tarojs/taro';
  3. import { View } from '@tarojs/components'
  4. import ListBottomStart from '../../components/common/listBottomStart';
  5. import './index.less';
  6. class MyList extends Component {
  7. constructor(props) {
  8. super(props);
  9. }
  10. render () {
  11. return (
  12. <View className='indexPage'>
  13. <View className='list'>
  14. {
  15. this.props.list.map((v,k)=>(
  16. <View key={k} className='item' onClick={()=>{
  17. console.log('/pages/egressDetails/index?type='+this.props.type+'&id='+v.id)
  18. Taro.navigateTo({
  19. url:'/pages/egressDetails/index?type='+this.props.type+'&dtails='+JSON.stringify(v)
  20. })
  21. }}>
  22. <View className='infor'>
  23. <View className='title'>
  24. <View className='aname'>{v.aname}提交的外出申请</View>
  25. <View className='createTimes'>{v.createTimes}</View>
  26. </View>
  27. <View className='userName'>
  28. 外出地点:
  29. {v.userName}
  30. </View>
  31. <View className='releaseStarts'>
  32. 开始时间:{v.releaseStarts}
  33. </View>
  34. <View className='releaseEnds'>
  35. 结束时间:{v.releaseEnds}
  36. <View className='status' style={{
  37. color:v.status === 0 ? '#f31212' :
  38. v.status === 1 ? '#1d4fea' :
  39. v.status === 2 ? '#34de38' : ''
  40. }}>
  41. {
  42. v.status === 0 ? '驳回' :
  43. v.status === 1 ? '发起' :
  44. v.status === 2 ? '通过' : ''
  45. }
  46. </View>
  47. </View>
  48. </View>
  49. </View>
  50. ))
  51. }
  52. <ListBottomStart
  53. state={this.props.listState}
  54. reload={()=>{
  55. this.props.onRefresh
  56. }}/>
  57. </View>
  58. </View>
  59. )
  60. }
  61. }
  62. export default MyList