BasicInfo.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. import React, { Component } from 'react'
  2. import {
  3. StyleSheet,
  4. ScrollView,
  5. View,
  6. Text,
  7. StatusBar,
  8. TouchableOpacity,
  9. PixelRatio,
  10. FlatList,
  11. } from 'react-native'
  12. import { connect } from 'react-redux'
  13. import Icon from '../../../components/Iconfont/Iconfont'
  14. import { NavigationActions, createAction } from '../../../utils'
  15. @connect(({ theme, mine }) => ({ ...theme, ...mine }))
  16. class BasicInfo extends Component {
  17. constructor(props) {
  18. super(props)
  19. this.state = {}
  20. // console.disableYellowBox = true;
  21. }
  22. // 头部
  23. header() {
  24. return (
  25. <View
  26. style={{
  27. height: HEADERSTYLE.height,
  28. paddingTop: HEADERSTYLE.paddingTop + 5,
  29. backgroundColor: '#fff',
  30. borderBottomColor: '#eee',
  31. borderBottomWidth: 1 / PixelRatio.get(),
  32. }}
  33. >
  34. <View
  35. style={{
  36. flex: 1,
  37. justifyContent: 'center',
  38. }}
  39. >
  40. <TouchableOpacity
  41. style={{ position: 'absolute', left: 10, flexDirection: 'row' }}
  42. onPress={() => this.props.dispatch(NavigationActions.back())}
  43. >
  44. <Icon
  45. name="icon-icon-fanhui"
  46. size={20}
  47. color={'#666'}
  48. style={{ marginTop: 4 }}
  49. />
  50. <Text
  51. style={{
  52. fontSize: 14,
  53. lineHeight: 20,
  54. color: '#666',
  55. alignSelf: 'center',
  56. }}
  57. >
  58. 返回
  59. </Text>
  60. </TouchableOpacity>
  61. <Text
  62. style={{
  63. alignSelf: 'center',
  64. fontSize: 18,
  65. lineHeight: 25,
  66. letterSpacing: 0.19,
  67. color: '#333',
  68. }}
  69. >
  70. 基础信息
  71. </Text>
  72. </View>
  73. </View>
  74. )
  75. }
  76. viewList(header, content) {
  77. return (
  78. <View
  79. style={{
  80. flexDirection: 'row',
  81. paddingVertical: 10,
  82. borderTopColor: '#EEE',
  83. borderTopWidth: 1 / PixelRatio.get(),
  84. }}
  85. >
  86. <Text
  87. style={{
  88. fontSize: 14,
  89. lineHeight: 20,
  90. letterSpacing: 0.17,
  91. color: '#999',
  92. }}
  93. >
  94. {header}
  95. </Text>
  96. <Text
  97. style={{
  98. flex: 1,
  99. fontSize: 14,
  100. lineHeight: 20,
  101. letterSpacing: 0.17,
  102. color: '#333',
  103. marginLeft: 20,
  104. }}
  105. >
  106. {content}
  107. </Text>
  108. </View>
  109. )
  110. }
  111. basicList(item) {
  112. return (
  113. <View>
  114. <View style={{ backgroundColor: '#FFF', paddingHorizontal: 10 }}>
  115. {/* 客户编号 */}
  116. {this.viewList('客户编码', item.code)}
  117. {/* 客户名称 */}
  118. {this.viewList('客户名称', item.name)}
  119. {/* 客户分类 */}
  120. {this.viewList('客户分类', item.customerCategoryName)}
  121. {/* 渠道类型 */}
  122. {this.viewList('渠道类型', item.channelTypeName)}
  123. {/* 法人代表 */}
  124. {this.viewList('法人代表', item.legalPerson)}
  125. {/* 税务登记 */}
  126. {this.viewList('税务登记', item.taxRegNo)}
  127. {/* 客户地区 */}
  128. {this.viewList(
  129. '客户地区',
  130. (item.countryName || '') +
  131. (item.provinceName || '') +
  132. (item.cityName || '') +
  133. (item.countyName || '') +
  134. (item.townName || '') +
  135. (item.detailAddr || '')
  136. )}
  137. </View>
  138. </View>
  139. )
  140. }
  141. render() {
  142. const { appTheme, BasicInfo, BankInfo } = this.props
  143. return (
  144. <View
  145. style={[
  146. styles.container,
  147. { backgroundColor: appTheme.backgroundColor },
  148. ]}
  149. >
  150. <StatusBar
  151. animated={true}
  152. barStyle={appTheme.barStyle}
  153. // barStyle={"dark-content"}
  154. backgroundColor={'transparent'}
  155. translucent={true}
  156. />
  157. {this.header()}
  158. <ScrollView style={{ flex: 1 }}>
  159. {this.basicList(BasicInfo, BankInfo)}
  160. <FlatList
  161. extraData={this.state}
  162. keyExtractor={item => item.id}
  163. data={BankInfo}
  164. renderItem={({ item }) => (
  165. <View
  166. style={{
  167. marginTop: 10,
  168. backgroundColor: '#FFF',
  169. paddingHorizontal: 10,
  170. }}
  171. >
  172. {/* 开户银行 */}
  173. {this.viewList('开 户 行', item.depositBankName)}
  174. {/* 银行账户 */}
  175. {this.viewList('银行账户', item.accountNumber)}
  176. {/* 户名 */}
  177. {this.viewList('户 名', item.accountName)}
  178. </View>
  179. )}
  180. />
  181. </ScrollView>
  182. </View>
  183. )
  184. }
  185. }
  186. const styles = StyleSheet.create({
  187. container: {
  188. flex: 1,
  189. },
  190. })
  191. export default BasicInfo