GameHome.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View, Image, ImageBackground, ScrollView } from "react-native"
  3. import { unitWidth, unitHeight } from "../utils/AdapterUtil";
  4. import Ionicons from "react-native-vector-icons/Ionicons"
  5. import FontAwesome5 from "react-native-vector-icons/FontAwesome5"
  6. export default class GameHome extends Component {
  7. render() {
  8. return (
  9. <ScrollView>
  10. <View style={styles.container}>
  11. <Image
  12. source={require("../../static/bannerBgc.png")}
  13. style={styles.bannerBgc}
  14. />
  15. <View style={styles.centerTab}>
  16. <ImageBackground source={require('../../static/tabBgc1.png')}
  17. style={styles.tabBgc}
  18. >
  19. <Text style={styles.tabText}>闯关游戏</Text>
  20. </ImageBackground>
  21. <ImageBackground source={require('../../static/tabBgc2.png')}
  22. style={styles.tabBgc}
  23. >
  24. <Text style={styles.tabText}>谁是卧底</Text>
  25. </ImageBackground>
  26. </View>
  27. <View style={styles.cardList}>
  28. <View style={styles.cardItem}>
  29. <View style={styles.cardTit}>
  30. <Ionicons
  31. name={"ios-radio-button-on"}
  32. size={20}
  33. style={{ color: "#FB788A" }}
  34. />
  35. <Text style={{ fontSize: unitWidth * 28, color: "#333333", marginLeft: unitWidth * 20 }}>推荐关卡</Text>
  36. </View>
  37. <Text style={{ fontSize: unitWidth * 28, color: "#333333", marginBottom: unitHeight * 24 }}>关卡关卡关卡关卡关卡关卡关卡关卡关卡关卡关卡关卡关卡</Text>
  38. <Image
  39. source={require("../../static/bannerBgc.png")}
  40. style={styles.cardBgc}
  41. />
  42. <View style={styles.cardBottom}>
  43. <View style={styles.cardBottomItem}>
  44. <FontAwesome5
  45. name={"crown"}
  46. size={20}
  47. style={{ color: "orange" }}
  48. />
  49. <Text style={{ fontSize: unitWidth * 28, color: "#333333", marginLeft: unitWidth * 20 }}>关主:明明</Text>
  50. </View>
  51. <View style={styles.cardBottomItem}>
  52. <FontAwesome5
  53. name={"heartbeat"}
  54. size={20}
  55. style={{ color: "#FB788A" }}
  56. />
  57. <Text style={{ fontSize: unitWidth * 28, color: "#333333", marginLeft: unitWidth * 20 }}>魅力值:90</Text>
  58. </View>
  59. </View>
  60. </View>
  61. </View>
  62. </View>
  63. </ScrollView>
  64. )
  65. }
  66. }
  67. const styles = StyleSheet.create({
  68. container: {
  69. flex: 1,
  70. alignItems: "center",
  71. paddingLeft: unitWidth * 23,
  72. paddingRight: unitWidth * 23
  73. },
  74. bannerBgc: {
  75. height: unitHeight * 300,
  76. width: "100%",
  77. marginTop: unitHeight * 10
  78. },
  79. centerTab: {
  80. width: "100%",
  81. height: unitHeight * 200,
  82. marginTop: unitHeight * 30,
  83. marginBottom: unitHeight * 30,
  84. flexDirection: "row",
  85. justifyContent: "space-between"
  86. },
  87. tabBgc: {
  88. width: unitWidth * 342,
  89. height: unitHeight * 200,
  90. justifyContent: "center",
  91. paddingLeft: unitWidth * 42,
  92. },
  93. tabText: {
  94. fontSize: unitWidth * 32,
  95. color: "#FFFFFF",
  96. fontWeight: "bold"
  97. },
  98. cardList: {
  99. width: "100%"
  100. },
  101. cardItem: {
  102. width: "100%",
  103. height: unitHeight * 880
  104. },
  105. cardTit: {
  106. flexDirection: "row",
  107. alignItems: "center",
  108. marginBottom: unitHeight * 23
  109. },
  110. cardBgc: {
  111. width: "100%",
  112. height: unitHeight * 650,
  113. borderRadius: unitHeight * 20
  114. },
  115. cardBottom: {
  116. flexDirection: "row",
  117. justifyContent: "space-between",
  118. paddingLeft: unitWidth * 30,
  119. paddingRight: unitWidth * 30,
  120. marginTop: unitHeight * 30
  121. },
  122. cardBottomItem: {
  123. flexDirection: "row",
  124. alignItems: "center"
  125. }
  126. })