12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073 |
- import React, {Component} from 'react';
- import {
- Image,
- StyleSheet,
- Dimensions,
- ImageBackground,
- TouchableOpacity,
- ScrollView,
- Text,
- View,
- DeviceEventEmitter,
- SafeAreaView,
- Alert,
- } from 'react-native';
- import {RequestNetwork} from '../../data/encryption';
- import {IndividualStorageData, RetrieveData} from '../../data/storage';
- import LinearGradient from 'react-native-linear-gradient';
- import Swiper from 'react-native-swiper';
- import public_css from '../../source/css/public_css';
- import {noticeIcon, homeArrow} from '../../source/icon/icon';
- import {SvgXml} from 'react-native-svg';
- import {CleanAll} from '../../components/abnormalMessage/abnormal_message';
- import {ToastShow} from '../../components/toast/toast';
- import {WhiteSpace, WingBlank, Carousel} from '@ant-design/react-native';
- import { GetMonthDate } from "../../utils/date";
- export default class home_page extends Component {
- constructor(props) {
- super(props);
- this.state = {
- pageNo: 1,
- name: '',
- info: '',
- totalAmt: 0.0,
- totalTaxes: 0.0,
- sumNum: 0.0,
- authority: '',
- landingStatus: 0, //登录状态,0:表示未登录,1:表示已登录
- curCompany: '首页',
- fontStatus: '更多',
- monthTotal: 0.0,
- monthTotalTaxes: 0.0,
- list: [1, 2, 3],
- statisticsData: {},
- activityList: [],
- invoiceNumber: 0,
- };
- }
- render() {
- return (
- <SafeAreaView style={public_css.body}>
- <ScrollView style={styles.homePageBak}>
- <View style={styles.banner_box}>
- <Swiper
- style={styles.wrapper}
- height={170}
- horizontal={true}
- index={0}
- autoplay
- autoplayTimeout={4}>
- {/*{this.state.list.map((item, index) => {*/}
- {/* return (*/}
- {/* <View style={styles.carousel}>*/}
- {/* <Image*/}
- {/* key={index}*/}
- {/* style={{height: 170}}*/}
- {/* resizeMode={'contain'}*/}
- {/* source={require('../../source/img/homeImg/homeImg1.png')}*/}
- {/* />*/}
- {/* </View>*/}
- {/* );*/}
- {/*})}*/}
- <View style={styles.carousel}>
- <Image
- style={styles.banner_img}
- resizeMode="cover"
- source={require('../../source/img/homeImg/homeImg1.png')}
- />
- </View>
- <View style={styles.carousel}>
- <Image
- style={styles.banner_img}
- resizeMode="cover"
- source={require('../../source/img/homeImg/homeImg2.png')}
- />
- </View>
- <TouchableOpacity
- style={styles.carousel}
- onPress={() => {
- this.props.navigation.navigate('loan');
- }}>
- <Image
- style={styles.banner_img}
- resizeMode="cover"
- source={require('../../source/img/homeImg/homeImg3.png')}
- />
- </TouchableOpacity>
- </Swiper>
- </View>
- <View style={styles.taxItemBak}>
- {this.state.landingStatus === 1 ? (
- <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>
- ) : (
- <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>
- )}
- {this.state.landingStatus === 1 ? (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(2);
- }}>
- <Image
- source={require('../../source/img/homeImg/saoma.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>扫码开票</Text>
- </TouchableOpacity>
- ) : (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(2);
- }}>
- <Image
- source={require('../../source/img/homeImg/saoma.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>扫码开票</Text>
- </TouchableOpacity>
- )}
- {this.state.landingStatus === 1 ? (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(3);
- }}>
- <Image
- source={require('../../source/img/homeImg/goufanginvoice.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>购方开票</Text>
- </TouchableOpacity>
- ) : (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(3);
- }}>
- <Image
- source={require('../../source/img/homeImg/goufanginvoice.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>购方开票</Text>
- </TouchableOpacity>
- )}
- {this.state.landingStatus === 1 ? (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(4);
- }}>
- <Image
- source={require('../../source/img/homeImg/daikaitaitou.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>待开抬头</Text>
- </TouchableOpacity>
- ) : (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(4);
- }}>
- <Image
- source={require('../../source/img/homeImg/daikaitaitou.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>待开抬头</Text>
- </TouchableOpacity>
- )}
- {this.state.landingStatus === 1 ? (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(5);
- }}>
- <Image
- source={require('../../source/img/homeImg/daikaiinvoice.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>待开发票</Text>
- </TouchableOpacity>
- ) : (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(5);
- }}>
- <Image
- source={require('../../source/img/homeImg/daikaiinvoice.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>待开发票</Text>
- </TouchableOpacity>
- )}
- {this.state.landingStatus === 1 ? (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(6);
- }}>
- <Image
- source={require('../../source/img/homeImg/invoicelinggou.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票领购</Text>
- </TouchableOpacity>
- ) : (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(6);
- }}>
- <Image
- source={require('../../source/img/homeImg/invoicelinggou.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票领购</Text>
- </TouchableOpacity>
- )}
- {this.state.landingStatus === 1 ? (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(7);
- }}>
- <Image
- source={require('../../source/img/homeImg/invoicefenfa.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票分发</Text>
- </TouchableOpacity>
- ) : (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(7);
- }}>
- <Image
- source={require('../../source/img/homeImg/invoicefenfa.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票分发</Text>
- </TouchableOpacity>
- )}
- {this.state.landingStatus === 1 ? (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(8);
- }}>
- <Image
- source={require('../../source/img/homeImg/invoiceSearch.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票查询</Text>
- </TouchableOpacity>
- ) : (
- <TouchableOpacity
- style={styles.tapBtnBakCol}
- onPress={() => {
- this.getLandingStatus(8);
- }}>
- <Image
- source={require('../../source/img/homeImg/invoiceSearch.png')}
- style={styles.tapBtnImg}
- />
- <Text style={styles.tapBtnTips}>发票查询</Text>
- </TouchableOpacity>
- )}
- </View>
- <View style={{height: 10, backgroundColor: '#F7F7F7'}} />
- <Carousel
- style={styles.wrapper1}
- selectedIndex={2}
- autoplay
- infinite
- // afterChange={this.onHorizontalSelectedIndexChange}
- >
- {this.state.activityList.map((item) => {
- return (
- <TouchableOpacity
- key={item.campaignId}
- style={styles.carousel1}
- onPress={() => {
- this.props.navigation.navigate('activity', {
- data: {
- title: item.campaignName,
- desc: item.campaignDesc,
- number: item.campaignId,
- url: item.detailUrl,
- },
- });
- }}>
- <Image
- style={styles.banner_img}
- source={{uri: item.bannerImgUrl}}
- resizeMode="cover"
- />
- </TouchableOpacity>
- );
- })}
- </Carousel>
- <View style={styles.yxTopicBak}>
- <View style={styles.yxTopicTop}>
- <View style={styles.userOnlineLeft}>
- {/*<Image*/}
- {/* source={require('../../source/img/homeImg/service.png')}*/}
- {/* style={{width: 18, height: 18}}*/}
- {/*/>*/}
- <Text
- style={{
- fontSize: 16,
- color: 'rgba(51, 51, 51, 1)',
- fontWeight: 'bold',
- }}>
- 本月概览
- </Text>
- </View>
- <TouchableOpacity
- style={styles.userOnlineRight}
- onPress={() => {
- this.props.navigation.navigate('home_amount_statistics');
- }}>
- <Text style={{color: 'rgba(153, 153, 153, 1)', marginRight: 5}}>
- 查看更多
- </Text>
- <Image
- source={require('../../source/img/homeImg/go.png')}
- style={{marginTop: 3, width: 12, height: 12}}
- />
- </TouchableOpacity>
- </View>
- <View style={styles.yxTopicBottom}>
- {/*<TouchableOpacity*/}
- {/* style={[styles.yxTopicItem, styles.yxTopicItem_1]}>*/}
- {/* <Text style={styles.yxTopicItemTextA}>开票总数</Text>*/}
- {/* /!*<Text style={styles.yxTopicItemTextB}>剩余发票数量</Text>*!/*/}
- {/* <Text style={styles.yxTopicItemTextC}>*/}
- {/* {this.state.statisticsInfo.monthTotal}*/}
- {/* </Text>*/}
- {/*</TouchableOpacity>*/}
- <LinearGradient
- colors={['#F56B6C', '#FA8384']}
- style={styles.yxTopicItem}
- start={{x: 0.25, y: 0.25}}
- end={{x: 0.7, y: 0.7}}>
- <TouchableOpacity style={styles.yc_inner}>
- <Text style={styles.yxTopicItemTextA}>开票总数</Text>
- <Text style={styles.yxTopicItemTextC}>{this.state.invoiceNumber}</Text>
- </TouchableOpacity>
- </LinearGradient>
- <LinearGradient
- colors={['#F59B6B', '#F7CA8D']}
- style={styles.yxTopicItem}
- start={{x: 0.25, y: 0.25}}
- end={{x: 0.7, y: 0.7}}>
- <TouchableOpacity style={styles.yc_inner}>
- <Text style={styles.yxTopicItemTextA}>开票总额</Text>
- <Text style={styles.yxTopicItemTextC}>
- {this.state.monthTotal}
- </Text>
- </TouchableOpacity>
- </LinearGradient>
- <LinearGradient
- style={styles.yxTopicItem}
- colors={['#3BC0D0', '#58DBE8']}
- start={{x: 0.25, y: 0.25}}
- end={{x: 0.7, y: 0.7}}>
- <TouchableOpacity style={styles.yc_inner}>
- <Text style={styles.yxTopicItemTextA}>税额</Text>
- <Text style={styles.yxTopicItemTextC}>
- {this.state.monthTotalTaxes}
- </Text>
- </TouchableOpacity>
- </LinearGradient>
- </View>
- </View>
- <View style={{backgroundColor: '#FCFCFE'}}>
- <Text style={styles.main_title}>未税金额</Text>
- <View style={styles.line_des}>
- <View style={styles.line_item}>
- <Image
- style={{width: 20, height: 20}}
- source={require('../../source/img/homeImg/leiji.png')}
- />
- <Text style={styles.font_item}>累计成功开票未税金额(元)</Text>
- </View>
- <Text style={styles.font_item_right}>
- {this.state.statisticsData.monthTotal}
- </Text>
- </View>
- <View style={styles.line_des}>
- <View style={styles.line_item}>
- <Image
- style={{width: 20, height: 20}}
- source={require('../../source/img/homeImg/zhuan.png')}
- />
- <Text style={styles.font_item}>专票开票未税金额(元)</Text>
- </View>
- <Text style={styles.font_item_right}>
- {this.state.statisticsData.monthZhuanpiaoTotal}
- </Text>
- </View>
- <View style={styles.line_des}>
- <View style={styles.line_item}>
- <Image
- style={{width: 20, height: 20}}
- source={require('../../source/img/homeImg/leijicheng.png')}
- />
- <Text style={styles.font_item}>普票开票未税金额(元)</Text>
- </View>
- <Text style={styles.font_item_right}>
- {this.state.statisticsData.monthPupiaoTotal}
- </Text>
- </View>
- <Text style={styles.main_title}>累计税额</Text>
- <View style={styles.line_des}>
- <View style={styles.line_item}>
- <Image
- style={{width: 20, height: 20}}
- source={require('../../source/img/homeImg/leiji.png')}
- />
- <Text style={styles.font_item}>累计开票税额(元)</Text>
- </View>
- <Text style={styles.font_item_right}>
- {this.state.statisticsData.monthTotalTaxes}
- </Text>
- </View>
- <View style={styles.line_des}>
- <View style={styles.line_item}>
- <Image
- style={{width: 20, height: 20}}
- source={require('../../source/img/homeImg/zhuan.png')}
- />
- <Text style={styles.font_item}>专票开票税额(元)</Text>
- </View>
- <Text style={styles.font_item_right}>
- {this.state.statisticsData.monthZhuanpiaoTotalTaxes}
- </Text>
- </View>
- <View style={styles.line_des}>
- <View style={styles.line_item}>
- <Image
- style={{width: 20, height: 20}}
- source={require('../../source/img/homeImg/leijicheng.png')}
- />
- <Text style={styles.font_item}>普票开票税额(元)</Text>
- </View>
- <Text style={styles.font_item_right}>
- {this.state.statisticsData.monthPupiaoTotalTaxes}
- </Text>
- </View>
- <WhiteSpace />
- </View>
- {/*<View style={styles.xpPushBak}>*/}
- {/* <View style={styles.xpPushTop}>*/}
- {/* <View style={styles.userOnlineLeft}>*/}
- {/* <Image*/}
- {/* source={require('../../source/img/homeImg/recommend.png')}*/}
- {/* style={{width: 18, height: 18}}*/}
- {/* />*/}
- {/* <Text*/}
- {/* style={{*/}
- {/* marginLeft: 10,*/}
- {/* fontSize: 16,*/}
- {/* color: 'rgba(51, 51, 51, 1)',*/}
- {/* }}>*/}
- {/* 新品推荐*/}
- {/* </Text>*/}
- {/* </View>*/}
- {/* <TouchableOpacity style={styles.userOnlineRight}>*/}
- {/* <Text style={{color: 'rgba(153, 153, 153, 1)', marginRight: 5}}>*/}
- {/* 查看全部*/}
- {/* </Text>*/}
- {/* <Image*/}
- {/* source={require('../../source/img/homeImg/go.png')}*/}
- {/* style={{marginTop: 3, width: 12, height: 12}}*/}
- {/* />*/}
- {/* </TouchableOpacity>*/}
- {/* </View>*/}
- {/* <View style={styles.xpPushBottom}>*/}
- {/* <View style={styles.xpPushItem}>*/}
- {/* <TouchableOpacity*/}
- {/* onPress={() => {*/}
- {/* this.props.navigation.navigate('recommend_home');*/}
- {/* }}>*/}
- {/* <Image*/}
- {/* style={{*/}
- {/* height: '100%',*/}
- {/* width: '100%',*/}
- {/* borderRadius: 10,*/}
- {/* resizeMode: 'stretch',*/}
- {/* }}*/}
- {/* source={require('../../source/img/homeImg/activity.png')}*/}
- {/* />*/}
- {/* </TouchableOpacity>*/}
- {/* </View>*/}
- {/* </View>*/}
- {/*</View>*/}
- </ScrollView>
- </SafeAreaView>
- );
- }
- // render加载完后调用
- async componentDidMount() {
- await this.getAuthority();
- await this.getCompanyInfo();
- await this.getInvoiceStatistics();
- await this.getLoanList();
- await this.getInvoiceNumber();
- // 收到监听
- this.listener = DeviceEventEmitter.addListener(
- 'updateCompany',
- (message) => {
- // 收到监听后想做的事情 // 监听
- this.getCompanyInfo();
- this.getInvoiceStatistics();
- this.getInvoiceNumber();
- //this.getKPStatsMonth();
- },
- );
- this.listenerStatistics = DeviceEventEmitter.addListener(
- 'updateStatistics',
- (message) => {
- // 收到监听后想做的事情 // 监听
- this.getInvoiceStatistics();
- this.getInvoiceNumber();
- },
- );
- }
- componentWillUnmount() {
- // 移除监听
- if (this.listener) {
- this.listener.remove();
- }
- if (this.listenerStatistics) {
- this.listenerStatistics.remove();
- }
- this.setState = (state, callback) => {
- return;
- };
- }
- //首页数据获取
- getKPStatsMonth = async (curEntId) => {
- const token = await RetrieveData('token');
- const account = await RetrieveData('account');
- //const curEntId =await RetrieveData('defaultEnt');
- if (token && account) {
- const url = '/sys/invoice_info/getKPStatsMonth';
- let response = await RequestNetwork(
- url,
- token,
- {
- entTaxId: curEntId,
- },
- false,
- 2,
- );
- if (response.code != 0) {
- //console.log(response);
- this.setState({
- sumNum: 0.0,
- totalAmt: 0.0,
- totalTaxes: 0.0,
- });
- } else {
- this.setState({
- sumNum: response.data.cnt,
- totalAmt: response.data.totalAmt,
- totalTaxes: response.data.totalTaxes,
- });
- }
- }
- };
- // 获取当前默认绑定企业
- getCompanyInfo = async () => {
- let company = await RetrieveData('company');
- if (company) {
- company = JSON.parse(company);
- }
- this.props.navigation.setOptions({
- headerTitleAlign: 'left',
- headerTitle: (props) => {
- return (
- <View
- style={{
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'center',
- }}>
- <View style={{flex: 1}}>
- <TouchableOpacity
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'flex-start',
- }}
- onPress={async () => {
- if (company) {
- this.props.navigation.navigate('enterprise_list', {
- getCompanyInfo: () => {
- this.getCompanyInfo();
- },
- });
- } else {
- await this.getLandingStatus(-1);
- }
- }}>
- <Text
- ellipsizeMode={'tail'}
- numberOfLines={1}
- style={{
- color: '#000000',
- fontSize: 20,
- fontWeight: '600',
- }}>
- {company ? company.entName : '未登录'}
- </Text>
- <SvgXml height={12} xml={homeArrow()} />
- {/*<View>*/}
- {/* */}
- {/*</View>*/}
- {/*<View>*/}
- {/* */}
- {/*</View>*/}
- </TouchableOpacity>
- </View>
- <View
- style={{
- width: 50,
- height: 27,
- alignItems: 'center',
- justifyContent: 'center',
- }}>
- <TouchableOpacity
- onPress={async () => {
- this.props.navigation.navigate('notice');
- }}>
- <SvgXml height={22} xml={noticeIcon()} />
- </TouchableOpacity>
- </View>
- </View>
- );
- },
- headerStyle: {backgroundColor: '#ffffff', borderWidth: 0},
- });
- await this.getInvoiceStatistics();
- };
- //判断是否登录
- getLandingStatus = async (type) => {
- const account = await RetrieveData('account');
- if (account) {
- this.setState({
- landingStatus: 1,
- });
- if (type === 1) {
- this.props.navigation.navigate('invoice');
- }
- if (type === 2) {
- this.props.navigation.navigate('invoice_qrcode');
- }
- if (type === 3) {
- this.props.navigation.navigate('buyer_invoice');
- }
- if (type === 4) {
- this.props.navigation.navigate('invoice_head_list');
- }
- if (type === 5) {
- this.props.navigation.navigate('wait_invoice_list');
- }
- if (type === 6) {
- this.props.navigation.navigate('application_info');
- }
- if (type === 7) {
- this.props.navigation.navigate('invoice_distribution');
- }
- if (type === 8) {
- this.props.navigation.navigate('electronics_ordinary_invoice');
- }
- } else {
- this.setState({
- landingStatus: 0,
- });
- this.props.navigation.navigate('login', {
- refresh: (type) => {
- this.refresh(type);
- },
- });
- }
- };
- refresh = async (type) => {
- await this.getCompanyInfo();
- DeviceEventEmitter.emit('updateLoginInfo', type);
- };
- //获取权限信息
- getAuthority = async () => {
- const authority = await RetrieveData('authority');
- if (authority) {
- this.setState({
- authority: authority,
- landingStatus: 1,
- });
- }
- };
- //获取首页统计数据
- getInvoiceStatistics = async () => {
- let company = await RetrieveData('company');
- if (company) {
- company = JSON.parse(company);
- }
- const token = await RetrieveData('token');
- if (token && company) {
- const url = '/sys/stat/toInvoice';
- let response = await RequestNetwork(
- url,
- token,
- {
- entTaxId: company.entTaxId,
- },
- false,
- 2,
- );
- if (response) {
- if (response.code === 0) {
- this.setState({
- monthTotal: response.data.monthTotal,
- monthTotalTaxes: response.data.monthTotalTaxes,
- statisticsData: response.data,
- });
- } else {
- await this.abnormalMessage(response);
- }
- }
- }
- };
- //获取发票数量统计
- getInvoiceNumber = async () => {
- let company = await RetrieveData('company');
- if (company) {
- company = JSON.parse(company);
- }
- const token = await RetrieveData('token');
- const account = await RetrieveData('account');
- if (token && company) {
- let date = GetMonthDate();
- const url = '/sys/invoiceExt/reports';
- let response = await RequestNetwork(
- url,
- token,
- {
- entTaxId: company.entTaxId,
- deviceType: company.defaultDeviceInfo.deviceType,
- taxDiscId: company.defaultDeviceInfo.taxDiscId,
- mobile: account,
- invoiceDateBegin: date.startDateTime,
- invoiceDateEnd: date.endDateTime,
- reqChannel: 3,
- },
- false,
- 2,
- );
- if (response) {
- if (response.code === 0) {
- this.setState({
- invoiceNumber: response.data.totalFapiaoCnt,
- });
- }
- }
- }
- };
- // 处理网络请求数据
- abnormalMessage = async (jason) => {
- if (jason.code === 401) {
- await Alert.alert(
- '登录失效',
- '登录状态已失效,请重新登录!',
- [
- {
- text: '确定',
- onPress: () => {
- CleanAll();
- this.props.navigation.popToTop();
- },
- },
- ],
- {cancelable: false},
- );
- }
- if (jason.code === 403) {
- Alert.alert(
- '权限',
- '暂无权限操作此模块!',
- [
- {
- text: '确定',
- onPress: () => {
- this.props.navigation.goBack();
- },
- },
- ],
- {cancelable: false},
- );
- }
- if (jason.code !== 401 && jason.code !== 403) {
- ToastShow(1, jason.msg);
- }
- };
- //获取数据
- getLoanList = async () => {
- const url = '/marketing/campaign/findPage';
- let response = await RequestNetwork(
- url,
- null,
- {
- campaignName: '',
- valid: true,
- pageNum: 1,
- pageSize: 5,
- },
- false,
- 2,
- );
- if (response) {
- if (response.code === 0) {
- let list = [];
- response.data.records.map((item) => {
- if (item.campaignId !== '4efc6f48fed8ce0457fc4abaf3470a82') {
- list = list.concat(item);
- }
- });
- this.setState({
- activityList: list,
- });
- }
- }
- };
- }
- const windowWidth = Dimensions.get('window').width;
- const styles = StyleSheet.create({
- homePageBak: {
- flexDirection: 'column',
- },
- taxItemBak: {
- display: 'flex',
- flexDirection: 'row',
- flexWrap: 'wrap',
- paddingTop: 15,
- backgroundColor: '#FFFFFF',
- },
- tapBtnBakCol: {
- display: 'flex',
- flexDirection: 'column',
- width: windowWidth / 4,
- height: 80,
- alignItems: 'center',
- justifyContent: 'center',
- marginBottom: 15,
- },
- tapBtnImg: {
- width: 53,
- height: 53,
- },
- tapBtnTips: {
- color: '#000',
- },
- userOnlineLeft: {
- flex: 1,
- flexDirection: 'row'
- },
- userOnlineRight: {
- flex: 1,
- marginRight: 10,
- flexDirection: 'row',
- justifyContent: 'flex-end',
- },
- yxTopicBak: {
- marginTop: 20,
- // height: 200,
- backgroundColor: '#fff',
- flexDirection: 'column',
- },
- yxTopicTop: {
- height: 45,
- flexDirection: 'row',
- alignItems: 'center',
- paddingLeft: 10,
- paddingRight: 10,
- },
- yxTopicBottom: {
- display: 'flex',
- flexDirection: 'row',
- flexWrap: 'wrap',
- paddingBottom: 15,
- },
- yxTopicItem: {
- width: (windowWidth - 60) / 3,
- height: 70,
- borderRadius: 5,
- marginLeft: 10,
- marginRight: 10,
- },
- yc_inner: {
- width: '100%',
- height: '100%',
- display: 'flex',
- flexDirection: 'column',
- borderRadius: 5,
- justifyContent: 'center',
- paddingLeft: 12,
- },
- yxTopicItemTextA: {
- color: '#FFFFFF',
- fontWeight: '600',
- fontSize: 12,
- },
- yxTopicItemTextB: {
- color: '#FFFFFF',
- fontSize: 16,
- marginTop: 5,
- },
- yxTopicItemTextC: {
- color: '#FFFFFF',
- fontSize: 16,
- marginTop: 5,
- },
- xpPushBak: {
- height: 292,
- marginTop: 20,
- backgroundColor: '#fff',
- flexDirection: 'column',
- },
- xpPushTop: {
- height: 45,
- flexDirection: 'row',
- borderBottomWidth: 1,
- borderBottomColor: '#E0EEEE',
- alignItems: 'center',
- marginLeft: 10,
- marginRight: 10,
- },
- xpPushBottom: {},
- xpPushItem: {
- height: 148,
- marginTop: 20,
- marginRight: 24,
- marginLeft: 24,
- borderRadius: 10,
- },
- containerHorizontal: {
- flexGrow: 1,
- alignItems: 'center',
- justifyContent: 'center',
- height: 150,
- },
- containerVertical: {
- flexGrow: 1,
- alignItems: 'center',
- justifyContent: 'center',
- height: 150,
- },
- text: {
- color: '#fff',
- fontSize: 36,
- },
- // zj
- wrapper: {
- height: 170,
- },
- wrapper1: {
- height: 140,
- marginTop: 15,
- },
- carousel: {
- width: '100%',
- height: 170,
- backgroundColor: '#fff',
- paddingLeft: 12,
- paddingRight: 12,
- overflow: 'hidden',
- },
- carousel1: {
- width: '100%',
- height: '100%',
- backgroundColor: '#fff',
- paddingLeft: 12,
- paddingRight: 12,
- overflow: 'hidden',
- },
- banner_box: {
- paddingTop: 15,
- },
- banner_img: {
- height: '100%',
- width: '100%',
- borderRadius: 14,
- },
- line_des: {
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 55,
- backgroundColor: '#ffffff',
- paddingLeft: 20,
- paddingRight: 20,
- },
- line_item: {
- display: 'flex',
- flexDirection: 'row',
- alignItems: 'center',
- },
- font_item: {
- color: '#3B3B3B',
- fontSize: 12,
- fontWeight: 'bold',
- marginLeft: 12,
- },
- font_item_right: {
- color: '#2A67FE',
- fontSize: 14,
- fontWeight: 'bold',
- },
- main_title: {
- paddingLeft: 12,
- fontWeight: 'bold',
- color: '#464646',
- fontSize: 16,
- },
- });
|