No Description

CAVideoDiscussPage.js 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /**
  2. * Created by Sean on 2018/5/9.
  3. */
  4. import {
  5. View,
  6. Text,
  7. StyleSheet,
  8. TouchableOpacity,
  9. TouchableWithoutFeedback,
  10. ScrollView,
  11. SectionList,
  12. Image,
  13. FlatList
  14. } from 'react-native'
  15. import React, {Component} from 'react'
  16. import PropTypes from 'prop-types';
  17. import {NavigationBarHeight, TabBarHeight, ScreenDimensions} from '../../../utils/DimensionsTools'
  18. export default class CAVideoDiscussPage extends Component {
  19. constructor(props) {
  20. super(props);
  21. }
  22. render() {
  23. return(
  24. <View style={styles.pageContainer}>
  25. <View style={styles.titleContainer}>
  26. <Text style={styles.discussTitle}>
  27. 全部讨论(3)
  28. </Text>
  29. </View>
  30. <FlatList
  31. data = {[1,2,3]}
  32. renderItem={({item}) => this.renderItem(item)}
  33. keyExtractor = {(item,index) =>{
  34. return 'key' + item.key + index
  35. }}
  36. ListFooterComponent = {() => {
  37. return(
  38. <View style={{width: ScreenDimensions.width, height: 44, backgroundColor: 'red'}} />
  39. )
  40. }}
  41. />
  42. </View>
  43. );
  44. }
  45. renderItem(item) {
  46. let LikeIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/like_hover.png');
  47. return(
  48. <View style={styles.itemContainer}>
  49. <View style={styles.leftContainer}>
  50. <Image style={styles.avatarImage} source={require('../../../resources/images/TabBar/Community/Answer/img.png')}/>
  51. </View>
  52. <View style={{flex: 3}}>
  53. <Text style={[styles.normalText, {marginTop: 36}]}>Michae</Text>
  54. <Text style={[styles.normalText, {marginTop: 15}]}>仍然是早晚半小时,把所有的单词都口头造不同的句子</Text>
  55. <View style={styles.bottomContainer}>
  56. <Text style={styles.lightColorText}>04-03</Text>
  57. <Text style={[styles.lightColorText, {marginLeft: 10}]}>23:34</Text>
  58. </View>
  59. </View>
  60. <View style={styles.rightContainer}>
  61. <Image style={styles.likeIcon} source={LikeIcon}/>
  62. <Text style={[styles.normalText, {marginTop: 10}]}>2324</Text>
  63. </View>
  64. </View>
  65. )
  66. }
  67. }
  68. const styles = StyleSheet.create({
  69. pageContainer: {
  70. width: ScreenDimensions.width,
  71. height: ScreenDimensions.height - NavigationBarHeight.height - 78 - 78 - 45 - 10,
  72. },
  73. titleContainer: {
  74. height: 56,
  75. borderBottomColor: '#efeff4',
  76. borderBottomWidth: 1,
  77. justifyContent:'center'
  78. },
  79. discussTitle: {
  80. fontSize: 18,
  81. color: "#666666",
  82. marginHorizontal: 12
  83. },
  84. itemContainer:{
  85. flex: 1,
  86. flexDirection: 'row',
  87. height: 140,
  88. width: ScreenDimensions.width,
  89. },
  90. leftContainer: {
  91. flex: 1,
  92. justifyContent: 'center',
  93. alignItems:'center',
  94. },
  95. rightContainer: {
  96. flex: 1,
  97. justifyContent: 'center',
  98. alignItems: 'center'
  99. },
  100. avatarImage: {
  101. width: 48,
  102. height: 48,
  103. borderRadius: 24,
  104. },
  105. likeIcon:{
  106. width: 52/2,
  107. height: 25,
  108. },
  109. normalText: {
  110. fontSize: 14,
  111. color: "#434242"
  112. },
  113. lightColorText: {
  114. fontSize: 13,
  115. lineHeight: 12,
  116. color: "#9c9c9c",
  117. },
  118. bottomContainer: {
  119. marginTop: 17,
  120. height: 20,
  121. flexDirection: 'row',
  122. alignItems: 'center'
  123. }
  124. });