Add user wallet to wallet
This commit is contained in:
parent
7d700f725d
commit
2c6f4052da
4
App.js
4
App.js
|
@ -54,6 +54,7 @@ import ValidateIdentification from './screens/identification/validateIdentificat
|
|||
import CreateIdentificationUser from './screens/identification/CreateIdentificationUser';
|
||||
import OperateurOptionSelect from './screens/wallet/OperateurOptionSelect';
|
||||
import PaiementFacture from './screens/wallet/PaiementFacture';
|
||||
import EnvoieWalletToWalletUser from './screens/wallet/user/EnvoieWalletToWalletUser';
|
||||
|
||||
const instructions = Platform.select({
|
||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||
|
@ -96,7 +97,8 @@ const AppStack = createDrawerNavigator({
|
|||
walletOptionSelect: WalletOptionSelect,
|
||||
operateurOptionSelect: OperateurOptionSelect,
|
||||
operateurOptionSelect: OperateurOptionSelect,
|
||||
paiementFacture: PaiementFacture
|
||||
paiementFacture: PaiementFacture,
|
||||
envoieWalletToWalletUser: EnvoieWalletToWalletUser
|
||||
|
||||
})
|
||||
}, { contentComponent: OptionsMenu, headerMode: 'none', contentOptions: { activeTintColor: theme.accent } })
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -36,5 +36,7 @@
|
|||
"createIdentification": "createIdentification",
|
||||
"createIdentificationUser": "createIdentificationUser",
|
||||
"validateIdentification": "validateIdentification",
|
||||
"paiementOptionSelect": "paiementOptionSelect"
|
||||
"operateurOptionSelect": "operateurOptionSelect",
|
||||
"paiementFacture": "paiementFacture",
|
||||
"envoieWalletToWalletUser": "envoieWalletToWalletUser"
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
"THIS_FIELD_IS_REQUIRED": "This field is required",
|
||||
"PLEASE_ENTER_THE_AMOUNT": "Please enter the amount",
|
||||
"CHOOSE_OPTION": "Please choose an option",
|
||||
"CHOOSE_OPERATOR": "Please choose an operator",
|
||||
"EXPIRY_CARD_ERROR": "Date incorrect",
|
||||
"CARD_NUMBER_ERROR": "Card number incorrect",
|
||||
"AMOUNT_LABEL": "Amount",
|
||||
|
@ -71,6 +72,11 @@
|
|||
"DEPOSIT_CASH_TO_VISA": "Cash to visa card",
|
||||
"DEPOSIT_CASH_TO_BANK": "Cash to bank",
|
||||
"DEPOSIT_WALLET_TO_WALLET": "Wallet to wallet",
|
||||
"ENVOIE_WALLET_TO_WALLET": "Send Wallet to wallet",
|
||||
"CODE_WALLET": "Wallet Code",
|
||||
"ACTIVE_WALLET": "Active wallet",
|
||||
"TYPE_IDENTIFIANT": "ID type",
|
||||
"PAYS_DESTINATION": "Destination country",
|
||||
"DEPOSIT_TO_CASH": "Wallet to cash",
|
||||
"DEPOSIT_TO_CARD": "Wallet to card",
|
||||
"DEPOSIT_TO_BANK": "Wallet to bank",
|
||||
|
@ -79,6 +85,8 @@
|
|||
"NANO_SANTE": "Nano health",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano health description",
|
||||
"PAIEMENT_FACTURE": "Bill payment",
|
||||
"NUMERO_ABONNE": "Subscriber number",
|
||||
"IDENTIFIANT_ETUDIANT": "Student ID",
|
||||
"DEMAND_SEND": "Demand send",
|
||||
"WITHDRAWAL_DESCRIPTION": "Make a withdrawal",
|
||||
"COMMISSION_ACCOUNT_TITLE": "Commission account",
|
||||
|
@ -293,14 +301,21 @@
|
|||
"DELETE": "Delete",
|
||||
"FREE": "Available",
|
||||
"SAVED": "Registered",
|
||||
"PROFILE_PICTURE": "Profile picture",
|
||||
"FRONT_FACE_CB": "CB front side",
|
||||
"BACK_FACE_CB": "CB back side",
|
||||
"PREVISUALISATION": "Preview",
|
||||
"ACCOUNT_INFO": "My Account Information",
|
||||
"ALREADY_IDENTIFIED": "You are already identified",
|
||||
"NOT_IDENTIFIED": "This number exists, its identification is not yet entered",
|
||||
"ALREADY_VALIDATED": "The identification of this client has already been validated",
|
||||
"IDENTIFICATION": " Identification",
|
||||
"CREATION_IDENTIFICATION": "Creation",
|
||||
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
|
||||
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a client",
|
||||
"VALIDATE_IDENTIFICATION": "Validation",
|
||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
||||
"IDENTIFICATION_INFORMATION": "Identification information",
|
||||
"CREATE_IDENTIFICATION_TITLE": "Please fill in customer information",
|
||||
"DATE_NAISSANCE": "Date of birth",
|
||||
"REGISTER_YOURSELF": "Register",
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
"THIS_FIELD_IS_REQUIRED": "Ce champ est requis",
|
||||
"PLEASE_ENTER_THE_AMOUNT": "Veuillez renseigne le montant",
|
||||
"CHOOSE_OPTION": "Veuillez sélectionner une option",
|
||||
"CHOOSE_OPERATOR": "Veuillez sélectionner un opérateur",
|
||||
"DEPOSIT_DESCRIPTION": "Effectuer un dépôt",
|
||||
"WITHDRAWAL": "Retrait",
|
||||
"WITHDRAWAL_IN_CASH": "Retrait en cash",
|
||||
|
@ -76,6 +77,11 @@
|
|||
"DEPOSIT_CASH_TO_VISA": "Cash vers carte visa",
|
||||
"DEPOSIT_CASH_TO_BANK": "Cash vers banque",
|
||||
"DEPOSIT_WALLET_TO_WALLET": "Wallet vers wallet",
|
||||
"ENVOIE_WALLET_TO_WALLET": "Envoie Wallet vers wallet",
|
||||
"CODE_WALLET": "Code Wallet",
|
||||
"TYPE_IDENTIFIANT": "Type d'identifiant",
|
||||
"PAYS_DESTINATION": "Pays destination",
|
||||
"ACTIVE_WALLET": "Wallet actif",
|
||||
"DEPOSIT_TO_CASH": "Wallet vers cash",
|
||||
"DEPOSIT_TO_CARD": "Wallet vers carte",
|
||||
"DEPOSIT_TO_BANK": "Wallet vers banque",
|
||||
|
@ -84,6 +90,8 @@
|
|||
"NANO_SANTE": "Nano santé",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano santé iLink",
|
||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||
"NUMERO_ABONNE": "Numéro d'abonnée",
|
||||
"IDENTIFIANT_ETUDIANT": "Identifiant étudiant",
|
||||
"WITHDRAWAL_DESCRIPTION": "Effectuer un retrait",
|
||||
"COMMISSION_ACCOUNT_TITLE": "Cpt. commission",
|
||||
"CONFIRM": "Confirmer",
|
||||
|
@ -296,8 +304,14 @@
|
|||
"DELETE": "Supprimer",
|
||||
"FREE": "disponibles",
|
||||
"SAVED": "enregistrés",
|
||||
"PROFILE_PICTURE": "Photo de profil",
|
||||
"FRONT_FACE_CB": "Face avant CB",
|
||||
"BACK_FACE_CB": "Face arrière CB",
|
||||
"PREVISUALISATION": "Prévisualisation",
|
||||
"ACCOUNT_INFO": " Information sur mon compte",
|
||||
"ALREADY_IDENTIFIED": "Vous êtes déjà identifié",
|
||||
"NOT_IDENTIFIED": "Ce numéro existe, son identification n'est pas encore saisi",
|
||||
"ALREADY_VALIDATED": "L'identification de ce client a déjà été validée",
|
||||
"IDENTIFICATION": " Identification",
|
||||
"CREATION_IDENTIFICATION": "Création",
|
||||
"CREATION_IDENTIFICATION_CLIENT": "M'identifier",
|
||||
|
@ -305,6 +319,7 @@
|
|||
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Saisir l'identité d'un client",
|
||||
"VALIDATE_IDENTIFICATION": "Validation",
|
||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Valider une identité client",
|
||||
"IDENTIFICATION_INFORMATION": "Information sur l'identification",
|
||||
"CREATE_IDENTIFICATION_TITLE": "Veuillez renseigner les informations du client",
|
||||
"DATE_NAISSANCE": "Date de naissance",
|
||||
"REGISTER_YOURSELF": "Enregistrez-vous",
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
"react-native-material-dropdown": "^0.11.1",
|
||||
"react-native-paper": "^2.16.0",
|
||||
"react-native-phone-call": "^1.0.9",
|
||||
"react-native-popover-tooltip": "^1.1.4",
|
||||
"react-native-popup-dialog": "^0.18.3",
|
||||
"react-native-progress": "^3.6.0",
|
||||
"react-native-range-datepicker": "^1.8.2",
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
import { ACTIVE_COUNTRY_LIST_PENDING, ACTIVE_COUNTRY_LIST_SUCCESS, ACTIVE_COUNTRY_LIST_ERROR, ACTIVE_COUNTRY_LIST_RESET, PAY_COUNTRY_NETWORK_SUCCESS, PAY_COUNTRY_NETWORK_ERROR, PAY_COUNTRY_NETWORK_RESET, COUNTRY_BY_DIAL_CODE_PENDING, COUNTRY_BY_DIAL_CODE_SUCCESS, COUNTRY_BY_DIAL_CODE_RESET, PAY_COUNTRY_NETWORK_PENDING } from "../types/CountryNetworkType";
|
||||
|
||||
export const fetchActiveCountryListPending = () => ({
|
||||
type: ACTIVE_COUNTRY_LIST_PENDING
|
||||
});
|
||||
|
||||
export const fetchActiveCountryListSucsess = (res) => ({
|
||||
type: ACTIVE_COUNTRY_LIST_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchActiveCountryListError = (error) => ({
|
||||
type: ACTIVE_COUNTRY_LIST_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchActiveCountryListReset = () => ({
|
||||
type: ACTIVE_COUNTRY_LIST_RESET
|
||||
});
|
||||
|
||||
|
||||
|
||||
export const fetchPayCountryNetworkPending = () => ({
|
||||
type: PAY_COUNTRY_NETWORK_PENDING
|
||||
});
|
||||
|
||||
export const fetchPayCountryNetworkSucsess = (res) => ({
|
||||
type: PAY_COUNTRY_NETWORK_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchPayCountryNetworkError = (error) => ({
|
||||
type: PAY_COUNTRY_NETWORK_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchPayCountryNetworkReset = () => ({
|
||||
type: PAY_COUNTRY_NETWORK_RESET
|
||||
});
|
||||
|
||||
|
||||
|
||||
export const fetchCountryByDialCodePending = () => ({
|
||||
type: COUNTRY_BY_DIAL_CODE_PENDING
|
||||
});
|
||||
|
||||
export const fetchCountryByDialCodeSucsess = (res) => ({
|
||||
type: COUNTRY_BY_DIAL_CODE_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchCountryByDialCodeError = (error) => ({
|
||||
type: COUNTRY_BY_DIAL_CODE_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchCountryByDialCodeReset = () => ({
|
||||
type: COUNTRY_BY_DIAL_CODE_RESET
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { CREATE_IDENTIFICATION_PENDING, CREATE_IDENTIFICATION_SUCCESS, CREATE_IDENTIFICATION_ERROR, CREATE_IDENTIFICATION_RESET, GET_NUMBER_DETAIL_PENDING, GET_NUMBER_DETAIL_SUCCESS, GET_NUMBER_DETAIL_ERROR, GET_NUMBER_DETAIL_RESET, GET_USER_IDENTIFICATION_PENDING, GET_USER_IDENTIFICATION_SUCCESS, GET_USER_IDENTIFICATION_ERROR, GET_USER_IDENTIFICATION_RESET } from "../types/IdentificationType";
|
||||
import { CREATE_IDENTIFICATION_PENDING, CREATE_IDENTIFICATION_SUCCESS, CREATE_IDENTIFICATION_ERROR, CREATE_IDENTIFICATION_RESET, GET_NUMBER_DETAIL_PENDING, GET_NUMBER_DETAIL_SUCCESS, GET_NUMBER_DETAIL_ERROR, GET_NUMBER_DETAIL_RESET, GET_USER_IDENTIFICATION_PENDING, GET_USER_IDENTIFICATION_SUCCESS, GET_USER_IDENTIFICATION_ERROR, GET_USER_IDENTIFICATION_RESET, VALIDATE_IDENTIFICATION_PENDING, VALIDATE_IDENTIFICATION_SUCCESS, VALIDATE_IDENTIFICATION_ERROR, VALIDATE_IDENTIFICATION_RESET } from "../types/IdentificationType";
|
||||
|
||||
export const fetchCreateIdentificationPending = () => ({
|
||||
type: CREATE_IDENTIFICATION_PENDING
|
||||
|
@ -53,3 +53,21 @@ export const fetchUserIdentificationError = (error) => ({
|
|||
export const fetchUserIdentificationReset = () => ({
|
||||
type: GET_USER_IDENTIFICATION_RESET
|
||||
});
|
||||
|
||||
export const fetchValidateIndentificationPending = () => ({
|
||||
type: VALIDATE_IDENTIFICATION_PENDING
|
||||
});
|
||||
|
||||
export const fetchValidateIndentificationSuccess = (res) => ({
|
||||
type: VALIDATE_IDENTIFICATION_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchValidateIndentificationError = (error) => ({
|
||||
type: VALIDATE_IDENTIFICATION_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchValidateIndentificationReset = () => ({
|
||||
type: VALIDATE_IDENTIFICATION_RESET
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
import { ACTIVE_COUNTRY_LIST_PENDING, ACTIVE_COUNTRY_LIST_SUCCESS, ACTIVE_COUNTRY_LIST_ERROR, ACTIVE_COUNTRY_LIST_RESET } from "../types/CountryNetworkType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case ACTIVE_COUNTRY_LIST_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case ACTIVE_COUNTRY_LIST_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case ACTIVE_COUNTRY_LIST_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case ACTIVE_COUNTRY_LIST_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
import { COUNTRY_BY_DIAL_CODE_PENDING, COUNTRY_BY_DIAL_CODE_SUCCESS, COUNTRY_BY_DIAL_CODE_ERROR, COUNTRY_BY_DIAL_CODE_RESET } from "../types/CountryNetworkType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case COUNTRY_BY_DIAL_CODE_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case COUNTRY_BY_DIAL_CODE_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case COUNTRY_BY_DIAL_CODE_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case COUNTRY_BY_DIAL_CODE_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
import { PAY_COUNTRY_NETWORK_ERROR, PAY_COUNTRY_NETWORK_PENDING, PAY_COUNTRY_NETWORK_RESET, PAY_COUNTRY_NETWORK_SUCCESS } from "../types/CountryNetworkType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case PAY_COUNTRY_NETWORK_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case PAY_COUNTRY_NETWORK_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case PAY_COUNTRY_NETWORK_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case PAY_COUNTRY_NETWORK_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
import { VALIDATE_IDENTIFICATION_PENDING, VALIDATE_IDENTIFICATION_SUCCESS, VALIDATE_IDENTIFICATION_ERROR, VALIDATE_IDENTIFICATION_RESET } from "../types/IdentificationType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case VALIDATE_IDENTIFICATION_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case VALIDATE_IDENTIFICATION_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case VALIDATE_IDENTIFICATION_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case VALIDATE_IDENTIFICATION_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,18 +1,21 @@
|
|||
import { combineReducers } from "redux";
|
||||
import walletReducer from "./WalletReducer";
|
||||
import walletDetailReducer from "./WalletDetailReducer.js";
|
||||
import { AsyncStorage } from "react-native";
|
||||
import { persistCombineReducers } from "redux-persist";
|
||||
import ActiveCountryListReducer from "./ActiveCountryListReducer";
|
||||
import authKeyReducer from "./AuthKeyReducer";
|
||||
import depositReducer from "./DepositReducer";
|
||||
import creditTreatDemandReducer from "./CreditTreatDemandReducer";
|
||||
import creditCancelDemandReducer from "./CreditCancelDemandReducer";
|
||||
import creditTreatDemandReducer from "./CreditTreatDemandReducer";
|
||||
import depositReducer from "./DepositReducer";
|
||||
import GetNumberInformation from "./GetNumberInformation";
|
||||
import GetUserIdentificationReducer from "./GetUserIdentificationReducer";
|
||||
import CreateIdentificationReducer from "./IdentificationReducer";
|
||||
import PayCountryNetworkReducer from "./PayCountryNetworkReducer";
|
||||
import ValidateIdentificationReducer from "./ValidateIdentificationReducer";
|
||||
import walletDetailReducer from "./WalletDetailReducer.js";
|
||||
import WalletGetCommissionReducer from "./WalletGetCommissionReducer";
|
||||
import walletReducer from "./WalletReducer";
|
||||
import walletHistoryReducer from "./WalletTransactionHistoryReducer";
|
||||
import walletTransferCommissionReducer from "./WalletTransferCommission";
|
||||
import CreateIdentificationReducer from "./IdentificationReducer";
|
||||
import GetNumberInformation from "./GetNumberInformation";
|
||||
import { persistCombineReducers } from "redux-persist";
|
||||
import { AsyncStorage } from "react-native";
|
||||
import GetUserIdentificationReducer from "./GetUserIdentificationReducer";
|
||||
import CountryByDialCodeReducer from "./CountryByDialCodeReducer";
|
||||
|
||||
const persistConfig = {
|
||||
key: 'root',
|
||||
|
@ -33,7 +36,13 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
|||
walletGetCommission: WalletGetCommissionReducer,
|
||||
createIdentificationReducer: CreateIdentificationReducer,
|
||||
getNumberInformationReducer: GetNumberInformation,
|
||||
getUserIdentificationReducer: GetUserIdentificationReducer
|
||||
getUserIdentificationReducer: GetUserIdentificationReducer,
|
||||
validateIdentificationReducer: ValidateIdentificationReducer,
|
||||
payCountryNetworkReducer: PayCountryNetworkReducer,
|
||||
activeCountryListReducer: ActiveCountryListReducer,
|
||||
countryByDialCode: CountryByDialCodeReducer
|
||||
|
||||
|
||||
});
|
||||
|
||||
export default rootReducer;
|
|
@ -0,0 +1,14 @@
|
|||
export const ACTIVE_COUNTRY_LIST_PENDING = 'ACTIVE_COUNTRY_LIST_PENDING';
|
||||
export const ACTIVE_COUNTRY_LIST_SUCCESS = 'ACTIVE_COUNTRY_LIST_SUCCESS';
|
||||
export const ACTIVE_COUNTRY_LIST_ERROR = 'ACTIVE_COUNTRY_LIST_ERROR';
|
||||
export const ACTIVE_COUNTRY_LIST_RESET = 'ACTIVE_COUNTRY_LIST_RESET';
|
||||
|
||||
export const PAY_COUNTRY_NETWORK_PENDING = 'PAY_COUNTRY_NETWORK_PENDING';
|
||||
export const PAY_COUNTRY_NETWORK_SUCCESS = 'PAY_COUNTRY_NETWORK_SUCCESS';
|
||||
export const PAY_COUNTRY_NETWORK_ERROR = 'PAY_COUNTRY_NETWORK_ERROR';
|
||||
export const PAY_COUNTRY_NETWORK_RESET = 'PAY_COUNTRY_NETWORK_RESET';
|
||||
|
||||
export const COUNTRY_BY_DIAL_CODE_PENDING = 'COUNTRY_BY_DIAL_CODE_PENDING';
|
||||
export const COUNTRY_BY_DIAL_CODE_SUCCESS = 'COUNTRY_BY_DIAL_CODE_SUCCESS';
|
||||
export const COUNTRY_BY_DIAL_CODE_ERROR = 'COUNTRY_BY_DIAL_CODE_ERROR';
|
||||
export const COUNTRY_BY_DIAL_CODE_RESET = 'COUNTRY_BY_DIAL_CODE_RESET';
|
|
@ -0,0 +1,4 @@
|
|||
export const ENVOIE_WALLET_TO_WALLET_USER_PENDING = 'ENVOIE_WALLET_TO_WALLET_USER_PENDING';
|
||||
export const ENVOIE_WALLET_TO_WALLET_USER_SUCCESS = 'ENVOIE_WALLET_TO_WALLET_USER_SUCCESS';
|
||||
export const ENVOIE_WALLET_TO_WALLET_USER_ERROR = 'ENVOIE_WALLET_TO_WALLET_USER_ERROR';
|
||||
export const ENVOIE_WALLET_TO_WALLET_USER_RESET = 'ENVOIE_WALLET_TO_WALLET_USER_RESET';
|
|
@ -12,3 +12,8 @@ export const GET_USER_IDENTIFICATION_PENDING = 'GET_USER_IDENTIFICATION_PENDING'
|
|||
export const GET_USER_IDENTIFICATION_SUCCESS = 'GET_USER_IDENTIFICATION_SUCCESS';
|
||||
export const GET_USER_IDENTIFICATION_ERROR = 'GET_USER_IDENTIFICATION_ERROR';
|
||||
export const GET_USER_IDENTIFICATION_RESET = 'GET_USER_IDENTIFICATION_RESET';
|
||||
|
||||
export const VALIDATE_IDENTIFICATION_PENDING = 'VALIDATE_IDENTIFICATION_PENDING';
|
||||
export const VALIDATE_IDENTIFICATION_SUCCESS = 'VALIDATE_IDENTIFICATION_SUCCESS';
|
||||
export const VALIDATE_IDENTIFICATION_ERROR = 'VALIDATE_IDENTIFICATION_ERROR';
|
||||
export const VALIDATE_IDENTIFICATION_RESET = 'VALIDATE_IDENTIFICATION_RESET';
|
|
@ -37,5 +37,6 @@
|
|||
"createIdentificationUser": "createIdentificationUser",
|
||||
"validateIdentification": "validateIdentification",
|
||||
"operateurOptionSelect": "operateurOptionSelect",
|
||||
"paiementFacture": "paiementFacture"
|
||||
"paiementFacture": "paiementFacture",
|
||||
"envoieWalletToWalletUser": "envoieWalletToWalletUser"
|
||||
}
|
||||
|
|
|
@ -1390,7 +1390,7 @@ class Home extends BaseScreen {
|
|||
translucent={true}
|
||||
/>
|
||||
{/* Start here to comment */}
|
||||
{
|
||||
{/* {
|
||||
(this.state.loadingDialog || this.props.loading) ?
|
||||
<View
|
||||
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
|
||||
|
@ -1426,7 +1426,7 @@ class Home extends BaseScreen {
|
|||
this.setState({ showProgress: false })
|
||||
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
||||
}}
|
||||
/>
|
||||
/> */}
|
||||
{this.makeCardSearch()}
|
||||
{this.makeSlidingUp()}
|
||||
{this.makeDialogLoader()}
|
||||
|
|
|
@ -187,7 +187,7 @@ class CreateIdentification extends Component {
|
|||
|
||||
showErrorDialog() {
|
||||
this.setState({ modalDialog: false })
|
||||
Aler.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
||||
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
||||
"et que vous êtes connecté à internet puis ressayer", [{
|
||||
text: "Recommencer", onPress: () => {
|
||||
this.watchLocation()
|
||||
|
@ -302,18 +302,6 @@ class CreateIdentification extends Component {
|
|||
this.showErrorDialog()
|
||||
});
|
||||
this.setState({ myPosition: myPosition });
|
||||
/* if (this.mapRef !== undefined && this.mapRef !== null) {
|
||||
this.mapRef.animateToCoordinate({
|
||||
latitude: myPosition.latitude,
|
||||
longitude: myPosition.longitude
|
||||
}, 1000);
|
||||
this.mapRef.animateToRegion({
|
||||
latitude: myPosition.latitude,
|
||||
longitude: myPosition.longitude,
|
||||
latitudeDelta: 0.03,
|
||||
longitudeDelta: 0.01,
|
||||
}, 1000)
|
||||
} */
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,25 +1,34 @@
|
|||
import Button from 'apsl-react-native-button';
|
||||
import React, { Component } from 'react';
|
||||
import { Alert, PermissionsAndroid, ScrollView, StyleSheet, Image, Text, View } from 'react-native';
|
||||
import { Alert, Image, PermissionsAndroid, Platform, ProgressBarAndroid, ScrollView, StyleSheet, Text, View } from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import Dialog from "react-native-dialog";
|
||||
import { TouchableOpacity } from 'react-native-gesture-handler';
|
||||
import I18n from 'react-native-i18n';
|
||||
import ImagePicker from 'react-native-image-crop-picker';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import PopoverTooltip from 'react-native-popover-tooltip';
|
||||
import ImagePicker from 'react-native-image-crop-picker';
|
||||
import Dialog from "react-native-dialog";
|
||||
import { Color } from '../../config/Color';
|
||||
import { readUser } from './../../webservice/AuthApi';
|
||||
import isNil from 'lodash/isNil';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import { SinglePickerMaterialDialog, MultiPickerMaterialDialog, MaterialDialog } from "react-native-material-dialog";
|
||||
import { readUser, getTownInformationName, getListCountriesActive } from './../../webservice/AuthApi';
|
||||
import { Typography, FontWeight } from '../../config/typography';
|
||||
import { connect } from 'react-redux';
|
||||
import Geolocation from 'react-native-geolocation-service';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { getUserIdentificationResetAction, getUserIdentificationAction, validateIdentificationAction, validateIdentificationResetAction } from '../../webservice/IdentificationApi'
|
||||
import { getPositionInformation } from '../../webservice/MapService';
|
||||
let theme = require('./../../utils/theme.json');
|
||||
let route = require('./../../route.json');
|
||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
||||
const moment = require('moment');
|
||||
|
||||
|
||||
export default class ValidateIdentification extends Component {
|
||||
class ValidateIdentification extends Component {
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
|
@ -48,13 +57,30 @@ export default class ValidateIdentification extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
memberCode: null,
|
||||
numeroTelephone: null,
|
||||
image: null,
|
||||
displayImage: false,
|
||||
userPhoto: null,
|
||||
cardFront: null,
|
||||
cardBack: null,
|
||||
idNetwork: null,
|
||||
idUser: null,
|
||||
idIdentification: null,
|
||||
displayUploadButtons: false,
|
||||
triggerSubmitClick: false,
|
||||
triggerValidateClick: false,
|
||||
isIdentified: false,
|
||||
modalVisible: true,
|
||||
isIdentifiedValidated: false,
|
||||
userId: null,
|
||||
isLoging: false,
|
||||
countries: [],
|
||||
town: [],
|
||||
townName: null,
|
||||
country: null,
|
||||
|
||||
datatoSend: null
|
||||
};
|
||||
this.dataToSendTemp = new FormData();
|
||||
this.props.getUserIdentificationResetAction();
|
||||
this.props.validateIdentificationResetAction();
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
@ -65,14 +91,21 @@ export default class ValidateIdentification extends Component {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
this.requestCameraPermission();
|
||||
} else {
|
||||
this.watchLocation();
|
||||
}
|
||||
}
|
||||
componentWillUnmount() {
|
||||
this.mounted = false;
|
||||
if (this.watchID) Geolocation.clearWatch(this.watchID);
|
||||
}
|
||||
|
||||
showErrorDialog() {
|
||||
this.setState({ modalDialog: false })
|
||||
Aler.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
||||
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
||||
"et que vous êtes connecté à internet puis ressayer", [{
|
||||
text: "Recommencer", onPress: () => {
|
||||
this.watchLocation()
|
||||
|
@ -80,6 +113,17 @@ export default class ValidateIdentification extends Component {
|
|||
}, { text: "Annuler", onPress: () => { this.props.navigation.popToTop() } }])
|
||||
}
|
||||
|
||||
async watchLocation() {
|
||||
Geolocation.getCurrentPosition((position) => {
|
||||
this.treatPosition(position)
|
||||
}, (e) => {
|
||||
this.showErrorDialog()
|
||||
}, this.props.geolocationOptions);
|
||||
if (!this.watchID) {
|
||||
Geolocation.watchPosition((position) => { this.treatPosition(position) }, (e) => { this.showErrorDialog() }, this.props.geolocationOptions)
|
||||
}
|
||||
}
|
||||
|
||||
async requestCameraPermission() {
|
||||
try {
|
||||
const granted = await PermissionsAndroid.request(
|
||||
|
@ -114,6 +158,295 @@ export default class ValidateIdentification extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
treatPosition(position) {
|
||||
const myLastPosition = this.state.myPosition;
|
||||
const myPosition = position.coords;
|
||||
|
||||
if (!isEqual(myPosition, myLastPosition)) {
|
||||
getPositionInformation(myPosition).then((response) => {
|
||||
if (response.results !== undefined) {
|
||||
if (response.results.length > 0) {
|
||||
let most = response.results[0]
|
||||
let { address_components, formatted_address, place_id } = most
|
||||
this.setState({ address: address_components, textadress: formatted_address, place: place_id })
|
||||
|
||||
let results = response.results;
|
||||
let shortcountry;
|
||||
let mcountry;
|
||||
for (let i = 0; i < results[0].address_components.length; i++) {
|
||||
for (let j = 0; j < results[0].address_components[i].types.length; j++) {
|
||||
if (results[0].address_components[i].types[j] === "country") {
|
||||
mcountry = results[0].address_components[i];
|
||||
shortcountry = mcountry.short_name;
|
||||
this.setState({ shortCountry: mcountry.short_name, longCountry: mcountry.long_name })
|
||||
} else if (results[0].address_components[i].types[j] === "locality") {
|
||||
const name = results[0].address_components[i].short_name;
|
||||
getTownInformationName(name).then((result) => {
|
||||
let town = null;
|
||||
if (result instanceof Array) {
|
||||
town = result[0];
|
||||
} else {
|
||||
town = result;
|
||||
}
|
||||
|
||||
this.setState({ modalVisible: false });
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
getListCountriesActive().then((cnt) => {
|
||||
this.setState({ countries: cnt })
|
||||
var found = false
|
||||
for (let i of cnt) {
|
||||
if (i.code_country === shortcountry) {
|
||||
found = true;
|
||||
this.setState({ modalVisible: false, indicatif: i.code_dial, country: i.name })
|
||||
/* this.getNetworks(i.code_dial); */
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{ text: "OK" }]);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}).catch((e) => {
|
||||
this.showErrorDialog()
|
||||
});
|
||||
this.setState({ myPosition: myPosition });
|
||||
/* if (this.mapRef !== undefined && this.mapRef !== null) {
|
||||
this.mapRef.animateToCoordinate({
|
||||
latitude: myPosition.latitude,
|
||||
longitude: myPosition.longitude
|
||||
}, 1000);
|
||||
this.mapRef.animateToRegion({
|
||||
latitude: myPosition.latitude,
|
||||
longitude: myPosition.longitude,
|
||||
latitudeDelta: 0.03,
|
||||
longitudeDelta: 0.01,
|
||||
}, 1000)
|
||||
} */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
createFormData = (key, photo) => {
|
||||
this.dataToSendTemp.append(key, {
|
||||
name: photo.path.split('/').pop(),
|
||||
type: photo.mime,
|
||||
uri:
|
||||
Platform.OS === "android" ? photo.path : photo.path.replace("file://", "")
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<ProgressDialog
|
||||
visible={this.props.loadingUserIndentification || this.props.loadingValidateIdentification}
|
||||
title={I18n.t('LOADING')}
|
||||
message={I18n.t('LOADING_INFO')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
renderLoaderModal() {
|
||||
return (
|
||||
<MaterialDialog
|
||||
visible={this.state.modalVisible}
|
||||
title={I18n.t("LOADING_INFO")}>
|
||||
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Text>{I18n.t("LOADING_DESCRIPTION_COUNTRY")}</Text>
|
||||
<ProgressBarAndroid />
|
||||
</View>
|
||||
</MaterialDialog>)
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
renderGetUserIdentificationResponse = () => {
|
||||
const { resultUserIndentification, errorUserIndentification } = this.props;
|
||||
|
||||
if (resultUserIndentification !== null) {
|
||||
if (typeof resultUserIndentification.response !== 'undefined') {
|
||||
if (resultUserIndentification.status === 200) {
|
||||
|
||||
if (resultUserIndentification.response.isIdentifiedValidated) {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_IDENTIFICATION'),
|
||||
I18n.t('ALREADY_VALIDATED'),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getUserIdentificationResetAction();
|
||||
this.setState({ triggerSubmitClick: false })
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
|
||||
if (!resultUserIndentification.response.isIdentified && !resultUserIndentification.response.isIdentifiedValidated) {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_IDENTIFICATION'),
|
||||
I18n.t('NOT_IDENTIFIED'),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getUserIdentificationResetAction();
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
|
||||
if (resultUserIndentification.response.isIdentified && !resultUserIndentification.response.isIdentifiedValidated) {
|
||||
this.setState({
|
||||
isIdentified: resultUserIndentification.response.isIdentified,
|
||||
isIdentifiedValidated: resultUserIndentification.response.isIdentifiedValidated,
|
||||
idIdentification: resultUserIndentification.response.data.id,
|
||||
idNetwork: resultUserIndentification.response.data.idNetwork,
|
||||
idUser: resultUserIndentification.response.data.id_user,
|
||||
displayUploadButtons: true,
|
||||
triggerSubmitClick: false
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (errorUserIndentification !== null) {
|
||||
if (typeof errorUserIndentification.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
errorUserIndentification.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getUserIdentificationResetAction();
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
JSON.stringify(errorUserIndentification),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
this.props.getUserIdentificationResetAction();
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
renderValidationResponse = () => {
|
||||
const { resultValidateIdentification, errorValidateIdentification } = this.props;
|
||||
|
||||
if (resultValidateIdentification !== null) {
|
||||
if (typeof resultValidateIdentification.response !== 'undefined') {
|
||||
if (resultValidateIdentification.status === 200) {
|
||||
|
||||
Alert.alert(
|
||||
'Validation effectué',
|
||||
'Utilisateur validé avec succès',
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.validateIdentificationResetAction();
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (errorValidateIdentification !== null) {
|
||||
if (typeof errorValidateIdentification.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
errorValidateIdentification.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.validateIdentificationResetAction();
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
JSON.stringify(errorValidateIdentification),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.validateIdentificationResetAction();
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onSubmitValidationClient = () => {
|
||||
const { displayUploadButtons, numeroTelephone } = this.state;
|
||||
|
||||
if (displayUploadButtons) {
|
||||
console.log('TRUE', displayUploadButtons);
|
||||
this.dataToSendTemp.append('id_network', 1);
|
||||
this.dataToSendTemp.append('id_country', 1);
|
||||
this.props.validateIdentificationAction(this.dataToSendTemp, this.state.idIdentification);
|
||||
} else {
|
||||
if (this.ckeckIfFieldIsOK(numeroTelephone))
|
||||
this.numeroTelephoneAnim.shake(800);
|
||||
else {
|
||||
this.props.getUserIdentificationAction(numeroTelephone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onPicture = ({ uri }) => {
|
||||
this.setState({ image: uri, displayCamera: true });
|
||||
console.log("URI", uri);
|
||||
|
@ -126,12 +459,19 @@ export default class ValidateIdentification extends Component {
|
|||
renderDialogImage = () => {
|
||||
|
||||
return (
|
||||
<Dialog.Container useNativeDriver={true} visible={this.state.displayImage}>
|
||||
<Dialog.Container contentStyle={{ width: responsiveWidth(80) }} useNativeDriver={true} visible={this.state.displayImage}>
|
||||
|
||||
<Dialog.Title>Image</Dialog.Title>
|
||||
<Dialog.Title>{I18n.t('PREVISUALISATION')}</Dialog.Title>
|
||||
|
||||
<View>
|
||||
<Image source={{ uri: this.state.image.path }} style={{ width: this.state.image.width, height: this.state.image.height }} />
|
||||
<View style={{ width: 50 }} />
|
||||
<View style={{ justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
||||
<Image source={{ uri: this.state.image.path }} style={{
|
||||
width: this.state.image.width, height: this.state.image.height, aspectRatio: 1,
|
||||
resizeMode: 'contain'
|
||||
}} />
|
||||
</View>
|
||||
<View style={{ width: 50 }} />
|
||||
</View>
|
||||
|
||||
<Dialog.Button bold={true} label={I18n.t('OK')} onPress={() => {
|
||||
|
@ -148,8 +488,12 @@ export default class ValidateIdentification extends Component {
|
|||
const { showPickerDateNaissance } = this.state;
|
||||
return (
|
||||
<>
|
||||
{(this.props.loadingUserIndentification || this.props.loadingValidateIdentification) && this.renderLoader()}
|
||||
{this.state.displayImage && this.renderDialogImage()}
|
||||
{this.state.modalVisible && this.renderLoaderModal()}
|
||||
{this.state.triggerSubmitClick && this.renderGetUserIdentificationResponse()}
|
||||
{this.state.triggerValidateClick && this.renderValidationResponse()}
|
||||
<ScrollView style={styles.container}>
|
||||
{this.state.displayImage && this.renderDialogImage()}
|
||||
<Text style={styles.subbigtitle}>{I18n.t('CREATE_IDENTIFICATION_TITLE')}</Text>
|
||||
|
||||
{/* <Animatable.View style={{
|
||||
|
@ -181,30 +525,41 @@ export default class ValidateIdentification extends Component {
|
|||
</TouchableOpacity>
|
||||
</Animatable.View> */}
|
||||
|
||||
<Animatable.View ref={(comp) => { this.nameanim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||
label={`${I18n.t('MEMBER_CODE')}`}
|
||||
<Animatable.View ref={(comp) => { this.numeroTelephoneAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'phone'}
|
||||
label={`${I18n.t('PHONE_NUMBER')}`}
|
||||
iconColor={'#f95a25'}
|
||||
value={this.state.numeroTelephone === null ? this.state.indicatif : this.state.numeroTelephone}
|
||||
iconSize={20}
|
||||
onChangeText={(memberCode) => {
|
||||
this.setState({ memberCode })
|
||||
onChangeText={(numeroTelephone) => {
|
||||
this.setState({ numeroTelephone })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
{
|
||||
this.state.displayUploadButtons &&
|
||||
<View style={{ marginTop: 20, flexDirection: 'row' }}>
|
||||
|
||||
<View style={{ marginTop: 20, flexDirection: 'row' }}>
|
||||
<View style={[styles.contentPicker]}>
|
||||
|
||||
<View style={[styles.contentPicker]}>
|
||||
|
||||
<PopoverTooltip
|
||||
ref='toolTipVisibleUserPhoto'
|
||||
buttonComponent={
|
||||
<View style={[styles.contentPicker]}>
|
||||
<TouchableOpacity
|
||||
style={[styles.contain]}
|
||||
onPress={() => { this.refs['toolTipVisibleUserPhoto'].toggle(); }}
|
||||
onPress={() => {
|
||||
ImagePicker.openCamera({
|
||||
width: 200,
|
||||
height: 200,
|
||||
cropping: true,
|
||||
useFrontCamera: true
|
||||
}).then(image => {
|
||||
this.createFormData('user_image', image);
|
||||
this.setState({ image, displayImage: true });
|
||||
})
|
||||
}}
|
||||
activeOpacity={0.9}>
|
||||
<View style={[styles.contcontainerCenterentLeft]}>
|
||||
<View>
|
||||
|
@ -215,48 +570,27 @@ export default class ValidateIdentification extends Component {
|
|||
</View>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
}
|
||||
items={[
|
||||
{
|
||||
label: 'Camera',
|
||||
onPress: () => {
|
||||
ImagePicker.openCamera({
|
||||
width: 200,
|
||||
height: 200,
|
||||
cropping: true,
|
||||
}).then(image => {
|
||||
this.setState({ image, displayImage: true });
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Galerie',
|
||||
onPress: () => {
|
||||
ImagePicker.openPicker({
|
||||
width: 300,
|
||||
height: 400,
|
||||
cropping: true
|
||||
}).then(image => {
|
||||
this.setState({ image, displayImage: true });
|
||||
});
|
||||
}
|
||||
}
|
||||
]}
|
||||
animationType='spring'
|
||||
overlayStyle={{ backgroundColor: 'transparent' }} // set the overlay invisible
|
||||
tooltipContainerStyle={{ borderRadius: 0 }}
|
||||
labelContainerStyle={{ backgroundColor: Color.whiteColor, width: 120, alignItems: 'center' }}
|
||||
labelSeparatorColor={Color.dividerColor}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View style={[styles.contentPicker]}>
|
||||
<PopoverTooltip
|
||||
ref='toolTipVisibleCardFront'
|
||||
buttonComponent={
|
||||
<Text style={[Typography.footnote, FontWeight.semibold], { color: Color.whiteColor }}>{I18n.t('PROFILE_PICTURE')}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={[styles.contentPicker]}>
|
||||
|
||||
<View style={[styles.contentPicker]}>
|
||||
<TouchableOpacity
|
||||
style={[styles.contain]}
|
||||
onPress={() => { this.refs['toolTipVisibleCardFront'].toggle(); }}
|
||||
onPress={() => {
|
||||
ImagePicker.openCamera({
|
||||
width: 400,
|
||||
height: 281,
|
||||
cropping: true,
|
||||
useFrontCamera: false
|
||||
}).then(image => {
|
||||
this.createFormData('document_image_front', image);
|
||||
this.setState({ image, displayImage: true });
|
||||
})
|
||||
}}
|
||||
activeOpacity={0.9}>
|
||||
<View style={[styles.contcontainerCenterentLeft]}>
|
||||
<View>
|
||||
|
@ -267,99 +601,51 @@ export default class ValidateIdentification extends Component {
|
|||
</View>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
}
|
||||
items={[
|
||||
{
|
||||
label: 'Camera',
|
||||
onPress: () => {
|
||||
ImagePicker.openCamera({
|
||||
width: 400,
|
||||
height: 200,
|
||||
cropping: true,
|
||||
}).then(image => {
|
||||
this.setState({ image, displayImage: true });
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Galerie',
|
||||
onPress: () => {
|
||||
ImagePicker.openPicker({
|
||||
width: 400,
|
||||
height: 200,
|
||||
cropping: true
|
||||
}).then(image => {
|
||||
this.setState({ image, displayImage: true });
|
||||
});
|
||||
}
|
||||
}
|
||||
]}
|
||||
animationType='spring'
|
||||
overlayStyle={{ backgroundColor: 'transparent' }} // set the overlay invisible
|
||||
tooltipContainerStyle={{ borderRadius: 0 }}
|
||||
labelContainerStyle={{ backgroundColor: Color.whiteColor, width: 120, alignItems: 'center' }}
|
||||
labelSeparatorColor={Color.dividerColor}
|
||||
/>
|
||||
</View>
|
||||
<Text style={[Typography.footnote, FontWeight.semibold], { color: Color.whiteColor }}>{I18n.t('FRONT_FACE_CB')}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={[styles.contentPicker]}>
|
||||
<PopoverTooltip
|
||||
ref='toolTipVisibleCardBack'
|
||||
buttonComponent={
|
||||
<TouchableOpacity
|
||||
style={[styles.contain]}
|
||||
onPress={() => { this.refs['toolTipVisibleCardBack'].toggle(); }}
|
||||
activeOpacity={0.9}>
|
||||
<View style={[styles.contcontainerCenterentLeft]}>
|
||||
<View>
|
||||
<Icon name='credit-card-off' color={Color.whiteColor} style={[styles.thumb]} size={80} />
|
||||
<View style={[styles.point, { backgroundColor: Color.accentColor }]}>
|
||||
<Icon name='camera-image' color={Color.whiteColor} size={20} />
|
||||
</View>
|
||||
<View style={[styles.contentPicker]}>
|
||||
<TouchableOpacity
|
||||
style={[styles.contain]}
|
||||
onPress={() => {
|
||||
ImagePicker.openCamera({
|
||||
width: 400,
|
||||
height: 281,
|
||||
cropping: true,
|
||||
useFrontCamera: false
|
||||
}).then(image => {
|
||||
this.createFormData('document_image_back', image);
|
||||
this.setState({ image, displayImage: true });
|
||||
})
|
||||
}}
|
||||
activeOpacity={0.9}>
|
||||
<View style={[styles.contcontainerCenterentLeft]}>
|
||||
<View>
|
||||
<Icon name='credit-card-off' color={Color.whiteColor} style={[styles.thumb]} size={80} />
|
||||
<View style={[styles.point, { backgroundColor: Color.accentColor }]}>
|
||||
<Icon name='camera-image' color={Color.whiteColor} size={20} />
|
||||
</View>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
}
|
||||
items={[
|
||||
{
|
||||
label: 'Camera',
|
||||
onPress: () => {
|
||||
ImagePicker.openCamera({
|
||||
width: 400,
|
||||
height: 200,
|
||||
cropping: true,
|
||||
}).then(image => {
|
||||
this.setState({ image, displayImage: true });
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Galerie',
|
||||
onPress: () => {
|
||||
ImagePicker.openPicker({
|
||||
width: 400,
|
||||
height: 200,
|
||||
cropping: true
|
||||
}).then(image => {
|
||||
this.setState({ image, displayImage: true });
|
||||
});
|
||||
}
|
||||
}
|
||||
]}
|
||||
animationType='spring'
|
||||
overlayStyle={{ backgroundColor: 'transparent' }} // set the overlay invisible
|
||||
tooltipContainerStyle={{ borderRadius: 0 }}
|
||||
labelContainerStyle={{ backgroundColor: Color.whiteColor, width: 120, alignItems: 'center' }}
|
||||
labelSeparatorColor={Color.dividerColor}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
<Text style={[Typography.footnote, FontWeight.semibold], { color: Color.whiteColor }}>{I18n.t('BACK_FACE_CB')}</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</View>
|
||||
}
|
||||
|
||||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
isLoading={this.state.isLoging}
|
||||
onPress={() => { }}>
|
||||
onPress={() => {
|
||||
this.onSubmitValidationClient();
|
||||
if (this.state.displayUploadButtons)
|
||||
this.setState({ triggerValidateClick: true });
|
||||
this.setState({
|
||||
triggerSubmitClick: true
|
||||
})
|
||||
}}>
|
||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||
|
||||
</ScrollView>
|
||||
|
@ -368,6 +654,25 @@ export default class ValidateIdentification extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
const maptStateToProps = state => ({
|
||||
loadingUserIndentification: state.getUserIdentificationReducer.loading,
|
||||
resultUserIndentification: state.getUserIdentificationReducer.result,
|
||||
errorUserIndentification: state.getUserIdentificationReducer.error,
|
||||
|
||||
loadingValidateIdentification: state.validateIdentificationReducer.loading,
|
||||
resultValidateIdentification: state.validateIdentificationReducer.result,
|
||||
errorValidateIdentification: state.validateIdentificationReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
getUserIdentificationAction,
|
||||
getUserIdentificationResetAction,
|
||||
validateIdentificationResetAction,
|
||||
validateIdentificationAction
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(ValidateIdentification);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
|
|
|
@ -253,7 +253,7 @@ export default class OptionsMenu extends Component {
|
|||
_renderItem = (item) => {
|
||||
if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks' || item === 'walletDetail' || item === 'walletDetailUser'
|
||||
|| item === 'walletDepot' || item === 'walletRetrait' || item === 'createIdentification' || item === 'walletOptionSelect' || item === 'validateIdentification'
|
||||
|| item === 'createIdentificationUser' || item === 'operateurOptionSelect' || item === 'paiementFacture') {
|
||||
|| item === 'createIdentificationUser' || item === 'operateurOptionSelect' || item === 'paiementFacture' || item === 'envoieWalletToWalletUser') {
|
||||
return null
|
||||
} else {
|
||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||
|
|
|
@ -46,20 +46,11 @@ export default class OperateurOptionSelect extends Component {
|
|||
});
|
||||
|
||||
redirectToRoute = (item) => {
|
||||
switch (item.type) {
|
||||
this.props.navigation.push(item.screen, {
|
||||
title: item.title,
|
||||
type: item.type
|
||||
});
|
||||
|
||||
case 'PAIEMENT_ECOLE':
|
||||
this.props.navigation.push(item.screen, {
|
||||
title: item.title
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
this.props.navigation.push(item.screen, {
|
||||
title: item.title
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
renderItem = (item, index) => {
|
||||
|
|
|
@ -18,7 +18,9 @@ export default class PaiementFacture extends Component {
|
|||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||
this.state = {
|
||||
title: this.props.navigation.state.params.title,
|
||||
type: this.props.navigation.state.params.type,
|
||||
}
|
||||
console.log("Paiement facture props", this.props);
|
||||
|
||||
}
|
||||
|
||||
|
@ -42,6 +44,24 @@ export default class PaiementFacture extends Component {
|
|||
/>)
|
||||
});
|
||||
|
||||
renderLabel = () => {
|
||||
const { type } = this.state;
|
||||
|
||||
switch (type) {
|
||||
case 'PAIEMENT_ECOLE':
|
||||
return I18n.t('IDENTIFIANT_ETUDIANT')
|
||||
case 'PAIEMENT_EAU_ELECTRICITE':
|
||||
return I18n.t('NUMERO_ABONNE')
|
||||
case 'PAIEMENT_CREDIT_TELEPHONE':
|
||||
return I18n.t('PHONE_NUMBER')
|
||||
case 'PAIEMENT_ABONNEMENT_TV':
|
||||
return I18n.t('NUMERO_ABONNE')
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Provider>
|
||||
|
@ -70,9 +90,9 @@ export default class PaiementFacture extends Component {
|
|||
<OutlineTextInput
|
||||
borderBottomColor={'black'}
|
||||
keyboardType="numeric"
|
||||
label={I18n.t('NUMERO_DE_SERIE')}
|
||||
label={this.renderLabel()}
|
||||
style={{ marginTop: 10 }}
|
||||
placeholder={I18n.t('NUMERO_DE_SERIE_DESCRIPTION')}
|
||||
placeholder={this.renderLabel()}
|
||||
/>
|
||||
</View>
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ import { Alert, Dimensions, ScrollView, StatusBar, StyleSheet, Text, View } from
|
|||
import { CreditCardInput } from "react-native-credit-card-input";
|
||||
import Dialog from "react-native-dialog";
|
||||
import I18n from 'react-native-i18n';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import { Dropdown } from 'react-native-material-dropdown';
|
||||
import { Appbar, Provider } from 'react-native-paper';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
|
|
|
@ -0,0 +1,616 @@
|
|||
import Button from 'apsl-react-native-button';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
import React, { Component } from 'react';
|
||||
import { Keyboard, PermissionsAndroid, ProgressBarAndroid, ScrollView, StyleSheet, Text, View, Platform, Alert } from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import I18n from 'react-native-i18n';
|
||||
import { MaterialDialog } from "react-native-material-dialog";
|
||||
import { Dropdown } from 'react-native-material-dropdown';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import Geolocation from 'react-native-geolocation-service';
|
||||
import { identityPieces, paysDestinationData, walletActifData, typeIdIDestinataire } from '../../../utils/UtilsFunction';
|
||||
import { Color } from '../../../config/Color';
|
||||
import { getActiveCountryAction, getActiveCountryByDialCodeAction, getActiveCountryByDialCodeReset, getActiveCountryReset, getPayCountryNetworkAction, getPayCountryNetworkReset } from '../../../webservice/CountryApi';
|
||||
import { readUser, getTownInformationName, getListCountriesActive } from '../../../webservice/AuthApi';
|
||||
import { getPositionInformation } from '../../../webservice/MapService';
|
||||
let theme = require('../../../utils/theme.json');
|
||||
let route = require('../../../route.json');
|
||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
||||
const moment = require('moment');
|
||||
|
||||
class EnvoieWalletToCashUser extends Component {
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF'
|
||||
|
||||
};
|
||||
|
||||
static navigationOptions = () => {
|
||||
return {
|
||||
drawerLabel: () => null,
|
||||
headerTitle: I18n.t('DEPOSIT_WALLET_TO_WALLET'),
|
||||
headerTintColor: 'white',
|
||||
headerStyle: {
|
||||
backgroundColor: Color.primaryColor,
|
||||
marginTop: 0,
|
||||
color: 'white'
|
||||
},
|
||||
headerTitleStyle: {
|
||||
color: "white"
|
||||
},
|
||||
title: I18n.t('DEPOSIT_WALLET_TO_WALLET')
|
||||
}
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
identityPieces: identityPieces(),
|
||||
identityPiecesName: (identityPieces()[0]).name,
|
||||
paysDestination: [],
|
||||
paysDestinationSelect: null,
|
||||
walletActifs: [],
|
||||
walletActifSelect: null,
|
||||
typeIdDestinataire: typeIdIDestinataire(),
|
||||
typeIdDestinataireSelect: (typeIdIDestinataire()[0].name),
|
||||
numeroTelephone: null,
|
||||
montant: null,
|
||||
password: null,
|
||||
loading: false,
|
||||
user: null,
|
||||
modalVisible: true,
|
||||
hasLoadActiveCountryList: true,
|
||||
hasLoadActivePayCountryNetworkList: true,
|
||||
};
|
||||
|
||||
this.props.getActiveCountryReset();
|
||||
this.props.getActiveCountryByDialCodeReset();
|
||||
this.props.getPayCountryNetworkReset();
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.setState({ user });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
this.requestCameraPermission();
|
||||
} else {
|
||||
this.watchLocation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.mounted = false;
|
||||
if (this.watchID) Geolocation.clearWatch(this.watchID);
|
||||
}
|
||||
|
||||
renderGetActionCountryList = () => {
|
||||
|
||||
const { resultActiveCountryList, errorActiveCountryList } = this.props;
|
||||
if (resultActiveCountryList !== null) {
|
||||
if (typeof resultActiveCountryList.response !== 'undefined') {
|
||||
|
||||
this.setState({
|
||||
hasLoadActiveCountryList: false,
|
||||
paysDestination: resultActiveCountryList.response,
|
||||
modalVisible: false
|
||||
});
|
||||
this.watchLocation();
|
||||
}
|
||||
}
|
||||
|
||||
if (errorActiveCountryList !== null) {
|
||||
if (typeof errorActiveCountryList.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
errorActiveCountryList.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getActiveCountryReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
JSON.stringify(errorActiveCountryList),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getActiveCountryReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderGetPayCountryNetworkResponse = () => {
|
||||
const { resultPayCountryNetwork, errorPayCountryNetwork } = this.props;
|
||||
if (resultPayCountryNetwork !== null) {
|
||||
if (typeof resultPayCountryNetwork.response !== 'undefined') {
|
||||
this.setState({
|
||||
hasLoadActivePayCountryNetworkList: false,
|
||||
walletActifs: resultPayCountryNetwork.response,
|
||||
walletActifSelect: resultPayCountryNetwork.response[0].name,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (errorPayCountryNetwork !== null) {
|
||||
if (typeof errorPayCountryNetwork.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
errorPayCountryNetwork.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getPayCountryNetworkReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
JSON.stringify(errorPayCountryNetwork),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getPayCountryNetworkReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
showErrorDialog() {
|
||||
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
||||
"et que vous êtes connecté à internet puis ressayer", [{
|
||||
text: "Recommencer", onPress: () => {
|
||||
this.watchLocation()
|
||||
}
|
||||
}, { text: "Annuler", onPress: () => { this.props.navigation.pop() } }])
|
||||
}
|
||||
|
||||
|
||||
async watchLocation() {
|
||||
Geolocation.getCurrentPosition((position) => {
|
||||
this.props.getActiveCountryAction();
|
||||
this.treatPosition(position);
|
||||
return position;
|
||||
}, (e) => {
|
||||
this.showErrorDialog()
|
||||
}, this.props.geolocationOptions);
|
||||
if (!this.watchID) {
|
||||
Geolocation.watchPosition((position) => { this.treatPosition(position); return position }, (e) => { this.showErrorDialog() }, this.props.geolocationOptions)
|
||||
}
|
||||
}
|
||||
|
||||
async requestCameraPermission() {
|
||||
try {
|
||||
const granted = await PermissionsAndroid.request(
|
||||
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
|
||||
{
|
||||
'title': 'Cool Photo App Camera Permission',
|
||||
'message': 'Cool Photo App needs access to your camera ' +
|
||||
'so you can take awesome pictures.'
|
||||
}
|
||||
)
|
||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
||||
this.watchLocation();
|
||||
} else {
|
||||
Alert.alert("Echec à l'autorisation",
|
||||
"L'application n'est pas autorisé à acceder à votre position veuillez verifier que votre GPS est activé et configurer en mode Haute Precision",
|
||||
[{
|
||||
text: "Ok", onPress: () => {
|
||||
this.props.navigation.pop()
|
||||
}
|
||||
}])
|
||||
}
|
||||
} catch (err) {
|
||||
Alert.alert("Une erreur est Survenue",
|
||||
"Une erreur est survenu lors du demarrage de l'application veuillez relancer l'application",
|
||||
[{
|
||||
text: "Ok", onPress: () => {
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}])
|
||||
}
|
||||
}
|
||||
|
||||
treatPosition(position) {
|
||||
const myLastPosition = this.state.myPosition;
|
||||
const myPosition = position.coords;
|
||||
|
||||
if (!isEqual(myPosition, myLastPosition)) {
|
||||
getPositionInformation(myPosition).then((response) => {
|
||||
if (response.results !== undefined) {
|
||||
|
||||
if (response.results !== undefined) {
|
||||
if (response.results.length > 0) {
|
||||
|
||||
let results = response.results;
|
||||
let shortcountry;
|
||||
let mcountry;
|
||||
for (let i = 0; i < results[0].address_components.length; i++) {
|
||||
for (let j = 0; j < results[0].address_components[i].types.length; j++) {
|
||||
if (results[0].address_components[i].types[j] === "country") {
|
||||
mcountry = results[0].address_components[i];
|
||||
shortcountry = mcountry.short_name;
|
||||
this.setState({ shortCountry: mcountry.short_name, longCountry: mcountry.long_name })
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.state.paysDestination.length > 0) {
|
||||
|
||||
var found = false;
|
||||
for (let country of this.state.paysDestination) {
|
||||
if (country.code_country === shortcountry) {
|
||||
found = true;
|
||||
this.setState({
|
||||
modalVisible: false, indicatifCountry: country.code_dial,
|
||||
paysDestinationSelect: country.name
|
||||
});
|
||||
if (this.state.hasLoadActivePayCountryNetworkList)
|
||||
this.props.getPayCountryNetworkAction(country.id);
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{ text: "OK" }]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t("UNABLE_TO_CONNECT_TITLE"),
|
||||
I18n.t('TEXT_NETWORK_UNABLE')
|
||||
,
|
||||
[
|
||||
{ text: I18n.t("NO"), onPress: () => { this.props.navigation.pop() } },
|
||||
{
|
||||
text: I18n.t("YES"), onPress: () => {
|
||||
this.treatPosition(myPosition)
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}).catch((e) => {
|
||||
console.log("CATCH", e);
|
||||
this.showErrorDialog();
|
||||
});
|
||||
this.setState({ myPosition: myPosition });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
onSubmitSendWalletToWallet = () => {
|
||||
const { identityPiecesName, paysDestinationSelect, walletActifSelect, typeIdDestinataireSelect, numeroTelephone, montant, password } = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(identityPiecesName))
|
||||
this.identityPiecesAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(paysDestinationSelect))
|
||||
this.paysDestinationAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(walletActifSelect))
|
||||
this.walletActifAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(typeIdDestinataireSelect))
|
||||
this.typeIdDestinataireAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(typeIdDestinataireSelect))
|
||||
this.typeIdDestinataireAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(numeroTelephone))
|
||||
this.numeroTelephoneAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(montant))
|
||||
this.montantAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(password))
|
||||
this.passwordAnim.shake(800);
|
||||
else {
|
||||
this
|
||||
}
|
||||
this.setState({
|
||||
triggerSubmitClick: true
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
renderLoaderModal() {
|
||||
return (
|
||||
<MaterialDialog
|
||||
visible={this.state.modalVisible}
|
||||
title={I18n.t("LOADING_INFO")}>
|
||||
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Text>{I18n.t("LOADING_DESCRIPTION_COUNTRY")}</Text>
|
||||
<ProgressBarAndroid />
|
||||
</View>
|
||||
</MaterialDialog>)
|
||||
}
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<ProgressDialog
|
||||
visible={this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingPayCountryNetwork}
|
||||
title={I18n.t('LOADING')}
|
||||
message={I18n.t('LOADING_INFO')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log("STATE", this.state);
|
||||
return (
|
||||
<>
|
||||
{(this.state.modalVisible || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()}
|
||||
{this.state.hasLoadActiveCountryList && this.renderGetActionCountryList()}
|
||||
{this.state.hasLoadActivePayCountryNetworkList && this.renderGetPayCountryNetworkResponse()}
|
||||
{/* {this.state.triggerSubmitClick && this.renderCreateIdentificationResponse()}
|
||||
{this.state.triggerNextClick && this.renderGetNumberResponse()} */}
|
||||
<ScrollView style={styles.container}>
|
||||
|
||||
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_WALLET')}</Text>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.paysDestinationAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('PAYS_DESTINATION')}
|
||||
data={this.state.paysDestination}
|
||||
useNativeDriver={true}
|
||||
value={this.state.paysDestinationSelect === null ? '' : this.state.paysDestinationSelect}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ paysDestinationSelect: value });
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.walletActifAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('ACTIVE_WALLET')}
|
||||
data={this.state.walletActifs}
|
||||
useNativeDriver={true}
|
||||
value={isNil(this.state.walletActifSelect) ? '' : this.state.walletActifSelect}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ walletActifSelect: value });
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.identityPiecesAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('PIECE_IDENTITE')}
|
||||
data={this.state.identityPieces}
|
||||
useNativeDriver={true}
|
||||
value={this.state.identityPiecesName}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ identityPiecesName: value });
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.typeIdDestinataireAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('TYPE_IDENTIFIANT')}
|
||||
data={this.state.typeIdDestinataire}
|
||||
useNativeDriver={true}
|
||||
value={this.state.typeIdDestinataireSelect}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ typeIdDestinataireSelect: value });
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.numeroTelephoneAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'phone'}
|
||||
label={I18n.t('PHONE')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.numeroTelephone}
|
||||
onChangeText={(numeroTelephone) => {
|
||||
this.setState({ numeroTelephone })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.montantAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
||||
label={I18n.t('AMOUNT')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.montant}
|
||||
onChangeText={(montant) => {
|
||||
this.setState({ montant })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||
label={I18n.t('PASSWORD')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.password}
|
||||
onChangeText={(password) => {
|
||||
this.setState({ password })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
isLoading={this.state.isLoging}
|
||||
onPress={() => { this.onSubmitSendWalletToWallet() }}>
|
||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||
</ScrollView>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const maptStateToProps = state => ({
|
||||
loadingCountryByDialCode: state.countryByDialCode.loading,
|
||||
resultCountryByDialCode: state.countryByDialCode.result,
|
||||
errorCountryByDialCode: state.countryByDialCode.error,
|
||||
|
||||
loadingActiveCountryList: state.activeCountryListReducer.loading,
|
||||
resultActiveCountryList: state.activeCountryListReducer.result,
|
||||
errorActiveCountryList: state.activeCountryListReducer.error,
|
||||
|
||||
loadingPayCountryNetwork: state.payCountryNetworkReducer.loading,
|
||||
resultPayCountryNetwork: state.payCountryNetworkReducer.result,
|
||||
errorPayCountryNetwork: state.payCountryNetworkReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
getActiveCountryByDialCodeAction,
|
||||
getActiveCountryByDialCodeReset,
|
||||
|
||||
getPayCountryNetworkAction,
|
||||
getPayCountryNetworkReset,
|
||||
|
||||
getActiveCountryAction,
|
||||
getActiveCountryReset
|
||||
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(EnvoieWalletToCashUser);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Color.primaryDarkColor,
|
||||
},
|
||||
textbtnvalide: {
|
||||
color: 'white',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
bigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 20,
|
||||
flex: 1,
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
margin: 20,
|
||||
},
|
||||
subbigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 17,
|
||||
textAlign: 'center',
|
||||
margin: 5,
|
||||
},
|
||||
btnvalide: {
|
||||
marginTop: 20,
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52
|
||||
},
|
||||
btnSubmit: {
|
||||
marginTop: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52,
|
||||
width: "30%",
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
},
|
||||
input: {
|
||||
height: 60,
|
||||
marginTop: responsiveHeight(2),
|
||||
marginLeft: responsiveWidth(5),
|
||||
marginRight: responsiveWidth(5),
|
||||
borderRadius: 5,
|
||||
}
|
||||
});
|
|
@ -0,0 +1,656 @@
|
|||
import Button from 'apsl-react-native-button';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
import React, { Component } from 'react';
|
||||
import { Keyboard, PermissionsAndroid, ProgressBarAndroid, ScrollView, StyleSheet, Text, View, Platform, Alert } from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import I18n from 'react-native-i18n';
|
||||
import { MaterialDialog } from "react-native-material-dialog";
|
||||
import { Dropdown } from 'react-native-material-dropdown';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import Geolocation from 'react-native-geolocation-service';
|
||||
import { identityPieces, paysDestinationData, walletActifData, typeIdIDestinataire, isIlinkWorldWallet } from '../../../utils/UtilsFunction';
|
||||
import { Color } from '../../../config/Color';
|
||||
import { getActiveCountryAction, getActiveCountryByDialCodeAction, getActiveCountryByDialCodeReset, getActiveCountryReset, getPayCountryNetworkAction, getPayCountryNetworkReset } from '../../../webservice/CountryApi';
|
||||
import { readUser, getTownInformationName, getListCountriesActive } from '../../../webservice/AuthApi';
|
||||
import { getPositionInformation } from '../../../webservice/MapService';
|
||||
let theme = require('../../../utils/theme.json');
|
||||
let route = require('../../../route.json');
|
||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
||||
const moment = require('moment');
|
||||
|
||||
class EnvoieWalletToWalletUser extends Component {
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF'
|
||||
|
||||
};
|
||||
|
||||
static navigationOptions = () => {
|
||||
return {
|
||||
drawerLabel: () => null,
|
||||
headerTitle: I18n.t('DEPOSIT_WALLET_TO_WALLET'),
|
||||
headerTintColor: 'white',
|
||||
headerStyle: {
|
||||
backgroundColor: Color.primaryColor,
|
||||
marginTop: 0,
|
||||
color: 'white'
|
||||
},
|
||||
headerTitleStyle: {
|
||||
color: "white"
|
||||
},
|
||||
title: I18n.t('DEPOSIT_WALLET_TO_WALLET')
|
||||
}
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
identityPieces: identityPieces(),
|
||||
identityPiecesName: (identityPieces()[0]).name,
|
||||
paysDestination: [],
|
||||
paysDestinationSelect: null,
|
||||
walletActifs: [],
|
||||
walletActifSelect: null,
|
||||
typeIdDestinataire: typeIdIDestinataire(),
|
||||
typeIdDestinataireSelect: (typeIdIDestinataire()[0].name),
|
||||
numeroTelephoneOrWalletCode: null,
|
||||
numeroIdentite: null,
|
||||
montant: null,
|
||||
password: null,
|
||||
isIlinkWorldWalletSelect: false,
|
||||
loading: false,
|
||||
user: null,
|
||||
modalVisible: true,
|
||||
hasLoadActiveCountryList: true,
|
||||
hasLoadActivePayCountryNetworkList: true,
|
||||
triggerSubmitClick: false
|
||||
};
|
||||
|
||||
this.props.getActiveCountryReset();
|
||||
this.props.getActiveCountryByDialCodeReset();
|
||||
this.props.getPayCountryNetworkReset();
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.setState({ user });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
this.requestCameraPermission();
|
||||
} else {
|
||||
this.watchLocation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.mounted = false;
|
||||
if (this.watchID) Geolocation.clearWatch(this.watchID);
|
||||
}
|
||||
|
||||
renderGetActionCountryList = () => {
|
||||
|
||||
const { resultActiveCountryList, errorActiveCountryList } = this.props;
|
||||
if (resultActiveCountryList !== null) {
|
||||
if (typeof resultActiveCountryList.response !== 'undefined') {
|
||||
|
||||
this.setState({
|
||||
hasLoadActiveCountryList: false,
|
||||
paysDestination: resultActiveCountryList.response,
|
||||
modalVisible: false
|
||||
});
|
||||
this.watchLocation();
|
||||
}
|
||||
}
|
||||
|
||||
if (errorActiveCountryList !== null) {
|
||||
if (typeof errorActiveCountryList.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
errorActiveCountryList.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getActiveCountryReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
JSON.stringify(errorActiveCountryList),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getActiveCountryReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderGetPayCountryNetworkResponse = () => {
|
||||
const { resultPayCountryNetwork, errorPayCountryNetwork } = this.props;
|
||||
if (resultPayCountryNetwork !== null) {
|
||||
if (typeof resultPayCountryNetwork.response !== 'undefined') {
|
||||
let typeIdentifiant = isIlinkWorldWallet(resultPayCountryNetwork.response[0].type) ? I18n.t('CODE_WALLET') : I18n.t('PHONE');
|
||||
this.setState({
|
||||
hasLoadActivePayCountryNetworkList: false,
|
||||
walletActifs: resultPayCountryNetwork.response,
|
||||
walletActifSelect: resultPayCountryNetwork.response[0].name,
|
||||
typeIdDestinataireSelect: typeIdentifiant,
|
||||
isIlinkWorldWalletSelect: isIlinkWorldWallet(resultPayCountryNetwork.response[0].type)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (errorPayCountryNetwork !== null) {
|
||||
if (typeof errorPayCountryNetwork.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
errorPayCountryNetwork.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getPayCountryNetworkReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
JSON.stringify(errorPayCountryNetwork),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getPayCountryNetworkReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
showErrorDialog() {
|
||||
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
||||
"et que vous êtes connecté à internet puis ressayer", [{
|
||||
text: "Recommencer", onPress: () => {
|
||||
this.watchLocation()
|
||||
}
|
||||
}, { text: "Annuler", onPress: () => { this.props.navigation.pop() } }])
|
||||
}
|
||||
|
||||
|
||||
async watchLocation() {
|
||||
Geolocation.getCurrentPosition((position) => {
|
||||
this.props.getActiveCountryAction();
|
||||
this.treatPosition(position);
|
||||
return position;
|
||||
}, (e) => {
|
||||
this.showErrorDialog()
|
||||
}, this.props.geolocationOptions);
|
||||
if (!this.watchID) {
|
||||
Geolocation.watchPosition((position) => { this.treatPosition(position); return position }, (e) => { this.showErrorDialog() }, this.props.geolocationOptions)
|
||||
}
|
||||
}
|
||||
|
||||
async requestCameraPermission() {
|
||||
try {
|
||||
const granted = await PermissionsAndroid.request(
|
||||
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
|
||||
{
|
||||
'title': 'Cool Photo App Camera Permission',
|
||||
'message': 'Cool Photo App needs access to your camera ' +
|
||||
'so you can take awesome pictures.'
|
||||
}
|
||||
)
|
||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
||||
this.watchLocation();
|
||||
} else {
|
||||
Alert.alert("Echec à l'autorisation",
|
||||
"L'application n'est pas autorisé à acceder à votre position veuillez verifier que votre GPS est activé et configurer en mode Haute Precision",
|
||||
[{
|
||||
text: "Ok", onPress: () => {
|
||||
this.props.navigation.pop()
|
||||
}
|
||||
}])
|
||||
}
|
||||
} catch (err) {
|
||||
Alert.alert("Une erreur est Survenue",
|
||||
"Une erreur est survenu lors du demarrage de l'application veuillez relancer l'application",
|
||||
[{
|
||||
text: "Ok", onPress: () => {
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}])
|
||||
}
|
||||
}
|
||||
|
||||
treatPosition(position) {
|
||||
const myLastPosition = this.state.myPosition;
|
||||
const myPosition = position.coords;
|
||||
|
||||
if (!isEqual(myPosition, myLastPosition)) {
|
||||
getPositionInformation(myPosition).then((response) => {
|
||||
if (response.results !== undefined) {
|
||||
|
||||
if (response.results !== undefined) {
|
||||
if (response.results.length > 0) {
|
||||
|
||||
let results = response.results;
|
||||
let shortcountry;
|
||||
let mcountry;
|
||||
for (let i = 0; i < results[0].address_components.length; i++) {
|
||||
for (let j = 0; j < results[0].address_components[i].types.length; j++) {
|
||||
if (results[0].address_components[i].types[j] === "country") {
|
||||
mcountry = results[0].address_components[i];
|
||||
shortcountry = mcountry.short_name;
|
||||
this.setState({ shortCountry: mcountry.short_name, longCountry: mcountry.long_name })
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.state.paysDestination.length > 0) {
|
||||
|
||||
var found = false;
|
||||
for (let country of this.state.paysDestination) {
|
||||
if (country.code_country === shortcountry) {
|
||||
found = true;
|
||||
this.setState({
|
||||
modalVisible: false, indicatifCountry: country.code_dial,
|
||||
paysDestinationSelect: country.name
|
||||
});
|
||||
if (this.state.hasLoadActivePayCountryNetworkList)
|
||||
this.props.getPayCountryNetworkAction(country.id);
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{ text: "OK" }]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t("UNABLE_TO_CONNECT_TITLE"),
|
||||
I18n.t('TEXT_NETWORK_UNABLE')
|
||||
,
|
||||
[
|
||||
{ text: I18n.t("NO"), onPress: () => { this.props.navigation.pop() } },
|
||||
{
|
||||
text: I18n.t("YES"), onPress: () => {
|
||||
this.treatPosition(myPosition)
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}).catch((e) => {
|
||||
console.log("CATCH", e);
|
||||
this.showErrorDialog();
|
||||
});
|
||||
this.setState({ myPosition: myPosition });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
isMontantValid = () => {
|
||||
const { montant } = this.state;
|
||||
if ((parseInt(isEqual(montant, 0)) || montant < 0))
|
||||
return {
|
||||
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
|
||||
isValid: false
|
||||
};
|
||||
|
||||
else if (!this.isNormalInteger(montant))
|
||||
return {
|
||||
errorMessage: I18n.t('ENTER_VALID_AMOUNT'),
|
||||
isValid: false
|
||||
};
|
||||
|
||||
|
||||
else if (montant > parseInt(this.state.comptePrincipal))
|
||||
return {
|
||||
errorMessage: I18n.t('AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT'),
|
||||
isValid: false
|
||||
};
|
||||
|
||||
else
|
||||
return {
|
||||
errorMessage: '',
|
||||
isValid: true
|
||||
};
|
||||
}
|
||||
|
||||
onSubmitSendWalletToWallet = () => {
|
||||
const { identityPiecesName, paysDestinationSelect, numeroIdentite, walletActifSelect, typeIdDestinataireSelect, numeroTelephoneOrWalletCode, montant, password } = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(identityPiecesName))
|
||||
this.identityPiecesAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(paysDestinationSelect))
|
||||
this.paysDestinationAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(walletActifSelect))
|
||||
this.walletActifAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(typeIdDestinataireSelect))
|
||||
this.typeIdDestinataireAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(numeroIdentite))
|
||||
this.numeroIdentiteAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(numeroTelephoneOrWalletCode))
|
||||
this.numeroTelephoneAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(montant) || this.isMontantValid().isValid)
|
||||
this.montantAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(password))
|
||||
this.passwordAnim.shake(800);
|
||||
else {
|
||||
this
|
||||
}
|
||||
this.setState({
|
||||
triggerSubmitClick: true
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<ProgressDialog
|
||||
visible={this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingPayCountryNetwork}
|
||||
title={I18n.t('LOADING')}
|
||||
message={I18n.t('LOADING_INFO')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log("STATE", this.state);
|
||||
return (
|
||||
<>
|
||||
{(this.state.modalVisible || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()}
|
||||
{this.state.hasLoadActiveCountryList && this.renderGetActionCountryList()}
|
||||
{this.state.hasLoadActivePayCountryNetworkList && this.renderGetPayCountryNetworkResponse()}
|
||||
{this.state.triggerSubmitClick && this.renderEnvoieWalletToWalletResponse()}
|
||||
{this.state.triggerNextClick && this.renderGetNumberResponse()} */}
|
||||
<ScrollView style={styles.container}>
|
||||
|
||||
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_WALLET')}</Text>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.paysDestinationAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('PAYS_DESTINATION')}
|
||||
data={this.state.paysDestination}
|
||||
useNativeDriver={true}
|
||||
value={this.state.paysDestinationSelect === null ? '' : this.state.paysDestinationSelect}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.props.getPayCountryNetworkReset();
|
||||
|
||||
let countrySelect = data.filter(element => element.name === value);
|
||||
this.setState({ paysDestinationSelect: value, hasLoadActivePayCountryNetworkList: true }, () => {
|
||||
this.props.getPayCountryNetworkAction(countrySelect[0].id);
|
||||
});
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.walletActifAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('ACTIVE_WALLET')}
|
||||
data={this.state.walletActifs}
|
||||
useNativeDriver={true}
|
||||
value={isNil(this.state.walletActifSelect) ? '' : this.state.walletActifSelect}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ walletActifSelect: value });
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.identityPiecesAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('PIECE_IDENTITE')}
|
||||
data={this.state.identityPieces}
|
||||
useNativeDriver={true}
|
||||
value={this.state.identityPiecesName}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ identityPiecesName: value });
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
||||
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
onChangeText={(numeroIdentite) => {
|
||||
this.setState({ numeroIdentite })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.typeIdDestinataireAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
disabled={this.state.isIlinkWorldWalletSelect}
|
||||
label={I18n.t('TYPE_IDENTIFIANT')}
|
||||
data={this.state.typeIdDestinataire}
|
||||
useNativeDriver={true}
|
||||
value={this.state.typeIdDestinataireSelect}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ typeIdDestinataireSelect: value });
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.numeroTelephoneAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? 'phone' : 'lock'}
|
||||
label={isEqual(this.state.typeIdDestinataireSelect, I18n.t('PHONE')) ? I18n.t('PHONE') : I18n.t('CODE_WALLET')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.numeroTelephoneOrWalletCode}
|
||||
onChangeText={(numeroTelephoneOrWalletCode) => {
|
||||
this.setState({ numeroTelephoneOrWalletCode })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.montantAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
||||
label={I18n.t('AMOUNT')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.montant}
|
||||
onChangeText={(montant) => {
|
||||
this.setState({ montant })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||
label={I18n.t('PASSWORD')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.password}
|
||||
onChangeText={(password) => {
|
||||
this.setState({ password })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
isLoading={this.state.isLoging}
|
||||
onPress={() => { this.onSubmitSendWalletToWallet() }}>
|
||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||
</ScrollView>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const maptStateToProps = state => ({
|
||||
loadingCountryByDialCode: state.countryByDialCode.loading,
|
||||
resultCountryByDialCode: state.countryByDialCode.result,
|
||||
errorCountryByDialCode: state.countryByDialCode.error,
|
||||
|
||||
loadingActiveCountryList: state.activeCountryListReducer.loading,
|
||||
resultActiveCountryList: state.activeCountryListReducer.result,
|
||||
errorActiveCountryList: state.activeCountryListReducer.error,
|
||||
|
||||
loadingPayCountryNetwork: state.payCountryNetworkReducer.loading,
|
||||
resultPayCountryNetwork: state.payCountryNetworkReducer.result,
|
||||
errorPayCountryNetwork: state.payCountryNetworkReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
getActiveCountryByDialCodeAction,
|
||||
getActiveCountryByDialCodeReset,
|
||||
|
||||
getPayCountryNetworkAction,
|
||||
getPayCountryNetworkReset,
|
||||
|
||||
getActiveCountryAction,
|
||||
getActiveCountryReset
|
||||
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(EnvoieWalletToWalletUser);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Color.primaryDarkColor,
|
||||
},
|
||||
textbtnvalide: {
|
||||
color: 'white',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
bigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 20,
|
||||
flex: 1,
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
margin: 20,
|
||||
},
|
||||
subbigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 17,
|
||||
textAlign: 'center',
|
||||
margin: 5,
|
||||
},
|
||||
btnvalide: {
|
||||
marginTop: 20,
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52
|
||||
},
|
||||
btnSubmit: {
|
||||
marginTop: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52,
|
||||
width: "30%",
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
},
|
||||
input: {
|
||||
height: 60,
|
||||
marginTop: responsiveHeight(2),
|
||||
marginLeft: responsiveWidth(5),
|
||||
marginRight: responsiveWidth(5),
|
||||
borderRadius: 5,
|
||||
}
|
||||
});
|
|
@ -50,6 +50,7 @@ export const isIlinkWorldWallet = (walletName) => {
|
|||
return isEqual(slugify(walletName).toLowerCase(), 'ilink-world');
|
||||
}
|
||||
|
||||
|
||||
export const isEmptyObject = (obj) => {
|
||||
for (let prop in obj) {
|
||||
if (obj.hasOwnProperty(prop)) {
|
||||
|
@ -74,6 +75,57 @@ export const identityPieces = () => {
|
|||
]
|
||||
}
|
||||
|
||||
export const typeIdIDestinataire = () => {
|
||||
return [
|
||||
{
|
||||
name: I18n.t('PHONE')
|
||||
},
|
||||
{
|
||||
name: I18n.t('CODE_WALLET')
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const paysDestinationData = () => {
|
||||
return [
|
||||
{
|
||||
name: 'Cameroun'
|
||||
},
|
||||
{
|
||||
name: 'Gabon'
|
||||
},
|
||||
{
|
||||
name: 'Congo'
|
||||
},
|
||||
{
|
||||
name: 'Sénégal'
|
||||
},
|
||||
{
|
||||
name: 'Côte d\'Ivoire'
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const walletActifData = () => {
|
||||
return [
|
||||
{
|
||||
name: 'UBA'
|
||||
},
|
||||
{
|
||||
name: 'SOGO'
|
||||
},
|
||||
{
|
||||
name: 'Small World'
|
||||
},
|
||||
{
|
||||
name: 'UBA fs iLink'
|
||||
},
|
||||
{
|
||||
name: 'iLink World'
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const inputCardSource = () => [
|
||||
{
|
||||
name: I18n.t('NUMERO_DE_SERIE'),
|
||||
|
@ -199,7 +251,7 @@ export const optionDepotUserScreen = {
|
|||
subTitle: I18n.t('CHOOSE_OPTION'),
|
||||
options: [
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
screen: route.envoieWalletToWalletUser,
|
||||
icon: 'wallet',
|
||||
title: I18n.t('DEPOSIT_WALLET_TO_WALLET'),
|
||||
},
|
||||
|
@ -245,37 +297,37 @@ export const optionPaiementEauElectricite = {
|
|||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
||||
options: [
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
type: 'PAIEMENT_EAU_ELECTRICITE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur eau-électricité 1',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
type: 'PAIEMENT_EAU_ELECTRICITE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur eau-électricité 2',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
type: 'PAIEMENT_EAU_ELECTRICITE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur eau-électricité 3',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
type: 'PAIEMENT_EAU_ELECTRICITE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur eau-électricité 4',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
type: 'PAIEMENT_EAU_ELECTRICITE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur eau-électricité 5',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
type: 'PAIEMENT_EAU_ELECTRICITE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur eau-électricité 6',
|
||||
|
@ -283,7 +335,93 @@ export const optionPaiementEauElectricite = {
|
|||
]
|
||||
}
|
||||
|
||||
export const optionPaiementFactureSubScreen = {
|
||||
export const optionPaiementCreditTelephonique = {
|
||||
title: I18n.t('PAIEMENT_FACTURE'),
|
||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
||||
options: [
|
||||
{
|
||||
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur téléphonique 1',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur téléphonique 2',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur téléphonique 3',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur téléphonique 4',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur téléphonique 5',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur téléphonique 6',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const optionPaiementAbonnementTV = {
|
||||
title: I18n.t('PAIEMENT_FACTURE'),
|
||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
||||
options: [
|
||||
{
|
||||
type: 'PAIEMENT_ABONNEMENT_TV',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur abonnement TV 1',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ABONNEMENT_TV',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur abonnement TV 2',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ABONNEMENT_TV',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur abonnement TV 3',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ABONNEMENT_TV',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur abonnement TV 4',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ABONNEMENT_TV',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur abonnement TV 5',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ABONNEMENT_TV',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur abonnement TV 6',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const optionPaiementEcole = {
|
||||
title: I18n.t('PAIEMENT_FACTURE'),
|
||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
||||
options: [
|
||||
|
@ -291,37 +429,37 @@ export const optionPaiementFactureSubScreen = {
|
|||
type: 'PAIEMENT_ECOLE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur 1',
|
||||
title: 'Opérateur école 1',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur 2',
|
||||
title: 'Opérateur école 2',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur 3',
|
||||
title: 'Opérateur école 3',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur 4',
|
||||
title: 'Opérateur école 4',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur 5',
|
||||
title: 'Opérateur école 5',
|
||||
},
|
||||
{
|
||||
type: 'PAIEMENT_ECOLE',
|
||||
screen: route.paiementFacture,
|
||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||
title: 'Opérateur 6',
|
||||
title: 'Opérateur école 6',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
@ -343,21 +481,21 @@ export const optionPaiementFacture = {
|
|||
icon: 'school',
|
||||
title: 'Paiement école',
|
||||
screen: route.operateurOptionSelect,
|
||||
subScreenOption: optionPaiementFactureSubScreen
|
||||
subScreenOption: optionPaiementEcole
|
||||
},
|
||||
{
|
||||
type: 'FACTURE_PHONE',
|
||||
icon: 'phone-classic',
|
||||
title: 'Paiement crédit téléphonique',
|
||||
screen: route.operateurOptionSelect,
|
||||
subScreenOption: optionPaiementFactureSubScreen
|
||||
subScreenOption: optionPaiementCreditTelephonique
|
||||
},
|
||||
{
|
||||
type: 'FACTURE_TV',
|
||||
icon: 'television-classic',
|
||||
title: 'Paiement abonnement TV',
|
||||
screen: route.operateurOptionSelect,
|
||||
subScreenOption: optionPaiementFactureSubScreen
|
||||
subScreenOption: optionPaiementAbonnementTV
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
|
@ -72,6 +72,11 @@
|
|||
"DEPOSIT_CASH_TO_VISA": "Cash to visa card",
|
||||
"DEPOSIT_CASH_TO_BANK": "Cash to bank",
|
||||
"DEPOSIT_WALLET_TO_WALLET": "Wallet to wallet",
|
||||
"ENVOIE_WALLET_TO_WALLET": "Send Wallet to wallet",
|
||||
"CODE_WALLET": "Wallet Code",
|
||||
"ACTIVE_WALLET": "Active wallet",
|
||||
"TYPE_IDENTIFIANT": "ID type",
|
||||
"PAYS_DESTINATION": "Destination country",
|
||||
"DEPOSIT_TO_CASH": "Wallet to cash",
|
||||
"DEPOSIT_TO_CARD": "Wallet to card",
|
||||
"DEPOSIT_TO_BANK": "Wallet to bank",
|
||||
|
@ -80,6 +85,8 @@
|
|||
"NANO_SANTE": "Nano health",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano health description",
|
||||
"PAIEMENT_FACTURE": "Bill payment",
|
||||
"NUMERO_ABONNE": "Subscriber number",
|
||||
"IDENTIFIANT_ETUDIANT": "Student ID",
|
||||
"DEMAND_SEND": "Demand send",
|
||||
"WITHDRAWAL_DESCRIPTION": "Make a withdrawal",
|
||||
"COMMISSION_ACCOUNT_TITLE": "Commission account",
|
||||
|
@ -294,14 +301,21 @@
|
|||
"DELETE": "Delete",
|
||||
"FREE": "Available",
|
||||
"SAVED": "Registered",
|
||||
"PROFILE_PICTURE": "Profile picture",
|
||||
"FRONT_FACE_CB": "CB front side",
|
||||
"BACK_FACE_CB": "CB back side",
|
||||
"PREVISUALISATION": "Preview",
|
||||
"ACCOUNT_INFO": "My Account Information",
|
||||
"ALREADY_IDENTIFIED": "You are already identified",
|
||||
"NOT_IDENTIFIED": "This number exists, its identification is not yet entered",
|
||||
"ALREADY_VALIDATED": "The identification of this client has already been validated",
|
||||
"IDENTIFICATION": " Identification",
|
||||
"CREATION_IDENTIFICATION": "Creation",
|
||||
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
|
||||
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a client",
|
||||
"VALIDATE_IDENTIFICATION": "Validation",
|
||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
||||
"IDENTIFICATION_INFORMATION": "Identification information",
|
||||
"CREATE_IDENTIFICATION_TITLE": "Please fill in customer information",
|
||||
"DATE_NAISSANCE": "Date of birth",
|
||||
"REGISTER_YOURSELF": "Register",
|
||||
|
|
|
@ -77,6 +77,11 @@
|
|||
"DEPOSIT_CASH_TO_VISA": "Cash vers carte visa",
|
||||
"DEPOSIT_CASH_TO_BANK": "Cash vers banque",
|
||||
"DEPOSIT_WALLET_TO_WALLET": "Wallet vers wallet",
|
||||
"ENVOIE_WALLET_TO_WALLET": "Envoie Wallet vers wallet",
|
||||
"CODE_WALLET": "Code Wallet",
|
||||
"TYPE_IDENTIFIANT": "Type d'identifiant",
|
||||
"PAYS_DESTINATION": "Pays destination",
|
||||
"ACTIVE_WALLET": "Wallet actif",
|
||||
"DEPOSIT_TO_CASH": "Wallet vers cash",
|
||||
"DEPOSIT_TO_CARD": "Wallet vers carte",
|
||||
"DEPOSIT_TO_BANK": "Wallet vers banque",
|
||||
|
@ -85,6 +90,8 @@
|
|||
"NANO_SANTE": "Nano santé",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano santé iLink",
|
||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||
"NUMERO_ABONNE": "Numéro d'abonnée",
|
||||
"IDENTIFIANT_ETUDIANT": "Identifiant étudiant",
|
||||
"WITHDRAWAL_DESCRIPTION": "Effectuer un retrait",
|
||||
"COMMISSION_ACCOUNT_TITLE": "Cpt. commission",
|
||||
"CONFIRM": "Confirmer",
|
||||
|
@ -297,8 +304,14 @@
|
|||
"DELETE": "Supprimer",
|
||||
"FREE": "disponibles",
|
||||
"SAVED": "enregistrés",
|
||||
"PROFILE_PICTURE": "Photo de profil",
|
||||
"FRONT_FACE_CB": "Face avant CB",
|
||||
"BACK_FACE_CB": "Face arrière CB",
|
||||
"PREVISUALISATION": "Prévisualisation",
|
||||
"ACCOUNT_INFO": " Information sur mon compte",
|
||||
"ALREADY_IDENTIFIED": "Vous êtes déjà identifié",
|
||||
"NOT_IDENTIFIED": "Ce numéro existe, son identification n'est pas encore saisi",
|
||||
"ALREADY_VALIDATED": "L'identification de ce client a déjà été validée",
|
||||
"IDENTIFICATION": " Identification",
|
||||
"CREATION_IDENTIFICATION": "Création",
|
||||
"CREATION_IDENTIFICATION_CLIENT": "M'identifier",
|
||||
|
@ -306,6 +319,7 @@
|
|||
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Saisir l'identité d'un client",
|
||||
"VALIDATE_IDENTIFICATION": "Validation",
|
||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Valider une identité client",
|
||||
"IDENTIFICATION_INFORMATION": "Information sur l'identification",
|
||||
"CREATE_IDENTIFICATION_TITLE": "Veuillez renseigner les informations du client",
|
||||
"DATE_NAISSANCE": "Date de naissance",
|
||||
"REGISTER_YOURSELF": "Enregistrez-vous",
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
|
||||
import axios from "axios";
|
||||
import I18n from 'react-native-i18n';
|
||||
import { fetchActiveCountryListPending, fetchActiveCountryListSucsess, fetchActiveCountryListError, fetchActiveCountryListReset, fetchPayCountryNetworkPending, fetchPayCountryNetworkSucsess, fetchPayCountryNetworkError, fetchPayCountryNetworkReset, fetchCountryByDialCodePending, fetchCountryByDialCodeSucsess, fetchCountryByDialCodeError, fetchCountryByDialCodeReset } from "../redux/actions/CountryAction";
|
||||
import { store } from "../redux/store";
|
||||
import { activeCountryUrl, payCountryNetworkUrl } from "./IlinkConstants";
|
||||
|
||||
export const getActiveCountryAction = () => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchActiveCountryListPending());
|
||||
|
||||
axios({
|
||||
url: `${activeCountryUrl}`,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchActiveCountryListSucsess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchActiveCountryListError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchActiveCountryListError(error.request))
|
||||
else
|
||||
dispatch(fetchActiveCountryListError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const getActiveCountryReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchActiveCountryListReset());
|
||||
}
|
||||
}
|
||||
|
||||
export const getPayCountryNetworkAction = (idCountryNetwork) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchPayCountryNetworkPending());
|
||||
|
||||
axios({
|
||||
url: `${payCountryNetworkUrl}/${idCountryNetwork}`,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchPayCountryNetworkSucsess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchPayCountryNetworkError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchPayCountryNetworkError(error.request))
|
||||
else
|
||||
dispatch(fetchPayCountryNetworkError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const getPayCountryNetworkReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchPayCountryNetworkReset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const getActiveCountryByDialCodeAction = (countryDialCode) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchCountryByDialCodePending());
|
||||
|
||||
axios({
|
||||
url: `${activeCountryUrlGET}/${countryDialCode}`,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchCountryByDialCodeSucsess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchCountryByDialCodeError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchCountryByDialCodeError(error.request))
|
||||
else
|
||||
dispatch(fetchCountryByDialCodeError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const getActiveCountryByDialCodeReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchCountryByDialCodeReset());
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
import { createIdentificationUrl, getNumberInformationUrl, getUserIdentifiedInformationUrl } from "./IlinkConstants";
|
||||
import { createIdentificationUrl, validateIdentificationUrl, getNumberInformationUrl, getUserIdentifiedInformationUrl } from "./IlinkConstants";
|
||||
import { store } from "../redux/store";
|
||||
import axios from "axios";
|
||||
import I18n from 'react-native-i18n'
|
||||
import { fetchCreateIdentificationReset, fetchCreateIdentificationSuccess, fetchCreateIdentificationError, fetchCreateIdentificationPending, fetchGetNumberInformationPending, fetchGetNumberInformationSuccess, fetchGetNumberInformationError, fetchGetNumberInformationReset, fetchUserIdentificationPending, fetchUserIdentificationSuccess, fetchUserIdentificationError, fetchUserIdentificationReset } from "../redux/actions/IdentificationAction";
|
||||
import { fetchCreateIdentificationReset, fetchCreateIdentificationSuccess, fetchCreateIdentificationError, fetchCreateIdentificationPending, fetchGetNumberInformationPending, fetchGetNumberInformationSuccess, fetchGetNumberInformationError, fetchGetNumberInformationReset, fetchUserIdentificationPending, fetchUserIdentificationSuccess, fetchUserIdentificationError, fetchUserIdentificationReset, fetchValidateIndentificationPending, fetchValidateIndentificationSuccess, fetchValidateIndentificationError, fetchValidateIndentificationReset } from "../redux/actions/IdentificationAction";
|
||||
|
||||
|
||||
export const createIndentificationAction = (data) => {
|
||||
|
@ -121,3 +121,42 @@ export const getUserIdentificationResetAction = () => {
|
|||
dispatch(fetchUserIdentificationReset());
|
||||
}
|
||||
}
|
||||
|
||||
export const validateIdentificationAction = (formData, idIdentification) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchValidateIndentificationPending());
|
||||
|
||||
axios({
|
||||
url: `${validateIdentificationUrl}/${idIdentification}`,
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
},
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchValidateIndentificationSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
if (error.response)
|
||||
dispatch(fetchValidateIndentificationError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchValidateIndentificationError(error.request))
|
||||
else
|
||||
dispatch(fetchValidateIndentificationError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const validateIdentificationResetAction = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchValidateIndentificationReset());
|
||||
}
|
||||
}
|
|
@ -27,14 +27,23 @@ export const logoutActionUrl = testBaseUrl + '/logout';
|
|||
export const walletActionUrl = testBaseUrl + '/walletService/wallets';
|
||||
export const walletUserSimpleActionUrl = testBaseUrl + '/walletService/wallets/users';
|
||||
export const walletDetailUrl = testBaseUrl + '/walletService/wallets';
|
||||
|
||||
export const creditTreatDemand = testBaseUrl + '/walletService/credits/treatDemand';
|
||||
export const creditCancelDemand = testBaseUrl + '/walletService/credits/cancelDemand';
|
||||
|
||||
export const commissionAmount = testBaseUrl + '/walletService/transactions/commission';
|
||||
export const transactionUrl = testBaseUrl + '/walletService/transactions';
|
||||
export const transferCommission = testBaseUrl + '/walletService/virement';
|
||||
|
||||
export const createIdentificationUrl = testBaseUrl + '/walletService/identifications';
|
||||
export const validateIdentificationUrl = testBaseUrl + '/walletService/identifications';
|
||||
|
||||
export const getNumberInformationUrl = testBaseUrl + '/walletService/identifications/verify';
|
||||
export const getUserIdentifiedInformationUrl = testBaseUrl + '/walletService/identifications';
|
||||
|
||||
export const activeCountryUrl = testBaseUrl + '/walletService/countries';
|
||||
export const payCountryNetworkUrl = testBaseUrl + '/walletService/paying_networks';
|
||||
|
||||
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||
export const MARKER_URL = baseUrl + "/interacted/LocationAction.php";
|
||||
|
|
|
@ -6616,14 +6616,6 @@ react-native-phone-call@^1.0.9:
|
|||
resolved "https://registry.yarnpkg.com/react-native-phone-call/-/react-native-phone-call-1.0.9.tgz#4468ec6f95856557fbff9bd69a0db04b54c35e1d"
|
||||
integrity sha512-OPWYg8qeWNG/U4bWGMAKcQTH/ifqJnsvUPCH4lOkvWFHbQS3fbH5M8rFhXCzcfS0GVNzHhZX9ZByMM368TFAUQ==
|
||||
|
||||
react-native-popover-tooltip@^1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/react-native-popover-tooltip/-/react-native-popover-tooltip-1.1.4.tgz#f6f2121e6725e9da2c014a33b946162c197a4eb4"
|
||||
integrity sha1-9vISHmcl6dosAUozuUYWLBl6TrQ=
|
||||
dependencies:
|
||||
invariant "^2.2.2"
|
||||
prop-types "^15.6.0"
|
||||
|
||||
react-native-popup-dialog@^0.18.3:
|
||||
version "0.18.3"
|
||||
resolved "https://registry.yarnpkg.com/react-native-popup-dialog/-/react-native-popup-dialog-0.18.3.tgz#5d7a13fd7d9f817cf2121965a3b100a257201b67"
|
||||
|
|
Loading…
Reference in New Issue