CreatPass.js 12 KB

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