123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- import React, {Component} from 'react';
- import {
- View,
- Image,
- TouchableHighlight,
- Text,
- StyleSheet,
- TextInput,
- TouchableOpacity,
- Dimensions,
- ScrollView,
- KeyboardAvoidingView,
- DeviceEventEmitter,
- } from 'react-native';
- import login_css from '../login/login_css';
- import public_css from '../../source/css/public_css';
- import loading_css from '../../source/css/loading_css';
- import Spinner from 'react-native-loading-spinner-overlay';
- import {GetDataPost} from '../../data/encryption';
- import {ShowToast} from '../../components/rootToast/root_toast';
- import {RetrieveData, StorageData} from '../../data/storage';
- export default class service_provider extends Component {
- constructor(props) {
- super(props);
- this.props.navigation.dangerouslyGetParent().setOptions({
- tabBarVisible: false,
- });
- this.service = this.props.route.params.service;
- this.state = {
- name: this.service.name,
- contactPhone: this.service.contactPhone,
- contactName: this.service.contactName,
- address: this.service.address,
- ispId: this.service.ispId,
- joinDate: this.service.joinDate,
- machineCnt: 0,
- onlineEnCut: 0,
- allEntCnt: 0,
- monthInvoiceAmt: 0,
- monthInvoiceCnt: 0,
- monthNewInitCnt: 0,
- avaiableEntCnt: 0,
- };
- console.log(this);
- }
- render() {
- return (
- <KeyboardAvoidingView enabled style={{flex: 1}}>
- <ScrollView>
- <View>
- <View style={login_css.inputView}>
- <View style={[public_css.view, public_css.lineTopBottom]}>
- <Text
- style={[
- public_css.text,
- {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
- ]}>
- 服务商名称:
- </Text>
- <TextInput
- style={public_css.textInputStyle}
- value={this.state.name}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- editable={false}
- />
- </View>
- <View style={[public_css.view, public_css.lineTopBottom]}>
- <Text
- style={[
- public_css.text,
- {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
- ]}>
- 联系电话:
- </Text>
- <TextInput
- style={public_css.textInputStyle}
- value={this.state.contactPhone}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- editable={false}
- onChangeText={(text) => {
- this.setState({
- contactPhone: text,
- });
- }}
- />
- </View>
- <View style={[public_css.view, public_css.lineTopBottom]}>
- <Text
- style={[
- public_css.text,
- {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
- ]}>
- 地址:
- </Text>
- <TextInput
- style={public_css.textInputStyle}
- value={this.state.address}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- editable={false}
- onChangeText={(text) => {
- this.setState({
- address: text,
- });
- }}
- />
- </View>
- <View style={[public_css.view, public_css.lineTopBottom]}>
- <Text style={public_css.text}>接入日期:</Text>
- <TextInput
- style={public_css.textInputStyle}
- value={this.state.joinDate}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- editable={false}
- onChangeText={(text) => {
- this.setState({
- joinDate: text,
- });
- }}
- />
- </View>
- </View>
- </View>
- <View style={[login_css.inputView, {marginTop: 10}]}>
- <View style={[public_css.view, public_css.lineTopBottom]}>
- <Text style={public_css.text}>服务器数量:</Text>
- <TextInput
- style={public_css.textInputStyle}
- value={this.state.bankAccountName}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- editable={false}
- onChangeText={(text) => {
- this.setState({
- bankAccountName: text,
- });
- }}
- />
- </View>
- <View style={[public_css.view, public_css.lineTopBottom]}>
- <Text style={public_css.text}>在线企业数:</Text>
- <TextInput
- style={public_css.textInputStyle}
- value={this.state.onlineEnCut}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- editable={false}
- onChangeText={(text) => {
- this.setState({
- onlineEnCut: text,
- });
- }}
- />
- </View>
- <View
- style={[
- public_css.view,
- public_css.lineTopBottom,
- {alignItems: 'center'},
- ]}>
- <Text style={public_css.text}>所有企业数:</Text>
- <TextInput
- style={public_css.textInputStyle}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- value={this.state.payees}
- editable={false}
- />
- </View>
- <View
- style={[
- public_css.view,
- public_css.lineTopBottom,
- {alignItems: 'center'},
- ]}>
- <Text style={public_css.text}>月累计开票金额:</Text>
- <TextInput
- style={public_css.textInputStyle}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- value={this.state.reviewers}
- editable={false}
- />
- </View>
- <View
- style={[
- public_css.view,
- public_css.lineTopBottom,
- {alignItems: 'center'},
- ]}>
- <Text style={public_css.text}>月累计开票数量:</Text>
- <TextInput
- style={public_css.textInputStyle}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- value={this.state.reviewers}
- editable={false}
- />
- </View>
- <View
- style={[
- public_css.view,
- public_css.lineTopBottom,
- {alignItems: 'center'},
- ]}>
- <Text style={public_css.text}>月新增上架企业数:</Text>
- <TextInput
- style={public_css.textInputStyle}
- clearButtonMode="while-editing"
- secureTextEntry={false}
- value={this.state.reviewers}
- editable={false}
- />
- </View>
- </View>
- </ScrollView>
- </KeyboardAvoidingView>
- );
- }
- //加载页面时显示数据
- componentDidMount(): void {
- this.getServiceInfo();
- }
- //获取服务商列表
- getServiceInfo = async () => {
- let account = await RetrieveData('account');
- let token = await RetrieveData('token');
- if (token && account) {
- account = account.substring(1, account.length - 1);
- token = token.substring(1, token.length - 1);
- const url = 'https://app.taxbk.cn:9443/auth/isp/info/findDetail';
- let response = await GetDataPost(
- url,
- token,
- {
- ispId: this.state.ispId,
- },
- false,
- 2,
- );
- if (response) {
- if (response.code == 0) {
- this.setState({
- name: response.data.name,
- contactPhone: response.data.contactPhone,
- contactName: response.data.contactName,
- address: response.data.address,
- ispId: response.data.ispId,
- joinDate: response.data.joinDate,
- machineCnt: response.data.machineCnt,
- onlineEnCut: response.data.onlineEnCut,
- allEntCnt: response.data.allEntCnt,
- monthInvoiceAmt: response.data.monthInvoiceAmt,
- monthInvoiceCnt: response.data.monthInvoiceCnt,
- monthNewInitCnt: response.data.monthNewInitCnt,
- avaiableEntCnt: response.data.avaiableEntCnt,
- });
- }
- }
- }
- };
- }
|