import React, {Component} from 'react'; import {View, Text, TouchableOpacity, Image} from 'react-native'; import {List, Radio, WhiteSpace} from '@ant-design/react-native'; import {ShowToast} from '../../components/rootToast/root_toast'; import {GetDataPost} from '../../data/encryption'; import {RetrieveData} from '../../data/storage'; import public_css from '../../source/css/public_css'; const RadioItem = Radio.RadioItem; export default class change_sex extends Component { constructor(props) { super(props); this.state = { sex: this.props.route.params.data.state.sex, }; } render() { return ( { if (event.target.checked) { this.setState({sex: 'M'}); } }}> 男 { if (event.target.checked) { this.setState({sex: 'F'}); } }}> 女 this.submitData()}> 确认 ); } //提交信息 submitData = 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/comm/user/personalInfo/save'; let response = await GetDataPost( url, token, { mobile: account, sex: this.state.sex, reqChannel: 3, ip: '', }, false, 1, ); if (response) { if (response.code == 0) { ShowToast('修改成功!'); await this.props.route.params.data.getUserInformation(); this.props.navigation.goBack(); } } else { ShowToast('服务器故障!'); } } }; }