Supplier.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. import React, { Component } from 'react'
  2. import {
  3. StyleSheet,
  4. View,
  5. FlatList,
  6. Text,
  7. StatusBar,
  8. TouchableOpacity,
  9. PixelRatio,
  10. } from 'react-native'
  11. import { connect } from 'react-redux'
  12. import Icon from '../../../components/Iconfont/Iconfont'
  13. import { NavigationActions, createAction } from '../../../utils'
  14. @connect(({ theme, mine }) => ({ ...theme, ...mine }))
  15. class Supplier extends Component {
  16. constructor(props) {
  17. super(props)
  18. this.state = {}
  19. // console.disableYellowBox = true;
  20. }
  21. // 头部
  22. header() {
  23. return (
  24. <View
  25. style={{
  26. height: HEADERSTYLE.height,
  27. paddingTop: HEADERSTYLE.paddingTop + 5,
  28. backgroundColor: '#fff',
  29. borderBottomColor: '#eee',
  30. borderBottomWidth: 1 / PixelRatio.get(),
  31. }}
  32. >
  33. <View
  34. style={{
  35. flex: 1,
  36. justifyContent: 'center',
  37. }}
  38. >
  39. <TouchableOpacity
  40. style={{ position: 'absolute', left: 10, flexDirection: 'row' }}
  41. onPress={() => this.props.dispatch(NavigationActions.back())}
  42. >
  43. <Icon
  44. name="icon-icon-fanhui"
  45. size={20}
  46. color={'#666'}
  47. style={{ marginTop: 4 }}
  48. />
  49. <Text
  50. style={{
  51. fontSize: 14,
  52. lineHeight: 20,
  53. color: '#666',
  54. alignSelf: 'center',
  55. }}
  56. >
  57. 返回
  58. </Text>
  59. </TouchableOpacity>
  60. <Text
  61. style={{
  62. alignSelf: 'center',
  63. fontSize: 18,
  64. lineHeight: 25,
  65. letterSpacing: 0.19,
  66. color: '#333',
  67. }}
  68. >
  69. 供应商
  70. </Text>
  71. </View>
  72. </View>
  73. )
  74. }
  75. SupplierList(item) {
  76. return (
  77. <View
  78. style={{
  79. marginTop: 10,
  80. padding: 10,
  81. backgroundColor: '#FFF',
  82. }}
  83. >
  84. <Text
  85. style={{
  86. fontSize: 15,
  87. lineHeight: 21,
  88. color: '#333',
  89. fontWeight: '600',
  90. }}
  91. >
  92. {item.saleOrganizationName || item.saleCustomerName}
  93. </Text>
  94. {/* <Text
  95. style={{ fontSize: 14, lineHeight: 20, color: "#666", marginTop: 5 }}
  96. > */}
  97. {/* 电 话:{item.tel} */}
  98. {/* 电 话: -
  99. </Text> */}
  100. <Text
  101. style={{ fontSize: 14, lineHeight: 20, color: '#666', marginTop: 5 }}
  102. >
  103. 产品线:{item.productLineName}
  104. </Text>
  105. <Text
  106. style={{ fontSize: 14, lineHeight: 20, color: '#666', marginTop: 3 }}
  107. >
  108. 品 牌:{item.brandName}
  109. </Text>
  110. </View>
  111. )
  112. }
  113. render() {
  114. const { appTheme, SupplierInfo } = this.props
  115. return (
  116. <View
  117. style={[
  118. styles.container,
  119. { backgroundColor: appTheme.backgroundColor },
  120. ]}
  121. >
  122. <StatusBar
  123. animated={true}
  124. barStyle={appTheme.barStyle}
  125. backgroundColor={'transparent'}
  126. translucent={true}
  127. />
  128. {this.header()}
  129. <FlatList
  130. extraData={this.state.collapsed}
  131. keyExtractor={(item, key) => item.id + key}
  132. data={SupplierInfo}
  133. renderItem={({ item, key }) => this.SupplierList(item, key)}
  134. />
  135. </View>
  136. )
  137. }
  138. }
  139. const styles = StyleSheet.create({
  140. container: {
  141. flex: 1,
  142. },
  143. })
  144. export default Supplier