51 lines
2.7 KiB
JavaScript
51 lines
2.7 KiB
JavaScript
import React, { Component } from 'react';
|
|
import { View, TouchableOpacity, TextInput, KeyboardAvoidingView, Platform, ScrollView } from 'react-native';
|
|
import Image from 'react-native-fast-image'
|
|
import Text from '../../components/Text';
|
|
import Icon from '../../components/Icon'
|
|
import moment from 'moment'
|
|
|
|
export default class SaveViewMeter extends Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
};
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<KeyboardAvoidingView style={{flex:1}} keyboardVerticalOffset={Platform.OS == 'ios' ? 70 : 0} behavior={Platform.OS == 'ios' ? "padding" : ""} enabled>
|
|
<ScrollView contentContainerStyle={{flex:1}}>
|
|
<View style={{flex:1,padding:16}}>
|
|
<View style={{justifyContent:'center',alignItems:'center'}}>
|
|
<Image source={{uri:this.props.ImageUri}} resizeMode={'contain'} style={{borderRadius:5,height: 184,width:'100%'}}/>
|
|
</View>
|
|
<Text style={{color:'black',fontSize:14,textAlign:'center',marginVertical: 16,}}>ถ่ายเมื่อวันที่ {moment().format('DD/MM/YYYY HH:mm')} น.</Text>
|
|
<TouchableOpacity style={{height: 40,width: '100%',backgroundColor:'#007AFF',justifyContent:'center',alignItems:'center',borderRadius:5,flexDirection:'row'}}
|
|
onPress={this.props.onTakeCamera}>
|
|
<Icon nane={'ic_outline_camera'} size={22} color={'#FFFFFF'}/>
|
|
<Text style={{color:'white'}}>ถ่ายภาพมิเตอร์{this.props.TypeName}อีกครั้ง</Text>
|
|
</TouchableOpacity>
|
|
<Text style={{color:'#00420A',marginVertical: 16,fontSize:14}}>กรุณากรอกเลขมิเตอร์{this.props.TypeName}</Text>
|
|
<TextInput
|
|
style={{height: 48, backgroundColor: '#FFFFFF', borderRadius:24,paddingHorizontal:16}}
|
|
onChangeText={(text) => this.props.TextChanged(text)}
|
|
value={this.props.amount}
|
|
keyboardType={'numeric'}
|
|
/>
|
|
<View style={{flex:1}}/>
|
|
<View style={{}}>
|
|
<TouchableOpacity style={{height: 40,width: '100%',backgroundColor:this.props.canConfirm ? '#269A21' : 'silver' ,justifyContent:'center',alignItems:'center',borderRadius:5,flexDirection:'row'}}
|
|
disabled={this.props.canConfirm ? false : true}
|
|
onPress={() => {this.props.Confirm()}}>
|
|
<Icon nane={'ic_outline_camera'} size={22} color={'#FFFFFF'}/>
|
|
<Text style={{color:'white'}}>ยืนยันหมายเลขหน่วย</Text>
|
|
</TouchableOpacity>
|
|
</View>
|
|
</View>
|
|
</ScrollView>
|
|
</KeyboardAvoidingView>
|
|
);
|
|
}
|
|
}
|