Promotions.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. import React, { Component } from 'react'
  2. import {
  3. View,
  4. Text,
  5. PixelRatio,
  6. TouchableOpacity,
  7. StyleSheet,
  8. ScrollView,
  9. Image,
  10. FlatList,
  11. Dimensions,
  12. Animated,
  13. } from 'react-native'
  14. import phonaq from '../../../static/images/defaultimg.jpg'
  15. import Icon from '../../../components/Iconfont/Iconfont'
  16. import { Bubble, ModalEcx, CountNum } from '../../../components'
  17. import { ScaleUtil } from '../../../utils/utils'
  18. const { width } = Dimensions.get('window')
  19. export default class Specification extends Component {
  20. constructor(props) {
  21. super(props)
  22. this.state = {}
  23. }
  24. _renderModalContent() {
  25. return (
  26. <View style={styles.contentBox}>
  27. <View
  28. style={{ alignSelf: 'center', paddingTop: 13, paddingBottom: 18 }}
  29. >
  30. <Text
  31. style={{
  32. fontSize: 14,
  33. lineHeight: 20,
  34. letterSpacing: 0.17,
  35. color: '#999',
  36. }}
  37. >
  38. 促销
  39. </Text>
  40. </View>
  41. <TouchableOpacity
  42. onPress={() => {
  43. this.closeModalCate()
  44. }}
  45. style={{ position: 'absolute', right: 7, top: 10 }}
  46. >
  47. <Icon name="icon-icon-guanbianniu" size={28} color="#999" />
  48. </TouchableOpacity>
  49. {/* 信息行 */}
  50. <FlatList
  51. keyExtractor={(item, index) => index}
  52. data={[
  53. { title: '满减', data: '满100件20' },
  54. { title: '满额返券', data: '全场满199元包邮' },
  55. { title: '组合', data: '搭配商品A可以立省30元' },
  56. { title: '满减', data: '满100件20' },
  57. { title: '满额返券', data: '全场满199元包邮' },
  58. { title: '组合', data: '搭配商品A可以立省30元' },
  59. { title: '满减', data: '满100件20' },
  60. ]}
  61. extraData={this.state}
  62. style={{ paddingHorizontal: 10, paddingBottom: 30 }}
  63. renderItem={({ item, index }) => (
  64. <View
  65. style={{
  66. flexDirection: 'row',
  67. paddingVertical: 10,
  68. borderBottomColor: '#EEE',
  69. borderBottomWidth: 1 / PixelRatio.get(),
  70. }}
  71. >
  72. <View
  73. style={{
  74. paddingVertical: 2,
  75. paddingHorizontal: 8,
  76. borderRadius: 100,
  77. borderColor: '#E70013',
  78. borderWidth: 1 / PixelRatio.get(),
  79. }}
  80. >
  81. <Text
  82. style={{
  83. fontSize: 10,
  84. lineHeight: 14,
  85. letterSpacing: 0.14,
  86. color: '#E70013',
  87. }}
  88. >
  89. {item.title}
  90. </Text>
  91. </View>
  92. <Text
  93. style={{
  94. fontSize: 12,
  95. lineHeight: 17,
  96. color: '#333',
  97. marginLeft: 5,
  98. marginTop: 2,
  99. }}
  100. >
  101. {item.data}
  102. </Text>
  103. </View>
  104. )}
  105. />
  106. </View>
  107. )
  108. }
  109. _openModalCate(va, data) {
  110. this.mdPromot._setModalVisible(va)
  111. }
  112. closeModalCate() {
  113. this.mdPromot._setModalVisible(false)
  114. }
  115. render() {
  116. return (
  117. <ModalEcx
  118. animationType={'fade'}
  119. ref={mdPromot => (this.mdPromot = mdPromot)}
  120. content={this._renderModalContent()}
  121. />
  122. )
  123. }
  124. }
  125. const styles = StyleSheet.create({
  126. contentBox: {
  127. backgroundColor: '#FFF',
  128. },
  129. })