PersonalInfo.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. /**
  2. * Sample React Native App
  3. * https://github.com/facebook/react-native
  4. *
  5. * @format
  6. * @flow
  7. */
  8. import React, { Component } from "react";
  9. import {
  10. Platform,
  11. StyleSheet,
  12. Text,
  13. View,
  14. Image,
  15. TouchableOpacity,
  16. ImageBackground,
  17. Button,
  18. StatusBar,
  19. DeviceEventEmitter
  20. } from "react-native";
  21. import AndroidUtil from "../../util/AndroidUtil";
  22. import BasePage from "../BasePage";
  23. import CourseTitle from "./CourseTitle";
  24. import Header from "./Header";
  25. type Props = {};
  26. export default class PersonalInfo extends BasePage {
  27. render() {
  28. return (
  29. <View style={{ flex: 1 }}>
  30. <StatusBar
  31. // backgroundColor={"transparent"}
  32. barStyle={"dark-content"}
  33. backgroundColor={"white"}
  34. translucent={false}
  35. />
  36. <ImageBackground style={{ flex: 1, backgroundColor: "blue" }}>
  37. <View
  38. style={{
  39. flex: 1,
  40. flexDirection: "column"
  41. }}
  42. >
  43. <View
  44. style={{
  45. width: "100%",
  46. flex: 1
  47. }}
  48. >
  49. <CourseTitle
  50. width={this.getWindowWidth()}
  51. title="个人信息"
  52. backPress={() => this.goBack()}
  53. lefttype={2}
  54. righttype={2}
  55. textcolor={"white"}
  56. backPress={() => alert("点击左侧")}
  57. rightPress={() => alert("点击分享")}
  58. />
  59. </View>
  60. <View
  61. style={{
  62. width: "100%",
  63. flex: 3,
  64. alignItems: "center",
  65. justifyContent: "center"
  66. }}
  67. >
  68. <View
  69. style={{
  70. backgroundColor: "white",
  71. width: "90%",
  72. height: "90%",
  73. alignItems: "center",
  74. justifyContent: "center",
  75. borderRadius: 20,
  76. overflow: "hidden"
  77. }}
  78. >
  79. <Header
  80. uri="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1295208965,3056573814&amp;fm=26&amp;gp=0.jpg"
  81. username="卡通笨笨熊"
  82. flowerNumber="123234"
  83. onPress={() => this.toNextPage("MainActivity")}
  84. />
  85. </View>
  86. </View>
  87. <View
  88. style={{
  89. width: "100%",
  90. flex: 4,
  91. alignItems: "center",
  92. justifyContent: "center"
  93. }}
  94. >
  95. <View
  96. style={{
  97. backgroundColor: "#F3F3F3",
  98. width: "90%",
  99. alignItems: "center",
  100. justifyContent: "center",
  101. height: "90%",
  102. overflow: "hidden",
  103. borderRadius: 20
  104. }}
  105. >
  106. {this.userInfo123()}
  107. </View>
  108. </View>
  109. <View
  110. style={{
  111. width: "100%",
  112. alignItems: "center",
  113. justifyContent: "center",
  114. flex: 4
  115. }}
  116. >
  117. <View
  118. style={{
  119. backgroundColor: "#F3F3F3",
  120. width: "90%",
  121. height: "90%",
  122. overflow: "hidden",
  123. borderRadius: 20
  124. }}
  125. >
  126. {this.userInfo456()}
  127. </View>
  128. </View>
  129. <View
  130. style={{
  131. width: "100%",
  132. flex: 4,
  133. alignItems: "center",
  134. justifyContent: "center"
  135. }}
  136. >
  137. <View
  138. style={{
  139. width: "80%",
  140. height: "35%"
  141. }}
  142. >
  143. <ImageBackground
  144. source={{
  145. uri:
  146. "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg"
  147. }}
  148. style={{
  149. flex: 1,
  150. alignItems: "center",
  151. borderRadius: 40,
  152. justifyContent: "center",
  153. width: "100%",
  154. height: "100%"
  155. }}
  156. imageStyle={{ borderRadius: 40 }}
  157. >
  158. <Text
  159. style={{
  160. fontSize: 30,
  161. color: "white",
  162. width: "100%",
  163. textAlign: "center"
  164. }}
  165. >
  166. 退出登录
  167. </Text>
  168. </ImageBackground>
  169. </View>
  170. </View>
  171. </View>
  172. </ImageBackground>
  173. </View>
  174. );
  175. }
  176. userInfo123() {
  177. return (
  178. <View
  179. style={{
  180. width: "100%",
  181. alignItems: "center",
  182. justifyContent: "center",
  183. height: "100%"
  184. }}
  185. >
  186. <View style={styles.item}>
  187. <View
  188. style={{
  189. flex: 2,
  190. alignItems: "center",
  191. justifyContent: "center"
  192. }}
  193. >
  194. <Image
  195. style={{
  196. backgroundColor: "yellow",
  197. width: "50%",
  198. height: "50%"
  199. }}
  200. />
  201. </View>
  202. <Text style={styles.item_text}>头像</Text>
  203. <View
  204. style={{
  205. flex: 2,
  206. alignItems: "center",
  207. justifyContent: "center"
  208. }}
  209. >
  210. <Image
  211. style={{
  212. backgroundColor: "yellow",
  213. width: "50%",
  214. height: "50%"
  215. }}
  216. />
  217. </View>
  218. </View>
  219. <View style={{ flex: 0.05 }} />
  220. <View style={styles.item}>
  221. <View
  222. style={{
  223. flex: 2,
  224. alignItems: "center",
  225. justifyContent: "center"
  226. }}
  227. >
  228. <Image
  229. style={{
  230. backgroundColor: "yellow",
  231. width: "50%",
  232. height: "50%"
  233. }}
  234. />
  235. </View>
  236. <Text style={styles.item_text}>昵称</Text>
  237. <View
  238. style={{
  239. flex: 2,
  240. alignItems: "center",
  241. justifyContent: "center"
  242. }}
  243. >
  244. <Image
  245. style={{
  246. backgroundColor: "yellow",
  247. width: "50%",
  248. height: "50%"
  249. }}
  250. />
  251. </View>
  252. </View>
  253. <View style={{ flex: 0.05 }} />
  254. <View style={styles.item}>
  255. <View
  256. style={{
  257. flex: 2,
  258. alignItems: "center",
  259. justifyContent: "center"
  260. }}
  261. >
  262. <Image
  263. style={{
  264. backgroundColor: "yellow",
  265. width: "50%",
  266. height: "50%"
  267. }}
  268. />
  269. </View>
  270. <Text style={styles.item_text}>生日</Text>
  271. <View
  272. style={{
  273. flex: 2,
  274. alignItems: "center",
  275. justifyContent: "center"
  276. }}
  277. >
  278. <Image
  279. style={{
  280. backgroundColor: "yellow",
  281. width: "50%",
  282. height: "50%"
  283. }}
  284. />
  285. </View>
  286. </View>
  287. </View>
  288. );
  289. }
  290. userInfo456() {
  291. return (
  292. <View
  293. style={{
  294. width: "100%",
  295. alignItems: "center",
  296. justifyContent: "center",
  297. height: "100%"
  298. }}
  299. >
  300. <View style={styles.item}>
  301. <View
  302. style={{
  303. flex: 2,
  304. alignItems: "center",
  305. justifyContent: "center"
  306. }}
  307. >
  308. <Image
  309. style={{
  310. backgroundColor: "yellow",
  311. width: "50%",
  312. height: "50%"
  313. }}
  314. />
  315. </View>
  316. <Text style={styles.item_text}>所在地区</Text>
  317. <View
  318. style={{
  319. flex: 2,
  320. alignItems: "center",
  321. justifyContent: "center"
  322. }}
  323. >
  324. <Image
  325. style={{
  326. backgroundColor: "yellow",
  327. width: "50%",
  328. height: "50%"
  329. }}
  330. />
  331. </View>
  332. </View>
  333. <View style={{ flex: 0.05 }} />
  334. <View style={styles.item}>
  335. <View
  336. style={{
  337. flex: 2,
  338. alignItems: "center",
  339. justifyContent: "center"
  340. }}
  341. >
  342. <Image
  343. style={{
  344. backgroundColor: "yellow",
  345. width: "50%",
  346. height: "50%"
  347. }}
  348. />
  349. </View>
  350. <Text style={styles.item_text}>我的学习</Text>
  351. <View
  352. style={{
  353. flex: 2,
  354. alignItems: "center",
  355. justifyContent: "center"
  356. }}
  357. >
  358. <Image
  359. style={{
  360. backgroundColor: "yellow",
  361. width: "50%",
  362. height: "50%"
  363. }}
  364. />
  365. </View>
  366. </View>
  367. <View style={{ flex: 0.05 }} />
  368. <View style={styles.item}>
  369. <View
  370. style={{
  371. flex: 2,
  372. alignItems: "center",
  373. justifyContent: "center"
  374. }}
  375. >
  376. <Image
  377. style={{
  378. backgroundColor: "yellow",
  379. width: "50%",
  380. height: "50%"
  381. }}
  382. />
  383. </View>
  384. <Text style={styles.item_text}>我的年级</Text>
  385. <View
  386. style={{
  387. flex: 2,
  388. alignItems: "center",
  389. justifyContent: "center"
  390. }}
  391. >
  392. <Image
  393. style={{
  394. backgroundColor: "yellow",
  395. width: "50%",
  396. height: "50%"
  397. }}
  398. />
  399. </View>
  400. </View>
  401. </View>
  402. );
  403. }
  404. }
  405. const styles = StyleSheet.create({
  406. item: {
  407. flex: 1,
  408. width: "100%",
  409. flexDirection: "row",
  410. backgroundColor: "white"
  411. },
  412. item_text: {
  413. flex: 10,
  414. textAlignVertical: "center",
  415. color: "black",
  416. fontSize: 20
  417. }
  418. });