OrderCredit.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. import React, { Component } from 'react'
  2. import {
  3. View,
  4. Dimensions,
  5. FlatList,
  6. TouchableOpacity,
  7. Text,
  8. } from 'react-native'
  9. import { connect } from 'react-redux'
  10. import { NavigationActions } from '../../../utils'
  11. import Icon from '../../../components/Iconfont/Iconfont'
  12. import ModalEcx from '../../../components/Modal'
  13. const { width, height } = Dimensions.get('window')
  14. // @connect(({ theme }) => ({ ...theme }))
  15. class OrderCredit extends Component {
  16. constructor(props) {
  17. super(props)
  18. this.state = {
  19. data: [],
  20. }
  21. }
  22. _closeModal() {
  23. this.credit._setModalVisible(false)
  24. }
  25. _openModal = va => {
  26. this.credit._setModalVisible(true)
  27. this.setState({ data: va })
  28. }
  29. OrderCredit(item) {
  30. return (
  31. <View
  32. style={{
  33. marginBottom: 2,
  34. borderBottomColor: '#EEE',
  35. borderBottomWidth: 1,
  36. }}
  37. >
  38. <View style={{ paddingTop: 7 }}>
  39. <Text style={{ fontSize: 14, color: '#333' }}>
  40. {item.productLineName}
  41. </Text>
  42. </View>
  43. <View
  44. style={{
  45. flexDirection: 'row',
  46. justifyContent: 'space-between',
  47. paddingVertical: 7,
  48. }}
  49. >
  50. <Text style={{ fontSize: 13, lineHeight: 18, color: '#666' }}>
  51. 信用余额:
  52. </Text>
  53. <Text style={{ fontSize: 13, lineHeight: 18, color: '#666' }}>
  54. {CURRENCY.currencySign} {item.creditBalance}
  55. </Text>
  56. </View>
  57. <View
  58. style={{
  59. flexDirection: 'row',
  60. justifyContent: 'space-between',
  61. marginBottom: 7,
  62. }}
  63. >
  64. <Text style={{ fontSize: 13, lineHeight: 18, color: '#666' }}>
  65. 本单产品线金额:
  66. </Text>
  67. <Text style={{ fontSize: 13, lineHeight: 18, color: '#666' }}>
  68. {CURRENCY.currencySign} {item.thisProdLineAmount}
  69. </Text>
  70. </View>
  71. </View>
  72. )
  73. }
  74. _renderModalContent() {
  75. return (
  76. <View
  77. style={{
  78. width: width,
  79. backgroundColor: '#FFF',
  80. paddingHorizontal: 10,
  81. paddingTop: 20,
  82. paddingBottom: 130,
  83. }}
  84. >
  85. <TouchableOpacity
  86. onPress={() => {
  87. this._closeModal()
  88. this.props.cb && this.props.cb()
  89. }}
  90. style={{ position: 'absolute', right: 10, top: 10 }}
  91. >
  92. <Icon name="icon-icon-guanbianniu" size={26} color={'#CCC'} />
  93. </TouchableOpacity>
  94. <Text
  95. style={{
  96. alignSelf: 'center',
  97. fontSize: 15,
  98. lineHeight: 19,
  99. color: '#333',
  100. }}
  101. >
  102. 本单信用满足情况
  103. </Text>
  104. <FlatList
  105. keyExtractor={(item, index) => index}
  106. data={this.state.data}
  107. extraData={this.state}
  108. style={{ marginTop: 31 }}
  109. renderItem={({ item, index }) => this.OrderCredit(item, index)}
  110. />
  111. </View>
  112. )
  113. }
  114. gotoDetail = () => {
  115. this.props.dispatch(NavigationActions.navigate({ routeName: 'Detail' }))
  116. }
  117. render() {
  118. return (
  119. <ModalEcx
  120. ref={credit => (this.credit = credit)}
  121. content={this._renderModalContent()}
  122. />
  123. )
  124. }
  125. }
  126. export default OrderCredit