Insurance ok
7
App.js
|
@ -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,
|
||||||
|
@ -133,7 +132,7 @@ const AppStack = createDrawerNavigator({
|
||||||
envoieWalletToCashUser: EnvoieWalletToCashUser,
|
envoieWalletToCashUser: EnvoieWalletToCashUser,
|
||||||
envoieWalletToCardUser: EnvoieWalletToCardUser,
|
envoieWalletToCardUser: EnvoieWalletToCardUser,
|
||||||
envoieWalletToBankUser: EnvoieWalletToBankUser,
|
envoieWalletToBankUser: EnvoieWalletToBankUser,
|
||||||
addBeneficiaryScreen:AddBeneficiaryScreen,
|
addBeneficiaryScreen: AddBeneficiaryScreen,
|
||||||
insuranceSubscriptionScreen: InsuranceSubscriptionScreen,
|
insuranceSubscriptionScreen: InsuranceSubscriptionScreen,
|
||||||
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
||||||
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
||||||
|
@ -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
|
||||||
|
|
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",
|
"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"
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
|
@ -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" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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) => {
|
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,
|
||||||
|
|
|
@ -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()}
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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) => {
|
||||||
|
@ -261,16 +271,13 @@ const InsuranceSubscriptionScreen = ({
|
||||||
fetchGetListInsurance(user.country_id);
|
fetchGetListInsurance(user.country_id);
|
||||||
}, [user]);
|
}, [user]);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
console.log('Beneficiaries', beneficiaries);
|
||||||
|
}, [beneficiaries]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("insurance", insurance);
|
console.log("currentYearMinusAgeLimit", currentYearMinusAgeLimit);
|
||||||
console.log("Insurances", insurances);
|
}, currentYearMinusAgeLimit);
|
||||||
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]);
|
|
||||||
|
|
||||||
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,19 +340,25 @@ 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 (beneficiaries.length === parseInt(insurance.max_number_of_beneficiaries)) {
|
if (insurance !== null) {
|
||||||
dropDownAlertRef.alertWithType(
|
if (beneficiaries.length === parseInt(insurance.max_number_of_beneficiaries)) {
|
||||||
'error',
|
dropDownAlertRef.alertWithType(
|
||||||
I18n.t('ERROR_LABEL'),
|
'error',
|
||||||
I18n.t('NUMBER_MAX_BENEFICIARY'),
|
I18n.t('ERROR_LABEL'),
|
||||||
);
|
I18n.t('NUMBER_MAX_BENEFICIARY'),
|
||||||
} else {
|
);
|
||||||
if (affiliation === 'CHILD') {
|
} else {
|
||||||
setBeneficiaries(beneficiaries.push({
|
console.log("affiliation", affiliation);
|
||||||
|
let beneficiariesTemp = beneficiaries;
|
||||||
|
setBeneficiaries([{
|
||||||
lastname: lastNameBeneficiary,
|
lastname: lastNameBeneficiary,
|
||||||
firstname: firstNameBeneficiary,
|
firstname: firstNameBeneficiary,
|
||||||
gender: gender,
|
gender: gender,
|
||||||
|
@ -353,33 +367,19 @@ 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(
|
||||||
|
'success',
|
||||||
|
I18n.t('SUCCESS'),
|
||||||
|
I18n.t('BENEFICIARY_SUCCESSFULLY_ADDED'),
|
||||||
|
);
|
||||||
|
setModalVisible(false);
|
||||||
}
|
}
|
||||||
dropDownAlertRef.alertWithType(
|
|
||||||
'success',
|
|
||||||
I18n.t('SUCCESS'),
|
|
||||||
I18n.t('BENEFICIARY_SUCCESSFULLY_ADDED'),
|
|
||||||
);
|
|
||||||
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>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -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)"
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
||||||
|
|