RecommendGamer.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View, Image, TouchableOpacity } from "react-native"
  3. import { unitWidth, unitHeight } from "../utils/AdapterUtil";
  4. import FontAwesome from "react-native-vector-icons/FontAwesome"
  5. import MyButtom from '../component/MyButton'
  6. export default class RecommendGamer extends Component {
  7. toGamerList = () => {
  8. const { navigation } = this.props;
  9. navigation.navigate("GamerList")
  10. }
  11. toPassMode = () => {
  12. const { navigation } = this.props;
  13. navigation.navigate("PassMode1")
  14. }
  15. toUserCard = () => {
  16. const { navigation } = this.props;
  17. navigation.navigate("UserCard", { status: 1 })
  18. }
  19. render() {
  20. return (
  21. <View style={styles.container}>
  22. <View style={styles.gamerList}>
  23. <View style={styles.itemArea}>
  24. <TouchableOpacity onPress={this.toUserCard}>
  25. <View style={styles.itemTop}>
  26. <Image
  27. source={require("../../static/bannerBgc.png")}
  28. style={styles.phone}
  29. onPress={this.toGamerList}
  30. />
  31. <View style={styles.userInfo}>
  32. <View style={styles.userTit}>
  33. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>萱萱</Text>
  34. <Text>{"<500m"}</Text>
  35. </View>
  36. <Text style={{ fontSize: unitWidth * 24, color: "#333333" }}>26岁/163/本科/7000-10000</Text>
  37. <View style={styles.userTips}>
  38. <View style={styles.tipsOnce}>
  39. <Text style={{ fontSize: unitWidth * 24, color: "#FDB1B1" }}>身材苗条</Text>
  40. </View>
  41. <View style={styles.tipsOnce}>
  42. <Text style={{ fontSize: unitWidth * 24, color: "#FDB1B1" }}>文艺</Text>
  43. </View>
  44. <View style={styles.tipsOnce}>
  45. <Text style={{ fontSize: unitWidth * 24, color: "#FDB1B1" }}>旅行</Text>
  46. </View>
  47. </View>
  48. </View>
  49. </View>
  50. </TouchableOpacity>
  51. <View style={styles.itemBottom}>
  52. <View style={styles.itemBottomLeft}>
  53. <FontAwesome
  54. name={"heartbeat"}
  55. size={20}
  56. style={{ color: "#FB788A" }}
  57. />
  58. <Text style={{ color: "#999999", fontSize: unitWidth * 24, marginLeft: unitWidth * 10 }}>魅力值:90</Text>
  59. </View>
  60. <View style={styles.itemBottomRight}>
  61. <MyButtom
  62. onPress={this.toGamerList}
  63. text={"查看关卡"}
  64. width={unitWidth * 144}
  65. height={unitHeight * 58}
  66. borderRadius={unitHeight * 10}
  67. bgColor="#fff"
  68. borderColor="#FA788A"
  69. borderWidth={1}
  70. shadowBgc="#fff"
  71. style={{ fontSize: unitWidth * 28, color: "#FA788A" }}
  72. />
  73. <MyButtom
  74. onPress={this.toPassMode}
  75. text={"开始闯关"}
  76. width={unitWidth * 144}
  77. height={unitHeight * 58}
  78. borderRadius={unitHeight * 10}
  79. bgColor="#FF4A6C"
  80. borderColor="#FF4A6C"
  81. borderWidth={1}
  82. shadowBgc="#FB788A"
  83. style={{ fontSize: unitWidth * 28, color: "#fff" }}
  84. />
  85. </View>
  86. </View>
  87. </View>
  88. <View style={styles.itemArea}>
  89. <View style={styles.itemTop}>
  90. <Image
  91. source={require("../../static/bannerBgc.png")}
  92. style={styles.phone}
  93. />
  94. <View style={styles.userInfo}>
  95. <View style={styles.userTit}>
  96. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>萱萱</Text>
  97. <Text>{"<500m"}</Text>
  98. </View>
  99. <Text style={{ fontSize: unitWidth * 24, color: "#333333" }}>26岁/163/本科/7000-10000</Text>
  100. <View style={styles.userTips}>
  101. <View style={styles.tipsOnce}>
  102. <Text style={{ fontSize: unitWidth * 24, color: "#FDB1B1" }}>身材苗条</Text>
  103. </View>
  104. <View style={styles.tipsOnce}>
  105. <Text style={{ fontSize: unitWidth * 24, color: "#FDB1B1" }}>文艺</Text>
  106. </View>
  107. <View style={styles.tipsOnce}>
  108. <Text style={{ fontSize: unitWidth * 24, color: "#FDB1B1" }}>旅行</Text>
  109. </View>
  110. </View>
  111. </View>
  112. </View>
  113. <View style={styles.itemBottom}>
  114. <View style={styles.itemBottomLeft}>
  115. <FontAwesome
  116. name={"heartbeat"}
  117. size={20}
  118. style={{ color: "#FB788A" }}
  119. />
  120. <Text style={{ color: "#999999", fontSize: unitWidth * 24, marginLeft: unitWidth * 10 }}>魅力值:90</Text>
  121. </View>
  122. <View style={styles.itemBottomRight}>
  123. <MyButtom
  124. onPress={this.toGamerList}
  125. text={"查看关卡"}
  126. width={unitWidth * 144}
  127. height={unitHeight * 58}
  128. borderRadius={unitHeight * 10}
  129. bgColor="#fff"
  130. borderColor="#FA788A"
  131. borderWidth={1}
  132. shadowBgc="#fff"
  133. style={{ fontSize: unitWidth * 28, color: "#FA788A" }}
  134. />
  135. <MyButtom
  136. onPress={this.toPassMode}
  137. text={"开始闯关"}
  138. width={unitWidth * 144}
  139. height={unitHeight * 58}
  140. borderRadius={unitHeight * 10}
  141. bgColor="#FF4A6C"
  142. borderColor="#FF4A6C"
  143. borderWidth={1}
  144. shadowBgc="#FB788A"
  145. style={{ fontSize: unitWidth * 28, color: "#fff" }}
  146. />
  147. </View>
  148. </View>
  149. </View>
  150. </View>
  151. </View>
  152. )
  153. }
  154. }
  155. const styles = StyleSheet.create({
  156. container: {
  157. flex: 1,
  158. alignItems: "center",
  159. paddingLeft: unitWidth * 23,
  160. paddingRight: unitWidth * 23,
  161. paddingTop: unitHeight * 57
  162. },
  163. gamerList: {
  164. width: "100%"
  165. },
  166. itemArea: {
  167. width: unitWidth * 702,
  168. height: unitHeight * 308,
  169. backgroundColor: "#F9F9F9",
  170. borderRadius: unitHeight * 10,
  171. paddingTop: unitHeight * 20,
  172. marginBottom: unitHeight * 30,
  173. paddingLeft: unitWidth * 20
  174. },
  175. itemTop: {
  176. flexDirection: "row"
  177. },
  178. phone: {
  179. flex: 1,
  180. height: unitHeight * 180
  181. },
  182. userInfo: {
  183. flex: 2,
  184. paddingLeft: unitWidth * 20,
  185. paddingRight: unitWidth * 20
  186. },
  187. userTit: {
  188. flexDirection: "row",
  189. justifyContent: "space-between",
  190. marginBottom: unitHeight * 30
  191. },
  192. userTips: {
  193. flexDirection: "row",
  194. marginTop: unitHeight * 25
  195. },
  196. tipsOnce: {
  197. height: unitHeight * 42,
  198. backgroundColor: "#FCF2F6",
  199. borderRadius: unitHeight * 42,
  200. justifyContent: "center",
  201. alignItems: "center",
  202. paddingLeft: unitWidth * 20,
  203. paddingRight: unitWidth * 20,
  204. marginLeft: unitWidth * 10,
  205. marginRight: unitWidth * 10
  206. },
  207. itemBottom: {
  208. flexDirection: "row",
  209. justifyContent: "space-between",
  210. alignItems: "center",
  211. marginTop: unitHeight * 30,
  212. paddingLeft: unitWidth * 20,
  213. paddingRight: unitWidth * 20
  214. },
  215. itemBottomLeft: {
  216. flexDirection: "row",
  217. },
  218. itemBottomRight: {
  219. flexDirection: "row",
  220. width: unitWidth * 320,
  221. justifyContent: "space-between"
  222. }
  223. })