home_navigation.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. import React, {Component} from 'react';
  2. import {createStackNavigator} from '@react-navigation/stack';
  3. import login from '../../page/login/login';
  4. import home_page from '../../page/homePage/home_page';
  5. import forget_password from '../../page/login/forget_password';
  6. import invoice from '../../page/invoice/invoice';
  7. import invoice_product_list_add from '../../page/invoice/invoice_product_list_add';
  8. import invoice_select_customer from '../../page/invoice/invoice_select_customer';
  9. import notice from '../../page/notice/notice';
  10. import notice_message from '../../page/notice/notice_message';
  11. import message from '../../page/notice/message';
  12. import home_amount_statistics from '../../page/statistics/home_amount_statistics';
  13. import product_list_info from '../product/product_list_info';
  14. import product_confirm from '../product/product_confirm';
  15. import loan from '../../page/activity/loan/loan';
  16. import loan_apply from '../../page/activity/loan/loan_apply';
  17. import invoice_qrcode from '../../page/invoiceQrcode/invoice_qrcode';
  18. import buyer_invoice from '../../page/buyerInvoice/buyer_invoice';
  19. import buyer_qrcode from '../../page/buyerInvoice/buyer_qrcode';
  20. import invoice_head_list from '../../page/invoiceHead/invoice_head_list';
  21. import {Image, TouchableOpacity, View} from 'react-native';
  22. import invoice_head from '../../page/invoiceHead/invoice_head';
  23. import wait_invoice_list from '../../page/waitInvoice/wait_invoice_list';
  24. import wait_invoice from '../../page/waitInvoice/wait_invoice';
  25. import application_info from '../../page/invoiceApplication/application_info';
  26. import {SvgXml} from 'react-native-svg';
  27. import {searchIcon} from '../../source/icon/icon';
  28. import invoice_application from '../../page/invoiceApplication/invoice_application';
  29. import invoice_distribution from '../../page/invoiceDistribution/invoice_distribution';
  30. import activity from '../../page/activity/activity';
  31. import enterprise_list from '../../page/enterpriseInfo/enterprise_list';
  32. import select_user from '../selectUser/select_user';
  33. import electronics_ordinary_invoice from '../../page/tax/invoiceInquiry/electronics_ordinary_invoice';
  34. import invoice_info from '../../page/tax/invoiceInquiry/invoice_info';
  35. import preview_pdf from '../onlinePreviewPDF/preview_pdf';
  36. import message_info from '../../page/notice/message_info';
  37. import user_agreement from '../../page/login/user_agreement';
  38. const HomeStack = createStackNavigator();
  39. export default class home_navigation extends Component {
  40. constructor(props) {
  41. super(props);
  42. this.state = {
  43. language: '',
  44. };
  45. }
  46. render() {
  47. return (
  48. <HomeStack.Navigator initialRouteName="home_page">
  49. <HomeStack.Screen
  50. name="home_page"
  51. component={home_page}
  52. options={{
  53. title: '首页',
  54. headerTitleAlign: 'left',
  55. headerStyle: {
  56. backgroundColor: '#ffffff',
  57. },
  58. headerTintColor: '#000000',
  59. }}
  60. />
  61. <HomeStack.Screen
  62. name="enterprise_list"
  63. component={enterprise_list}
  64. options={{
  65. title: '企业信息',
  66. headerTitleAlign: 'center',
  67. headerStyle: {
  68. backgroundColor: '#ffffff',
  69. },
  70. headerTintColor: '#000000',
  71. }}
  72. />
  73. <HomeStack.Screen
  74. name="login"
  75. component={login}
  76. options={{
  77. title: '登录',
  78. headerTitleAlign: 'center',
  79. headerStyle: {
  80. backgroundColor: '#ffffff',
  81. },
  82. headerTintColor: '#000000',
  83. }}
  84. />
  85. <HomeStack.Screen
  86. name="user_agreement"
  87. component={user_agreement}
  88. options={{
  89. title: '云票在线用户使用协议',
  90. headerTitleAlign: 'center',
  91. headerStyle: {
  92. backgroundColor: '#ffffff',
  93. },
  94. headerTintColor: '#000000',
  95. }}
  96. />
  97. <HomeStack.Screen
  98. name="forget_password"
  99. component={forget_password}
  100. options={{
  101. title: '密码修改',
  102. headerTitleAlign: 'center',
  103. headerStyle: {
  104. backgroundColor: '#ffffff',
  105. },
  106. headerTintColor: '#000000',
  107. }}
  108. />
  109. <HomeStack.Screen
  110. name={'invoice'}
  111. component={invoice}
  112. options={{
  113. headerTitle: '发票开具',
  114. headerTitleAlign: 'center',
  115. headerStyle: {
  116. backgroundColor: '#ffffff',
  117. },
  118. headerTintColor: '#000000',
  119. }}
  120. />
  121. <HomeStack.Screen
  122. name={'invoice_product_list_add'}
  123. component={invoice_product_list_add}
  124. options={{
  125. title: '添加开票产品',
  126. headerTitleAlign: 'center',
  127. headerStyle: {
  128. backgroundColor: '#ffffff',
  129. },
  130. headerTintColor: '#000000',
  131. }}
  132. />
  133. <HomeStack.Screen
  134. name={'invoice_select_customer'}
  135. component={invoice_select_customer}
  136. options={{
  137. title: '客户信息选择',
  138. headerTitleAlign: 'center',
  139. headerStyle: {
  140. backgroundColor: '#ffffff',
  141. },
  142. headerTintColor: '#000000',
  143. }}
  144. />
  145. <HomeStack.Screen
  146. name="notice"
  147. component={notice}
  148. options={{
  149. title: '消息',
  150. headerTitleAlign: 'center',
  151. headerStyle: {
  152. backgroundColor: '#ffffff',
  153. },
  154. headerTintColor: '#000000',
  155. }}
  156. />
  157. <HomeStack.Screen
  158. name="notice_message"
  159. component={notice_message}
  160. options={{
  161. title: '公告',
  162. headerTitleAlign: 'center',
  163. headerStyle: {
  164. backgroundColor: '#ffffff',
  165. },
  166. headerTintColor: '#000000',
  167. }}
  168. />
  169. <HomeStack.Screen
  170. name="message"
  171. component={message}
  172. options={{
  173. title: '消息',
  174. headerTitleAlign: 'center',
  175. headerStyle: {
  176. backgroundColor: '#ffffff',
  177. },
  178. headerTintColor: '#000000',
  179. }}
  180. />
  181. <HomeStack.Screen
  182. name="home_amount_statistics"
  183. component={home_amount_statistics}
  184. options={{
  185. title: '数据概览',
  186. headerTitleAlign: 'center',
  187. headerStyle: {
  188. backgroundColor: '#2A67FE',
  189. },
  190. headerTintColor: '#ffffff',
  191. }}
  192. />
  193. <HomeStack.Screen
  194. name={'product_list_info'}
  195. component={product_list_info}
  196. options={{
  197. headerTitle: '选择商品',
  198. headerTitleAlign: 'center',
  199. headerStyle: {
  200. backgroundColor: '#ffffff',
  201. },
  202. headerTintColor: '#000000',
  203. }}
  204. />
  205. <HomeStack.Screen
  206. name={'product_confirm'}
  207. component={product_confirm}
  208. options={{
  209. headerTitle: '商品信息',
  210. headerTitleAlign: 'center',
  211. headerStyle: {
  212. backgroundColor: '#ffffff',
  213. },
  214. headerTintColor: '#000000',
  215. }}
  216. />
  217. <HomeStack.Screen
  218. name={'loan'}
  219. component={loan}
  220. options={{
  221. headerTitle: '农信合作申请',
  222. headerTitleAlign: 'center',
  223. headerStyle: {
  224. backgroundColor: '#ffffff',
  225. },
  226. headerTintColor: '#000000',
  227. }}
  228. />
  229. <HomeStack.Screen
  230. name={'loan_apply'}
  231. component={loan_apply}
  232. options={{
  233. headerTitle: '填写申请信息',
  234. headerTitleAlign: 'center',
  235. headerStyle: {
  236. backgroundColor: '#ffffff',
  237. },
  238. headerTintColor: '#000000',
  239. }}
  240. />
  241. <HomeStack.Screen
  242. name={'activity'}
  243. component={activity}
  244. options={{
  245. headerTitle: '推荐活动',
  246. headerTitleAlign: 'center',
  247. headerStyle: {
  248. backgroundColor: '#ffffff',
  249. },
  250. headerTintColor: '#000000',
  251. }}
  252. />
  253. <HomeStack.Screen
  254. name="invoice_qrcode"
  255. component={invoice_qrcode}
  256. options={{
  257. title: '扫码开票',
  258. headerTitleAlign: 'center',
  259. headerStyle: {
  260. backgroundColor: '#ffffff',
  261. },
  262. headerTintColor: '#000000',
  263. }}
  264. />
  265. <HomeStack.Screen
  266. name="buyer_invoice"
  267. component={buyer_invoice}
  268. options={{
  269. title: '购方开票',
  270. headerTitleAlign: 'center',
  271. headerStyle: {
  272. backgroundColor: '#ffffff',
  273. },
  274. headerTintColor: '#000000',
  275. }}
  276. />
  277. <HomeStack.Screen
  278. name="buyer_qrcode"
  279. component={buyer_qrcode}
  280. options={{
  281. title: '扫码开票',
  282. headerTitleAlign: 'center',
  283. headerStyle: {
  284. backgroundColor: '#ffffff',
  285. },
  286. headerTintColor: '#000000',
  287. }}
  288. />
  289. <HomeStack.Screen
  290. name={'invoice_head_list'}
  291. component={invoice_head_list}
  292. options={{
  293. headerTitle: '待开抬头',
  294. headerTitleAlign: 'center',
  295. headerRight: () => (
  296. <View style={{marginRight: 20}}>
  297. <TouchableOpacity
  298. onPress={() => {
  299. this.props.navigation.navigate('invoice_head_list', {
  300. isShow: true,
  301. });
  302. }}>
  303. <Image
  304. source={require('../../source/img/search.png')}
  305. style={{height: 16, width: 16}}
  306. />
  307. </TouchableOpacity>
  308. </View>
  309. ),
  310. headerStyle: {
  311. backgroundColor: '#ffffff',
  312. },
  313. headerTintColor: '#000000',
  314. }}
  315. />
  316. <HomeStack.Screen
  317. name="invoice_head"
  318. component={invoice_head}
  319. options={{
  320. title: '发票开具',
  321. headerTitleAlign: 'center',
  322. headerStyle: {
  323. backgroundColor: '#ffffff',
  324. },
  325. headerTintColor: '#000000',
  326. }}
  327. />
  328. <HomeStack.Screen
  329. name={'wait_invoice_list'}
  330. component={wait_invoice_list}
  331. options={{
  332. headerTitle: '待开发票',
  333. headerTitleAlign: 'center',
  334. headerRight: () => (
  335. <View style={{marginRight: 20}}>
  336. <TouchableOpacity
  337. style={{
  338. height: 30,
  339. width: 50,
  340. justifyContent: 'center',
  341. alignItems: 'center',
  342. }}
  343. onPress={() => {
  344. this.props.navigation.navigate('wait_invoice_list', {
  345. isShow: true,
  346. });
  347. }}>
  348. <SvgXml height={20} xml={searchIcon()} />
  349. </TouchableOpacity>
  350. </View>
  351. ),
  352. headerStyle: {
  353. backgroundColor: '#ffffff',
  354. },
  355. headerTintColor: '#000000',
  356. }}
  357. />
  358. <HomeStack.Screen
  359. name="wait_invoice"
  360. component={wait_invoice}
  361. options={{
  362. title: '发票开具',
  363. headerTitleAlign: 'center',
  364. headerStyle: {
  365. backgroundColor: '#ffffff',
  366. },
  367. headerTintColor: '#000000',
  368. }}
  369. />
  370. <HomeStack.Screen
  371. name="application_info"
  372. component={application_info}
  373. options={{
  374. title: '申领查询',
  375. headerTitleAlign: 'center',
  376. headerRight: () => (
  377. <View style={{marginRight: 20}}>
  378. <TouchableOpacity
  379. style={{
  380. height: 30,
  381. width: 50,
  382. justifyContent: 'center',
  383. alignItems: 'center',
  384. }}
  385. onPress={() => {
  386. this.props.navigation.navigate('application_info', {
  387. isShow: true,
  388. });
  389. }}>
  390. <SvgXml height={20} xml={searchIcon()} />
  391. </TouchableOpacity>
  392. </View>
  393. ),
  394. headerStyle: {
  395. backgroundColor: '#ffffff',
  396. },
  397. headerTintColor: '#000000',
  398. }}
  399. />
  400. <HomeStack.Screen
  401. name={'invoice_application'}
  402. component={invoice_application}
  403. options={{
  404. title: '发票申领',
  405. headerTitleAlign: 'center',
  406. headerStyle: {
  407. backgroundColor: '#ffffff',
  408. },
  409. headerTintColor: '#000000',
  410. }}
  411. />
  412. <HomeStack.Screen
  413. name="invoice_distribution"
  414. component={invoice_distribution}
  415. options={{
  416. title: '发票分发',
  417. headerTitleAlign: 'center',
  418. headerRight: () => (
  419. <View style={{marginRight: 20}}>
  420. <TouchableOpacity
  421. style={{
  422. height: 30,
  423. width: 50,
  424. justifyContent: 'center',
  425. alignItems: 'center',
  426. }}
  427. onPress={() => {
  428. this.props.navigation.navigate('invoice_distribution', {
  429. isShow: true,
  430. });
  431. }}>
  432. <SvgXml height={20} xml={searchIcon()} />
  433. </TouchableOpacity>
  434. </View>
  435. ),
  436. headerStyle: {
  437. backgroundColor: '#ffffff',
  438. },
  439. headerTintColor: '#000000',
  440. }}
  441. />
  442. <HomeStack.Screen
  443. name="select_user"
  444. component={select_user}
  445. options={{
  446. title: '人员管理',
  447. headerTitleAlign: 'center',
  448. headerStyle: {
  449. backgroundColor: '#ffffff',
  450. },
  451. headerTintColor: '#000000',
  452. }}
  453. />
  454. <HomeStack.Screen
  455. name={'electronics_ordinary_invoice'}
  456. component={electronics_ordinary_invoice}
  457. options={{
  458. headerTitle: '电子普票查询',
  459. headerTitleAlign: 'center',
  460. headerRight: () => (
  461. <View style={{marginRight: 20}}>
  462. <TouchableOpacity
  463. style={{
  464. height: 30,
  465. width: 50,
  466. justifyContent: 'center',
  467. alignItems: 'center',
  468. }}
  469. onPress={() => {
  470. this.props.navigation.navigate(
  471. 'electronics_ordinary_invoice',
  472. {
  473. isShow: true,
  474. },
  475. );
  476. }}>
  477. <SvgXml height={20} xml={searchIcon()} />
  478. </TouchableOpacity>
  479. </View>
  480. ),
  481. headerStyle: {
  482. backgroundColor: '#ffffff',
  483. },
  484. headerTintColor: '#000000',
  485. }}
  486. />
  487. <HomeStack.Screen
  488. name={'invoice_info'}
  489. component={invoice_info}
  490. options={{
  491. title: '发票详情',
  492. headerTitleAlign: 'center',
  493. headerStyle: {
  494. backgroundColor: '#ffffff',
  495. },
  496. headerTintColor: '#000000',
  497. }}
  498. />
  499. <HomeStack.Screen
  500. name={'preview_pdf'}
  501. component={preview_pdf}
  502. options={{
  503. title: '发票在线查看',
  504. headerTitleAlign: 'center',
  505. headerStyle: {
  506. backgroundColor: '#ffffff',
  507. },
  508. headerTintColor: '#000000',
  509. }}
  510. />
  511. <HomeStack.Screen
  512. name={'message_info'}
  513. component={message_info}
  514. options={{
  515. title: '消息详情',
  516. headerTitleAlign: 'center',
  517. headerStyle: {
  518. backgroundColor: '#ffffff',
  519. },
  520. headerTintColor: '#000000',
  521. }}
  522. />
  523. </HomeStack.Navigator>
  524. );
  525. }
  526. shouldComponentUpdate(
  527. nextProps: Readonly<P>,
  528. nextState: Readonly<S>,
  529. nextContext: any,
  530. ): boolean {
  531. //console.log("state: "+ JSON.stringify(nextProps.route));
  532. if (nextProps.route.name === 'home_navigation') {
  533. if (nextProps.route.state !== null && nextProps.route.state.index === 0) {
  534. this.props.navigation.setOptions({
  535. tabBarVisible: true,
  536. });
  537. }
  538. }
  539. return true;
  540. }
  541. }