wallet ok
This commit is contained in:
parent
a06dcff31a
commit
7d5c4a105e
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,7 @@
|
|||
"DEPOSIT_DESCRIPTION": "Make a deposit",
|
||||
"DEPOSIT": "Deposit",
|
||||
"CONFIRM_DEPOSIT": "Confirm deposit",
|
||||
"CONFIRM_WITHDRAWAL": "Confirm withdrawal",
|
||||
"CARD_NUMBER_LABEL": "Card number",
|
||||
"CARD_EXPIRY_LABEL": "Expiry.",
|
||||
"CARD_CVC_LABEL": "CVC/CCV",
|
||||
|
@ -60,7 +61,7 @@
|
|||
"CONFIRM_TRANSFER_COMMISSION": "Confirm commission transfer",
|
||||
"CREATION_DATE": "Creation date",
|
||||
"PRINCIPAL_ACCOUNT_TITLE": "Principal account",
|
||||
"NO_WALLET_ACTIVED": "PNo wallet is activated for your account",
|
||||
"NO_WALLET_ACTIVED": "No wallet is activated for your account",
|
||||
"TRANSFER_TO_PRINCIPAL_ACCOUNT": "Transfer commissions",
|
||||
"PRINCIPAL": "Principal",
|
||||
"ENTER_YOUR_CARD_ID": "Please enter your bank card ID",
|
||||
|
@ -112,6 +113,7 @@
|
|||
"COUNTRY_CHOICE": "Choose a country",
|
||||
"LAST_STEP": "Last step",
|
||||
"ACTIVE_ACCOUNT": "Activate the account !",
|
||||
"ACTIVE_USER": "Active",
|
||||
"LAST_STEP_TEXT": "Activate your account using the verification code that was sent to you on your e-mail address and on your phone number",
|
||||
"NETWORK_CHOICE": "Choix du réseau",
|
||||
"CHOICE_NETWORK_TEXT": "Define a network to display",
|
||||
|
@ -141,6 +143,7 @@
|
|||
"ERROR_FILTER": "Error occurred during the filter",
|
||||
"ERROR_LABLE": "Erreur",
|
||||
"ERROR_TRANSFER_COMMISSION": "Commissions transfer error",
|
||||
"TRANSFER_COMMISSION_IMPOSSIBLE": "Commissions transfer impossible",
|
||||
"ERROR_FILTER_TEXT": "Problem encountered while filtering.",
|
||||
"ERROR_TREATMENT_DEMAND": "Request processing error",
|
||||
"REFUSER_DEMANDE": "Reject the request",
|
||||
|
@ -200,6 +203,7 @@
|
|||
"ADD_SUCCESS_TEXT": "The number has been added to the network successfully",
|
||||
"MEMBER_CODE": "Member Code",
|
||||
"MEMBER_INFO": "Member Information",
|
||||
"NO_MEMBERS": "No registered members",
|
||||
"DEMAND_INFO": "Information on the request",
|
||||
"ACCOUNT_NOT_ACTIVE": "Your account is not activated",
|
||||
"ENTER_VALIDATION_CODE": "Enter the validation code that was sent to you.",
|
||||
|
@ -271,6 +275,7 @@
|
|||
"MAKE_REQUEST": "Make a request",
|
||||
"DATE_WRONG": "The end date can not be earlier than the start date",
|
||||
"LOADING_DOTS": "Loading...",
|
||||
"LOADING_PROGRESS": "Loading",
|
||||
"LOADING": "Loading",
|
||||
"EMPTY_LIST_REQUEST": "No request",
|
||||
"MEMBER_LIST": "List of members",
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
"WALLET": "Wallet",
|
||||
"DEPOSIT": "Dépôt",
|
||||
"CONFIRM_DEPOSIT": "Confirmer le dépôt",
|
||||
"CONFIRM_WITHDRAWAL": "Confirmer le retrait",
|
||||
"ENTER_VALID_AMOUNT": "Entrer un montant valide",
|
||||
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Entrer un montant supérieur à zero",
|
||||
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Montant supérieur à celui du compte principal de l'agent",
|
||||
|
@ -115,6 +116,7 @@
|
|||
"COUNTRY_CHOICE": "Choisissez un pays",
|
||||
"LAST_STEP": "Derniere étape",
|
||||
"ACTIVE_ACCOUNT": "Activez le compte !",
|
||||
"ACTIVE_USER": "Activer",
|
||||
"LAST_STEP_TEXT": "Activez votre compte à l'aide du code de validation qui vous a été envoyé sur votre adresse e-mail et sur votre numero de téléphone",
|
||||
"NETWORK_CHOICE": "Choix du réseau",
|
||||
"CHOICE_NETWORK_TEXT": "Definir un réseau à afficher",
|
||||
|
@ -144,6 +146,7 @@
|
|||
"ERROR_FILTER": "Erreur survenue lors du filtre",
|
||||
"ERROR_LABLE": "Erreur",
|
||||
"ERROR_TRANSFER_COMMISSION": "Erreur de transfert des commissions",
|
||||
"TRANSFER_COMMISSION_IMPOSSIBLE": "Transfert des commissions impossible",
|
||||
"ERROR_FILTER_TEXT": "Probleme rencontré lors du filtrage.",
|
||||
"ERROR_TREATMENT_DEMAND": "Erreur de traitement de la demande",
|
||||
"REFUSER_DEMANDE": "Refuser la demande",
|
||||
|
@ -201,6 +204,7 @@
|
|||
"MEMBER_CODE": "Code membre",
|
||||
"MEMBER_INFO": "Information du membre",
|
||||
"DEMAND_INFO": "Information sur la demande",
|
||||
"NO_MEMBERS": "Aucun membre enregistré",
|
||||
"ACCOUNT_NOT_ACTIVE": "Votre compte n'est pas activé",
|
||||
"ENTER_VALIDATION_CODE": "Saisissez le code de validation qui vous a été envoyé.",
|
||||
"ENTER_VALIDATION_CODE1": "Saisissez le code de validation.",
|
||||
|
|
|
@ -15,6 +15,7 @@ import 'moment/locale/en-ca'
|
|||
import 'moment/locale/en-ie'
|
||||
import 'moment/locale/en-il'
|
||||
import 'moment/locale/en-nz'
|
||||
import 'moment/locale/en-gb'
|
||||
|
||||
import DeviceInfo from 'react-native-device-info'
|
||||
import { Color } from '../../config/Color';
|
||||
|
@ -53,8 +54,8 @@ export class HistoryItem extends React.Component {
|
|||
var today = new Date();
|
||||
var l = this.props.selfData.date_creation;
|
||||
let t = this.props.selfData.status;
|
||||
let currentLocale = (DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : DeviceInfo.getDeviceLocale());
|
||||
moment.locale(currentLocale);
|
||||
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();
|
||||
re = moment(re)
|
||||
return {
|
||||
|
|
|
@ -240,6 +240,8 @@ class HistoryItemDetails extends Component {
|
|||
this.displayToast(resultTreatDemand.response);
|
||||
this.props.navigation.goBack();
|
||||
this.props.navigation.state.params.onGoBack();
|
||||
this.props.creditCancelResetReducer();
|
||||
this.props.creditDemandResetReducer();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,6 +252,8 @@ class HistoryItemDetails extends Component {
|
|||
this.displayToast(resultCancelDemand.response);
|
||||
this.props.navigation.goBack();
|
||||
this.props.navigation.state.params.onGoBack();
|
||||
this.props.creditCancelResetReducer();
|
||||
this.props.creditDemandResetReducer();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,19 +43,22 @@ export default class HistoryRequester extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = this.initState();
|
||||
this.updateState()
|
||||
this.updateState();
|
||||
}
|
||||
|
||||
|
||||
componentDidDisappear() {
|
||||
BackHandler.removeEventListener('hardwareBackPress', this.backPressed);
|
||||
|
||||
this.props.navigation.state.params.onGoBack();
|
||||
}
|
||||
|
||||
componentDidAppear() {
|
||||
BackHandler.addEventListener('hardwareBackPress', this.backPressed);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.navigation.state.params.onGoBack();
|
||||
}
|
||||
|
||||
handleViewRef = ref => this.numberView = ref;
|
||||
handleMontantRef = ref => this.montantView = ref;
|
||||
initState() {
|
||||
|
|
|
@ -25,7 +25,14 @@ import { readUser } from "../../webservice/AuthApi";
|
|||
import Calendar from 'react-native-calendario';
|
||||
let route = require('./../../route.json')
|
||||
import 'moment';
|
||||
import 'moment/locale/fr';
|
||||
import 'moment/locale/fr'
|
||||
import 'moment/locale/es-us'
|
||||
import 'moment/locale/en-au'
|
||||
import 'moment/locale/en-ca'
|
||||
import 'moment/locale/en-ie'
|
||||
import 'moment/locale/en-il'
|
||||
import 'moment/locale/en-nz'
|
||||
import 'moment/locale/en-gb'
|
||||
import moment from 'moment-timezone';
|
||||
let theme = require('./../../utils/theme.json')
|
||||
import { primary, primaryDark, accent, purpleLight, primaryLight } from './../../utils/theme.json';
|
||||
|
@ -39,6 +46,7 @@ import { Header } from "react-native-elements";
|
|||
import { withNavigationFocus } from "react-navigation";
|
||||
import IconWithBadge from "../IconWithBadge";
|
||||
import { Appbar, Paragraph, Menu, Divider, Provider } from 'react-native-paper';
|
||||
import DeviceInfo from 'react-native-device-info'
|
||||
class MyHistory extends React.Component {
|
||||
|
||||
static navigatorStyle = {
|
||||
|
@ -83,7 +91,8 @@ class MyHistory extends React.Component {
|
|||
});
|
||||
|
||||
this.navigation = this.props.navigation
|
||||
|
||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
||||
moment.locale(this.currentLocale);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1373,7 +1373,7 @@ class Home extends BaseScreen {
|
|||
barStyle="light-content"
|
||||
translucent={true}
|
||||
/>
|
||||
{this.state.loadingDialog ?
|
||||
{(this.state.loadingDialog || this.props.loading) ?
|
||||
<View
|
||||
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
|
||||
|
||||
|
|
|
@ -28,10 +28,11 @@ import 'moment/locale/en-ca'
|
|||
import 'moment/locale/en-ie'
|
||||
import 'moment/locale/en-il'
|
||||
import 'moment/locale/en-nz'
|
||||
import 'moment/locale/en-gb'
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import DeviceInfo from 'react-native-device-info'
|
||||
import { thousandsSeparators } from '../../utils/UtilsFunction';
|
||||
import DeviceInfo from 'react-native-device-info'
|
||||
|
||||
let route = require('./../../route.json');
|
||||
let slugify = require('slugify');
|
||||
|
@ -52,13 +53,15 @@ class WalletDetail extends Component {
|
|||
wallet: null,
|
||||
triggerTransferCommission: false,
|
||||
loading: false,
|
||||
isTriggerRefresh: false
|
||||
isTriggerRefresh: false,
|
||||
scrollHeaderY: 0
|
||||
};
|
||||
|
||||
this.renderContent = null;
|
||||
slugify.extend({ '+': 'plus' });
|
||||
|
||||
this.scrollY = new Animated.Value(0);
|
||||
this.scrollHeaderY = new Animated.Value(0);
|
||||
this.deltaY = new Animated.Value(0);
|
||||
this.bgBannerY = new Animated.Value(0);
|
||||
|
||||
|
@ -72,74 +75,82 @@ class WalletDetail extends Component {
|
|||
this.props.depositActionReset();
|
||||
this.props.resetWalletListDetailReducer();
|
||||
|
||||
this.currentLocale = (DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : DeviceInfo.getDeviceLocale());
|
||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
||||
moment.locale(this.currentLocale);
|
||||
|
||||
if (this.isHomeRootView) {
|
||||
let agentId = this.props.navigation.state.params.agentId;
|
||||
this.props.getWalletDetailActivated(agentId);
|
||||
this.props.getWalletDetailActivated(agentId, true);
|
||||
}
|
||||
else {
|
||||
this.props.getWalletDetailActivated(this.props.navigation.state.params.wallet.id, false);
|
||||
this.props.getWalletTransactionHistory(this.props.navigation.state.params.wallet.id);
|
||||
this.state.wallet = this.props.navigation.state.params.wallet;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static options(passProps) {
|
||||
return {
|
||||
topBar: {
|
||||
drawBehind: false,
|
||||
visible: true,
|
||||
animate: true,
|
||||
buttonColor: 'white',
|
||||
background: {
|
||||
color: 'white',
|
||||
/*
|
||||
static options(passProps) {
|
||||
return {
|
||||
topBar: {
|
||||
drawBehind: false,
|
||||
visible: true,
|
||||
animate: true,
|
||||
buttonColor: 'white',
|
||||
background: {
|
||||
color: 'white',
|
||||
},
|
||||
rightButtons: []
|
||||
},
|
||||
rightButtons: []
|
||||
},
|
||||
backButton: {
|
||||
visible: true,
|
||||
color: "white"
|
||||
},
|
||||
buttonColor: "white",
|
||||
background: {
|
||||
color: Color.primaryDarkColor
|
||||
},
|
||||
statusBar: {
|
||||
drawBehind: false,
|
||||
visible: true,
|
||||
}
|
||||
};
|
||||
}
|
||||
backButton: {
|
||||
visible: true,
|
||||
color: "white"
|
||||
},
|
||||
buttonColor: "white",
|
||||
background: {
|
||||
color: Color.primaryDarkColor
|
||||
},
|
||||
statusBar: {
|
||||
drawBehind: false,
|
||||
visible: true,
|
||||
}
|
||||
};
|
||||
}
|
||||
*/
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF'
|
||||
|
||||
static navigationOptions = ({ navigation }) => {
|
||||
};
|
||||
|
||||
static navigationOptions = () => {
|
||||
return {
|
||||
//title: I18n.t('WALLET'),
|
||||
//title: this.isHomeRootView ? I18n.t('WALLET') : ((typeof this.props.navigation.state.params !== 'undefined') && this.props.navigation.state.params.wallet.network),
|
||||
drawerLabel: () => null,
|
||||
headerTitle: I18n.t('WALLET'),
|
||||
headerTintColor: 'white',
|
||||
headerStyle: {
|
||||
backgroundColor: Color.primaryColor,
|
||||
paddingTop: 10
|
||||
marginTop: 23,
|
||||
color: 'white'
|
||||
},
|
||||
headerTitleStyle: {
|
||||
color: "white"
|
||||
}
|
||||
},
|
||||
title: I18n.t('WALLET')
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
const { result } = this.props;
|
||||
|
||||
if (this.isHomeRootView) {
|
||||
if (result !== null) {
|
||||
if (typeof result.response !== 'undefined') {
|
||||
const wallet = result.response[0];
|
||||
this.setState({
|
||||
wallet: wallet,
|
||||
isTriggerRefresh: false
|
||||
})
|
||||
}
|
||||
if (result !== null) {
|
||||
if (typeof result.response !== 'undefined') {
|
||||
const wallet = result.response[0];
|
||||
this.setState({
|
||||
wallet: wallet,
|
||||
isTriggerRefresh: false
|
||||
})
|
||||
}
|
||||
}
|
||||
/*else {
|
||||
|
@ -169,17 +180,17 @@ class WalletDetail extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
if (nextProps.loading || nextProps.loadingTransferCommission)
|
||||
this.setState({
|
||||
loading: true
|
||||
})
|
||||
else
|
||||
this.setState({
|
||||
loading: false
|
||||
})
|
||||
}
|
||||
/* componentWillReceiveProps(nextProps) {
|
||||
|
||||
if (nextProps.loading || nextProps.loadingTransferCommission)
|
||||
this.setState({
|
||||
loading: true
|
||||
})
|
||||
else
|
||||
this.setState({
|
||||
loading: false
|
||||
})
|
||||
} */
|
||||
|
||||
isEmptyObject = (obj) => {
|
||||
for (let prop in obj) {
|
||||
|
@ -224,36 +235,34 @@ class WalletDetail extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
bgBannerY = () => {
|
||||
bgHeaderTranslateY = () => {
|
||||
return this.scrollY.interpolate({
|
||||
inputRange: [0, 100],
|
||||
outputRange: [150, 0],
|
||||
inputRange: [0, 150],
|
||||
outputRange: [-5, 0],
|
||||
extrapolate: 'clamp',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
refresh = () => {
|
||||
const { result } = this.props;
|
||||
console.log("STATE NAVIGATION PARAMS REFRESH", this.props.navigation.state);
|
||||
|
||||
if (!this.isHomeRootView) {
|
||||
const { wallet } = this.props.navigation.state.params;
|
||||
this.props.getWalletDetailActivated(wallet.agentId);
|
||||
this.props.getWalletDetailActivated(wallet.id, false);
|
||||
this.props.getWalletTransactionHistory(wallet.id);
|
||||
this.setState({
|
||||
isTriggerRefresh: true
|
||||
});
|
||||
|
||||
if (typeof this.props.navigation.state.params.onRefreshDetail !== 'undefined')
|
||||
this.props.navigation.state.params.onRefreshDetail();
|
||||
/* if (typeof this.props.navigation.state.params.onRefreshDetail !== 'undefined')
|
||||
this.props.navigation.state.params.onRefreshDetail(); */
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
const wallet = Array.isArray(result.response) && result.response[0];
|
||||
let agentId = this.props.navigation.state.params.agentId;
|
||||
this.props.getWalletDetailActivated(agentId);
|
||||
this.props.getWalletTransactionHistory(wallet.id);
|
||||
this.props.getWalletDetailActivated(agentId, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -299,7 +308,6 @@ class WalletDetail extends Component {
|
|||
zIndex: 11,
|
||||
shadowColor: Color.borderColor,
|
||||
borderColor: Color.borderColor,
|
||||
|
||||
}
|
||||
]}>
|
||||
<View style={[styles.contentLeftItem]}>
|
||||
|
@ -343,11 +351,9 @@ class WalletDetail extends Component {
|
|||
if (result !== null) {
|
||||
if (typeof result.response !== 'undefined') {
|
||||
|
||||
const wallet = Array.isArray(result.response) ? result.response[0] : result.response.filter((item) => item.id === this.state.wallet.id)
|
||||
|
||||
if (parseInt(wallet.balance_com) === 0) {
|
||||
if (parseInt(result.response.balance_com) === 0) {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_TRANSFER_COMMISSION"),
|
||||
I18n.t("TRANSFER_COMMISSION_IMPOSSIBLE"),
|
||||
I18n.t("COMMISSION_TRANSFER_ERROR_EMPTY"),
|
||||
[
|
||||
{
|
||||
|
@ -365,24 +371,24 @@ class WalletDetail extends Component {
|
|||
|
||||
}
|
||||
|
||||
else {
|
||||
if (parseInt(this.state.wallet.balance_com) === 0) {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_TRANSFER_COMMISSION"),
|
||||
I18n.t("COMMISSION_TRANSFER_ERROR_EMPTY"),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.resetCommissionReducer();
|
||||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
else
|
||||
this.renderDialogConfirmTransferCommission()
|
||||
}
|
||||
/* else {
|
||||
if (parseInt(this.state.wallet.balance_com) === 0) {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_TRANSFER_COMMISSION"),
|
||||
I18n.t("COMMISSION_TRANSFER_ERROR_EMPTY"),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.resetCommissionReducer();
|
||||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
else
|
||||
this.renderDialogConfirmTransferCommission()
|
||||
} */
|
||||
}}>
|
||||
{I18n.t('TRANSFER_TO_PRINCIPAL_ACCOUNT')}
|
||||
</Tag>
|
||||
|
@ -468,21 +474,19 @@ class WalletDetail extends Component {
|
|||
</View>
|
||||
);
|
||||
|
||||
renderDetailWallet = (walletParam) => {
|
||||
|
||||
const wallet = Array.isArray(walletParam) ? walletParam[0] : walletParam;
|
||||
|
||||
renderDetailWallet = (wallet) => {
|
||||
console.log("WALLET SEND", wallet);
|
||||
return (
|
||||
|
||||
!this.isEmptyObject(wallet) ?
|
||||
(<>
|
||||
{this.state.triggerTransferCommission && this.renderDialogTransferCommissionResponse()}
|
||||
{this.state.loading ?
|
||||
{/* {this.state.loading ?
|
||||
<View
|
||||
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loading ? responsiveWidth(100) : 0, height: this.state.loading ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Text style={{ fontSize: 20, color: 'white', fontWeight: 'bold' }}>{I18n.t("LOADING_DOTS")}</Text>
|
||||
</View> : null
|
||||
}
|
||||
} */}
|
||||
|
||||
<View
|
||||
style={styles.container}>
|
||||
|
@ -492,7 +496,7 @@ class WalletDetail extends Component {
|
|||
width: "100%",
|
||||
zIndex: 1,
|
||||
backgroundColor: Color.primaryColor,
|
||||
height: 150
|
||||
height: 140 - this.state.scrollHeaderY,
|
||||
}} />
|
||||
|
||||
<ScrollView style={{
|
||||
|
@ -508,7 +512,8 @@ class WalletDetail extends Component {
|
|||
contentOffset: { y: this.scrollY },
|
||||
},
|
||||
},
|
||||
])}>
|
||||
],
|
||||
{ listener: (event) => { this.setState({ scrollHeaderY: event.nativeEvent.contentOffset.y }); } })}>
|
||||
<View style={{ marginTop: 80, }}>
|
||||
|
||||
{this.renderHeader(wallet)}
|
||||
|
@ -733,7 +738,15 @@ class WalletDetail extends Component {
|
|||
},
|
||||
{
|
||||
text: I18n.t("YES"), onPress: () => {
|
||||
this.props.transferCommissionAction(this.state.wallet.id);
|
||||
const { result } = this.props;
|
||||
if (result !== null) {
|
||||
if (typeof result.response !== 'undefined') {
|
||||
this.props.transferCommissionAction(result.response.id);
|
||||
}
|
||||
}/*
|
||||
else
|
||||
this.props.transferCommissionAction(this.state.wallet.id); */
|
||||
|
||||
this.setState({
|
||||
triggerTransferCommission: true
|
||||
});
|
||||
|
@ -785,46 +798,38 @@ class WalletDetail extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
getWalletParam = () => {
|
||||
const { result } = this.props;
|
||||
const isHomeRootView = this.props.navigation.state.params.hasOwnProperty('agentId');
|
||||
|
||||
if (!isHomeRootView)
|
||||
return this.props.navigation.state.params.wallet;
|
||||
else
|
||||
return this.props.response.filter((item) => item.id === this.state.wallet.id);
|
||||
}
|
||||
|
||||
render() {
|
||||
const isHomeRootView = this.props.navigation.state.params.hasOwnProperty('agentId');
|
||||
console.log("WALLET DETAILS PROPS", this.props);
|
||||
/*console.log("isHomeRootView", isHomeRootView);
|
||||
console.log("this.props.loading || this.props.loadingTransferCommission", this.props.loading || this.props.loadingTransferCommission); */
|
||||
const isHomeRootView = this.isHomeRootView;
|
||||
/*console.log("WALLET DETAILS PROPS", this.props);
|
||||
console.log("isHomeRootView", isHomeRootView);
|
||||
console.log("this.props.loading || this.props.loadingTransferCommission", this.props.loading || this.props.loadingTransferCommission);
|
||||
console.log(this.state.scrollHeaderY);*/
|
||||
|
||||
return (
|
||||
<>
|
||||
<StatusBar
|
||||
backgroundColor={Color.primaryDarkColor}
|
||||
barStyle="light-content"
|
||||
translucent={true}
|
||||
/>
|
||||
{
|
||||
!isHomeRootView ? (
|
||||
((this.props.loading || this.props.loadingTransferCommission) ?
|
||||
this.renderLoader() :
|
||||
(
|
||||
this.props.result !== null ?
|
||||
|
||||
(this.props.loading || this.props.loadingTransferCommission) ?
|
||||
Array.isArray(this.props.result.response) && (this.props.result.response.length) === 0 ?
|
||||
|
||||
this.renderDetailWallet(this.getWalletParam()) : (
|
||||
((this.props.result !== null)) ?
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
|
||||
</View>
|
||||
:
|
||||
|
||||
this.renderDetailWallet(this.props.result.response.filter((item) => item.id === this.state.wallet.id)) :
|
||||
|
||||
this.renderDetailWallet(this.props.navigation.state.params.wallet)
|
||||
|
||||
)
|
||||
|
||||
) :
|
||||
((this.props.loading || this.props.loadingTransferCommission) ?
|
||||
this.renderLoader() :
|
||||
(
|
||||
this.props.result !== null &&
|
||||
this.renderDetailWallet(this.props.result.response)
|
||||
)
|
||||
this.renderDetailWallet(this.props.result.response)
|
||||
:
|
||||
null
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ class WalletRetrait extends Component {
|
|||
|
||||
<Dialog.Container useNativeDriver={true} visible={this.state.isModalConfirmVisible}>
|
||||
|
||||
<Dialog.Title>{I18n.t('CONFIRM_DEPOSIT')}</Dialog.Title>
|
||||
<Dialog.Title>{I18n.t('CONFIRM_WITHDRAWAL')}</Dialog.Title>
|
||||
|
||||
<View>
|
||||
|
||||
|
|
|
@ -61,18 +61,18 @@ class WalletSelect extends Component {
|
|||
|
||||
}
|
||||
|
||||
refresh() {
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
if (user.phone !== undefined) {
|
||||
this.props.getWalletActivated(user.agentId);
|
||||
this.setState({ agentId: user.agentId });
|
||||
/* refresh() {
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
if (user.phone !== undefined) {
|
||||
this.props.getWalletActivated(user.agentId);
|
||||
this.setState({ agentId: user.agentId });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} */
|
||||
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
||||
|
@ -110,8 +110,8 @@ class WalletSelect extends Component {
|
|||
key={item.id}
|
||||
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}
|
||||
onPress={() => this.props.navigation.navigate('walletDetail', {
|
||||
wallet: itemToSend,
|
||||
onRefreshDetail: () => this.refresh()
|
||||
wallet: itemToSend,/*
|
||||
onRefreshDetail: () => this.refresh() */
|
||||
})}>
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||
<View style={styles.iconContent}>
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
"DEPOSIT_DESCRIPTION": "Make a deposit",
|
||||
"DEPOSIT": "Deposit",
|
||||
"CONFIRM_DEPOSIT": "Confirm deposit",
|
||||
"CONFIRM_WITHDRAWAL": "Confirm withdrawal",
|
||||
"CARD_NUMBER_LABEL": "Card number",
|
||||
"CARD_EXPIRY_LABEL": "Expiry.",
|
||||
"CARD_CVC_LABEL": "CVC/CCV",
|
||||
|
@ -60,7 +61,7 @@
|
|||
"CONFIRM_TRANSFER_COMMISSION": "Confirm commission transfer",
|
||||
"CREATION_DATE": "Creation date",
|
||||
"PRINCIPAL_ACCOUNT_TITLE": "Principal account",
|
||||
"NO_WALLET_ACTIVED": "PNo wallet is activated for your account",
|
||||
"NO_WALLET_ACTIVED": "No wallet is activated for your account",
|
||||
"TRANSFER_TO_PRINCIPAL_ACCOUNT": "Transfer commissions",
|
||||
"PRINCIPAL": "Principal",
|
||||
"ENTER_YOUR_CARD_ID": "Please enter your bank card ID",
|
||||
|
@ -112,6 +113,7 @@
|
|||
"COUNTRY_CHOICE": "Choose a country",
|
||||
"LAST_STEP": "Last step",
|
||||
"ACTIVE_ACCOUNT": "Activate the account !",
|
||||
"ACTIVE_USER": "Active",
|
||||
"LAST_STEP_TEXT": "Activate your account using the verification code that was sent to you on your e-mail address and on your phone number",
|
||||
"NETWORK_CHOICE": "Choix du réseau",
|
||||
"CHOICE_NETWORK_TEXT": "Define a network to display",
|
||||
|
@ -141,6 +143,7 @@
|
|||
"ERROR_FILTER": "Error occurred during the filter",
|
||||
"ERROR_LABLE": "Erreur",
|
||||
"ERROR_TRANSFER_COMMISSION": "Commissions transfer error",
|
||||
"TRANSFER_COMMISSION_IMPOSSIBLE": "Commissions transfer impossible",
|
||||
"ERROR_FILTER_TEXT": "Problem encountered while filtering.",
|
||||
"ERROR_TREATMENT_DEMAND": "Request processing error",
|
||||
"REFUSER_DEMANDE": "Reject the request",
|
||||
|
@ -200,6 +203,7 @@
|
|||
"ADD_SUCCESS_TEXT": "The number has been added to the network successfully",
|
||||
"MEMBER_CODE": "Member Code",
|
||||
"MEMBER_INFO": "Member Information",
|
||||
"NO_MEMBERS": "No registered members",
|
||||
"DEMAND_INFO": "Information on the request",
|
||||
"ACCOUNT_NOT_ACTIVE": "Your account is not activated",
|
||||
"ENTER_VALIDATION_CODE": "Enter the validation code that was sent to you.",
|
||||
|
@ -271,6 +275,7 @@
|
|||
"MAKE_REQUEST": "Make a request",
|
||||
"DATE_WRONG": "The end date can not be earlier than the start date",
|
||||
"LOADING_DOTS": "Loading...",
|
||||
"LOADING_PROGRESS": "Loading",
|
||||
"LOADING": "Loading",
|
||||
"EMPTY_LIST_REQUEST": "No request",
|
||||
"MEMBER_LIST": "List of members",
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
"WALLET": "Wallet",
|
||||
"DEPOSIT": "Dépôt",
|
||||
"CONFIRM_DEPOSIT": "Confirmer le dépôt",
|
||||
"CONFIRM_WITHDRAWAL": "Confirmer le retrait",
|
||||
"ENTER_VALID_AMOUNT": "Entrer un montant valide",
|
||||
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Entrer un montant supérieur à zero",
|
||||
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Montant supérieur à celui du compte principal de l'agent",
|
||||
|
@ -115,6 +116,7 @@
|
|||
"COUNTRY_CHOICE": "Choisissez un pays",
|
||||
"LAST_STEP": "Derniere étape",
|
||||
"ACTIVE_ACCOUNT": "Activez le compte !",
|
||||
"ACTIVE_USER": "Activer",
|
||||
"LAST_STEP_TEXT": "Activez votre compte à l'aide du code de validation qui vous a été envoyé sur votre adresse e-mail et sur votre numero de téléphone",
|
||||
"NETWORK_CHOICE": "Choix du réseau",
|
||||
"CHOICE_NETWORK_TEXT": "Definir un réseau à afficher",
|
||||
|
@ -144,6 +146,7 @@
|
|||
"ERROR_FILTER": "Erreur survenue lors du filtre",
|
||||
"ERROR_LABLE": "Erreur",
|
||||
"ERROR_TRANSFER_COMMISSION": "Erreur de transfert des commissions",
|
||||
"TRANSFER_COMMISSION_IMPOSSIBLE": "Transfert des commissions impossible",
|
||||
"ERROR_FILTER_TEXT": "Probleme rencontré lors du filtrage.",
|
||||
"ERROR_TREATMENT_DEMAND": "Erreur de traitement de la demande",
|
||||
"REFUSER_DEMANDE": "Refuser la demande",
|
||||
|
@ -201,6 +204,7 @@
|
|||
"MEMBER_CODE": "Code membre",
|
||||
"MEMBER_INFO": "Information du membre",
|
||||
"DEMAND_INFO": "Information sur la demande",
|
||||
"NO_MEMBERS": "Aucun membre enregistré",
|
||||
"ACCOUNT_NOT_ACTIVE": "Votre compte n'est pas activé",
|
||||
"ENTER_VALIDATION_CODE": "Saisissez le code de validation qui vous a été envoyé.",
|
||||
"ENTER_VALIDATION_CODE1": "Saisissez le code de validation.",
|
||||
|
|
|
@ -19,6 +19,7 @@ export const locationActionUrl = baseUrl + '/interacted/LocationAction.php';
|
|||
export const demandeActionUrl = baseUrl + '/interacted/DemandeAction.php';
|
||||
export const configActionUrl = baseUrl + '/interacted/ConfigAction.php';
|
||||
export const walletActionUrl = testBaseUrl + '/walletService/wallets';
|
||||
export const walletDetailUrl = testBaseUrl + '/walletService/wallets';
|
||||
export const creditTreatDemand = testBaseUrl + '/walletService/credits/treatDemand';
|
||||
export const creditCancelDemand = testBaseUrl + '/walletService/credits/cancelDemand';
|
||||
export const commissionAmount = testBaseUrl + '/walletService/transactions/commission';
|
||||
|
|
|
@ -1,54 +1,55 @@
|
|||
import React, { Component } from 'react';
|
||||
import {readUser} from './AuthApi'
|
||||
import { readUser } from './AuthApi'
|
||||
|
||||
var DBEvents=require('react-native-db-models').DBEvents;
|
||||
var db=require('./persistences/db.js');
|
||||
var DBEvents = require('react-native-db-models').DBEvents;
|
||||
var db = require('./persistences/db.js');
|
||||
import I18n from 'react-native-i18n'
|
||||
import {isDebugMode,adhesionUrl,locationActionUrl,memberActionUrl,networkActionUrl,demandeActionUrl} from "./IlinkConstants"
|
||||
import { isDebugMode, adhesionUrl, locationActionUrl, memberActionUrl, networkActionUrl, demandeActionUrl } from "./IlinkConstants"
|
||||
|
||||
var serializeJSON = function(data) {
|
||||
return Object.keys(data).map(function (keyName) {
|
||||
return encodeURIComponent(keyName) + '=' + encodeURIComponent(data[keyName])
|
||||
}).join('&');
|
||||
var serializeJSON = function (data) {
|
||||
return Object.keys(data).map(function (keyName) {
|
||||
return encodeURIComponent(keyName) + '=' + encodeURIComponent(data[keyName])
|
||||
}).join('&');
|
||||
}
|
||||
|
||||
export const listAllMembers=async ()=> {
|
||||
const user=await readUser()
|
||||
if(user!==null){
|
||||
let la= I18n.currentLocale()
|
||||
let data={"tag":"member",
|
||||
"id":user['member_code'],
|
||||
export const listAllMembers = async () => {
|
||||
const user = await readUser()
|
||||
if (user !== null) {
|
||||
let la = I18n.currentLocale()
|
||||
let data = {
|
||||
"tag": "member",
|
||||
"id": user.code_membre,
|
||||
la,
|
||||
"test":isDebugMode,
|
||||
"codeparrain":user.code_membre
|
||||
,"type":'all_geolocated'};
|
||||
"test": isDebugMode,
|
||||
"codeparrain": user.code_membre
|
||||
, "type": 'all_geolocated'
|
||||
};
|
||||
|
||||
console.log("DATA to SEND", data);
|
||||
|
||||
|
||||
const response=await fetch(memberActionUrl,{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
const response = await fetch(memberActionUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
let responseText=""
|
||||
try{
|
||||
responseText=await response.text()
|
||||
return JSON.parse(responseText)
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
console.log("error when liste member",responseText)
|
||||
let er={
|
||||
error:-3,
|
||||
content:e,
|
||||
text:responseText
|
||||
}
|
||||
return er;
|
||||
}
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
let responseText = ""
|
||||
try {
|
||||
responseText = await response.text()
|
||||
return JSON.parse(responseText)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
console.log("error when liste member", responseText)
|
||||
let er = {
|
||||
error: -3,
|
||||
content: e,
|
||||
text: responseText
|
||||
}
|
||||
return er;
|
||||
}
|
||||
|
||||
}
|
||||
return null
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import { walletActionUrl, commissionAmount } from "./IlinkConstants";
|
||||
import { walletActionUrl, commissionAmount, walletDetailUrl } from "./IlinkConstants";
|
||||
import { fetchWalletListPending, fetchWalletListSuccess, fetchWalletListError, fetchWalletListReset, fetchWalletListDetailPending, fetchWalletListDetailSuccess, fetchWalletListDetailError, fetchWalletListDetailReset, fetchWalletGetCommissionPending, fetchWalletGetCommissionSuccess, fetchWalleGetCommissionError, walletGetCommissionReset } from "../redux/actions/WalletActions";
|
||||
import { store } from "../redux/store";
|
||||
import axios from "axios";
|
||||
|
@ -41,16 +41,17 @@ export const resetWalletListReducer = () => {
|
|||
}
|
||||
}
|
||||
|
||||
export const getWalletDetailActivated = (userID) => {
|
||||
export const getWalletDetailActivated = (id, isAgentCall) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
const url = isAgentCall ? `${walletActionUrl}/${id}/activated` : `${walletDetailUrl}/${id}`;
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchWalletListDetailPending());
|
||||
|
||||
axios({
|
||||
url: `${walletActionUrl}/${userID}/activated`,
|
||||
url,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': authKey
|
||||
|
|
Loading…
Reference in New Issue