Identification Ok
This commit is contained in:
parent
2d027283b9
commit
60020b1cf8
File diff suppressed because one or more lines are too long
|
|
@ -294,6 +294,7 @@
|
||||||
"IDENTIFICATION": " Identification",
|
"IDENTIFICATION": " Identification",
|
||||||
"CREATION_IDENTIFICATION": "Creation",
|
"CREATION_IDENTIFICATION": "Creation",
|
||||||
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
|
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
|
||||||
|
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a client",
|
||||||
"VALIDATE_IDENTIFICATION": "Validation",
|
"VALIDATE_IDENTIFICATION": "Validation",
|
||||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
||||||
"CREATE_IDENTIFICATION_TITLE": "Please fill in customer information",
|
"CREATE_IDENTIFICATION_TITLE": "Please fill in customer information",
|
||||||
|
|
|
||||||
|
|
@ -298,8 +298,9 @@
|
||||||
"CREATION_IDENTIFICATION": "Création",
|
"CREATION_IDENTIFICATION": "Création",
|
||||||
"CREATION_IDENTIFICATION_CLIENT": "M'identifier",
|
"CREATION_IDENTIFICATION_CLIENT": "M'identifier",
|
||||||
"CREATION_IDENTIFICATION_DESCRIPTION": "Identifier un client",
|
"CREATION_IDENTIFICATION_DESCRIPTION": "Identifier un client",
|
||||||
|
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Saisir l'identité d'un client",
|
||||||
"VALIDATE_IDENTIFICATION": "Validation",
|
"VALIDATE_IDENTIFICATION": "Validation",
|
||||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Valider une identification",
|
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Valider une identité client",
|
||||||
"CREATE_IDENTIFICATION_TITLE": "Veuillez renseigner les informations du client",
|
"CREATE_IDENTIFICATION_TITLE": "Veuillez renseigner les informations du client",
|
||||||
"DATE_NAISSANCE": "Date de naissance",
|
"DATE_NAISSANCE": "Date de naissance",
|
||||||
"REGISTER_YOURSELF": "Enregistrez-vous",
|
"REGISTER_YOURSELF": "Enregistrez-vous",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { CREATE_IDENTIFICATION_PENDING, CREATE_IDENTIFICATION_SUCCESS, CREATE_IDENTIFICATION_ERROR, CREATE_IDENTIFICATION_RESET } from "../types/IdentificationType";
|
||||||
|
|
||||||
|
export const fetchCreateIdentificationPending = () => ({
|
||||||
|
type: CREATE_IDENTIFICATION_PENDING
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchCreateIdentificationSuccess = (res) => ({
|
||||||
|
type: CREATE_IDENTIFICATION_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchCreateIdentificationError = (error) => ({
|
||||||
|
type: CREATE_IDENTIFICATION_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchCreateIdentificationReset = () => ({
|
||||||
|
type: CREATE_IDENTIFICATION_RESET
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
import { CREATE_IDENTIFICATION_PENDING, CREATE_IDENTIFICATION_SUCCESS, CREATE_IDENTIFICATION_ERROR, CREATE_IDENTIFICATION_RESET } from "../types/IdentificationType";
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: null
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (state = initialState, action) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case CREATE_IDENTIFICATION_PENDING: return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case CREATE_IDENTIFICATION_SUCCESS: return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case CREATE_IDENTIFICATION_ERROR: return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
case CREATE_IDENTIFICATION_RESET: return initialState;
|
||||||
|
|
||||||
|
default: {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -8,6 +8,7 @@ import creditCancelDemandReducer from "./CreditCancelDemandReducer";
|
||||||
import WalletGetCommissionReducer from "./WalletGetCommissionReducer";
|
import WalletGetCommissionReducer from "./WalletGetCommissionReducer";
|
||||||
import walletHistoryReducer from "./WalletTransactionHistoryReducer";
|
import walletHistoryReducer from "./WalletTransactionHistoryReducer";
|
||||||
import walletTransferCommissionReducer from "./WalletTransferCommission";
|
import walletTransferCommissionReducer from "./WalletTransferCommission";
|
||||||
|
import CreateIdentificationReducer from "./IdentificationReducer";
|
||||||
import { persistCombineReducers } from "redux-persist";
|
import { persistCombineReducers } from "redux-persist";
|
||||||
import { AsyncStorage } from "react-native";
|
import { AsyncStorage } from "react-native";
|
||||||
|
|
||||||
|
|
@ -28,6 +29,7 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
creditTreatDemandReducer: creditTreatDemandReducer,
|
creditTreatDemandReducer: creditTreatDemandReducer,
|
||||||
creditCancelDemandReducer: creditCancelDemandReducer,
|
creditCancelDemandReducer: creditCancelDemandReducer,
|
||||||
walletGetCommission: WalletGetCommissionReducer,
|
walletGetCommission: WalletGetCommissionReducer,
|
||||||
|
createIdentificationReducer: CreateIdentificationReducer
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
export const CREATE_IDENTIFICATION_PENDING = 'CREATE_IDENTIFICATION_PENDING';
|
||||||
|
export const CREATE_IDENTIFICATION_SUCCESS = 'CREATE_IDENTIFICATION_SUCCESS';
|
||||||
|
export const CREATE_IDENTIFICATION_ERROR = 'CREATE_IDENTIFICATION_ERROR';
|
||||||
|
export const CREATE_IDENTIFICATION_RESET = 'CREATE_IDENTIFICATION_RESET';
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Alert, StyleSheet, Text, View, Image, ScrollView, Platform, ProgressBarAndroid, PermissionsAndroid, Keyboard } from 'react-native';
|
import { Alert, ActivityIndicator, StyleSheet, Text, View, Image, ScrollView, Platform, ProgressBarAndroid, PermissionsAndroid, Keyboard } from 'react-native';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
||||||
|
|
@ -12,18 +12,23 @@ let theme = require('./../../utils/theme.json');
|
||||||
let route = require('./../../route.json');
|
let route = require('./../../route.json');
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
|
import isNil from 'lodash/isNil';
|
||||||
import { Color } from '../../config/Color';
|
import { Color } from '../../config/Color';
|
||||||
import DateTimePicker from '@react-native-community/datetimepicker';
|
import DateTimePicker from '@react-native-community/datetimepicker';
|
||||||
import { Dropdown } from 'react-native-material-dropdown';
|
import { Dropdown } from 'react-native-material-dropdown';
|
||||||
import { getPositionInformation } from './../../webservice/MapService';
|
import { getPositionInformation } from './../../webservice/MapService';
|
||||||
|
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||||
import { getCountryNetwork, createGeolocatedAccount, createUserAccount, getTownInformationName, getListCountriesActive, getCodeInformation, readUser } from './../../webservice/AuthApi';
|
import { getCountryNetwork, createGeolocatedAccount, createUserAccount, getTownInformationName, getListCountriesActive, getCodeInformation, readUser } from './../../webservice/AuthApi';
|
||||||
import { SinglePickerMaterialDialog, MultiPickerMaterialDialog, MaterialDialog } from "react-native-material-dialog";
|
import { SinglePickerMaterialDialog, MultiPickerMaterialDialog, MaterialDialog } from "react-native-material-dialog";
|
||||||
import Geolocation from 'react-native-geolocation-service';
|
import Geolocation from 'react-native-geolocation-service';
|
||||||
import { identityPieces } from '../../utils/UtilsFunction';
|
import { identityPieces } from '../../utils/UtilsFunction';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { createIndentificationAction, createIndentificationResetAction } from '../../webservice/IdentificationApi';
|
||||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
|
|
||||||
export default class CreateIdentification extends Component {
|
class CreateIdentification extends Component {
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
navBarBackgroundColor: Color.primaryColor,
|
navBarBackgroundColor: Color.primaryColor,
|
||||||
statusBarColor: Color.primaryDarkColor,
|
statusBarColor: Color.primaryDarkColor,
|
||||||
|
|
@ -52,18 +57,20 @@ export default class CreateIdentification extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
password: null,
|
|
||||||
enterPhone: null,
|
enterPhone: null,
|
||||||
|
firstname: null,
|
||||||
|
lastname: null,
|
||||||
numeroIdentite: null,
|
numeroIdentite: null,
|
||||||
nameanim: null,
|
dateNaissance: null,
|
||||||
dateNaissance: new Date(),
|
dateExpiration: null,
|
||||||
dateExpiration: new Date(),
|
numeroTelephone: null,
|
||||||
networksinglePickerVisible: false,
|
networksinglePickerVisible: false,
|
||||||
passwordanim: null,
|
|
||||||
confirmpassanim: null,
|
confirmpassanim: null,
|
||||||
isLoging: false,
|
isLoging: false,
|
||||||
countries: [],
|
countries: [],
|
||||||
town: [],
|
town: [],
|
||||||
|
townName: null,
|
||||||
|
country: null,
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: (identityPieces()[0]).name,
|
||||||
snackVisible: false,
|
snackVisible: false,
|
||||||
|
|
@ -74,15 +81,16 @@ export default class CreateIdentification extends Component {
|
||||||
showPickerDateExpiration: false,
|
showPickerDateExpiration: false,
|
||||||
modalVisible: true,
|
modalVisible: true,
|
||||||
select_network: I18n.t("SELECT_NETWORK"),
|
select_network: I18n.t("SELECT_NETWORK"),
|
||||||
user: null
|
user: null,
|
||||||
|
triggerSubmitClick: false
|
||||||
};
|
};
|
||||||
this.dateNaissanceRef = null;
|
|
||||||
this.surnameanim = null;
|
|
||||||
this.dateNaissanceFumiProps = {};
|
this.dateNaissanceFumiProps = {};
|
||||||
this.dateExpirationFumiProps = {};
|
this.dateExpirationFumiProps = {};
|
||||||
|
this.props.createIndentificationResetAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
|
|
@ -90,13 +98,70 @@ export default class CreateIdentification extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
this.requestCameraPermission();
|
this.requestCameraPermission();
|
||||||
} else {
|
} else {
|
||||||
this.watchLocation();
|
this.watchLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderCreateIdentificationResponse() {
|
||||||
|
const { result, error } = this.props;
|
||||||
|
|
||||||
|
console.log("PROPS", this.props);
|
||||||
|
|
||||||
|
if (result !== null) {
|
||||||
|
if (typeof result.response !== 'undefined') {
|
||||||
|
Alert.alert(
|
||||||
|
"SUCCES",
|
||||||
|
JSON.stringify(result.response),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.createIndentificationResetAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error !== null) {
|
||||||
|
if (typeof error.data !== 'undefined') {
|
||||||
|
Alert.alert(
|
||||||
|
"ERREUR",
|
||||||
|
JSON.stringify(error.data),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.createIndentificationResetAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Alert.alert(
|
||||||
|
"ERREUR",
|
||||||
|
JSON.stringify(error),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.createIndentificationResetAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
componentWillUpdate(nextProps, nextState) {
|
componentWillUpdate(nextProps, nextState) {
|
||||||
if (this.state.showPickerDateNaissance)
|
if (this.state.showPickerDateNaissance)
|
||||||
this.dateNaissanceFumiProps.value = moment(nextState.dateNaissance).format('DD-MM-YYYY');
|
this.dateNaissanceFumiProps.value = moment(nextState.dateNaissance).format('DD-MM-YYYY');
|
||||||
|
|
@ -192,8 +257,9 @@ export default class CreateIdentification extends Component {
|
||||||
let town = null;
|
let town = null;
|
||||||
if (result instanceof Array) {
|
if (result instanceof Array) {
|
||||||
town = result[0];
|
town = result[0];
|
||||||
} else
|
} else {
|
||||||
town = result;
|
town = result;
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({ modalVisible: false, town: new Array(town) });
|
this.setState({ modalVisible: false, town: new Array(town) });
|
||||||
})
|
})
|
||||||
|
|
@ -242,31 +308,83 @@ export default class CreateIdentification extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeDateNaissance = (event, selectedDate) => {
|
onChangeDateNaissance = (event, selectedDate) => {
|
||||||
const currentDate = selectedDate || this.state.dateNaissance;
|
const currentDate = selectedDate || new Date();
|
||||||
this.setState({
|
this.setState({
|
||||||
showPickerDateNaissance: Platform.OS === 'ios' || false,
|
showPickerDateNaissance: Platform.OS === 'ios' || false,
|
||||||
dateNaissance: currentDate,
|
dateNaissance: moment(currentDate).format('DD-MM-YYYY'),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onChangeDateExpiration = (event, selectedDate) => {
|
onChangeDateExpiration = (event, selectedDate) => {
|
||||||
const currentDate = selectedDate || this.state.dateExpiration;
|
const currentDate = selectedDate || new Date();
|
||||||
this.setState({
|
this.setState({
|
||||||
showPickerDateExpiration: Platform.OS === 'ios' || false,
|
showPickerDateExpiration: Platform.OS === 'ios' || false,
|
||||||
dateExpiration: currentDate,
|
dateExpiration: moment(currentDate).format('DD-MM-YYYY'),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ckeckIfFieldIsOK(champ) {
|
||||||
|
return (isNil(champ) || isEqual(champ.length, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmitIdentityClient = () => {
|
||||||
|
const { lastname, numeroTelephone, numeroIdentite, dateNaissance, dateExpiration, country, townName, identityPiecesName } = this.state;
|
||||||
|
|
||||||
|
if (this.ckeckIfFieldIsOK(lastname))
|
||||||
|
this.lastnameAnim.shake(800);
|
||||||
|
if (this.ckeckIfFieldIsOK(numeroTelephone))
|
||||||
|
this.numeroTelephoneAnim.shake(800);
|
||||||
|
else if (this.ckeckIfFieldIsOK(dateNaissance))
|
||||||
|
this.datenaissanceAnim.shake(800);
|
||||||
|
else if (this.ckeckIfFieldIsOK(country))
|
||||||
|
this.countryAnim.shake(800);
|
||||||
|
else if (this.ckeckIfFieldIsOK(townName))
|
||||||
|
this.townAnim.shake(800);
|
||||||
|
else if (this.ckeckIfFieldIsOK(identityPiecesName))
|
||||||
|
this.identityPiecesAnim.shake(800);
|
||||||
|
else if (this.ckeckIfFieldIsOK(numeroIdentite))
|
||||||
|
this.numeroIdentiteAnim.shake(800);
|
||||||
|
else if (this.ckeckIfFieldIsOK(dateExpiration))
|
||||||
|
this.identityDateExpiryAnim.shake(800);
|
||||||
|
else {
|
||||||
|
this.props.createIndentificationAction({
|
||||||
|
lastname: this.state.lastname,
|
||||||
|
firstname: "",
|
||||||
|
birth_date: this.state.dateNaissance,
|
||||||
|
town: this.state.townName,
|
||||||
|
country: this.state.country,
|
||||||
|
identity_document: this.state.identityPiecesName,
|
||||||
|
id_identity_document: this.state.numeroIdentite,
|
||||||
|
expiry_date_document: this.state.dateExpiration,
|
||||||
|
id_user: 321
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
triggerSubmitClick: true
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
renderLoaderModal() {
|
renderLoaderModal() {
|
||||||
return (<MaterialDialog
|
return (
|
||||||
visible={this.state.modalVisible}
|
<MaterialDialog
|
||||||
title={I18n.t("LOADING_INFO")}
|
visible={this.state.modalVisible}
|
||||||
>
|
title={I18n.t("LOADING_INFO")}>
|
||||||
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
|
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
|
||||||
<Text>{I18n.t("LOADING_DESCRIPTION_COUNTRY")}</Text>
|
<Text>{I18n.t("LOADING_DESCRIPTION_COUNTRY")}</Text>
|
||||||
<ProgressBarAndroid />
|
<ProgressBarAndroid />
|
||||||
</View>
|
</View>
|
||||||
</MaterialDialog>)
|
</MaterialDialog>)
|
||||||
|
}
|
||||||
|
|
||||||
|
renderLoader = () => {
|
||||||
|
return (
|
||||||
|
<ProgressDialog
|
||||||
|
visible={this.props.loading}
|
||||||
|
title={I18n.t('LOADING')}
|
||||||
|
message={I18n.t('LOADING_INFO')}
|
||||||
|
/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
renderDateNaissancePicker = () => {
|
renderDateNaissancePicker = () => {
|
||||||
|
|
@ -275,7 +393,7 @@ export default class CreateIdentification extends Component {
|
||||||
testID="dateTimePicker"
|
testID="dateTimePicker"
|
||||||
timeZoneOffsetInMinutes={0}
|
timeZoneOffsetInMinutes={0}
|
||||||
is24Hour={true}
|
is24Hour={true}
|
||||||
value={this.state.dateNaissance}
|
value={this.state.dateNaissance === null ? new Date() : this.state.dateNaissance}
|
||||||
mode='date'
|
mode='date'
|
||||||
maximumDate={new Date()}
|
maximumDate={new Date()}
|
||||||
display="spinner"
|
display="spinner"
|
||||||
|
|
@ -290,7 +408,7 @@ export default class CreateIdentification extends Component {
|
||||||
testID="dateTimePicker"
|
testID="dateTimePicker"
|
||||||
timeZoneOffsetInMinutes={0}
|
timeZoneOffsetInMinutes={0}
|
||||||
is24Hour={true}
|
is24Hour={true}
|
||||||
value={this.state.dateExpiration}
|
value={this.state.dateExpiration === null ? new Date() : this.state.dateExpiration}
|
||||||
mode='date'
|
mode='date'
|
||||||
maximumDate={new Date(2300, 10, 20)}
|
maximumDate={new Date(2300, 10, 20)}
|
||||||
display="spinner"
|
display="spinner"
|
||||||
|
|
@ -307,23 +425,36 @@ export default class CreateIdentification extends Component {
|
||||||
{this.state.showPickerDateNaissance && this.renderDateNaissancePicker()}
|
{this.state.showPickerDateNaissance && this.renderDateNaissancePicker()}
|
||||||
{this.state.showPickerDateExpiration && this.renderDateExpirationPicker()}
|
{this.state.showPickerDateExpiration && this.renderDateExpirationPicker()}
|
||||||
{this.state.modalVisible && this.renderLoaderModal()}
|
{this.state.modalVisible && this.renderLoaderModal()}
|
||||||
|
{this.props.loading && this.renderLoader()}
|
||||||
|
{this.state.triggerSubmitClick && this.renderCreateIdentificationResponse()}
|
||||||
<ScrollView style={styles.container}>
|
<ScrollView style={styles.container}>
|
||||||
<Text style={styles.subbigtitle}>{I18n.t('CREATE_IDENTIFICATION_TITLE')}</Text>
|
<Text style={styles.subbigtitle}>{I18n.t('CREATE_IDENTIFICATION_TITLE')}</Text>
|
||||||
<Animatable.View ref={(comp) => { this.nameanim = comp }}>
|
<Animatable.View ref={(comp) => { this.lastnameAnim = comp }}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
||||||
label={`${I18n.t('NAME')} ${I18n.t('AND')} ${I18n.t('FIRSTNAME')}`}
|
label={`${I18n.t('NAME')} ${I18n.t('AND')} ${I18n.t('FIRSTNAME')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
onChangeText={(text) => {
|
onChangeText={(lastname) => {
|
||||||
let use = this.state.user;
|
this.setState({ lastname })
|
||||||
use.lastname = text;
|
|
||||||
this.setState({ user: use })
|
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
<Animatable.View ref={(comp) => { this.surnameanim = comp }}>
|
<Animatable.View ref={(comp) => { this.numeroTelephoneAnim = comp }}>
|
||||||
|
<Fumi iconClass={FontAwesomeIcon} iconName={'phone'}
|
||||||
|
label={I18n.t('PHONE')}
|
||||||
|
iconColor={'#f95a25'}
|
||||||
|
value={this.state.numeroTelephone === null ? this.state.indicatif : this.state.numeroTelephone}
|
||||||
|
iconSize={20}
|
||||||
|
onChangeText={(numeroTelephone) => {
|
||||||
|
this.setState({ numeroTelephone })
|
||||||
|
}}
|
||||||
|
style={styles.input}
|
||||||
|
>
|
||||||
|
</Fumi>
|
||||||
|
</Animatable.View>
|
||||||
|
<Animatable.View ref={(comp) => { this.datenaissanceAnim = comp }}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar'}
|
||||||
label={I18n.t('DATE_NAISSANCE')}
|
label={I18n.t('DATE_NAISSANCE')}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
|
@ -336,7 +467,7 @@ export default class CreateIdentification extends Component {
|
||||||
{...this.dateNaissanceFumiProps}>
|
{...this.dateNaissanceFumiProps}>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
<View
|
<Animatable.View ref={(comp) => { this.countryAnim = comp }}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
|
@ -359,8 +490,8 @@ export default class CreateIdentification extends Component {
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return value.name }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return value.name }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</Animatable.View>
|
||||||
<View
|
<Animatable.View ref={(comp) => { this.townAnim = comp }}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
|
@ -383,8 +514,8 @@ export default class CreateIdentification extends Component {
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return value.name }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return value.name }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</Animatable.View>
|
||||||
<View
|
<Animatable.View ref={(comp) => { this.identityPiecesAnim = comp }}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
|
@ -406,8 +537,8 @@ export default class CreateIdentification extends Component {
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return value.name }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return value.name }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</Animatable.View>
|
||||||
<Animatable.View ref={(comp) => { this.nameanim = comp }}>
|
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
||||||
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
|
@ -419,7 +550,7 @@ export default class CreateIdentification extends Component {
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
<Animatable.View ref={(comp) => { this.surnameanim = comp }}>
|
<Animatable.View ref={(comp) => { this.identityDateExpiryAnim = comp }}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar-times-o'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar-times-o'}
|
||||||
label={I18n.t('IDENTITY_PIECE_EXPIRY_DATE')}
|
label={I18n.t('IDENTITY_PIECE_EXPIRY_DATE')}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
|
@ -436,7 +567,7 @@ export default class CreateIdentification extends Component {
|
||||||
<Button style={styles.btnvalide}
|
<Button style={styles.btnvalide}
|
||||||
textStyle={styles.textbtnvalide}
|
textStyle={styles.textbtnvalide}
|
||||||
isLoading={this.state.isLoging}
|
isLoading={this.state.isLoging}
|
||||||
onPress={() => { }}>
|
onPress={() => { this.onSubmitIdentityClient() }}>
|
||||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
@ -445,6 +576,19 @@ export default class CreateIdentification extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const maptStateToProps = state => ({
|
||||||
|
loading: state.createIdentificationReducer.loading,
|
||||||
|
result: state.createIdentificationReducer.result,
|
||||||
|
error: state.createIdentificationReducer.error,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
createIndentificationAction,
|
||||||
|
createIndentificationResetAction
|
||||||
|
}, dispatch);
|
||||||
|
|
||||||
|
export default connect(maptStateToProps, mapDispatchToProps)(CreateIdentification);
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
|
|
||||||
|
|
@ -274,6 +274,7 @@ export default class CreateUserStep2 extends Component {
|
||||||
Geolocation.watchPosition((position) => { this.treatPosition(position) }, (e) => { this.showErrorDialog() }, this.props.geolocationOptions)
|
Geolocation.watchPosition((position) => { this.treatPosition(position) }, (e) => { this.showErrorDialog() }, this.props.geolocationOptions)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
treatPosition(position) {
|
treatPosition(position) {
|
||||||
const myLastPosition = this.state.myPosition;
|
const myLastPosition = this.state.myPosition;
|
||||||
const myPosition = position.coords;
|
const myPosition = position.coords;
|
||||||
|
|
|
||||||
|
|
@ -198,12 +198,12 @@ export const optionIdentificationScreen = {
|
||||||
{
|
{
|
||||||
screen: route.createIdentification,
|
screen: route.createIdentification,
|
||||||
icon: 'pencil-plus',
|
icon: 'pencil-plus',
|
||||||
title: I18n.t('CREATION_IDENTIFICATION_DESCRIPTION'),
|
title: I18n.t('CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.validateIdentification,
|
screen: route.validateIdentification,
|
||||||
icon: 'check-circle',
|
icon: 'check-circle',
|
||||||
title: I18n.t('VALIDATE_IDENTIFICATION'),
|
title: I18n.t('VALIDATE_IDENTIFICATION_DESCRIPTION'),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -294,6 +294,7 @@
|
||||||
"IDENTIFICATION": " Identification",
|
"IDENTIFICATION": " Identification",
|
||||||
"CREATION_IDENTIFICATION": "Creation",
|
"CREATION_IDENTIFICATION": "Creation",
|
||||||
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
|
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
|
||||||
|
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a client",
|
||||||
"VALIDATE_IDENTIFICATION": "Validation",
|
"VALIDATE_IDENTIFICATION": "Validation",
|
||||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
||||||
"CREATE_IDENTIFICATION_TITLE": "Please fill in customer information",
|
"CREATE_IDENTIFICATION_TITLE": "Please fill in customer information",
|
||||||
|
|
|
||||||
|
|
@ -298,8 +298,9 @@
|
||||||
"CREATION_IDENTIFICATION": "Création",
|
"CREATION_IDENTIFICATION": "Création",
|
||||||
"CREATION_IDENTIFICATION_CLIENT": "M'identifier",
|
"CREATION_IDENTIFICATION_CLIENT": "M'identifier",
|
||||||
"CREATION_IDENTIFICATION_DESCRIPTION": "Identifier un client",
|
"CREATION_IDENTIFICATION_DESCRIPTION": "Identifier un client",
|
||||||
|
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Saisir l'identité d'un client",
|
||||||
"VALIDATE_IDENTIFICATION": "Validation",
|
"VALIDATE_IDENTIFICATION": "Validation",
|
||||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Valider une identification",
|
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Valider une identité client",
|
||||||
"CREATE_IDENTIFICATION_TITLE": "Veuillez renseigner les informations du client",
|
"CREATE_IDENTIFICATION_TITLE": "Veuillez renseigner les informations du client",
|
||||||
"DATE_NAISSANCE": "Date de naissance",
|
"DATE_NAISSANCE": "Date de naissance",
|
||||||
"REGISTER_YOURSELF": "Enregistrez-vous",
|
"REGISTER_YOURSELF": "Enregistrez-vous",
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ const getAuthApiKey = (phone) => {
|
||||||
dispatch(fetchAuthKeySuccess(response));
|
dispatch(fetchAuthKeySuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
dispatch(fetchAuthKeyError(error.message));
|
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchAuthKeyError(error.response));
|
dispatch(fetchAuthKeyError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@ export const treatCancelDemand = (idDemand) => {
|
||||||
dispatch(fetchTreatCreditCancelSucsess(response));
|
dispatch(fetchTreatCreditCancelSucsess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error);
|
|
||||||
dispatch(fetchTreatCreditCancelError(error.message));
|
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchTreatCreditCancelError(error.response));
|
dispatch(fetchTreatCreditCancelError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@ export const treatCreditDemand = (idDemand, montant) => {
|
||||||
dispatch(fetchTreatCreditDemandSucsess(response));
|
dispatch(fetchTreatCreditDemandSucsess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error);
|
|
||||||
dispatch(fetchTreatCreditDemandError(error.message));
|
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchTreatCreditDemandError(error.response));
|
dispatch(fetchTreatCreditDemandError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,6 @@ export const depositAction = (data) => {
|
||||||
dispatch(fetchDepositSuccess(response));
|
dispatch(fetchDepositSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log('DEPOSIT ACTION', error);
|
|
||||||
dispatch(fetchDepositError(error.message));
|
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchDepositError(error.response));
|
dispatch(fetchDepositError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
import { createIdentificationUrl } from "./IlinkConstants";
|
||||||
|
import { store } from "../redux/store";
|
||||||
|
import axios from "axios";
|
||||||
|
import I18n from 'react-native-i18n'
|
||||||
|
import { fetchCreateIdentificationReset, fetchCreateIdentificationSuccess, fetchCreateIdentificationError, fetchCreateIdentificationPending } from "../redux/actions/IdentificationAction";
|
||||||
|
|
||||||
|
export const createIndentificationAction = (data) => {
|
||||||
|
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchCreateIdentificationPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${createIdentificationUrl}`,
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
},
|
||||||
|
data
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchCreateIdentificationSuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.log(error);
|
||||||
|
//dispatch(fetchCreateIdentificationError(error.message));
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchCreateIdentificationError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchCreateIdentificationError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchCreateIdentificationError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const createIndentificationResetAction = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchCreateIdentificationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -32,6 +32,7 @@ export const creditCancelDemand = testBaseUrl + '/walletService/credits/cancelDe
|
||||||
export const commissionAmount = testBaseUrl + '/walletService/transactions/commission';
|
export const commissionAmount = testBaseUrl + '/walletService/transactions/commission';
|
||||||
export const transactionUrl = testBaseUrl + '/walletService/transactions';
|
export const transactionUrl = testBaseUrl + '/walletService/transactions';
|
||||||
export const transferCommission = testBaseUrl + '/walletService/virement';
|
export const transferCommission = testBaseUrl + '/walletService/virement';
|
||||||
|
export const createIdentificationUrl = testBaseUrl + '/walletService/identifications';
|
||||||
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
||||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||||
export const MARKER_URL = baseUrl + "/interacted/LocationAction.php";
|
export const MARKER_URL = baseUrl + "/interacted/LocationAction.php";
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@ export const getWalletActivated = (userID) => {
|
||||||
dispatch(fetchWalletListSuccess(response));
|
dispatch(fetchWalletListSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error);
|
|
||||||
dispatch(fetchWalletListError(error.message));
|
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchWalletListError(error.response));
|
dispatch(fetchWalletListError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
|
|
@ -73,8 +71,6 @@ export const getWalletDetailActivated = (id, isAgentCall) => {
|
||||||
dispatch(fetchWalletListDetailSuccess(response));
|
dispatch(fetchWalletListDetailSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log("ERROR", error);
|
|
||||||
dispatch(fetchWalletListDetailError(error.message));
|
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchWalletListDetailError(error.response));
|
dispatch(fetchWalletListDetailError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@ export const getWalletTransactionHistory = (walletID) => {
|
||||||
dispatch(fetchWalletHistorySuccess(response));
|
dispatch(fetchWalletHistorySuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error);
|
|
||||||
dispatch(fetchWalletHistoryError(error.message));
|
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchWalletHistoryError(error.response));
|
dispatch(fetchWalletHistoryError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@ export const transferCommissionAction = (walletID) => {
|
||||||
dispatch(fetchWalletTransferCommissionSuccess(response));
|
dispatch(fetchWalletTransferCommissionSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error);
|
|
||||||
dispatch(fetchWalletTransferCommssionError(error.message));
|
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchWalletTransferCommssionError(error.response));
|
dispatch(fetchWalletTransferCommssionError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue