123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408 |
- 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 (
- <SafeAreaView style={public_css.body}>
- <ScrollView style={{backgroundColor: '#F2F1F7'}}>
- <WhiteSpace />
- <WingBlank>
- <View style={{backgroundColor: '#ffffff'}}>
- <View
- style={{
- height: 30,
- justifyContent: 'center',
- marginLeft: 10,
- marginTop: 5,
- }}>
- <Text style={{color: '#464646', fontWeight: 'bold', fontSize: 16}}>
- 发票类查询
- </Text>
- </View>
- <View style={{flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center'}}>
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(1);
- }}>
- <Image
- source={require('../../source/img/tax/paperInvoice.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>纸质普票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(1);
- }}>
- <Image
- source={require('../../source/img/tax/paperInvoice.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>纸质普票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(2);
- }}>
- <Image
- source={require('../../source/img/tax/paperz.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>纸质专票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(2);
- }}>
- <Image
- source={require('../../source/img/tax/paperz.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>纸质专票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(3);
- }}>
- <Image
- source={require('../../source/img/tax/dianp.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>电子普票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(3);
- }}>
- <Image
- source={require('../../source/img/tax/dianp.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>电子普票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(4);
- }}>
- <Image
- source={require('../../source/img/tax/invoiceSearch.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>电子专票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(4);
- }}>
- <Image
- source={require('../../source/img/tax/invoiceSearch.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>电子专票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(5);
- }}>
- <Image
- source={require('../../source/img/tax/invoicestock.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票库存查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(5);
- }}>
- <Image
- source={require('../../source/img/tax/invoicestock.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票库存查询</Text>
- </TouchableOpacity>
- </View>
- )}
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View style={{backgroundColor: '#ffffff'}}>
- <View
- style={{
- height: 30,
- justifyContent: 'center',
- marginLeft: 10,
- marginTop: 5,
- }}>
- <Text style={{color: '#464646', fontWeight: 'bold', fontSize: 16}}>
- 税盘监控管理信息
- </Text>
- </View>
- <View style={{flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center'}}>
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(6);
- }}>
- <Image
- source={require('../../source/img/tax/zhizhip.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>纸质普票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(6);
- }}>
- <Image
- source={require('../../source/img/tax/zhizhip.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>纸质普票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(7);
- }}>
- <Image
- source={require('../../source/img/tax/paperz.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>纸质专票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(7);
- }}>
- <Image
- source={require('../../source/img/tax/paperz.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>纸质专票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(8);
- }}>
- <Image
- source={require('../../source/img/tax/dianzip.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>电子普票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(8);
- }}>
- <Image
- source={require('../../source/img/tax/dianzip.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>电子普票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(9);
- }}>
- <Image
- source={require('../../source/img/tax/dianz.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>电子专票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View style={{margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(9);
- }}>
- <Image
- source={require('../../source/img/tax/dianz.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>电子专票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- </ScrollView>
- </SafeAreaView>
- );
- }
- //加载数据
- 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',
- },
- });
|