Correction de bugs

This commit is contained in:
Brice Zele 2020-12-05 18:14:33 +01:00
parent 210d09c49f
commit 5bfad5f025
8 changed files with 1598 additions and 1440 deletions

View File

@ -1,9 +1,28 @@
import { 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_CARD_USER_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_CARD_USER_GET_COMMISSION_ERROR,
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_GET_COMMISSION_PENDING,
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_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_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"; } from "../types/EnvoieUserType";
export const fetchEnvoieUserWalletToWalletPending = () => ({ export const fetchEnvoieUserWalletToWalletPending = () => ({
@ -47,7 +66,7 @@ export const fetchEnvoieUserWalletToWalleGetCommissiontReset = (error) => ({
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
export const fetchEnvoieUserWalletToCashPending = () => ({ export const fetchEnvoieUserWalletToCashPending = () => ({
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING type: ENVOIE_WALLET_TO_CASH_USER_PENDING
}); });
export const fetchEnvoieUserWalletToCashSuccess = (res) => ({ export const fetchEnvoieUserWalletToCashSuccess = (res) => ({
@ -60,7 +79,7 @@ export const fetchEnvoieUserWalletToCashError = (error) => ({
result: error result: error
}); });
export const fetchEnvoieUserWalletToCashReset = (error) => ({ export const fetchEnvoieUserWalletToCashReset = () => ({
type: ENVOIE_WALLET_TO_CASH_USER_RESET type: ENVOIE_WALLET_TO_CASH_USER_RESET
}); });

View File

@ -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 = { const initialState = {
loading: false, loading: false,
@ -8,23 +13,27 @@ const initialState = {
export default (state = initialState, action) => { export default (state = initialState, action) => {
switch (action.type) { switch (action.type) {
case ENVOIE_WALLET_TO_CASH_USER_PENDING: return { case ENVOIE_WALLET_TO_CASH_USER_PENDING:
return {
...state, ...state,
loading: true loading: true
} }
case ENVOIE_WALLET_TO_CASH_USER_SUCCESS: return { case ENVOIE_WALLET_TO_CASH_USER_SUCCESS:
return {
...state, ...state,
loading: false, loading: false,
result: action.result.data, result: action.result.data,
error: null error: null
} }
case ENVOIE_WALLET_TO_CASH_USER_ERROR: return { case ENVOIE_WALLET_TO_CASH_USER_ERROR:
return {
...state, ...state,
loading: false, loading: false,
result: null, result: null,
error: action.result error: action.result
} }
case ENVOIE_WALLET_TO_CASH_USER_PENDING: return initialState; case ENVOIE_WALLET_TO_CASH_USER_RESET:
return initialState;
default: { default: {
return state; return state;

View File

@ -1,17 +1,17 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {StyleSheet,View,Text,Image,StatusBar,ScrollView,Alert} from 'react-native'; import {Alert, View} from 'react-native';
let theme=require('./../../utils/theme.json');
import {readUser, updatePosition, updateUserData} from './../../webservice/AuthApi'; import {readUser, updatePosition, updateUserData} from './../../webservice/AuthApi';
import {getAgentNetworksList} from './../../webservice/NetworkApi' import {responsiveHeight} from 'react-native-responsive-dimensions';
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
import MapView,{Marker} from 'react-native-maps';
import Icon from 'react-native-vector-icons/FontAwesome5' import Icon from 'react-native-vector-icons/FontAwesome5'
import Button from 'apsl-react-native-button' 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 I18n from 'react-native-i18n'
import {Header} from "react-native-elements";
import {IlinkEmitter} from "../../utils/events"; 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') require('./../../utils/Translations')
const height = responsiveHeight(100) - 250; const height = responsiveHeight(100) - 250;
@ -25,6 +25,7 @@ export default class UpdateInformations extends Component {
statusBarColor: theme.primaryDarkAdvanced, statusBarColor: theme.primaryDarkAdvanced,
statusBarTextColorScheme: 'light', statusBarTextColorScheme: 'light',
}; };
static options(passProps) { static options(passProps) {
return { return {
statusBar: { statusBar: {
@ -43,6 +44,7 @@ export default class UpdateInformations extends Component {
} }
} }
} }
static navigationOptions = ({navigation}) => { static navigationOptions = ({navigation}) => {
return { return {
headerTitle: I18n.t('CHANGE_INFORMATION'), headerTitle: I18n.t('CHANGE_INFORMATION'),
@ -52,7 +54,9 @@ export default class UpdateInformations extends Component {
size={24} size={24}
/> />
), ),
}}; }
};
constructor(props) { constructor(props) {
super(props) super(props)
@ -60,6 +64,7 @@ export default class UpdateInformations extends Component {
IlinkEmitter.on("langueChange", this.updateLangue.bind(this)) IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
this.showUserState() this.showUserState()
} }
async showUserState() { async showUserState() {
const user = await readUser() const user = await readUser()
this.setState({user: user}) this.setState({user: user})
@ -72,18 +77,21 @@ export default class UpdateInformations extends Component {
this.props.navigation.setParams({name: I18n.t('CHANGE_INFORMATION')}) this.props.navigation.setParams({name: I18n.t('CHANGE_INFORMATION')})
this.forceUpdate() this.forceUpdate()
} }
render() { render() {
return ( return (
<View style={{flex: 1, backgroundColor: theme.primary}}> <View style={{flex: 1, backgroundColor: theme.primary}}>
<Button <Button
isLoading={this.state.positionEnabled} isLoading={this.state.positionEnabled}
style={{backgroundColor:theme.primaryDark, style={{
backgroundColor: theme.primaryDark,
marginTop: responsiveHeight(5), marginTop: responsiveHeight(5),
height: responsiveHeight(7), height: responsiveHeight(7),
marginRight: 10, marginRight: 10,
marginLeft: 10, marginLeft: 10,
borderColor: 'transparent' borderColor: 'transparent'
}} textStyle={{color:"white",fontSize:20,fontWeight:'bold'}} onPress={()=>this.onClickUpdatePosition()}>{I18n.t('UPDATE_POSITION_TEXT')}</Button> }} textStyle={{color: "white", fontSize: 20, fontWeight: 'bold'}}
onPress={() => this.onClickUpdatePosition()}>{I18n.t('UPDATE_POSITION_TEXT')}</Button>
</View>); </View>);
} }
@ -95,7 +103,7 @@ export default class UpdateInformations extends Component {
onClickUpdatePosition() { onClickUpdatePosition() {
this.setState({positionEnabled: true}) this.setState({positionEnabled: true})
navigator.geolocation.getCurrentPosition((position) => { Geolocation.getCurrentPosition((position) => {
const myPosition = position.coords; const myPosition = position.coords;
updatePosition(myPosition.longitude, myPosition.latitude).then((response) => { updatePosition(myPosition.longitude, myPosition.latitude).then((response) => {
var title = ''; var title = '';
@ -109,15 +117,20 @@ export default class UpdateInformations extends Component {
} else { } else {
title = I18n.t("TITLE_UPDATE_POSITION_FAILED") title = I18n.t("TITLE_UPDATE_POSITION_FAILED")
switch (response.error) { switch (response.error) {
case -3:message=I18n.t('TEXT_UDATE_POSITION_FAILED_1');break case -3:
case -2:message=I18n.t('TEXT_UDATE_POSITION_FAILED_2'); message = I18n.t('TEXT_UDATE_POSITION_FAILED_1');
break
case -2:
message = I18n.t('TEXT_UDATE_POSITION_FAILED_2');
break; break;
} }
} }
Alert.alert(title,message,[{text:"Ok",onPress:()=>{ Alert.alert(title, message, [{
text: "Ok", onPress: () => {
this.props.navigation.popToTop() this.props.navigation.popToTop()
}}]) }
}])
}).catch((e) => { }).catch((e) => {
this.setState({positionEnabled: false}) this.setState({positionEnabled: false})
}) })

View File

@ -21,7 +21,6 @@ import {accent, primary, primaryDark, purpleLight} from './../../utils/theme.jso
import {PagerTabIndicator} from 'react-native-best-viewpager' import {PagerTabIndicator} from 'react-native-best-viewpager'
import IconWithBadge from "../IconWithBadge"; import IconWithBadge from "../IconWithBadge";
import {Appbar, Divider, Menu, Provider} from 'react-native-paper'; import {Appbar, Divider, Menu, Provider} from 'react-native-paper';
import DeviceInfo from 'react-native-device-info';
var moment = require('moment-timezone'); var moment = require('moment-timezone');
const momentJS = require('moment'); const momentJS = require('moment');
@ -322,11 +321,11 @@ class MyHistory extends React.Component {
<Button onPress={this._openMenu}>Show menu</Button> <Button onPress={this._openMenu}>Show menu</Button>
} }
> >
<Menu.Item onPress={() => { {/* <Menu.Item onPress={() => {
this.setState({isSectionned: !this.state.isSectionned}) this.setState({isSectionned: !this.state.isSectionned})
this._closeMenu() this._closeMenu()
}} }}
title="Section"/> title="Section"/>*/}
<Divider/> <Divider/>
<Menu.Item onPress={() => { <Menu.Item onPress={() => {

View File

@ -3,7 +3,17 @@ import Button from 'apsl-react-native-button';
import isEqual from 'lodash/isEqual'; import isEqual from 'lodash/isEqual';
import isNil from 'lodash/isNil'; import isNil from 'lodash/isNil';
import React, {Component} from 'react'; import React, {Component} from 'react';
import { Alert, Keyboard, PermissionsAndroid, Platform, ProgressBarAndroid, ScrollView, StyleSheet, Text, View } from 'react-native'; import {
Alert,
Keyboard,
PermissionsAndroid,
Platform,
ProgressBarAndroid,
ScrollView,
StyleSheet,
Text,
View
} from 'react-native';
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import Geolocation from 'react-native-geolocation-service'; import Geolocation from 'react-native-geolocation-service';
import I18n from 'react-native-i18n'; import I18n from 'react-native-i18n';
@ -18,9 +28,16 @@ import { bindActionCreators } from 'redux';
import {Color} from '../../config/Color'; import {Color} from '../../config/Color';
import {store} from '../../redux/store'; import {store} from '../../redux/store';
import {identityPieces} from '../../utils/UtilsFunction'; import {identityPieces} from '../../utils/UtilsFunction';
import { createIndentificationResetAction, getNumberDetailAction, getNumberResetAction, getUserIdentificationAction, updateIndentificationAction } from '../../webservice/IdentificationApi'; import {
createIndentificationResetAction,
getNumberDetailAction,
getNumberResetAction,
getUserIdentificationAction,
updateIndentificationAction
} from '../../webservice/IdentificationApi';
import {getListCountriesActive, getTownInformationName, readUser} from './../../webservice/AuthApi'; import {getListCountriesActive, getTownInformationName, readUser} from './../../webservice/AuthApi';
import {getPositionInformation} from './../../webservice/MapService'; import {getPositionInformation} from './../../webservice/MapService';
let theme = require('./../../utils/theme.json'); let theme = require('./../../utils/theme.json');
let route = require('./../../route.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};
@ -93,8 +110,8 @@ class ModifyIdentificationUser extends Component {
componentDidMount() { componentDidMount() {
this.dateNaissanceFumiProps.value = moment(this.state.userIdentificationData.birth_date).format('DD-MM-YYYY'); this.dateNaissanceFumiProps.value = this.state.userIdentificationData !== null ? 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.dateExpirationFumiProps.value = this.state.userIdentificationData !== null ? moment(this.state.userIdentificationData.expiry_date_document).format('DD-MM-YYYY') : "";
readUser().then((user) => { readUser().then((user) => {
if (user) { if (user) {
@ -198,7 +215,11 @@ class ModifyIdentificationUser extends Component {
text: "Recommencer", onPress: () => { text: "Recommencer", onPress: () => {
this.watchLocation() this.watchLocation()
} }
}, { text: "Annuler", onPress: () => { this.props.navigation.popToTop() } }]) }, {
text: "Annuler", onPress: () => {
this.props.navigation.popToTop()
}
}])
} }
async watchLocation() { async watchLocation() {
@ -208,7 +229,11 @@ class ModifyIdentificationUser extends Component {
this.showErrorDialog() this.showErrorDialog()
}, this.props.geolocationOptions); }, this.props.geolocationOptions);
if (!this.watchID) { 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)
} }
} }
@ -436,7 +461,9 @@ class ModifyIdentificationUser extends Component {
{this.state.triggerSubmitClick && this.renderCreateIdentificationResponse()} {this.state.triggerSubmitClick && this.renderCreateIdentificationResponse()}
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
<Animatable.View ref={(comp) => { this.lastnameAnim = 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'}
@ -450,7 +477,9 @@ class ModifyIdentificationUser extends Component {
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.datenaissanceAnim = comp }}> <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'}
@ -464,7 +493,9 @@ class ModifyIdentificationUser extends Component {
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.countryAnim = comp }} <Animatable.View ref={(comp) => {
this.countryAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -484,12 +515,18 @@ class ModifyIdentificationUser extends Component {
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
this.setState({country: value}); this.setState({country: value});
}} }}
valueExtractor={(value) => { return value.name }} valueExtractor={(value) => {
labelExtractor={(value) => { return value.name }} return value.name
}}
labelExtractor={(value) => {
return value.name
}}
/> />
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.townAnim = comp }} <Animatable.View ref={(comp) => {
this.townAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -509,12 +546,18 @@ class ModifyIdentificationUser extends Component {
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
this.setState({townName: value}); this.setState({townName: value});
}} }}
valueExtractor={(value) => { return value.name }} valueExtractor={(value) => {
labelExtractor={(value) => { return value.name }} return value.name
}}
labelExtractor={(value) => {
return value.name
}}
/> />
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.identityPiecesAnim = comp }} <Animatable.View ref={(comp) => {
this.identityPiecesAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -533,11 +576,17 @@ class ModifyIdentificationUser extends Component {
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
this.setState({identityPiecesName: value}); this.setState({identityPiecesName: value});
}} }}
valueExtractor={(value) => { return I18n.t(value.name) }} valueExtractor={(value) => {
labelExtractor={(value) => { return I18n.t(value.name) }} return I18n.t(value.name)
}}
labelExtractor={(value) => {
return I18n.t(value.name)
}}
/> />
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = 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'}
@ -550,7 +599,9 @@ class ModifyIdentificationUser extends Component {
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.identityDateExpiryAnim = 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'}
@ -567,7 +618,9 @@ class ModifyIdentificationUser 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={() => { this.onSubmitIdentityClient() }}> onPress={() => {
this.onSubmitIdentityClient()
}}>
{I18n.t('MODIFY')}</Button> {I18n.t('MODIFY')}</Button>
</ScrollView> </ScrollView>
</> </>

View File

@ -48,6 +48,7 @@ import {responsiveWidth} from 'react-native-responsive-dimensions';
import {getWalletDetailActivated} from "../../webservice/WalletApi"; import {getWalletDetailActivated} from "../../webservice/WalletApi";
import {getWalletTransactionHistoryUser} from "../../webservice/WalletTransactionHistoryApi"; import {getWalletTransactionHistoryUser} from "../../webservice/WalletTransactionHistoryApi";
import {getUserIdentificationAction} from "../../webservice/IdentificationApi"; import {getUserIdentificationAction} from "../../webservice/IdentificationApi";
import {store} from "../../redux/store";
const route = require('./../../route.json'); const route = require('./../../route.json');
let slugify = require('slugify'); let slugify = require('slugify');
@ -64,7 +65,7 @@ class WalletOptionSelect extends Component {
wallet: this.props.navigation.state.params.wallet, wallet: this.props.navigation.state.params.wallet,
lottie: this.props.navigation.state.params.lottie, lottie: this.props.navigation.state.params.lottie,
onGoBack: this.props.navigation.state.params.onGoBack, 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'), isNanoCredit: this.props.navigation.state.params.hasOwnProperty('isNanoCredit'),
user: null, user: null,
displayModalHistory: false, displayModalHistory: false,

View File

@ -15,13 +15,26 @@ import { connect } from 'react-redux';
import {bindActionCreators} from 'redux'; import {bindActionCreators} from 'redux';
import {Color} from '../../../config/Color'; import {Color} from '../../../config/Color';
import {store} from "../../../redux/store"; import {store} from "../../../redux/store";
import { identityPieces, isIlinkWorldWallet, isNormalInteger, typeIdIDestinataire, thousandsSeparators } from '../../../utils/UtilsFunction'; import {identityPieces, isNormalInteger} from '../../../utils/UtilsFunction';
import {readUser} from '../../../webservice/AuthApi'; import {readUser} from '../../../webservice/AuthApi';
import { getActiveCountryAction, getActiveCountryByDialCodeAction, getActiveCountryByDialCodeReset, getActiveCountryReset, getPayCountryNetworkAction, getPayCountryNetworkReset } from '../../../webservice/CountryApi'; import {
import { envoieUserWalletToCashAction, envoieUserWalletToCashReset, getCommissionUserWalletToCashAction, getCommissionUserWalletToCashReset } from '../../../webservice/EnvoieUserApi'; getActiveCountryAction,
import { Typography, FontWeight } from '../../../config/typography'; 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 thousands from 'thousands';
import {IlinkEmitter} from '../../../utils/events'; import {IlinkEmitter} from '../../../utils/events';
let theme = require('../../../utils/theme.json'); let theme = require('../../../utils/theme.json');
let route = require('../../../route.json'); let route = require('../../../route.json');
@ -73,7 +86,6 @@ class EnvoiCashVersCashAgent extends Component {
password: null, password: null,
loading: false, loading: false,
user: null, user: null,
triggerSubmitClick: false,
triggerNextClick: false, triggerNextClick: false,
displayFirstStep: true, displayFirstStep: true,
displaySecondStep: false, displaySecondStep: false,
@ -132,7 +144,10 @@ class EnvoiCashVersCashAgent extends Component {
paysDestinationSelect: resultActiveCountryList.response[0].name, paysDestinationSelect: resultActiveCountryList.response[0].name,
}); });
if (this.state.hasLoadActivePayCountryNetworkList) 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
});
} }
} }
@ -180,8 +195,7 @@ class EnvoiCashVersCashAgent extends Component {
walletActifSelect: resultPayCountryNetwork.response[0].name, walletActifSelect: resultPayCountryNetwork.response[0].name,
modalVisible: false modalVisible: false
}); });
} } else if (resultPayCountryNetwork.response.length === 0) {
else if (resultPayCountryNetwork.response.length === 0) {
this.setState({ this.setState({
walletActifs: [], walletActifs: [],
walletActifSelect: '', walletActifSelect: '',
@ -342,7 +356,8 @@ class EnvoiCashVersCashAgent extends Component {
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text> <Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
</View> </View>
<View style={{flex: 1, alignItems: 'flex-end'}}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text> <Text
style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View> </View>
</View> </View>
<View style={{flexDirection: 'row', marginTop: 10}}> <View style={{flexDirection: 'row', marginTop: 10}}>
@ -350,7 +365,8 @@ class EnvoiCashVersCashAgent extends Component {
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text> <Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
</View> </View>
<View style={{flex: 1, alignItems: 'flex-end'}}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text> <Text
style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View> </View>
</View> </View>
</View> </View>
@ -361,7 +377,8 @@ class EnvoiCashVersCashAgent extends Component {
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text> <Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
</View> </View>
<View style={{flex: 1, alignItems: 'flex-end'}}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}}`}</Text> <Text
style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}`}</Text>
</View> </View>
</View> </View>
</View> </View>
@ -445,8 +462,7 @@ class EnvoiCashVersCashAgent extends Component {
else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) { else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
console.log("IS MONTANT VALID", this.isMontantValid()) console.log("IS MONTANT VALID", this.isMontantValid())
this.montantAnim.shake(800); this.montantAnim.shake(800);
} } else if (this.ckeckIfFieldIsOK(password))
else if (this.ckeckIfFieldIsOK(password))
this.passwordAnim.shake(800); this.passwordAnim.shake(800);
else { else {
@ -497,7 +513,9 @@ class EnvoiCashVersCashAgent extends Component {
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_CASH_TO_CASH')}</Text> <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'} <Fumi iconClass={FontAwesomeIcon} iconName={'user'}
label={`${I18n.t('NAME_EMETTEUR')}`} label={`${I18n.t('NAME_EMETTEUR')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -511,7 +529,9 @@ class EnvoiCashVersCashAgent extends Component {
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.prenomsEmetteurAnim = comp }}> <Animatable.View ref={(comp) => {
this.prenomsEmetteurAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'} <Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
label={`${I18n.t('FIRSTNAME_EMETTEUR')}`} label={`${I18n.t('FIRSTNAME_EMETTEUR')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -525,7 +545,9 @@ class EnvoiCashVersCashAgent extends Component {
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.emailEmetteurAnim = comp }}> <Animatable.View ref={(comp) => {
this.emailEmetteurAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName='envelope' <Fumi iconClass={FontAwesomeIcon} iconName='envelope'
label={I18n.t('EMAIL_EMETTEUR')} label={I18n.t('EMAIL_EMETTEUR')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -540,7 +562,9 @@ class EnvoiCashVersCashAgent extends Component {
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.identityPiecesEmetteurAnim = comp }} <Animatable.View ref={(comp) => {
this.identityPiecesEmetteurAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -559,12 +583,18 @@ class EnvoiCashVersCashAgent extends Component {
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
this.setState({identityPiecesNameEmetteur: value, isDataSubmit: false}); this.setState({identityPiecesNameEmetteur: value, isDataSubmit: false});
}} }}
valueExtractor={(value) => { return I18n.t(value.name) }} valueExtractor={(value) => {
labelExtractor={(value) => { return I18n.t(value.name) }} return I18n.t(value.name)
}}
labelExtractor={(value) => {
return I18n.t(value.name)
}}
/> />
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.numeroIdentiteEmetteurAnim = comp }}> <Animatable.View ref={(comp) => {
this.numeroIdentiteEmetteurAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'} <Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
label={`${I18n.t('NUMERO_IDENTITE_EMETTEUR')}`} label={`${I18n.t('NUMERO_IDENTITE_EMETTEUR')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -580,14 +610,18 @@ class EnvoiCashVersCashAgent 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={() => { this.onSubmitNextStep() }}> onPress={() => {
this.onSubmitNextStep()
}}>
{I18n.t('NEXT')}</Button> {I18n.t('NEXT')}</Button>
</> </>
} }
{this.state.displaySecondStep && {this.state.displaySecondStep &&
<> <>
<Animatable.View ref={(comp) => { this.nomDestinataireAnim = comp }}> <Animatable.View ref={(comp) => {
this.nomDestinataireAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user'} <Fumi iconClass={FontAwesomeIcon} iconName={'user'}
label={`${I18n.t('NAME_DESTINATAIRE')}`} label={`${I18n.t('NAME_DESTINATAIRE')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -601,7 +635,9 @@ class EnvoiCashVersCashAgent extends Component {
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.prenomsDestinataireAnim = comp }}> <Animatable.View ref={(comp) => {
this.prenomsDestinataireAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'} <Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
label={`${I18n.t('FIRSTNAME_DESTINATAIRE')}`} label={`${I18n.t('FIRSTNAME_DESTINATAIRE')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -615,7 +651,9 @@ class EnvoiCashVersCashAgent extends Component {
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.identityPiecesDestinataireAnim = comp }}> <Animatable.View ref={(comp) => {
this.identityPiecesDestinataireAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'} <Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
label={`${I18n.t('NUMERO_IDENTITE')}`} label={`${I18n.t('NUMERO_IDENTITE')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -629,7 +667,9 @@ class EnvoiCashVersCashAgent extends Component {
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.paysDestinationAnim = comp }} <Animatable.View ref={(comp) => {
this.paysDestinationAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -649,17 +689,30 @@ class EnvoiCashVersCashAgent extends Component {
this.props.getPayCountryNetworkReset(); this.props.getPayCountryNetworkReset();
let countrySelect = data.filter(element => element.name === value); let countrySelect = data.filter(element => element.name === value);
this.setState({ paysDestinationSelect: value, hasLoadActivePayCountryNetworkList: true, isDataSubmit: false }, () => { this.setState({
this.props.getPayCountryNetworkAction({ id_wallet_agent: this.state.wallet.id, id_country: countrySelect[0].id }); paysDestinationSelect: value,
hasLoadActivePayCountryNetworkList: true,
isDataSubmit: false
}, () => {
this.props.getPayCountryNetworkAction({
id_wallet_agent: this.state.wallet.id,
id_country: countrySelect[0].id
});
}); });
this.props.getCommissionUserWalletToCashReset(); this.props.getCommissionUserWalletToCashReset();
}} }}
valueExtractor={(value) => { return value.name }} valueExtractor={(value) => {
labelExtractor={(value) => { return value.name }} return value.name
}}
labelExtractor={(value) => {
return value.name
}}
/> />
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.walletActifAnim = comp }} <Animatable.View ref={(comp) => {
this.walletActifAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -682,12 +735,18 @@ class EnvoiCashVersCashAgent extends Component {
}); });
}} }}
valueExtractor={(value) => { return value.name }} valueExtractor={(value) => {
labelExtractor={(value) => { return value.name }} return value.name
}}
labelExtractor={(value) => {
return value.name
}}
/> />
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.montantAnim = comp }}> <Animatable.View ref={(comp) => {
this.montantAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'money'} <Fumi iconClass={FontAwesomeIcon} iconName={'money'}
label={I18n.t('AMOUNT')} label={I18n.t('AMOUNT')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -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> </View>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}> <Animatable.View ref={(comp) => {
this.passwordAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'} <Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
label={I18n.t('PASSWORD')} label={I18n.t('PASSWORD')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -738,7 +800,9 @@ class EnvoiCashVersCashAgent 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={() => { this.onSubmitCashVersAutreWallet() }}> onPress={() => {
this.onSubmitCashVersAutreWallet()
}}>
{I18n.t('SUBMIT_LABEL')}</Button> {I18n.t('SUBMIT_LABEL')}</Button>
</> </>

View File

@ -249,7 +249,7 @@
"DELETE_GROUP": "Supprimer le groupe", "DELETE_GROUP": "Supprimer le groupe",
"CREATOR": "Créateur", "CREATOR": "Créateur",
"NOTIFICATIONS": "Notification", "NOTIFICATIONS": "Notification",
"NO_NOTIFICATION": "Vous n'avez aucune Fnotification", "NO_NOTIFICATION": "Vous n'avez aucune notification",
"CONFIGURATIONS": "Configuration", "CONFIGURATIONS": "Configuration",
"LOGOUT": "Déconnexion", "LOGOUT": "Déconnexion",
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ", "HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",