CreatPass.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View, Image, TextInput, ScrollView } from "react-native"
  3. import { unitWidth, unitHeight } from "../utils/AdapterUtil";
  4. import AntDesign from "react-native-vector-icons/AntDesign"
  5. import Ionicons from "react-native-vector-icons/Ionicons"
  6. import MyButtom from '../component/MyButton'
  7. export default class CreatPass extends Component {
  8. toGamerList = () => {
  9. const { navigation } = this.props;
  10. navigation.navigate("GamerList")
  11. }
  12. render() {
  13. return (
  14. <ScrollView>
  15. <View style={styles.container}>
  16. <View style={styles.sec}>
  17. <View style={styles.secTitle}>
  18. <Text style={{ fontSize: unitWidth * 28, color: "#333333", fontWeight: "bold" }}>推荐关卡</Text>
  19. </View>
  20. </View>
  21. <View style={styles.btnList}>
  22. <View style={styles.btnItem}>
  23. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>你最想的东西是什么?</Text>
  24. </View>
  25. <View style={styles.btnItemRed}>
  26. <Text style={{ fontSize: unitWidth * 28, color: "#fff" }}>妈妈和对象同时落水你会先救谁?</Text>
  27. </View>
  28. <View style={styles.btnItem}>
  29. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>你会选择你爱的人还是爱你的人?</Text>
  30. </View>
  31. <View style={styles.btnItem}>
  32. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>如果有一天我和你吵架,你会怎么办?</Text>
  33. </View>
  34. </View>
  35. <View style={styles.sec}>
  36. <View style={styles.secTitle}>
  37. <Text style={{ fontSize: unitWidth * 28, color: "#333333", fontWeight: "bold" }}>关卡题目</Text>
  38. </View>
  39. <TextInput
  40. placeholder="请输入题目标题"
  41. placeholderTextColor={"#999999"}
  42. style={styles.TextInput1}
  43. />
  44. </View>
  45. <View style={styles.sec}>
  46. <View style={styles.secTitle2}>
  47. <Text style={{ fontSize: unitWidth * 28, color: "#333333", fontWeight: "bold" }}>题目选项</Text>
  48. <Text style={{ fontSize: unitWidth * 24, color: "#999999", marginLeft: unitWidth * 20, }}>填完选项后点击右侧单选按钮确定您的答案</Text>
  49. </View>
  50. <View style={styles.ansList}>
  51. <View style={styles.ansItem}>
  52. <View style={styles.ansItemLeft}>
  53. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>选项A</Text>
  54. </View>
  55. <View style={styles.ansItemIcon}>
  56. <Ionicons
  57. name={"md-radio-button-on"}
  58. size={18}
  59. style={{ color: "#FA788A" }}
  60. />
  61. </View>
  62. </View>
  63. <View style={styles.ansItem}>
  64. <View style={styles.ansItemLeft}>
  65. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>选项A</Text>
  66. </View>
  67. <View style={styles.ansItemIcon}>
  68. <AntDesign
  69. name={"delete"}
  70. size={18}
  71. style={{ color: "#999999" }}
  72. />
  73. <Ionicons
  74. name={"md-radio-button-on"}
  75. size={18}
  76. style={{ color: "#999999" }}
  77. />
  78. </View>
  79. </View>
  80. <View style={styles.ansItem}>
  81. <View style={styles.ansItemLeft}>
  82. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>选项A</Text>
  83. </View>
  84. <View style={styles.ansItemIcon}>
  85. <AntDesign
  86. name={"delete"}
  87. size={18}
  88. style={{ color: "#999999" }}
  89. />
  90. <Ionicons
  91. name={"md-radio-button-on"}
  92. size={18}
  93. style={{ color: "#999999" }}
  94. />
  95. </View>
  96. </View>
  97. </View>
  98. <View style={styles.addAns}>
  99. <Ionicons
  100. name={"ios-add-circle-outline"}
  101. size={18}
  102. style={{ color: "#FA788A", marginRight: unitWidth * 10 }}
  103. />
  104. <Text style={{ color: "#FA788A" }}>新建选项</Text>
  105. </View>
  106. </View>
  107. <View style={styles.sec}>
  108. <View style={styles.secTitle}>
  109. <Text style={{ fontSize: unitWidth * 28, color: "#333333", fontWeight: "bold" }}>关卡奖励</Text>
  110. </View>
  111. <View style={styles.bottomitem}>
  112. <Text style={{ fontSize: unitWidth * 28, color: "#333333", flex: 1 }}>手机号码</Text>
  113. <TextInput
  114. placeholder="请输入您的手机号码"
  115. placeholderTextColor={"#999999"}
  116. style={styles.bottomTextInput}
  117. />
  118. </View>
  119. <View style={styles.bottomitem}>
  120. <Text style={{ fontSize: unitWidth * 28, color: "#333333", flex: 1 }}>生活照</Text>
  121. <View style={styles.uploadiconArea}>
  122. <View style={styles.uploadiconBox}>
  123. <Ionicons
  124. name={"ios-add-circle-outline"}
  125. size={45}
  126. style={{ color: "#FA788A", marginRight: unitWidth * 10 }}
  127. />
  128. <Text>上传照片</Text>
  129. </View>
  130. </View>
  131. </View>
  132. <View style={styles.bottomitem}>
  133. <Text style={{ fontSize: unitWidth * 28, color: "#333333", flex: 1 }}>游戏邀请</Text>
  134. <View style={styles.uploadiconArea}>
  135. <View style={styles.resive}>
  136. <Ionicons
  137. name={"md-radio-button-on"}
  138. size={20}
  139. style={{ color: "#999999", marginRight: unitWidth * 10 }}
  140. />
  141. <Text style={{ color: "#333333", fontSize: unitWidth * 28 }}>接收</Text>
  142. </View>
  143. </View>
  144. </View>
  145. </View>
  146. <View style={styles.bottomBtn}>
  147. <MyButtom
  148. onPress={this.toGamerList}
  149. text={"发布关卡"}
  150. width={unitWidth * 502}
  151. height={unitHeight * 84}
  152. borderRadius={unitHeight * 84}
  153. bgColor="#FA788A"
  154. shadowBgc="rgba(250,120,138,1)"
  155. style={{ fontSize: unitWidth * 32 }}
  156. />
  157. </View>
  158. </View>
  159. </ScrollView>
  160. )
  161. }
  162. }
  163. const styles = StyleSheet.create({
  164. container: {
  165. flex: 1,
  166. alignItems: "center",
  167. backgroundColor: "#fff"
  168. },
  169. sec: {
  170. width: "100%",
  171. paddingLeft: unitWidth * 23,
  172. paddingRight: unitWidth * 23
  173. },
  174. secTitle: {
  175. width: "100%",
  176. marginBottom: unitHeight * 18,
  177. marginTop: unitHeight * 25
  178. },
  179. secTitle2: {
  180. width: "100%",
  181. marginBottom: unitHeight * 18,
  182. marginTop: unitHeight * 25,
  183. flexDirection: "row",
  184. alignItems: "center"
  185. },
  186. TextInput1: {
  187. width: "100%",
  188. height: unitHeight * 80,
  189. paddingLeft: unitWidth * 20,
  190. borderWidth: 1,
  191. borderColor: "#DEDEDE"
  192. },
  193. topIcon: {
  194. width: unitWidth * 235,
  195. height: unitHeight * 210,
  196. marginBottom: unitHeight * 44
  197. },
  198. btnList: {
  199. alignItems: "center"
  200. },
  201. btnItem: {
  202. width: unitWidth * 700,
  203. height: unitHeight * 88,
  204. justifyContent: "center",
  205. alignItems: "center",
  206. marginBottom: unitHeight * 19,
  207. borderRadius: unitHeight * 88,
  208. borderWidth: 1,
  209. borderColor: "#FFD1D1"
  210. },
  211. btnItemRed: {
  212. width: unitWidth * 700,
  213. height: unitHeight * 88,
  214. justifyContent: "center",
  215. alignItems: "center",
  216. backgroundColor: "#FB788A",
  217. marginBottom: unitHeight * 19,
  218. borderRadius: unitHeight * 88,
  219. borderWidth: 1,
  220. borderColor: "#FFD1D1"
  221. },
  222. ansList: {
  223. width: "100%"
  224. },
  225. ansItem: {
  226. width: "100%",
  227. height: unitHeight * 80,
  228. flexDirection: "row",
  229. marginBottom: unitHeight * 19
  230. },
  231. ansItemLeft: {
  232. flex: 4,
  233. height: "100%",
  234. borderWidth: 1,
  235. borderColor: "#DEDEDE",
  236. justifyContent: "center",
  237. paddingLeft: unitWidth * 20
  238. },
  239. ansItemIcon: {
  240. flex: 1,
  241. flexDirection: "row",
  242. justifyContent: "space-around",
  243. alignItems: "center"
  244. },
  245. addAns: {
  246. flexDirection: "row",
  247. alignItems: "center",
  248. justifyContent: "flex-end",
  249. marginRight: unitWidth * 150
  250. },
  251. bottomitem: {
  252. flexDirection: "row",
  253. alignItems: "center",
  254. marginBottom: unitHeight * 19
  255. },
  256. bottomTextInput: {
  257. height: unitHeight * 80,
  258. borderWidth: 1,
  259. borderColor: "#DEDEDE",
  260. flex: 4,
  261. paddingLeft: unitWidth * 20
  262. },
  263. uploadiconArea: {
  264. flex: 4
  265. },
  266. uploadiconBox: {
  267. width: unitHeight * 140,
  268. height: unitHeight * 120,
  269. borderWidth: 1,
  270. borderColor: "#DEDEDE",
  271. alignItems: "center",
  272. justifyContent: "space-between",
  273. paddingTop: unitHeight * 12,
  274. paddingBottom: unitHeight * 15,
  275. },
  276. resive: {
  277. flexDirection: "row",
  278. alignItems: "center"
  279. },
  280. bottomBtn: {
  281. width: "100%",
  282. marginTop: unitHeight * 90,
  283. height: unitHeight * 84,
  284. justifyContent: 'center',
  285. alignItems: 'center',
  286. marginBottom: unitHeight * 34
  287. },
  288. })