123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- import React, {Component} from 'react';
- import {
- View,
- Text,
- TouchableOpacity,
- Image,
- SafeAreaView,
- ScrollView,
- } from 'react-native';
- import {WingBlank, WhiteSpace, TextareaItem} from '@ant-design/react-native';
- import {RequestNetwork} from '../../data/encryption';
- import {RetrieveData} from '../../data/storage';
- import public_css from '../../source/css/public_css';
- import {ToastShow} from '../../components/toast/toast';
- export default class change_nick_name extends Component {
- constructor(props) {
- super(props);
- this.state = {
- profiles: this.props.route.params.data,
- };
- }
- render() {
- return (
- <SafeAreaView style={public_css.body}>
- <ScrollView>
- <TextareaItem
- rows={15}
- placeholder="请输入简介信息"
- value={this.state.profiles}
- onChange={(text) => {
- this.setState({
- profiles: text,
- });
- }}
- count={200}
- />
- </ScrollView>
- <WingBlank>
- <View style={[public_css.bottomStatus]}>
- <TouchableOpacity
- style={[public_css.statusBtn, public_css.statusRBtn]}
- onPress={() => this.submitData()}>
- <Image
- source={require('../../source/img/productImg/confirm.png')}
- style={{width: 32, height: 32}}
- />
- <Text style={{color: '#fff'}}>确认</Text>
- </TouchableOpacity>
- </View>
- </WingBlank>
- <WhiteSpace />
- </SafeAreaView>
- );
- }
- //提交信息
- submitData = async () => {
- let account = await RetrieveData('account');
- let token = await RetrieveData('token');
- if (token && account) {
- const url = '/auth/comm/user/personalInfo/save';
- let response = await RequestNetwork(
- url,
- token,
- {
- mobile: account,
- personalProfile: this.state.profiles,
- reqChannel: 3,
- ip: '',
- },
- false,
- 1,
- );
- if (response) {
- if (response.code === 0) {
- ToastShow(1, '编辑成功!');
- this.props.route.params.isRefresh();
- this.props.navigation.goBack();
- } else {
- ToastShow(1, '编辑失败!');
- }
- }
- }
- };
- }
|