Insurance ok

This commit is contained in:
Brice Zele 2021-10-29 19:51:10 +01:00
parent 99b99a902f
commit 6b01bc8f14
37 changed files with 2879 additions and 2210 deletions

5
App.js
View File

@ -115,8 +115,7 @@ const AppStack = createDrawerNavigator({
/* filtre:Filter, /* filtre:Filter,
network:Networks,*/ network:Networks,*/
useraccount: { useraccount: {
screen: InsuranceSubscriptionScreen, screen: UserAccount,
/*screen: UserAccount,*/
navigationOptions: {}, navigationOptions: {},
}, },
walletSelect: WalletSelect, walletSelect: WalletSelect,
@ -402,7 +401,7 @@ export default class App extends React.Component {
OneSignal.setLogLevel(6, 0); OneSignal.setLogLevel(6, 0);
IlinkEmitter.on("langueChange", this.updateLangue.bind(this)) IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID. // 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, kOSSettingsKeyAutoPrompt: false,
kOSSettingsKeyInAppLaunchURL: false, kOSSettingsKeyInAppLaunchURL: false,
kOSSettingsKeyInFocusDisplayOption: 2 kOSSettingsKeyInFocusDisplayOption: 2

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

View File

@ -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", "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!", "TITLE_HELP_SOON": "Help not available!",
"YOUR_NETWORK": "Select your network", "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"
} }

View File

@ -418,7 +418,7 @@
"CHANGE_INFORMATION": "Modifier mes informations", "CHANGE_INFORMATION": "Modifier mes informations",
"VALIDATE": "Valider", "VALIDATE": "Valider",
"NO_VALIDATE": "Non validé", "NO_VALIDATE": "Non validé",
"VALIDATION": "validation", "VALIDATION": "Validation",
"VALIDATIONS": "validations", "VALIDATIONS": "validations",
"LIMITE_GROUP": "Limite crédit", "LIMITE_GROUP": "Limite crédit",
"SELECT_YOUR_WALLET": "Selectionner un wallet", "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", "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 !", "TITLE_HELP_SOON": "Aide non disponible !",
"YOUR_NETWORK": "Sélectionner votre réseau", "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"
} }

View File

@ -2,8 +2,8 @@ buildscript {
ext { ext {
buildToolsVersion = "28.0.3" buildToolsVersion = "28.0.3"
minSdkVersion = 16 minSdkVersion = 16
compileSdkVersion = 28 compileSdkVersion = 29
targetSdkVersion = 28 targetSdkVersion = 29
} }
repositories { repositories {
google() google()
@ -42,6 +42,7 @@ allprojects {
google() google()
jcenter() jcenter()
maven { url 'https://jitpack.io' } maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
} }
} }

View File

@ -1,21 +1,17 @@
# Project-wide Gradle settings. # Project-wide Gradle settings.
# IDE (e.g. Android Studio) users: # IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override* # Gradle settings configured through the IDE *will override*
# any settings specified in this file. # any settings specified in this file.
# For more details on how to configure your build environment visit # For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html # http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m # Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # 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 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
org.gradle.jvmargs=-Xmx4608m

View File

@ -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;

View File

@ -34,7 +34,7 @@ export const fetchGetListInsuranceError = (error: any) => ({
export const fetchGetListInsurance = (idCountry) => { export const fetchGetListInsurance = (idCountry) => {
return ApiAction({ return ApiAction({
url: `${getInsuranceListUrl}/${idCountry}`, url: `${getInsuranceListUrl}?country_id=${idCountry}`,
method: 'GET', method: 'GET',
onLoading: fetchGetListInsurancePending, onLoading: fetchGetListInsurancePending,
onSuccess: fetchGetListInsuranceSuccess, onSuccess: fetchGetListInsuranceSuccess,

View File

@ -1667,7 +1667,7 @@ class Home extends BaseScreen {
translucent={true} translucent={true}
/> />
{/* Start here to comment */} {/* Start here to comment */}
{/* { {
(this.state.loadingDialog || this.props.loading) ? (this.state.loadingDialog || this.props.loading) ?
<View <View
style={{ style={{
@ -1720,7 +1720,7 @@ class Home extends BaseScreen {
} }
}]) }])
}} }}
/>*/} />
{this.makeCardSearch()} {this.makeCardSearch()}
{this.showInterticiel()} {this.showInterticiel()}
{this.makeSlidingUp()} {this.makeSlidingUp()}

View File

@ -271,7 +271,8 @@ export default class OptionsMenu extends Component {
|| item === 'envoieCashVersAutreWalletAgent' || item === 'retraitCarteVersCashUser' || item === 'envoiCashVersCashAgent' || item === 'envoieCashVersCashAgent' || item === 'envoieCashVersAutreWalletAgent' || item === 'retraitCarteVersCashUser' || item === 'envoiCashVersCashAgent' || item === 'envoieCashVersCashAgent'
|| item === 'envoieCashVersCarteAgent' || item === 'modifyIdentificationUser' || item === 'createGroupNanoCredit' || item === 'groupNanoCredit' || item === 'demandeValidationGroupe' || item === 'envoieCashVersCarteAgent' || item === 'modifyIdentificationUser' || item === 'createGroupNanoCredit' || item === 'groupNanoCredit' || item === 'demandeValidationGroupe'
|| item === 'adhererGroupNanoCredit' || item === 'myNanoCreditGroup' || item === 'askNanoCredit' || item === 'refundNanoCreditUser' || item === 'cautionNanoCreditAgent' || 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 return null
} else { } else {
const color = this.state.currentId === item.id ? theme.accent : "grey" const color = this.state.currentId === item.id ? theme.accent : "grey"

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, isIlinkWorldWallet, isNormalInteger, typeIdIDestinataire} 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 { envoieUserWalletToWalletAction, envoieUserWalletToWalletReset, getCommissionUserWalletToWalletAction, getCommissionUserWalletToWalletReset } from '../../../webservice/EnvoieUserApi'; getActiveCountryAction,
import { Typography, FontWeight } from '../../../config/typography'; 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 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');
@ -125,7 +138,10 @@ class EnvoieWalletToWalletUser 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_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
});
} }
} }
@ -176,8 +192,7 @@ class EnvoieWalletToWalletUser extends Component {
isIlinkWorldWalletSelect: isIlinkWorldWallet(resultPayCountryNetwork.response[0].type), isIlinkWorldWalletSelect: isIlinkWorldWallet(resultPayCountryNetwork.response[0].type),
modalVisible: false modalVisible: false
}); });
} } else if (resultPayCountryNetwork.response.length === 0) {
else if (resultPayCountryNetwork.response.length === 0) {
this.setState({ this.setState({
walletActifs: [], walletActifs: [],
walletActifSelect: '', walletActifSelect: '',
@ -347,7 +362,8 @@ class EnvoieWalletToWalletUser 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}}>
@ -355,7 +371,8 @@ class EnvoieWalletToWalletUser 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>
@ -373,7 +390,8 @@ class EnvoieWalletToWalletUser extends Component {
<Text tyle={[Typography.body2]}>{I18n.t('INIT_COUNTRY')}</Text> <Text tyle={[Typography.body2]}>{I18n.t('INIT_COUNTRY')}</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_init, ' ')} ${this.state.wallet.currency_code}`}</Text> <Text
style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_init, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View> </View>
</View> </View>
<View style={{flexDirection: 'row', marginTop: 10}}> <View style={{flexDirection: 'row', marginTop: 10}}>
@ -418,7 +436,16 @@ class EnvoieWalletToWalletUser extends Component {
} }
onSubmitSendWalletToWallet = () => { 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)) if (this.ckeckIfFieldIsOK(identityPiecesName))
this.identityPiecesAnim.shake(800); this.identityPiecesAnim.shake(800);
@ -435,8 +462,7 @@ class EnvoieWalletToWalletUser 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 {
@ -485,7 +511,9 @@ class EnvoieWalletToWalletUser extends Component {
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_WALLET')}</Text> <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={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -505,17 +533,29 @@ class EnvoieWalletToWalletUser 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 }, () => { this.setState({
this.props.getPayCountryNetworkAction({ id_wallet_user: this.state.wallet.id, id_country: countrySelect[0].id }); paysDestinationSelect: value,
hasLoadActivePayCountryNetworkList: true
}, () => {
this.props.getPayCountryNetworkAction({
id_wallet_user: this.state.wallet.id,
id_country: countrySelect[0].id
});
}); });
this.props.getCommissionUserWalletToWalletReset(); this.props.getCommissionUserWalletToWalletReset();
}} }}
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,
@ -540,12 +580,18 @@ class EnvoieWalletToWalletUser 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.typeIdDestinataireAnim = comp }} <Animatable.View ref={(comp) => {
this.typeIdDestinataireAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -565,13 +611,20 @@ class EnvoieWalletToWalletUser extends Component {
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
this.setState({typeIdDestinataireSelect: value}); this.setState({typeIdDestinataireSelect: 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.numeroTelephoneAnim = comp }}> <Animatable.View ref={(comp) => {
<Fumi iconClass={FontAwesomeIcon} iconName={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? 'phone' : 'lock'} 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')} label={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? I18n.t('PHONE') : I18n.t('CODE_WALLET')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
keyboardType={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? 'phone-pad' : 'default'} keyboardType={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? 'phone-pad' : 'default'}
@ -585,7 +638,9 @@ class EnvoieWalletToWalletUser extends Component {
</Fumi> </Fumi>
</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,
@ -604,12 +659,18 @@ class EnvoieWalletToWalletUser 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'}
@ -622,7 +683,9 @@ class EnvoieWalletToWalletUser extends Component {
</Fumi> </Fumi>
</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'}
@ -656,7 +719,9 @@ class EnvoieWalletToWalletUser extends Component {
</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'}
@ -674,7 +739,9 @@ class EnvoieWalletToWalletUser 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.onSubmitSendWalletToWallet() }}> onPress={() => {
this.onSubmitSendWalletToWallet()
}}>
{I18n.t('SUBMIT_LABEL')}</Button> {I18n.t('SUBMIT_LABEL')}</Button>
</ScrollView> </ScrollView>
</> </>

View File

@ -59,9 +59,8 @@ import {
} from "../../../redux/insurance/insurance.selector"; } from "../../../redux/insurance/insurance.selector";
import Dialog from "react-native-dialog"; import Dialog from "react-native-dialog";
import {Typography} from "../../../config/typography"; 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 {Dropdown} from "react-native-material-dropdown";
import Icon from "react-native-vector-icons/FontAwesome5";
let moment = require('moment-timezone'); let moment = require('moment-timezone');
@ -77,6 +76,11 @@ const styles = StyleSheet.create({
padding: 10, padding: 10,
width: '100%', width: '100%',
}, },
lineRow: {
flexDirection: 'row',
justifyContent: 'space-between',
paddingBottom: 20,
},
contain: { contain: {
alignItems: 'center', alignItems: 'center',
marginTop: 40, marginTop: 40,
@ -217,8 +221,12 @@ const InsuranceSubscriptionScreen = ({
const [insurance, setInsurance] = useState(null); const [insurance, setInsurance] = useState(null);
const [amountPerMonth, setAmountPerMonth] = useState(null); const [amountPerMonth, setAmountPerMonth] = useState(null);
useEffect(() => {
console.log("amountPerMonth", amountPerMonth);
});
const [firstNameBeneficiary, setFirstNameBeneficiary] = useState(null); const [firstNameBeneficiary, setFirstNameBeneficiary] = useState(null);
const [lastNameBeneficiary, setLastNameBeneficiary] = useState(null); const [lastNameBeneficiary, setLastNameBeneficiary] = useState(null);
const [password, setPassword] = useState(null);
let fileToSendTemp = new FormData(); let fileToSendTemp = new FormData();
let [fileToSend, setFileToSend] = useState(null); let [fileToSend, setFileToSend] = useState(null);
let [fileAdded, setFileAdded] = useState([]); 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 [dateNaissance, setDateNaissance] = useState('' + moment(new Date(((new Date()).getFullYear() - 5), 0, 1)).format('YYYY-MM-DD'));
const [showDateNaissancePicker, setShowDateNaissancePicker] = useState(false); const [showDateNaissancePicker, setShowDateNaissancePicker] = useState(false);
const [showModalDetail, setShowModalDetail] = useState(false); const [showModalDetail, setShowModalDetail] = useState(false);
const [modalViewBeneficiariesVisible, setModalViewBeneficiariesVisible] = useState(false);
const [gender, setGender] = useState('M'); const [gender, setGender] = useState('M');
const [affiliations] = useState([ const [affiliations] = useState([
{label: I18n.t('ENFANT'), value: "CHILD"}, {label: I18n.t('ENFANT'), value: "CHILD"},
@ -245,6 +254,7 @@ const InsuranceSubscriptionScreen = ({
let currentYearMinusFiveYear = new Date(((new Date()).getFullYear() - 5), 0, 1); let currentYearMinusFiveYear = new Date(((new Date()).getFullYear() - 5), 0, 1);
let [currentYearMinusAgeLimit, setCurrentYearMinusAgeLimit] = useState(new Date(((new Date()).getFullYear() - 5), 0, 1)); let [currentYearMinusAgeLimit, setCurrentYearMinusAgeLimit] = useState(new Date(((new Date()).getFullYear() - 5), 0, 1));
let insurancesRef = null; let insurancesRef = null;
let amountPerMonthRef = null;
useEffect(() => { useEffect(() => {
readUser().then((user) => { readUser().then((user) => {
@ -262,15 +272,12 @@ const InsuranceSubscriptionScreen = ({
}, [user]); }, [user]);
useEffect(()=>{ useEffect(()=>{
console.log("insurance", insurance); console.log('Beneficiaries', beneficiaries);
console.log("Insurances", insurances); }, [beneficiaries]);
if (insurance !== null) {
if (affiliation === 'CHILD') useEffect(() => {
setCurrentYearMinusAgeLimit(new Date(((new Date()).getFullYear() - parseInt(insurance.age_limit_of_child_beneficiary)), 0, 1)); console.log("currentYearMinusAgeLimit", currentYearMinusAgeLimit);
else }, currentYearMinusAgeLimit);
setCurrentYearMinusAgeLimit(new Date(((new Date()).getFullYear() - parseInt(insurance.age_limit_of_insured_and_spouse)), 0, 1));
}
}, [insurance]);
useEffect(() => { useEffect(() => {
if (insuranceList.result !== null) { if (insuranceList.result !== null) {
@ -299,6 +306,7 @@ const InsuranceSubscriptionScreen = ({
[ [
{ {
text: I18n.t("OK"), onPress: () => { text: I18n.t("OK"), onPress: () => {
dispatch(fetchSubscribeInsuranceReset());
navigation.goBack(); navigation.goBack();
} }
} }
@ -332,10 +340,15 @@ const InsuranceSubscriptionScreen = ({
} }
}, [insurancePrimeAmount]); }, [insurancePrimeAmount]);
useEffect(() => {
console.log("affiliation", affiliation);
}, [affiliation]);
useEffect(() => { useEffect(() => {
if (uploadInsuranceImages.result !== null) { if (uploadInsuranceImages.result !== null) {
setModalVisible(false); setModalVisible(false);
if (insurance !== null) {
if (beneficiaries.length === parseInt(insurance.max_number_of_beneficiaries)) { if (beneficiaries.length === parseInt(insurance.max_number_of_beneficiaries)) {
dropDownAlertRef.alertWithType( dropDownAlertRef.alertWithType(
'error', 'error',
@ -343,8 +356,9 @@ const InsuranceSubscriptionScreen = ({
I18n.t('NUMBER_MAX_BENEFICIARY'), I18n.t('NUMBER_MAX_BENEFICIARY'),
); );
} else { } else {
if (affiliation === 'CHILD') { console.log("affiliation", affiliation);
setBeneficiaries(beneficiaries.push({ let beneficiariesTemp = beneficiaries;
setBeneficiaries([{
lastname: lastNameBeneficiary, lastname: lastNameBeneficiary,
firstname: firstNameBeneficiary, firstname: firstNameBeneficiary,
gender: gender, gender: gender,
@ -353,24 +367,11 @@ const InsuranceSubscriptionScreen = ({
birthdate_proof: childAyantDroitDocument[0].checboxSelectedValue, birthdate_proof: childAyantDroitDocument[0].checboxSelectedValue,
birthdate_proof_doc: uploadInsuranceImages.result.response[0], birthdate_proof_doc: uploadInsuranceImages.result.response[0],
justice_doc: uploadInsuranceImages.result.response.length > 1 ? uploadInsuranceImages.result.response[1] : null, 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], marriage_certificate_doc: uploadInsuranceImages.result.response[0],
id_document_type: "CNI", id_document_type: "CNI",
id_document_front: uploadInsuranceImages.result.response[1] || null, id_document_front: uploadInsuranceImages.result.response[1],
id_document_back: uploadInsuranceImages.result.response[2] || null id_document_back: uploadInsuranceImages.result.response[2]
})) }, ...beneficiaries]);
}
dropDownAlertRef.alertWithType( dropDownAlertRef.alertWithType(
'success', 'success',
I18n.t('SUCCESS'), I18n.t('SUCCESS'),
@ -378,8 +379,7 @@ const InsuranceSubscriptionScreen = ({
); );
setModalVisible(false); setModalVisible(false);
} }
}
} }
if (uploadInsuranceImages.error) { if (uploadInsuranceImages.error) {
@ -463,7 +463,7 @@ const InsuranceSubscriptionScreen = ({
} }
]); ]);
const renderModalAmountDetail = (password) => ( const renderModalAmountDetail = () => (
<Dialog.Container useNativeDriver={true} visible={showModalDetail}> <Dialog.Container useNativeDriver={true} visible={showModalDetail}>
<Dialog.Title>{I18n.t('DETAIL')}</Dialog.Title> <Dialog.Title>{I18n.t('DETAIL')}</Dialog.Title>
@ -487,8 +487,10 @@ const InsuranceSubscriptionScreen = ({
network_id: insurance.id, network_id: insurance.id,
user_id: user.id, user_id: user.id,
password: password, password: password,
beneficiaries,
month_price_id: insurance.months_prices.filter(item => item.checked)[0].id, month_price_id: insurance.months_prices.filter(item => item.checked)[0].id,
}) });
dispatch(fetchGetInsurancePrimeAmountReset());
setShowModalDetail(false); setShowModalDetail(false);
}}/> }}/>
</Dialog.Container> </Dialog.Container>
@ -496,10 +498,8 @@ const InsuranceSubscriptionScreen = ({
const handleTakePhotoFromCamera = (name, isFrontCamera = false) => { const handleTakePhotoFromCamera = (name, isFrontCamera = false) => {
ImagePicker.openCamera({ ImagePicker.openCamera({
width: isFrontCamera ? 800 : 3024,
height: isFrontCamera ? 800 : 4032,
cropping: true, cropping: true,
useFrontCamera: true compressImageQuality: 0.7
}).then(image => { }).then(image => {
if (affiliation === "CHILD") { if (affiliation === "CHILD") {
let tempChildAyantDroitDocument = childAyantDroitDocument; let tempChildAyantDroitDocument = childAyantDroitDocument;
@ -561,7 +561,7 @@ const InsuranceSubscriptionScreen = ({
setDateNaissance(currentDate); setDateNaissance(currentDate);
}; };
const onSelectAmountPerMonth = selected => { const onSelectAmountPerMonth = () => {
let insuranceTemp = insurance; let insuranceTemp = insurance;
setInsurance( setInsurance(
{ {
@ -575,7 +575,6 @@ const InsuranceSubscriptionScreen = ({
id: item.id, id: item.id,
number_of_months: item.number_of_months, number_of_months: item.number_of_months,
min_amount: item.min_amount, min_amount: item.min_amount,
checked: item.id === selected.id,
}; };
}) })
} }
@ -583,19 +582,90 @@ const InsuranceSubscriptionScreen = ({
}; };
const renderDateNaissancePicker = () => { const renderDateNaissancePicker = () => {
return ( return (<DateTimePicker
<DateTimePicker
timeZoneOffsetInMinutes={0} timeZoneOffsetInMinutes={0}
is24Hour={true} is24Hour={true}
value={new Date(dateNaissance)} value={new Date(dateNaissance)}
mode='date' mode='date'
minimumDate={currentYearMinusAgeLimit} maximumDate={currentYearMinusAgeLimit}
display="spinner" display="spinner"
onChange={onChangeDateNaissance} 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 = () => ( const renderAddNewIdentification = () => (
<Formik validationSchema={AddBeneficiarySchema} <Formik validationSchema={AddBeneficiarySchema}
initialValues={{ initialValues={{
@ -717,6 +787,10 @@ const InsuranceSubscriptionScreen = ({
height={32} height={32}
onPress={(value) => { onPress={(value) => {
setFileAdded([]); 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); setAffliliation(value);
}}/> }}/>
</View> </View>
@ -866,6 +940,7 @@ const InsuranceSubscriptionScreen = ({
)} )}
</Formik> </Formik>
); );
return ( return (
<ScreenComponent> <ScreenComponent>
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/> <DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
@ -884,6 +959,7 @@ const InsuranceSubscriptionScreen = ({
insurancesRef.shake(800); insurancesRef.shake(800);
} else { } else {
console.log(user); console.log(user);
setPassword(values.password);
fetchGetInsurancePrimeAmount({ fetchGetInsurancePrimeAmount({
network_id: insurance.id, network_id: insurance.id,
month_price_id: insurance.months_prices.filter(item => item.checked)[0].id, month_price_id: insurance.months_prices.filter(item => item.checked)[0].id,
@ -933,11 +1009,11 @@ const InsuranceSubscriptionScreen = ({
id: item.id, id: item.id,
number_of_months: item.number_of_months, number_of_months: item.number_of_months,
min_amount: item.min_amount, min_amount: item.min_amount,
checked: index === 0,
}; };
}) })
} }
); );
setAmountPerMonth(value.months_prices[0]);
}} }}
valueExtractor={(value) => { valueExtractor={(value) => {
return value return value
@ -984,44 +1060,44 @@ const InsuranceSubscriptionScreen = ({
error={errors.name} 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 && 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> <Text headline semibold>
{I18n.t('AMOUNT_PER_MONTH')} {I18n.t('AMOUNT_PER_MONTH')}
</Text> </Text>
@ -1058,26 +1134,23 @@ const InsuranceSubscriptionScreen = ({
</TouchableOpacity> </TouchableOpacity>
))} ))}
</View> </View>
{/* { </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>
} }
<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 <View
style={{ style={{
flexDirection: 'column', flexDirection: 'column',
@ -1098,7 +1171,9 @@ const InsuranceSubscriptionScreen = ({
setShowDateNaissancePicker(false); setShowDateNaissancePicker(false);
dispatch(fetchUploadInsuranceReset()); dispatch(fetchUploadInsuranceReset());
setAffliliation('CHILD'); 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); setFirstNameBeneficiary(null);
setLastNameBeneficiary(null); setLastNameBeneficiary(null);
setFileAdded([]); setFileAdded([]);
@ -1117,14 +1192,34 @@ const InsuranceSubscriptionScreen = ({
onPress={handleSubmit}> onPress={handleSubmit}>
{I18n.t('SUBMIT_LABEL')} {I18n.t('SUBMIT_LABEL')}
</Button> </Button>
{showModalDetail && renderModalAmountDetail(values.password)} {showModalDetail && renderModalAmountDetail()}
</View> </View>
)} )}
</Formik> </Formik>
</ScrollView> </ScrollView>
</KeyboardAvoidingView> </KeyboardAvoidingView>
{modalVisible && renderAddNewIdentification()} {modalVisible && renderAddNewIdentification()}
{modalViewBeneficiariesVisible && renderModalViewBeneficiaries()}
{showDateNaissancePicker && renderDateNaissancePicker()} {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> </ScreenComponent>
); );
}; };

View File

@ -597,9 +597,10 @@
"PLEASE_SELECT_INSURANCE_BEFORE": "Veuillez d'abord sélectionner une assurance", "PLEASE_SELECT_INSURANCE_BEFORE": "Veuillez d'abord sélectionner une assurance",
"NUMBER_MAX_BENEFICIARY": "Nombre maximum d'ayant droit atteint", "NUMBER_MAX_BENEFICIARY": "Nombre maximum d'ayant droit atteint",
"BENEFICIARY_SUCCESSFULLY_ADDED": "L'ayant droit a été correctement ajouté", "BENEFICIARY_SUCCESSFULLY_ADDED": "L'ayant droit a été correctement ajouté",
"NUMBER_OF_MONTHS": "Nombre de mois", "NUMBER_OF_MONTHS": "Nbre de mois",
"MINIMUM_AMOUNT": "Montant minimum", "MINIMUM_AMOUNT": "Montant min.",
"AMOUNT_PER_MONTH": "Montant par durée de couverture", "AMOUNT_PER_MONTH": "Montant par durée de couverture",
"DETAIL": "Détail", "DETAIL": "Détail",
"PRIME_AMOUNT": "Montant de la prime" "PRIME_AMOUNT": "Montant de la prime",
"AYANT_DROIT": "Ayant(s) droit(s)"
} }

View File

@ -81,10 +81,10 @@ export const getIlinkBankListUrl = testBaseUrl + '/walletService/wallets/users/b
export const linkBankAccountUrl = testBaseUrl + '/walletService/wallets/users/link_bank_account'; export const linkBankAccountUrl = testBaseUrl + '/walletService/wallets/users/link_bank_account';
export const payBillUrl = testBaseUrl + '/walletService/transactions/ilink'; export const payBillUrl = testBaseUrl + '/walletService/transactions/ilink';
export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances/countries'; export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances';
export const subscribeInsuranceUrl = testBaseUrl + '/nanoSanteService/insurances/subscribe'; export const subscribeInsuranceUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions';
export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/bonus-amount'; export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount';
export const uploadInsuranceImagetUrl = 'http://test.ilink-app.com:8086/insurances/upload-images'; export const uploadInsuranceImagetUrl = 'https://test.ilink-app.com:8086/insurances/subscriptions/upload-images';
export const authKeyUrl = testBaseUrl + '/oauth/token'; export const authKeyUrl = testBaseUrl + '/oauth/token';
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY"; export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";