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,17 +1,17 @@
|
|||
import React, {Component} from 'react';
|
||||
import {StyleSheet,View,Text,Image,StatusBar,ScrollView,Alert} from 'react-native';
|
||||
let theme=require('./../../utils/theme.json');
|
||||
import {Alert, View} from 'react-native';
|
||||
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 {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;
|
||||
|
@ -25,6 +25,7 @@ export default class UpdateInformations extends Component {
|
|||
statusBarColor: theme.primaryDarkAdvanced,
|
||||
statusBarTextColorScheme: 'light',
|
||||
};
|
||||
|
||||
static options(passProps) {
|
||||
return {
|
||||
statusBar: {
|
||||
|
@ -43,6 +44,7 @@ export default class UpdateInformations extends Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static navigationOptions = ({navigation}) => {
|
||||
return {
|
||||
headerTitle: I18n.t('CHANGE_INFORMATION'),
|
||||
|
@ -52,7 +54,9 @@ export default class UpdateInformations extends Component {
|
|||
size={24}
|
||||
/>
|
||||
),
|
||||
}};
|
||||
}
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
|
@ -60,6 +64,7 @@ export default class UpdateInformations extends Component {
|
|||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||
this.showUserState()
|
||||
}
|
||||
|
||||
async showUserState() {
|
||||
const user = await readUser()
|
||||
this.setState({user: user})
|
||||
|
@ -72,18 +77,21 @@ export default class UpdateInformations extends Component {
|
|||
this.props.navigation.setParams({name: I18n.t('CHANGE_INFORMATION')})
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={{flex: 1, backgroundColor: theme.primary}}>
|
||||
<Button
|
||||
isLoading={this.state.positionEnabled}
|
||||
style={{backgroundColor:theme.primaryDark,
|
||||
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>
|
||||
}} textStyle={{color: "white", fontSize: 20, fontWeight: 'bold'}}
|
||||
onPress={() => this.onClickUpdatePosition()}>{I18n.t('UPDATE_POSITION_TEXT')}</Button>
|
||||
</View>);
|
||||
}
|
||||
|
||||
|
@ -95,7 +103,7 @@ export default class UpdateInformations extends Component {
|
|||
|
||||
onClickUpdatePosition() {
|
||||
this.setState({positionEnabled: true})
|
||||
navigator.geolocation.getCurrentPosition((position) => {
|
||||
Geolocation.getCurrentPosition((position) => {
|
||||
const myPosition = position.coords;
|
||||
updatePosition(myPosition.longitude, myPosition.latitude).then((response) => {
|
||||
var title = '';
|
||||
|
@ -109,15 +117,20 @@ export default class UpdateInformations extends Component {
|
|||
} 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');
|
||||
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})
|
||||
})
|
||||
|
|
|
@ -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={() => {
|
||||
|
||||
|
|
|
@ -3,7 +3,17 @@ 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 {
|
||||
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';
|
||||
|
@ -18,9 +28,16 @@ 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 {
|
||||
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};
|
||||
|
@ -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) {
|
||||
|
@ -198,7 +215,11 @@ class ModifyIdentificationUser extends Component {
|
|||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -436,7 +461,9 @@ 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'}
|
||||
|
@ -450,7 +477,9 @@ class ModifyIdentificationUser extends Component {
|
|||
</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'}
|
||||
|
@ -464,7 +493,9 @@ class ModifyIdentificationUser extends Component {
|
|||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.countryAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.countryAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -484,12 +515,18 @@ class ModifyIdentificationUser extends Component {
|
|||
onChangeText={(value, index, data) => {
|
||||
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,
|
||||
|
@ -509,12 +546,18 @@ class ModifyIdentificationUser extends Component {
|
|||
onChangeText={(value, index, data) => {
|
||||
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,
|
||||
|
@ -533,11 +576,17 @@ class ModifyIdentificationUser extends Component {
|
|||
onChangeText={(value, index, data) => {
|
||||
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'}
|
||||
|
@ -550,7 +599,9 @@ class ModifyIdentificationUser extends Component {
|
|||
>
|
||||
</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'}
|
||||
|
@ -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,
|
||||
|
|
|
@ -15,13 +15,26 @@ 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 {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 { Typography, FontWeight } from '../../../config/typography';
|
||||
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';
|
||||
|
||||
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,
|
||||
|
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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: '',
|
||||
|
@ -342,7 +356,8 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
<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>
|
||||
<Text
|
||||
style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||
|
@ -350,7 +365,8 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
<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>
|
||||
<Text
|
||||
style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -361,7 +377,8 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
<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>
|
||||
<Text
|
||||
style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -497,7 +513,9 @@ 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'}
|
||||
|
@ -511,7 +529,9 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
</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'}
|
||||
|
@ -525,7 +545,9 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
</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'}
|
||||
|
@ -540,7 +562,9 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.identityPiecesEmetteurAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.identityPiecesEmetteurAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -559,12 +583,18 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
onChangeText={(value, index, data) => {
|
||||
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'}
|
||||
|
@ -580,14 +610,18 @@ 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'}
|
||||
|
@ -601,7 +635,9 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
</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'}
|
||||
|
@ -615,7 +651,9 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
</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'}
|
||||
|
@ -629,7 +667,9 @@ class EnvoiCashVersCashAgent extends Component {
|
|||
</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'}
|
||||
|
@ -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'}
|
||||
|
@ -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