Historique nano credit & stabilisation notificatino OK
This commit is contained in:
parent
edafab7025
commit
c6581c4b1d
41
App.js
41
App.js
|
@ -89,6 +89,7 @@ import EpargnerArgentUser from './screens/nano-credit/EpargnerArgentUser';
|
||||||
import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
|
import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
|
||||||
import { IlinkEmitter } from './utils/events';
|
import { IlinkEmitter } from './utils/events';
|
||||||
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
|
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
|
||||||
|
import { readUser } from './webservice/AuthApi';
|
||||||
|
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
|
@ -440,22 +441,32 @@ class App extends React.Component {
|
||||||
|
|
||||||
goToScreen = (routeName, params, isReset = true) => {
|
goToScreen = (routeName, params, isReset = true) => {
|
||||||
const { navigator } = this.refs;
|
const { navigator } = this.refs;
|
||||||
console.log("APP HAS LOADED", global.appHasLoaded);
|
|
||||||
if (global.appHasLoaded) {
|
|
||||||
navigator.dispatch({
|
|
||||||
type: "Navigation/NAVIGATE",
|
|
||||||
routeName,
|
|
||||||
params
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.warn("NOTIFICATION PARAMS", params);
|
|
||||||
navigator.dispatch({
|
|
||||||
type: "Navigation/NAVIGATE",
|
|
||||||
routeName: "first",
|
|
||||||
params: { routeName, params }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (typeof this.refs.navigator !== 'undefined') {
|
if (typeof this.refs.navigator !== 'undefined') {
|
||||||
|
console.log("APP HAS LOADED", global.appHasLoaded);
|
||||||
|
if (global.appHasLoaded) {
|
||||||
|
readUser().then((result) => {
|
||||||
|
if (result === null || result === undefined) {
|
||||||
|
navigator.dispatch({
|
||||||
|
type: "Navigation/NAVIGATE",
|
||||||
|
routeName: "first",
|
||||||
|
params: { routeName, params }
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
navigator.dispatch({
|
||||||
|
type: "Navigation/NAVIGATE",
|
||||||
|
routeName,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.warn("NOTIFICATION PARAMS", params);
|
||||||
|
navigator.dispatch({
|
||||||
|
type: "Navigation/NAVIGATE",
|
||||||
|
routeName: "first",
|
||||||
|
params: { routeName, params }
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -62,6 +62,7 @@
|
||||||
"CREDIT_ACCOUNT": "Credit account",
|
"CREDIT_ACCOUNT": "Credit account",
|
||||||
"SAVINGS_ACCOUNT": "Saving account",
|
"SAVINGS_ACCOUNT": "Saving account",
|
||||||
"SAVINGS": "Savings",
|
"SAVINGS": "Savings",
|
||||||
|
"SAVING": "Saving",
|
||||||
"CREDITS": "Credits",
|
"CREDITS": "Credits",
|
||||||
"PHONE_SET_AS_DEFAULT": "Default phone for notifications",
|
"PHONE_SET_AS_DEFAULT": "Default phone for notifications",
|
||||||
"NUMERO_DE_SERIE": "Serial number",
|
"NUMERO_DE_SERIE": "Serial number",
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
"CREDIT_ACCOUNT": "Compte crédit",
|
"CREDIT_ACCOUNT": "Compte crédit",
|
||||||
"SAVINGS_ACCOUNT": "Compte épargne",
|
"SAVINGS_ACCOUNT": "Compte épargne",
|
||||||
"SAVINGS": "Epargnes",
|
"SAVINGS": "Epargnes",
|
||||||
|
"SAVING": "Epargne",
|
||||||
"CREDITS": "Crédits",
|
"CREDITS": "Crédits",
|
||||||
"PHONE_SET_AS_DEFAULT": "Téléphone par défaut pour les notifications",
|
"PHONE_SET_AS_DEFAULT": "Téléphone par défaut pour les notifications",
|
||||||
"NUMERO_DE_SERIE": "Numéro de série",
|
"NUMERO_DE_SERIE": "Numéro de série",
|
||||||
|
|
|
@ -40,6 +40,7 @@ import walletTransferCommissionReducer from "./WalletTransferCommission";
|
||||||
import EpargnerArgentUserReducer from "./EpargnerArgentUserReducer";
|
import EpargnerArgentUserReducer from "./EpargnerArgentUserReducer";
|
||||||
import CasserEpargneUserReducer from "./CasserEpargneUserReducer";
|
import CasserEpargneUserReducer from "./CasserEpargneUserReducer";
|
||||||
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
||||||
|
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'root',
|
key: 'root',
|
||||||
|
@ -89,8 +90,8 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
getNanoCreditDemandDetailReducer: GetNanoCreditDemandDetailReducer,
|
getNanoCreditDemandDetailReducer: GetNanoCreditDemandDetailReducer,
|
||||||
epargnerArgentUserReducer: EpargnerArgentUserReducer,
|
epargnerArgentUserReducer: EpargnerArgentUserReducer,
|
||||||
casserEpargneUserReducer: CasserEpargneUserReducer,
|
casserEpargneUserReducer: CasserEpargneUserReducer,
|
||||||
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer
|
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
|
||||||
|
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
|
@ -1,11 +1,13 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { StyleSheet, View, Image, StatusBar, Alert, FlatList, TouchableOpacity, ActivityIndicator, Platform, ProgressBarAndroid, Text } from 'react-native';
|
import { StyleSheet, ScrollView, View, Image, StatusBar, Alert, FlatList, TouchableOpacity, ActivityIndicator, Platform, ProgressBarAndroid, Text } from 'react-native';
|
||||||
import { ActionSheetProvider, connectActionSheet } from '@expo/react-native-action-sheet'
|
import { ActionSheetProvider, connectActionSheet } from '@expo/react-native-action-sheet'
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useActionSheet } from '@expo/react-native-action-sheet'
|
import { useActionSheet } from '@expo/react-native-action-sheet'
|
||||||
const route = require('./../../route.json');
|
const route = require('./../../route.json');
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n';
|
||||||
|
import isEqual from 'lodash/isEqual';
|
||||||
|
import omit from 'lodash/omit';
|
||||||
import * as Utils from '../../utils/DeviceUtils';
|
import * as Utils from '../../utils/DeviceUtils';
|
||||||
import { Images } from '../../config/Images';
|
import { Images } from '../../config/Images';
|
||||||
import { Color } from '../../config/Color';
|
import { Color } from '../../config/Color';
|
||||||
|
@ -18,12 +20,15 @@ import _ from 'lodash';
|
||||||
import Icons from 'react-native-vector-icons/Ionicons'
|
import Icons from 'react-native-vector-icons/Ionicons'
|
||||||
import { FontWeight, Typography } from '../../config/typography';
|
import { FontWeight, Typography } from '../../config/typography';
|
||||||
import LottieView from 'lottie-react-native';
|
import LottieView from 'lottie-react-native';
|
||||||
import { isIlinkWorldWallet, optionDepotScreen, optionPaiementFactureSubScreen, displayToast } from '../../utils/UtilsFunction';
|
import { isIlinkWorldWallet, optionDepotScreen, optionPaiementFactureSubScreen, displayTransactionType, displayToast, cutStringWithoutDot, cutString } from '../../utils/UtilsFunction';
|
||||||
import chunk from 'lodash/chunk';
|
import chunk from 'lodash/chunk';
|
||||||
import thousands from 'thousands';
|
import thousands from 'thousands';
|
||||||
import Tag from '../../components/Tag';
|
import Tag from '../../components/Tag';
|
||||||
|
import Dialog from "react-native-dialog";
|
||||||
|
import { transactionHistoryNanoCreditLabel } from '../../utils/UtilsFunction';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { responsiveWidth } from 'react-native-responsive-dimensions';
|
||||||
|
|
||||||
class WalletOptionSelect extends Component {
|
class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
|
@ -41,6 +46,8 @@ class WalletOptionSelect extends Component {
|
||||||
isIdentified: this.props.navigation.state.params.isIdentified || null,
|
isIdentified: this.props.navigation.state.params.isIdentified || null,
|
||||||
isNanoCredit: this.props.navigation.state.params.hasOwnProperty('isNanoCredit'),
|
isNanoCredit: this.props.navigation.state.params.hasOwnProperty('isNanoCredit'),
|
||||||
user: null,
|
user: null,
|
||||||
|
displayModalHistory: false,
|
||||||
|
historyItemDetail: null,
|
||||||
isDataHasLoaded: false
|
isDataHasLoaded: false
|
||||||
}
|
}
|
||||||
console.log("WALLET OPTION PROPS", this.props);
|
console.log("WALLET OPTION PROPS", this.props);
|
||||||
|
@ -344,11 +351,326 @@ class WalletOptionSelect extends Component {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
renderHistoryTransactionList = () => {
|
||||||
|
const { resultHistory, errorHistory } = this.props;
|
||||||
|
if (errorHistory !== null) {
|
||||||
|
if (typeof errorHistory.data !== 'undefined') {
|
||||||
|
return (
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Text style={Typography.body1}>{errorHistory.data.error}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Text style={Typography.body1}>{errorHistory}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (resultHistory !== null) {
|
||||||
|
if (resultHistory.response !== null) {
|
||||||
|
return (
|
||||||
|
Array.isArray(resultHistory.response) && (resultHistory.response.length) > 0 ?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
|
{
|
||||||
|
transactionHistoryNanoCreditLabel().map((item, index) => (
|
||||||
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
|
{item.label}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
resultHistory.response.map((item, index) => (
|
||||||
|
this.renderHistoryTransactionItem(item, index)
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
(
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'flex-start' }}>
|
||||||
|
<Text style={Typography.body1}>{I18n.t('NO_WALLET_HISTORY')}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
renderHistoryTransactionItem = (item, index) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TouchableOpacity onPress={() => { this.setState({ displayModalHistory: true, historyItemDetail: item }) }} style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
|
{
|
||||||
|
Object.keys(omit(item, ['id', 'type', 'id_epargne', 'id_demande', 'duree_mois', 'taxe', '', 'date_fin', 'date_cassation', 'etat', 'id_user', 'id_network', 'user', 'partiellement_rembourse', 'user_phone', 'type_caution', 'interet', 'date_remboursement_prevu', 'date_remboursement', 'id_wallet_agent', 'retrait_cash', 'codeParrain', 'agent', 'montant_rembourse',])).map((element, i) => (
|
||||||
|
<View style={{ alignItems: 'center' }} key={i}>
|
||||||
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
|
{
|
||||||
|
isEqual(element, 'montant') ?
|
||||||
|
` ${thousands(item[element], ' ')} ${this.state.wallet.currency_code}`
|
||||||
|
: isEqual(element, 'date_creation') ?
|
||||||
|
cutStringWithoutDot(item[element], 16) :
|
||||||
|
isEqual(element, 'type_historique') ?
|
||||||
|
displayTransactionType(item[element])
|
||||||
|
: item[element]
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderModalHistoryDetail = () => {
|
||||||
|
const { historyItemDetail } = this.state;
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
||||||
|
|
||||||
|
<Dialog.Title>Détail de l'historique</Dialog.Title>
|
||||||
|
|
||||||
|
<ScrollView persistentScrollbar={true}>
|
||||||
|
{
|
||||||
|
isEqual(historyItemDetail.type_historique, 'N') ?
|
||||||
|
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('ID_DEMAND')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.id_demande}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('STATUS')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.etat}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('DEMAND_DURATION_IN_MONTH')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.duree_mois}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT_REFUND')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_rembourse + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT_PARTIALLY_REFUND')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.partiellement_rembourse + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('TAXES')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.taxe + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('INTERET')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.interet + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('WITHDRAWAL_IN_CASH')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.retrait_cash + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('CREATION_DATE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_creation}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('DEMAND_DATE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_demande}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('DATE_REMBOURSEMENT_PREVU')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_remboursement_prevu}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('DATE_REMBOURSEMENT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_remboursement}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
:
|
||||||
|
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('ID_DEMAND')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.id_demande}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('STATUS')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.etat}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('DEMAND_DURATION_IN_MONTH')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.duree_mois}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.type}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('TAXES')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.taxe + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('INTERET')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.interet + ' ' + this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('CREATION_DATE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_creation}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('FINAL_DATE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_fin}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('CASSATION_DATE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_cassation}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('OK')} onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
displayModalHistory: !this.state.displayModalHistory,
|
||||||
|
});
|
||||||
|
|
||||||
|
}} />
|
||||||
|
|
||||||
|
</Dialog.Container>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
!this.state.isDataHasLoaded && this.renderResultGetNanoCreditAccount();
|
!this.state.isDataHasLoaded && this.renderResultGetNanoCreditAccount();
|
||||||
return (
|
return (
|
||||||
<Provider>
|
<Provider>
|
||||||
<View style={{ flex: 1 }}>
|
<ScrollView style={{ flex: 1 }}>
|
||||||
|
|
||||||
<StatusBar
|
<StatusBar
|
||||||
backgroundColor={Color.primaryDarkColor}
|
backgroundColor={Color.primaryDarkColor}
|
||||||
|
@ -368,6 +690,8 @@ class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
|
|
||||||
|
{this.state.displayModalHistory && this.renderModalHistoryDetail()}
|
||||||
|
|
||||||
<View>
|
<View>
|
||||||
{
|
{
|
||||||
this.state.isNanoCredit ?
|
this.state.isNanoCredit ?
|
||||||
|
@ -412,9 +736,40 @@ class WalletOptionSelect extends Component {
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.title3, Typography.semibold]}>
|
||||||
|
{I18n.t('TRANSACTION_HISTORY')}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{
|
||||||
|
this.props.loadingHistory ?
|
||||||
|
(
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
{Platform.OS === 'android'
|
||||||
|
?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<ProgressBarAndroid />
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<ActivityIndicator size="large" color={'#ccc'} />
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
) :
|
||||||
|
this.renderHistoryTransactionList()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
</View>
|
</ScrollView>
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -424,6 +779,10 @@ const mapStateToProps = state => ({
|
||||||
loading: state.getNanoCreditAccountUserReducer.loading,
|
loading: state.getNanoCreditAccountUserReducer.loading,
|
||||||
result: state.getNanoCreditAccountUserReducer.result,
|
result: state.getNanoCreditAccountUserReducer.result,
|
||||||
error: state.getNanoCreditAccountUserReducer.error,
|
error: state.getNanoCreditAccountUserReducer.error,
|
||||||
|
|
||||||
|
loadingHistory: state.getNanoCreditHistoryUserReducer.loading,
|
||||||
|
resultHistory: state.getNanoCreditHistoryUserReducer.result,
|
||||||
|
errorHistory: state.getNanoCreditHistoryUserReducer.error,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
@ -507,9 +866,49 @@ const styles = StyleSheet.create({
|
||||||
contentTitle: {
|
contentTitle: {
|
||||||
paddingTop: 12,
|
paddingTop: 12,
|
||||||
},
|
},
|
||||||
|
contentService: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
blockView: {
|
blockView: {
|
||||||
paddingVertical: 10,
|
paddingVertical: 10,
|
||||||
borderBottomWidth: 0.5,
|
borderBottomWidth: 0.5,
|
||||||
},
|
},
|
||||||
|
containField: {
|
||||||
|
padding: 10,
|
||||||
|
marginBottom: 20,
|
||||||
|
borderWidth: 0.5,
|
||||||
|
shadowOffset: { width: 1.5, height: 1.5 },
|
||||||
|
shadowOpacity: 1.0,
|
||||||
|
elevation: 5,
|
||||||
|
flexDirection: "row",
|
||||||
|
height: 140,
|
||||||
|
borderRadius: 10
|
||||||
|
},
|
||||||
|
paymentItem: {
|
||||||
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
paddingVertical: 5,
|
||||||
|
width: responsiveWidth(100),
|
||||||
|
marginBottom: 15
|
||||||
|
},
|
||||||
|
iconContent: {
|
||||||
|
width: 60,
|
||||||
|
marginRight: 10,
|
||||||
|
alignItems: "center"
|
||||||
|
},
|
||||||
|
contentLeftItem: {
|
||||||
|
flex: 1,
|
||||||
|
paddingTop: 40,
|
||||||
|
paddingLeft: 10,
|
||||||
|
paddingRight: 10,
|
||||||
|
alignItems: "center"
|
||||||
|
},
|
||||||
|
tagFollow: { width: 150, margin: 10 },
|
||||||
|
|
||||||
});
|
});
|
|
@ -223,6 +223,30 @@ export const transactionHistoryIlinkLabel = () => {
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
export const transactionHistoryNanoCreditLabel = () => {
|
||||||
|
return [
|
||||||
|
/*{
|
||||||
|
icon: 'arrow-expand',
|
||||||
|
label: 'Type'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'inbox-arrow-up',
|
||||||
|
label: 'Source'
|
||||||
|
}, */
|
||||||
|
{
|
||||||
|
icon: 'cash',
|
||||||
|
label: 'Type'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'cash',
|
||||||
|
label: I18n.t('AMOUNT_LABEL')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'calendar-clock',
|
||||||
|
label: 'Date'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export const transactionHistoryUser = () => {
|
export const transactionHistoryUser = () => {
|
||||||
return [
|
return [
|
||||||
|
@ -243,6 +267,10 @@ export const transactionHistoryUser = () => {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const displayTransactionType = (transactionType) => {
|
||||||
|
return isEqual(transactionType, 'E') ? I18n.t('SAVING') : I18n.t('NANO_CREDIT');
|
||||||
|
}
|
||||||
|
|
||||||
export const optionWalletToBank = {
|
export const optionWalletToBank = {
|
||||||
title: I18n.t('DEPOSIT_TO_BANK'),
|
title: I18n.t('DEPOSIT_TO_BANK'),
|
||||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
"CREDIT_ACCOUNT": "Credit account",
|
"CREDIT_ACCOUNT": "Credit account",
|
||||||
"SAVINGS_ACCOUNT": "Saving account",
|
"SAVINGS_ACCOUNT": "Saving account",
|
||||||
"SAVINGS": "Savings",
|
"SAVINGS": "Savings",
|
||||||
|
"SAVING": "Saving",
|
||||||
"CREDITS": "Credits",
|
"CREDITS": "Credits",
|
||||||
"PHONE_SET_AS_DEFAULT": "Default phone for notifications",
|
"PHONE_SET_AS_DEFAULT": "Default phone for notifications",
|
||||||
"NUMERO_DE_SERIE": "Serial number",
|
"NUMERO_DE_SERIE": "Serial number",
|
||||||
|
@ -164,6 +165,15 @@
|
||||||
"SAVE_MONEY_TYPE": "Savings type",
|
"SAVE_MONEY_TYPE": "Savings type",
|
||||||
"CAUTION_CREDIT": "Caution credit demand",
|
"CAUTION_CREDIT": "Caution credit demand",
|
||||||
"ID_DEMAND": "Demand ID",
|
"ID_DEMAND": "Demand ID",
|
||||||
|
|
||||||
|
"DEMAND_DATE": "Demand date",
|
||||||
|
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
|
||||||
|
"DATE_REMBOURSEMENT": "Refund date",
|
||||||
|
"AMOUNT_REFUND": "Amount reimbursed",
|
||||||
|
"AMOUNT_PARTIALLY_REFUND": "Amount partially refunded",
|
||||||
|
"FINAL_DATE": "End date",
|
||||||
|
"CASSATION_DATE": "Cassation date",
|
||||||
|
|
||||||
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
|
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
|
||||||
"PAIEMENT_FACTURE": "Bill payment",
|
"PAIEMENT_FACTURE": "Bill payment",
|
||||||
"NUMERO_ABONNE": "Subscriber number",
|
"NUMERO_ABONNE": "Subscriber number",
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
"CREDIT_ACCOUNT": "Compte crédit",
|
"CREDIT_ACCOUNT": "Compte crédit",
|
||||||
"SAVINGS_ACCOUNT": "Compte épargne",
|
"SAVINGS_ACCOUNT": "Compte épargne",
|
||||||
"SAVINGS": "Epargnes",
|
"SAVINGS": "Epargnes",
|
||||||
|
"SAVING": "Epargne",
|
||||||
"CREDITS": "Crédits",
|
"CREDITS": "Crédits",
|
||||||
"PHONE_SET_AS_DEFAULT": "Téléphone par défaut pour les notifications",
|
"PHONE_SET_AS_DEFAULT": "Téléphone par défaut pour les notifications",
|
||||||
"NUMERO_DE_SERIE": "Numéro de série",
|
"NUMERO_DE_SERIE": "Numéro de série",
|
||||||
|
@ -171,6 +172,15 @@
|
||||||
"REFUND_DONE": "Remboursement effectué",
|
"REFUND_DONE": "Remboursement effectué",
|
||||||
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
||||||
"ID_DEMAND": "Identifiant de la demande",
|
"ID_DEMAND": "Identifiant de la demande",
|
||||||
|
|
||||||
|
"DEMAND_DATE": "Date de la demande",
|
||||||
|
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
||||||
|
"DATE_REMBOURSEMENT": "Date de remboursement",
|
||||||
|
"AMOUNT_REFUND": "Montant remboursé",
|
||||||
|
"AMOUNT_PARTIALLY_REFUND": "Montant partiellement remboursé",
|
||||||
|
"FINAL_DATE": "Date de fin",
|
||||||
|
"CASSATION_DATE": "Date de cassation",
|
||||||
|
|
||||||
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
|
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
|
||||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||||
"NUMERO_ABONNE": "Numéro d'abonnée",
|
"NUMERO_ABONNE": "Numéro d'abonnée",
|
||||||
|
|
Loading…
Reference in New Issue