Correction des bugs
This commit is contained in:
parent
f3148ea78f
commit
0a1c1f896a
File diff suppressed because one or more lines are too long
|
@ -11,7 +11,7 @@
|
||||||
"start-emulator": "emulator -avd Nexus_5X_API_29 -dns-server 8.8.8.8",
|
"start-emulator": "emulator -avd Nexus_5X_API_29 -dns-server 8.8.8.8",
|
||||||
"start-emulator-pixel": "emulator -avd Pixel_2_API_29 -dns-server 8.8.8.8",
|
"start-emulator-pixel": "emulator -avd Pixel_2_API_29 -dns-server 8.8.8.8",
|
||||||
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
|
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
|
||||||
"run-release": "cd android && ./gradlew clean && cd .. && react-native run-android --variant=release"
|
"run-release": "cd android && ./gradlew clean && cd h.. && react-native run-android --variant=release"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/react-native-action-sheet": "^3.8.0",
|
"@expo/react-native-action-sheet": "^3.8.0",
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
import {
|
import {
|
||||||
WALLET_LIST_PENDING,
|
GET_OPERATOR_LIST_ERROR,
|
||||||
WALLET_LIST_SUCCESS,
|
GET_OPERATOR_LIST_PENDING,
|
||||||
WALLET_LIST_ERROR,
|
GET_OPERATOR_LIST_RESET,
|
||||||
WALLET_HISTORY_PENDING,
|
GET_OPERATOR_LIST_SUCCESS,
|
||||||
WALLET_HISTORY_SUCCESS,
|
LINK_CARD_ERROR,
|
||||||
WALLET_HISTORY_ERROR,
|
|
||||||
WALLET_TRANSFER_COMMISSION_PENDING,
|
|
||||||
WALLET_TRANSFER_COMMISSION_SUCCESS,
|
|
||||||
WALLET_TRANSFER_COMMISSION_ERROR,
|
|
||||||
WALLET_TRANSFER_COMMISSION_RESET,
|
|
||||||
WALLET_HISTORY_RESET,
|
|
||||||
WALLET_LIST_DETAIL_RESET,
|
|
||||||
WALLET_LIST_DETAIL_ERROR,
|
|
||||||
WALLET_LIST_DETAIL_PENDING,
|
|
||||||
WALLET_LIST_DETAIL_SUCCESS,
|
|
||||||
WALLET_GET_COMMISSION_PENDING,
|
|
||||||
WALLET_GET_COMMISSION_SUCCESS,
|
|
||||||
WALLET_GET_COMMISSION_ERROR,
|
|
||||||
WALLET_GET_COMMISSION_RESET,
|
|
||||||
WALLET_GET_RETREAIT_COMMISSION_PENDING,
|
|
||||||
WALLET_GET_RETREAIT_COMMISSION_SUCCESS,
|
|
||||||
WALLET_GET_RETREAIT_COMMISSION_ERROR,
|
|
||||||
WALLET_GET_RETREAIT_COMMISSION_RESET,
|
|
||||||
LINK_CARD_PENDING,
|
LINK_CARD_PENDING,
|
||||||
LINK_CARD_RESET,
|
LINK_CARD_RESET,
|
||||||
LINK_CARD_SUCCESS,
|
LINK_CARD_SUCCESS,
|
||||||
LINK_CARD_ERROR,
|
WALLET_GET_COMMISSION_ERROR,
|
||||||
WALLET_HISTORY_HYPER_SUPER_PENDING,
|
WALLET_GET_COMMISSION_PENDING,
|
||||||
WALLET_HISTORY_HYPER_SUPER__SUCCESS,
|
WALLET_GET_COMMISSION_RESET,
|
||||||
|
WALLET_GET_COMMISSION_SUCCESS,
|
||||||
|
WALLET_HISTORY_ERROR,
|
||||||
WALLET_HISTORY_HYPER_SUPER__ERROR,
|
WALLET_HISTORY_HYPER_SUPER__ERROR,
|
||||||
WALLET_HISTORY_HYPER_SUPER__RESET
|
WALLET_HISTORY_HYPER_SUPER__RESET,
|
||||||
|
WALLET_HISTORY_HYPER_SUPER__SUCCESS,
|
||||||
|
WALLET_HISTORY_HYPER_SUPER_PENDING,
|
||||||
|
WALLET_HISTORY_PENDING,
|
||||||
|
WALLET_HISTORY_RESET,
|
||||||
|
WALLET_HISTORY_SUCCESS,
|
||||||
|
WALLET_LIST_DETAIL_ERROR,
|
||||||
|
WALLET_LIST_DETAIL_PENDING,
|
||||||
|
WALLET_LIST_DETAIL_RESET,
|
||||||
|
WALLET_LIST_DETAIL_SUCCESS,
|
||||||
|
WALLET_LIST_ERROR,
|
||||||
|
WALLET_LIST_PENDING,
|
||||||
|
WALLET_LIST_SUCCESS,
|
||||||
|
WALLET_TRANSFER_COMMISSION_ERROR,
|
||||||
|
WALLET_TRANSFER_COMMISSION_PENDING,
|
||||||
|
WALLET_TRANSFER_COMMISSION_RESET,
|
||||||
|
WALLET_TRANSFER_COMMISSION_SUCCESS
|
||||||
} from "../types/WalletType";
|
} from "../types/WalletType";
|
||||||
|
|
||||||
|
|
||||||
|
@ -190,3 +190,24 @@ export const fetchWalleGetRetraitCommissionError = (error) => ({
|
||||||
type: WALLET_GET_RETREAIT_COMMISSION_ERROR,
|
type: WALLET_GET_RETREAIT_COMMISSION_ERROR,
|
||||||
result: error
|
result: error
|
||||||
}); */
|
}); */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ---------------------------------------------------
|
||||||
|
*/
|
||||||
|
export const fetchGetListOperatorPending = () => ({
|
||||||
|
type: GET_OPERATOR_LIST_PENDING
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetListOperatorReset = () => ({
|
||||||
|
type: GET_OPERATOR_LIST_RESET
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetListOperatorSuccess = (res) => ({
|
||||||
|
type: GET_OPERATOR_LIST_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetListOperatorError = (error) => ({
|
||||||
|
type: GET_OPERATOR_LIST_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
|
@ -0,0 +1,42 @@
|
||||||
|
import {
|
||||||
|
GET_OPERATOR_LIST_ERROR,
|
||||||
|
GET_OPERATOR_LIST_PENDING,
|
||||||
|
GET_OPERATOR_LIST_RESET,
|
||||||
|
GET_OPERATOR_LIST_SUCCESS
|
||||||
|
} from "../types/WalletType";
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: null
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (state = initialState, action) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case GET_OPERATOR_LIST_PENDING:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case GET_OPERATOR_LIST_SUCCESS:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case GET_OPERATOR_LIST_ERROR:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
case GET_OPERATOR_LIST_RESET:
|
||||||
|
return initialState;
|
||||||
|
|
||||||
|
default: {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -46,6 +46,7 @@ import GetBankListReducer from "./GetBankListReducer";
|
||||||
import EnvoieUserWalletToBank from "./EnvoieUserWalletToBankReducer";
|
import EnvoieUserWalletToBank from "./EnvoieUserWalletToBankReducer";
|
||||||
import GetEpargneInProgressReducer from "./GetEpargneInProgressReducer";
|
import GetEpargneInProgressReducer from "./GetEpargneInProgressReducer";
|
||||||
import GetNanoCreditUserHistoryInProgressReducer from "./GetNanoCreditUserHistoryInProgressReducer";
|
import GetNanoCreditUserHistoryInProgressReducer from "./GetNanoCreditUserHistoryInProgressReducer";
|
||||||
|
import GetListOperatorReducer from "./GetListOperatorReducer";
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'root',
|
key: 'root',
|
||||||
|
@ -100,7 +101,8 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
getBankListReducer: GetBankListReducer,
|
getBankListReducer: GetBankListReducer,
|
||||||
envoieUserWalletToBank: EnvoieUserWalletToBank,
|
envoieUserWalletToBank: EnvoieUserWalletToBank,
|
||||||
getEpargneInProgressReducer: GetEpargneInProgressReducer,
|
getEpargneInProgressReducer: GetEpargneInProgressReducer,
|
||||||
getNanoCreditUserHistoryInProgressReducer: GetNanoCreditUserHistoryInProgressReducer
|
getNanoCreditUserHistoryInProgressReducer: GetNanoCreditUserHistoryInProgressReducer,
|
||||||
|
getListOperatorReducer: GetListOperatorReducer
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
|
@ -37,3 +37,8 @@ export const LINK_CARD_PENDING = 'LINK_CARD_PENDING';
|
||||||
export const LINK_CARD_SUCCESS = 'LINK_CARD_SUCCESS';
|
export const LINK_CARD_SUCCESS = 'LINK_CARD_SUCCESS';
|
||||||
export const LINK_CARD_ERROR = 'LINK_CARD_ERROR';
|
export const LINK_CARD_ERROR = 'LINK_CARD_ERROR';
|
||||||
export const LINK_CARD_RESET = 'LINK_CARD_RESET';
|
export const LINK_CARD_RESET = 'LINK_CARD_RESET';
|
||||||
|
|
||||||
|
export const GET_OPERATOR_LIST_PENDING = 'GET_OPERATOR_LIST_PENDING';
|
||||||
|
export const GET_OPERATOR_LIST_SUCCESS = 'GET_OPERATOR_LIST_SUCCESS';
|
||||||
|
export const GET_OPERATOR_LIST_ERROR = 'GET_OPERATOR_LIST_ERROR';
|
||||||
|
export const GET_OPERATOR_LIST_RESET = 'GET_OPERATOR_LIST_RESET';
|
|
@ -268,7 +268,7 @@ export default class SuperViseurGroupeHome extends BaseScreen {
|
||||||
|
|
||||||
|
|
||||||
renderMembers(item) {
|
renderMembers(item) {
|
||||||
var re = moment.tz(item.created_at, 'Etc/GMT+0').format();
|
var re = moment.tz(item.created_at, moment.tz.guess()).format();
|
||||||
re = moment(re).fromNow();
|
re = moment(re).fromNow();
|
||||||
if (true) {
|
if (true) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
import React, { Component, PureComponent } from 'react';
|
import React, {PureComponent} from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import {FlatList, RefreshControl, SectionList, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
|
||||||
import { StyleSheet, Text, View, FlatList, TouchableOpacity, SectionList, RefreshControl } from 'react-native';
|
import {responsiveFontSize, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
import { responsiveFontSize, responsiveWidth, responsiveHeight } from 'react-native-responsive-dimensions';
|
|
||||||
import { convertDateToHumanText } from './../../utils/DateUtils';
|
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
var moment = require('moment-timezone')
|
|
||||||
const momentJS = require('moment')
|
|
||||||
import I18n from "react-native-i18n"
|
import I18n from "react-native-i18n"
|
||||||
|
|
||||||
import 'moment/locale/fr'
|
import 'moment/locale/fr'
|
||||||
|
@ -18,7 +14,10 @@ import 'moment/locale/en-nz'
|
||||||
import 'moment/locale/en-gb'
|
import 'moment/locale/en-gb'
|
||||||
|
|
||||||
import DeviceInfo from 'react-native-device-info'
|
import DeviceInfo from 'react-native-device-info'
|
||||||
import { Color } from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
|
|
||||||
|
var moment = require('moment-timezone')
|
||||||
|
const momentJS = require('moment')
|
||||||
|
|
||||||
let route = require('./../../route.json');
|
let route = require('./../../route.json');
|
||||||
var theme = require('./../../utils/theme.json');
|
var theme = require('./../../utils/theme.json');
|
||||||
|
@ -32,32 +31,40 @@ export class HistoryItem extends React.Component {
|
||||||
|
|
||||||
statusLabel = (status) => {
|
statusLabel = (status) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case '0': return I18n.t('NO_TREAT');
|
case '0':
|
||||||
case '1': return I18n.t('TREAT');
|
return I18n.t('NO_TREAT');
|
||||||
case '2': return I18n.t('REFUSED');
|
case '1':
|
||||||
|
return I18n.t('TREAT');
|
||||||
|
case '2':
|
||||||
|
return I18n.t('REFUSED');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
colorLabel = (status) => {
|
colorLabel = (status) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case '0': return Color.accentColor;
|
case '0':
|
||||||
case '1': return Color.greenColor;
|
return Color.accentColor;
|
||||||
case '2': return Color.redColor;
|
case '1':
|
||||||
|
return Color.greenColor;
|
||||||
|
case '2':
|
||||||
|
return Color.redColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptionLabelUserType = (user) => {
|
descriptionLabelUserType = (user) => {
|
||||||
console.log("USER")
|
|
||||||
let textDescription = (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' ' + this.props.selfData.reseau;
|
let textDescription = (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' ' + this.props.selfData.reseau;
|
||||||
|
|
||||||
switch (user.category) {
|
switch (user.category) {
|
||||||
case 'geolocated': return `${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`;
|
case 'geolocated':
|
||||||
case 'super': return this.props.isDemandSend ?
|
return `${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`;
|
||||||
|
case 'super':
|
||||||
|
return this.props.isDemandSend ?
|
||||||
`${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`
|
`${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`
|
||||||
:
|
:
|
||||||
`${I18n.t('THE_AGENT')} ${this.props.selfData.lastname} (${this.props.selfData.phone}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
|
`${I18n.t('THE_AGENT')} ${this.props.selfData.lastname} (${this.props.selfData.phone}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
|
||||||
|
|
||||||
case 'hyper': return `${I18n.t('THE_SUPERVISOR')} ${this.props.selfData.lastname} (${this.props.selfData.phone}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
|
case 'hyper':
|
||||||
|
return `${I18n.t('THE_SUPERVISOR')} ${this.props.selfData.lastname} (${this.props.selfData.phone}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +77,7 @@ export class HistoryItem extends React.Component {
|
||||||
let t = this.props.selfData.status;
|
let t = this.props.selfData.status;
|
||||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
||||||
moment.locale(this.currentLocale);
|
moment.locale(this.currentLocale);
|
||||||
var re = moment.tz(this.props.selfData.date_creation, 'Etc/GMT+0').format();
|
var re = moment.tz(this.props.selfData.date_creation, moment.tz.guess()).format();
|
||||||
re = moment(re)
|
re = moment(re)
|
||||||
return {
|
return {
|
||||||
title: textTitle,
|
title: textTitle,
|
||||||
|
@ -91,7 +98,6 @@ export class HistoryItem extends React.Component {
|
||||||
item: this.props.selfData,
|
item: this.props.selfData,
|
||||||
onGoBack: () => this.props.refresh(),
|
onGoBack: () => this.props.refresh(),
|
||||||
}
|
}
|
||||||
|
|
||||||
)}>
|
)}>
|
||||||
<View style={style.content}>
|
<View style={style.content}>
|
||||||
<Text style={style.title}>{this.state.title}</Text>
|
<Text style={style.title}>{this.state.title}</Text>
|
||||||
|
@ -103,10 +109,10 @@ export class HistoryItem extends React.Component {
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
color: this.state.colorstate,
|
color: this.state.colorstate,
|
||||||
|
|
||||||
}}>{this.props.selfData.nombre_validation}</Text>
|
}}>{this.statusLabel(this.props.selfData.status)}</Text>
|
||||||
<Text style={style.time}>{this.state.time}</Text>
|
<Text style={style.time}>{this.state.time}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={style.bottomSeparator} />
|
<View style={style.bottomSeparator}/>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
@ -115,27 +121,42 @@ export class HistoryItem extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class HistoryItemSectionned extends PureComponent {
|
export class HistoryItemSectionned extends PureComponent {
|
||||||
_keyExtractor = (item, index) => item.id;
|
_keyExtractor = (item, index) => item.id;
|
||||||
_renderItem = ({ item }) => (
|
_renderItem = ({item}) => (
|
||||||
<HistoryItem
|
<HistoryItem
|
||||||
navigator={this.props.navigator}
|
navigator={this.props.navigator}
|
||||||
selfData={item}
|
selfData={item}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = this.initState();
|
this.state = this.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<SectionList
|
<SectionList
|
||||||
sections={[
|
sections={[
|
||||||
{ title: 'Demande traité', type: 0, data: this.state.treat, size: this.state.conservetreat.length, expandState: this.state.istreatexpand },
|
{
|
||||||
{ title: 'Demande non traité', type: 1, data: this.state.untreat, size: this.state.conserveuntreat.length, expandState: this.state.isuntreatexpand }
|
title: 'Demande traité',
|
||||||
|
type: 0,
|
||||||
|
data: this.state.treat,
|
||||||
|
size: this.state.conservetreat.length,
|
||||||
|
expandState: this.state.istreatexpand
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Demande non traité',
|
||||||
|
type: 1,
|
||||||
|
data: this.state.untreat,
|
||||||
|
size: this.state.conserveuntreat.length,
|
||||||
|
expandState: this.state.isuntreatexpand
|
||||||
|
}
|
||||||
]}
|
]}
|
||||||
renderSectionHeader={({ section: { title, type, data, size, expandState } }) => (
|
renderSectionHeader={({section: {title, type, data, size, expandState}}) => (
|
||||||
<TouchableOpacity onPress={() => this.onPressedHeader(type)} style={{
|
<TouchableOpacity onPress={() => this.onPressedHeader(type)} style={{
|
||||||
backgroundColor: theme.accent,
|
backgroundColor: theme.accent,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
@ -161,7 +182,8 @@ export class HistoryItemSectionned extends PureComponent {
|
||||||
color: 'white'
|
color: 'white'
|
||||||
}}>{size} demande(s)</Text>
|
}}>{size} demande(s)</Text>
|
||||||
</View>
|
</View>
|
||||||
<Icon name={expandState ? 'sort-up' : 'sort-down'} size={30} color={'white'} style={{ marginRight: 20 }} />
|
<Icon name={expandState ? 'sort-up' : 'sort-down'} size={30} color={'white'}
|
||||||
|
style={{marginRight: 20}}/>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
style={style.listStyle}
|
style={style.listStyle}
|
||||||
|
@ -171,14 +193,22 @@ export class HistoryItemSectionned extends PureComponent {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressedHeader(type) {
|
onPressedHeader(type) {
|
||||||
if (type === 0) {
|
if (type === 0) {
|
||||||
this.setState({ istreatexpand: !this.state.istreatexpand, treat: this.state.istreatexpand ? [] : this.state.conservetreat })
|
this.setState({
|
||||||
|
istreatexpand: !this.state.istreatexpand,
|
||||||
|
treat: this.state.istreatexpand ? [] : this.state.conservetreat
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.setState({ isuntreatexpand: !this.state.isuntreatexpand, untreat: this.state.isuntreatexpand ? [] : this.state.conserveuntreat })
|
this.setState({
|
||||||
|
isuntreatexpand: !this.state.isuntreatexpand,
|
||||||
|
untreat: this.state.isuntreatexpand ? [] : this.state.conserveuntreat
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initState() {
|
initState() {
|
||||||
let data = this.props.list
|
let data = this.props.list
|
||||||
|
|
||||||
|
@ -192,13 +222,14 @@ export class HistoryItemSectionned extends PureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class HistoryListItem extends React.Component {
|
export class HistoryListItem extends React.Component {
|
||||||
_keyExtractor = (item, index) => item.id;
|
_keyExtractor = (item, index) => item.id;
|
||||||
|
|
||||||
_onPressItem = (id: string) => {
|
_onPressItem = (id: string) => {
|
||||||
|
|
||||||
};
|
};
|
||||||
_renderItem = ({ item }) => {
|
_renderItem = ({item}) => {
|
||||||
console.log('ITEM ', item);
|
console.log('ITEM ', item);
|
||||||
return (
|
return (
|
||||||
<HistoryItem
|
<HistoryItem
|
||||||
|
@ -209,16 +240,20 @@ export class HistoryListItem extends React.Component {
|
||||||
selfData={item}
|
selfData={item}
|
||||||
refresh={this.props.refresh}
|
refresh={this.props.refresh}
|
||||||
/>
|
/>
|
||||||
)};
|
)
|
||||||
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = this.initState();
|
this.state = this.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
initState() {
|
initState() {
|
||||||
return {
|
return {
|
||||||
refreshing: false,
|
refreshing: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<FlatList
|
<FlatList
|
||||||
|
@ -239,8 +274,10 @@ export class HistoryListItem extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRefresh() {
|
_onRefresh() {
|
||||||
this.setState({ refreshing: true })
|
this.setState({refreshing: true})
|
||||||
setTimeout(() => { this.setState({ refreshing: false }) }, 5000);
|
setTimeout(() => {
|
||||||
|
this.setState({refreshing: false})
|
||||||
|
}, 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,7 +324,6 @@ const style = StyleSheet.create({
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
color: theme.accent,
|
color: theme.accent,
|
||||||
},
|
},
|
||||||
treat: {
|
treat: {},
|
||||||
},
|
|
||||||
|
|
||||||
});
|
});
|
|
@ -1,30 +1,31 @@
|
||||||
import React, { Component } from 'react'
|
import React, {Component} from 'react'
|
||||||
import { StyleSheet, View, Text, Alert, Platform } from 'react-native'
|
import {Alert, Platform, StyleSheet, Text, View} from 'react-native'
|
||||||
import CardView from 'react-native-cardview'
|
import CardView from 'react-native-cardview'
|
||||||
import Button from 'apsl-react-native-button'
|
import Button from 'apsl-react-native-button'
|
||||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions'
|
import {responsiveWidth} from 'react-native-responsive-dimensions'
|
||||||
import Icons from 'react-native-vector-icons/Ionicons'
|
import Icons from 'react-native-vector-icons/Ionicons'
|
||||||
import { updateCreditDemand } from "../../webservice/HistoryRequestApi";
|
import {readUser} from "../../webservice/AuthApi";
|
||||||
import { readUser } from "../../webservice/AuthApi";
|
|
||||||
let typesta = 0;
|
|
||||||
import isNil from 'lodash/isNil';
|
import isNil from 'lodash/isNil';
|
||||||
|
import I18n from "react-native-i18n";
|
||||||
|
import {creditDemandResetReducer, treatCreditDemand} from '../../webservice/CreditTreatDemandApi';
|
||||||
|
import {creditCancelResetReducer, treatCancelDemand} from '../../webservice/CreditCancelDemandeApi';
|
||||||
|
import {getAgentNetworksList} from "../../webservice/NetworkApi";
|
||||||
|
import {connect} from 'react-redux';
|
||||||
|
import {bindActionCreators} from 'redux';
|
||||||
|
import Toast from 'react-native-root-toast';
|
||||||
|
import {Color} from '../../config/Color'
|
||||||
|
import Dialog from "react-native-dialog";
|
||||||
|
import {FontWeight} from '../../config/typography'
|
||||||
|
import DeviceInfo from 'react-native-device-info'
|
||||||
|
|
||||||
|
let typesta = 0;
|
||||||
|
|
||||||
let moment = require('moment-timezone')
|
let moment = require('moment-timezone')
|
||||||
var colorback = 'white'
|
var colorback = 'white'
|
||||||
import I18n from "react-native-i18n";
|
|
||||||
import { treatCreditDemand, creditDemandResetReducer } from '../../webservice/CreditTreatDemandApi';
|
|
||||||
import { treatCancelDemand, creditCancelResetReducer } from '../../webservice/CreditCancelDemandeApi';
|
|
||||||
import { getAgentNetworksList } from "../../webservice/NetworkApi";
|
|
||||||
import Icon from "./History";
|
|
||||||
import { Header } from "react-native-elements";
|
|
||||||
let theme = require('./../../utils/theme.json');
|
let theme = require('./../../utils/theme.json');
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { bindActionCreators } from 'redux';
|
|
||||||
import Toast from 'react-native-root-toast';
|
|
||||||
import { Color } from '../../config/Color'
|
|
||||||
const route = require("./../../route.json");
|
const route = require("./../../route.json");
|
||||||
import Dialog from "react-native-dialog";
|
|
||||||
import { FontWeight } from '../../config/typography'
|
|
||||||
import DeviceInfo from 'react-native-device-info'
|
|
||||||
|
|
||||||
class HistoryItemDetails extends Component {
|
class HistoryItemDetails extends Component {
|
||||||
|
|
||||||
|
@ -34,19 +35,19 @@ class HistoryItemDetails extends Component {
|
||||||
navBarTextColor: '#FFFFFF',
|
navBarTextColor: '#FFFFFF',
|
||||||
navBarButtonColor: '#FFFFFF',
|
navBarButtonColor: '#FFFFFF',
|
||||||
};
|
};
|
||||||
static navigationOptions = ({ navigation }) => {
|
static navigationOptions = ({navigation}) => {
|
||||||
return {
|
return {
|
||||||
drawerLabel: () => null,
|
drawerLabel: () => null,
|
||||||
title: isNil(navigation.getParam("item", null).item) ?
|
title: isNil(navigation.getParam("item", null).item) ?
|
||||||
"Transaction N°" + navigation.getParam("item", { id: "-" }).id :
|
"Transaction N°" + navigation.getParam("item", {id: "-"}).id :
|
||||||
"Transaction N°" + navigation.getParam("item", { id: "-" }).item.id
|
"Transaction N°" + navigation.getParam("item", {id: "-"}).item.id
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.item = this.props.navigation.getParam("item", null);
|
this.item = this.props.navigation.getParam("item", null);
|
||||||
if(isNil(this.props.navigation.getParam("item", null).item)) {
|
if (isNil(this.props.navigation.getParam("item", null).item)) {
|
||||||
this.item = this.props.navigation.getParam("item", null);
|
this.item = this.props.navigation.getParam("item", null);
|
||||||
} else {
|
} else {
|
||||||
this.item = this.props.navigation.getParam("item", null).item;
|
this.item = this.props.navigation.getParam("item", null).item;
|
||||||
|
@ -61,8 +62,7 @@ class HistoryItemDetails extends Component {
|
||||||
colorback = 'green'
|
colorback = 'green'
|
||||||
typesta = 2
|
typesta = 2
|
||||||
sta = I18n.t('ACCEPTER_DEMANDE')
|
sta = I18n.t('ACCEPTER_DEMANDE')
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
colorback = '#AEAEAE'
|
colorback = '#AEAEAE'
|
||||||
typesta = 2
|
typesta = 2
|
||||||
sta = I18n.t('REFUSED')
|
sta = I18n.t('REFUSED')
|
||||||
|
@ -84,8 +84,7 @@ class HistoryItemDetails extends Component {
|
||||||
readUser().then(async (user) => {
|
readUser().then(async (user) => {
|
||||||
let networks = []
|
let networks = []
|
||||||
networks = await getAgentNetworksList(user.agentId);
|
networks = await getAgentNetworksList(user.agentId);
|
||||||
this.setState({ user: user, networks: networks.networks })
|
this.setState({user: user, networks: networks.networks})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
||||||
|
@ -99,7 +98,7 @@ class HistoryItemDetails extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
isMontantValid = () => {
|
isMontantValid = () => {
|
||||||
const { montant } = this.state;
|
const {montant} = this.state;
|
||||||
if ((parseInt(montant) == 0 || montant < 0))
|
if ((parseInt(montant) == 0 || montant < 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -175,13 +174,12 @@ class HistoryItemDetails extends Component {
|
||||||
keyboardType="numeric"
|
keyboardType="numeric"
|
||||||
onChangeText={(montant) => {
|
onChangeText={(montant) => {
|
||||||
|
|
||||||
this.setState({ montant }, () => {
|
this.setState({montant}, () => {
|
||||||
if (this.isMontantValid(montant)) {
|
if (this.isMontantValid(montant)) {
|
||||||
this.setState({
|
this.setState({
|
||||||
isBtnModifyAmountEnabled: true
|
isBtnModifyAmountEnabled: true
|
||||||
})
|
})
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
this.setState({
|
this.setState({
|
||||||
isBtnModifyAmountEnabled: false
|
isBtnModifyAmountEnabled: false
|
||||||
});
|
});
|
||||||
|
@ -190,19 +188,21 @@ class HistoryItemDetails extends Component {
|
||||||
console.log("isBtnModifyAmountEnabled", this.state.isBtnModifyAmountEnabled);
|
console.log("isBtnModifyAmountEnabled", this.state.isBtnModifyAmountEnabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
}} />
|
}}/>
|
||||||
|
|
||||||
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => this.setState({ displayAmountModifyDialog: false })} />
|
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')}
|
||||||
<Dialog.Button bold={true} label={I18n.t('SEND')} disable={this.state.isBtnModifyAmountEnabled} onPress={() => {
|
onPress={() => this.setState({displayAmountModifyDialog: false})}/>
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('SEND')} disable={this.state.isBtnModifyAmountEnabled}
|
||||||
|
onPress={() => {
|
||||||
this.props.creditDemandResetReducer();
|
this.props.creditDemandResetReducer();
|
||||||
this.props.treatCreditDemand(this.item.id, this.state.montant);
|
this.props.treatCreditDemand(this.item.id, this.state.montant);
|
||||||
}} />
|
}}/>
|
||||||
</Dialog.Container>
|
</Dialog.Container>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
renderAlertErrorTreatOrCancelDemand = () => {
|
renderAlertErrorTreatOrCancelDemand = () => {
|
||||||
const { errorTreatDemand, resultTreatDemand, resultCancelDemand, errorCancelDemand } = this.props;
|
const {errorTreatDemand, resultTreatDemand, resultCancelDemand, errorCancelDemand} = this.props;
|
||||||
|
|
||||||
if (errorTreatDemand !== null) {
|
if (errorTreatDemand !== null) {
|
||||||
if (typeof errorTreatDemand.data !== 'undefined') {
|
if (typeof errorTreatDemand.data !== 'undefined') {
|
||||||
|
@ -212,7 +212,8 @@ class HistoryItemDetails extends Component {
|
||||||
errorTreatDemand.data.error,
|
errorTreatDemand.data.error,
|
||||||
[{
|
[{
|
||||||
text: I18n.t('CANCEL_LABEL'),
|
text: I18n.t('CANCEL_LABEL'),
|
||||||
onPress: () => { },
|
onPress: () => {
|
||||||
|
},
|
||||||
style: 'cancel'
|
style: 'cancel'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -226,10 +227,9 @@ class HistoryItemDetails extends Component {
|
||||||
this.props.creditCancelResetReducer();
|
this.props.creditCancelResetReducer();
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
I18n.t("ERROR_TREATMENT_DEMAND"),
|
I18n.t("ERROR_TREATMENT_DEMAND"),
|
||||||
errorTreatDemand.data.error,
|
errorTreatDemand.data.error,
|
||||||
|
@ -241,7 +241,7 @@ class HistoryItemDetails extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ class HistoryItemDetails extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ class HistoryItemDetails extends Component {
|
||||||
if (resultTreatDemand.status === 200) {
|
if (resultTreatDemand.status === 200) {
|
||||||
this.displayToast(resultTreatDemand.response);
|
this.displayToast(resultTreatDemand.response);
|
||||||
this.props.navigation.goBack();
|
this.props.navigation.goBack();
|
||||||
if(!isNil(this.props.navigation.state.params.onGoBack))
|
if (!isNil(this.props.navigation.state.params.onGoBack))
|
||||||
this.props.navigation.state.params.onGoBack();
|
this.props.navigation.state.params.onGoBack();
|
||||||
this.props.creditCancelResetReducer();
|
this.props.creditCancelResetReducer();
|
||||||
this.props.creditDemandResetReducer();
|
this.props.creditDemandResetReducer();
|
||||||
|
@ -283,7 +283,7 @@ class HistoryItemDetails extends Component {
|
||||||
|
|
||||||
this.displayToast(resultCancelDemand.response);
|
this.displayToast(resultCancelDemand.response);
|
||||||
this.props.navigation.goBack();
|
this.props.navigation.goBack();
|
||||||
if(!isNil(this.props.navigation.state.params.onGoBack))
|
if (!isNil(this.props.navigation.state.params.onGoBack))
|
||||||
this.props.navigation.state.params.onGoBack();
|
this.props.navigation.state.params.onGoBack();
|
||||||
this.props.creditCancelResetReducer();
|
this.props.creditCancelResetReducer();
|
||||||
this.props.creditDemandResetReducer();
|
this.props.creditDemandResetReducer();
|
||||||
|
@ -294,8 +294,9 @@ class HistoryItemDetails extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
renderBtn() {
|
renderBtn() {
|
||||||
const { user } = this.state
|
const {user} = this.state;
|
||||||
console.warn("ITEM ITEM", this.item);
|
console.warn("ITEM ITEM", this.item);
|
||||||
|
console.warn("Code Membre", user.code_membre);
|
||||||
if (user) {
|
if (user) {
|
||||||
if (this.item.code_parrain === user.code_membre) {
|
if (this.item.code_parrain === user.code_membre) {
|
||||||
if (this.item.status === '1') {
|
if (this.item.status === '1') {
|
||||||
|
@ -316,8 +317,7 @@ class HistoryItemDetails extends Component {
|
||||||
{this.state.statut}
|
{this.state.statut}
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
} else if (this.item.status === '2') {
|
||||||
else if (this.item.status === '2') {
|
|
||||||
return (<Button
|
return (<Button
|
||||||
style={{
|
style={{
|
||||||
borderColor: 'transparent',
|
borderColor: 'transparent',
|
||||||
|
@ -334,9 +334,7 @@ class HistoryItemDetails extends Component {
|
||||||
{this.state.statut}
|
{this.state.statut}
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
return (<View style={{
|
return (<View style={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
paddingTop: 10
|
paddingTop: 10
|
||||||
|
@ -399,8 +397,8 @@ class HistoryItemDetails extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
console.log("CREDIT MANAGE PROPS", this.props);
|
console.log("CREDIT MANAGE PROPS", this.props);
|
||||||
let ago = moment.tz(this.item.date_creation, 'Etc/GMT+0').format();
|
let ago = moment.tz(this.item.date_creation, moment.tz.guess()).format();
|
||||||
ago = moment(ago)
|
ago = moment(ago);
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
{this.renderPromptModifyAmountToSend()}
|
{this.renderPromptModifyAmountToSend()}
|
||||||
|
@ -550,9 +548,7 @@ const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
btnstyle: {
|
btnstyle: {},
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
inputAmountText: {
|
inputAmountText: {
|
||||||
...Platform.select({
|
...Platform.select({
|
||||||
|
|
|
@ -176,8 +176,8 @@ class Home extends BaseScreen {
|
||||||
AsyncStorage.getAllKeys((err, keys) => {
|
AsyncStorage.getAllKeys((err, keys) => {
|
||||||
AsyncStorage.multiGet(keys, (err, stores) => {
|
AsyncStorage.multiGet(keys, (err, stores) => {
|
||||||
stores.map(async (result, i, store) => {
|
stores.map(async (result, i, store) => {
|
||||||
/* console.warn("KEY MAP", store);
|
console.warn("KEY MAP", store);
|
||||||
console.log("KEY SAVE " + store[i][0]); */
|
console.log("KEY SAVE " + store[i][0]);
|
||||||
let key = store[i][0];
|
let key = store[i][0];
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
if (!_.isEqual(key, '@config:onesignalIds')) {
|
if (!_.isEqual(key, '@config:onesignalIds')) {
|
||||||
|
@ -778,9 +778,8 @@ class Home extends BaseScreen {
|
||||||
this.makeMarkerInformation = this.makeMarkerInformation.bind(this);
|
this.makeMarkerInformation = this.makeMarkerInformation.bind(this);
|
||||||
|
|
||||||
//IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
//IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||||
|
|
||||||
OneSignal.addEventListener('ids', this.onIds);
|
OneSignal.addEventListener('ids', this.onIds);
|
||||||
|
global.appHasLoaded = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* updateLangue() {
|
/* updateLangue() {
|
||||||
|
@ -1656,7 +1655,7 @@ class Home extends BaseScreen {
|
||||||
translucent={true}
|
translucent={true}
|
||||||
/>
|
/>
|
||||||
{/* Start here to comment */}
|
{/* Start here to comment */}
|
||||||
{/*{
|
{
|
||||||
(this.state.loadingDialog || this.props.loading) ?
|
(this.state.loadingDialog || this.props.loading) ?
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
|
@ -1708,7 +1707,7 @@ class Home extends BaseScreen {
|
||||||
}
|
}
|
||||||
}])
|
}])
|
||||||
}}
|
}}
|
||||||
/>*/}
|
/>
|
||||||
{this.makeCardSearch()}
|
{this.makeCardSearch()}
|
||||||
{this.makeSlidingUp()}
|
{this.makeSlidingUp()}
|
||||||
{this.makeDialogLoader()}
|
{this.makeDialogLoader()}
|
||||||
|
|
|
@ -1,24 +1,35 @@
|
||||||
import Button from 'apsl-react-native-button';
|
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import isNil from 'lodash/isNil';
|
import isNil from 'lodash/isNil';
|
||||||
import React, { Component } from 'react';
|
import React, {Component} from 'react';
|
||||||
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
|
import {
|
||||||
import * as Animatable from 'react-native-animatable';
|
ActivityIndicator,
|
||||||
|
Alert,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||||
import { Fumi } from 'react-native-textinput-effects';
|
import {connect} from 'react-redux';
|
||||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
import {bindActionCreators} from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import omit from 'lodash/omit';
|
||||||
import { bindActionCreators } from 'redux';
|
import {Color} from '../../config/Color';
|
||||||
import { Color } from '../../config/Color';
|
import {Typography} from '../../config/typography';
|
||||||
import { FontWeight, Typography } from '../../config/typography';
|
import {IlinkEmitter} from '../../utils/events';
|
||||||
import { store } from "../../redux/store";
|
import {readUser} from '../../webservice/AuthApi';
|
||||||
import { IlinkEmitter } from '../../utils/events';
|
import {getEpargneInProgressAction, getEpargneInProgressReset} from '../../webservice/NanoCreditApi';
|
||||||
import { readUser } from '../../webservice/AuthApi';
|
import {casserEpargneUserAction, casserEpargneUserReset} from '../../webservice/user/NanoCreditApi';
|
||||||
import { createGroupAction, createGroupReset } from '../../webservice/NanoCreditApi';
|
import {cutStringWithoutDot, displayTransactionType, nanoCreditHistoryLabel} from "../../utils/UtilsFunction";
|
||||||
import { isNormalInteger } from '../../utils/UtilsFunction';
|
import * as Utils from "../../utils/DeviceUtils";
|
||||||
import { casserEpargneUserAction, casserEpargneUserReset } from '../../webservice/user/NanoCreditApi';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import thousands from "thousands";
|
||||||
|
import Dialog from "react-native-dialog";
|
||||||
|
|
||||||
|
|
||||||
let theme = require('../../utils/theme.json');
|
let theme = require('../../utils/theme.json');
|
||||||
let route = require('../../route.json');
|
let route = require('../../route.json');
|
||||||
|
|
||||||
|
@ -39,7 +50,13 @@ class CasserEpargneUser extends Component {
|
||||||
isDataSubmit: false,
|
isDataSubmit: false,
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
isGroupToModify: false,
|
isGroupToModify: false,
|
||||||
|
displayModalHistory: false,
|
||||||
|
historyItemDetail: null,
|
||||||
|
isDataHasLoaded: false,
|
||||||
|
displayPasswordModal: false,
|
||||||
|
wallet: this.props.navigation.state.params.wallet,
|
||||||
};
|
};
|
||||||
|
this.props.getEpargneInProgressReset();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +90,9 @@ class CasserEpargneUser extends Component {
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
this.setState({ user });
|
this.setState({user});
|
||||||
|
this.props.getEpargneInProgressAction(user.id);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -86,7 +105,7 @@ class CasserEpargneUser extends Component {
|
||||||
|
|
||||||
renderBreakEpargneRespons = () => {
|
renderBreakEpargneRespons = () => {
|
||||||
|
|
||||||
const { result, error } = this.props;
|
const {result, error} = this.props;
|
||||||
|
|
||||||
if (error !== null) {
|
if (error !== null) {
|
||||||
if (typeof error.data !== 'undefined') {
|
if (typeof error.data !== 'undefined') {
|
||||||
|
@ -100,7 +119,7 @@ class CasserEpargneUser extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,14 +139,14 @@ class CasserEpargneUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
this.props.navigation.setParams({ name: I18n.t('REFUND_NANO_CREDIT') })
|
this.props.navigation.setParams({name: I18n.t('REFUND_NANO_CREDIT')})
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +155,7 @@ class CasserEpargneUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmitCasserEpargne = () => {
|
onSubmitCasserEpargne = () => {
|
||||||
const { idEpargne, password } = this.state;
|
const {idEpargne, password} = this.state;
|
||||||
|
|
||||||
if (this.ckeckIfFieldIsOK(idEpargne))
|
if (this.ckeckIfFieldIsOK(idEpargne))
|
||||||
this.idEpargneAnim.shake(800);
|
this.idEpargneAnim.shake(800);
|
||||||
|
@ -155,25 +174,335 @@ class CasserEpargneUser extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
renderLoader = () => {
|
renderLoader = () => {
|
||||||
return (
|
return (
|
||||||
<ProgressDialog
|
<ProgressDialog
|
||||||
visible={this.props.loading || this.props.loadingGetCommission}
|
visible={this.props.loading || this.props.loadingGetCommission || this.props.loadingNanoCreditHistory}
|
||||||
title={I18n.t('LOADING')}
|
title={I18n.t('LOADING')}
|
||||||
message={I18n.t('LOADING_INFO')}
|
message={I18n.t('LOADING_INFO')}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderModalHistoryDetail = () => {
|
||||||
|
return (
|
||||||
|
|
||||||
|
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
||||||
|
|
||||||
|
<Dialog.Title>{I18n.t('DEMAND_DETAIL')}</Dialog.Title>
|
||||||
|
{
|
||||||
|
<ScrollView>
|
||||||
|
<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]}>{I18n.t(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_epargne}</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('AMOUNT_WITHDRAWAL')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_retire + ' ' + 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('CANCEL_LABEL')} onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
displayModalHistory: !this.state.displayModalHistory,
|
||||||
|
});
|
||||||
|
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
displayPasswordModal: !this.state.displayPasswordModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
</Dialog.Container>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderPasswordDialog = () => {
|
||||||
|
return (
|
||||||
|
<Dialog.Container useNativeDriver={true} visible={this.state.displayPasswordModal}>
|
||||||
|
|
||||||
|
<Dialog.Title>{I18n.t('PASSWORD')}</Dialog.Title>
|
||||||
|
|
||||||
|
<Dialog.Input placeholder={I18n.t('PLEASE_ENTER_THE_PASSWORD')}
|
||||||
|
style={{borderBottomWidth: 1, borderBottomColor: Color.borderColor}}
|
||||||
|
showSoftInputOnFocus={true}
|
||||||
|
onChangeText={(password) => {
|
||||||
|
this.setState({password})
|
||||||
|
}}
|
||||||
|
secureTextEntry={true}
|
||||||
|
value={this.state.password}
|
||||||
|
onSubmitEditing={() => {
|
||||||
|
this.setState({
|
||||||
|
displayPasswordModal: false,
|
||||||
|
displayModalHistory: false,
|
||||||
|
isDataSubmit: true
|
||||||
|
});
|
||||||
|
this.props.refundCreditDemandUserAction({
|
||||||
|
id_user: this.state.user.id,
|
||||||
|
id_epargne: this.state.historyItemDetail.id_epargne,
|
||||||
|
password: this.state.password
|
||||||
|
});
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
<Dialog.Button label={I18n.t('CANCEL_LABEL')} onPress={() => {
|
||||||
|
this.setState({displayPasswordModal: !this.state.displayPasswordModal});
|
||||||
|
}}/>
|
||||||
|
<Dialog.Button label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
displayPasswordModal: false,
|
||||||
|
displayModalHistory: false,
|
||||||
|
isDataSubmit: true
|
||||||
|
})
|
||||||
|
this.props.casserEpargneUserAction({
|
||||||
|
id_user: this.state.user.id,
|
||||||
|
id_epargne: this.state.historyItemDetail.id_epargne,
|
||||||
|
password: this.state.password
|
||||||
|
});
|
||||||
|
}}/>
|
||||||
|
</Dialog.Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderNanoCreditItem = (item, index) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TouchableOpacity onPress={() => {
|
||||||
|
this.setState({displayModalHistory: true, historyItemDetail: item})
|
||||||
|
}} style={[styles.contentService, {borderBottomColor: Color.primaryColor}]}>
|
||||||
|
{
|
||||||
|
Object.keys(omit(item, ['id', 'id_epargne', 'date_demande', 'date_fin', 'date_remboursement_prevu', 'date_validation', 'date_cassation', 'date_remboursement', 'id_demande', 'duree_mois', 'taxe', '', 'date_fin', 'date_cassation', 'id_user', 'id_network', 'user', 'partiellement_rembourse', 'user_phone', '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], ' ')}`
|
||||||
|
: isEqual(element, 'date_creation') ?
|
||||||
|
cutStringWithoutDot(item[element], 16)
|
||||||
|
: item[element]
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderNanoCreditList = () => {
|
||||||
|
const {errorNanoCreditHistory, resultNanoCreditHistory} = this.props;
|
||||||
|
if (errorNanoCreditHistory !== null) {
|
||||||
|
if (typeof errorNanoCreditHistory.data !== 'undefined') {
|
||||||
|
return (
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
<Text style={Typography.body1}>{errorNanoCreditHistory.data.error}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
<Text style={Typography.body1}>{errorNanoCreditHistory}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (resultNanoCreditHistory !== null) {
|
||||||
|
if (resultNanoCreditHistory.response !== null) {
|
||||||
|
return (
|
||||||
|
Array.isArray(resultNanoCreditHistory.response) && (resultNanoCreditHistory.response.length) > 0 ?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<View style={[styles.contentService, {borderBottomColor: Color.primaryColor}]}>
|
||||||
|
{
|
||||||
|
nanoCreditHistoryLabel().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}}>
|
||||||
|
{I18n.t(item.label)}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
resultNanoCreditHistory.response.map((item, index) => (
|
||||||
|
this.renderNanoCreditItem(item, index)
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
(
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'flex-start'}}>
|
||||||
|
<Text style={Typography.body1}>{I18n.t('NO_NANO_CREDIT')}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
renderNanoCreditHistory = () => {
|
||||||
|
return (
|
||||||
|
<View style={{backgroundColor: Color.containerBackgroundColor, flex: 1}}>
|
||||||
|
|
||||||
|
{
|
||||||
|
this.props.loadingNanoCreditHistory ?
|
||||||
|
(
|
||||||
|
<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.renderNanoCreditList()
|
||||||
|
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(this.props.loading || this.props.loadingGetCommission) && this.renderLoader()}
|
{(this.props.loading || this.props.loadingGetCommission || this.props.loadingNanoCreditHistory) && this.renderLoader()}
|
||||||
{this.state.isDataSubmit && this.renderBreakEpargneRespons()}
|
{this.state.isDataSubmit && this.renderBreakEpargneRespons()}
|
||||||
|
{this.state.displayModalHistory && this.renderModalHistoryDetail()}
|
||||||
|
{this.state.displayPasswordModal && this.renderPasswordDialog()}
|
||||||
<ScrollView style={styles.container}>
|
<ScrollView style={styles.container}>
|
||||||
|
|
||||||
<Text style={styles.subbigtitle}>{I18n.t('DEMAND_INFO')}</Text>
|
<View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.title3, Typography.semibold]}>
|
||||||
|
{I18n.t('SAVINGS_LIST')}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{
|
||||||
|
this.renderNanoCreditHistory()
|
||||||
|
}
|
||||||
|
|
||||||
|
{/*<Text style={styles.subbigtitle}>{I18n.t('DEMAND_INFO')}</Text>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { idEpargneAnim = comp }}>
|
<Animatable.View ref={(comp) => { idEpargneAnim = comp }}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
||||||
|
@ -209,7 +538,7 @@ class CasserEpargneUser extends Component {
|
||||||
<Button style={styles.btnvalide}
|
<Button style={styles.btnvalide}
|
||||||
textStyle={styles.textbtnvalide}
|
textStyle={styles.textbtnvalide}
|
||||||
onPress={() => { this.onSubmitCasserEpargne(); }}>
|
onPress={() => { this.onSubmitCasserEpargne(); }}>
|
||||||
{this.state.isGroupToModify ? I18n.t('MODIFY') : I18n.t('SUBMIT_LABEL')}</Button>
|
{this.state.isGroupToModify ? I18n.t('MODIFY') : I18n.t('SUBMIT_LABEL')}</Button>*/}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
@ -221,12 +550,18 @@ const maptStateToProps = state => ({
|
||||||
loading: state.casserEpargneUserReducer.loading,
|
loading: state.casserEpargneUserReducer.loading,
|
||||||
result: state.casserEpargneUserReducer.result,
|
result: state.casserEpargneUserReducer.result,
|
||||||
error: state.casserEpargneUserReducer.error,
|
error: state.casserEpargneUserReducer.error,
|
||||||
|
|
||||||
|
errorNanoCreditHistory: state.getEpargneInProgressReducer.error,
|
||||||
|
resultNanoCreditHistory: state.getEpargneInProgressReducer.result,
|
||||||
|
loadingNanoCreditHistory: state.getEpargneInProgressReducer.loading,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
|
||||||
casserEpargneUserAction,
|
casserEpargneUserAction,
|
||||||
casserEpargneUserReset,
|
casserEpargneUserReset,
|
||||||
|
getEpargneInProgressAction,
|
||||||
|
getEpargneInProgressReset
|
||||||
|
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
|
@ -235,7 +570,8 @@ export default connect(maptStateToProps, mapDispatchToProps)(CasserEpargneUser);
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: Color.primaryDarkColor,
|
backgroundColor: Color.containerBackgroundColor,
|
||||||
|
paddingHorizontal: 20
|
||||||
},
|
},
|
||||||
textbtnvalide: {
|
textbtnvalide: {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
|
@ -282,5 +618,98 @@ const styles = StyleSheet.create({
|
||||||
marginLeft: responsiveWidth(5),
|
marginLeft: responsiveWidth(5),
|
||||||
marginRight: responsiveWidth(5),
|
marginRight: responsiveWidth(5),
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
}
|
},
|
||||||
|
circlePoint: {
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
borderRadius: 25,
|
||||||
|
marginRight: 5,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
checkDefault: {
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
paddingVertical: 10,
|
||||||
|
marginTop: 5
|
||||||
|
},
|
||||||
|
transactionContainer: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
paddingTop: 10,
|
||||||
|
},
|
||||||
|
containerTouch: {
|
||||||
|
flex: 1,
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
shadowColor: Color.borderColor,
|
||||||
|
borderColor: Color.borderColor,
|
||||||
|
borderWidth: 0.5,
|
||||||
|
shadowOffset: {width: 1.5, height: 1.5},
|
||||||
|
shadowOpacity: 1.0,
|
||||||
|
elevation: 5,
|
||||||
|
borderRadius: 10,
|
||||||
|
backgroundColor: Color.cardBackgroundColor
|
||||||
|
},
|
||||||
|
|
||||||
|
contain: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
imageBanner: {
|
||||||
|
marginTop: 15,
|
||||||
|
marginLeft: 5,
|
||||||
|
width: Utils.scaleWithPixel(30),
|
||||||
|
height: Utils.scaleWithPixel(30)
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
height: Utils.scaleWithPixel(65),
|
||||||
|
paddingHorizontal: 10,
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'flex-start',
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
contentTitle: {
|
||||||
|
paddingTop: 12,
|
||||||
|
},
|
||||||
|
contentService: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
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"
|
||||||
|
},
|
||||||
});
|
});
|
|
@ -174,7 +174,7 @@ class DemandValidationGroup extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
renderDemandItem = (item) => {
|
renderDemandItem = (item) => {
|
||||||
let dateFormat = moment.tz(item.date_creation_demande, 'Etc/GMT+0').format();
|
let dateFormat = moment.tz(item.date_creation_demande, moment.tz.guess()).format();
|
||||||
dateFormat = moment(dateFormat).fromNow();
|
dateFormat = moment(dateFormat).fromNow();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -312,8 +312,8 @@ class DemandGroupNanoCreditDetail extends Component {
|
||||||
renderDetail = () => {
|
renderDetail = () => {
|
||||||
|
|
||||||
const { resultGetUniqueDemand } = this.props;
|
const { resultGetUniqueDemand } = this.props;
|
||||||
let ago = moment.tz(resultGetUniqueDemand.response.date_creation_groupe, 'Etc/GMT+0').format();
|
let ago = moment.tz(resultGetUniqueDemand.response.date_creation_groupe, moment.tz.guess()).format();
|
||||||
let dateDemand = moment.tz(resultGetUniqueDemand.response.date_creation_demande, 'Etc/GMT+0').format();
|
let dateDemand = moment.tz(resultGetUniqueDemand.response.date_creation_demande, moment.tz.guess()).format();
|
||||||
ago = moment(ago);
|
ago = moment(ago);
|
||||||
dateDemand = moment(dateDemand);
|
dateDemand = moment(dateDemand);
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,7 @@ class MyNanoCreditGroup extends Component {
|
||||||
renderDetail = () => {
|
renderDetail = () => {
|
||||||
|
|
||||||
const { resultGetUniqueDemand } = this.props;
|
const { resultGetUniqueDemand } = this.props;
|
||||||
let ago = moment.tz(resultGetUniqueDemand.response.date_creation, 'Etc/GMT+0').format();
|
let ago = moment.tz(resultGetUniqueDemand.response.date_creation, moment.tz.guess()).format();
|
||||||
ago = moment(ago)
|
ago = moment(ago)
|
||||||
return (<View style={styles.container}>
|
return (<View style={styles.container}>
|
||||||
<CardView
|
<CardView
|
||||||
|
|
|
@ -39,7 +39,6 @@ let route = require('../../route.json');
|
||||||
|
|
||||||
class RefundNanoCreditUser extends Component {
|
class RefundNanoCreditUser extends Component {
|
||||||
|
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
|
|
@ -8,17 +8,27 @@ import 'moment/locale/en-nz';
|
||||||
import 'moment/locale/es-us';
|
import 'moment/locale/es-us';
|
||||||
import 'moment/locale/fr';
|
import 'moment/locale/fr';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Platform, ProgressBarAndroid, ScrollView, StatusBar, StyleSheet, Text, View, TouchableOpacity } from 'react-native';
|
import {
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
import DeviceInfo from 'react-native-device-info';
|
import DeviceInfo from 'react-native-device-info';
|
||||||
import I18n from "react-native-i18n";
|
import I18n from "react-native-i18n";
|
||||||
import Icon from 'react-native-vector-icons/MaterialIcons';
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||||
import { connect } from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import { Color } from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
import { Typography } from '../../config/typography';
|
import {Typography} from '../../config/typography';
|
||||||
import { readUser } from '../../webservice/AuthApi';
|
import {readUser} from '../../webservice/AuthApi';
|
||||||
import { getNotificationAction, getNotificationReset } from '../../webservice/OnesignalApi';
|
import {getNotificationAction, getNotificationReset} from '../../webservice/OnesignalApi';
|
||||||
import BaseScreen from './../BaseScreen';
|
import BaseScreen from './../BaseScreen';
|
||||||
|
|
||||||
const theme = require('./../../utils/theme.json');
|
const theme = require('./../../utils/theme.json');
|
||||||
let moment = require('moment-timezone');
|
let moment = require('moment-timezone');
|
||||||
|
|
||||||
|
@ -32,13 +42,14 @@ class Notifications extends BaseScreen {
|
||||||
};
|
};
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
headerTitle: I18n.t('NOTIFICATIONS'),
|
headerTitle: I18n.t('NOTIFICATIONS'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({tintColor}) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'notifications-active'}
|
name={'notifications-active'}
|
||||||
size={24}
|
size={24}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
||||||
|
@ -47,7 +58,7 @@ class Notifications extends BaseScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
this.props.navigation.setParams({name: I18n.t('WALLET')})
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +73,7 @@ class Notifications extends BaseScreen {
|
||||||
agent_code: user.code_membre
|
agent_code: user.code_membre
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
this.props.getNotificationAction({
|
this.props.getNotificationAction({
|
||||||
user_code: user.user_code
|
user_code: user.user_code
|
||||||
});
|
});
|
||||||
|
@ -75,26 +85,36 @@ class Notifications extends BaseScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
getCreationDateToHumanFormat = (date) => {
|
getCreationDateToHumanFormat = (date) => {
|
||||||
let re = moment.tz(date, 'Etc/GMT+0').format();
|
let re = moment.tz(date, moment.tz.guess()).format();
|
||||||
|
console.log("Human date", moment(re).fromNow());
|
||||||
return moment(re).fromNow();
|
return moment(re).fromNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
getNotificationTypeIcon = (notification) => {
|
getNotificationTypeIcon = (notification) => {
|
||||||
switch (notification) {
|
switch (notification) {
|
||||||
case 'creation': return 'account-multiple-plus';
|
case 'creation':
|
||||||
case 'demandeSuppressionGroupe': return 'account-multiple-minus';
|
return 'account-multiple-plus';
|
||||||
case 'adhesion': return 'account-multiple-check'
|
case 'demandeSuppressionGroupe':
|
||||||
case 'nano_credit': return 'cash'
|
return 'account-multiple-minus';
|
||||||
default: return 'account-multiple'
|
case 'adhesion':
|
||||||
|
return 'account-multiple-check'
|
||||||
|
case 'nano_credit':
|
||||||
|
return 'cash'
|
||||||
|
default:
|
||||||
|
return 'account-multiple'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getDemandTypeColor = (type) => {
|
getDemandTypeColor = (type) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'creation': return 'green';
|
case 'creation':
|
||||||
case 'suppression': return 'red';
|
return 'green';
|
||||||
case 'adhesion': return Color.primaryColor
|
case 'suppression':
|
||||||
case 'nano_credit': return Color.primaryColor
|
return 'red';
|
||||||
|
case 'adhesion':
|
||||||
|
return Color.primaryColor
|
||||||
|
case 'nano_credit':
|
||||||
|
return Color.primaryColor
|
||||||
default:
|
default:
|
||||||
return Color.primaryColor
|
return Color.primaryColor
|
||||||
}
|
}
|
||||||
|
@ -106,7 +126,7 @@ class Notifications extends BaseScreen {
|
||||||
|
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={item.id}
|
key={item.id}
|
||||||
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}
|
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
switch (item.data.screen) {
|
switch (item.data.screen) {
|
||||||
case 'historyItemDetails':
|
case 'historyItemDetails':
|
||||||
|
@ -123,13 +143,13 @@ class Notifications extends BaseScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
}}>
|
}}>
|
||||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
<View style={{flexDirection: 'row', alignItems: 'center'}}>
|
||||||
{/* <View style={styles.iconContent}>
|
{/* <View style={styles.iconContent}>
|
||||||
<Image style={{ width: 48, height: 48 }} source={{ uri: icon }} />
|
<Image style={{ width: 48, height: 48 }} source={{ uri: icon }} />
|
||||||
</View> */}
|
</View> */}
|
||||||
<View>
|
<View>
|
||||||
<Text style={Typography.body1}>{item.message}</Text>
|
<Text style={Typography.body1}>{item.message}</Text>
|
||||||
<Text style={[Typography.footnote, Color.grayColor]} style={{ marginTop: 5 }}>
|
<Text style={[Typography.footnote, Color.grayColor]} style={{marginTop: 5}}>
|
||||||
{this.getCreationDateToHumanFormat(item.date)}
|
{this.getCreationDateToHumanFormat(item.date)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
@ -140,18 +160,17 @@ class Notifications extends BaseScreen {
|
||||||
|
|
||||||
renderNotificationList = () => {
|
renderNotificationList = () => {
|
||||||
|
|
||||||
const { result, error } = this.props;
|
const {result, error} = this.props;
|
||||||
if (error !== null) {
|
if (error !== null) {
|
||||||
if (typeof error.data !== 'undefined') {
|
if (typeof error.data !== 'undefined') {
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
<Text style={Typography.body1}>{error.data.error}</Text>
|
<Text style={Typography.body1}>{error.data.error}</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
<Text style={Typography.body1}>{error}</Text>
|
<Text style={Typography.body1}>{error}</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -161,7 +180,7 @@ class Notifications extends BaseScreen {
|
||||||
if (result.response !== null) {
|
if (result.response !== null) {
|
||||||
return (
|
return (
|
||||||
Array.isArray(result.response) && (result.response.length) > 0 ?
|
Array.isArray(result.response) && (result.response.length) > 0 ?
|
||||||
(<ScrollView style={{ flex: 1, padding: 20 }}>
|
(<ScrollView style={{flex: 1, padding: 20}}>
|
||||||
{
|
{
|
||||||
result.response.map((item) => (
|
result.response.map((item) => (
|
||||||
this.renderNotificationItem(item)
|
this.renderNotificationItem(item)
|
||||||
|
@ -169,7 +188,7 @@ class Notifications extends BaseScreen {
|
||||||
}
|
}
|
||||||
</ScrollView>) :
|
</ScrollView>) :
|
||||||
(
|
(
|
||||||
<View style={{ justifyContent: "center", alignItems: 'center', marginTop: 100 }}>
|
<View style={{justifyContent: "center", alignItems: 'center', marginTop: 100}}>
|
||||||
|
|
||||||
<LottieView
|
<LottieView
|
||||||
style={styles.lottie}
|
style={styles.lottie}
|
||||||
|
@ -188,18 +207,18 @@ class Notifications extends BaseScreen {
|
||||||
|
|
||||||
renderLoader = () => {
|
renderLoader = () => {
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
{Platform.OS === 'android'
|
{Platform.OS === 'android'
|
||||||
?
|
?
|
||||||
(
|
(
|
||||||
<>
|
<>
|
||||||
<ProgressBarAndroid />
|
<ProgressBarAndroid/>
|
||||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
) :
|
) :
|
||||||
<>
|
<>
|
||||||
<ActivityIndicator size="large" color={'#ccc'} />
|
<ActivityIndicator size="large" color={'#ccc'}/>
|
||||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import {Alert, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
|
import {Alert, AsyncStorage, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/Ionicons';
|
import Icon from 'react-native-vector-icons/Ionicons';
|
||||||
import {responsiveFontSize, responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
import {responsiveFontSize, responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
import {primary, primaryDarkAdvanced} from './../../utils/theme.json';
|
import {primary, primaryDarkAdvanced} from './../../utils/theme.json';
|
||||||
|
@ -582,7 +582,7 @@ export default class OptionsMenu extends Component {
|
||||||
text: I18n.t('YES'), onPress: () => {
|
text: I18n.t('YES'), onPress: () => {
|
||||||
disconnect().then(() => {
|
disconnect().then(() => {
|
||||||
IlinkEmitter.emit("userdisconnect");
|
IlinkEmitter.emit("userdisconnect");
|
||||||
//AsyncStorage.clear();
|
AsyncStorage.removeItem('@config:onesignalIds');
|
||||||
this.props.navigation.navigate("Auth");
|
this.props.navigation.navigate("Auth");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import {bindActionCreators} from "redux";
|
||||||
import {getBankListAction, getBankListReset} from "../../webservice/BankApi";
|
import {getBankListAction, getBankListReset} from "../../webservice/BankApi";
|
||||||
import {store} from "../../redux/store";
|
import {store} from "../../redux/store";
|
||||||
import {readUser} from "../../webservice/AuthApi";
|
import {readUser} from "../../webservice/AuthApi";
|
||||||
|
import {getOperatorListAction, getOperatorListReset} from "../../webservice/WalletApi";
|
||||||
|
|
||||||
const route = require('../../route.json');
|
const route = require('../../route.json');
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
|
@ -37,19 +38,32 @@ class OperateurOptionSelect extends Component {
|
||||||
options: this.props.navigation.state.params.optionSelect.options,
|
options: this.props.navigation.state.params.optionSelect.options,
|
||||||
title: this.props.navigation.state.params.optionSelect.title,
|
title: this.props.navigation.state.params.optionSelect.title,
|
||||||
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
|
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
|
||||||
|
operatorType: this.props.navigation.state.params.optionSelect.operatorType,
|
||||||
wallet: store.getState().walletDetailReducer.result.response
|
wallet: store.getState().walletDetailReducer.result.response
|
||||||
}
|
}
|
||||||
this.props.getBankListReset();
|
this.props.getBankListReset();
|
||||||
|
this.props.getOperatorListReset();
|
||||||
|
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
|
if (this.state.options.length > 0) {
|
||||||
|
if (user.category === undefined)
|
||||||
|
this.props.getOperatorListAction(this.state.operatorType, this.state.wallet.id_wallet_network)
|
||||||
|
else {
|
||||||
|
if (user.category === 'geolocated')
|
||||||
|
this.props.getOperatorListAction(this.state.operatorType, this.state.wallet.id_network)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (user.category === undefined) {
|
if (user.category === undefined) {
|
||||||
this.props.getBankListAction(this.state.wallet.id_wallet_network);
|
|
||||||
|
this.props.getOperatorListAction('bank', this.state.wallet.id_wallet_network)
|
||||||
} else {
|
} else {
|
||||||
if (user.category === 'geolocated')
|
if (user.category === 'geolocated')
|
||||||
this.props.getBankListAction(this.state.wallet.id_network);
|
this.props.getOperatorListAction('bank', this.state.wallet.id_network)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({user});
|
this.setState({user});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,11 +92,20 @@ class OperateurOptionSelect extends Component {
|
||||||
});
|
});
|
||||||
|
|
||||||
redirectToRoute = (item) => {
|
redirectToRoute = (item) => {
|
||||||
this.props.navigation.push(item.screen, {
|
|
||||||
title: item.title,
|
|
||||||
type: item.type
|
|
||||||
});
|
|
||||||
|
|
||||||
|
console.log("Redirection");
|
||||||
|
if (this.state.options.length > 0) {
|
||||||
|
|
||||||
|
this.props.navigation.push(this.state.options[0].screen, {
|
||||||
|
title: this.state.options[0].title,
|
||||||
|
type: this.state.options[0].type
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (this.state.user.category === 'geolocated')
|
||||||
|
this.props.navigation.navigate(route.envoieWalletToBankAgent, {bank: item});
|
||||||
|
else
|
||||||
|
this.props.navigation.navigate(route.envoieWalletToBankUser, {bank: item});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderLoader = () => {
|
renderLoader = () => {
|
||||||
|
@ -113,10 +136,7 @@ class OperateurOptionSelect extends Component {
|
||||||
key={index}
|
key={index}
|
||||||
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
|
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (this.state.user.category === 'geolocated')
|
this.redirectToRoute(item);
|
||||||
this.props.navigation.navigate(route.envoieWalletToBankAgent, {bank: item});
|
|
||||||
else
|
|
||||||
this.props.navigation.navigate(route.envoieWalletToBankUser, {bank: item});
|
|
||||||
}}>
|
}}>
|
||||||
<View style={{flexDirection: 'row', alignItems: 'center'}}>
|
<View style={{flexDirection: 'row', alignItems: 'center'}}>
|
||||||
<View>
|
<View>
|
||||||
|
@ -161,7 +181,7 @@ class OperateurOptionSelect extends Component {
|
||||||
</ScrollView>) :
|
</ScrollView>) :
|
||||||
(
|
(
|
||||||
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
<Text style={Typography.body1}>{I18n.t('NO_BANK_AVAILABLE')}</Text>
|
<Text style={Typography.body1}>{I18n.t('NO_OPERATOR_AVAILABLE')}</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -240,9 +260,6 @@ class OperateurOptionSelect extends Component {
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
|
|
||||||
{
|
{
|
||||||
this.state.options.length > 0 ?
|
|
||||||
this.renderList()
|
|
||||||
:
|
|
||||||
this.props.loading ?
|
this.props.loading ?
|
||||||
this.renderLoader() :
|
this.renderLoader() :
|
||||||
this.props.result != null ?
|
this.props.result != null ?
|
||||||
|
@ -259,14 +276,18 @@ class OperateurOptionSelect extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
loading: state.getBankListReducer.loading,
|
loading: state.getListOperatorReducer.loading,
|
||||||
result: state.getBankListReducer.result,
|
result: state.getListOperatorReducer.result,
|
||||||
error: state.getBankListReducer.error,
|
error: state.getListOperatorReducer.error,
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
getBankListAction,
|
getBankListAction,
|
||||||
getBankListReset
|
getBankListReset,
|
||||||
|
getOperatorListAction,
|
||||||
|
getOperatorListReset
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(OperateurOptionSelect);
|
export default connect(mapStateToProps, mapDispatchToProps)(OperateurOptionSelect);
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
import React, { Component } from 'react';
|
import React, {Component} from 'react';
|
||||||
import { StatusBar, StyleSheet, View } from 'react-native';
|
import {StatusBar, StyleSheet, View} from 'react-native';
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import { Appbar, Provider } from 'react-native-paper';
|
import {Appbar, Provider} from 'react-native-paper';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { Color } from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
import { IlinkEmitter } from "../../utils/events";
|
import {IlinkEmitter} from "../../utils/events";
|
||||||
import OutlineTextInput from '../../components/OutlineTextInput';
|
import OutlineTextInput from '../../components/OutlineTextInput';
|
||||||
import CustomButton from '../../components/CustomButton';
|
import CustomButton from '../../components/CustomButton';
|
||||||
import { ScrollView } from 'react-native-gesture-handler';
|
import {ScrollView} from 'react-native-gesture-handler';
|
||||||
|
|
||||||
const route = require('../../route.json');
|
const route = require('../../route.json');
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
|
|
||||||
|
@ -25,19 +26,19 @@ export default class PaiementFacture extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
this.props.navigation.setParams({name: I18n.t('WALLET')})
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
static navigationOptions = ({ navigation }) => ({
|
static navigationOptions = ({navigation}) => ({
|
||||||
header: null,
|
header: null,
|
||||||
headerMode: 'none',
|
headerMode: 'none',
|
||||||
headerTitle: null,
|
headerTitle: null,
|
||||||
activeColor: '#f0edf6',
|
activeColor: '#f0edf6',
|
||||||
inactiveColor: '#3e2465',
|
inactiveColor: '#3e2465',
|
||||||
barStyle: { backgroundColor: '#694fad' },
|
barStyle: {backgroundColor: '#694fad'},
|
||||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({tintColor}) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
|
@ -45,12 +46,14 @@ export default class PaiementFacture extends Component {
|
||||||
});
|
});
|
||||||
|
|
||||||
renderLabel = () => {
|
renderLabel = () => {
|
||||||
const { type } = this.state;
|
const {type} = this.state;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'PAIEMENT_ECOLE':
|
case 'PAIEMENT_ECOLE':
|
||||||
return I18n.t('IDENTIFIANT_ETUDIANT')
|
return I18n.t('IDENTIFIANT_ETUDIANT')
|
||||||
case 'PAIEMENT_EAU_ELECTRICITE':
|
case 'PAIEMENT_EAU':
|
||||||
|
return I18n.t('NUMERO_ABONNE')
|
||||||
|
case 'PAIEMENT_ELECTRICITE':
|
||||||
return I18n.t('NUMERO_ABONNE')
|
return I18n.t('NUMERO_ABONNE')
|
||||||
case 'PAIEMENT_CREDIT_TELEPHONE':
|
case 'PAIEMENT_CREDIT_TELEPHONE':
|
||||||
return I18n.t('PHONE_NUMBER')
|
return I18n.t('PHONE_NUMBER')
|
||||||
|
@ -65,7 +68,7 @@ export default class PaiementFacture extends Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Provider>
|
<Provider>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{flex: 1}}>
|
||||||
|
|
||||||
<StatusBar
|
<StatusBar
|
||||||
backgroundColor={Color.primaryDarkColor}
|
backgroundColor={Color.primaryDarkColor}
|
||||||
|
@ -73,9 +76,11 @@ export default class PaiementFacture extends Component {
|
||||||
translucent={false}
|
translucent={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Appbar.Header dark={true} style={{ backgroundColor: Color.primaryColor }}>
|
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>
|
||||||
<Appbar.BackAction
|
<Appbar.BackAction
|
||||||
onPress={() => { this.props.navigation.pop() }}
|
onPress={() => {
|
||||||
|
this.props.navigation.pop()
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Appbar.Content
|
<Appbar.Content
|
||||||
title={this.state.title}
|
title={this.state.title}
|
||||||
|
@ -84,31 +89,32 @@ export default class PaiementFacture extends Component {
|
||||||
|
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
|
|
||||||
<ScrollView style={{ padding: 20 }}>
|
<ScrollView style={{padding: 20}}>
|
||||||
|
|
||||||
<View style={{ marginTop: 10, marginRight: 20, marginLeft: 20 }}>
|
<View style={{marginTop: 10, marginRight: 20, marginLeft: 20}}>
|
||||||
<OutlineTextInput
|
<OutlineTextInput
|
||||||
borderBottomColor={'black'}
|
borderBottomColor={'black'}
|
||||||
keyboardType="numeric"
|
keyboardType="numeric"
|
||||||
label={this.renderLabel()}
|
label={this.renderLabel()}
|
||||||
style={{ marginTop: 10 }}
|
style={{marginTop: 10}}
|
||||||
placeholder={this.renderLabel()}
|
placeholder={this.renderLabel()}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={{ marginTop: 10, marginRight: 20, marginLeft: 20, marginBottom: 10 }}>
|
<View style={{marginTop: 10, marginRight: 20, marginLeft: 20, marginBottom: 10}}>
|
||||||
<OutlineTextInput
|
<OutlineTextInput
|
||||||
borderBottomColor={'black'}
|
borderBottomColor={'black'}
|
||||||
keyboardType="numeric"
|
keyboardType="numeric"
|
||||||
label={I18n.t('AMOUNT')}
|
label={I18n.t('AMOUNT')}
|
||||||
style={{ marginTop: 10 }}
|
style={{marginTop: 10}}
|
||||||
placeholder={I18n.t('AMOUNT_LABEL_DESCRIPTION')}
|
placeholder={I18n.t('AMOUNT_LABEL_DESCRIPTION')}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
||||||
<View style={{ margin: 10 }}>
|
<View style={{margin: 10}}>
|
||||||
<CustomButton outline onPress={() => { }}>
|
<CustomButton outline onPress={() => {
|
||||||
|
}}>
|
||||||
{I18n.t('VALIDATE')}
|
{I18n.t('VALIDATE')}
|
||||||
</CustomButton>
|
</CustomButton>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -252,7 +252,7 @@ class WalletDetail extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getCreationDateToHumanFormat = (date) => {
|
getCreationDateToHumanFormat = (date) => {
|
||||||
let re = moment.tz(date, 'Etc/GMT+0').format();
|
let re = moment.tz(date, moment.tz.guess()).format();
|
||||||
return moment(re).fromNow();
|
return moment(re).fromNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,10 +106,8 @@ class WalletDetailUser extends Component {
|
||||||
this.props.getWalletDetailActivated(this.props.navigation.state.params.userId, null);
|
this.props.getWalletDetailActivated(this.props.navigation.state.params.userId, null);
|
||||||
this.props.getUserIdentificationResetAction();
|
this.props.getUserIdentificationResetAction();
|
||||||
|
|
||||||
this.willFocus = this.props.navigation.addListener(
|
|
||||||
'willFocus',
|
|
||||||
payload => {
|
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
|
console.log("WIIL FOCUS CALL 1");
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
this.setState({user});
|
this.setState({user});
|
||||||
|
@ -118,6 +116,19 @@ class WalletDetailUser extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.willFocus = this.props.navigation.addListener(
|
||||||
|
'willFocus',
|
||||||
|
payload => {
|
||||||
|
console.log("WIIL FOCUS CALL 2");
|
||||||
|
readUser().then((user) => {
|
||||||
|
if (user) {
|
||||||
|
if (user !== undefined) {
|
||||||
|
this.setState({user});
|
||||||
|
this.props.getWalletTransactionHistoryUser(user.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -191,7 +202,7 @@ class WalletDetailUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getCreationDateToHumanFormat = (date) => {
|
getCreationDateToHumanFormat = (date) => {
|
||||||
let re = moment.tz(date, 'Etc/GMT+0').format();
|
let re = moment.tz(date, moment.tz.guess()).format();
|
||||||
return moment(re).fromNow();
|
return moment(re).fromNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -515,9 +515,54 @@ export const optionNanoCreditAgentScreen = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionPaiementEauElectricite = {
|
export const optionPaiementEau = {
|
||||||
title: 'PAIEMENT_FACTURE',
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: 'CHOOSE_OPERATOR',
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
|
operatorType: 'water',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: 'PAIEMENT_EAU',
|
||||||
|
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_EAU',
|
||||||
|
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_EAU',
|
||||||
|
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_EAU',
|
||||||
|
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_EAU',
|
||||||
|
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_EAU',
|
||||||
|
screen: route.paiementFacture,
|
||||||
|
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
||||||
|
title: 'Opérateur eau-électricité 6',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const optionPaiementElectricite = {
|
||||||
|
title: 'PAIEMENT_FACTURE',
|
||||||
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
|
operatorType: 'electricity',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'PAIEMENT_EAU_ELECTRICITE',
|
type: 'PAIEMENT_EAU_ELECTRICITE',
|
||||||
|
@ -561,6 +606,7 @@ export const optionPaiementEauElectricite = {
|
||||||
export const optionPaiementCreditTelephonique = {
|
export const optionPaiementCreditTelephonique = {
|
||||||
title: 'PAIEMENT_FACTURE',
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: 'CHOOSE_OPERATOR',
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
|
operatorType: 'phone',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
||||||
|
@ -604,6 +650,7 @@ export const optionPaiementCreditTelephonique = {
|
||||||
export const optionPaiementAbonnementTV = {
|
export const optionPaiementAbonnementTV = {
|
||||||
title: 'PAIEMENT_FACTURE',
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: 'CHOOSE_OPERATOR',
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
|
operatorType: 'tv',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'PAIEMENT_ABONNEMENT_TV',
|
type: 'PAIEMENT_ABONNEMENT_TV',
|
||||||
|
@ -647,6 +694,7 @@ export const optionPaiementAbonnementTV = {
|
||||||
export const optionPaiementEcole = {
|
export const optionPaiementEcole = {
|
||||||
title: 'PAIEMENT_FACTURE',
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: 'CHOOSE_OPERATOR',
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
|
operatorType: 'school',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'PAIEMENT_ECOLE',
|
type: 'PAIEMENT_ECOLE',
|
||||||
|
@ -695,9 +743,16 @@ export const optionPaiementFacture = {
|
||||||
{
|
{
|
||||||
type: 'FACTURE_WATER_ELECTRICITY',
|
type: 'FACTURE_WATER_ELECTRICITY',
|
||||||
icon: 'water',
|
icon: 'water',
|
||||||
title: 'PAIEMENT_EAU_ELECTRICITY',
|
title: 'PAIEMENT_EAU',
|
||||||
screen: route.operateurOptionSelect,
|
screen: route.operateurOptionSelect,
|
||||||
subScreenOption: optionPaiementEauElectricite
|
subScreenOption: optionPaiementEau
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'FACTURE_ELECTRICITY',
|
||||||
|
icon: 'water',
|
||||||
|
title: 'PAIEMENT_ELECTRICITY',
|
||||||
|
screen: route.operateurOptionSelect,
|
||||||
|
subScreenOption: optionPaiementElectricite
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'FACTURE_SCHOOL',
|
type: 'FACTURE_SCHOOL',
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
"MY_ACCOUNT": "My account",
|
"MY_ACCOUNT": "My account",
|
||||||
"WALLET": "Wallet",
|
"WALLET": "Wallet",
|
||||||
"NO_BANK_AVAILABLE": "No bank available",
|
"NO_BANK_AVAILABLE": "No bank available",
|
||||||
|
"NO_OPERATOR_AVAILABLE": "No operator available",
|
||||||
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
||||||
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
||||||
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
||||||
|
@ -158,6 +159,7 @@
|
||||||
"DEPOSIT_TO_BANK": "Your Wallet to bank",
|
"DEPOSIT_TO_BANK": "Your Wallet to bank",
|
||||||
"NANO_CREDIT": "Nano credit",
|
"NANO_CREDIT": "Nano credit",
|
||||||
"NANO_CREDIT_LIST": "Nano credit list",
|
"NANO_CREDIT_LIST": "Nano credit list",
|
||||||
|
"SAVINGS_LIST": "Savings list",
|
||||||
"NO_NANO_CREDIT": "No nano credit demand",
|
"NO_NANO_CREDIT": "No nano credit demand",
|
||||||
"NANO_CREDIT_DESCRIPTION": "Nano credit description",
|
"NANO_CREDIT_DESCRIPTION": "Nano credit description",
|
||||||
"NANO_SANTE": "Nano health",
|
"NANO_SANTE": "Nano health",
|
||||||
|
@ -172,7 +174,8 @@
|
||||||
"CAUTIONNEMENT_DONE": "Caution done",
|
"CAUTIONNEMENT_DONE": "Caution done",
|
||||||
"ID_DEMAND": "Demand ID",
|
"ID_DEMAND": "Demand ID",
|
||||||
"DATE": "Date",
|
"DATE": "Date",
|
||||||
"PAIEMENT_EAU_ELECTRICITY": "Water/electricity bill",
|
"PAIEMENT_EAU_ELECTRICITY": "Water bill",
|
||||||
|
"PAIEMENT_ELECTRICITY": "Electricity bill",
|
||||||
"PAIEMENT_ECOLE": "School fees",
|
"PAIEMENT_ECOLE": "School fees",
|
||||||
"PAIEMENT_CREDIT_TELEPHONIQUE": "Phone credit bills",
|
"PAIEMENT_CREDIT_TELEPHONIQUE": "Phone credit bills",
|
||||||
"PAIEMENT_ABONNEMENT_TV": "TV subscription",
|
"PAIEMENT_ABONNEMENT_TV": "TV subscription",
|
||||||
|
@ -180,6 +183,7 @@
|
||||||
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
|
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
|
||||||
"DATE_REMBOURSEMENT": "Refund date",
|
"DATE_REMBOURSEMENT": "Refund date",
|
||||||
"AMOUNT_REFUND": "Amount reimbursed",
|
"AMOUNT_REFUND": "Amount reimbursed",
|
||||||
|
"AMOUNT_WITHDRAWAL": "Amount withdrawal",
|
||||||
"AMOUNT_PARTIALLY_REFUND": "Amount partially refunded",
|
"AMOUNT_PARTIALLY_REFUND": "Amount partially refunded",
|
||||||
"FINAL_DATE": "End date",
|
"FINAL_DATE": "End date",
|
||||||
"CASSATION_DATE": "Cassation date",
|
"CASSATION_DATE": "Cassation date",
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
"DESTINATAIRE": "Destinataire",
|
"DESTINATAIRE": "Destinataire",
|
||||||
"ERROR_LABEL": "Erreur",
|
"ERROR_LABEL": "Erreur",
|
||||||
"NO_BANK_AVAILABLE": "Aucune banque disponible",
|
"NO_BANK_AVAILABLE": "Aucune banque disponible",
|
||||||
|
"NO_OPERATOR_AVAILABLE": "Aucun opérateur disponible",
|
||||||
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
||||||
"SUCCESS": "Succès",
|
"SUCCESS": "Succès",
|
||||||
"ETAT": "Etat",
|
"ETAT": "Etat",
|
||||||
|
@ -165,6 +166,7 @@
|
||||||
"DEPOSIT_TO_BANK": "Votre Wallet vers banque",
|
"DEPOSIT_TO_BANK": "Votre Wallet vers banque",
|
||||||
"NANO_CREDIT": "Nano crédit",
|
"NANO_CREDIT": "Nano crédit",
|
||||||
"NANO_CREDIT_LIST": "Liste des nano crédit",
|
"NANO_CREDIT_LIST": "Liste des nano crédit",
|
||||||
|
"SAVINGS_LIST": "Liste des épargnes",
|
||||||
"NO_NANO_CREDIT": "Aucune demande de nano crédit",
|
"NO_NANO_CREDIT": "Aucune demande de nano crédit",
|
||||||
"NANO_CREDIT_DESCRIPTION": "Nano crédit iLink",
|
"NANO_CREDIT_DESCRIPTION": "Nano crédit iLink",
|
||||||
"NANO_SANTE": "Nano santé",
|
"NANO_SANTE": "Nano santé",
|
||||||
|
@ -178,7 +180,8 @@
|
||||||
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
||||||
"CAUTIONNEMENT_DONE": "Cautionnement effectué",
|
"CAUTIONNEMENT_DONE": "Cautionnement effectué",
|
||||||
"ID_DEMAND": "Identifiant de la demande",
|
"ID_DEMAND": "Identifiant de la demande",
|
||||||
"PAIEMENT_EAU_ELECTRICITY": "Paiement eau/électricité",
|
"PAIEMENT_EAU": "Paiement eau",
|
||||||
|
"PAIEMENT_ELECTRICITY": "Paiement électricité",
|
||||||
"PAIEMENT_ECOLE": "Paiement école",
|
"PAIEMENT_ECOLE": "Paiement école",
|
||||||
"PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
|
"PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
|
||||||
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
|
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
|
||||||
|
@ -187,6 +190,7 @@
|
||||||
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
||||||
"DATE_REMBOURSEMENT": "Date de remboursement",
|
"DATE_REMBOURSEMENT": "Date de remboursement",
|
||||||
"AMOUNT_REFUND": "Montant remboursé",
|
"AMOUNT_REFUND": "Montant remboursé",
|
||||||
|
"AMOUNT_WITHDRAWAL": "Montant retiré",
|
||||||
"AMOUNT_PARTIALLY_REFUND": "Montant partiellement remboursé",
|
"AMOUNT_PARTIALLY_REFUND": "Montant partiellement remboursé",
|
||||||
"FINAL_DATE": "Date de fin",
|
"FINAL_DATE": "Date de fin",
|
||||||
"CASSATION_DATE": "Date de cassation",
|
"CASSATION_DATE": "Date de cassation",
|
||||||
|
|
|
@ -72,6 +72,7 @@ export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets
|
||||||
export const getBankUrl = testBaseUrl + '/walletService/wallets/users/operators/bank';
|
export const getBankUrl = testBaseUrl + '/walletService/wallets/users/operators/bank';
|
||||||
export const getHistoryNanoPendingCreditUrl = testBaseUrl + '/walletService/groups/nanoCredit/demands_in_progress';
|
export const getHistoryNanoPendingCreditUrl = testBaseUrl + '/walletService/groups/nanoCredit/demands_in_progress';
|
||||||
export const getHistoryEpargnePendingUrl = testBaseUrl + '/walletService/groups/nanoCredit/savings/demands_in_progress';
|
export const getHistoryEpargnePendingUrl = testBaseUrl + '/walletService/groups/nanoCredit/savings/demands_in_progress';
|
||||||
|
export const getOperatorListUrl = testBaseUrl + '/walletService/wallets/users/operators';
|
||||||
|
|
||||||
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
||||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||||
|
|
|
@ -33,7 +33,7 @@ import {
|
||||||
import {store} from "../redux/store";
|
import {store} from "../redux/store";
|
||||||
import {
|
import {
|
||||||
askNanoCreditUrl,
|
askNanoCreditUrl,
|
||||||
cancelDemandUrl,
|
cancelDemandUrl, getHistoryEpargnePendingUrl,
|
||||||
getHistoryNanoPendingCreditUrl,
|
getHistoryNanoPendingCreditUrl,
|
||||||
getNanoCreditDemandDureationUrl,
|
getNanoCreditDemandDureationUrl,
|
||||||
groupUrl,
|
groupUrl,
|
||||||
|
@ -282,9 +282,8 @@ export const getEpargneInProgressAction = (data) => {
|
||||||
dispatch(fetchGetEpargneInProgressPending());
|
dispatch(fetchGetEpargneInProgressPending());
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
url: `${getHistoryNanoPendingCreditUrl}`,
|
url: `${getHistoryEpargnePendingUrl}/${data}`,
|
||||||
method: 'POST',
|
method: 'GET',
|
||||||
data,
|
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': authKey,
|
'Authorization': authKey,
|
||||||
'X-Localization': I18n.currentLocale()
|
'X-Localization': I18n.currentLocale()
|
||||||
|
|
|
@ -1,12 +1,34 @@
|
||||||
|
|
||||||
import { walletActionUrl, commissionAmount, walletDetailUrl, walletUserSimpleActionUrl, linkCardUrl } from "./IlinkConstants";
|
|
||||||
import {
|
import {
|
||||||
fetchWalletListPending, fetchWalletListSuccess, fetchWalletListError, fetchWalletListReset,
|
commissionAmount,
|
||||||
fetchWalletListDetailPending, fetchWalletListDetailSuccess, fetchWalletListDetailError, fetchWalletListDetailReset,
|
getOperatorListUrl,
|
||||||
fetchWalletGetCommissionPending, fetchWalletGetCommissionSuccess, fetchWalleGetCommissionError, walletGetCommissionReset,
|
linkCardUrl,
|
||||||
fetchLinkCardPending, fetchLinkCardSuccess, fetchLinkCardError, fetchLinkCardReset
|
walletActionUrl,
|
||||||
|
walletDetailUrl,
|
||||||
|
walletUserSimpleActionUrl
|
||||||
|
} from "./IlinkConstants";
|
||||||
|
import {
|
||||||
|
fetchGetListOperatorError,
|
||||||
|
fetchGetListOperatorPending,
|
||||||
|
fetchGetListOperatorReset,
|
||||||
|
fetchGetListOperatorSuccess,
|
||||||
|
fetchLinkCardError,
|
||||||
|
fetchLinkCardPending,
|
||||||
|
fetchLinkCardReset,
|
||||||
|
fetchLinkCardSuccess,
|
||||||
|
fetchWalleGetCommissionError,
|
||||||
|
fetchWalletGetCommissionPending,
|
||||||
|
fetchWalletGetCommissionSuccess,
|
||||||
|
fetchWalletListDetailError,
|
||||||
|
fetchWalletListDetailPending,
|
||||||
|
fetchWalletListDetailReset,
|
||||||
|
fetchWalletListDetailSuccess,
|
||||||
|
fetchWalletListError,
|
||||||
|
fetchWalletListPending,
|
||||||
|
fetchWalletListReset,
|
||||||
|
fetchWalletListSuccess,
|
||||||
|
walletGetCommissionReset
|
||||||
} from "../redux/actions/WalletActions";
|
} from "../redux/actions/WalletActions";
|
||||||
import { store } from "../redux/store";
|
import {store} from "../redux/store";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
|
|
||||||
|
@ -167,3 +189,40 @@ export const linkCardReset = () => {
|
||||||
dispatch(fetchLinkCardReset());
|
dispatch(fetchLinkCardReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const getOperatorListAction = (typeOperator, idNetworkWallet) => {
|
||||||
|
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchGetListOperatorPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${getOperatorListUrl}/${typeOperator}/${idNetworkWallet}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchGetListOperatorSuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchGetListOperatorError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchGetListOperatorError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchGetListOperatorError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const getOperatorListReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchGetListOperatorReset());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue