No Description

BottomView.js 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. /**
  2. * Created by zack on 2018/4/19.
  3. */
  4. import {
  5. View,
  6. Text,
  7. Image,
  8. StyleSheet,
  9. TouchableHighlight,
  10. ImageBackground
  11. } from 'react-native'
  12. import React, { Component } from 'react'
  13. import ScreenDimensions from '../../../utils/ScreenDimensions'
  14. import ScreenDimensionsClientHeight from '../../../utils/ScreenDimensions'
  15. import NavigationBarHeight from '../../../utils/NavigationBarHeight'
  16. import TabBarHeight from '../../../utils/TabBarHeight'
  17. export default class BottomView extends Component {
  18. constructor(props) {
  19. super(props)
  20. this.state = {
  21. selectLike:false
  22. }
  23. }
  24. componentDidMount() {
  25. }
  26. componentWillReceiveProps(nextProps) {
  27. }
  28. render() {
  29. let uerIcon = require('../../../resources/images/TabBar/Community/SmallVideo/user_3.png');
  30. let addIcon = require('../../../resources/images/TabBar/Community/SmallVideo/follow.png');
  31. let LikeSelectIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/like_hover.png');
  32. let LikeIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/like.png');
  33. let messIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/mess.png');
  34. let forwardIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/forward.png');
  35. let cameraIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/camera.png');
  36. let inputIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/input.png');
  37. let penIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/pen.png');
  38. let expressIcon = require('../../../resources/images/TabBar/Community/SmallVideo/VideoDetails/Express.png');
  39. return (
  40. <View
  41. style={styles.View}>
  42. <View style={styles.topStyle}>
  43. <View style={styles.rightStyle}>
  44. <TouchableHighlight
  45. underlayColor={"rgba(255,255,255,0)"}
  46. onPress={this.onPressAdd.bind(this)}>
  47. <View style={styles.ImageView}>
  48. <Image source={uerIcon} style={styles.userIcon} />
  49. <Image source={addIcon} style={styles.followStyle} />
  50. </View>
  51. </TouchableHighlight>
  52. <TouchableHighlight
  53. underlayColor={"rgba(255,255,255,0)"}
  54. onPress={this.onPressLike.bind(this)}>
  55. <View style={styles.LikeView}>
  56. <Image source={this.state.selectLike?LikeSelectIcon:LikeIcon} style={styles.likeIcon} />
  57. <Text style={styles.textStyle}>688</Text>
  58. </View>
  59. </TouchableHighlight>
  60. <TouchableHighlight
  61. underlayColor={"rgba(255,255,255,0)"}
  62. onPress={this.onPressMess.bind(this)}>
  63. <View style={styles.messView}>
  64. <Image source={messIcon} style={styles.messIcon} />
  65. <Text style={styles.textStyle}>688</Text>
  66. </View>
  67. </TouchableHighlight>
  68. <TouchableHighlight
  69. underlayColor={"rgba(255,255,255,0)"}
  70. onPress={this.onPressForWard.bind(this)}>
  71. <View style={styles.forwardView}>
  72. <Image source={forwardIcon} style={styles.forwardIcon} />
  73. <Text style={styles.textStyle}>688</Text>
  74. </View>
  75. </TouchableHighlight>
  76. </View>
  77. </View>
  78. <View style={styles.bottomStyle}>
  79. <Text style={styles.bottomText}>轮从小的英语环境的重要性轮从小的英语环境的重要性</Text>
  80. <TouchableHighlight
  81. underlayColor={"rgba(255,255,255,0)"}
  82. onPress={this.onPressCamera.bind(this)}>
  83. <View style={styles.cameraView}>
  84. <Image source={cameraIcon} style={styles.cameraIcon} />
  85. </View>
  86. </TouchableHighlight>
  87. </View>
  88. <TouchableHighlight
  89. underlayColor={"rgba(255,255,255,0)"}
  90. onPress={this.onPressBoard.bind(this)}>
  91. <View>
  92. <ImageBackground source={inputIcon} style={styles.inputView}>
  93. <View style={{flexDirection:"row",justifyContent:"center"}}>
  94. <Image source={penIcon} style={styles.penIcon} />
  95. <Text style={styles.inputStyle}>写评论....</Text>
  96. </View>
  97. <View>
  98. <Image source={expressIcon} style={styles.expressIcon} />
  99. </View>
  100. </ImageBackground>
  101. </View>
  102. </TouchableHighlight>
  103. </View>
  104. );
  105. }
  106. onPressAdd(){
  107. //添加好友
  108. }
  109. onPressLike(){
  110. //点赞
  111. let bool= this.state.selectLike;
  112. this.setState({
  113. selectLike:!bool
  114. })
  115. }
  116. onPressMess(){
  117. //评论
  118. console.log("评论")
  119. }
  120. onPressForWard(){
  121. //分享
  122. console.log("分享")
  123. }
  124. onPressCamera(){
  125. //去拍摄
  126. console.log("去拍摄")
  127. this.props.onPressInput()
  128. }
  129. onPressBoard(){
  130. //弹出输入框
  131. console.log("弹出输入框")
  132. this.props.onPressInput()
  133. }
  134. }
  135. const styles = StyleSheet.create({
  136. View:{
  137. position: 'absolute',
  138. // top: (250/640)*(ScreenDimensions.height),
  139. left: 0,
  140. right: 0,
  141. bottom:0,
  142. width:ScreenDimensions.width,
  143. height:340,
  144. },
  145. topStyle: {
  146. alignItems: "flex-end"
  147. },
  148. bottomStyle:{
  149. justifyContent:"space-between",
  150. flexDirection:"row"
  151. },
  152. rightStyle: {
  153. flexDirection: "column",
  154. marginRight:13
  155. },
  156. ImageView:{
  157. width:45,
  158. height:45,
  159. borderRadius:45,
  160. alignItems:"center"
  161. },
  162. userIcon: {
  163. width: 40,
  164. height: 40,
  165. },
  166. followStyle: {
  167. width: 12,
  168. height: 12,
  169. marginTop: -8,
  170. },
  171. textStyle:{
  172. color:"#ffffff",
  173. fontSize:14,
  174. marginTop:5
  175. },
  176. LikeView:{
  177. width:45,
  178. height:45,
  179. marginTop:15,
  180. alignItems:"center"
  181. },
  182. likeIcon:{
  183. width: 52/2,
  184. height: 25,
  185. },
  186. messView:{
  187. width:45,
  188. height:45,
  189. marginTop:15,
  190. alignItems:"center"
  191. },
  192. messIcon:{
  193. width: 52/2,
  194. height: 25,
  195. },
  196. forwardView:{
  197. width:45,
  198. height:45,
  199. marginTop:15,
  200. alignItems:"center"
  201. },
  202. forwardIcon:{
  203. width: 52/2,
  204. height: 56/2,
  205. },
  206. bottomText:{
  207. width:200,
  208. fontSize:14,
  209. color:"#ffffff",
  210. marginLeft:15,
  211. marginTop:15,
  212. },
  213. cameraIcon:{
  214. width: 57/2,
  215. height: 49/2,
  216. },
  217. cameraView:{
  218. width:45,
  219. height:45,
  220. marginTop:15,
  221. marginRight:15,
  222. alignItems:"center"
  223. },
  224. inputView:{
  225. marginHorizontal:15,
  226. height:87/2,
  227. justifyContent:"space-between",
  228. flexDirection:"row",
  229. alignItems:"center"
  230. },
  231. inputStyle:{
  232. color:"#ffffff",
  233. fontSize:14,
  234. },
  235. penIcon:{
  236. width:16,
  237. height:16,
  238. marginLeft:15,
  239. marginRight:15,
  240. },
  241. expressIcon:{
  242. width:20,
  243. height:20,
  244. marginRight:15,
  245. }
  246. })