import React, {Component} from 'react'; import { View, Text, SafeAreaView, ScrollView, Image, Dimensions, TouchableOpacity, TextInput, DeviceEventEmitter, } from "react-native"; import public_css from '../../../source/css/public_css'; import { RequestNetwork } from "../../../data/encryption"; import { StorageData } from "../../../data/storage"; import { ToastShow } from "../../../components/toast/toast"; import Spinner from 'react-native-loading-spinner-overlay'; import loading_css from "../../../source/css/loading_css"; export default class loan_apply extends Component { constructor(props) { super(props); this.props.navigation.dangerouslyGetParent().setOptions({ tabBarVisible: false, }); this.state = { companyName: '', contacts: '', phone: '', quota: '', spinner: false, initData: 'loading', }; } render() { return ( 填写申请信息 企业名称: { this.setState({companyName: text}); }} /> 联系人: { this.setState({contacts: text}); }} /> 联系电话: { this.setState({phone: text}); }} /> 意向额度: { this.setState({quota: text}); }} /> 小提示:提交申请后,工作人员会在第一时间与您取得联系,请保持手机畅通! this.submitData()}> 立即申请 *本产品最终解释权归昆明官渡农村合作银行所有 ); } //提交申请信息 submitData = async () => { this.setLoadingStatus(true); const url = '/marketing/recommended/save'; let token = null; let response = await RequestNetwork( url, token, { contactName: this.state.contacts, contactPhone: this.state.phone, entName: this.state.companyName, campaignId: '4efc6f48fed8ce0457fc4abaf3470a82', reqChannel: 3, by1: this.state.quota, }, false, 1, ); if (response) { if (response.code === 0) { this.setLoadingStatus(false); ToastShow(1, '申请成功!'); this.props.navigation.goBack(); } else { this.setLoadingStatus(false); ToastShow(1, response.msg); } } }; //是否显示Loading层 setLoadingStatus(isLoading) { this.setState({ spinner: isLoading, }); } }