Commit a7c661dd by Giang Tran

upload image on android

parent d29b6433
......@@ -30,20 +30,5 @@ const mapStateToProps = (state) => {
loadingModal: state.ModalLoadingReducer,
};
};
const styles = StyleSheet.create({
container: {
height: HEIGHT(65),
paddingHorizontal: 10,
flexDirection: 'row',
paddingTop: 15,
backgroundColor: R.colors.red,
},
img: {
height: HEIGHTXD(788),
width: '100%',
justifyContent: 'center',
},
});
export default connect(mapStateToProps, {})(RootView);
......@@ -19,6 +19,9 @@ import R from '../../../assets/R';
import Button from '../../../components/Button';
import PickerItem from '../../../components/Picker/PickerItem';
import {verifyAccountApi} from '../../../apis/Functions/users';
import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../../actions/loadingAction';
const {width} = Dimensions.get('window');
const dataType = [
{
......@@ -32,13 +35,12 @@ const dataType = [
];
const BankInfor = (props) => {
const [type, setType] = useState();
const [acc_type, setAccType] = useState('');
const [acc_type, setAccType] = useState();
const [bank_no, setBackNo] = useState('');
const [account_no, setAccountNo] = useState('');
const createFormData = (identity_after, identity_before, sign_img, body) => {
const data = new FormData();
console.log(identity_after);
data.append('identity_after', {
name: 'identity_after.jpg',
......@@ -73,7 +75,7 @@ const BankInfor = (props) => {
const onPress = async () => {
const titles = ['loại thẻ', 'mã ngân hàng', 'số thẻ/tài khoản'];
const index = checkFormatArray([type, acc_type, account_no]);
const index = checkFormatArray([acc_type, bank_no, account_no]);
console.log(props.route.params.body);
if (index === true) {
const data = createFormData(
......@@ -81,10 +83,10 @@ const BankInfor = (props) => {
props.route.params.img.urlFont,
props.route.params.img.urlSign,
{
uid: 17,
uid: props.user.uid,
acc_type: 0,
account_no: '123465789',
bank_no: '970423',
bank_no,
account_no,
...props.route.params.body,
},
);
......@@ -119,13 +121,13 @@ const BankInfor = (props) => {
width={width - 20}
data={dataType}
onValueChange={(value, items) => {
setType(items);
setAccType(items);
}}
/>
<TextField
isNumber={true}
title={'Mã ngân hàng'}
onChangeText={(val) => setAccType(val)}
onChangeText={(val) => setBackNo(val)}
/>
<TextField
title={'Số thẻ/tài khoản'}
......@@ -149,4 +151,9 @@ const styles = StyleSheet.create({
},
});
export default BankInfor;
const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {showLoading, hideLoading})(BankInfor);
......@@ -4,7 +4,6 @@ import {connect} from 'react-redux';
import HomeView from './HomeView';
const Home = (props) => {
console.log('Information in home', props.user);
return <HomeView />;
};
......
......@@ -103,7 +103,7 @@ export async function PostFormData(url, data) {
.then((response) => response)
.then((response) => response)
.catch((error) => {
console.log(error.request);
console.log(error);
const err = {
message: 'error',
status: error.request.status,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment