123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- import React, {Component} from 'react';
- import {
- Image,
- Text,
- View,
- TouchableOpacity,
- StyleSheet,
- ScrollView,
- DeviceEventEmitter,
- } from '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 (
- <ScrollView style={public_css.body}>
- <View
- style={{
- height: 30,
- justifyContent: 'center',
- marginLeft: 10,
- marginTop: 5,
- }}>
- <Text style={{color: '#999999'}}>开票服务</Text>
- </View>
- <View style={{flexDirection: 'row', flexWrap: 'wrap'}}>
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:invoice:add') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(1);
- }}>
- <Image
- source={require('../../source/img/homeImg/taxManagement.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>开票</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(1);
- }}>
- <Image
- source={require('../../source/img/homeImg/taxManagement.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>开票</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:invoice:view') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(2);
- }}>
- <Image
- source={require('../../source/img/tax/invoiceSearch.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票查询</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(2);
- }}>
- <Image
- source={require('../../source/img/tax/invoiceSearch.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票查询</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:hongchong:view') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(3);
- }}>
- <Image
- source={require('../../source/img/tax/hongchong.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票红冲</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(3);
- }}>
- <Image
- source={require('../../source/img/tax/hongchong.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票红冲</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:invoice:claims') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(4);
- }}>
- <Image
- source={require('../../source/img/tax/fapiaoshenling.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票申领</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(4);
- }}>
- <Image
- source={require('../../source/img/tax/fapiaoshenling.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票申领</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:invoice:add') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(5);
- }}>
- <Image
- source={require('../../source/img/homeImg/taxManagement.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>扫码开票</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(5);
- }}>
- <Image
- source={require('../../source/img/tax/saomakaipiao.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>扫码开票</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:taitou:view') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(6);
- }}>
- <Image
- source={require('../../source/img/tax/taitou.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>待开抬头开票</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(6);
- }}>
- <Image
- source={require('../../source/img/tax/taitou.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>待开抬头开票</Text>
- </TouchableOpacity>
- </View>
- )}
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:taitou:view') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(7);
- }}>
- <Image
- source={require('../../source/img/homeImg/taxManagement.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>购方开票</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(7);
- }}>
- <Image
- source={require('../../source/img/homeImg/taxManagement.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>购方开票</Text>
- </TouchableOpacity>
- </View>
- )}
- </View>
- <View
- style={{
- height: 30,
- justifyContent: 'center',
- marginLeft: 10,
- marginTop: 5,
- }}>
- <Text style={{color: '#999999'}}>客户服务</Text>
- </View>
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:customer:view') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(8);
- }}>
- <Image
- source={require('../../source/img/tax/customer.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>客户信息</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(8);
- }}>
- <Image
- source={require('../../source/img/tax/customer.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>客户信息</Text>
- </TouchableOpacity>
- </View>
- )}
- <View
- style={{
- height: 30,
- justifyContent: 'center',
- marginLeft: 10,
- marginTop: 5,
- }}>
- <Text style={{color: '#999999'}}>企业信息</Text>
- </View>
- {this.state.landingStatus == 1 ? (
- this.state.authority.includes('sys:customer:view') ? (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(30);
- }}>
- <Image
- source={require('../../source/img/tax/company.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>企业信息</Text>
- </TouchableOpacity>
- </View>
- ) : (
- <View />
- )
- ) : (
- <View style={{width: 60, margin: 10}}>
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(30);
- }}>
- <Image
- source={require('../../source/img/tax/company.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>企业信息</Text>
- </TouchableOpacity>
- </View>
- )}
- </ScrollView>
- );
- }
- //加载数据
- componentDidMount() {
- this.getAuthority();
- }
- //判断是否登录
- getLandingStatus = async type => {
- const account = await RetrieveData('account');
- if (account) {
- if (type == 1) {
- this.props.navigation.navigate('invoice_product_list');
- }
- if (type == 2) {
- this.props.navigation.navigate('invoice_inquiry');
- }
- if (type == 3) {
- this.props.navigation.navigate('invoice_inquiry_red_rush');
- }
- if (type == 4) {
- this.props.navigation.navigate('invoice_application');
- }
- if (type == 5) {
- this.props.navigation.navigate('sweep_code_invoice');
- }
- if (type == 6) {
- this.props.navigation.navigate('invoice_head');
- }
- if (type == 7) {
- this.props.navigation.navigate('invoice_qrcode_product_list');
- }
- if (type == 8) {
- this.props.navigation.navigate('customer_information');
- }
- if (type == 30) {
- this.props.navigation.navigate('enterprise_information');
- }
- } else {
- this.props.navigation.navigate('login_head');
- }
- };
- //获取权限信息
- 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: 53,
- height: 53,
- },
- tapBtnTips: {
- marginTop: 10,
- color: '#000',
- },
- });
|