RecentView.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import React, { Component } from 'react'
  2. import {
  3. StyleSheet,
  4. ScrollView,
  5. View,
  6. Image,
  7. ImageBackground,
  8. Text,
  9. Dimensions,
  10. StatusBar,
  11. TouchableOpacity,
  12. } from 'react-native'
  13. import { connect } from 'react-redux'
  14. import { Button } from '../../components'
  15. import Icon from '../../components/Iconfont/Iconfont'
  16. import { NavigationActions, createAction } from '../../utils'
  17. import {
  18. CarouselHorizontal,
  19. CarouselVertical,
  20. } from '../../components/carousel/index'
  21. import Input from '../../components/input/index'
  22. import Bubble from '../../components/Bubble'
  23. // import png from "../../static/images/banner.png";
  24. import Grid from '../../components/Grid'
  25. const { width, height } = Dimensions.get('window')
  26. @connect(({ theme, home }) => ({ ...theme, ...home }))
  27. class RecentView extends Component {
  28. constructor(props) {
  29. super(props)
  30. this.state = {
  31. headercol: 'transparent',
  32. inputtx: '#CCC',
  33. inputbacg: '#FFF',
  34. messcol: '#FFF',
  35. barStyle: props.appTheme.barStyle,
  36. }
  37. // console.disableYellowBox = true;
  38. }
  39. static navigationOptions = {
  40. title: '最近浏览',
  41. }
  42. render() {
  43. const { appTheme, recentDatas } = this.props
  44. return (
  45. <View
  46. style={[
  47. styles.container,
  48. { backgroundColor: appTheme.backgroundColor },
  49. ]}
  50. >
  51. <Grid
  52. titleName="最近浏览"
  53. data={recentDatas}
  54. nameKey="name"
  55. pictureKey="pictureUrl"
  56. priceKey="salePrice"
  57. keyext="code"
  58. titleBool={false}
  59. />
  60. </View>
  61. )
  62. }
  63. }
  64. const styles = StyleSheet.create({
  65. container: {
  66. flex: 1,
  67. },
  68. pngstyle: {
  69. width: width,
  70. },
  71. buttonStyle: {
  72. backgroundColor: 'transparent',
  73. flexDirection: 'column',
  74. alignItems: 'center',
  75. },
  76. buttonText: {
  77. marginTop: 9,
  78. fontSize: 14,
  79. color: '#FFF',
  80. },
  81. })
  82. export default RecentView