AmountEditView.js 1.41 KB
import React, {Component} from 'react';
import {
    View,
    Text,
    TextInput,
    Image,
} from 'react-native';

export default class AmountEditView extends Component {

    constructor(props) {
        super(props);
        this.state = {
            value: '',
        };
        this.title = this.props.title || '计算公式';
        this.onChangeText = this.props.onChangeText;
        this.inputType = this.props.inputType || 'default';// 输入类型
    }

    render() {
        return(
            <View style={{width: '100%', backgroundColor: 'white', paddingHorizontal: 5, paddingVertical: 10}}>
                <Text style={{fontSize: 16, color: 'rgba(0, 0, 0, 1)', marginBottom: 5}}>{this.title}</Text>
                <TextInput
                    style={{width: "100%", backgroundColor: 'white', textAlign: 'left', paddingVertical: 5}}
                    multiline={false}
                    keyboardType={this.inputType}
                    onChangeText={text => {
                        if (this.onChangeText) {
                            this.onChangeText(text)
                        }
                    }}
                    placeholderTextColor={'#999'}
                    placeholder={'请输入金额'}
                    underlineColorAndroid="transparent"
                />
                <Text style={{fontSize: 16, color: 'rgba(0, 0, 0, 1)'}}>大写</Text>
            </View>
        )
    }
}