OrderEditGoods.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. import React, { Component } from 'react'
  2. import {
  3. StyleSheet,
  4. View,
  5. Image,
  6. StatusBar,
  7. Text,
  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 } from '../../../utils'
  15. import png from '../../../static/images/defaultimg.jpg'
  16. import CountNum from '../../../components/CountNum'
  17. import Collapsible from 'react-native-collapsible'
  18. import lodash from 'lodash'
  19. class OrderEditGoods extends Component {
  20. constructor() {
  21. super()
  22. this.state = { activeAllCollaps: true }
  23. }
  24. setActive() {
  25. this.setState({ activeAllCollaps: !this.state.activeAllCollaps })
  26. }
  27. goodsInfo(item, index) {
  28. return (
  29. <View key={index}>
  30. <View style={{ padding: 10, marginTop: 10, backgroundColor: '#FFF' }}>
  31. <View style={{ flexDirection: 'row' }}>
  32. <Image source={png} style={{ width: 80, height: 80 }} />
  33. <View style={{ marginLeft: 10, flex: 1 }}>
  34. <Text style={{ fontSize: 13, lineHeight: 18, color: '#333' }}>
  35. 布艺沙发可拆洗组合储物坐在沙发上美人榻在右手边
  36. </Text>
  37. <View
  38. style={{
  39. flexDirection: 'row',
  40. justifyContent: 'space-between',
  41. marginTop: 10,
  42. }}
  43. >
  44. {/* <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  45. 库存:200 件
  46. </Text> */}
  47. <CountNum
  48. defaultValue={4}
  49. size={24}
  50. callback={nv => console.log(nv)}
  51. />
  52. </View>
  53. </View>
  54. </View>
  55. <View
  56. style={{
  57. flexDirection: 'row',
  58. justifyContent: 'space-between',
  59. marginTop: 10,
  60. }}
  61. >
  62. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  63. 成交价:<Text
  64. style={{ fontSize: 14, lineHeight: 17, color: '#E14C46' }}
  65. >
  66. {CURRENCY.currencySign}696.00
  67. </Text>
  68. </Text>
  69. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  70. 成交金额:<Text
  71. style={{ fontSize: 14, lineHeight: 17, color: '#E14C46' }}
  72. >
  73. {CURRENCY.currencySign}122096.00
  74. </Text>
  75. </Text>
  76. </View>
  77. </View>
  78. <Collapsible collapsed={this.state.activeAllCollaps}>
  79. <View style={{ padding: 10, backgroundColor: '#FAFAFA' }}>
  80. <View
  81. style={{ flexDirection: 'row', justifyContent: 'space-between' }}
  82. >
  83. <Text style={styles.text666}>
  84. 单价:{CURRENCY.currencySign}5099.00
  85. </Text>
  86. <Text style={styles.text666}>
  87. 金额:{CURRENCY.currencySign}55099.00
  88. </Text>
  89. </View>
  90. <View
  91. style={{
  92. flexDirection: 'row',
  93. justifyContent: 'space-between',
  94. marginTop: 3,
  95. }}
  96. >
  97. <Text style={styles.text666}>重量:200kg</Text>
  98. <Text style={styles.text666}>体积:8平方米</Text>
  99. </View>
  100. </View>
  101. </Collapsible>
  102. </View>
  103. )
  104. }
  105. render() {
  106. return [1, 2, 3].map((item, key) => this.goodsInfo(item, key))
  107. }
  108. }
  109. const styles = StyleSheet.create({
  110. container: {
  111. flex: 1,
  112. },
  113. text333: {
  114. fontSize: 14,
  115. lineHeight: 20,
  116. letterSpacing: 0.17,
  117. color: '#333',
  118. },
  119. text666: {
  120. fontSize: 12,
  121. lineHeight: 17,
  122. color: '#666',
  123. },
  124. text999: {
  125. fontSize: 12,
  126. lineHeight: 17,
  127. color: '#999',
  128. },
  129. })
  130. export default OrderEditGoods