Correction de bugs
This commit is contained in:
parent
210d09c49f
commit
5bfad5f025
|
@ -1,9 +1,28 @@
|
|||
import {
|
||||
ENVOIE_WALLET_TO_WALLET_USER_PENDING, ENVOIE_WALLET_TO_WALLET_USER_SUCCESS, ENVOIE_WALLET_TO_WALLET_USER_ERROR, ENVOIE_WALLET_TO_WALLET_USER_RESET, ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_ERROR,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_PENDING, ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_SUCCESS, ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_RESET, ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING, ENVOIE_WALLET_TO_CASH_USER_SUCCESS, ENVOIE_WALLET_TO_CASH_USER_ERROR, ENVOIE_WALLET_TO_CASH_USER_RESET,
|
||||
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_SUCCESS, ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_ERROR, ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_RESET,
|
||||
ENVOIE_WALLET_TO_CARD_USER_PENDING, ENVOIE_WALLET_TO_CARD_USER_SUCCESS, ENVOIE_WALLET_TO_CARD_USER_ERROR, ENVOIE_WALLET_TO_CARD_USER_RESET,
|
||||
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING, ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS, ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR, ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET
|
||||
ENVOIE_WALLET_TO_CARD_USER_ERROR,
|
||||
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR,
|
||||
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING,
|
||||
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET,
|
||||
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS,
|
||||
ENVOIE_WALLET_TO_CARD_USER_PENDING,
|
||||
ENVOIE_WALLET_TO_CARD_USER_RESET,
|
||||
ENVOIE_WALLET_TO_CARD_USER_SUCCESS,
|
||||
ENVOIE_WALLET_TO_CASH_USER_ERROR,
|
||||
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_ERROR,
|
||||
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING,
|
||||
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_RESET,
|
||||
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_SUCCESS,
|
||||
ENVOIE_WALLET_TO_CASH_USER_PENDING,
|
||||
ENVOIE_WALLET_TO_CASH_USER_RESET,
|
||||
ENVOIE_WALLET_TO_CASH_USER_SUCCESS,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_ERROR,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_ERROR,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_PENDING,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_RESET,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_SUCCESS,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_PENDING,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_RESET,
|
||||
ENVOIE_WALLET_TO_WALLET_USER_SUCCESS
|
||||
} from "../types/EnvoieUserType";
|
||||
|
||||
export const fetchEnvoieUserWalletToWalletPending = () => ({
|
||||
|
@ -47,7 +66,7 @@ export const fetchEnvoieUserWalletToWalleGetCommissiontReset = (error) => ({
|
|||
/*--------------------------------------------------------------------*/
|
||||
|
||||
export const fetchEnvoieUserWalletToCashPending = () => ({
|
||||
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING
|
||||
type: ENVOIE_WALLET_TO_CASH_USER_PENDING
|
||||
});
|
||||
|
||||
export const fetchEnvoieUserWalletToCashSuccess = (res) => ({
|
||||
|
@ -60,7 +79,7 @@ export const fetchEnvoieUserWalletToCashError = (error) => ({
|
|||
result: error
|
||||
});
|
||||
|
||||
export const fetchEnvoieUserWalletToCashReset = (error) => ({
|
||||
export const fetchEnvoieUserWalletToCashReset = () => ({
|
||||
type: ENVOIE_WALLET_TO_CASH_USER_RESET
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
import { ENVOIE_WALLET_TO_CASH_USER_PENDING, ENVOIE_WALLET_TO_CASH_USER_SUCCESS, ENVOIE_WALLET_TO_CASH_USER_ERROR } from "../types/EnvoieUserType";
|
||||
import {
|
||||
ENVOIE_WALLET_TO_CASH_USER_ERROR,
|
||||
ENVOIE_WALLET_TO_CASH_USER_PENDING,
|
||||
ENVOIE_WALLET_TO_CASH_USER_RESET,
|
||||
ENVOIE_WALLET_TO_CASH_USER_SUCCESS
|
||||
} from "../types/EnvoieUserType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
|
@ -8,23 +13,27 @@ const initialState = {
|
|||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case ENVOIE_WALLET_TO_CASH_USER_PENDING: return {
|
||||
case ENVOIE_WALLET_TO_CASH_USER_PENDING:
|
||||
return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case ENVOIE_WALLET_TO_CASH_USER_SUCCESS: return {
|
||||
case ENVOIE_WALLET_TO_CASH_USER_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case ENVOIE_WALLET_TO_CASH_USER_ERROR: return {
|
||||
case ENVOIE_WALLET_TO_CASH_USER_ERROR:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case ENVOIE_WALLET_TO_CASH_USER_PENDING: return initialState;
|
||||
case ENVOIE_WALLET_TO_CASH_USER_RESET:
|
||||
return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
import React,{Component} from 'react';
|
||||
import {StyleSheet,View,Text,Image,StatusBar,ScrollView,Alert} from 'react-native';
|
||||
let theme=require('./../../utils/theme.json');
|
||||
import {readUser,updatePosition,updateUserData} from './../../webservice/AuthApi';
|
||||
import {getAgentNetworksList} from './../../webservice/NetworkApi'
|
||||
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||
import MapView,{Marker} from 'react-native-maps';
|
||||
import React, {Component} from 'react';
|
||||
import {Alert, View} from 'react-native';
|
||||
import {readUser, updatePosition, updateUserData} from './../../webservice/AuthApi';
|
||||
import {responsiveHeight} from 'react-native-responsive-dimensions';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5'
|
||||
import Button from 'apsl-react-native-button'
|
||||
import CardView from "react-native-cardview";
|
||||
const route=require('./../../route.json')
|
||||
import I18n from 'react-native-i18n'
|
||||
import {Header} from "react-native-elements";
|
||||
import {IlinkEmitter} from "../../utils/events";
|
||||
import Geolocation from 'react-native-geolocation-service';
|
||||
|
||||
let theme = require('./../../utils/theme.json');
|
||||
|
||||
const route = require('./../../route.json')
|
||||
|
||||
require('./../../utils/Translations')
|
||||
|
||||
const height=responsiveHeight(100)-250;
|
||||
const height = responsiveHeight(100) - 250;
|
||||
export default class UpdateInformations extends Component {
|
||||
static navigatorStyle = {
|
||||
navBarHidden: false,
|
||||
|
@ -25,101 +25,114 @@ export default class UpdateInformations extends Component {
|
|||
statusBarColor: theme.primaryDarkAdvanced,
|
||||
statusBarTextColorScheme: 'light',
|
||||
};
|
||||
static options(passProps){
|
||||
|
||||
static options(passProps) {
|
||||
return {
|
||||
statusBar:{
|
||||
drawBehind:false
|
||||
statusBar: {
|
||||
drawBehind: false
|
||||
},
|
||||
topBar:{
|
||||
title:{
|
||||
text:"Mise à jour des informations",
|
||||
color:"white"
|
||||
topBar: {
|
||||
title: {
|
||||
text: "Mise à jour des informations",
|
||||
color: "white"
|
||||
},
|
||||
|
||||
background:{
|
||||
color:theme.primaryDark
|
||||
background: {
|
||||
color: theme.primaryDark
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
static navigationOptions = ({navigation})=>{
|
||||
|
||||
static navigationOptions = ({navigation}) => {
|
||||
return {
|
||||
headerTitle: I18n.t('CHANGE_INFORMATION'),
|
||||
drawerIcon: ({ tintColor }) => (
|
||||
drawerIcon: ({tintColor}) => (
|
||||
<Icon
|
||||
name={'user'}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}};
|
||||
constructor(props){
|
||||
}
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
this.state=this.initiateItems()
|
||||
this.state = this.initiateItems()
|
||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||
this.showUserState()
|
||||
}
|
||||
async showUserState(){
|
||||
const user=await readUser()
|
||||
this.setState({user:user})
|
||||
if(user.longitude<=0 && user.latitude<=0){
|
||||
Alert.alert(I18n.t('TITLE_NEED_POSITION'),I18n.t('TEXT_NEED_POSITION'),[{text:'Ok'}])
|
||||
|
||||
async showUserState() {
|
||||
const user = await readUser()
|
||||
this.setState({user: user})
|
||||
if (user.longitude <= 0 && user.latitude <= 0) {
|
||||
Alert.alert(I18n.t('TITLE_NEED_POSITION'), I18n.t('TEXT_NEED_POSITION'), [{text: 'Ok'}])
|
||||
}
|
||||
}
|
||||
|
||||
updateLangue(){
|
||||
this.props.navigation.setParams({name:I18n.t('CHANGE_INFORMATION')})
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({name: I18n.t('CHANGE_INFORMATION')})
|
||||
this.forceUpdate()
|
||||
}
|
||||
render(){
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={{flex:1,backgroundColor:theme.primary}}>
|
||||
<View style={{flex: 1, backgroundColor: theme.primary}}>
|
||||
<Button
|
||||
isLoading={this.state.positionEnabled}
|
||||
style={{backgroundColor:theme.primaryDark,
|
||||
marginTop:responsiveHeight(5),
|
||||
height:responsiveHeight(7),
|
||||
marginRight:10,
|
||||
marginLeft:10,
|
||||
borderColor:'transparent'
|
||||
}} textStyle={{color:"white",fontSize:20,fontWeight:'bold'}} onPress={()=>this.onClickUpdatePosition()}>{I18n.t('UPDATE_POSITION_TEXT')}</Button>
|
||||
style={{
|
||||
backgroundColor: theme.primaryDark,
|
||||
marginTop: responsiveHeight(5),
|
||||
height: responsiveHeight(7),
|
||||
marginRight: 10,
|
||||
marginLeft: 10,
|
||||
borderColor: 'transparent'
|
||||
}} textStyle={{color: "white", fontSize: 20, fontWeight: 'bold'}}
|
||||
onPress={() => this.onClickUpdatePosition()}>{I18n.t('UPDATE_POSITION_TEXT')}</Button>
|
||||
</View>);
|
||||
}
|
||||
|
||||
initiateItems() {
|
||||
return{
|
||||
positionEnabled:false,
|
||||
return {
|
||||
positionEnabled: false,
|
||||
}
|
||||
}
|
||||
|
||||
onClickUpdatePosition() {
|
||||
this.setState({positionEnabled:true})
|
||||
navigator.geolocation.getCurrentPosition((position) => {
|
||||
this.setState({positionEnabled: true})
|
||||
Geolocation.getCurrentPosition((position) => {
|
||||
const myPosition = position.coords;
|
||||
updatePosition(myPosition.longitude,myPosition.latitude).then((response)=> {
|
||||
var title='';
|
||||
var message='';
|
||||
this.setState({positionEnabled:false})
|
||||
updatePosition(myPosition.longitude, myPosition.latitude).then((response) => {
|
||||
var title = '';
|
||||
var message = '';
|
||||
this.setState({positionEnabled: false})
|
||||
console.log(response.error)
|
||||
if(response.error===undefined){
|
||||
updateUserData({longitude:myPosition.longitude,latitude:myPosition.latitude})
|
||||
message=I18n.t('POSITION_UPDATE_SUCCESS_TEXT')
|
||||
title=I18n.t('UPDATE_SUCCESS');
|
||||
}else{
|
||||
title=I18n.t("TITLE_UPDATE_POSITION_FAILED")
|
||||
switch (response.error){
|
||||
case -3:message=I18n.t('TEXT_UDATE_POSITION_FAILED_1');break
|
||||
case -2:message=I18n.t('TEXT_UDATE_POSITION_FAILED_2');
|
||||
if (response.error === undefined) {
|
||||
updateUserData({longitude: myPosition.longitude, latitude: myPosition.latitude})
|
||||
message = I18n.t('POSITION_UPDATE_SUCCESS_TEXT')
|
||||
title = I18n.t('UPDATE_SUCCESS');
|
||||
} else {
|
||||
title = I18n.t("TITLE_UPDATE_POSITION_FAILED")
|
||||
switch (response.error) {
|
||||
case -3:
|
||||
message = I18n.t('TEXT_UDATE_POSITION_FAILED_1');
|
||||
break
|
||||
case -2:
|
||||
message = I18n.t('TEXT_UDATE_POSITION_FAILED_2');
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
Alert.alert(title,message,[{text:"Ok",onPress:()=>{
|
||||
Alert.alert(title, message, [{
|
||||
text: "Ok", onPress: () => {
|
||||
this.props.navigation.popToTop()
|
||||
}}])
|
||||
}).catch((e)=>{
|
||||
this.setState({positionEnabled:false})
|
||||
}
|
||||
}])
|
||||
}).catch((e) => {
|
||||
this.setState({positionEnabled: false})
|
||||
})
|
||||
}, null, this.props.geolocationOptions);
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import {accent, primary, primaryDark, purpleLight} from './../../utils/theme.jso
|
|||
import {PagerTabIndicator} from 'react-native-best-viewpager'
|
||||
import IconWithBadge from "../IconWithBadge";
|
||||
import {Appbar, Divider, Menu, Provider} from 'react-native-paper';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
|
||||
var moment = require('moment-timezone');
|
||||
const momentJS = require('moment');
|
||||
|
@ -322,11 +321,11 @@ class MyHistory extends React.Component {
|
|||
<Button onPress={this._openMenu}>Show menu</Button>
|
||||
}
|
||||
>
|
||||
<Menu.Item onPress={() => {
|
||||
{/* <Menu.Item onPress={() => {
|
||||
this.setState({isSectionned: !this.state.isSectionned})
|
||||
this._closeMenu()
|
||||
}}
|
||||
title="Section"/>
|
||||
title="Section"/>*/}
|
||||
<Divider/>
|
||||
<Menu.Item onPress={() => {
|
||||
|
||||
|
|
|
@ -2,28 +2,45 @@ import DateTimePicker from '@react-native-community/datetimepicker';
|
|||
import Button from 'apsl-react-native-button';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
import React, { Component } from 'react';
|
||||
import { Alert, Keyboard, PermissionsAndroid, Platform, ProgressBarAndroid, ScrollView, StyleSheet, Text, View } from 'react-native';
|
||||
import React, {Component} from 'react';
|
||||
import {
|
||||
Alert,
|
||||
Keyboard,
|
||||
PermissionsAndroid,
|
||||
Platform,
|
||||
ProgressBarAndroid,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View
|
||||
} from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import Geolocation from 'react-native-geolocation-service';
|
||||
import I18n from 'react-native-i18n';
|
||||
import { MaterialDialog } from "react-native-material-dialog";
|
||||
import { Dropdown } from 'react-native-material-dropdown';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import {MaterialDialog} from "react-native-material-dialog";
|
||||
import {Dropdown} from 'react-native-material-dropdown';
|
||||
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||
import {Fumi} from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { Color } from '../../config/Color';
|
||||
import { store } from '../../redux/store';
|
||||
import { identityPieces } from '../../utils/UtilsFunction';
|
||||
import { createIndentificationResetAction, getNumberDetailAction, getNumberResetAction, getUserIdentificationAction, updateIndentificationAction } from '../../webservice/IdentificationApi';
|
||||
import { getListCountriesActive, getTownInformationName, readUser } from './../../webservice/AuthApi';
|
||||
import { getPositionInformation } from './../../webservice/MapService';
|
||||
import {connect} from 'react-redux';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import {Color} from '../../config/Color';
|
||||
import {store} from '../../redux/store';
|
||||
import {identityPieces} from '../../utils/UtilsFunction';
|
||||
import {
|
||||
createIndentificationResetAction,
|
||||
getNumberDetailAction,
|
||||
getNumberResetAction,
|
||||
getUserIdentificationAction,
|
||||
updateIndentificationAction
|
||||
} from '../../webservice/IdentificationApi';
|
||||
import {getListCountriesActive, getTownInformationName, readUser} from './../../webservice/AuthApi';
|
||||
import {getPositionInformation} from './../../webservice/MapService';
|
||||
|
||||
let theme = require('./../../utils/theme.json');
|
||||
let route = require('./../../route.json');
|
||||
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');
|
||||
|
||||
class ModifyIdentificationUser extends Component {
|
||||
|
@ -93,8 +110,8 @@ class ModifyIdentificationUser extends Component {
|
|||
|
||||
componentDidMount() {
|
||||
|
||||
this.dateNaissanceFumiProps.value = moment(this.state.userIdentificationData.birth_date).format('DD-MM-YYYY');
|
||||
this.dateExpirationFumiProps.value = moment(this.state.userIdentificationData.expiry_date_document).format('DD-MM-YYYY');
|
||||
this.dateNaissanceFumiProps.value = this.state.userIdentificationData !== null ? moment(this.state.userIdentificationData.birth_date).format('DD-MM-YYYY') : "";
|
||||
this.dateExpirationFumiProps.value = this.state.userIdentificationData !== null ? moment(this.state.userIdentificationData.expiry_date_document).format('DD-MM-YYYY') : "";
|
||||
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
|
@ -118,7 +135,7 @@ class ModifyIdentificationUser extends Component {
|
|||
}
|
||||
|
||||
renderCreateIdentificationResponse() {
|
||||
const { result, error } = this.props;
|
||||
const {result, error} = this.props;
|
||||
|
||||
console.log("PROPS", this.props);
|
||||
|
||||
|
@ -132,13 +149,13 @@ class ModifyIdentificationUser extends Component {
|
|||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getUserIdentificationAction(this.state.user.phone);
|
||||
this.props.createIndentificationResetAction();
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
this.setState({triggerSubmitClick: false});
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -152,12 +169,12 @@ class ModifyIdentificationUser extends Component {
|
|||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.createIndentificationResetAction();
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
this.setState({triggerSubmitClick: false});
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
|
@ -171,7 +188,7 @@ class ModifyIdentificationUser extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -192,13 +209,17 @@ class ModifyIdentificationUser extends Component {
|
|||
}
|
||||
|
||||
showErrorDialog() {
|
||||
this.setState({ modalDialog: false })
|
||||
this.setState({modalDialog: false})
|
||||
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
||||
"et que vous êtes connecté à internet puis ressayer", [{
|
||||
text: "Recommencer", onPress: () => {
|
||||
this.watchLocation()
|
||||
}
|
||||
}, { text: "Annuler", onPress: () => { this.props.navigation.popToTop() } }])
|
||||
}, {
|
||||
text: "Annuler", onPress: () => {
|
||||
this.props.navigation.popToTop()
|
||||
}
|
||||
}])
|
||||
}
|
||||
|
||||
async watchLocation() {
|
||||
|
@ -208,7 +229,11 @@ class ModifyIdentificationUser extends Component {
|
|||
this.showErrorDialog()
|
||||
}, this.props.geolocationOptions);
|
||||
if (!this.watchID) {
|
||||
Geolocation.watchPosition((position) => { this.treatPosition(position) }, (e) => { this.showErrorDialog() }, this.props.geolocationOptions)
|
||||
Geolocation.watchPosition((position) => {
|
||||
this.treatPosition(position)
|
||||
}, (e) => {
|
||||
this.showErrorDialog()
|
||||
}, this.props.geolocationOptions)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,7 +250,7 @@ class ModifyIdentificationUser extends Component {
|
|||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
||||
this.watchLocation();
|
||||
} else {
|
||||
this.setState({ modalDialog: false })
|
||||
this.setState({modalDialog: false})
|
||||
Alert.alert("Echec à l'autorisation",
|
||||
"L'application n'est pas autorisé à acceder à votre position veuillez verifier que votre GPS est activé et configurer en mode Haute Precision",
|
||||
[{
|
||||
|
@ -235,7 +260,7 @@ class ModifyIdentificationUser extends Component {
|
|||
}])
|
||||
}
|
||||
} catch (err) {
|
||||
this.setState({ modalDialog: false })
|
||||
this.setState({modalDialog: false})
|
||||
Alert.alert("Une erreur est Survenue",
|
||||
"Une erreur est survenu lors du demarrage de l'application veuillez relancer l'application",
|
||||
[{
|
||||
|
@ -255,8 +280,8 @@ class ModifyIdentificationUser extends Component {
|
|||
if (response.results !== undefined) {
|
||||
if (response.results.length > 0) {
|
||||
let most = response.results[0]
|
||||
let { address_components, formatted_address, place_id } = most
|
||||
this.setState({ address: address_components, textadress: formatted_address, place: place_id })
|
||||
let {address_components, formatted_address, place_id} = most
|
||||
this.setState({address: address_components, textadress: formatted_address, place: place_id})
|
||||
|
||||
let results = response.results;
|
||||
let shortcountry;
|
||||
|
@ -266,10 +291,10 @@ class ModifyIdentificationUser extends Component {
|
|||
if (results[0].address_components[i].types[j] === "country") {
|
||||
mcountry = results[0].address_components[i];
|
||||
shortcountry = mcountry.short_name;
|
||||
this.setState({ shortCountry: mcountry.short_name, longCountry: mcountry.long_name })
|
||||
this.setState({shortCountry: mcountry.short_name, longCountry: mcountry.long_name})
|
||||
} else if (results[0].address_components[i].types[j] === "locality") {
|
||||
const name = results[0].address_components[i].short_name;
|
||||
this.setState({ townName: name });
|
||||
this.setState({townName: name});
|
||||
getTownInformationName(name).then((result) => {
|
||||
let town = null;
|
||||
if (result instanceof Array) {
|
||||
|
@ -278,24 +303,24 @@ class ModifyIdentificationUser extends Component {
|
|||
town = result;
|
||||
}
|
||||
|
||||
this.setState({ modalVisible: false, town: new Array(town) });
|
||||
this.setState({modalVisible: false, town: new Array(town)});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
getListCountriesActive().then((cnt) => {
|
||||
this.setState({ countries: cnt })
|
||||
this.setState({countries: cnt})
|
||||
console.debug(cnt, shortcountry);
|
||||
var found = false
|
||||
for (let i of cnt) {
|
||||
if (i.code_country === shortcountry) {
|
||||
found = true;
|
||||
this.setState({ modalVisible: false, indicatif: i.code_dial, country: i.name })
|
||||
this.setState({modalVisible: false, indicatif: i.code_dial, country: i.name})
|
||||
/* this.getNetworks(i.code_dial); */
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{ text: "OK" }]);
|
||||
Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{text: "OK"}]);
|
||||
|
||||
}
|
||||
})
|
||||
|
@ -307,7 +332,7 @@ class ModifyIdentificationUser extends Component {
|
|||
}).catch((e) => {
|
||||
this.showErrorDialog()
|
||||
});
|
||||
this.setState({ myPosition: myPosition });
|
||||
this.setState({myPosition: myPosition});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -335,7 +360,7 @@ class ModifyIdentificationUser extends Component {
|
|||
}
|
||||
|
||||
onSubmitIdentityClient = () => {
|
||||
const { lastname, numeroIdentite, dateNaissance, dateExpiration, country, townName, identityPiecesName } = this.state;
|
||||
const {lastname, numeroIdentite, dateNaissance, dateExpiration, country, townName, identityPiecesName} = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(lastname))
|
||||
this.lastnameAnim.shake(800);
|
||||
|
@ -377,9 +402,9 @@ class ModifyIdentificationUser extends Component {
|
|||
<MaterialDialog
|
||||
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>
|
||||
<ProgressBarAndroid />
|
||||
<ProgressBarAndroid/>
|
||||
</View>
|
||||
</MaterialDialog>)
|
||||
}
|
||||
|
@ -426,7 +451,7 @@ class ModifyIdentificationUser extends Component {
|
|||
|
||||
render() {
|
||||
console.log("STATE", this.state);
|
||||
const { showPickerDateNaissance } = this.state;
|
||||
const {showPickerDateNaissance} = this.state;
|
||||
return (
|
||||
<>
|
||||
{this.state.showPickerDateNaissance && this.renderDateNaissancePicker()}
|
||||
|
@ -436,21 +461,25 @@ class ModifyIdentificationUser extends Component {
|
|||
{this.state.triggerSubmitClick && this.renderCreateIdentificationResponse()}
|
||||
<ScrollView style={styles.container}>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.lastnameAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.lastnameAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
||||
label={`${I18n.t('NAME')} ${I18n.t('AND')} ${I18n.t('FIRSTNAME')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.lastname}
|
||||
onChangeText={(lastname) => {
|
||||
this.setState({ lastname })
|
||||
this.setState({lastname})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.datenaissanceAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.datenaissanceAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar'}
|
||||
label={I18n.t('DATE_NAISSANCE')}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -458,13 +487,15 @@ class ModifyIdentificationUser extends Component {
|
|||
style={styles.input}
|
||||
onFocus={() => {
|
||||
Keyboard.dismiss();
|
||||
this.setState({ showPickerDateNaissance: true })
|
||||
this.setState({showPickerDateNaissance: true})
|
||||
}}
|
||||
{...this.dateNaissanceFumiProps}>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.countryAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.countryAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -482,14 +513,20 @@ class ModifyIdentificationUser extends Component {
|
|||
value={this.state.country === null ? "" :
|
||||
this.state.country}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ country: value });
|
||||
this.setState({country: value});
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.townAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.townAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -507,14 +544,20 @@ class ModifyIdentificationUser extends Component {
|
|||
value={this.state.townName === null ? "" :
|
||||
this.state.townName}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ townName: value });
|
||||
this.setState({townName: value});
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.identityPiecesAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.identityPiecesAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -531,26 +574,34 @@ class ModifyIdentificationUser extends Component {
|
|||
useNativeDriver={true}
|
||||
value={this.state.identityPiecesName}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ identityPiecesName: value });
|
||||
this.setState({identityPiecesName: value});
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return I18n.t(value.name)
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return I18n.t(value.name)
|
||||
}}
|
||||
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.numeroIdentiteAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
||||
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.numeroIdentite}
|
||||
onChangeText={(numeroIdentite) => {
|
||||
this.setState({ numeroIdentite })
|
||||
this.setState({numeroIdentite})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
<Animatable.View ref={(comp) => { this.identityDateExpiryAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.identityDateExpiryAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar-times-o'}
|
||||
label={I18n.t('IDENTITY_PIECE_EXPIRY_DATE')}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -558,7 +609,7 @@ class ModifyIdentificationUser extends Component {
|
|||
style={styles.input}
|
||||
onFocus={() => {
|
||||
Keyboard.dismiss();
|
||||
this.setState({ showPickerDateExpiration: true })
|
||||
this.setState({showPickerDateExpiration: true})
|
||||
}}
|
||||
{...this.dateExpirationFumiProps}>
|
||||
</Fumi>
|
||||
|
@ -567,7 +618,9 @@ class ModifyIdentificationUser extends Component {
|
|||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
isLoading={this.state.isLoging}
|
||||
onPress={() => { this.onSubmitIdentityClient() }}>
|
||||
onPress={() => {
|
||||
this.onSubmitIdentityClient()
|
||||
}}>
|
||||
{I18n.t('MODIFY')}</Button>
|
||||
</ScrollView>
|
||||
</>
|
||||
|
|
|
@ -48,6 +48,7 @@ import {responsiveWidth} from 'react-native-responsive-dimensions';
|
|||
import {getWalletDetailActivated} from "../../webservice/WalletApi";
|
||||
import {getWalletTransactionHistoryUser} from "../../webservice/WalletTransactionHistoryApi";
|
||||
import {getUserIdentificationAction} from "../../webservice/IdentificationApi";
|
||||
import {store} from "../../redux/store";
|
||||
|
||||
const route = require('./../../route.json');
|
||||
let slugify = require('slugify');
|
||||
|
@ -64,7 +65,7 @@ class WalletOptionSelect extends Component {
|
|||
wallet: this.props.navigation.state.params.wallet,
|
||||
lottie: this.props.navigation.state.params.lottie,
|
||||
onGoBack: this.props.navigation.state.params.onGoBack,
|
||||
isIdentified: this.props.navigation.state.params.isIdentified || null,
|
||||
isIdentified: store.getState().getUserIdentificationReducer.result !== null ? store.getState().getUserIdentificationReducer.result.response.isIdentified : false,
|
||||
isNanoCredit: this.props.navigation.state.params.hasOwnProperty('isNanoCredit'),
|
||||
user: null,
|
||||
displayModalHistory: false,
|
||||
|
|
|
@ -1,27 +1,40 @@
|
|||
import Button from 'apsl-react-native-button';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
import React, { Component } from 'react';
|
||||
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
|
||||
import React, {Component} from 'react';
|
||||
import {Alert, ScrollView, StyleSheet, Text, View} from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import I18n from 'react-native-i18n';
|
||||
import Dialog from "react-native-dialog";
|
||||
import { Dropdown } from 'react-native-material-dropdown';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import {Dropdown} from 'react-native-material-dropdown';
|
||||
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||
import {Fumi} from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { Color } from '../../../config/Color';
|
||||
import { store } from "../../../redux/store";
|
||||
import { identityPieces, isIlinkWorldWallet, isNormalInteger, typeIdIDestinataire, thousandsSeparators } from '../../../utils/UtilsFunction';
|
||||
import { readUser } from '../../../webservice/AuthApi';
|
||||
import { getActiveCountryAction, getActiveCountryByDialCodeAction, getActiveCountryByDialCodeReset, getActiveCountryReset, getPayCountryNetworkAction, getPayCountryNetworkReset } from '../../../webservice/CountryApi';
|
||||
import { envoieUserWalletToCashAction, envoieUserWalletToCashReset, getCommissionUserWalletToCashAction, getCommissionUserWalletToCashReset } from '../../../webservice/EnvoieUserApi';
|
||||
import { Typography, FontWeight } from '../../../config/typography';
|
||||
import {connect} from 'react-redux';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import {Color} from '../../../config/Color';
|
||||
import {store} from "../../../redux/store";
|
||||
import {identityPieces, isNormalInteger} from '../../../utils/UtilsFunction';
|
||||
import {readUser} from '../../../webservice/AuthApi';
|
||||
import {
|
||||
getActiveCountryAction,
|
||||
getActiveCountryByDialCodeAction,
|
||||
getActiveCountryByDialCodeReset,
|
||||
getActiveCountryReset,
|
||||
getPayCountryNetworkAction,
|
||||
getPayCountryNetworkReset
|
||||
} from '../../../webservice/CountryApi';
|
||||
import {
|
||||
envoieUserWalletToCashAction,
|
||||
envoieUserWalletToCashReset,
|
||||
getCommissionUserWalletToCashAction,
|
||||
getCommissionUserWalletToCashReset
|
||||
} from '../../../webservice/EnvoieUserApi';
|
||||
import {FontWeight, Typography} from '../../../config/typography';
|
||||
import thousands from 'thousands';
|
||||
import { IlinkEmitter } from '../../../utils/events';
|
||||
import {IlinkEmitter} from '../../../utils/events';
|
||||
|
||||
let theme = require('../../../utils/theme.json');
|
||||
let route = require('../../../route.json');
|
||||
|
||||
|
@ -73,7 +86,6 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
password: null,
|
||||
loading: false,
|
||||
user: null,
|
||||
triggerSubmitClick: false,
|
||||
triggerNextClick: false,
|
||||
displayFirstStep: true,
|
||||
displaySecondStep: false,
|
||||
|
@ -99,7 +111,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.setState({ user });
|
||||
this.setState({user});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -122,7 +134,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
|
||||
renderGetActionCountryList = () => {
|
||||
|
||||
const { resultActiveCountryList, errorActiveCountryList } = this.props;
|
||||
const {resultActiveCountryList, errorActiveCountryList} = this.props;
|
||||
if (resultActiveCountryList !== null) {
|
||||
if (typeof resultActiveCountryList.response !== 'undefined') {
|
||||
|
||||
|
@ -132,7 +144,10 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
paysDestinationSelect: resultActiveCountryList.response[0].name,
|
||||
});
|
||||
if (this.state.hasLoadActivePayCountryNetworkList)
|
||||
this.props.getPayCountryNetworkAction({ id_wallet_agent: this.state.wallet.id, id_country: resultActiveCountryList.response[0].id });
|
||||
this.props.getPayCountryNetworkAction({
|
||||
id_wallet_agent: this.state.wallet.id,
|
||||
id_country: resultActiveCountryList.response[0].id
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +164,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
|
@ -163,14 +178,14 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderGetPayCountryNetworkResponse = () => {
|
||||
const { resultPayCountryNetwork, errorPayCountryNetwork } = this.props;
|
||||
const {resultPayCountryNetwork, errorPayCountryNetwork} = this.props;
|
||||
if (resultPayCountryNetwork !== null) {
|
||||
if (typeof resultPayCountryNetwork.response !== 'undefined') {
|
||||
if (resultPayCountryNetwork.response.length > 0) {
|
||||
|
@ -180,8 +195,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
walletActifSelect: resultPayCountryNetwork.response[0].name,
|
||||
modalVisible: false
|
||||
});
|
||||
}
|
||||
else if (resultPayCountryNetwork.response.length === 0) {
|
||||
} else if (resultPayCountryNetwork.response.length === 0) {
|
||||
this.setState({
|
||||
walletActifs: [],
|
||||
walletActifSelect: '',
|
||||
|
@ -205,7 +219,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
|
@ -219,7 +233,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +241,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
|
||||
renderEnvoieWalletToWalletResponse = () => {
|
||||
|
||||
const { resultEnvoieWalletToCash, errorEnvoieWalletToCash } = this.props;
|
||||
const {resultEnvoieWalletToCash, errorEnvoieWalletToCash} = this.props;
|
||||
|
||||
if (errorEnvoieWalletToCash !== null) {
|
||||
if (typeof errorEnvoieWalletToCash.data !== 'undefined') {
|
||||
|
@ -241,7 +255,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +275,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +283,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
|
||||
renderDialogGetCommissionResponse = () => {
|
||||
|
||||
const { errorEnvoieWalletToCashGetCommission } = this.props;
|
||||
const {errorEnvoieWalletToCashGetCommission} = this.props;
|
||||
|
||||
if (errorEnvoieWalletToCashGetCommission !== null) {
|
||||
if (typeof errorEnvoieWalletToCashGetCommission.data !== 'undefined') {
|
||||
|
@ -283,7 +297,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -295,7 +309,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
|
||||
isMontantValid = () => {
|
||||
const { montant } = this.state;
|
||||
const {montant} = this.state;
|
||||
if ((parseInt(isEqual(montant, 0)) || montant < 0))
|
||||
return {
|
||||
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
|
||||
|
@ -336,32 +350,35 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
|
||||
<View>
|
||||
|
||||
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||
<View style={{flex: 1}}>
|
||||
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<Text
|
||||
style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||
<View style={{flex: 1}}>
|
||||
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<Text
|
||||
style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ paddingVertical: 10 }}>
|
||||
<View style={{ paddingVertical: 10 }}>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<View style={{paddingVertical: 10}}>
|
||||
<View style={{paddingVertical: 10}}>
|
||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||
<View style={{flex: 1}}>
|
||||
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}}`}</Text>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<Text
|
||||
style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -372,7 +389,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
this.setState({
|
||||
isModalConfirmVisible: false
|
||||
});
|
||||
}} />
|
||||
}}/>
|
||||
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
||||
this.setState({
|
||||
isModalConfirmVisible: false,
|
||||
|
@ -397,7 +414,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
password: this.state.password
|
||||
});
|
||||
this.props.getCommissionUserWalletToCashReset();
|
||||
}} />
|
||||
}}/>
|
||||
|
||||
</Dialog.Container>
|
||||
|
||||
|
@ -407,7 +424,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
|
||||
onSubmitNextStep = () => {
|
||||
|
||||
const { nomsEmetteur, prenomsEmetteur, emailEmetteur, numeroIdentiteEmetteur } = this.state;
|
||||
const {nomsEmetteur, prenomsEmetteur, emailEmetteur, numeroIdentiteEmetteur} = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(nomsEmetteur))
|
||||
this.nomsEmetteurAnim.shake(800);
|
||||
|
@ -434,7 +451,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
}
|
||||
|
||||
onSubmitCashVersAutreWallet = () => {
|
||||
const { nomsDestinataire, prenomsDestinataire, montant, password, numeroIdentiteDestinataire } = this.state;
|
||||
const {nomsDestinataire, prenomsDestinataire, montant, password, numeroIdentiteDestinataire} = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(nomsDestinataire))
|
||||
this.nomDestinataireAnim.shake(800);
|
||||
|
@ -445,8 +462,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
|
||||
console.log("IS MONTANT VALID", this.isMontantValid())
|
||||
this.montantAnim.shake(800);
|
||||
}
|
||||
else if (this.ckeckIfFieldIsOK(password))
|
||||
} else if (this.ckeckIfFieldIsOK(password))
|
||||
this.passwordAnim.shake(800);
|
||||
else {
|
||||
|
||||
|
@ -477,7 +493,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
|
||||
render() {
|
||||
console.log("STATE", this.state);
|
||||
const { resultEnvoieWalletToCashGetCommission } = this.props;
|
||||
const {resultEnvoieWalletToCashGetCommission} = this.props;
|
||||
return (
|
||||
<>
|
||||
{(this.state.modalVisible || this.props.loadingEnvoieWalletToCashGetCommission || this.props.loadingEnvoieWalletToCash || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()}
|
||||
|
@ -497,35 +513,41 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
|
||||
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_CASH_TO_CASH')}</Text>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.nomsEmetteurAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.nomsEmetteurAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
||||
label={`${I18n.t('NAME_EMETTEUR')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.nomsEmetteur}
|
||||
onChangeText={(nomsEmetteur) => {
|
||||
this.setState({ nomsEmetteur })
|
||||
this.setState({nomsEmetteur})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.prenomsEmetteurAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.prenomsEmetteurAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
||||
label={`${I18n.t('FIRSTNAME_EMETTEUR')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.prenomsEmetteur}
|
||||
onChangeText={(prenomsEmetteur) => {
|
||||
this.setState({ prenomsEmetteur })
|
||||
this.setState({prenomsEmetteur})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.emailEmetteurAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.emailEmetteurAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName='envelope'
|
||||
label={I18n.t('EMAIL_EMETTEUR')}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -533,14 +555,16 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
iconSize={20}
|
||||
value={this.state.emailEmetteur}
|
||||
onChangeText={(emailEmetteur) => {
|
||||
this.setState({ emailEmetteur })
|
||||
this.setState({emailEmetteur})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.identityPiecesEmetteurAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.identityPiecesEmetteurAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -557,20 +581,26 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
useNativeDriver={true}
|
||||
value={this.state.identityPiecesNameEmetteur}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ identityPiecesNameEmetteur: value, isDataSubmit: false });
|
||||
this.setState({identityPiecesNameEmetteur: value, isDataSubmit: false});
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return I18n.t(value.name)
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return I18n.t(value.name)
|
||||
}}
|
||||
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.numeroIdentiteEmetteurAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.numeroIdentiteEmetteurAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
||||
label={`${I18n.t('NUMERO_IDENTITE_EMETTEUR')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
onChangeText={(numeroIdentiteEmetteur) => {
|
||||
this.setState({ numeroIdentiteEmetteur })
|
||||
this.setState({numeroIdentiteEmetteur})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
|
@ -580,56 +610,66 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
isLoading={this.state.isLoging}
|
||||
onPress={() => { this.onSubmitNextStep() }}>
|
||||
onPress={() => {
|
||||
this.onSubmitNextStep()
|
||||
}}>
|
||||
{I18n.t('NEXT')}</Button>
|
||||
</>
|
||||
}
|
||||
|
||||
{this.state.displaySecondStep &&
|
||||
<>
|
||||
<Animatable.View ref={(comp) => { this.nomDestinataireAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.nomDestinataireAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
||||
label={`${I18n.t('NAME_DESTINATAIRE')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.nomsDestinataire}
|
||||
onChangeText={(nomsDestinataire) => {
|
||||
this.setState({ nomsDestinataire })
|
||||
this.setState({nomsDestinataire})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.prenomsDestinataireAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.prenomsDestinataireAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
||||
label={`${I18n.t('FIRSTNAME_DESTINATAIRE')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.prenomsDestinataire}
|
||||
onChangeText={(prenomsDestinataire) => {
|
||||
this.setState({ prenomsDestinataire })
|
||||
this.setState({prenomsDestinataire})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.identityPiecesDestinataireAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.identityPiecesDestinataireAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
||||
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.numeroIdentiteDestinataire}
|
||||
onChangeText={(numeroIdentiteDestinataire) => {
|
||||
this.setState({ numeroIdentiteDestinataire })
|
||||
this.setState({numeroIdentiteDestinataire})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.paysDestinationAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.paysDestinationAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -649,17 +689,30 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
this.props.getPayCountryNetworkReset();
|
||||
|
||||
let countrySelect = data.filter(element => element.name === value);
|
||||
this.setState({ paysDestinationSelect: value, hasLoadActivePayCountryNetworkList: true, isDataSubmit: false }, () => {
|
||||
this.props.getPayCountryNetworkAction({ id_wallet_agent: this.state.wallet.id, id_country: countrySelect[0].id });
|
||||
this.setState({
|
||||
paysDestinationSelect: value,
|
||||
hasLoadActivePayCountryNetworkList: true,
|
||||
isDataSubmit: false
|
||||
}, () => {
|
||||
this.props.getPayCountryNetworkAction({
|
||||
id_wallet_agent: this.state.wallet.id,
|
||||
id_country: countrySelect[0].id
|
||||
});
|
||||
});
|
||||
this.props.getCommissionUserWalletToCashReset();
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
valueExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.walletActifAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.walletActifAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -682,12 +735,18 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
});
|
||||
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
valueExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.montantAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.montantAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
||||
label={I18n.t('AMOUNT')}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -695,7 +754,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
iconSize={20}
|
||||
value={this.state.montant}
|
||||
onChangeText={(montant) => {
|
||||
this.setState({ montant })
|
||||
this.setState({montant})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
|
@ -717,11 +776,14 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
|
||||
}}
|
||||
/>
|
||||
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
|
||||
<Text
|
||||
style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
|
||||
</View>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.passwordAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||
label={I18n.t('PASSWORD')}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -729,7 +791,7 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
secureTextEntry={true}
|
||||
value={this.state.password}
|
||||
onChangeText={(password) => {
|
||||
this.setState({ password })
|
||||
this.setState({password})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
|
@ -738,7 +800,9 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
isLoading={this.state.isLoging}
|
||||
onPress={() => { this.onSubmitCashVersAutreWallet() }}>
|
||||
onPress={() => {
|
||||
this.onSubmitCashVersAutreWallet()
|
||||
}}>
|
||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||
|
||||
</>
|
||||
|
|
|
@ -249,7 +249,7 @@
|
|||
"DELETE_GROUP": "Supprimer le groupe",
|
||||
"CREATOR": "Créateur",
|
||||
"NOTIFICATIONS": "Notification",
|
||||
"NO_NOTIFICATION": "Vous n'avez aucune Fnotification",
|
||||
"NO_NOTIFICATION": "Vous n'avez aucune notification",
|
||||
"CONFIGURATIONS": "Configuration",
|
||||
"LOGOUT": "Déconnexion",
|
||||
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
||||
|
|
Loading…
Reference in New Issue