AppNavigators.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. import { createAppContainer, createSwitchNavigator } from "react-navigation"
  2. import { createStackNavigator } from "react-navigation-stack"
  3. import { createBottomTabNavigator } from 'react-navigation-tabs'
  4. import WelcomePage from "../page/WelcomePage"
  5. import LoginPage from "../page/LoginPage"
  6. import Register from "../page/Register"
  7. import Register1 from "../page/Register1"
  8. import Register2 from "../page/Register2"
  9. import Register3 from "../page/Register3"
  10. import Meet from "../page/Meet"
  11. import ForgetPassWord from "../page/ForgetPassWord"
  12. import UserCard from "../page/UserCard"
  13. import GirlFrienfTerm from "../page/GirlFrienfTerm"
  14. import GiftPay from "../page/GiftPay"
  15. import UserAgree from "../page/UserAgree"
  16. import Suggestion from "../page/Suggestion"
  17. import Setting from "../page/Setting"
  18. import MyInfo from "../page/MyInfo"
  19. import MyGift from "../page/MyGift"
  20. import Attestation from "../page/Attestation/Attestation"
  21. import WaitAttestation from "../page/WaitAttestation"
  22. import AttestationInfo from "../page/AttestationInfo"
  23. import PassMode from "../page/PassMode"
  24. import PassMode1 from "../page/PassMode1"
  25. import CreatPass from "../page/CreatPass"
  26. import GameHome from "../page/GameHome"
  27. import RecommendGamer from "../page/RecommendGamer"
  28. import GamerList from "../page/GamerList"
  29. import GameLead from "../page/GameLead"
  30. import MainPage from "../page/MainPage"
  31. import MessagePage from "../page/MessagePage"
  32. import Entypo from "react-native-vector-icons/Entypo"
  33. import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons"
  34. import AntDesign from "react-native-vector-icons/AntDesign"
  35. import React from "react"
  36. import { Text, TouchableOpacity } from "react-native"
  37. const InitNavigator = createStackNavigator({
  38. LoginPage: {
  39. screen: LoginPage,
  40. navigationOptions: {
  41. header: null
  42. }
  43. },
  44. WelcomePage: {
  45. screen: WelcomePage,
  46. navigationOptions: {
  47. header: null
  48. }
  49. }
  50. })
  51. const BottomTabNavigator = createBottomTabNavigator(
  52. {//在这里配置页面的路由
  53. MainPage: {
  54. screen: MainPage,
  55. navigationOptions: {
  56. tabBarLabel: "主页",
  57. tabBarIcon: ({ tintColor, focused }) => (
  58. <MaterialCommunityIcons
  59. name={"home-heart"}
  60. size={30}
  61. style={{ color: tintColor }}
  62. />
  63. )
  64. }
  65. },
  66. MessagePage: {
  67. screen: MessagePage,
  68. navigationOptions: {
  69. tabBarLabel: "消息",
  70. tabBarIcon: ({ tintColor, focused }) => (
  71. <AntDesign
  72. name={"message1"}
  73. size={26}
  74. style={{ color: tintColor }}
  75. />
  76. )
  77. }
  78. },
  79. GamePage: {
  80. screen: GameHome,
  81. navigationOptions: {
  82. tabBarLabel: "游戏",
  83. tabBarIcon: ({ tintColor, focused }) => (
  84. <Entypo
  85. name={"game-controller"}
  86. size={26}
  87. style={{ color: tintColor }}
  88. />
  89. )
  90. }
  91. },
  92. MyPage: {
  93. screen: UserCard,
  94. navigationOptions: {
  95. tabBarLabel: "我的",
  96. tabBarIcon: ({ tintColor, focused }) => (
  97. <AntDesign
  98. name={"smileo"}
  99. size={26}
  100. style={{ color: tintColor }}
  101. />
  102. )
  103. }
  104. }
  105. }, {
  106. initialRouteName: "", // 设置默认的页面
  107. tabBarOptions: {
  108. activeTintColor: Platform.OS === 'ios' ? '#FA788A' : '#fff',
  109. style: {
  110. paddingTop: 10,
  111. paddingBottom: 10,
  112. height: 60
  113. },
  114. labelStyle: {
  115. marginTop: 6,
  116. marginBottom: 6
  117. },// 文字的样式
  118. },
  119. lazy: true, // 是否在app打开的时候将底部标签栏全部加载
  120. backBehavior: null, // 点击返回退到上级界面
  121. }
  122. );
  123. const MainNavigator = createStackNavigator({
  124. GameLead: {
  125. screen: GameLead,
  126. navigationOptions: {
  127. header: null
  128. }
  129. },
  130. BottomTabNavigator: {
  131. screen: BottomTabNavigator,
  132. navigationOptions: {
  133. title: '底部导航器',
  134. headerShown: false
  135. }
  136. },
  137. GamerList: {
  138. screen: GamerList,
  139. navigationOptions: {
  140. headerTitle: "选择关卡",
  141. headerTintColor: "#fff",
  142. headerBackTitleStyle: {
  143. color: "#fff"
  144. },
  145. headerStyle: {
  146. backgroundColor: '#FA788A',
  147. color: '#fff',
  148. },
  149. headerTitleStyle: {
  150. color: '#fff',
  151. },
  152. }
  153. },
  154. RecommendGamer: {
  155. screen: RecommendGamer,
  156. navigationOptions: ({ navigation }) => (
  157. {
  158. headerTitle: "推荐关主",
  159. headerTintColor: "#fff",
  160. headerBackTitleStyle: {
  161. color: "#fff"
  162. },
  163. headerStyle: {
  164. backgroundColor: '#FA788A',
  165. color: '#fff',
  166. },
  167. headerTitleStyle: {
  168. color: '#fff',
  169. },
  170. headerRight: <TouchableOpacity onPress={() => navigation.navigate("CreatPass")}>
  171. <Text style={{ fontSize: 15, color: "#FF4A6C", marginRight: 10 }}>创建关卡</Text>
  172. </TouchableOpacity>
  173. }
  174. )
  175. },
  176. GameHome: {
  177. screen: GameHome,
  178. navigationOptions: {
  179. headerTitle: "游戏大厅",
  180. headerTintColor: "#fff",
  181. headerBackTitleStyle: {
  182. color: "#fff"
  183. },
  184. headerStyle: {
  185. backgroundColor: '#FA788A',
  186. color: '#fff',
  187. },
  188. headerTitleStyle: {
  189. color: '#fff',
  190. },
  191. }
  192. },
  193. CreatPass: {
  194. screen: CreatPass,
  195. navigationOptions: {
  196. headerTitle: "创建关卡",
  197. headerTintColor: "#fff",
  198. headerBackTitleStyle: {
  199. color: "#fff"
  200. },
  201. headerStyle: {
  202. backgroundColor: '#FA788A',
  203. color: '#fff',
  204. },
  205. headerTitleStyle: {
  206. color: '#fff',
  207. },
  208. }
  209. },
  210. PassMode1: {
  211. screen: PassMode1,
  212. navigationOptions: {
  213. headerTitle: "闯关模式",
  214. headerTintColor: "#fff",
  215. headerBackTitleStyle: {
  216. color: "#fff"
  217. },
  218. headerStyle: {
  219. backgroundColor: '#FA788A',
  220. color: '#fff',
  221. },
  222. headerTitleStyle: {
  223. color: '#fff',
  224. },
  225. }
  226. },
  227. PassMode: {
  228. screen: PassMode,
  229. navigationOptions: {
  230. headerTitle: "闯关模式",
  231. headerTintColor: "#fff",
  232. headerBackTitleStyle: {
  233. color: "#fff"
  234. },
  235. headerStyle: {
  236. backgroundColor: '#FA788A',
  237. color: '#fff',
  238. },
  239. headerTitleStyle: {
  240. color: '#fff',
  241. },
  242. }
  243. },
  244. Attestation: {
  245. screen: Attestation,
  246. navigationOptions: {
  247. headerTitle: "认证",
  248. headerTintColor: "#fff",
  249. headerBackTitleStyle: {
  250. color: "#fff"
  251. },
  252. headerStyle: {
  253. backgroundColor: '#FA788A',
  254. color: '#fff',
  255. },
  256. headerTitleStyle: {
  257. color: '#fff',
  258. },
  259. }
  260. },
  261. AttestationInfo: {
  262. screen: AttestationInfo,
  263. navigationOptions: {
  264. headerTitle: "实名认证",
  265. headerTintColor: "#fff",
  266. headerBackTitleStyle: {
  267. color: "#fff"
  268. },
  269. headerStyle: {
  270. backgroundColor: '#FA788A',
  271. color: '#fff',
  272. },
  273. headerTitleStyle: {
  274. color: '#fff',
  275. },
  276. }
  277. },
  278. WaitAttestation: {
  279. screen: WaitAttestation,
  280. navigationOptions: {
  281. headerTitle: "实名认证",
  282. headerTintColor: "#fff",
  283. headerBackTitleStyle: {
  284. color: "#fff"
  285. },
  286. headerStyle: {
  287. backgroundColor: '#FA788A',
  288. color: '#fff',
  289. },
  290. headerTitleStyle: {
  291. color: '#fff',
  292. },
  293. }
  294. },
  295. MyGift: {
  296. screen: MyGift,
  297. navigationOptions: {
  298. headerTitle: "我的礼物",
  299. headerTintColor: "#fff",
  300. headerBackTitleStyle: {
  301. color: "#fff"
  302. },
  303. headerStyle: {
  304. backgroundColor: '#FA788A',
  305. color: '#fff',
  306. },
  307. headerTitleStyle: {
  308. color: '#fff',
  309. },
  310. }
  311. },
  312. MyInfo: {
  313. screen: MyInfo,
  314. navigationOptions: {
  315. headerTitle: "我的资料",
  316. headerTintColor: "#fff",
  317. headerBackTitleStyle: {
  318. color: "#fff"
  319. },
  320. headerStyle: {
  321. backgroundColor: '#FA788A',
  322. color: '#fff',
  323. },
  324. headerTitleStyle: {
  325. color: '#fff',
  326. },
  327. }
  328. },
  329. Setting: {
  330. screen: Setting,
  331. navigationOptions: {
  332. headerTitle: "设置",
  333. headerTintColor: "#fff",
  334. headerBackTitleStyle: {
  335. color: "#fff"
  336. },
  337. headerStyle: {
  338. backgroundColor: '#FA788A',
  339. color: '#fff',
  340. },
  341. headerTitleStyle: {
  342. color: '#fff',
  343. },
  344. }
  345. },
  346. Suggestion: {
  347. screen: Suggestion,
  348. navigationOptions: {
  349. headerTitle: "意见反馈",
  350. headerTintColor: "#fff",
  351. headerBackTitleStyle: {
  352. color: "#fff"
  353. },
  354. headerStyle: {
  355. backgroundColor: '#FA788A',
  356. color: '#fff',
  357. },
  358. headerTitleStyle: {
  359. color: '#fff',
  360. },
  361. }
  362. },
  363. UserAgree: {
  364. screen: UserAgree,
  365. navigationOptions: {
  366. headerTitle: "用户协议",
  367. headerTintColor: "#fff",
  368. headerBackTitleStyle: {
  369. color: "#fff"
  370. },
  371. headerStyle: {
  372. backgroundColor: '#FA788A',
  373. color: '#fff',
  374. },
  375. headerTitleStyle: {
  376. color: '#fff',
  377. },
  378. }
  379. },
  380. GiftPay: {
  381. screen: GiftPay,
  382. navigationOptions: {
  383. headerTitle: "收银台",
  384. headerTintColor: "#fff",
  385. headerBackTitleStyle: {
  386. color: "#fff"
  387. },
  388. headerStyle: {
  389. backgroundColor: '#FA788A',
  390. color: '#fff',
  391. },
  392. headerTitleStyle: {
  393. color: '#fff',
  394. },
  395. }
  396. },
  397. GirlFrienfTerm: {
  398. screen: GirlFrienfTerm,
  399. navigationOptions: {
  400. headerTitle: "择偶条件",
  401. headerTintColor: "#fff",
  402. headerBackTitleStyle: {
  403. color: "#fff"
  404. },
  405. headerStyle: {
  406. backgroundColor: '#FA788A',
  407. color: '#fff',
  408. },
  409. headerTitleStyle: {
  410. color: '#fff',
  411. },
  412. }
  413. },
  414. UserCard: {
  415. screen: UserCard,
  416. navigationOptions: {
  417. header: null
  418. }
  419. },
  420. Meet: {
  421. screen: Meet,
  422. navigationOptions: {
  423. headerTitle: "偶遇",
  424. headerTintColor: "#fff",
  425. headerBackTitleStyle: {
  426. color: "#fff"
  427. },
  428. headerStyle: {
  429. backgroundColor: '#FA788A',
  430. color: '#fff',
  431. },
  432. headerTitleStyle: {
  433. color: '#fff',
  434. },
  435. }
  436. },
  437. Register3: {
  438. screen: Register3,
  439. navigationOptions: {
  440. headerTitle: "完善资料",
  441. headerTintColor: "#fff",
  442. headerBackTitleStyle: {
  443. color: "#fff"
  444. },
  445. headerStyle: {
  446. backgroundColor: '#FA788A',
  447. color: '#fff',
  448. },
  449. headerTitleStyle: {
  450. color: '#fff',
  451. },
  452. }
  453. },
  454. Register2: {
  455. screen: Register2,
  456. navigationOptions: {
  457. headerTitle: "完善资料",
  458. headerTintColor: "#fff",
  459. headerBackTitleStyle: {
  460. color: "#fff"
  461. },
  462. headerStyle: {
  463. backgroundColor: '#FA788A',
  464. color: '#fff',
  465. },
  466. headerTitleStyle: {
  467. color: '#fff',
  468. },
  469. }
  470. },
  471. Register1: {
  472. screen: Register1,
  473. navigationOptions: {
  474. headerTitle: "完善资料",
  475. headerTintColor: "#fff",
  476. headerBackTitleStyle: {
  477. color: "#fff"
  478. },
  479. headerStyle: {
  480. backgroundColor: '#FA788A',
  481. color: '#fff',
  482. },
  483. headerTitleStyle: {
  484. color: '#fff',
  485. },
  486. }
  487. },
  488. ForgetPassWord: {
  489. screen: ForgetPassWord,
  490. navigationOptions: {
  491. header: null
  492. }
  493. },
  494. Register: {
  495. screen: Register,
  496. navigationOptions: {
  497. header: null
  498. }
  499. },
  500. })
  501. export default createAppContainer(createSwitchNavigator({
  502. Init: InitNavigator,
  503. Main: MainNavigator
  504. },
  505. {
  506. navigationOptions: {
  507. header: null
  508. }
  509. }
  510. ))