tax_navigation.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. import React, {Component} from 'react';
  2. import { Text, TouchableOpacity, View } from "react-native";
  3. import {createStackNavigator} from '@react-navigation/stack';
  4. import tax_page from '../../page/tax/tax_page';
  5. import preview_pdf from '../onlinePreviewPDF/preview_pdf';
  6. import invoice_inquiry from '../../page/tax/invoiceInquiry/invoice_inquiry';
  7. import login from '../../page/login/login';
  8. import forget_password from '../../page/login/forget_password';
  9. import invoice_info from '../../page/tax/invoiceInquiry/invoice_info';
  10. import electronics_ordinary_invoice from '../../page/tax/invoiceInquiry/electronics_ordinary_invoice';
  11. import electronics_major_invoice from '../../page/tax/invoiceInquiry/electronics_major_invoice';
  12. import paper_ordinary_invoice from '../../page/tax/invoiceInquiry/paper_ordinary_invoice';
  13. import paper_major_invoice from '../../page/tax/invoiceInquiry/paper_major_invoice';
  14. import invoice_stock from '../../page/tax/invoiceStock/invoice_stock';
  15. import {searchIcon} from '../../source/icon/icon';
  16. import {SvgXml} from 'react-native-svg';
  17. import invoice_monitor from '../../page/tax/monitor/invoice_monitor';
  18. import device from '../../page/tax/monitor/device';
  19. import user_agreement from '../../page/login/user_agreement';
  20. const TaxStack = createStackNavigator();
  21. export default class tax_navigation extends Component {
  22. constructor(props) {
  23. super(props);
  24. }
  25. render() {
  26. return (
  27. <TaxStack.Navigator initialRouteName="tax_page">
  28. <TaxStack.Screen
  29. name="tax_page"
  30. component={tax_page}
  31. options={{
  32. title: '查询',
  33. headerTitleAlign: 'center',
  34. headerStyle: {
  35. backgroundColor: '#ffffff',
  36. },
  37. headerTintColor: '#000000',
  38. }}
  39. />
  40. <TaxStack.Screen
  41. name={'invoice_inquiry'}
  42. component={invoice_inquiry}
  43. options={{
  44. headerTitle: '发票查询',
  45. headerTitleAlign: 'center',
  46. headerRight: () => (
  47. <View style={{marginRight: 20}}>
  48. <TouchableOpacity
  49. style={{
  50. height: 30,
  51. width: 50,
  52. justifyContent: 'center',
  53. alignItems: 'center',
  54. }}
  55. onPress={() => {
  56. this.props.navigation.navigate('invoice_inquiry', {
  57. isShow: true,
  58. });
  59. }}>
  60. <SvgXml height={20} xml={searchIcon()} />
  61. </TouchableOpacity>
  62. </View>
  63. ),
  64. headerStyle: {
  65. backgroundColor: '#ffffff',
  66. },
  67. headerTintColor: '#000000',
  68. }}
  69. />
  70. <TaxStack.Screen
  71. name={'invoice_info'}
  72. component={invoice_info}
  73. options={{
  74. title: '发票详情',
  75. headerTitleAlign: 'center',
  76. headerStyle: {
  77. backgroundColor: '#ffffff',
  78. },
  79. headerTintColor: '#000000',
  80. }}
  81. />
  82. <TaxStack.Screen
  83. name={'preview_pdf'}
  84. component={preview_pdf}
  85. options={{
  86. title: '发票在线查看',
  87. headerTitleAlign: 'center',
  88. headerStyle: {
  89. backgroundColor: '#ffffff',
  90. },
  91. headerTintColor: '#000000',
  92. }}
  93. />
  94. <TaxStack.Screen
  95. name="login"
  96. component={login}
  97. options={{
  98. title: '登录',
  99. headerTitleAlign: 'center',
  100. headerStyle: {
  101. backgroundColor: '#ffffff',
  102. },
  103. headerTintColor: '#000000',
  104. }}
  105. />
  106. <TaxStack.Screen
  107. name="user_agreement"
  108. component={user_agreement}
  109. options={{
  110. title: '云票在线用户使用协议',
  111. headerTitleAlign: 'center',
  112. headerStyle: {
  113. backgroundColor: '#ffffff',
  114. },
  115. headerTintColor: '#000000',
  116. }}
  117. />
  118. <TaxStack.Screen
  119. name="forget_password"
  120. component={forget_password}
  121. options={{
  122. title: '密码修改',
  123. headerTitleAlign: 'center',
  124. headerStyle: {
  125. backgroundColor: '#ffffff',
  126. },
  127. headerTintColor: '#000000',
  128. }}
  129. />
  130. <TaxStack.Screen
  131. name={'electronics_ordinary_invoice'}
  132. component={electronics_ordinary_invoice}
  133. options={{
  134. headerTitle: '电子普票查询',
  135. headerTitleAlign: 'center',
  136. headerRight: () => (
  137. <View style={{marginRight: 20}}>
  138. <TouchableOpacity
  139. style={{
  140. height: 30,
  141. width: 50,
  142. justifyContent: 'center',
  143. alignItems: 'center',
  144. }}
  145. onPress={() => {
  146. this.props.navigation.navigate(
  147. 'electronics_ordinary_invoice',
  148. {
  149. isShow: true,
  150. },
  151. );
  152. }}>
  153. <SvgXml height={20} xml={searchIcon()} />
  154. </TouchableOpacity>
  155. </View>
  156. ),
  157. headerStyle: {
  158. backgroundColor: '#ffffff',
  159. },
  160. headerTintColor: '#000000',
  161. }}
  162. />
  163. <TaxStack.Screen
  164. name={'electronics_major_invoice'}
  165. component={electronics_major_invoice}
  166. options={{
  167. headerTitle: '电子专票查询',
  168. headerTitleAlign: 'center',
  169. headerRight: () => (
  170. <View style={{marginRight: 20}}>
  171. <TouchableOpacity
  172. style={{
  173. height: 30,
  174. width: 50,
  175. justifyContent: 'center',
  176. alignItems: 'center',
  177. }}
  178. onPress={() => {
  179. this.props.navigation.navigate(
  180. 'electronics_major_invoice',
  181. {
  182. isShow: true,
  183. },
  184. );
  185. }}>
  186. <SvgXml height={20} xml={searchIcon()} />
  187. </TouchableOpacity>
  188. </View>
  189. ),
  190. headerStyle: {
  191. backgroundColor: '#ffffff',
  192. },
  193. headerTintColor: '#000000',
  194. }}
  195. />
  196. <TaxStack.Screen
  197. name={'paper_ordinary_invoice'}
  198. component={paper_ordinary_invoice}
  199. options={{
  200. headerTitle: '纸质普票查询',
  201. headerTitleAlign: 'center',
  202. headerRight: () => (
  203. <View style={{marginRight: 20}}>
  204. <TouchableOpacity
  205. style={{
  206. height: 30,
  207. width: 50,
  208. justifyContent: 'center',
  209. alignItems: 'center',
  210. }}
  211. onPress={() => {
  212. this.props.navigation.navigate('paper_ordinary_invoice', {
  213. isShow: true,
  214. });
  215. }}>
  216. <SvgXml height={20} xml={searchIcon()} />
  217. </TouchableOpacity>
  218. </View>
  219. ),
  220. headerStyle: {
  221. backgroundColor: '#ffffff',
  222. },
  223. headerTintColor: '#000000',
  224. }}
  225. />
  226. <TaxStack.Screen
  227. name={'paper_major_invoice'}
  228. component={paper_major_invoice}
  229. options={{
  230. headerTitle: '纸质专票查询',
  231. headerTitleAlign: 'center',
  232. headerRight: () => (
  233. <View style={{marginRight: 20}}>
  234. <TouchableOpacity
  235. style={{
  236. height: 30,
  237. width: 50,
  238. justifyContent: 'center',
  239. alignItems: 'center',
  240. }}
  241. onPress={() => {
  242. this.props.navigation.navigate('paper_major_invoice', {
  243. isShow: true,
  244. });
  245. }}>
  246. <SvgXml height={20} xml={searchIcon()} />
  247. </TouchableOpacity>
  248. </View>
  249. ),
  250. headerStyle: {
  251. backgroundColor: '#ffffff',
  252. },
  253. headerTintColor: '#000000',
  254. }}
  255. />
  256. <TaxStack.Screen
  257. name="invoice_stock"
  258. component={invoice_stock}
  259. options={{
  260. title: '发票库存',
  261. headerTitleAlign: 'center',
  262. headerRight: () => (
  263. <View style={{marginRight: 20}}>
  264. <TouchableOpacity
  265. style={{
  266. height: 30,
  267. width: 50,
  268. justifyContent: 'center',
  269. alignItems: 'center',
  270. }}
  271. onPress={() => {
  272. this.props.navigation.navigate('invoice_stock', {
  273. isShow: true,
  274. });
  275. }}>
  276. <SvgXml height={20} xml={searchIcon()} />
  277. </TouchableOpacity>
  278. </View>
  279. ),
  280. headerStyle: {
  281. backgroundColor: '#ffffff',
  282. },
  283. headerTintColor: '#000000',
  284. }}
  285. />
  286. <TaxStack.Screen
  287. name="invoice_monitor"
  288. component={invoice_monitor}
  289. options={{
  290. title: '税控管理',
  291. headerTitleAlign: 'center',
  292. headerStyle: {
  293. backgroundColor: '#ffffff',
  294. },
  295. headerTintColor: '#000000',
  296. }}
  297. />
  298. <TaxStack.Screen
  299. name="device"
  300. component={device}
  301. options={{
  302. title: '税控设备',
  303. headerTitleAlign: 'center',
  304. headerStyle: {
  305. backgroundColor: '#ffffff',
  306. },
  307. headerTintColor: '#000000',
  308. }}
  309. />
  310. </TaxStack.Navigator>
  311. );
  312. }
  313. shouldComponentUpdate(
  314. nextProps: Readonly<P>,
  315. nextState: Readonly<S>,
  316. nextContext: any,
  317. ): boolean {
  318. if (nextProps.route.state.index === 0) {
  319. this.props.navigation.setOptions({
  320. tabBarVisible: true,
  321. });
  322. }
  323. return true;
  324. }
  325. }