Correction des bugs

This commit is contained in:
Brice 2020-11-18 12:22:53 +01:00
parent f3148ea78f
commit 0a1c1f896a
27 changed files with 2282 additions and 1574 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@
"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",
"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": {
"@expo/react-native-action-sheet": "^3.8.0",

View File

@ -1,35 +1,35 @@
import {
WALLET_LIST_PENDING,
WALLET_LIST_SUCCESS,
WALLET_LIST_ERROR,
WALLET_HISTORY_PENDING,
WALLET_HISTORY_SUCCESS,
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,
GET_OPERATOR_LIST_ERROR,
GET_OPERATOR_LIST_PENDING,
GET_OPERATOR_LIST_RESET,
GET_OPERATOR_LIST_SUCCESS,
LINK_CARD_ERROR,
LINK_CARD_PENDING,
LINK_CARD_RESET,
LINK_CARD_SUCCESS,
LINK_CARD_ERROR,
WALLET_HISTORY_HYPER_SUPER_PENDING,
WALLET_HISTORY_HYPER_SUPER__SUCCESS,
WALLET_GET_COMMISSION_ERROR,
WALLET_GET_COMMISSION_PENDING,
WALLET_GET_COMMISSION_RESET,
WALLET_GET_COMMISSION_SUCCESS,
WALLET_HISTORY_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";
@ -190,3 +190,24 @@ export const fetchWalleGetRetraitCommissionError = (error) => ({
type: WALLET_GET_RETREAIT_COMMISSION_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
});

View File

@ -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;
}
}
};

View File

@ -46,6 +46,7 @@ import GetBankListReducer from "./GetBankListReducer";
import EnvoieUserWalletToBank from "./EnvoieUserWalletToBankReducer";
import GetEpargneInProgressReducer from "./GetEpargneInProgressReducer";
import GetNanoCreditUserHistoryInProgressReducer from "./GetNanoCreditUserHistoryInProgressReducer";
import GetListOperatorReducer from "./GetListOperatorReducer";
const persistConfig = {
key: 'root',
@ -100,7 +101,8 @@ const rootReducer = persistCombineReducers(persistConfig, {
getBankListReducer: GetBankListReducer,
envoieUserWalletToBank: EnvoieUserWalletToBank,
getEpargneInProgressReducer: GetEpargneInProgressReducer,
getNanoCreditUserHistoryInProgressReducer: GetNanoCreditUserHistoryInProgressReducer
getNanoCreditUserHistoryInProgressReducer: GetNanoCreditUserHistoryInProgressReducer,
getListOperatorReducer: GetListOperatorReducer
});
export default rootReducer;

View File

@ -37,3 +37,8 @@ export const LINK_CARD_PENDING = 'LINK_CARD_PENDING';
export const LINK_CARD_SUCCESS = 'LINK_CARD_SUCCESS';
export const LINK_CARD_ERROR = 'LINK_CARD_ERROR';
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';

View File

@ -268,7 +268,7 @@ export default class SuperViseurGroupeHome extends BaseScreen {
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();
if (true) {
return (

View File

@ -1,11 +1,7 @@
import React, { Component, PureComponent } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, Text, View, FlatList, TouchableOpacity, SectionList, RefreshControl } from 'react-native';
import { responsiveFontSize, responsiveWidth, responsiveHeight } from 'react-native-responsive-dimensions';
import { convertDateToHumanText } from './../../utils/DateUtils';
import React, {PureComponent} from 'react';
import {FlatList, RefreshControl, SectionList, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {responsiveFontSize, responsiveWidth} from 'react-native-responsive-dimensions';
import Icon from 'react-native-vector-icons/FontAwesome5';
var moment = require('moment-timezone')
const momentJS = require('moment')
import I18n from "react-native-i18n"
import 'moment/locale/fr'
@ -20,6 +16,9 @@ import 'moment/locale/en-gb'
import DeviceInfo from 'react-native-device-info'
import {Color} from '../../config/Color';
var moment = require('moment-timezone')
const momentJS = require('moment')
let route = require('./../../route.json');
var theme = require('./../../utils/theme.json');
@ -32,32 +31,40 @@ export class HistoryItem extends React.Component {
statusLabel = (status) => {
switch (status) {
case '0': return I18n.t('NO_TREAT');
case '1': return I18n.t('TREAT');
case '2': return I18n.t('REFUSED');
case '0':
return I18n.t('NO_TREAT');
case '1':
return I18n.t('TREAT');
case '2':
return I18n.t('REFUSED');
}
}
colorLabel = (status) => {
switch (status) {
case '0': return Color.accentColor;
case '1': return Color.greenColor;
case '2': return Color.redColor;
case '0':
return Color.accentColor;
case '1':
return Color.greenColor;
case '2':
return Color.redColor;
}
}
descriptionLabelUserType = (user) => {
console.log("USER")
let textDescription = (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' ' + this.props.selfData.reseau;
switch (user.category) {
case 'geolocated': return `${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`;
case 'super': return this.props.isDemandSend ?
case 'geolocated':
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('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;
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
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)
return {
title: textTitle,
@ -91,7 +98,6 @@ export class HistoryItem extends React.Component {
item: this.props.selfData,
onGoBack: () => this.props.refresh(),
}
)}>
<View style={style.content}>
<Text style={style.title}>{this.state.title}</Text>
@ -103,7 +109,7 @@ export class HistoryItem extends React.Component {
marginBottom: 10,
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>
</View>
<View style={style.bottomSeparator}/>
@ -115,6 +121,7 @@ export class HistoryItem extends React.Component {
}
}
export class HistoryItemSectionned extends PureComponent {
_keyExtractor = (item, index) => item.id;
_renderItem = ({item}) => (
@ -123,17 +130,31 @@ export class HistoryItemSectionned extends PureComponent {
selfData={item}
/>
);
constructor(props) {
super(props);
this.state = this.initState();
}
render() {
return (
<SectionList
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}}) => (
<TouchableOpacity onPress={() => this.onPressedHeader(type)} style={{
@ -161,7 +182,8 @@ export class HistoryItemSectionned extends PureComponent {
color: 'white'
}}>{size} demande(s)</Text>
</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>
)}
style={style.listStyle}
@ -171,14 +193,22 @@ export class HistoryItemSectionned extends PureComponent {
/>
);
}
onPressedHeader(type) {
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 {
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() {
let data = this.props.list
@ -192,6 +222,7 @@ export class HistoryItemSectionned extends PureComponent {
}
}
}
export class HistoryListItem extends React.Component {
_keyExtractor = (item, index) => item.id;
@ -209,16 +240,20 @@ export class HistoryListItem extends React.Component {
selfData={item}
refresh={this.props.refresh}
/>
)};
)
};
constructor(props) {
super(props);
this.state = this.initState();
}
initState() {
return {
refreshing: false,
}
}
render() {
return (
<FlatList
@ -240,7 +275,9 @@ export class HistoryListItem extends React.Component {
_onRefresh() {
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,
color: theme.accent,
},
treat: {
},
treat: {},
});

View File

@ -1,31 +1,32 @@
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 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 { updateCreditDemand } from "../../webservice/HistoryRequestApi";
import {readUser} from "../../webservice/AuthApi";
let typesta = 0;
import isNil from 'lodash/isNil';
let moment = require('moment-timezone')
var colorback = 'white'
import I18n from "react-native-i18n";
import { treatCreditDemand, creditDemandResetReducer } from '../../webservice/CreditTreatDemandApi';
import { treatCancelDemand, creditCancelResetReducer } from '../../webservice/CreditCancelDemandeApi';
import {creditDemandResetReducer, treatCreditDemand} from '../../webservice/CreditTreatDemandApi';
import {creditCancelResetReducer, treatCancelDemand} from '../../webservice/CreditCancelDemandeApi';
import {getAgentNetworksList} from "../../webservice/NetworkApi";
import Icon from "./History";
import { Header } from "react-native-elements";
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");
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')
var colorback = 'white'
let theme = require('./../../utils/theme.json');
const route = require("./../../route.json");
class HistoryItemDetails extends Component {
static navigatorStyle = {
@ -61,8 +62,7 @@ class HistoryItemDetails extends Component {
colorback = 'green'
typesta = 2
sta = I18n.t('ACCEPTER_DEMANDE')
}
else {
} else {
colorback = '#AEAEAE'
typesta = 2
sta = I18n.t('REFUSED')
@ -85,7 +85,6 @@ class HistoryItemDetails extends Component {
let networks = []
networks = await getAgentNetworksList(user.agentId);
this.setState({user: user, networks: networks.networks})
});
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
@ -180,8 +179,7 @@ class HistoryItemDetails extends Component {
this.setState({
isBtnModifyAmountEnabled: true
})
}
else
} else
this.setState({
isBtnModifyAmountEnabled: false
});
@ -192,8 +190,10 @@ class HistoryItemDetails extends Component {
}}/>
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => this.setState({ displayAmountModifyDialog: false })} />
<Dialog.Button bold={true} label={I18n.t('SEND')} disable={this.state.isBtnModifyAmountEnabled} onPress={() => {
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')}
onPress={() => this.setState({displayAmountModifyDialog: false})}/>
<Dialog.Button bold={true} label={I18n.t('SEND')} disable={this.state.isBtnModifyAmountEnabled}
onPress={() => {
this.props.creditDemandResetReducer();
this.props.treatCreditDemand(this.item.id, this.state.montant);
}}/>
@ -212,7 +212,8 @@ class HistoryItemDetails extends Component {
errorTreatDemand.data.error,
[{
text: I18n.t('CANCEL_LABEL'),
onPress: () => { },
onPress: () => {
},
style: 'cancel'
},
{
@ -228,8 +229,7 @@ class HistoryItemDetails extends Component {
}],
{cancelable: false}
);
}
else {
} else {
Alert.alert(
I18n.t("ERROR_TREATMENT_DEMAND"),
errorTreatDemand.data.error,
@ -294,8 +294,9 @@ class HistoryItemDetails extends Component {
}
renderBtn() {
const { user } = this.state
const {user} = this.state;
console.warn("ITEM ITEM", this.item);
console.warn("Code Membre", user.code_membre);
if (user) {
if (this.item.code_parrain === user.code_membre) {
if (this.item.status === '1') {
@ -316,8 +317,7 @@ class HistoryItemDetails extends Component {
{this.state.statut}
</Button>
)
}
else if (this.item.status === '2') {
} else if (this.item.status === '2') {
return (<Button
style={{
borderColor: 'transparent',
@ -334,9 +334,7 @@ class HistoryItemDetails extends Component {
{this.state.statut}
</Button>
)
}
else {
} else {
return (<View style={{
flexDirection: 'row',
paddingTop: 10
@ -399,8 +397,8 @@ class HistoryItemDetails extends Component {
render() {
console.log("CREDIT MANAGE PROPS", this.props);
let ago = moment.tz(this.item.date_creation, 'Etc/GMT+0').format();
ago = moment(ago)
let ago = moment.tz(this.item.date_creation, moment.tz.guess()).format();
ago = moment(ago);
return (
<View style={styles.container}>
{this.renderPromptModifyAmountToSend()}
@ -550,9 +548,7 @@ const styles = StyleSheet.create({
container: {
flex: 1,
},
btnstyle: {
},
btnstyle: {},
inputAmountText: {
...Platform.select({

View File

@ -176,8 +176,8 @@ class Home extends BaseScreen {
AsyncStorage.getAllKeys((err, keys) => {
AsyncStorage.multiGet(keys, (err, stores) => {
stores.map(async (result, i, store) => {
/* console.warn("KEY MAP", store);
console.log("KEY SAVE " + store[i][0]); */
console.warn("KEY MAP", store);
console.log("KEY SAVE " + store[i][0]);
let key = store[i][0];
if (i === 0) {
if (!_.isEqual(key, '@config:onesignalIds')) {
@ -778,9 +778,8 @@ class Home extends BaseScreen {
this.makeMarkerInformation = this.makeMarkerInformation.bind(this);
//IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
OneSignal.addEventListener('ids', this.onIds);
global.appHasLoaded = true;
};
/* updateLangue() {
@ -1656,7 +1655,7 @@ class Home extends BaseScreen {
translucent={true}
/>
{/* Start here to comment */}
{/*{
{
(this.state.loadingDialog || this.props.loading) ?
<View
style={{
@ -1708,7 +1707,7 @@ class Home extends BaseScreen {
}
}])
}}
/>*/}
/>
{this.makeCardSearch()}
{this.makeSlidingUp()}
{this.makeDialogLoader()}

View File

@ -1,24 +1,35 @@
import Button from 'apsl-react-native-button';
import isEqual from 'lodash/isEqual';
import isNil from 'lodash/isNil';
import React, {Component} from 'react';
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
import * as Animatable from 'react-native-animatable';
import {
ActivityIndicator,
Alert,
ProgressBarAndroid,
ScrollView,
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native';
import I18n from 'react-native-i18n';
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
import {ProgressDialog} from 'react-native-simple-dialogs';
import { Fumi } from 'react-native-textinput-effects';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import omit from 'lodash/omit';
import {Color} from '../../config/Color';
import { FontWeight, Typography } from '../../config/typography';
import { store } from "../../redux/store";
import {Typography} from '../../config/typography';
import {IlinkEmitter} from '../../utils/events';
import {readUser} from '../../webservice/AuthApi';
import { createGroupAction, createGroupReset } from '../../webservice/NanoCreditApi';
import { isNormalInteger } from '../../utils/UtilsFunction';
import {getEpargneInProgressAction, getEpargneInProgressReset} from '../../webservice/NanoCreditApi';
import {casserEpargneUserAction, casserEpargneUserReset} from '../../webservice/user/NanoCreditApi';
import {cutStringWithoutDot, displayTransactionType, nanoCreditHistoryLabel} from "../../utils/UtilsFunction";
import * as Utils from "../../utils/DeviceUtils";
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 route = require('../../route.json');
@ -39,7 +50,13 @@ class CasserEpargneUser extends Component {
isDataSubmit: false,
isModalConfirmVisible: false,
isGroupToModify: false,
displayModalHistory: false,
historyItemDetail: null,
isDataHasLoaded: false,
displayPasswordModal: false,
wallet: this.props.navigation.state.params.wallet,
};
this.props.getEpargneInProgressReset();
}
@ -74,6 +91,8 @@ class CasserEpargneUser extends Component {
if (user) {
if (user !== undefined) {
this.setState({user});
this.props.getEpargneInProgressAction(user.id);
}
}
});
@ -155,25 +174,335 @@ class CasserEpargneUser extends Component {
});
}
renderLoader = () => {
return (
<ProgressDialog
visible={this.props.loading || this.props.loadingGetCommission}
visible={this.props.loading || this.props.loadingGetCommission || this.props.loadingNanoCreditHistory}
title={I18n.t('LOADING')}
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() {
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.displayModalHistory && this.renderModalHistoryDetail()}
{this.state.displayPasswordModal && this.renderPasswordDialog()}
<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 }}>
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
@ -209,7 +538,7 @@ class CasserEpargneUser extends Component {
<Button style={styles.btnvalide}
textStyle={styles.textbtnvalide}
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>
</>
)
@ -221,12 +550,18 @@ const maptStateToProps = state => ({
loading: state.casserEpargneUserReducer.loading,
result: state.casserEpargneUserReducer.result,
error: state.casserEpargneUserReducer.error,
errorNanoCreditHistory: state.getEpargneInProgressReducer.error,
resultNanoCreditHistory: state.getEpargneInProgressReducer.result,
loadingNanoCreditHistory: state.getEpargneInProgressReducer.loading,
});
const mapDispatchToProps = dispatch => bindActionCreators({
casserEpargneUserAction,
casserEpargneUserReset,
getEpargneInProgressAction,
getEpargneInProgressReset
}, dispatch);
@ -235,7 +570,8 @@ export default connect(maptStateToProps, mapDispatchToProps)(CasserEpargneUser);
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Color.primaryDarkColor,
backgroundColor: Color.containerBackgroundColor,
paddingHorizontal: 20
},
textbtnvalide: {
color: 'white',
@ -282,5 +618,98 @@ const styles = StyleSheet.create({
marginLeft: responsiveWidth(5),
marginRight: responsiveWidth(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"
},
});

View File

@ -174,7 +174,7 @@ class DemandValidationGroup extends React.Component {
}
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();
return (

View File

@ -312,8 +312,8 @@ class DemandGroupNanoCreditDetail extends Component {
renderDetail = () => {
const { resultGetUniqueDemand } = this.props;
let ago = moment.tz(resultGetUniqueDemand.response.date_creation_groupe, 'Etc/GMT+0').format();
let dateDemand = moment.tz(resultGetUniqueDemand.response.date_creation_demande, '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, moment.tz.guess()).format();
ago = moment(ago);
dateDemand = moment(dateDemand);

View File

@ -268,7 +268,7 @@ class MyNanoCreditGroup extends Component {
renderDetail = () => {
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)
return (<View style={styles.container}>
<CardView

View File

@ -39,7 +39,6 @@ let route = require('../../route.json');
class RefundNanoCreditUser extends Component {
constructor(props) {
super(props);
this.state = {

View File

@ -8,7 +8,16 @@ import 'moment/locale/en-nz';
import 'moment/locale/es-us';
import 'moment/locale/fr';
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 I18n from "react-native-i18n";
import Icon from 'react-native-vector-icons/MaterialIcons';
@ -19,6 +28,7 @@ import { Typography } from '../../config/typography';
import {readUser} from '../../webservice/AuthApi';
import {getNotificationAction, getNotificationReset} from '../../webservice/OnesignalApi';
import BaseScreen from './../BaseScreen';
const theme = require('./../../utils/theme.json');
let moment = require('moment-timezone');
@ -39,6 +49,7 @@ class Notifications extends BaseScreen {
/>
),
};
constructor(props) {
super(props);
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
@ -62,8 +73,7 @@ class Notifications extends BaseScreen {
agent_code: user.code_membre
});
}
}
else {
} else {
this.props.getNotificationAction({
user_code: user.user_code
});
@ -75,26 +85,36 @@ class Notifications extends BaseScreen {
}
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();
}
getNotificationTypeIcon = (notification) => {
switch (notification) {
case 'creation': return 'account-multiple-plus';
case 'demandeSuppressionGroupe': return 'account-multiple-minus';
case 'adhesion': return 'account-multiple-check'
case 'nano_credit': return 'cash'
default: return 'account-multiple'
case 'creation':
return 'account-multiple-plus';
case 'demandeSuppressionGroupe':
return 'account-multiple-minus';
case 'adhesion':
return 'account-multiple-check'
case 'nano_credit':
return 'cash'
default:
return 'account-multiple'
}
}
getDemandTypeColor = (type) => {
switch (type) {
case 'creation': return 'green';
case 'suppression': return 'red';
case 'adhesion': return Color.primaryColor
case 'nano_credit': return Color.primaryColor
case 'creation':
return 'green';
case 'suppression':
return 'red';
case 'adhesion':
return Color.primaryColor
case 'nano_credit':
return Color.primaryColor
default:
return Color.primaryColor
}
@ -148,8 +168,7 @@ class Notifications extends BaseScreen {
<Text style={Typography.body1}>{error.data.error}</Text>
</View>
)
}
else {
} else {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{error}</Text>

View File

@ -8,7 +8,7 @@
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 {responsiveFontSize, responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
import {primary, primaryDarkAdvanced} from './../../utils/theme.json';
@ -582,7 +582,7 @@ export default class OptionsMenu extends Component {
text: I18n.t('YES'), onPress: () => {
disconnect().then(() => {
IlinkEmitter.emit("userdisconnect");
//AsyncStorage.clear();
AsyncStorage.removeItem('@config:onesignalIds');
this.props.navigation.navigate("Auth");
})
}

View File

@ -23,6 +23,7 @@ import {bindActionCreators} from "redux";
import {getBankListAction, getBankListReset} from "../../webservice/BankApi";
import {store} from "../../redux/store";
import {readUser} from "../../webservice/AuthApi";
import {getOperatorListAction, getOperatorListReset} from "../../webservice/WalletApi";
const route = require('../../route.json');
let slugify = require('slugify');
@ -37,19 +38,32 @@ class OperateurOptionSelect extends Component {
options: this.props.navigation.state.params.optionSelect.options,
title: this.props.navigation.state.params.optionSelect.title,
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
operatorType: this.props.navigation.state.params.optionSelect.operatorType,
wallet: store.getState().walletDetailReducer.result.response
}
this.props.getBankListReset();
this.props.getOperatorListReset();
readUser().then((user) => {
if (user) {
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) {
this.props.getBankListAction(this.state.wallet.id_wallet_network);
this.props.getOperatorListAction('bank', this.state.wallet.id_wallet_network)
} else {
if (user.category === 'geolocated')
this.props.getBankListAction(this.state.wallet.id_network);
this.props.getOperatorListAction('bank', this.state.wallet.id_network)
}
}
this.setState({user});
}
}
@ -78,11 +92,20 @@ class OperateurOptionSelect extends Component {
});
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 = () => {
@ -113,10 +136,7 @@ class OperateurOptionSelect extends Component {
key={index}
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
onPress={() => {
if (this.state.user.category === 'geolocated')
this.props.navigation.navigate(route.envoieWalletToBankAgent, {bank: item});
else
this.props.navigation.navigate(route.envoieWalletToBankUser, {bank: item});
this.redirectToRoute(item);
}}>
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<View>
@ -161,7 +181,7 @@ class OperateurOptionSelect extends Component {
</ScrollView>) :
(
<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>
)
)
@ -240,9 +260,6 @@ class OperateurOptionSelect extends Component {
<View style={styles.container}>
{
this.state.options.length > 0 ?
this.renderList()
:
this.props.loading ?
this.renderLoader() :
this.props.result != null ?
@ -259,14 +276,18 @@ class OperateurOptionSelect extends Component {
}
const mapStateToProps = state => ({
loading: state.getBankListReducer.loading,
result: state.getBankListReducer.result,
error: state.getBankListReducer.error,
loading: state.getListOperatorReducer.loading,
result: state.getListOperatorReducer.result,
error: state.getListOperatorReducer.error,
});
const mapDispatchToProps = dispatch => bindActionCreators({
getBankListAction,
getBankListReset
getBankListReset,
getOperatorListAction,
getOperatorListReset
}, dispatch);
export default connect(mapStateToProps, mapDispatchToProps)(OperateurOptionSelect);

View File

@ -8,6 +8,7 @@ import { IlinkEmitter } from "../../utils/events";
import OutlineTextInput from '../../components/OutlineTextInput';
import CustomButton from '../../components/CustomButton';
import {ScrollView} from 'react-native-gesture-handler';
const route = require('../../route.json');
let slugify = require('slugify');
@ -50,7 +51,9 @@ export default class PaiementFacture extends Component {
switch (type) {
case 'PAIEMENT_ECOLE':
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')
case 'PAIEMENT_CREDIT_TELEPHONE':
return I18n.t('PHONE_NUMBER')
@ -75,7 +78,9 @@ export default class PaiementFacture extends Component {
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>
<Appbar.BackAction
onPress={() => { this.props.navigation.pop() }}
onPress={() => {
this.props.navigation.pop()
}}
/>
<Appbar.Content
title={this.state.title}
@ -108,7 +113,8 @@ export default class PaiementFacture extends Component {
<View style={{margin: 10}}>
<CustomButton outline onPress={() => { }}>
<CustomButton outline onPress={() => {
}}>
{I18n.t('VALIDATE')}
</CustomButton>
</View>

View File

@ -252,7 +252,7 @@ class WalletDetail extends Component {
}
getCreationDateToHumanFormat = (date) => {
let re = moment.tz(date, 'Etc/GMT+0').format();
let re = moment.tz(date, moment.tz.guess()).format();
return moment(re).fromNow();
}

View File

@ -106,10 +106,8 @@ class WalletDetailUser extends Component {
this.props.getWalletDetailActivated(this.props.navigation.state.params.userId, null);
this.props.getUserIdentificationResetAction();
this.willFocus = this.props.navigation.addListener(
'willFocus',
payload => {
readUser().then((user) => {
console.log("WIIL FOCUS CALL 1");
if (user) {
if (user !== undefined) {
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) => {
let re = moment.tz(date, 'Etc/GMT+0').format();
let re = moment.tz(date, moment.tz.guess()).format();
return moment(re).fromNow();
}

View File

@ -515,9 +515,54 @@ export const optionNanoCreditAgentScreen = {
]
}
export const optionPaiementEauElectricite = {
export const optionPaiementEau = {
title: 'PAIEMENT_FACTURE',
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: [
{
type: 'PAIEMENT_EAU_ELECTRICITE',
@ -561,6 +606,7 @@ export const optionPaiementEauElectricite = {
export const optionPaiementCreditTelephonique = {
title: 'PAIEMENT_FACTURE',
subTitle: 'CHOOSE_OPERATOR',
operatorType: 'phone',
options: [
{
type: 'PAIEMENT_CREDIT_TELEPHONE',
@ -604,6 +650,7 @@ export const optionPaiementCreditTelephonique = {
export const optionPaiementAbonnementTV = {
title: 'PAIEMENT_FACTURE',
subTitle: 'CHOOSE_OPERATOR',
operatorType: 'tv',
options: [
{
type: 'PAIEMENT_ABONNEMENT_TV',
@ -647,6 +694,7 @@ export const optionPaiementAbonnementTV = {
export const optionPaiementEcole = {
title: 'PAIEMENT_FACTURE',
subTitle: 'CHOOSE_OPERATOR',
operatorType: 'school',
options: [
{
type: 'PAIEMENT_ECOLE',
@ -695,9 +743,16 @@ export const optionPaiementFacture = {
{
type: 'FACTURE_WATER_ELECTRICITY',
icon: 'water',
title: 'PAIEMENT_EAU_ELECTRICITY',
title: 'PAIEMENT_EAU',
screen: route.operateurOptionSelect,
subScreenOption: optionPaiementEauElectricite
subScreenOption: optionPaiementEau
},
{
type: 'FACTURE_ELECTRICITY',
icon: 'water',
title: 'PAIEMENT_ELECTRICITY',
screen: route.operateurOptionSelect,
subScreenOption: optionPaiementElectricite
},
{
type: 'FACTURE_SCHOOL',

View File

@ -36,6 +36,7 @@
"MY_ACCOUNT": "My account",
"WALLET": "Wallet",
"NO_BANK_AVAILABLE": "No bank available",
"NO_OPERATOR_AVAILABLE": "No operator available",
"ENTER_VALID_AMOUNT": "Enter a valid amount",
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
"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",
"NANO_CREDIT": "Nano credit",
"NANO_CREDIT_LIST": "Nano credit list",
"SAVINGS_LIST": "Savings list",
"NO_NANO_CREDIT": "No nano credit demand",
"NANO_CREDIT_DESCRIPTION": "Nano credit description",
"NANO_SANTE": "Nano health",
@ -172,7 +174,8 @@
"CAUTIONNEMENT_DONE": "Caution done",
"ID_DEMAND": "Demand ID",
"DATE": "Date",
"PAIEMENT_EAU_ELECTRICITY": "Water/electricity bill",
"PAIEMENT_EAU_ELECTRICITY": "Water bill",
"PAIEMENT_ELECTRICITY": "Electricity bill",
"PAIEMENT_ECOLE": "School fees",
"PAIEMENT_CREDIT_TELEPHONIQUE": "Phone credit bills",
"PAIEMENT_ABONNEMENT_TV": "TV subscription",
@ -180,6 +183,7 @@
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
"DATE_REMBOURSEMENT": "Refund date",
"AMOUNT_REFUND": "Amount reimbursed",
"AMOUNT_WITHDRAWAL": "Amount withdrawal",
"AMOUNT_PARTIALLY_REFUND": "Amount partially refunded",
"FINAL_DATE": "End date",
"CASSATION_DATE": "Cassation date",

View File

@ -39,6 +39,7 @@
"DESTINATAIRE": "Destinataire",
"ERROR_LABEL": "Erreur",
"NO_BANK_AVAILABLE": "Aucune banque disponible",
"NO_OPERATOR_AVAILABLE": "Aucun opérateur disponible",
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
"SUCCESS": "Succès",
"ETAT": "Etat",
@ -165,6 +166,7 @@
"DEPOSIT_TO_BANK": "Votre Wallet vers banque",
"NANO_CREDIT": "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",
"NANO_CREDIT_DESCRIPTION": "Nano crédit iLink",
"NANO_SANTE": "Nano santé",
@ -178,7 +180,8 @@
"CAUTION_CREDIT": "Cautionner une demande de crédit",
"CAUTIONNEMENT_DONE": "Cautionnement effectué",
"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_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
@ -187,6 +190,7 @@
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
"DATE_REMBOURSEMENT": "Date de remboursement",
"AMOUNT_REFUND": "Montant remboursé",
"AMOUNT_WITHDRAWAL": "Montant retiré",
"AMOUNT_PARTIALLY_REFUND": "Montant partiellement remboursé",
"FINAL_DATE": "Date de fin",
"CASSATION_DATE": "Date de cassation",

View File

@ -72,6 +72,7 @@ export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets
export const getBankUrl = testBaseUrl + '/walletService/wallets/users/operators/bank';
export const getHistoryNanoPendingCreditUrl = testBaseUrl + '/walletService/groups/nanoCredit/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 videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";

View File

@ -33,7 +33,7 @@ import {
import {store} from "../redux/store";
import {
askNanoCreditUrl,
cancelDemandUrl,
cancelDemandUrl, getHistoryEpargnePendingUrl,
getHistoryNanoPendingCreditUrl,
getNanoCreditDemandDureationUrl,
groupUrl,
@ -282,9 +282,8 @@ export const getEpargneInProgressAction = (data) => {
dispatch(fetchGetEpargneInProgressPending());
axios({
url: `${getHistoryNanoPendingCreditUrl}`,
method: 'POST',
data,
url: `${getHistoryEpargnePendingUrl}/${data}`,
method: 'GET',
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()

View File

@ -1,10 +1,32 @@
import { walletActionUrl, commissionAmount, walletDetailUrl, walletUserSimpleActionUrl, linkCardUrl } from "./IlinkConstants";
import {
fetchWalletListPending, fetchWalletListSuccess, fetchWalletListError, fetchWalletListReset,
fetchWalletListDetailPending, fetchWalletListDetailSuccess, fetchWalletListDetailError, fetchWalletListDetailReset,
fetchWalletGetCommissionPending, fetchWalletGetCommissionSuccess, fetchWalleGetCommissionError, walletGetCommissionReset,
fetchLinkCardPending, fetchLinkCardSuccess, fetchLinkCardError, fetchLinkCardReset
commissionAmount,
getOperatorListUrl,
linkCardUrl,
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";
import {store} from "../redux/store";
import axios from "axios";
@ -167,3 +189,40 @@ export const linkCardReset = () => {
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());
}
}