import React, {Component} from 'react'; import { Image, Text, View, TouchableOpacity, StyleSheet, ScrollView, SafeAreaView, DeviceEventEmitter, } from 'react-native'; import {WingBlank, WhiteSpace} from '@ant-design/react-native'; import public_css from '../../source/css/public_css'; import {RetrieveData} from '../../data/storage'; export default class tax_page extends Component { constructor(props) { super(props); this.state = { authority: '', landingStatus: 0, //登录状态,0:表示未登录,1:表示已登录 }; } render() { return ( 发票类查询 {this.state.landingStatus == 1 ? ( { this.getLandingStatus(1); }}> 纸质普票查询 ) : ( { this.getLandingStatus(1); }}> 纸质普票查询 )} {this.state.landingStatus == 1 ? ( { this.getLandingStatus(2); }}> 纸质专票查询 ) : ( { this.getLandingStatus(2); }}> 纸质专票查询 )} {this.state.landingStatus == 1 ? ( { this.getLandingStatus(3); }}> 电子普票查询 ) : ( { this.getLandingStatus(3); }}> 电子普票查询 )} {this.state.landingStatus == 1 ? ( { this.getLandingStatus(4); }}> 电子专票查询 ) : ( { this.getLandingStatus(4); }}> 电子专票查询 )} {this.state.landingStatus == 1 ? ( { this.getLandingStatus(5); }}> 发票库存查询 ) : ( { this.getLandingStatus(5); }}> 发票库存查询 )} 税盘监控管理信息 {this.state.landingStatus == 1 ? ( { this.getLandingStatus(6); }}> 纸质普票查询 ) : ( { this.getLandingStatus(6); }}> 纸质普票查询 )} {this.state.landingStatus == 1 ? ( { this.getLandingStatus(7); }}> 纸质专票查询 ) : ( { this.getLandingStatus(7); }}> 纸质专票查询 )} {this.state.landingStatus == 1 ? ( { this.getLandingStatus(8); }}> 电子普票查询 ) : ( { this.getLandingStatus(8); }}> 电子普票查询 )} {this.state.landingStatus == 1 ? ( { this.getLandingStatus(9); }}> 电子专票查询 ) : ( { this.getLandingStatus(9); }}> 电子专票查询 )} ); } //加载数据 componentDidMount() { this.getAuthority(); } //判断是否登录 getLandingStatus = async (type) => { const account = await RetrieveData('account'); if (account) { if (type === 1) { this.props.navigation.navigate('paper_ordinary_invoice'); } if (type === 2) { this.props.navigation.navigate('paper_major_invoice'); } if (type === 3) { this.props.navigation.navigate('electronics_ordinary_invoice'); } if (type === 4) { this.props.navigation.navigate('electronics_major_invoice'); } if (type === 5) { this.props.navigation.navigate('invoice_stock'); } if (type === 6) { this.props.navigation.navigate('invoice_monitor', {type: 3}); } if (type === 7) { this.props.navigation.navigate('invoice_monitor', {type: 4}); } if (type === 8) { this.props.navigation.navigate('invoice_monitor', {type: 1}); } if (type === 9) { this.props.navigation.navigate('invoice_monitor', {type: 2}); } } else { this.props.navigation.navigate('login', { refresh: (type) => { this.refresh(type); }, }); } }; refresh = async (type) => { DeviceEventEmitter.emit('updateLoginInfo', type); DeviceEventEmitter.emit('updateCompany', null); }; //获取权限信息 getAuthority = async () => { const authority = await RetrieveData('authority'); if (authority) { this.setState({ authority: authority, landingStatus: 1, }); } }; } const styles = StyleSheet.create({ tapBtnBakCol: { flexDirection: 'column', alignItems: 'center', }, tapBtnImg: { width: 49, height: 49, }, tapBtnTips: { marginTop: 10, color: '#757374', }, });