Nano sante utilisateur OK
This commit is contained in:
parent
6b01bc8f14
commit
2767c26524
4
App.js
4
App.js
|
@ -85,6 +85,8 @@ import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAg
|
|||
import ReattachAccountUser from "./screens/wallet/user/ReattachAccountUser";
|
||||
import InsuranceSubscriptionScreen from "./screens/wallet/user/InsuranceSubscriptionScreen";
|
||||
import AddBeneficiaryScreen from "./screens/wallet/user/AddBeneficiaryScreen";
|
||||
import ActivateBuySubscriptionScreen from "./screens/wallet/user/ActivateBuySubscriptionScreen";
|
||||
import SaisirFeuilleSoinScreen from "./screens/wallet/agent/SaisirFeuilleSoinScreen";
|
||||
|
||||
|
||||
const instructions = Platform.select({
|
||||
|
@ -134,6 +136,7 @@ const AppStack = createDrawerNavigator({
|
|||
envoieWalletToBankUser: EnvoieWalletToBankUser,
|
||||
addBeneficiaryScreen: AddBeneficiaryScreen,
|
||||
insuranceSubscriptionScreen: InsuranceSubscriptionScreen,
|
||||
activateBuySubscriptionScreen: ActivateBuySubscriptionScreen,
|
||||
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
||||
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
||||
retraitCarteVersWalletUser: RetraitCarteVersWalletUser,
|
||||
|
@ -248,6 +251,7 @@ const AppAgentStack = createDrawerNavigator({
|
|||
|
||||
historyItemDetails: HistoryItemDetails,
|
||||
creditrequest: HistoryRequester,
|
||||
saisirFeuilleSoinScreen: SaisirFeuilleSoinScreen,
|
||||
addNetwork: AddNetwork,
|
||||
updateinformation: UpdateInformations,
|
||||
notificationview: Notifications,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -597,9 +597,11 @@
|
|||
"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)",
|
||||
"SELECT_SUBSCRIPTION": "Sélectionner une souscription"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
/**
|
||||
* Project iLinkWorld
|
||||
* File StepHeaderComponent
|
||||
* Path components
|
||||
* Created by BRICE ZELE
|
||||
* Date: 11/11/2021
|
||||
*/
|
||||
/**
|
||||
* Project yoolearn-mobile
|
||||
* File StepHeader
|
||||
* Path app/components
|
||||
* Created by BRICE ZELE
|
||||
* Date: 17/10/2021
|
||||
*/
|
||||
import React from 'react';
|
||||
import {StyleSheet, View} from 'react-native';
|
||||
import {Color} from "../config/Color";
|
||||
|
||||
const Circle = ({index, selectedIndex}) => {
|
||||
return (
|
||||
<View
|
||||
style={
|
||||
index === selectedIndex
|
||||
? {
|
||||
...styles.circle,
|
||||
backgroundColor: Color.whiteColor,
|
||||
borderColor: Color.primaryColor,
|
||||
}
|
||||
: {
|
||||
...styles.circle,
|
||||
backgroundColor: Color.primaryColor,
|
||||
borderColor: Color.primaryColor,
|
||||
}
|
||||
}>
|
||||
<Text
|
||||
style={
|
||||
index === selectedIndex
|
||||
? styles.selectedcircleTitle
|
||||
: styles.circleTitle
|
||||
}>
|
||||
{index}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const StepHeader = props => {
|
||||
const MAX_NUMBER_LINES = 2;
|
||||
const {steps, currentStepIndex} = props;
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{steps.map((step, index) => (
|
||||
<View key={index} style={styles.stepContainer}>
|
||||
<Circle selectedIndex={currentStepIndex} index={++index}/>
|
||||
<Text
|
||||
numberOfLines={MAX_NUMBER_LINES}
|
||||
ellipsizeMode="tail"
|
||||
style={styles.titleCircle}>
|
||||
{step.title}
|
||||
</Text>
|
||||
</View>
|
||||
))}
|
||||
<View style={[styles.line, {borderBottomColor: Color.primaryColor}]}/>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default StepHeader;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
width: '100%',
|
||||
},
|
||||
stepContainer: {
|
||||
flexDirection: 'column',
|
||||
padding: 10,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
titleCircle: {
|
||||
marginTop: 10,
|
||||
fontSize: 12,
|
||||
paddingBottom: 10,
|
||||
},
|
||||
line: {
|
||||
borderBottomWidth: 1,
|
||||
justifyContent: 'center',
|
||||
width: '80%',
|
||||
position: 'absolute',
|
||||
top: 35,
|
||||
zIndex: 1,
|
||||
marginHorizontal: 20,
|
||||
},
|
||||
circle: {
|
||||
borderWidth: 1,
|
||||
borderRadius: 50,
|
||||
width: 30,
|
||||
height: 30,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
marginTop: 10,
|
||||
zIndex: 10,
|
||||
},
|
||||
circleTitle: {
|
||||
fontSize: 12,
|
||||
color: '#fff',
|
||||
},
|
||||
selectedcircleTitle: {
|
||||
fontSize: 12,
|
||||
color: '#2E81D3',
|
||||
},
|
||||
});
|
File diff suppressed because it is too large
Load Diff
|
@ -85,6 +85,7 @@
|
|||
"react-native-textinput-effects": "^0.5.1",
|
||||
"react-native-vector-icons": "^6.5.0",
|
||||
"react-native-webview": "^11.6.2",
|
||||
"react-native-wizard": "^2.1.0",
|
||||
"react-navigation": "3.11.0",
|
||||
"react-navigation-drawer": "^1.4.0",
|
||||
"react-navigation-material-bottom-tabs": "^1.0.0",
|
||||
|
|
|
@ -34,7 +34,7 @@ export const fetchGetListInsuranceError = (error: any) => ({
|
|||
|
||||
export const fetchGetListInsurance = (idCountry) => {
|
||||
return ApiAction({
|
||||
url: `${getInsuranceListUrl}?country_id=${idCountry}`,
|
||||
url: `${getInsuranceListUrl}/networks?country_id=${idCountry}`,
|
||||
method: 'GET',
|
||||
onLoading: fetchGetListInsurancePending,
|
||||
onSuccess: fetchGetListInsuranceSuccess,
|
||||
|
@ -132,3 +132,92 @@ export const fetchUploadInsurance = (data) => {
|
|||
onError: fetchUploadInsuranceError,
|
||||
});
|
||||
};
|
||||
|
||||
/************************************************************/
|
||||
export const fetchGetSubscriptionListPending = () => ({
|
||||
type: InsuranceActions.GET_SUBSCRIPTION_LIST_PENDING,
|
||||
});
|
||||
|
||||
export const fetchGetSubscriptionListReset = () => ({
|
||||
type: InsuranceActions.GET_SUBSCRIPTION_LIST_RESET,
|
||||
});
|
||||
|
||||
export const fetchGetSubscriptionListSuccess = (authkey: any) => ({
|
||||
type: InsuranceActions.GET_SUBSCRIPTION_LIST_SUCCESS,
|
||||
payload: authkey,
|
||||
});
|
||||
|
||||
export const fetchGetSubscriptionListError = (error: any) => ({
|
||||
type: InsuranceActions.GET_SUBSCRIPTION_LIST_ERROR,
|
||||
payload: error,
|
||||
});
|
||||
|
||||
export const fetchGetSubscriptionList = (idUser, type, includeSubscription = true) => {
|
||||
return ApiAction({
|
||||
url: includeSubscription ? `${getInsuranceListUrl}/subscriptions?user_id=${idUser}&type=${type}` : `${getInsuranceListUrl}?user_id=${idUser}&type=${type}`,
|
||||
method: 'GET',
|
||||
onLoading: fetchGetSubscriptionListPending,
|
||||
onSuccess: fetchGetSubscriptionListSuccess,
|
||||
onError: fetchGetSubscriptionListError,
|
||||
});
|
||||
};
|
||||
|
||||
/************************************************************/
|
||||
export const fetchActivePaySubscriptionPending = () => ({
|
||||
type: InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_PENDING,
|
||||
});
|
||||
|
||||
export const fetchActivePaySubscriptionReset = () => ({
|
||||
type: InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_RESET,
|
||||
});
|
||||
|
||||
export const fetchActivePaySubscriptionSuccess = (authkey: any) => ({
|
||||
type: InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_SUCCESS,
|
||||
payload: authkey,
|
||||
});
|
||||
|
||||
export const fetchActivePaySubscriptionError = (error: any) => ({
|
||||
type: InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_ERROR,
|
||||
payload: error,
|
||||
});
|
||||
|
||||
export const fetchActivePaySubscription = (id, data) => {
|
||||
return ApiAction({
|
||||
url: `${subscribeInsuranceUrl}/${id}/pay`,
|
||||
data,
|
||||
method: 'PUT',
|
||||
onLoading: fetchActivePaySubscriptionPending,
|
||||
onSuccess: fetchActivePaySubscriptionSuccess,
|
||||
onError: fetchActivePaySubscriptionError,
|
||||
});
|
||||
};
|
||||
|
||||
/************************************************************/
|
||||
export const fetchAddBeneficiaryToSubscriptionPending = () => ({
|
||||
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_PENDING,
|
||||
});
|
||||
|
||||
export const fetchAddBeneficiaryToSubscriptionReset = () => ({
|
||||
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_RESET,
|
||||
});
|
||||
|
||||
export const fetchAddBeneficiaryToSubscriptionSuccess = (authkey: any) => ({
|
||||
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_SUCCESS,
|
||||
payload: authkey,
|
||||
});
|
||||
|
||||
export const fetchAddBeneficiaryToSubscriptionError = (error: any) => ({
|
||||
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_ERROR,
|
||||
payload: error,
|
||||
});
|
||||
|
||||
export const fetchAddBeneficiaryToSubscription = (id, data) => {
|
||||
return ApiAction({
|
||||
url: `${getInsuranceListUrl}/${id}/add-beneficiaries`,
|
||||
data,
|
||||
method: 'PUT',
|
||||
onLoading: fetchAddBeneficiaryToSubscriptionPending,
|
||||
onSuccess: fetchAddBeneficiaryToSubscriptionSuccess,
|
||||
onError: fetchAddBeneficiaryToSubscriptionError,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -137,3 +137,93 @@ export const uploadInsuranceImagesReducer = (state = INITIAL_STATE, action: Insu
|
|||
|
||||
}
|
||||
};
|
||||
|
||||
export const getSubscriptionListReducer = (state = INITIAL_STATE, action: InsuranceActions) => {
|
||||
switch (action.type) {
|
||||
case InsuranceActions.GET_SUBSCRIPTION_LIST_PENDING:
|
||||
return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case InsuranceActions.GET_SUBSCRIPTION_LIST_SUCCESS:
|
||||
return {
|
||||
loading: false,
|
||||
result: action.payload,
|
||||
error: null
|
||||
}
|
||||
case InsuranceActions.GET_SUBSCRIPTION_LIST_ERROR:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.payload
|
||||
}
|
||||
|
||||
case InsuranceActions.GET_SUBSCRIPTION_LIST_RESET:
|
||||
return INITIAL_STATE;
|
||||
|
||||
default:
|
||||
return state
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
export const activatePaySubscriptionReducer = (state = INITIAL_STATE, action: InsuranceActions) => {
|
||||
switch (action.type) {
|
||||
case InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_PENDING:
|
||||
return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_SUCCESS:
|
||||
return {
|
||||
loading: false,
|
||||
result: action.payload,
|
||||
error: null
|
||||
}
|
||||
case InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_ERROR:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.payload
|
||||
}
|
||||
|
||||
case InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_RESET:
|
||||
return INITIAL_STATE;
|
||||
|
||||
default:
|
||||
return state
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
export const addBeneficiaryToSubscriptionReducer = (state = INITIAL_STATE, action: InsuranceActions) => {
|
||||
switch (action.type) {
|
||||
case InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_PENDING:
|
||||
return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_SUCCESS:
|
||||
return {
|
||||
loading: false,
|
||||
result: action.payload,
|
||||
error: null
|
||||
}
|
||||
case InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_ERROR:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.payload
|
||||
}
|
||||
|
||||
case InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_RESET:
|
||||
return INITIAL_STATE;
|
||||
|
||||
default:
|
||||
return state
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -11,6 +11,9 @@ const selectInsuranceListReducer = (state) => state.insuranceList;
|
|||
const selectSubscribeInsuranceReducer = (state) => state.subscribeInsurance;
|
||||
const selectInsurancePrimeAmountReducer = (state) => state.insurancePrimeAmount;
|
||||
const selectUploadInsuranceImagesReducerReducer = (state) => state.uploadInsuranceImagesReducer;
|
||||
const selectGetSubscriptionListReducerReducer = (state) => state.subscriptionList;
|
||||
const selectActivatePaySubscriptionReducer = (state) => state.activatePaySubscription;
|
||||
const selectAddBeneficiaryToSubscriptionReducer = (state) => state.addBeneficiaryToSubscription;
|
||||
|
||||
export const selectInsuranceList = createSelector(
|
||||
[selectInsuranceListReducer],
|
||||
|
@ -31,3 +34,18 @@ export const selectUploadInsuranceImages = createSelector(
|
|||
[selectUploadInsuranceImagesReducerReducer],
|
||||
(uploadInsuranceImagesReducer) => uploadInsuranceImagesReducer
|
||||
);
|
||||
|
||||
export const selectSubscriptionList = createSelector(
|
||||
[selectGetSubscriptionListReducerReducer],
|
||||
(subscriptionList) => subscriptionList
|
||||
);
|
||||
|
||||
export const selectAddBeneficiaryToSubscription = createSelector(
|
||||
[selectAddBeneficiaryToSubscriptionReducer],
|
||||
(addBeneficiaryToSubscription) => addBeneficiaryToSubscription
|
||||
);
|
||||
|
||||
export const selectActivatePaySubscription = createSelector(
|
||||
[selectActivatePaySubscriptionReducer],
|
||||
(activatePaySubscription) => activatePaySubscription
|
||||
);
|
||||
|
|
|
@ -24,6 +24,23 @@ const InsuranceActions = {
|
|||
UPLOAD_INSURANCE_IMAGES_PENDING: 'UPLOAD_INSURANCE_IMAGES_PENDING',
|
||||
UPLOAD_INSURANCE_IMAGES_SUCCESS: 'UPLOAD_INSURANCE_IMAGES_SUCCESS',
|
||||
UPLOAD_INSURANCE_IMAGES_ERROR: 'UPLOAD_INSURANCE_IMAGES_ERROR',
|
||||
UPLOAD_INSURANCE_IMAGES_RESET: 'UPLOAD_INSURANCE_IMAGES_RESET'
|
||||
UPLOAD_INSURANCE_IMAGES_RESET: 'UPLOAD_INSURANCE_IMAGES_RESET',
|
||||
|
||||
GET_SUBSCRIPTION_LIST_PENDING: 'GET_SUBSCRIPTION_LIST_PENDING',
|
||||
GET_SUBSCRIPTION_LIST_SUCCESS: 'GET_SUBSCRIPTION_LIST_SUCCESS',
|
||||
GET_SUBSCRIPTION_LIST_ERROR: 'GET_SUBSCRIPTION_LIST_ERROR',
|
||||
GET_SUBSCRIPTION_LIST_RESET: 'GET_SUBSCRIPTION_LIST_RESET',
|
||||
|
||||
ACTIVATE_PAY_SUBSCRIPTION_PENDING: 'ACTIVATE_PAY_SUBSCRIPTION_PENDING',
|
||||
ACTIVATE_PAY_SUBSCRIPTION_SUCCESS: 'ACTIVATE_PAY_SUBSCRIPTION_SUCCESS',
|
||||
ACTIVATE_PAY_SUBSCRIPTION_ERROR: 'ACTIVATE_PAY_SUBSCRIPTION_ERROR',
|
||||
ACTIVATE_PAY_SUBSCRIPTION_RESET: 'ACTIVATE_PAY_SUBSCRIPTION_RESET',
|
||||
|
||||
ADD_BENEFICIARY_TO_SUBSCRIPTION_PENDING: 'ADD_BENEFICIARY_TO_SUBSCRIPTION_PENDING',
|
||||
ADD_BENEFICIARY_TO_SUBSCRIPTION_SUCCESS: 'ADD_BENEFICIARY_TO_SUBSCRIPTION_SUCCESS',
|
||||
ADD_BENEFICIARY_TO_SUBSCRIPTION_ERROR: 'ADD_BENEFICIARY_TO_SUBSCRIPTION_ERROR',
|
||||
ADD_BENEFICIARY_TO_SUBSCRIPTION_RESET: 'ADD_BENEFICIARY_TO_SUBSCRIPTION_RESET',
|
||||
|
||||
|
||||
}
|
||||
export default InsuranceActions;
|
||||
|
|
|
@ -51,9 +51,13 @@ import PayBillReducer from "./PayBillReducer";
|
|||
import GetIlinkBankReducer from "./GetIlinkBankReducer";
|
||||
import ReattachAccountReducer from "./ReattachAccountReducer";
|
||||
import {
|
||||
activatePaySubscriptionReducer,
|
||||
addBeneficiaryToSubscriptionReducer,
|
||||
getInsurancePrimeAmountReducer,
|
||||
getSubscriptionListReducer,
|
||||
insuranceListReducer,
|
||||
subscribeInsuranceReducer, uploadInsuranceImagesReducer
|
||||
subscribeInsuranceReducer,
|
||||
uploadInsuranceImagesReducer
|
||||
} from "../insurance/insurance.reducer";
|
||||
|
||||
const persistConfig = {
|
||||
|
@ -144,7 +148,10 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
|||
insuranceList: insuranceListReducer,
|
||||
subscribeInsurance: subscribeInsuranceReducer,
|
||||
insurancePrimeAmount: getInsurancePrimeAmountReducer,
|
||||
uploadInsuranceImagesReducer: uploadInsuranceImagesReducer
|
||||
uploadInsuranceImagesReducer: uploadInsuranceImagesReducer,
|
||||
subscriptionList: getSubscriptionListReducer,
|
||||
activatePaySubscription: activatePaySubscriptionReducer,
|
||||
addBeneficiaryToSubscription: addBeneficiaryToSubscriptionReducer
|
||||
});
|
||||
|
||||
export default rootReducer;
|
||||
|
|
|
@ -67,5 +67,6 @@
|
|||
"reattachAccountUser": "reattachAccountUser",
|
||||
"acceptPrestationAgent": "acceptPrestationAgent",
|
||||
"souscrireAssuranceUser": "souscrireAssuranceUser",
|
||||
"askPrestationUser": "askPrestationUser"
|
||||
"askPrestationUser": "askPrestationUser",
|
||||
"saisirFeuilleSoinScreen": "saisirFeuilleSoinScreen"
|
||||
}
|
||||
|
|
|
@ -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()}
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
import React, {Component} from 'react';
|
||||
import { Alert, ActivityIndicator, StyleSheet, Text, View, Image, ScrollView, Platform, ProgressBarAndroid, PermissionsAndroid, Keyboard } from 'react-native';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
Alert,
|
||||
Keyboard,
|
||||
PermissionsAndroid,
|
||||
Platform,
|
||||
ProgressBarAndroid,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View
|
||||
} from 'react-native';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
||||
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||
import { responsiveHeight, responsiveWidth, responsiveFontSize } from 'react-native-responsive-dimensions';
|
||||
import { Fumi, Kaede } from 'react-native-textinput-effects'
|
||||
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||
import {Fumi} from 'react-native-textinput-effects'
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import Button from 'apsl-react-native-button';
|
||||
let theme = require('./../../utils/theme.json');
|
||||
let route = require('./../../route.json');
|
||||
import I18n from 'react-native-i18n';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
|
@ -18,13 +23,21 @@ import DateTimePicker from '@react-native-community/datetimepicker';
|
|||
import {Dropdown} from 'react-native-material-dropdown';
|
||||
import {getPositionInformation} from './../../webservice/MapService';
|
||||
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||
import { getCountryNetwork, createGeolocatedAccount, createUserAccount, getTownInformationName, getListCountriesActive, getCodeInformation, readUser } from './../../webservice/AuthApi';
|
||||
import { SinglePickerMaterialDialog, MultiPickerMaterialDialog, MaterialDialog } from "react-native-material-dialog";
|
||||
import {getListCountriesActive, getTownInformationName, readUser} from './../../webservice/AuthApi';
|
||||
import {MaterialDialog} from "react-native-material-dialog";
|
||||
import Geolocation from 'react-native-geolocation-service';
|
||||
import {identityPieces} from '../../utils/UtilsFunction';
|
||||
import {connect} from 'react-redux';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import { createIndentificationAction, createIndentificationResetAction, getUserIdentificationAction } from '../../webservice/IdentificationApi';
|
||||
import {
|
||||
createIndentificationAction,
|
||||
createIndentificationResetAction,
|
||||
getUserIdentificationAction
|
||||
} from '../../webservice/IdentificationApi';
|
||||
import SwitchSelector from "react-native-switch-selector";
|
||||
|
||||
let theme = require('./../../utils/theme.json');
|
||||
let route = require('./../../route.json');
|
||||
const GEOLOCATION_OPTIONS = {enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true};
|
||||
const moment = require('moment');
|
||||
|
||||
|
@ -78,7 +91,12 @@ class CreateIdentificationUser extends Component {
|
|||
modalVisible: true,
|
||||
select_network: I18n.t("SELECT_NETWORK"),
|
||||
user: null,
|
||||
triggerSubmitClick: false
|
||||
triggerSubmitClick: false,
|
||||
sexe: [
|
||||
{label: I18n.t('MASCULIN'), value: "M"},
|
||||
{label: I18n.t('FEMININ'), value: "F"},
|
||||
],
|
||||
gender: 'M'
|
||||
};
|
||||
this.dateNaissanceFumiProps = {};
|
||||
this.dateExpirationFumiProps = {};
|
||||
|
@ -189,7 +207,11 @@ class CreateIdentificationUser extends Component {
|
|||
text: "Recommencer", onPress: () => {
|
||||
this.watchLocation()
|
||||
}
|
||||
}, { text: "Annuler", onPress: () => { this.props.navigation.popToTop() } }])
|
||||
}, {
|
||||
text: "Annuler", onPress: () => {
|
||||
this.props.navigation.popToTop()
|
||||
}
|
||||
}])
|
||||
}
|
||||
|
||||
async watchLocation() {
|
||||
|
@ -199,7 +221,11 @@ class CreateIdentificationUser extends Component {
|
|||
this.showErrorDialog()
|
||||
}, this.props.geolocationOptions);
|
||||
if (!this.watchID) {
|
||||
Geolocation.watchPosition((position) => { this.treatPosition(position) }, (e) => { this.showErrorDialog() }, this.props.geolocationOptions)
|
||||
Geolocation.watchPosition((position) => {
|
||||
this.treatPosition(position)
|
||||
}, (e) => {
|
||||
this.showErrorDialog()
|
||||
}, this.props.geolocationOptions)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -339,7 +365,15 @@ class CreateIdentificationUser extends Component {
|
|||
}
|
||||
|
||||
onSubmitIdentityClient = () => {
|
||||
const { lastname, numeroIdentite, dateNaissance, dateExpiration, country, townName, identityPiecesName } = this.state;
|
||||
const {
|
||||
lastname,
|
||||
numeroIdentite,
|
||||
dateNaissance,
|
||||
dateExpiration,
|
||||
country,
|
||||
townName,
|
||||
identityPiecesName
|
||||
} = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(lastname))
|
||||
this.lastnameAnim.shake(800);
|
||||
|
@ -366,7 +400,8 @@ class CreateIdentificationUser extends Component {
|
|||
id_identity_document: this.state.numeroIdentite,
|
||||
expiry_date_document: moment(this.state.dateExpiration).format('DD-MM-YYYY'),
|
||||
phone_number: null,
|
||||
id_user: this.state.user.id
|
||||
id_user: this.state.user.id,
|
||||
gender: this.state.gender
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
|
@ -438,7 +473,9 @@ class CreateIdentificationUser extends Component {
|
|||
{this.state.triggerSubmitClick && this.renderCreateIdentificationResponse()}
|
||||
<ScrollView style={styles.container}>
|
||||
<Text style={styles.subbigtitle}>{I18n.t('CREATE_IDENTIFICATION_TITLE')}</Text>
|
||||
<Animatable.View ref={(comp) => { this.lastnameAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.lastnameAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
||||
label={`${I18n.t('NAME')} ${I18n.t('AND')} ${I18n.t('FIRSTNAME')}`}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -451,7 +488,9 @@ class CreateIdentificationUser extends Component {
|
|||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
<Animatable.View ref={(comp) => { this.datenaissanceAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.datenaissanceAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar'}
|
||||
label={I18n.t('DATE_NAISSANCE')}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -464,7 +503,9 @@ class CreateIdentificationUser extends Component {
|
|||
{...this.dateNaissanceFumiProps}>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
<Animatable.View ref={(comp) => { this.countryAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.countryAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -484,11 +525,17 @@ class CreateIdentificationUser extends Component {
|
|||
onChangeText={(value, index, data) => {
|
||||
this.setState({country: value});
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
valueExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
/>
|
||||
</Animatable.View>
|
||||
<Animatable.View ref={(comp) => { this.townAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.townAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -508,11 +555,17 @@ class CreateIdentificationUser extends Component {
|
|||
onChangeText={(value, index, data) => {
|
||||
this.setState({townName: value});
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
valueExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return value.name
|
||||
}}
|
||||
/>
|
||||
</Animatable.View>
|
||||
<Animatable.View ref={(comp) => { this.identityPiecesAnim = comp }}
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.identityPiecesAnim = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
|
@ -531,11 +584,18 @@ class CreateIdentificationUser extends Component {
|
|||
onChangeText={(value, index, data) => {
|
||||
this.setState({identityPiecesName: value});
|
||||
}}
|
||||
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||
valueExtractor={(value) => {
|
||||
return I18n.t(value.name)
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return I18n.t(value.name)
|
||||
}}
|
||||
/>
|
||||
</Animatable.View>
|
||||
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
||||
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.numeroIdentiteAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
||||
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -547,7 +607,9 @@ class CreateIdentificationUser extends Component {
|
|||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
<Animatable.View ref={(comp) => { this.identityDateExpiryAnim = comp }}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
this.identityDateExpiryAnim = comp
|
||||
}}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar-times-o'}
|
||||
label={I18n.t('IDENTITY_PIECE_EXPIRY_DATE')}
|
||||
iconColor={'#f95a25'}
|
||||
|
@ -561,10 +623,36 @@ class CreateIdentificationUser extends Component {
|
|||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
|
||||
<View style={{
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
marginTop: 10,
|
||||
flexDirection: 'row',
|
||||
justifyContent: "space-between"
|
||||
}}>
|
||||
<Text style={{color: Color.whiteColor}}>{I18n.t('SEXE')}</Text>
|
||||
<View style={styles.contentSwitch}>
|
||||
<SwitchSelector options={this.state.sexe}
|
||||
initial={0}
|
||||
buttonColor={Color.accentColor}
|
||||
backgroundColor={Color.primaryDarkColor}
|
||||
textColor='white'
|
||||
bold={true}
|
||||
hasPadding
|
||||
height={32}
|
||||
onPress={(value) => {
|
||||
this.setState({gender: value})
|
||||
}}/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
isLoading={this.state.isLoging}
|
||||
onPress={() => { this.onSubmitIdentityClient() }}>
|
||||
onPress={() => {
|
||||
this.onSubmitIdentityClient()
|
||||
}}>
|
||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||
|
||||
</ScrollView>
|
||||
|
@ -624,5 +712,8 @@ const styles = StyleSheet.create({
|
|||
marginLeft: responsiveWidth(5),
|
||||
marginRight: responsiveWidth(5),
|
||||
borderRadius: 5,
|
||||
}
|
||||
},
|
||||
contentSwitch: {
|
||||
width: responsiveWidth(40),
|
||||
},
|
||||
});
|
|
@ -25,6 +25,7 @@ import { identityPieces } from '../../utils/UtilsFunction';
|
|||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { createIndentificationAction, createIndentificationResetAction, getNumberResetAction, getNumberDetailAction, getUserIdentificationAction } from '../../webservice/IdentificationApi';
|
||||
import SwitchSelector from "react-native-switch-selector";
|
||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
||||
const moment = require('moment');
|
||||
|
||||
|
@ -87,6 +88,11 @@ class CreateIdentification extends Component {
|
|||
triggerNextClick: false,
|
||||
displayFirstStep: true,
|
||||
displaySecondStep: false,
|
||||
sexe: [
|
||||
{label: I18n.t('MASCULIN'), value: "M"},
|
||||
{label: I18n.t('FEMININ'), value: "F"},
|
||||
],
|
||||
gender: 'M'
|
||||
};
|
||||
this.dateNaissanceFumiProps = {};
|
||||
this.dateExpirationFumiProps = {};
|
||||
|
@ -376,7 +382,8 @@ class CreateIdentification extends Component {
|
|||
id_identity_document: this.state.numeroIdentite,
|
||||
expiry_date_document: moment(this.state.dateExpiration).format('DD-MM-YYYY'),
|
||||
phone_number: this.state.numeroTelephone,
|
||||
id_user: this.state.userId
|
||||
id_user: this.state.userId,
|
||||
gender: this.state.gender
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
|
@ -670,6 +677,29 @@ class CreateIdentification extends Component {
|
|||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<View style={{
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
marginTop: 10,
|
||||
flexDirection: 'row',
|
||||
justifyContent: "space-between"
|
||||
}}>
|
||||
<Text style={{color: Color.whiteColor}}>{I18n.t('SEXE')}</Text>
|
||||
<View style={styles.contentSwitch}>
|
||||
<SwitchSelector options={this.state.sexe}
|
||||
initial={0}
|
||||
buttonColor={Color.accentColor}
|
||||
backgroundColor={Color.primaryDarkColor}
|
||||
textColor='white'
|
||||
bold={true}
|
||||
hasPadding
|
||||
height={32}
|
||||
onPress={(value) => {
|
||||
this.setState({gender: value})
|
||||
}}/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}>
|
||||
<Button style={styles.btnSubmit}
|
||||
textStyle={styles.textbtnvalide}
|
||||
|
|
|
@ -272,7 +272,7 @@ export default class OptionsMenu extends Component {
|
|||
|| 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 === 'addBeneficiaryScreen') {
|
||||
|| item === 'addBeneficiaryScreen' || item === 'activateBuySubscriptionScreen' || item === 'saisirFeuilleSoinScreen') {
|
||||
return null
|
||||
} else {
|
||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||
|
|
|
@ -45,7 +45,7 @@ import {
|
|||
optionDepotScreen,
|
||||
optionIdentificationScreen,
|
||||
optionNanoCreditAgentScreen,
|
||||
optionNanoSanteUserScreen,
|
||||
optionNanoSanteAgentScreen,
|
||||
optionPaiementFacture,
|
||||
optionRetraitScreen,
|
||||
transactionHistoryIlinkLabel
|
||||
|
@ -1484,6 +1484,15 @@ class WalletDetail extends Component {
|
|||
<View style={[styles.containerTouch]}>
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => {
|
||||
this.props.navigation.push(route.walletOptionSelect, {
|
||||
optionSelect: optionNanoSanteAgentScreen,
|
||||
wallet,
|
||||
lottie: {
|
||||
source: require("./../../datas/json/cedit-cards.json"),
|
||||
loop: true
|
||||
},
|
||||
isNanoSanteAgent: true
|
||||
});
|
||||
}}
|
||||
activeOpacity={0.9}>
|
||||
<Icon name='heart-multiple'
|
||||
|
|
|
@ -49,6 +49,8 @@ import {getWalletDetailActivated} from "../../webservice/WalletApi";
|
|||
import {getWalletTransactionHistoryUser} from "../../webservice/WalletTransactionHistoryApi";
|
||||
import {getUserIdentificationAction} from "../../webservice/IdentificationApi";
|
||||
import {store} from "../../redux/store";
|
||||
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
|
||||
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||
|
||||
const route = require('./../../route.json');
|
||||
let slugify = require('slugify');
|
||||
|
@ -68,6 +70,7 @@ class WalletOptionSelect extends Component {
|
|||
isIdentified: store.getState().getUserIdentificationReducer.result !== null ? store.getState().getUserIdentificationReducer.result.response.isIdentified : false,
|
||||
isNanoCredit: this.props.navigation.state.params.hasOwnProperty('isNanoCredit'),
|
||||
isNanoSante: this.props.navigation.state.params.hasOwnProperty('isNanoSante'),
|
||||
isNanoSanteAgent: this.props.navigation.state.params.hasOwnProperty('isNanoSanteAgent'),
|
||||
user: null,
|
||||
displayModalHistory: false,
|
||||
historyItemDetail: null,
|
||||
|
@ -296,10 +299,17 @@ class WalletOptionSelect extends Component {
|
|||
}}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name={options.icon}
|
||||
{
|
||||
this.state.isNanoSanteAgent
|
||||
? <FontAwesome name={options.icon}
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner}/>
|
||||
: <Icon name={options.icon}
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner}/>
|
||||
}
|
||||
|
||||
<View style={[styles.content]}>
|
||||
|
||||
|
@ -482,6 +492,92 @@ class WalletOptionSelect extends Component {
|
|||
</View>
|
||||
</>
|
||||
);
|
||||
|
||||
renderNanoSanteAgentAccountDetail = (options) => (
|
||||
<>
|
||||
<View
|
||||
style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||
{/*<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
|
||||
|
||||
<View
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
}}>
|
||||
<View
|
||||
style={[
|
||||
styles.circlePoint,
|
||||
{backgroundColor: Color.primaryColor},
|
||||
]}>
|
||||
<Icons name='md-wallet'
|
||||
size={28}
|
||||
color={Color.whiteColor}
|
||||
/>
|
||||
</View>
|
||||
<View>
|
||||
<Text style={[Typography.title3, Color.primaryColor], {marginBottom: 3}}>
|
||||
{I18n.t('CREDIT_ACCOUNT')}
|
||||
</Text>
|
||||
{this.state.user !== null ?
|
||||
<Text
|
||||
style={[Typography.body2]}>{this.props.result != null ? `${thousands(this.props.result.response.balance_credit, ' ')} ${this.state.wallet.currency_code}` : `${thousands(this.state.user.balance_credit, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
: null}
|
||||
</View>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
}}>
|
||||
<View
|
||||
style={[
|
||||
styles.circlePoint,
|
||||
{backgroundColor: Color.primaryColor},
|
||||
]}>
|
||||
<Icons name='md-key'
|
||||
size={28}
|
||||
color={Color.whiteColor}
|
||||
/>
|
||||
</View>
|
||||
<View>
|
||||
<Text style={[Typography.title3, Color.primaryColor], {marginBottom: 3}}>
|
||||
{I18n.t('SAVINGS_ACCOUNT')}
|
||||
</Text>
|
||||
{this.state.user !== null ?
|
||||
<Text
|
||||
style={[Typography.body2]}>{this.props.result != null ? `${thousands(this.props.result.response.balance_epargne, ' ')} ${this.state.wallet.currency_code}` : `${thousands(this.state.user.balance_epargne, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
: null}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
</View>*/}
|
||||
</View>
|
||||
<View style={{
|
||||
flexDirection: 'row',
|
||||
marginTop: 30,
|
||||
marginBottom: 10,
|
||||
flex: 1,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
}}>
|
||||
<Tag icon={<FontAwesome5 name='money-check-alt' size={20} color={Color.whiteColor}
|
||||
style={{marginLeft: -15}}/>}
|
||||
style={{
|
||||
paddingRight: 10,
|
||||
width: "70%",
|
||||
borderRightWidth: 1,
|
||||
borderRightColor: Color.whiteColor
|
||||
}}
|
||||
primary
|
||||
onPress={() => {
|
||||
//this._scrollView.scrollToEnd();
|
||||
}}>{' ' + I18n.t('FACTURER_FEUILLES_SOINS')}
|
||||
</Tag>
|
||||
|
||||
</View>
|
||||
</>
|
||||
);
|
||||
|
||||
renderHistoryTransactionList = () => {
|
||||
const {resultHistory, errorHistory} = this.props;
|
||||
if (errorHistory !== null) {
|
||||
|
@ -1055,6 +1151,8 @@ class WalletOptionSelect extends Component {
|
|||
this.renderAccountDetail()
|
||||
: this.state.isNanoSante ?
|
||||
this.renderNanoSanteAccountDetail() :
|
||||
this.state.isNanoSanteAgent ?
|
||||
this.renderNanoSanteAgentAccountDetail() :
|
||||
<View style={{
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
|
@ -1128,7 +1226,8 @@ class WalletOptionSelect extends Component {
|
|||
|
||||
|
||||
{
|
||||
isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_CREDIT') ?
|
||||
isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_CREDIT')
|
||||
|| isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_SANTE') ?
|
||||
this.renderHistory()
|
||||
: <View style={{flex: 1}}/>
|
||||
}
|
||||
|
|
|
@ -0,0 +1,382 @@
|
|||
/**
|
||||
* Project iLinkWorld
|
||||
* File SaisirFeuilleSoinScreen
|
||||
* Path screens/wallet/agent
|
||||
* Created by BRICE ZELE
|
||||
* Date: 11/11/2021
|
||||
*/
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {Alert, Dimensions, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, View,} from 'react-native';
|
||||
import {connect, useDispatch} from 'react-redux';
|
||||
import {Formik} from 'formik';
|
||||
import * as Yup from 'yup';
|
||||
import * as Utils from '../../../utils/UtilsFunction';
|
||||
import {Color} from "../../../config/Color";
|
||||
import I18n from 'react-native-i18n';
|
||||
import {ScreenComponent} from "../../../components/ScreenComponent";
|
||||
import PasswordInput from '../../../components/PasswordInput';
|
||||
import Button from "../../../components/Button";
|
||||
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||
import {responsiveWidth} from "react-native-responsive-dimensions";
|
||||
import {
|
||||
fetchActivePaySubscription,
|
||||
fetchActivePaySubscriptionReset,
|
||||
fetchGetSubscriptionList,
|
||||
fetchGetSubscriptionListReset
|
||||
} from "../../../redux/insurance/insurance.actions";
|
||||
import DropdownAlert from "react-native-dropdownalert";
|
||||
import {readUser} from "../../../webservice/AuthApi";
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {selectActivatePaySubscription, selectSubscriptionList} from "../../../redux/insurance/insurance.selector";
|
||||
|
||||
import {Dropdown} from "react-native-material-dropdown";
|
||||
|
||||
let moment = require('moment-timezone');
|
||||
|
||||
const {width, height} = Dimensions.get('window');
|
||||
const CIRCLE_SIZE = width * 0.5;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
textInput: {
|
||||
height: 46,
|
||||
backgroundColor: Color.fieldColor,
|
||||
borderRadius: 5,
|
||||
marginTop: 10,
|
||||
padding: 10,
|
||||
width: '100%',
|
||||
},
|
||||
lineRow: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
paddingBottom: 20,
|
||||
},
|
||||
contain: {
|
||||
alignItems: 'center',
|
||||
marginTop: 40,
|
||||
paddingBottom: 20,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
flex: 1,
|
||||
},
|
||||
circle: {
|
||||
width: CIRCLE_SIZE,
|
||||
height: CIRCLE_SIZE,
|
||||
borderRadius: CIRCLE_SIZE / 2,
|
||||
position: 'absolute',
|
||||
top: '15%',
|
||||
},
|
||||
circleContainer: {
|
||||
alignItems: 'flex-end',
|
||||
right: -(CIRCLE_SIZE / 3),
|
||||
top: -(CIRCLE_SIZE / 1.5),
|
||||
},
|
||||
lineSeparator: {
|
||||
borderWidth: 1,
|
||||
width: '40%',
|
||||
height: 1,
|
||||
alignSelf: 'center',
|
||||
},
|
||||
line: {
|
||||
width: 1,
|
||||
height: 14,
|
||||
backgroundColor: Color.grayColor,
|
||||
marginLeft: 10,
|
||||
},
|
||||
contentModeView: {
|
||||
width: 30,
|
||||
height: '100%',
|
||||
alignItems: 'flex-end',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
contentFilter: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginLeft: 10,
|
||||
},
|
||||
bottomModal: {
|
||||
justifyContent: 'flex-end',
|
||||
margin: 0,
|
||||
},
|
||||
contentFilterBottom: {
|
||||
width: "100%",
|
||||
borderTopLeftRadius: 8,
|
||||
borderTopRightRadius: 8,
|
||||
paddingHorizontal: 20
|
||||
},
|
||||
contentSwipeDown: {
|
||||
paddingTop: 10,
|
||||
alignItems: 'center',
|
||||
},
|
||||
lineSwipeDown: {
|
||||
width: 30,
|
||||
height: 2.5,
|
||||
backgroundColor: Color.dividerColor,
|
||||
},
|
||||
contentActionModalBottom: {
|
||||
flexDirection: 'row',
|
||||
paddingVertical: 15,
|
||||
justifyContent: 'space-between',
|
||||
borderBottomWidth: 1,
|
||||
},
|
||||
containModal: {
|
||||
paddingVertical: 10,
|
||||
paddingHorizontal: 20,
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
floatingButtonAdd: {
|
||||
backgroundColor: Color.accentColor,
|
||||
position: "absolute",
|
||||
width: 25,
|
||||
bottom: 0,
|
||||
zIndex: 1000,
|
||||
right: 20,
|
||||
top: 35,
|
||||
height: 25,
|
||||
borderRadius: 12.5,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
contentSwitch: {
|
||||
width: responsiveWidth(40),
|
||||
},
|
||||
switch: {},
|
||||
choosePhotoBtn: {
|
||||
marginTop: 10,
|
||||
marginBottom: 10,
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
padding: 5,
|
||||
alignItems: 'center',
|
||||
borderColor: Color.borderColor,
|
||||
marginRight: 10,
|
||||
elevation: 2,
|
||||
},
|
||||
checkbox: {
|
||||
alignSelf: "center",
|
||||
color: "white"
|
||||
},
|
||||
itemAmountPerMonth: {
|
||||
paddingLeft: 10,
|
||||
marginTop: 10,
|
||||
flexDirection: 'row',
|
||||
},
|
||||
dot: {
|
||||
width: 12,
|
||||
height: 12,
|
||||
borderRadius: 6
|
||||
},
|
||||
blockView: {
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 0.5,
|
||||
},
|
||||
});
|
||||
|
||||
const SaisirFeuilleSoinScreen = ({
|
||||
activatePaySubscription,
|
||||
fetchGetSubscriptionList,
|
||||
subscriptionList,
|
||||
fetchActivePaySubscription,
|
||||
navigation
|
||||
}) => {
|
||||
|
||||
const [user, setUser] = useState(null);
|
||||
const [password, setPassword] = useState(null);
|
||||
const [subscriptions, setSubscriptions] = useState([]);
|
||||
const [subscription, setSubscription] = useState(null);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
let dropDownAlertRef: any = null;
|
||||
let subscriptionRef = null;
|
||||
let amountPerMonthRef = null;
|
||||
|
||||
useEffect(() => {
|
||||
readUser().then((user) => {
|
||||
setUser(user)
|
||||
});
|
||||
dispatch(fetchGetSubscriptionListReset());
|
||||
dispatch(fetchActivePaySubscriptionReset());
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (user !== null) {
|
||||
console.log("user", user.id);
|
||||
fetchGetSubscriptionList(user.id, 'ACCEPTED', true);
|
||||
}
|
||||
}, [user]);
|
||||
|
||||
useEffect(() => {
|
||||
if (subscriptionList.result !== null) {
|
||||
let subscriptionListTemp = [];
|
||||
subscriptionList.result.response.map((subscriptionItem, index) => {
|
||||
subscriptionListTemp.push(subscriptionItem);
|
||||
});
|
||||
setSubscriptions(subscriptionListTemp);
|
||||
}
|
||||
|
||||
if (subscriptionList.error) {
|
||||
dropDownAlertRef.alertWithType(
|
||||
'error',
|
||||
I18n.t('ERROR_LABEL'),
|
||||
Utils.getErrorMsg(subscriptionList),
|
||||
);
|
||||
dispatch(fetchGetSubscriptionListReset());
|
||||
}
|
||||
}, [subscriptionList]);
|
||||
|
||||
useEffect(() => {
|
||||
if (activatePaySubscription.result !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("SUCCESS"),
|
||||
activatePaySubscription.result.response,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
dispatch(fetchActivePaySubscriptionReset());
|
||||
navigation.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
|
||||
if (activatePaySubscription.error) {
|
||||
dropDownAlertRef.alertWithType(
|
||||
'error',
|
||||
I18n.t('ERROR_LABEL'),
|
||||
Utils.getErrorMsg(activatePaySubscription),
|
||||
);
|
||||
dispatch(fetchActivePaySubscriptionReset());
|
||||
}
|
||||
}, [activatePaySubscription]);
|
||||
|
||||
const RegisterSchema = Yup.object().shape({
|
||||
password: Yup.string()
|
||||
.required(I18n.t('THIS_FIELD_IS_REQUIRED'))
|
||||
});
|
||||
|
||||
return (
|
||||
<ScreenComponent>
|
||||
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
|
||||
<KeyboardAvoidingView
|
||||
behavior={Platform.OS === 'android' ? 'height' : 'padding'}
|
||||
style={{flex: 1}}>
|
||||
|
||||
<ScrollView style={{flex: 1}}>
|
||||
<Formik validationSchema={RegisterSchema}
|
||||
initialValues={{
|
||||
password: '',
|
||||
}}
|
||||
onSubmit={(values) => {
|
||||
if (user !== null) {
|
||||
if (subscription === null) {
|
||||
subscriptionRef.shake(800);
|
||||
} else {
|
||||
console.log("subscription", subscription);
|
||||
fetchActivePaySubscription(subscription.id, {password: values.password});
|
||||
}
|
||||
}
|
||||
}}>
|
||||
|
||||
{({
|
||||
values,
|
||||
errors,
|
||||
touched,
|
||||
handleChange,
|
||||
handleBlur,
|
||||
handleSubmit,
|
||||
isSubmitting,
|
||||
}) => (
|
||||
<View style={styles.contain}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
subscriptionRef = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('SELECT_INSURANCE')}
|
||||
data={subscriptions}
|
||||
useNativeDriver={true}
|
||||
onChangeText={(value, index, data) => {
|
||||
console.log("Value", value);
|
||||
setSubscription(
|
||||
{
|
||||
id: value.id,
|
||||
insurance_subscription_id: value.insurance_subscription_id,
|
||||
network_id: value.network_id,
|
||||
user_id: value.user_id,
|
||||
number_of_months: value.number_of_months,
|
||||
bonus_amount: value.bonus_amount,
|
||||
number_of_beneficiaries: value.number_of_beneficiaries,
|
||||
total_bonus_amount: value.total_bonus_amount,
|
||||
state: value.state,
|
||||
created_at: value.created_at,
|
||||
updated_at: value.updated_at,
|
||||
start_at: value.start_at,
|
||||
end_at: value.end_at,
|
||||
reason: value.reason,
|
||||
network: value.network,
|
||||
beneficiaries: value.beneficiaries
|
||||
}
|
||||
);
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return value
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return `${value.network.name} | ${I18n.t('ETAT')}: ${value.state} | ${I18n.t('AMOUNT_LABEL')}: ${value.total_bonus_amount}`
|
||||
}}
|
||||
/>
|
||||
</Animatable.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}
|
||||
/>
|
||||
|
||||
<Button
|
||||
style={{marginTop: 20}}
|
||||
full
|
||||
loading={activatePaySubscription.loading}
|
||||
onPress={handleSubmit}>
|
||||
{I18n.t('SUBMIT_LABEL')}
|
||||
</Button>
|
||||
</View>
|
||||
)}
|
||||
</Formik>
|
||||
|
||||
</ScrollView>
|
||||
</KeyboardAvoidingView>
|
||||
</ScreenComponent>
|
||||
);
|
||||
};
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
subscriptionList: selectSubscriptionList,
|
||||
activatePaySubscription: selectActivatePaySubscription
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, {
|
||||
fetchActivePaySubscription,
|
||||
fetchGetSubscriptionList,
|
||||
})(
|
||||
SaisirFeuilleSoinScreen,
|
||||
);
|
|
@ -0,0 +1,382 @@
|
|||
/**
|
||||
* Project iLinkWorld
|
||||
* File ActivateBuySubscriptionScreen
|
||||
* Path screens/wallet/user
|
||||
* Created by BRICE ZELE
|
||||
* Date: 08/11/2021
|
||||
*/
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {Alert, Dimensions, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, View,} from 'react-native';
|
||||
import {connect, useDispatch} from 'react-redux';
|
||||
import {Formik} from 'formik';
|
||||
import * as Yup from 'yup';
|
||||
import * as Utils from '../../../utils/UtilsFunction';
|
||||
import {Color} from "../../../config/Color";
|
||||
import I18n from 'react-native-i18n';
|
||||
import {ScreenComponent} from "../../../components/ScreenComponent";
|
||||
import PasswordInput from '../../../components/PasswordInput';
|
||||
import Button from "../../../components/Button";
|
||||
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||
import {responsiveWidth} from "react-native-responsive-dimensions";
|
||||
import {
|
||||
fetchActivePaySubscription,
|
||||
fetchActivePaySubscriptionReset,
|
||||
fetchGetSubscriptionList,
|
||||
fetchGetSubscriptionListReset
|
||||
} from "../../../redux/insurance/insurance.actions";
|
||||
import DropdownAlert from "react-native-dropdownalert";
|
||||
import {readUser} from "../../../webservice/AuthApi";
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {selectActivatePaySubscription, selectSubscriptionList} from "../../../redux/insurance/insurance.selector";
|
||||
|
||||
import {Dropdown} from "react-native-material-dropdown";
|
||||
|
||||
let moment = require('moment-timezone');
|
||||
|
||||
const {width, height} = Dimensions.get('window');
|
||||
const CIRCLE_SIZE = width * 0.5;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
textInput: {
|
||||
height: 46,
|
||||
backgroundColor: Color.fieldColor,
|
||||
borderRadius: 5,
|
||||
marginTop: 10,
|
||||
padding: 10,
|
||||
width: '100%',
|
||||
},
|
||||
lineRow: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
paddingBottom: 20,
|
||||
},
|
||||
contain: {
|
||||
alignItems: 'center',
|
||||
marginTop: 40,
|
||||
paddingBottom: 20,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
flex: 1,
|
||||
},
|
||||
circle: {
|
||||
width: CIRCLE_SIZE,
|
||||
height: CIRCLE_SIZE,
|
||||
borderRadius: CIRCLE_SIZE / 2,
|
||||
position: 'absolute',
|
||||
top: '15%',
|
||||
},
|
||||
circleContainer: {
|
||||
alignItems: 'flex-end',
|
||||
right: -(CIRCLE_SIZE / 3),
|
||||
top: -(CIRCLE_SIZE / 1.5),
|
||||
},
|
||||
lineSeparator: {
|
||||
borderWidth: 1,
|
||||
width: '40%',
|
||||
height: 1,
|
||||
alignSelf: 'center',
|
||||
},
|
||||
line: {
|
||||
width: 1,
|
||||
height: 14,
|
||||
backgroundColor: Color.grayColor,
|
||||
marginLeft: 10,
|
||||
},
|
||||
contentModeView: {
|
||||
width: 30,
|
||||
height: '100%',
|
||||
alignItems: 'flex-end',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
contentFilter: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginLeft: 10,
|
||||
},
|
||||
bottomModal: {
|
||||
justifyContent: 'flex-end',
|
||||
margin: 0,
|
||||
},
|
||||
contentFilterBottom: {
|
||||
width: "100%",
|
||||
borderTopLeftRadius: 8,
|
||||
borderTopRightRadius: 8,
|
||||
paddingHorizontal: 20
|
||||
},
|
||||
contentSwipeDown: {
|
||||
paddingTop: 10,
|
||||
alignItems: 'center',
|
||||
},
|
||||
lineSwipeDown: {
|
||||
width: 30,
|
||||
height: 2.5,
|
||||
backgroundColor: Color.dividerColor,
|
||||
},
|
||||
contentActionModalBottom: {
|
||||
flexDirection: 'row',
|
||||
paddingVertical: 15,
|
||||
justifyContent: 'space-between',
|
||||
borderBottomWidth: 1,
|
||||
},
|
||||
containModal: {
|
||||
paddingVertical: 10,
|
||||
paddingHorizontal: 20,
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
floatingButtonAdd: {
|
||||
backgroundColor: Color.accentColor,
|
||||
position: "absolute",
|
||||
width: 25,
|
||||
bottom: 0,
|
||||
zIndex: 1000,
|
||||
right: 20,
|
||||
top: 35,
|
||||
height: 25,
|
||||
borderRadius: 12.5,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
contentSwitch: {
|
||||
width: responsiveWidth(40),
|
||||
},
|
||||
switch: {},
|
||||
choosePhotoBtn: {
|
||||
marginTop: 10,
|
||||
marginBottom: 10,
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
padding: 5,
|
||||
alignItems: 'center',
|
||||
borderColor: Color.borderColor,
|
||||
marginRight: 10,
|
||||
elevation: 2,
|
||||
},
|
||||
checkbox: {
|
||||
alignSelf: "center",
|
||||
color: "white"
|
||||
},
|
||||
itemAmountPerMonth: {
|
||||
paddingLeft: 10,
|
||||
marginTop: 10,
|
||||
flexDirection: 'row',
|
||||
},
|
||||
dot: {
|
||||
width: 12,
|
||||
height: 12,
|
||||
borderRadius: 6
|
||||
},
|
||||
blockView: {
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 0.5,
|
||||
},
|
||||
});
|
||||
|
||||
const ActivateBuySubscriptionScreen = ({
|
||||
activatePaySubscription,
|
||||
fetchGetSubscriptionList,
|
||||
subscriptionList,
|
||||
fetchActivePaySubscription,
|
||||
navigation
|
||||
}) => {
|
||||
|
||||
const [user, setUser] = useState(null);
|
||||
const [password, setPassword] = useState(null);
|
||||
const [subscriptions, setSubscriptions] = useState([]);
|
||||
const [subscription, setSubscription] = useState(null);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
let dropDownAlertRef: any = null;
|
||||
let subscriptionRef = null;
|
||||
let amountPerMonthRef = null;
|
||||
|
||||
useEffect(() => {
|
||||
readUser().then((user) => {
|
||||
setUser(user)
|
||||
});
|
||||
dispatch(fetchGetSubscriptionListReset());
|
||||
dispatch(fetchActivePaySubscriptionReset());
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (user !== null) {
|
||||
console.log("user", user.id);
|
||||
fetchGetSubscriptionList(user.id, 'ACCEPTED', true);
|
||||
}
|
||||
}, [user]);
|
||||
|
||||
useEffect(() => {
|
||||
if (subscriptionList.result !== null) {
|
||||
let subscriptionListTemp = [];
|
||||
subscriptionList.result.response.map((subscriptionItem, index) => {
|
||||
subscriptionListTemp.push(subscriptionItem);
|
||||
});
|
||||
setSubscriptions(subscriptionListTemp);
|
||||
}
|
||||
|
||||
if (subscriptionList.error) {
|
||||
dropDownAlertRef.alertWithType(
|
||||
'error',
|
||||
I18n.t('ERROR_LABEL'),
|
||||
Utils.getErrorMsg(subscriptionList),
|
||||
);
|
||||
dispatch(fetchGetSubscriptionListReset());
|
||||
}
|
||||
}, [subscriptionList]);
|
||||
|
||||
useEffect(() => {
|
||||
if (activatePaySubscription.result !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("SUCCESS"),
|
||||
activatePaySubscription.result.response,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
dispatch(fetchActivePaySubscriptionReset());
|
||||
navigation.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{cancelable: false}
|
||||
)
|
||||
}
|
||||
|
||||
if (activatePaySubscription.error) {
|
||||
dropDownAlertRef.alertWithType(
|
||||
'error',
|
||||
I18n.t('ERROR_LABEL'),
|
||||
Utils.getErrorMsg(activatePaySubscription),
|
||||
);
|
||||
dispatch(fetchActivePaySubscriptionReset());
|
||||
}
|
||||
}, [activatePaySubscription]);
|
||||
|
||||
const RegisterSchema = Yup.object().shape({
|
||||
password: Yup.string()
|
||||
.required(I18n.t('THIS_FIELD_IS_REQUIRED'))
|
||||
});
|
||||
|
||||
return (
|
||||
<ScreenComponent>
|
||||
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
|
||||
<KeyboardAvoidingView
|
||||
behavior={Platform.OS === 'android' ? 'height' : 'padding'}
|
||||
style={{flex: 1}}>
|
||||
|
||||
<ScrollView style={{flex: 1}}>
|
||||
<Formik validationSchema={RegisterSchema}
|
||||
initialValues={{
|
||||
password: '',
|
||||
}}
|
||||
onSubmit={(values) => {
|
||||
if (user !== null) {
|
||||
if (subscription === null) {
|
||||
subscriptionRef.shake(800);
|
||||
} else {
|
||||
console.log("subscription", subscription);
|
||||
fetchActivePaySubscription(subscription.id, {password: values.password});
|
||||
}
|
||||
}
|
||||
}}>
|
||||
|
||||
{({
|
||||
values,
|
||||
errors,
|
||||
touched,
|
||||
handleChange,
|
||||
handleBlur,
|
||||
handleSubmit,
|
||||
isSubmitting,
|
||||
}) => (
|
||||
<View style={styles.contain}>
|
||||
<Animatable.View ref={(comp) => {
|
||||
subscriptionRef = comp
|
||||
}}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('SELECT_INSURANCE')}
|
||||
data={subscriptions}
|
||||
useNativeDriver={true}
|
||||
onChangeText={(value, index, data) => {
|
||||
console.log("Value", value);
|
||||
setSubscription(
|
||||
{
|
||||
id: value.id,
|
||||
insurance_subscription_id: value.insurance_subscription_id,
|
||||
network_id: value.network_id,
|
||||
user_id: value.user_id,
|
||||
number_of_months: value.number_of_months,
|
||||
bonus_amount: value.bonus_amount,
|
||||
number_of_beneficiaries: value.number_of_beneficiaries,
|
||||
total_bonus_amount: value.total_bonus_amount,
|
||||
state: value.state,
|
||||
created_at: value.created_at,
|
||||
updated_at: value.updated_at,
|
||||
start_at: value.start_at,
|
||||
end_at: value.end_at,
|
||||
reason: value.reason,
|
||||
network: value.network,
|
||||
beneficiaries: value.beneficiaries
|
||||
}
|
||||
);
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return value
|
||||
}}
|
||||
labelExtractor={(value) => {
|
||||
return `${value.network.name} | ${I18n.t('ETAT')}: ${value.state} | ${I18n.t('AMOUNT_LABEL')}: ${value.total_bonus_amount}`
|
||||
}}
|
||||
/>
|
||||
</Animatable.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}
|
||||
/>
|
||||
|
||||
<Button
|
||||
style={{marginTop: 20}}
|
||||
full
|
||||
loading={activatePaySubscription.loading}
|
||||
onPress={handleSubmit}>
|
||||
{I18n.t('SUBMIT_LABEL')}
|
||||
</Button>
|
||||
</View>
|
||||
)}
|
||||
</Formik>
|
||||
|
||||
</ScrollView>
|
||||
</KeyboardAvoidingView>
|
||||
</ScreenComponent>
|
||||
);
|
||||
};
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
subscriptionList: selectSubscriptionList,
|
||||
activatePaySubscription: selectActivatePaySubscription
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, {
|
||||
fetchActivePaySubscription,
|
||||
fetchGetSubscriptionList,
|
||||
})(
|
||||
ActivateBuySubscriptionScreen,
|
||||
);
|
File diff suppressed because it is too large
Load Diff
|
@ -59,8 +59,10 @@ import {
|
|||
} from "../../../redux/insurance/insurance.selector";
|
||||
import Dialog from "react-native-dialog";
|
||||
import {Typography} from "../../../config/typography";
|
||||
|
||||
import {Dropdown} from "react-native-material-dropdown";
|
||||
import Icon from "react-native-vector-icons/FontAwesome5";
|
||||
import isNil from "lodash/isNil";
|
||||
|
||||
let moment = require('moment-timezone');
|
||||
|
||||
|
@ -362,7 +364,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
lastname: lastNameBeneficiary,
|
||||
firstname: firstNameBeneficiary,
|
||||
gender: gender,
|
||||
birthdate: dateNaissance,
|
||||
birthdate: moment(dateNaissance).format('YYYY-MM-DD'),
|
||||
affiliation: affiliation,
|
||||
birthdate_proof: childAyantDroitDocument[0].checboxSelectedValue,
|
||||
birthdate_proof_doc: uploadInsuranceImages.result.response[0],
|
||||
|
@ -499,7 +501,8 @@ const InsuranceSubscriptionScreen = ({
|
|||
const handleTakePhotoFromCamera = (name, isFrontCamera = false) => {
|
||||
ImagePicker.openCamera({
|
||||
cropping: true,
|
||||
compressImageQuality: 0.7
|
||||
compressImageQuality: 0.7,
|
||||
useFrontCamera: false
|
||||
}).then(image => {
|
||||
if (affiliation === "CHILD") {
|
||||
let tempChildAyantDroitDocument = childAyantDroitDocument;
|
||||
|
@ -561,7 +564,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
setDateNaissance(currentDate);
|
||||
};
|
||||
|
||||
const onSelectAmountPerMonth = () => {
|
||||
const onSelectAmountPerMonth = (selected) => {
|
||||
let insuranceTemp = insurance;
|
||||
setInsurance(
|
||||
{
|
||||
|
@ -575,6 +578,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
id: item.id,
|
||||
number_of_months: item.number_of_months,
|
||||
min_amount: item.min_amount,
|
||||
checked: item.id === selected.id,
|
||||
};
|
||||
})
|
||||
}
|
||||
|
@ -587,7 +591,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
is24Hour={true}
|
||||
value={new Date(dateNaissance)}
|
||||
mode='date'
|
||||
maximumDate={currentYearMinusAgeLimit}
|
||||
minimumDate={currentYearMinusAgeLimit}
|
||||
display="spinner"
|
||||
onChange={onChangeDateNaissance}
|
||||
/>
|
||||
|
@ -959,6 +963,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
insurancesRef.shake(800);
|
||||
} else {
|
||||
console.log(user);
|
||||
console.log("insurance", insurance);
|
||||
setPassword(values.password);
|
||||
fetchGetInsurancePrimeAmount({
|
||||
network_id: insurance.id,
|
||||
|
@ -1009,6 +1014,7 @@ const InsuranceSubscriptionScreen = ({
|
|||
id: item.id,
|
||||
number_of_months: item.number_of_months,
|
||||
min_amount: item.min_amount,
|
||||
checked: index === 0,
|
||||
};
|
||||
})
|
||||
}
|
||||
|
@ -1082,12 +1088,15 @@ const InsuranceSubscriptionScreen = ({
|
|||
? `${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}
|
||||
data={insurance.months_prices.map((item, index) => ({
|
||||
checked: !isNil(item.checked) ? item.checked : index === 0,
|
||||
...item
|
||||
}))}
|
||||
useNativeDriver={true}
|
||||
onChangeText={(value, index, data) => {
|
||||
console.log("Value", data[index]);
|
||||
setAmountPerMonth(data[index]);
|
||||
onSelectAmountPerMonth();
|
||||
onSelectAmountPerMonth(data[index]);
|
||||
}}
|
||||
valueExtractor={(value) => {
|
||||
return `${I18n.t('NUMBER_OF_MONTHS')}: ${value.number_of_months} | ${I18n.t('MINIMUM_AMOUNT')}: ${value.min_amount}`
|
||||
|
@ -1166,18 +1175,19 @@ const InsuranceSubscriptionScreen = ({
|
|||
I18n.t('ERROR_LABEL'),
|
||||
I18n.t('PLEASE_SELECT_INSURANCE_BEFORE'),
|
||||
);
|
||||
} else
|
||||
} else {
|
||||
setModalVisible(true);
|
||||
setShowDateNaissancePicker(false);
|
||||
dispatch(fetchUploadInsuranceReset());
|
||||
setAffliliation('CHILD');
|
||||
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([]);
|
||||
//setDateNaissance('' + moment().subtract(5, 'years').format());
|
||||
}
|
||||
|
||||
}}>
|
||||
<Text body1 primaryColor bold>
|
||||
{I18n.t('ADD_AYANT_DROIT')}
|
||||
|
|
|
@ -494,7 +494,7 @@ export const optionNanoSanteUserScreen = {
|
|||
},
|
||||
{
|
||||
title: 'ACTIVATE_INSSURANCE',
|
||||
screen: '',
|
||||
screen: 'activateBuySubscriptionScreen',
|
||||
icon: "cash-refund"
|
||||
},
|
||||
{
|
||||
|
@ -606,6 +606,24 @@ export const optionNanoCreditAgentScreen = {
|
|||
]
|
||||
}
|
||||
|
||||
export const optionNanoSanteAgentScreen = {
|
||||
type: 'NANO_SANTE',
|
||||
title: 'NANO_SANTE',
|
||||
subTitle: 'CHOOSE_OPTION',
|
||||
options: [
|
||||
{
|
||||
screen: route.cautionNanoCreditAgent,
|
||||
icon: 'user-plus',
|
||||
title: 'SAISIR_FEUILLE_SOIN',
|
||||
},
|
||||
{
|
||||
screen: route.cautionNanoCreditAgent,
|
||||
icon: 'edit',
|
||||
title: 'MODIFIER_FEUILLE_SOIN',
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
export const optionPaiementEau = {
|
||||
title: 'PAIEMENT_FACTURE',
|
||||
|
|
|
@ -602,5 +602,9 @@
|
|||
"AMOUNT_PER_MONTH": "Montant par durée de couverture",
|
||||
"DETAIL": "Détail",
|
||||
"PRIME_AMOUNT": "Montant de la prime",
|
||||
"AYANT_DROIT": "Ayant(s) droit(s)"
|
||||
"AYANT_DROIT": "Ayant(s) droit(s)",
|
||||
"SELECT_SUBSCRIPTION": "Sélectionner une souscription",
|
||||
"SAISIR_FEUILLE_SOIN": "Saisir une feuille de soin",
|
||||
"MODIFIER_FEUILLE_SOIN": "Modifier une feuille de soin",
|
||||
"FACTURER_FEUILLES_SOINS": "Facturer les feuilles de soins"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue