Insurance ok
7
App.js
|
@ -115,8 +115,7 @@ const AppStack = createDrawerNavigator({
|
|||
/* filtre:Filter,
|
||||
network:Networks,*/
|
||||
useraccount: {
|
||||
screen: InsuranceSubscriptionScreen,
|
||||
/*screen: UserAccount,*/
|
||||
screen: UserAccount,
|
||||
navigationOptions: {},
|
||||
},
|
||||
walletSelect: WalletSelect,
|
||||
|
@ -133,7 +132,7 @@ const AppStack = createDrawerNavigator({
|
|||
envoieWalletToCashUser: EnvoieWalletToCashUser,
|
||||
envoieWalletToCardUser: EnvoieWalletToCardUser,
|
||||
envoieWalletToBankUser: EnvoieWalletToBankUser,
|
||||
addBeneficiaryScreen:AddBeneficiaryScreen,
|
||||
addBeneficiaryScreen: AddBeneficiaryScreen,
|
||||
insuranceSubscriptionScreen: InsuranceSubscriptionScreen,
|
||||
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
||||
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
||||
|
@ -402,7 +401,7 @@ export default class App extends React.Component {
|
|||
OneSignal.setLogLevel(6, 0);
|
||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID.
|
||||
OneSignal.init("e8e7251f-713d-4658-9510-86d877fa6a7c", {
|
||||
OneSignal.init("ab02121a-ecec-424f-910a-2709ef85698d", {
|
||||
kOSSettingsKeyAutoPrompt: false,
|
||||
kOSSettingsKeyInAppLaunchURL: false,
|
||||
kOSSettingsKeyInFocusDisplayOption: 2
|
||||
|
|
After Width: | Height: | Size: 414 B |
After Width: | Height: | Size: 492 B |
After Width: | Height: | Size: 485 B |
After Width: | Height: | Size: 459 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 522 B |
After Width: | Height: | Size: 807 B |
After Width: | Height: | Size: 338 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 754 B |
After Width: | Height: | Size: 979 B |
After Width: | Height: | Size: 953 B |
After Width: | Height: | Size: 734 B |
After Width: | Height: | Size: 473 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 691 B |
|
@ -559,5 +559,9 @@
|
|||
"UNABLE_GET_INFORMATION_TEXT": "Make sure your GPS is turned on and put in high precision mode and restart iLink World",
|
||||
"TITLE_HELP_SOON": "Help not available!",
|
||||
"YOUR_NETWORK": "Select your network",
|
||||
"HELP_SOON": "A tutorial helping you in understanding the features of the application will soon be available."
|
||||
"HELP_SOON": "A tutorial helping you in understanding the features of the application will soon be available.",
|
||||
"CLASSE_PRESTATAIRE": "Provider class",
|
||||
"PLEASE_SELECT_INSURANCE_BEFORE": "Please select insurance first",
|
||||
"NUMBER_MAX_BENEFICIARY": "Maximum number of beneficiaries reached",
|
||||
"BENEFICIARY_SUCCESSFULLY_ADDED": "The beneficiary has been correctly added"
|
||||
}
|
||||
|
|
|
@ -418,7 +418,7 @@
|
|||
"CHANGE_INFORMATION": "Modifier mes informations",
|
||||
"VALIDATE": "Valider",
|
||||
"NO_VALIDATE": "Non validé",
|
||||
"VALIDATION": "validation",
|
||||
"VALIDATION": "Validation",
|
||||
"VALIDATIONS": "validations",
|
||||
"LIMITE_GROUP": "Limite crédit",
|
||||
"SELECT_YOUR_WALLET": "Selectionner un wallet",
|
||||
|
@ -562,5 +562,44 @@
|
|||
"UNABLE_GET_INFORMATION_TEXT": "Vérifiez que votre GPS est activé et mis en mode haute precision et relancez iLink World",
|
||||
"TITLE_HELP_SOON": "Aide non disponible !",
|
||||
"YOUR_NETWORK": "Sélectionner votre réseau",
|
||||
"HELP_SOON": "Un tutoriel vous aidant dans la compréhension des fonctionnalités de l'application vous sera bientôt mis à disposition."
|
||||
"HELP_SOON": "Un tutoriel vous aidant dans la compréhension des fonctionnalités de l'application vous sera bientôt mis à disposition.",
|
||||
"ATTACH_ASSURANCE_CARD": "Rattaché une carte d'assuré",
|
||||
"SUBSCRIBE_ASSURANCE": "Souscrire à une assurance",
|
||||
"ADD_SUBSCRIBE": "Ajouter un ayant droit",
|
||||
"DELETE_SUBSCRIBE": "Supprimer un ayant droit",
|
||||
"STOP_SUBSCRIBE": "Arrêter son assurance",
|
||||
"RENEW_INSSURANCE": "Renouveler son assurance ",
|
||||
"MANAGE_ASSURANCE": "Gérer son assurance",
|
||||
"MANAGE_HEALTH": "Gérer ses soins",
|
||||
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
|
||||
"HISTORIC_HEALTH": "Consulter historique de ses soins",
|
||||
"VALID_HEALTH": "Valider une feuille de soin ",
|
||||
"ACTIVATE_INSSURANCE": "Activer son assurance",
|
||||
"AMOUNT_PER_DURATION": "Montant par durée",
|
||||
"AMOUNT_PRIME": "Montant de la prime",
|
||||
"NOM_ASSURE": "Nom de l'assuré",
|
||||
"NUMERO_ASSURE": "Numéro de l'assuré",
|
||||
"PRENOM_ASSURE": "Prénom de l'assuré",
|
||||
"DATE_NAISSANCE": "Date de naissance",
|
||||
"SEXE": "Sexe",
|
||||
"MASCULIN": "Masculin",
|
||||
"FEMININ": "Féminin",
|
||||
"AFFILIATION": "Affiliation",
|
||||
"ENFANT": "Enfant",
|
||||
"CONJOINT": "Conjoint",
|
||||
"ADD_AYANT_DROIT": "Ajouter un ayant droit",
|
||||
"SELECT_INSURANCE": "Sélectionner une assurance",
|
||||
"COPIE_LEGALISE_ACTE_NAISSANCE_CERTIFICAT_NAISSANCE": "Acte \n naissance",
|
||||
"DOCUMENT_JUSTICE_ENFANT_ADOPTE": "Document adoption \n ou tutelle (facultatif) ",
|
||||
"ACTE_MARIAGE": "Acte mariage",
|
||||
"CNI_FRONT_FACE": "Face avant identité",
|
||||
"CNI_BACK_FACE": "Face arrière identité",
|
||||
"PLEASE_SELECT_INSURANCE_BEFORE": "Veuillez d'abord sélectionner une assurance",
|
||||
"NUMBER_MAX_BENEFICIARY": "Nombre maximum d'ayant droit atteint",
|
||||
"BENEFICIARY_SUCCESSFULLY_ADDED": "L'ayant droit a été correctement ajouté",
|
||||
"NUMBER_OF_MONTHS": "Nombre de mois",
|
||||
"MINIMUM_AMOUNT": "Montant minimum",
|
||||
"AMOUNT_PER_MONTH": "Montant par durée de couverture",
|
||||
"DETAIL": "Détail",
|
||||
"PRIME_AMOUNT": "Montant de la prime"
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ buildscript {
|
|||
ext {
|
||||
buildToolsVersion = "28.0.3"
|
||||
minSdkVersion = 16
|
||||
compileSdkVersion = 28
|
||||
targetSdkVersion = 28
|
||||
compileSdkVersion = 29
|
||||
targetSdkVersion = 29
|
||||
}
|
||||
repositories {
|
||||
google()
|
||||
|
@ -42,6 +42,7 @@ allprojects {
|
|||
|
||||
google()
|
||||
jcenter()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://maven.google.com' }
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
}
|
|
@ -1,21 +1,17 @@
|
|||
# Project-wide Gradle settings.
|
||||
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
org.gradle.jvmargs=-Xmx4608m
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* Project YooLearn
|
||||
* File Api
|
||||
* Path app/middleware
|
||||
* Created by BRICE ZELE
|
||||
* Date: 13/09/2021
|
||||
*/
|
||||
import axios from 'axios';
|
||||
import {API} from "../redux/reducers";
|
||||
import {store} from "../redux/store";
|
||||
import I18n from "react-native-i18n";
|
||||
|
||||
const ApiMiddleware =
|
||||
({dispatch}: any) =>
|
||||
next =>
|
||||
action => {
|
||||
next(action);
|
||||
|
||||
if (action.type !== API) return;
|
||||
|
||||
const {
|
||||
url,
|
||||
method,
|
||||
data,
|
||||
accessToken,
|
||||
onLoading,
|
||||
onSuccess,
|
||||
timeout,
|
||||
onError,
|
||||
...rest
|
||||
} = action.payload;
|
||||
const dataOrParams = ['GET', 'DELETE'].includes(method)
|
||||
? 'params'
|
||||
: 'data';
|
||||
// axios default configs
|
||||
axios.defaults.headers.common['Content-Type'] = 'application/json';
|
||||
axios.defaults.headers.common['X-Localization'] = I18n.currentLocale();
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
if (accessToken)
|
||||
axios.defaults.headers.common.Authorization = accessToken
|
||||
else
|
||||
axios.defaults.headers.common.Authorization = `${authKey}`
|
||||
|
||||
dispatch(onLoading());
|
||||
|
||||
axios
|
||||
.request({
|
||||
url,
|
||||
method,
|
||||
timeout: timeout || 15000,
|
||||
[dataOrParams]: data,
|
||||
...rest,
|
||||
})
|
||||
.then(response => {
|
||||
console.log('Data response', response);
|
||||
console.log('Data response data', response.config.data);
|
||||
dispatch(onSuccess(response.data));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response) {
|
||||
console.warn('Data error response', error.response);
|
||||
dispatch(onError(error.response?.data));
|
||||
} else if (error.request) {
|
||||
console.warn('Data error request', error.request);
|
||||
dispatch(onError(error.request));
|
||||
} else {
|
||||
console.warn('Data error message', error.message);
|
||||
dispatch(onError(error.message));
|
||||
}
|
||||
|
||||
/* if (error.response && error.response.status === 403) {
|
||||
dispatch(accessDenied());
|
||||
} */
|
||||
});
|
||||
};
|
||||
|
||||
export default ApiMiddleware;
|
|
@ -34,7 +34,7 @@ export const fetchGetListInsuranceError = (error: any) => ({
|
|||
|
||||
export const fetchGetListInsurance = (idCountry) => {
|
||||
return ApiAction({
|
||||
url: `${getInsuranceListUrl}/${idCountry}`,
|
||||
url: `${getInsuranceListUrl}?country_id=${idCountry}`,
|
||||
method: 'GET',
|
||||
onLoading: fetchGetListInsurancePending,
|
||||
onSuccess: fetchGetListInsuranceSuccess,
|
||||
|
|
|
@ -1667,7 +1667,7 @@ class Home extends BaseScreen {
|
|||
translucent={true}
|
||||
/>
|
||||
{/* Start here to comment */}
|
||||
{/* {
|
||||
{
|
||||
(this.state.loadingDialog || this.props.loading) ?
|
||||
<View
|
||||
style={{
|
||||
|
@ -1720,7 +1720,7 @@ class Home extends BaseScreen {
|
|||
}
|
||||
}])
|
||||
}}
|
||||
/>*/}
|
||||
/>
|
||||
{this.makeCardSearch()}
|
||||
{this.showInterticiel()}
|
||||
{this.makeSlidingUp()}
|
||||
|
|
|
@ -271,7 +271,8 @@ export default class OptionsMenu extends Component {
|
|||
|| item === 'envoieCashVersAutreWalletAgent' || item === 'retraitCarteVersCashUser' || item === 'envoiCashVersCashAgent' || item === 'envoieCashVersCashAgent'
|
||||
|| item === 'envoieCashVersCarteAgent' || item === 'modifyIdentificationUser' || item === 'createGroupNanoCredit' || item === 'groupNanoCredit' || item === 'demandeValidationGroupe'
|
||||
|| item === 'adhererGroupNanoCredit' || item === 'myNanoCreditGroup' || item === 'askNanoCredit' || item === 'refundNanoCreditUser' || item === 'cautionNanoCreditAgent'
|
||||
|| item === 'epargnerArgentUser' || item === 'askNanoCredit' || item === 'casserEpargneUser' || item === 'envoieWalletToBankAgent' || item === 'reattachAccountUser' || item === 'insuranceSubscriptionScreen') {
|
||||
|| item === 'epargnerArgentUser' || item === 'askNanoCredit' || item === 'casserEpargneUser' || item === 'envoieWalletToBankAgent' || item === 'reattachAccountUser' || item === 'insuranceSubscriptionScreen'
|
||||
|| item === 'addBeneficiaryScreen') {
|
||||
return null
|
||||
} else {
|
||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||
|
|
|
@ -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 { envoieUserWalletToWalletAction, envoieUserWalletToWalletReset, getCommissionUserWalletToWalletAction, getCommissionUserWalletToWalletReset } 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, isIlinkWorldWallet, isNormalInteger, typeIdIDestinataire} from '../../../utils/UtilsFunction';
|
||||
import {readUser} from '../../../webservice/AuthApi';
|
||||
import {
|
||||
getActiveCountryAction,
|
||||
getActiveCountryByDialCodeAction,
|
||||
getActiveCountryByDialCodeReset,
|
||||
getActiveCountryReset,
|
||||
getPayCountryNetworkAction,
|
||||
getPayCountryNetworkReset
|
||||
} from '../../../webservice/CountryApi';
|
||||
import {
|
||||
envoieUserWalletToWalletAction,
|
||||
envoieUserWalletToWalletReset,
|
||||
getCommissionUserWalletToWalletAction,
|
||||
getCommissionUserWalletToWalletReset
|
||||
} 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');
|
||||
|
||||
|
@ -92,7 +105,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.setState({ user });
|
||||
this.setState({user});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -115,7 +128,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
|
||||
renderGetActionCountryList = () => {
|
||||
|
||||
const { resultActiveCountryList, errorActiveCountryList } = this.props;
|
||||
const {resultActiveCountryList, errorActiveCountryList} = this.props;
|
||||
if (resultActiveCountryList !== null) {
|
||||
if (typeof resultActiveCountryList.response !== 'undefined') {
|
||||
|
||||
|
@ -125,7 +138,10 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
paysDestinationSelect: resultActiveCountryList.response[0].name,
|
||||
});
|
||||
if (this.state.hasLoadActivePayCountryNetworkList)
|
||||
this.props.getPayCountryNetworkAction({ id_wallet_user: this.state.wallet.id, id_country: resultActiveCountryList.response[0].id });
|
||||
this.props.getPayCountryNetworkAction({
|
||||
id_wallet_user: this.state.wallet.id,
|
||||
id_country: resultActiveCountryList.response[0].id
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,7 +158,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
|
@ -156,14 +172,14 @@ class EnvoieWalletToWalletUser 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) {
|
||||
|
@ -176,8 +192,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
isIlinkWorldWalletSelect: isIlinkWorldWallet(resultPayCountryNetwork.response[0].type),
|
||||
modalVisible: false
|
||||
});
|
||||
}
|
||||
else if (resultPayCountryNetwork.response.length === 0) {
|
||||
} else if (resultPayCountryNetwork.response.length === 0) {
|
||||
this.setState({
|
||||
walletActifs: [],
|
||||
walletActifSelect: '',
|
||||
|
@ -201,7 +216,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
|
@ -215,7 +230,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -223,7 +238,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
|
||||
renderEnvoieWalletToWalletResponse = () => {
|
||||
|
||||
const { resultEnvoieWalletToWallet, errorEnvoieWalletToWallet } = this.props;
|
||||
const {resultEnvoieWalletToWallet, errorEnvoieWalletToWallet} = this.props;
|
||||
|
||||
if (errorEnvoieWalletToWallet !== null) {
|
||||
if (typeof errorEnvoieWalletToWallet.data !== 'undefined') {
|
||||
|
@ -237,7 +252,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -257,7 +272,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +280,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
|
||||
renderDialogGetCommissionResponse = () => {
|
||||
|
||||
const { errorEnvoieWalletToWalletGetCommission } = this.props;
|
||||
const {errorEnvoieWalletToWalletGetCommission} = this.props;
|
||||
|
||||
if (errorEnvoieWalletToWalletGetCommission !== null) {
|
||||
if (typeof errorEnvoieWalletToWalletGetCommission.data !== 'undefined') {
|
||||
|
@ -279,7 +294,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -291,7 +306,7 @@ class EnvoieWalletToWalletUser 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'),
|
||||
|
@ -333,54 +348,57 @@ class EnvoieWalletToWalletUser 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('DESTINATAIRE')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{destinataire}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<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={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<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' }}>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}></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('INIT_COUNTRY')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_init, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<Text
|
||||
style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_init, ' ')} ${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('FINAL_COUNTRY')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{montant_net_final}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -391,7 +409,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
this.setState({
|
||||
isModalConfirmVisible: false
|
||||
});
|
||||
}} />
|
||||
}}/>
|
||||
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
||||
this.setState({
|
||||
isModalConfirmVisible: false,
|
||||
|
@ -409,7 +427,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
password: this.state.password
|
||||
});
|
||||
this.props.getCommissionUserWalletToWalletReset();
|
||||
}} />
|
||||
}}/>
|
||||
|
||||
</Dialog.Container>
|
||||
|
||||
|
@ -418,7 +436,16 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
}
|
||||
|
||||
onSubmitSendWalletToWallet = () => {
|
||||
const { identityPiecesName, paysDestinationSelect, numeroIdentite, walletActifSelect, typeIdDestinataireSelect, numeroTelephoneOrWalletCode, montant, password } = this.state;
|
||||
const {
|
||||
identityPiecesName,
|
||||
paysDestinationSelect,
|
||||
numeroIdentite,
|
||||
walletActifSelect,
|
||||
typeIdDestinataireSelect,
|
||||
numeroTelephoneOrWalletCode,
|
||||
montant,
|
||||
password
|
||||
} = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(identityPiecesName))
|
||||
this.identityPiecesAnim.shake(800);
|
||||
|
@ -435,8 +462,7 @@ class EnvoieWalletToWalletUser 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 {
|
||||
|
||||
|
@ -468,7 +494,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
|
||||
render() {
|
||||
console.log("STATE", this.state);
|
||||
const { resultEnvoieWalletToWalletGetCommission } = this.props;
|
||||
const {resultEnvoieWalletToWalletGetCommission} = this.props;
|
||||
return (
|
||||
<>
|
||||
{(this.state.modalVisible || this.props.loadingEnvoieWalletToWalletGetCommission || this.props.loadingEnvoieWalletToWallet || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()}
|
||||
|
@ -485,7 +511,9 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
|
||||
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_WALLET')}</Text>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.paysDestinationAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.paysDestinationAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -505,17 +533,29 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
this.props.getPayCountryNetworkReset();
|
||||
|
||||
let countrySelect = data.filter(element => element.name === value);
|
||||
this.setState({ paysDestinationSelect: value, hasLoadActivePayCountryNetworkList: true }, () => {
|
||||
this.props.getPayCountryNetworkAction({ id_wallet_user: this.state.wallet.id, id_country: countrySelect[0].id });
|
||||
this.setState({
|
||||
paysDestinationSelect: value,
|
||||
hasLoadActivePayCountryNetworkList: true
|
||||
}, () => {
|
||||
this.props.getPayCountryNetworkAction({
|
||||
id_wallet_user: this.state.wallet.id,
|
||||
id_country: countrySelect[0].id
|
||||
});
|
||||
});
|
||||
this.props.getCommissionUserWalletToWalletReset();
|
||||
}}
|
||||
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,
|
||||
|
@ -540,12 +580,18 @@ class EnvoieWalletToWalletUser 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.typeIdDestinataireAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.typeIdDestinataireAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -563,29 +609,38 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
useNativeDriver={true}
|
||||
value={this.state.typeIdDestinataireSelect}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ typeIdDestinataireSelect: value });
|
||||
this.setState({typeIdDestinataireSelect: 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.numeroTelephoneAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? 'phone' : 'lock'}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.numeroTelephoneAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon}
|
||||
iconName={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? 'phone' : 'lock'}
|
||||
label={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? I18n.t('PHONE') : I18n.t('CODE_WALLET')}
|
||||
iconColor={'#f95a25'}
|
||||
keyboardType={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? 'phone-pad' : 'default'}
|
||||
iconSize={20}
|
||||
value={this.state.numeroTelephoneOrWalletCode}
|
||||
onChangeText={(numeroTelephoneOrWalletCode) => {
|
||||
this.setState({ numeroTelephoneOrWalletCode })
|
||||
this.setState({numeroTelephoneOrWalletCode})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.identityPiecesAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.identityPiecesAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -602,27 +657,35 @@ class EnvoieWalletToWalletUser 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}
|
||||
onChangeText={(numeroIdentite) => {
|
||||
this.setState({ numeroIdentite })
|
||||
this.setState({numeroIdentite})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</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'}
|
||||
|
@ -630,7 +693,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
iconSize={20}
|
||||
value={this.state.montant}
|
||||
onChangeText={(montant) => {
|
||||
this.setState({ montant })
|
||||
this.setState({montant})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
|
@ -656,7 +719,9 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
</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'}
|
||||
|
@ -664,7 +729,7 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
secureTextEntry={true}
|
||||
value={this.state.password}
|
||||
onChangeText={(password) => {
|
||||
this.setState({ password })
|
||||
this.setState({password})
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
|
@ -674,7 +739,9 @@ class EnvoieWalletToWalletUser extends Component {
|
|||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
isLoading={this.state.isLoging}
|
||||
onPress={() => { this.onSubmitSendWalletToWallet() }}>
|
||||
onPress={() => {
|
||||
this.onSubmitSendWalletToWallet()
|
||||
}}>
|
||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||
</ScrollView>
|
||||
</>
|
||||
|
|
|
@ -59,9 +59,8 @@ import {
|
|||
} from "../../../redux/insurance/insurance.selector";
|
||||
import Dialog from "react-native-dialog";
|
||||
import {Typography} from "../../../config/typography";
|
||||
import Icon from "react-native-vector-icons/FontAwesome5";
|
||||
import isNil from "lodash/isNil";
|
||||
import {Dropdown} from "react-native-material-dropdown";
|
||||
import Icon from "react-native-vector-icons/FontAwesome5";
|
||||
|
||||
let moment = require('moment-timezone');
|
||||
|
||||
|
@ -77,6 +76,11 @@ const styles = StyleSheet.create({
|
|||
padding: 10,
|
||||
width: '100%',
|
||||
},
|
||||
lineRow: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
paddingBottom: 20,
|
||||
},
|
||||
contain: {
|
||||
alignItems: 'center',
|
||||
marginTop: 40,
|
||||
|
@ -217,8 +221,12 @@ const InsuranceSubscriptionScreen = ({
|
|||
const [insurance, setInsurance] = useState(null);
|
||||
const [amountPerMonth, setAmountPerMonth] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("amountPerMonth", amountPerMonth);
|
||||
});
|
||||
const [firstNameBeneficiary, setFirstNameBeneficiary] = useState(null);
|
||||
const [lastNameBeneficiary, setLastNameBeneficiary] = useState(null);
|
||||
const [password, setPassword] = useState(null);
|
||||
let fileToSendTemp = new FormData();
|
||||
let [fileToSend, setFileToSend] = useState(null);
|
||||
let [fileAdded, setFileAdded] = useState([]);
|
||||
|
@ -236,6 +244,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
const [dateNaissance, setDateNaissance] = useState('' + moment(new Date(((new Date()).getFullYear() - 5), 0, 1)).format('YYYY-MM-DD'));
|
||||
const [showDateNaissancePicker, setShowDateNaissancePicker] = useState(false);
|
||||
const [showModalDetail, setShowModalDetail] = useState(false);
|
||||
const [modalViewBeneficiariesVisible, setModalViewBeneficiariesVisible] = useState(false);
|
||||
const [gender, setGender] = useState('M');
|
||||
const [affiliations] = useState([
|
||||
{label: I18n.t('ENFANT'), value: "CHILD"},
|
||||
|
@ -245,6 +254,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
let currentYearMinusFiveYear = new Date(((new Date()).getFullYear() - 5), 0, 1);
|
||||
let [currentYearMinusAgeLimit, setCurrentYearMinusAgeLimit] = useState(new Date(((new Date()).getFullYear() - 5), 0, 1));
|
||||
let insurancesRef = null;
|
||||
let amountPerMonthRef = null;
|
||||
|
||||
useEffect(() => {
|
||||
readUser().then((user) => {
|
||||
|
@ -261,16 +271,13 @@ const InsuranceSubscriptionScreen = ({
|
|||
fetchGetListInsurance(user.country_id);
|
||||
}, [user]);
|
||||
|
||||
useEffect(()=>{
|
||||
console.log('Beneficiaries', beneficiaries);
|
||||
}, [beneficiaries]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("insurance", insurance);
|
||||
console.log("Insurances", insurances);
|
||||
if (insurance !== null) {
|
||||
if (affiliation === 'CHILD')
|
||||
setCurrentYearMinusAgeLimit(new Date(((new Date()).getFullYear() - parseInt(insurance.age_limit_of_child_beneficiary)), 0, 1));
|
||||
else
|
||||
setCurrentYearMinusAgeLimit(new Date(((new Date()).getFullYear() - parseInt(insurance.age_limit_of_insured_and_spouse)), 0, 1));
|
||||
}
|
||||
}, [insurance]);
|
||||
console.log("currentYearMinusAgeLimit", currentYearMinusAgeLimit);
|
||||
}, currentYearMinusAgeLimit);
|
||||
|
||||
useEffect(() => {
|
||||
if (insuranceList.result !== null) {
|
||||
|
@ -299,6 +306,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
dispatch(fetchSubscribeInsuranceReset());
|
||||
navigation.goBack();
|
||||
}
|
||||
}
|
||||
|
@ -332,10 +340,15 @@ const InsuranceSubscriptionScreen = ({
|
|||
}
|
||||
}, [insurancePrimeAmount]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("affiliation", affiliation);
|
||||
}, [affiliation]);
|
||||
|
||||
useEffect(() => {
|
||||
if (uploadInsuranceImages.result !== null) {
|
||||
setModalVisible(false);
|
||||
|
||||
if (insurance !== null) {
|
||||
if (beneficiaries.length === parseInt(insurance.max_number_of_beneficiaries)) {
|
||||
dropDownAlertRef.alertWithType(
|
||||
'error',
|
||||
|
@ -343,8 +356,9 @@ const InsuranceSubscriptionScreen = ({
|
|||
I18n.t('NUMBER_MAX_BENEFICIARY'),
|
||||
);
|
||||
} else {
|
||||
if (affiliation === 'CHILD') {
|
||||
setBeneficiaries(beneficiaries.push({
|
||||
console.log("affiliation", affiliation);
|
||||
let beneficiariesTemp = beneficiaries;
|
||||
setBeneficiaries([{
|
||||
lastname: lastNameBeneficiary,
|
||||
firstname: firstNameBeneficiary,
|
||||
gender: gender,
|
||||
|
@ -353,24 +367,11 @@ const InsuranceSubscriptionScreen = ({
|
|||
birthdate_proof: childAyantDroitDocument[0].checboxSelectedValue,
|
||||
birthdate_proof_doc: uploadInsuranceImages.result.response[0],
|
||||
justice_doc: uploadInsuranceImages.result.response.length > 1 ? uploadInsuranceImages.result.response[1] : null,
|
||||
marriage_certificate_doc: null,
|
||||
id_document_type: "CNI",
|
||||
id_document_front: null,
|
||||
id_document_back: null
|
||||
}))
|
||||
} else {
|
||||
setBeneficiaries(beneficiaries.push({
|
||||
lastname: lastNameBeneficiary,
|
||||
firstname: firstNameBeneficiary,
|
||||
gender: gender,
|
||||
birthdate: dateNaissance,
|
||||
affiliation: affiliation,
|
||||
marriage_certificate_doc: uploadInsuranceImages.result.response[0],
|
||||
id_document_type: "CNI",
|
||||
id_document_front: uploadInsuranceImages.result.response[1] || null,
|
||||
id_document_back: uploadInsuranceImages.result.response[2] || null
|
||||
}))
|
||||
}
|
||||
id_document_front: uploadInsuranceImages.result.response[1],
|
||||
id_document_back: uploadInsuranceImages.result.response[2]
|
||||
}, ...beneficiaries]);
|
||||
dropDownAlertRef.alertWithType(
|
||||
'success',
|
||||
I18n.t('SUCCESS'),
|
||||
|
@ -378,8 +379,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
);
|
||||
setModalVisible(false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (uploadInsuranceImages.error) {
|
||||
|
@ -463,7 +463,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
}
|
||||
]);
|
||||
|
||||
const renderModalAmountDetail = (password) => (
|
||||
const renderModalAmountDetail = () => (
|
||||
<Dialog.Container useNativeDriver={true} visible={showModalDetail}>
|
||||
|
||||
<Dialog.Title>{I18n.t('DETAIL')}</Dialog.Title>
|
||||
|
@ -487,8 +487,10 @@ const InsuranceSubscriptionScreen = ({
|
|||
network_id: insurance.id,
|
||||
user_id: user.id,
|
||||
password: password,
|
||||
beneficiaries,
|
||||
month_price_id: insurance.months_prices.filter(item => item.checked)[0].id,
|
||||
})
|
||||
});
|
||||
dispatch(fetchGetInsurancePrimeAmountReset());
|
||||
setShowModalDetail(false);
|
||||
}}/>
|
||||
</Dialog.Container>
|
||||
|
@ -496,10 +498,8 @@ const InsuranceSubscriptionScreen = ({
|
|||
|
||||
const handleTakePhotoFromCamera = (name, isFrontCamera = false) => {
|
||||
ImagePicker.openCamera({
|
||||
width: isFrontCamera ? 800 : 3024,
|
||||
height: isFrontCamera ? 800 : 4032,
|
||||
cropping: true,
|
||||
useFrontCamera: true
|
||||
compressImageQuality: 0.7
|
||||
}).then(image => {
|
||||
if (affiliation === "CHILD") {
|
||||
let tempChildAyantDroitDocument = childAyantDroitDocument;
|
||||
|
@ -561,7 +561,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
setDateNaissance(currentDate);
|
||||
};
|
||||
|
||||
const onSelectAmountPerMonth = selected => {
|
||||
const onSelectAmountPerMonth = () => {
|
||||
let insuranceTemp = insurance;
|
||||
setInsurance(
|
||||
{
|
||||
|
@ -575,7 +575,6 @@ const InsuranceSubscriptionScreen = ({
|
|||
id: item.id,
|
||||
number_of_months: item.number_of_months,
|
||||
min_amount: item.min_amount,
|
||||
checked: item.id === selected.id,
|
||||
};
|
||||
})
|
||||
}
|
||||
|
@ -583,19 +582,90 @@ const InsuranceSubscriptionScreen = ({
|
|||
};
|
||||
|
||||
const renderDateNaissancePicker = () => {
|
||||
return (
|
||||
<DateTimePicker
|
||||
return (<DateTimePicker
|
||||
timeZoneOffsetInMinutes={0}
|
||||
is24Hour={true}
|
||||
value={new Date(dateNaissance)}
|
||||
mode='date'
|
||||
minimumDate={currentYearMinusAgeLimit}
|
||||
maximumDate={currentYearMinusAgeLimit}
|
||||
display="spinner"
|
||||
onChange={onChangeDateNaissance}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const renderModalViewBeneficiaries = () => {
|
||||
return (
|
||||
<Modal
|
||||
isVisible={modalViewBeneficiariesVisible}
|
||||
onSwipeComplete={() => setModalViewBeneficiariesVisible(false)}
|
||||
swipeDirection={['down']}
|
||||
style={styles.bottomModal}>
|
||||
<View
|
||||
style={[styles.contentFilterBottom, {backgroundColor: Color.cardBackgroundColor}]}>
|
||||
<View style={styles.contentSwipeDown}>
|
||||
<View style={styles.lineSwipeDown}/>
|
||||
</View>
|
||||
<View
|
||||
style={[
|
||||
styles.contentActionModalBottom,
|
||||
{borderBottomColor: Color.borderColor},
|
||||
]}/>
|
||||
<View style={[{marginBottom: 40}]}>
|
||||
<FlatList
|
||||
data={beneficiaries}
|
||||
extraData={beneficiaries}
|
||||
keyExtractor={(item, index) => index}
|
||||
renderItem={({item, index}) => {
|
||||
return (
|
||||
<View style={styles.lineRow}>
|
||||
<View style={{alignItems: 'flex-start'}}>
|
||||
<Text body1>{I18n.t('NOM_ASSURE')}</Text>
|
||||
<Text caption1 grayColor>
|
||||
{`${item.firstname} ${item.lastname}`}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={{alignItems: 'flex-start'}}>
|
||||
<Text body1>{I18n.t('AFFILIATION')}</Text>
|
||||
<Text caption1 grayColor>
|
||||
{item.affiliation === 'CHILD' ? I18n.t('ENFANT') : I18n.t('CONJOINT')}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.iconRight}>
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
let beneficiariesTemp = beneficiaries;
|
||||
console.log("beneficiariesTemp index", index);
|
||||
beneficiariesTemp.splice(index);
|
||||
console.log("beneficiariesTemp", beneficiariesTemp);
|
||||
setBeneficiaries([...beneficiariesTemp]);
|
||||
}}>
|
||||
<Icon
|
||||
name="minus-circle"
|
||||
size={24}
|
||||
color={Color.grayColor}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}}/>
|
||||
</View>
|
||||
|
||||
<Button
|
||||
style={{marginTop: 20, marginBottom: 20}}
|
||||
full
|
||||
onPress={() => {
|
||||
setModalViewBeneficiariesVisible(false)
|
||||
}}>
|
||||
{I18n.t('OK')}
|
||||
</Button>
|
||||
</View>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
const renderAddNewIdentification = () => (
|
||||
<Formik validationSchema={AddBeneficiarySchema}
|
||||
initialValues={{
|
||||
|
@ -717,6 +787,10 @@ const InsuranceSubscriptionScreen = ({
|
|||
height={32}
|
||||
onPress={(value) => {
|
||||
setFileAdded([]);
|
||||
if (value === 'CHILD')
|
||||
setCurrentYearMinusAgeLimit(new Date(((new Date()).getFullYear() - parseInt(insurance.age_limit_of_child_beneficiary)), 0, 1));
|
||||
else
|
||||
setCurrentYearMinusAgeLimit(new Date(((new Date()).getFullYear() - parseInt(insurance.age_limit_of_insured_and_spouse)), 0, 1));
|
||||
setAffliliation(value);
|
||||
}}/>
|
||||
</View>
|
||||
|
@ -866,6 +940,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
)}
|
||||
</Formik>
|
||||
);
|
||||
|
||||
return (
|
||||
<ScreenComponent>
|
||||
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
|
||||
|
@ -884,6 +959,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
insurancesRef.shake(800);
|
||||
} else {
|
||||
console.log(user);
|
||||
setPassword(values.password);
|
||||
fetchGetInsurancePrimeAmount({
|
||||
network_id: insurance.id,
|
||||
month_price_id: insurance.months_prices.filter(item => item.checked)[0].id,
|
||||
|
@ -933,11 +1009,11 @@ const InsuranceSubscriptionScreen = ({
|
|||
id: item.id,
|
||||
number_of_months: item.number_of_months,
|
||||
min_amount: item.min_amount,
|
||||
checked: index === 0,
|
||||
};
|
||||
})
|
||||
}
|
||||
);
|
||||
setAmountPerMonth(value.months_prices[0]);
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return value
|
||||
|
@ -984,44 +1060,44 @@ const InsuranceSubscriptionScreen = ({
|
|||
error={errors.name}
|
||||
/>
|
||||
*/}
|
||||
<PasswordInput
|
||||
style={{marginTop: 10}}
|
||||
onChangeText={handleChange('password')}
|
||||
placeholder={I18n.t('PASSWORD')}
|
||||
secureTextEntry
|
||||
icon={<FontAwesome name="lock" size={20}/>}
|
||||
value={values.password}
|
||||
onBlur={handleBlur('password')}
|
||||
success={touched.password && !errors.password}
|
||||
touched={touched.password}
|
||||
error={errors.password}
|
||||
/>
|
||||
|
||||
|
||||
<View style={{
|
||||
marginTop: 10,
|
||||
width: "100%",
|
||||
flexDirection: 'row',
|
||||
justifyContent: "space-between"
|
||||
}}>
|
||||
<Text body2>{I18n.t('VALIDATION')}</Text>
|
||||
<View style={styles.contentSwitch}>
|
||||
<SwitchSelector options={validationOption}
|
||||
initial={0}
|
||||
buttonColor={Color.accentColor}
|
||||
backgroundColor={Color.primaryDarkColor}
|
||||
textColor='white'
|
||||
bold={true}
|
||||
hasPadding
|
||||
height={32}
|
||||
onPress={(value) => {
|
||||
}}/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{
|
||||
insurance !== null &&
|
||||
<View style={{paddingVertical: 10, width: '100%', alignSelf: "flex-start"}}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
amountPerMonthRef = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 10,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('AMOUNT_PER_MONTH')}
|
||||
value={amountPerMonth !== null
|
||||
? `${I18n.t('NUMBER_OF_MONTHS')}: ${amountPerMonth.number_of_months} | ${I18n.t('MINIMUM_AMOUNT')}: ${amountPerMonth.min_amount}`
|
||||
: `${I18n.t('NUMBER_OF_MONTHS')}: ${insurance.months_prices[0].number_of_months} | ${I18n.t('MINIMUM_AMOUNT')}: ${insurance.months_prices[0].min_amount}`
|
||||
}
|
||||
data={insurance.months_prices}
|
||||
useNativeDriver={true}
|
||||
onChangeText={(value, index, data) => {
|
||||
console.log("Value", data[index]);
|
||||
setAmountPerMonth(data[index]);
|
||||
onSelectAmountPerMonth();
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return `${I18n.t('NUMBER_OF_MONTHS')}: ${value.number_of_months} | ${I18n.t('MINIMUM_AMOUNT')}: ${value.min_amount}`
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return `${I18n.t('NUMBER_OF_MONTHS')}: ${value.number_of_months} | ${I18n.t('MINIMUM_AMOUNT')}: ${value.min_amount}`
|
||||
}}
|
||||
/>
|
||||
</Animatable.View>
|
||||
/*<View style={{paddingVertical: 10, width: '100%', alignSelf: "flex-start"}}>
|
||||
<Text headline semibold>
|
||||
{I18n.t('AMOUNT_PER_MONTH')}
|
||||
</Text>
|
||||
|
@ -1058,26 +1134,23 @@ const InsuranceSubscriptionScreen = ({
|
|||
</TouchableOpacity>
|
||||
))}
|
||||
</View>
|
||||
{/* {
|
||||
insurance.months_prices.map((item, index) => (
|
||||
<View style={styles.itemAmountPerMonth} key={index}>
|
||||
<View
|
||||
style={[styles.dot, {backgroundColor: Color.primaryColor}]}/>
|
||||
<View style={{marginLeft: 10}}>
|
||||
<Text subhead semibold>
|
||||
{`${I18n.t('NUMBER_OF_MONTHS')}: ${item.number_of_months}`}
|
||||
</Text>
|
||||
<Text body2>
|
||||
{`${I18n.t('MINIMUM_AMOUNT')}: ${item.min_amount}`}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
))
|
||||
|
||||
}*/}
|
||||
</View>
|
||||
</View>*/
|
||||
}
|
||||
|
||||
<PasswordInput
|
||||
style={{marginTop: 10}}
|
||||
onChangeText={handleChange('password')}
|
||||
placeholder={I18n.t('PASSWORD')}
|
||||
secureTextEntry
|
||||
icon={<FontAwesome name="lock" size={20}/>}
|
||||
value={values.password}
|
||||
onBlur={handleBlur('password')}
|
||||
success={touched.password && !errors.password}
|
||||
touched={touched.password}
|
||||
error={errors.password}
|
||||
/>
|
||||
|
||||
|
||||
<View
|
||||
style={{
|
||||
flexDirection: 'column',
|
||||
|
@ -1098,7 +1171,9 @@ const InsuranceSubscriptionScreen = ({
|
|||
setShowDateNaissancePicker(false);
|
||||
dispatch(fetchUploadInsuranceReset());
|
||||
setAffliliation('CHILD');
|
||||
setDateNaissance('' + moment(new Date(((new Date()).getFullYear() - 5), 0, 1)).format('YYYY-MM-DD'));
|
||||
if (insurance !== null)
|
||||
setCurrentYearMinusAgeLimit(new Date(((new Date()).getFullYear() - parseInt(insurance.age_limit_of_child_beneficiary)), 0, 1));
|
||||
setDateNaissance('' + moment(new Date(((new Date()).getFullYear() - parseInt(insurance.age_limit_of_child_beneficiary)), 0, 1)).format('YYYY-MM-DD'));
|
||||
setFirstNameBeneficiary(null);
|
||||
setLastNameBeneficiary(null);
|
||||
setFileAdded([]);
|
||||
|
@ -1117,14 +1192,34 @@ const InsuranceSubscriptionScreen = ({
|
|||
onPress={handleSubmit}>
|
||||
{I18n.t('SUBMIT_LABEL')}
|
||||
</Button>
|
||||
{showModalDetail && renderModalAmountDetail(values.password)}
|
||||
{showModalDetail && renderModalAmountDetail()}
|
||||
</View>
|
||||
)}
|
||||
</Formik>
|
||||
|
||||
</ScrollView>
|
||||
</KeyboardAvoidingView>
|
||||
{modalVisible && renderAddNewIdentification()}
|
||||
{modalViewBeneficiariesVisible && renderModalViewBeneficiaries()}
|
||||
{showDateNaissancePicker && renderDateNaissancePicker()}
|
||||
{beneficiaries.length >= 1 && (<TouchableOpacity
|
||||
style={{
|
||||
alignItems: 'center',
|
||||
flexDirection: 'row',
|
||||
width: 60,
|
||||
position: 'absolute',
|
||||
bottom: 10,
|
||||
right: 10,
|
||||
height: 60,
|
||||
padding: 3,
|
||||
backgroundColor: Color.primaryColor,
|
||||
borderRadius: 100,
|
||||
}}
|
||||
onPress={() => setModalViewBeneficiariesVisible(true)}
|
||||
>
|
||||
<Text whiteColor title2>{beneficiaries.length}</Text>
|
||||
<Text whiteColor caption2>{I18n.t('AYANT_DROIT')}</Text>
|
||||
</TouchableOpacity>)}
|
||||
</ScreenComponent>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -597,9 +597,10 @@
|
|||
"PLEASE_SELECT_INSURANCE_BEFORE": "Veuillez d'abord sélectionner une assurance",
|
||||
"NUMBER_MAX_BENEFICIARY": "Nombre maximum d'ayant droit atteint",
|
||||
"BENEFICIARY_SUCCESSFULLY_ADDED": "L'ayant droit a été correctement ajouté",
|
||||
"NUMBER_OF_MONTHS": "Nombre de mois",
|
||||
"MINIMUM_AMOUNT": "Montant minimum",
|
||||
"NUMBER_OF_MONTHS": "Nbre de mois",
|
||||
"MINIMUM_AMOUNT": "Montant min.",
|
||||
"AMOUNT_PER_MONTH": "Montant par durée de couverture",
|
||||
"DETAIL": "Détail",
|
||||
"PRIME_AMOUNT": "Montant de la prime"
|
||||
"PRIME_AMOUNT": "Montant de la prime",
|
||||
"AYANT_DROIT": "Ayant(s) droit(s)"
|
||||
}
|
||||
|
|
|
@ -81,10 +81,10 @@ export const getIlinkBankListUrl = testBaseUrl + '/walletService/wallets/users/b
|
|||
export const linkBankAccountUrl = testBaseUrl + '/walletService/wallets/users/link_bank_account';
|
||||
export const payBillUrl = testBaseUrl + '/walletService/transactions/ilink';
|
||||
|
||||
export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances/countries';
|
||||
export const subscribeInsuranceUrl = testBaseUrl + '/nanoSanteService/insurances/subscribe';
|
||||
export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/bonus-amount';
|
||||
export const uploadInsuranceImagetUrl = 'http://test.ilink-app.com:8086/insurances/upload-images';
|
||||
export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances';
|
||||
export const subscribeInsuranceUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions';
|
||||
export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount';
|
||||
export const uploadInsuranceImagetUrl = 'https://test.ilink-app.com:8086/insurances/subscriptions/upload-images';
|
||||
|
||||
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||
|
|