wallet user ok
This commit is contained in:
parent
21f51c7cf5
commit
a95339a81b
7
App.js
7
App.js
|
@ -49,6 +49,7 @@ import WalletDepot from './screens/wallet/WalletDepot';
|
|||
import WalletRetrait from './screens/wallet/WalletRetrait';
|
||||
import CreateIdentification from './screens/identification/createIdentification';
|
||||
import WalletDetailUser from './screens/wallet/WalletDetailUser';
|
||||
import WalletOptionSelect from './screens/wallet/WalletOptionSelect';
|
||||
|
||||
const instructions = Platform.select({
|
||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||
|
@ -86,7 +87,8 @@ const AppStack = createDrawerNavigator({
|
|||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetailUser: WalletDetailUser
|
||||
walletDetailUser: WalletDetailUser,
|
||||
walletOptionSelect: WalletOptionSelect
|
||||
|
||||
})
|
||||
}, { contentComponent: OptionsMenu, headerMode: 'none', contentOptions: { activeTintColor: theme.accent } })
|
||||
|
@ -137,7 +139,8 @@ const AppAgentStack = createDrawerNavigator({
|
|||
about: About,
|
||||
walletDetail: WalletDetail,
|
||||
walletDepot: WalletDepot,
|
||||
walletRetrait: WalletRetrait
|
||||
walletRetrait: WalletRetrait,
|
||||
walletOptionSelect: WalletOptionSelect
|
||||
})
|
||||
}, {
|
||||
contentComponent: OptionsMenu,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"release-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/ && rm -rf android/app/src/main/res/drawable-* && rm -rf android/app/src/main/res/raw/* && cd android && ./gradlew assembleRelease && cd .. && adb install android/app/build/outputs/apk/release/app-release.apk",
|
||||
"debug-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ && cd android && ./gradlew assembleDebug && cd .. && adb install android/app/build/outputs/apk/debug/app-debug.apk",
|
||||
"start-emulator": "emulator -avd Nexus_5X_API_R -dns-server 8.8.8.8",
|
||||
"start-emulator-pixel": "emulator -avd Pixel_2_API_29_1 -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"
|
||||
},
|
||||
|
|
67
route.json
67
route.json
|
@ -1,35 +1,36 @@
|
|||
{
|
||||
"discover": "ILink",
|
||||
"stackRoot": "stackcenter",
|
||||
"historiques": "Historique",
|
||||
"options": "menu",
|
||||
"drawer": "drawer",
|
||||
"credrequester": "creditrequest",
|
||||
"login": "Login",
|
||||
"first": "Home",
|
||||
"typeaccountcreate": "typeaccountcreate",
|
||||
"simpleusercreate": "simpleusercreate",
|
||||
"splashscreen": "spashscreen",
|
||||
"useraccount": "useraccount",
|
||||
"configurations": "configuration",
|
||||
"notification": "notification",
|
||||
"modalhistoryfilter": "filterhistory",
|
||||
"superviseurgroup": "superviseurgroup",
|
||||
"historyItemDetails": "historyItemDetails",
|
||||
"forgotpass": "forgottenpass",
|
||||
"confirmcode": "confirmcode",
|
||||
"creationstep2": "step2",
|
||||
"help": "help",
|
||||
"modaloading": "modaloading",
|
||||
"activateaccount": "activateaccout",
|
||||
"addNetwork": "addNetwork",
|
||||
"notificationView": "notificationview",
|
||||
"generateNetwork": "generateNetwork",
|
||||
"helpmenu": "helpMenu",
|
||||
"updateinfo": "updateinformation",
|
||||
"intersticielAds": "intersticielAds",
|
||||
"walletDetail": "walletDetail",
|
||||
"walletDepot": "walletDepot",
|
||||
"walletRetrait": "walletRetrait",
|
||||
"walletSelect": "walletSelect"
|
||||
"discover": "ILink",
|
||||
"stackRoot": "stackcenter",
|
||||
"historiques": "Historique",
|
||||
"options": "menu",
|
||||
"drawer": "drawer",
|
||||
"credrequester": "creditrequest",
|
||||
"login": "Login",
|
||||
"first": "Home",
|
||||
"typeaccountcreate": "typeaccountcreate",
|
||||
"simpleusercreate": "simpleusercreate",
|
||||
"splashscreen": "spashscreen",
|
||||
"useraccount": "useraccount",
|
||||
"configurations": "configuration",
|
||||
"notification": "notification",
|
||||
"modalhistoryfilter": "filterhistory",
|
||||
"superviseurgroup": "superviseurgroup",
|
||||
"historyItemDetails": "historyItemDetails",
|
||||
"forgotpass": "forgottenpass",
|
||||
"confirmcode": "confirmcode",
|
||||
"creationstep2": "step2",
|
||||
"help": "help",
|
||||
"modaloading": "modaloading",
|
||||
"activateaccount": "activateaccout",
|
||||
"addNetwork": "addNetwork",
|
||||
"notificationView": "notificationview",
|
||||
"generateNetwork": "generateNetwork",
|
||||
"helpmenu": "helpMenu",
|
||||
"updateinfo": "updateinformation",
|
||||
"intersticielAds": "intersticielAds",
|
||||
"walletDetail": "walletDetail",
|
||||
"walletDepot": "walletDepot",
|
||||
"walletRetrait": "walletRetrait",
|
||||
"walletSelect": "walletSelect",
|
||||
"walletOptionSelect": "walletOptionSelect"
|
||||
}
|
|
@ -177,6 +177,7 @@ class Home extends BaseScreen {
|
|||
}); */
|
||||
|
||||
readUser().then((user) => {
|
||||
console.log("USER", user);
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
if (user.phone !== undefined)
|
||||
|
@ -1388,13 +1389,14 @@ class Home extends BaseScreen {
|
|||
barStyle="light-content"
|
||||
translucent={true}
|
||||
/>
|
||||
{(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' }}
|
||||
{/* {
|
||||
(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' }}
|
||||
|
||||
>
|
||||
<Text style={{ fontSize: 20, color: 'white', fontWeight: 'bold' }}>{I18n.t("LOADING_DOTS")}</Text>
|
||||
</View> : null
|
||||
>
|
||||
<Text style={{ fontSize: 20, color: 'white', fontWeight: 'bold' }}>{I18n.t("LOADING_DOTS")}</Text>
|
||||
</View> : null
|
||||
}
|
||||
|
||||
<IMap
|
||||
|
@ -1424,6 +1426,7 @@ class Home extends BaseScreen {
|
|||
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
||||
}}
|
||||
/>
|
||||
*/}
|
||||
{this.makeCardSearch()}
|
||||
{this.makeSlidingUp()}
|
||||
{this.makeDialogLoader()}
|
||||
|
|
|
@ -251,7 +251,8 @@ export default class OptionsMenu extends Component {
|
|||
|
||||
}
|
||||
_renderItem = (item) => {
|
||||
if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks' || item === 'walletDetail' || item === 'walletDetailUser' || item === 'walletDepot' || item === 'walletRetrait' || item === 'createIdentification') {
|
||||
if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks' || item === 'walletDetail' || item === 'walletDetailUser'
|
||||
|| item === 'walletDepot' || item === 'walletRetrait' || item === 'createIdentification' || item === 'walletOptionSelect') {
|
||||
return null
|
||||
} else {
|
||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||
|
|
|
@ -10,7 +10,6 @@ import CustomButton from '../../components/CustomButton';
|
|||
import { Color } from '../../config/Color';
|
||||
import Tag from '../../components/Tag';
|
||||
import { IlinkEmitter } from "../../utils/events";
|
||||
import { CreditCardInput } from "react-native-credit-card-input";
|
||||
import { Typography, FontWeight } from '../../config/typography';
|
||||
import { responsiveHeight, responsiveWidth, } from 'react-native-responsive-dimensions';
|
||||
import { getWalletDetailActivated, resetWalletListDetailReducer } from '../../webservice/WalletApi';
|
||||
|
@ -18,7 +17,7 @@ import { depositActionReset } from '../../webservice/DepositApi';
|
|||
import { getWalletTransactionHistory, getWalletTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi';
|
||||
import { transferCommissionAction } from '../../webservice/WalletTransferCommission';
|
||||
import { resetCommissionReducer } from '../../webservice/WalletTransferCommission';
|
||||
import Dialog, { DialogContent, DialogTitle, DialogFooter, DialogButton } from 'react-native-popup-dialog';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import { baseUrl } from '../../webservice/IlinkConstants';
|
||||
let moment = require('moment-timezone');
|
||||
import 'moment/locale/fr'
|
||||
|
@ -31,7 +30,7 @@ import 'moment/locale/en-nz'
|
|||
import 'moment/locale/en-gb'
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { thousandsSeparators, isEmptyObject } from '../../utils/UtilsFunction';
|
||||
import { thousandsSeparators, isEmptyObject, isIlinkWorldWallet, optionDepotScreen, optionRetraitScreen } from '../../utils/UtilsFunction';
|
||||
import DeviceInfo from 'react-native-device-info'
|
||||
|
||||
let route = require('./../../route.json');
|
||||
|
@ -464,7 +463,7 @@ class WalletDetail extends Component {
|
|||
);
|
||||
|
||||
renderDetailWallet = (wallet) => {
|
||||
console.log("WALLET SEND", wallet);
|
||||
console.log("WALLET NAME SLUGIFY", slugify(wallet.network));
|
||||
return (
|
||||
|
||||
!isEmptyObject(wallet) ?
|
||||
|
@ -526,10 +525,20 @@ class WalletDetail extends Component {
|
|||
<View style={[styles.containerTouch]}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => this.props.navigation.push(route.walletDepot, {
|
||||
wallet,
|
||||
onGoBack: () => this.refresh(),
|
||||
})}
|
||||
onPress={() => {
|
||||
if (isIlinkWorldWallet(wallet.network)) {
|
||||
this.props.navigation.push(route.walletOptionSelect, {
|
||||
optionSelect: optionDepotScreen,
|
||||
wallet,
|
||||
onGoBack: () => this.refresh(),
|
||||
})
|
||||
} else {
|
||||
this.props.navigation.push(route.walletDepot, {
|
||||
wallet,
|
||||
onGoBack: () => this.refresh(),
|
||||
})
|
||||
}
|
||||
}}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name='arrow-bottom-right'
|
||||
|
@ -557,10 +566,21 @@ class WalletDetail extends Component {
|
|||
|
||||
<View style={styles.containerTouch}>
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => this.props.navigation.push(route.walletRetrait, {
|
||||
wallet,
|
||||
onGoBack: () => this.refresh(),
|
||||
})}
|
||||
onPress={() => {
|
||||
if (isIlinkWorldWallet(wallet.network)) {
|
||||
this.props.navigation.push(route.walletOptionSelect, {
|
||||
optionSelect: optionRetraitScreen,
|
||||
wallet,
|
||||
onGoBack: () => this.refresh(),
|
||||
})
|
||||
} else {
|
||||
this.props.navigation.push(route.walletRetrait, {
|
||||
wallet,
|
||||
onGoBack: () => this.refresh(),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
activeOpacity={0.9}>
|
||||
<Icon name='arrow-top-left'
|
||||
color={Color.primaryColor}
|
||||
|
@ -586,14 +606,14 @@ class WalletDetail extends Component {
|
|||
</View>
|
||||
</View>
|
||||
|
||||
{wallet.network.toLowerCase().includes('ilink') &&
|
||||
{isIlinkWorldWallet(wallet.network) &&
|
||||
<>
|
||||
<View style={styles.transactionContainer}>
|
||||
|
||||
<View style={[styles.containerTouch]}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
||||
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name='cash-multiple'
|
||||
|
@ -621,7 +641,7 @@ class WalletDetail extends Component {
|
|||
|
||||
<View style={[styles.containerTouch]}>
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { }}
|
||||
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
||||
activeOpacity={0.9}>
|
||||
<Icon name='heart-multiple'
|
||||
color={Color.primaryColor}
|
||||
|
@ -652,7 +672,7 @@ class WalletDetail extends Component {
|
|||
<View style={[styles.containerTouch]}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
||||
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name='file-document'
|
||||
|
|
|
@ -31,7 +31,7 @@ import 'moment/locale/en-nz'
|
|||
import 'moment/locale/en-gb'
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { thousandsSeparators, isEmptyObject, transactionHistoryUser } from '../../utils/UtilsFunction';
|
||||
import { thousandsSeparators, isEmptyObject, transactionHistoryUser, optionDepotUserScreen, optionRetraitUserScreen } from '../../utils/UtilsFunction';
|
||||
import DeviceInfo from 'react-native-device-info'
|
||||
|
||||
let route = require('./../../route.json');
|
||||
|
@ -66,47 +66,14 @@ class WalletDetailUser extends Component {
|
|||
moment.locale(this.currentLocale);
|
||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||
|
||||
/* this.props.getWalletTransactionHistoryReset();
|
||||
this.props.depositActionReset();
|
||||
this.props.resetWalletListDetailReducer();
|
||||
this.props.getWalletTransactionHistoryReset();
|
||||
this.props.depositActionReset();
|
||||
this.props.resetWalletListDetailReducer();
|
||||
|
||||
if (this.isHomeRootView) {
|
||||
let agentId = this.props.navigation.state.params.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.props.getWalletDetailActivated(this.props.navigation.state.params.userId, null);
|
||||
this.props.getWalletTransactionHistory(this.props.navigation.state.params.userId);
|
||||
}
|
||||
/*
|
||||
static options(passProps) {
|
||||
return {
|
||||
topBar: {
|
||||
drawBehind: false,
|
||||
visible: true,
|
||||
animate: true,
|
||||
buttonColor: 'white',
|
||||
background: {
|
||||
color: 'white',
|
||||
},
|
||||
rightButtons: []
|
||||
},
|
||||
backButton: {
|
||||
visible: true,
|
||||
color: "white"
|
||||
},
|
||||
buttonColor: "white",
|
||||
background: {
|
||||
color: Color.primaryDarkColor
|
||||
},
|
||||
statusBar: {
|
||||
drawBehind: false,
|
||||
visible: true,
|
||||
}
|
||||
};
|
||||
}
|
||||
*/
|
||||
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
|
@ -136,16 +103,16 @@ class WalletDetailUser extends Component {
|
|||
|
||||
componentDidMount() {
|
||||
|
||||
/* const { result } = this.props;
|
||||
if (result !== null) {
|
||||
if (typeof result.response !== 'undefined') {
|
||||
const wallet = result.response[0];
|
||||
this.setState({
|
||||
wallet: wallet,
|
||||
isTriggerRefresh: false
|
||||
})
|
||||
}
|
||||
} */
|
||||
const { result } = this.props;
|
||||
if (result !== null) {
|
||||
if (typeof result.response !== 'undefined') {
|
||||
const wallet = result.response[0];
|
||||
this.setState({
|
||||
wallet: wallet,
|
||||
isTriggerRefresh: false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -201,30 +168,15 @@ class WalletDetailUser extends Component {
|
|||
}
|
||||
|
||||
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.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(); */
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
let agentId = this.props.navigation.state.params.agentId;
|
||||
this.props.getWalletDetailActivated(agentId, true);
|
||||
}
|
||||
let agentId = this.props.navigation.state.params.userId;
|
||||
this.props.getWalletDetailActivated(agentId, null);
|
||||
//this.props.getWalletDetailActivated(agentId, null);
|
||||
}
|
||||
|
||||
|
||||
renderHeader = () => (
|
||||
|
||||
renderHeader = (wallet) => (
|
||||
<View style={[
|
||||
styles.containField,
|
||||
{
|
||||
|
@ -236,7 +188,7 @@ class WalletDetailUser extends Component {
|
|||
]}>
|
||||
<View style={[styles.contentLeftItem]}>
|
||||
<Text numberOfLines={1} style={[Typography.body1, Typography.semibold]}>{I18n.t('COUNTRY')}</Text>
|
||||
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>Gabon</Text>
|
||||
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>Pays</Text>
|
||||
</View>
|
||||
|
||||
<View style={{
|
||||
|
@ -245,7 +197,7 @@ class WalletDetailUser extends Component {
|
|||
justifyContent: 'flex-end',
|
||||
}}>
|
||||
<Animated.Image
|
||||
source={{ uri: `https://ilink-app.com/mobilebackend/datas/img/network/uba-fs-ilink-logo.png` }}
|
||||
source={{ uri: this.getWalletIcon(wallet) }}
|
||||
style={{
|
||||
width: 120,
|
||||
height: 120,
|
||||
|
@ -267,7 +219,7 @@ class WalletDetailUser extends Component {
|
|||
alignItems: 'center',
|
||||
justifyContent: 'flex-end'
|
||||
}}>
|
||||
<Text style={[Typography.headline, Typography.semibold]} numberOfLines={1}>UBA FS iLink</Text>
|
||||
<Text style={[Typography.headline, Typography.semibold]} numberOfLines={1}>{wallet.network}</Text>
|
||||
<Tag primary style={styles.tagFollow}>
|
||||
{I18n.t('CREATION_IDENTIFICATION_CLIENT')}
|
||||
</Tag>
|
||||
|
@ -275,7 +227,7 @@ class WalletDetailUser extends Component {
|
|||
</View>
|
||||
<View style={styles.contentLeftItem}>
|
||||
<Text numberOfLines={1} style={[Typography.body1, Typography.semibold]} >{I18n.t('CREATION_DATE')}</Text>
|
||||
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>Il y'a deux jours</Text>
|
||||
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>{this.getCreationDateToHumanFormat(wallet.createdAt)}</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
@ -323,7 +275,7 @@ class WalletDetailUser extends Component {
|
|||
<Text style={[Typography.title3, Color.primaryColor], { marginBottom: 3 }}>
|
||||
{I18n.t('PRINCIPAL_ACCOUNT_TITLE')}
|
||||
</Text>
|
||||
<Text style={[Typography.body2]}>0</Text>
|
||||
<Text style={[Typography.body2]}>{thousandsSeparators(wallet.balance)}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
@ -346,213 +298,221 @@ class WalletDetailUser extends Component {
|
|||
<Text style={[Typography.title3, Color.primaryColor], { marginBottom: 3 }}>
|
||||
{I18n.t('NUMERO_COMPTE')}
|
||||
</Text>
|
||||
<Text style={[Typography.body2]}>123456789</Text>
|
||||
<Text style={[Typography.body2]}>{wallet.user_code}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
);
|
||||
|
||||
renderDetailWallet = () => {
|
||||
renderDetailWallet = (wallet) => {
|
||||
return (
|
||||
!isEmptyObject(wallet) ?
|
||||
(<>
|
||||
{this.state.triggerTransferCommission && this.renderDialogTransferCommissionResponse()}
|
||||
|
||||
(<>
|
||||
{this.state.triggerTransferCommission && this.renderDialogTransferCommissionResponse()}
|
||||
<View
|
||||
style={styles.container}>
|
||||
|
||||
<View
|
||||
style={styles.container}>
|
||||
<Animated.View style={{
|
||||
position: 'absolute',
|
||||
width: "100%",
|
||||
zIndex: 1,
|
||||
backgroundColor: Color.primaryColor,
|
||||
height: 140 - this.state.scrollHeaderY,
|
||||
}} />
|
||||
|
||||
<Animated.View style={{
|
||||
position: 'absolute',
|
||||
width: "100%",
|
||||
zIndex: 1,
|
||||
backgroundColor: Color.primaryColor,
|
||||
height: 140 - this.state.scrollHeaderY,
|
||||
}} />
|
||||
|
||||
<ScrollView style={{
|
||||
paddingHorizontal: 20, position: 'absolute',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
zIndex: 2
|
||||
}}
|
||||
scrollEventThrottle={8}
|
||||
onScroll={Animated.event([
|
||||
{
|
||||
nativeEvent: {
|
||||
contentOffset: { y: this.scrollY },
|
||||
<ScrollView style={{
|
||||
paddingHorizontal: 20, position: 'absolute',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
zIndex: 2
|
||||
}}
|
||||
scrollEventThrottle={8}
|
||||
onScroll={Animated.event([
|
||||
{
|
||||
nativeEvent: {
|
||||
contentOffset: { y: this.scrollY },
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
{ listener: (event) => { this.setState({ scrollHeaderY: event.nativeEvent.contentOffset.y }); } })}>
|
||||
<View style={{ marginTop: 80, }}>
|
||||
],
|
||||
{ listener: (event) => { this.setState({ scrollHeaderY: event.nativeEvent.contentOffset.y }); } })}>
|
||||
<View style={{ marginTop: 80, }}>
|
||||
|
||||
{this.renderHeader()}
|
||||
{this.renderHeader(wallet)}
|
||||
|
||||
<View
|
||||
style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||
<View
|
||||
style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||
|
||||
{this.renderAccountDetail()}
|
||||
{this.renderAccountDetail(wallet)}
|
||||
|
||||
<>
|
||||
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||
<Text
|
||||
style={[Typography.title3, Typography.semibold]}>
|
||||
{I18n.t('TRANSACTIONS')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={styles.transactionContainer}>
|
||||
|
||||
<View style={[styles.containerTouch]}>
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { }}
|
||||
activeOpacity={0.9}>
|
||||
<Icon name='arrow-bottom-right'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
|
||||
<View style={[styles.content]}>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('DEPOSIT')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text numberOfLines={1} style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
{I18n.t('DEPOSIT_DESCRIPTION')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
<>
|
||||
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||
<Text
|
||||
style={[Typography.title3, Typography.semibold]}>
|
||||
{I18n.t('TRANSACTIONS')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={[styles.containerTouch]}>
|
||||
<View style={styles.transactionContainer}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
||||
activeOpacity={0.9}>
|
||||
<View style={[styles.containerTouch]}>
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => {
|
||||
this.props.navigation.push(route.walletOptionSelect, {
|
||||
optionSelect: optionDepotUserScreen
|
||||
})
|
||||
}}
|
||||
activeOpacity={0.9}>
|
||||
<Icon name='arrow-bottom-right'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
|
||||
<Icon name='arrow-top-left'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
<View style={[styles.content]}>
|
||||
|
||||
<View style={[styles.content]}>
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('DEPOSIT')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text numberOfLines={1} style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
{I18n.t('DEPOSIT_DESCRIPTION')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('WITHDRAWAL')}
|
||||
</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
<View style={[styles.containerTouch]}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => {
|
||||
this.props.navigation.push(route.walletOptionSelect, {
|
||||
optionSelect: optionRetraitUserScreen
|
||||
})
|
||||
}}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name='arrow-top-left'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
|
||||
<View style={[styles.content]}>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('WITHDRAWAL')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
{I18n.t('WITHDRAWAL_DESCRIPTION')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
{I18n.t('WITHDRAWAL_DESCRIPTION')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={styles.transactionContainer}>
|
||||
|
||||
<View style={[styles.containerTouch]}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name='cash-multiple'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
|
||||
<View style={[styles.content]}>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('NANO_CREDIT')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
{I18n.t('WITHDRAWAL_DESCRIPTION')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={[styles.containerTouch]}>
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { }}
|
||||
activeOpacity={0.9}>
|
||||
<Icon name='heart-multiple'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
<View style={styles.transactionContainer}>
|
||||
|
||||
<View style={[styles.content]}>
|
||||
<View style={[styles.containerTouch]}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name='cash-multiple'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
|
||||
<View style={[styles.content]}>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('NANO_CREDIT')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
{I18n.t('WITHDRAWAL_DESCRIPTION')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('NANO_SANTE')}
|
||||
</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
<View style={[styles.containerTouch]}>
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { }}
|
||||
activeOpacity={0.9}>
|
||||
<Icon name='heart-multiple'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
|
||||
<View style={[styles.content]}>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('NANO_SANTE')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text numberOfLines={1} style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
{I18n.t('VALIDATE_IDENTIFICATION_DESCRIPTION')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text numberOfLines={1} style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
{I18n.t('VALIDATE_IDENTIFICATION_DESCRIPTION')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={styles.transactionContainer}>
|
||||
|
||||
<View style={[styles.containerTouch]}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name='file-document'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
|
||||
<View style={[styles.content]}>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('PAIEMENT_FACTURE')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<View style={styles.transactionContainer}>
|
||||
|
||||
{/* <TouchableOpacity style={styles.contain}
|
||||
<View style={[styles.containerTouch]}>
|
||||
|
||||
<TouchableOpacity style={styles.contain}
|
||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
<Icon name='file-document'
|
||||
color={Color.primaryColor}
|
||||
size={30}
|
||||
style={styles.imageBanner} />
|
||||
|
||||
<View style={[styles.content]}>
|
||||
|
||||
<View style={styles.contentTitle}>
|
||||
<Text style={[Typography.headline, Typography.semibold]}>
|
||||
{I18n.t('PAIEMENT_FACTURE')}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1 }}>
|
||||
|
||||
{/* <TouchableOpacity style={styles.contain}
|
||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
||||
activeOpacity={0.9}>
|
||||
|
||||
|
@ -576,22 +536,29 @@ class WalletDetailUser extends Component {
|
|||
</View>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity> */}
|
||||
</TouchableOpacity>
|
||||
*/}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</>
|
||||
</>
|
||||
|
||||
{this.renderHistoryTransaction()}
|
||||
</View>
|
||||
|
||||
|
||||
{this.renderHistoryTransaction()}
|
||||
</View>
|
||||
|
||||
|
||||
</View>
|
||||
|
||||
</ScrollView>
|
||||
</View>
|
||||
</>)
|
||||
</ScrollView>
|
||||
</View>
|
||||
</>)
|
||||
:
|
||||
(
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
|
||||
</View>
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
renderHistoryTransactionItem = (item) => {
|
||||
|
@ -632,10 +599,26 @@ class WalletDetailUser extends Component {
|
|||
return (
|
||||
<>
|
||||
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||
<Text
|
||||
style={[Typography.title3, Typography.semibold]}>
|
||||
{I18n.t('TRANSACTION_HISTORY')}
|
||||
</Text>
|
||||
<View
|
||||
style={[
|
||||
styles.contentService,
|
||||
{ borderBottomColor: Color.primaryColor },
|
||||
]}>
|
||||
{[
|
||||
{ key: '1', name: 'wifi' },
|
||||
{ key: '2', name: 'coffee' },
|
||||
{ key: '3', name: 'bath' },
|
||||
{ key: '4', name: 'car' },
|
||||
{ key: '5', name: 'paw' },
|
||||
].map((item, index) => (
|
||||
<View style={{ alignItems: 'center' }} key={'service' + index}>
|
||||
<Icon name={item.name} size={24} color={Color.accentColor} />
|
||||
<Text overline grayColor style={{ marginTop: 4 }}>
|
||||
{item.name}
|
||||
</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<ScrollView style={styles.transactionContainer}>
|
||||
|
@ -675,8 +658,23 @@ class WalletDetailUser extends Component {
|
|||
translucent={true}
|
||||
/>
|
||||
{
|
||||
this.renderDetailWallet()
|
||||
((this.props.loading || this.props.loadingTransferCommission) ?
|
||||
this.renderLoader() :
|
||||
(
|
||||
this.props.result !== null ?
|
||||
|
||||
Array.isArray(this.props.result.response) && (this.props.result.response.length) === 0 ?
|
||||
|
||||
<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)
|
||||
:
|
||||
null
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
</>
|
||||
|
@ -729,6 +727,17 @@ const styles = StyleSheet.create({
|
|||
height: 250,
|
||||
position: 'absolute',
|
||||
},
|
||||
contentService: {
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 0.5,
|
||||
flexDirection: 'row',
|
||||
flexWrap: 'wrap',
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
blockView: {
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 0.5,
|
||||
},
|
||||
containField: {
|
||||
padding: 10,
|
||||
marginBottom: 20,
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
import React, { Component } from 'react';
|
||||
import { StyleSheet, View, Image, StatusBar, Alert, FlatList, TouchableOpacity, ActivityIndicator, Platform, ProgressBarAndroid, Text } from 'react-native';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
const route = require('./../../route.json');
|
||||
let slugify = require('slugify');
|
||||
import I18n from 'react-native-i18n'
|
||||
import * as Utils from '../../utils/DeviceUtils';
|
||||
import { Images } from '../../config/Images';
|
||||
import { Color } from '../../config/Color';
|
||||
import { baseUrl } from '../../webservice/IlinkConstants';
|
||||
import { IlinkEmitter } from "../../utils/events";
|
||||
import { Provider, Appbar } from 'react-native-paper';
|
||||
import { readUser } from '../../webservice/AuthApi';
|
||||
import { FontWeight, Typography } from '../../config/typography';
|
||||
|
||||
export default class WalletOptionSelect extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||
this.state = {
|
||||
options: this.props.navigation.state.params.optionSelect.options,
|
||||
title: this.props.navigation.state.params.optionSelect.title,
|
||||
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
|
||||
hasWallet: this.props.navigation.state.params.hasOwnProperty('wallet')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static navigationOptions = ({ navigation }) => ({
|
||||
header: null,
|
||||
headerMode: 'none',
|
||||
headerTitle: null,
|
||||
activeColor: '#f0edf6',
|
||||
inactiveColor: '#3e2465',
|
||||
barStyle: { backgroundColor: '#694fad' },
|
||||
|
||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||
drawerIcon: ({ tintColor }) => (
|
||||
<Icon
|
||||
name={'credit-card'}
|
||||
size={24}
|
||||
/>)
|
||||
});
|
||||
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
||||
this.forceUpdate();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Provider>
|
||||
<View style={{ flex: 1 }}>
|
||||
|
||||
<StatusBar
|
||||
backgroundColor={Color.primaryDarkColor}
|
||||
barStyle="light-content"
|
||||
translucent={false}
|
||||
/>
|
||||
|
||||
<Appbar.Header dark={true} style={{ backgroundColor: Color.primaryColor }}>
|
||||
<Appbar.BackAction
|
||||
onPress={() => { this.props.navigation.pop() }}
|
||||
/>
|
||||
<Appbar.Content
|
||||
title={this.state.title}
|
||||
subtitle={this.state.subTitle}
|
||||
/>
|
||||
</Appbar.Header>
|
||||
|
||||
<View style={styles.container}>
|
||||
<FlatList
|
||||
contentContainerStyle={{
|
||||
paddingHorizontal: 20,
|
||||
paddingBottom: 10,
|
||||
}}
|
||||
data={this.state.options}
|
||||
keyExtractor={(item, index) => index.toString()}
|
||||
renderItem={({ item, index }) => (
|
||||
<TouchableOpacity
|
||||
style={[styles.item, { borderBottomColor: Color.borderColor }]}
|
||||
onPress={() => {
|
||||
if (this.state.hasWallet) {
|
||||
this.props.navigation.push(item.screen, {
|
||||
wallet: this.props.navigation.state.params.wallet,
|
||||
onGoBack: () => this.props.navigation.state.params.onGoBack()
|
||||
})
|
||||
} else {
|
||||
this.props.navigation.push(item.screen)
|
||||
}
|
||||
|
||||
}}>
|
||||
<View style={{ flexDirection: 'row' }}>
|
||||
<Icon
|
||||
name={item.icon}
|
||||
color={Color.primaryColor}
|
||||
size={20}
|
||||
solid
|
||||
style={{ marginHorizontal: 10 }}
|
||||
/>
|
||||
<Text style={[Typography.body1]}>{item.title}</Text>
|
||||
</View>
|
||||
<Icon
|
||||
name="chevron-right"
|
||||
size={20}
|
||||
color={Color.primaryColor}
|
||||
enableRTL={true}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Color.containerBackgroundColor,
|
||||
},
|
||||
item: {
|
||||
paddingVertical: 15,
|
||||
borderBottomWidth: 1,
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center"
|
||||
}
|
||||
});
|
|
@ -1,4 +1,7 @@
|
|||
import I18n from 'react-native-i18n';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
let slugify = require('slugify');
|
||||
let route = require('./../route.json');
|
||||
|
||||
export const thousandsSeparators = (num) => {
|
||||
var num_parts = num.toString().split(".");
|
||||
|
@ -42,3 +45,95 @@ export const isEmptyObject = (obj) => {
|
|||
|
||||
return JSON.stringify(obj) === JSON.stringify({});
|
||||
}
|
||||
|
||||
export const isIlinkWorldWallet = (walletName) => {
|
||||
return isEqual(slugify(walletName).toLowerCase(), 'ilink-world');
|
||||
}
|
||||
|
||||
export const optionDepotScreen = {
|
||||
title: I18n.t('DEPOSIT'),
|
||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
||||
options: [
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'wallet',
|
||||
title: I18n.t('DEPOSIT_CASH_TO_WALLET'),
|
||||
},
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'cash-refund',
|
||||
title: I18n.t('DEPOSIT_CASH_TO_OTHER_WALLET'),
|
||||
},
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'credit-card',
|
||||
title: I18n.t('DEPOSIT_CASH_TO_VISA'),
|
||||
},
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'bank-transfer-in',
|
||||
title: I18n.t('DEPOSIT_CASH_TO_BANK'),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const optionRetraitScreen = {
|
||||
title: I18n.t('WITHDRAWAL'),
|
||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
||||
options: [
|
||||
{
|
||||
screen: route.walletRetrait,
|
||||
icon: 'cash',
|
||||
title: I18n.t('WITHDRAWAL_IN_CASH'),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const optionRetraitUserScreen = {
|
||||
title: I18n.t('WITHDRAWAL'),
|
||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
||||
options: [
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'wallet',
|
||||
title: I18n.t('WITHDRAWAL_WALLET_TO_CASH'),
|
||||
},
|
||||
{
|
||||
screen: route.walletRetrait,
|
||||
icon: 'credit-card-refund',
|
||||
title: I18n.t('WITHDRAWAL_CARD_TO_CASH'),
|
||||
},
|
||||
{
|
||||
screen: route.walletRetrait,
|
||||
icon: 'card',
|
||||
title: I18n.t('WITHDRAWAL_CARD_TO_WALLET'),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const optionDepotUserScreen = {
|
||||
title: I18n.t('DEPOSIT'),
|
||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
||||
options: [
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'wallet',
|
||||
title: I18n.t('DEPOSIT_WALLET_TO_WALLET'),
|
||||
},
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'cash-refund',
|
||||
title: I18n.t('DEPOSIT_TO_CASH'),
|
||||
},
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'credit-card',
|
||||
title: I18n.t('DEPOSIT_TO_CARD'),
|
||||
},
|
||||
{
|
||||
screen: route.walletDepot,
|
||||
icon: 'bank-transfer-in',
|
||||
title: I18n.t('DEPOSIT_TO_BANK'),
|
||||
},
|
||||
]
|
||||
}
|
|
@ -50,10 +50,23 @@
|
|||
"CVC_CARD_ERROR": "CVC card error format",
|
||||
"THIS_FIELD_IS_REQUIRED": "This field is required",
|
||||
"PLEASE_ENTER_THE_AMOUNT": "Please enter the amount",
|
||||
"CHOOSE_OPTION": "Please choose an option",
|
||||
"EXPIRY_CARD_ERROR": "Date incorrect",
|
||||
"CARD_NUMBER_ERROR": "Card number incorrect",
|
||||
"AMOUNT_LABEL": "Amount",
|
||||
"WITHDRAWAL": "Withdrawal",
|
||||
"WITHDRAWAL_IN_CASH": "Withdrawal in cash",
|
||||
"WITHDRAWAL_WALLET_TO_CASH": "Withdrawal wallet to cash",
|
||||
"WITHDRAWAL_CARD_TO_WALLET": "Withdrawal card to wallet",
|
||||
"WITHDRAWAL_CARD_TO_CASH": "Withdrawal card to cash",
|
||||
"DEPOSIT_CASH_TO_WALLET": "Cash to wallet",
|
||||
"DEPOSIT_CASH_TO_OTHER_WALLET": "Cash to another wallet",
|
||||
"DEPOSIT_CASH_TO_VISA": "Cash to visa card",
|
||||
"DEPOSIT_CASH_TO_BANK": "Cash to bank",
|
||||
"DEPOSIT_WALLET_TO_WALLET": "Wallet to wallet",
|
||||
"DEPOSIT_TO_CASH": "Deposit to cash",
|
||||
"DEPOSIT_TO_CARD": "Deposit to card",
|
||||
"DEPOSIT_TO_BANK": "Deposit to bank",
|
||||
"NANO_CREDIT": "Nano credit",
|
||||
"NANO_SANTE": "Nano health",
|
||||
"PAIEMENT_FACTURE": "Bill payment",
|
||||
|
|
|
@ -56,8 +56,21 @@
|
|||
"CARD_NUMBER_ERROR": "Numéro de carte incorrect",
|
||||
"THIS_FIELD_IS_REQUIRED": "Ce champ est requis",
|
||||
"PLEASE_ENTER_THE_AMOUNT": "Veuillez renseigne le montant",
|
||||
"CHOOSE_OPTION": "Veuillez sélectionner une option",
|
||||
"DEPOSIT_DESCRIPTION": "Effectuer un dépôt",
|
||||
"WITHDRAWAL": "Retrait",
|
||||
"WITHDRAWAL_IN_CASH": "Retrait en cash",
|
||||
"WITHDRAWAL_WALLET_TO_CASH": "Retrait wallet vers cash",
|
||||
"WITHDRAWAL_CARD_TO_WALLET": "Retrait carte vers wallet",
|
||||
"WITHDRAWAL_CARD_TO_CASH": "Retrait carte vers cash",
|
||||
"DEPOSIT_CASH_TO_WALLET": "Cash vers wallet",
|
||||
"DEPOSIT_CASH_TO_OTHER_WALLET": "Cash vers autre wallet",
|
||||
"DEPOSIT_CASH_TO_VISA": "Cash vers carte visa",
|
||||
"DEPOSIT_CASH_TO_BANK": "Cash vers banque",
|
||||
"DEPOSIT_WALLET_TO_WALLET": "Wallet vers wallet",
|
||||
"DEPOSIT_TO_CASH": "Dépôt vers cash",
|
||||
"DEPOSIT_TO_CARD": "Dépôt vers carte",
|
||||
"DEPOSIT_TO_BANK": "Dépôt vers banque",
|
||||
"NANO_CREDIT": "Nano crédit",
|
||||
"NANO_SANTE": "Nano santé",
|
||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||
|
|
|
@ -25,6 +25,7 @@ export const configActionUrl = baseUrl + '/interacted/ConfigAction.php';
|
|||
export const logoutActionUrl = testBaseUrl + '/logout';
|
||||
|
||||
export const walletActionUrl = testBaseUrl + '/walletService/wallets';
|
||||
export const walletUserSimpleActionUrl = testBaseUrl + '/walletService/wallets/users';
|
||||
export const walletDetailUrl = testBaseUrl + '/walletService/wallets';
|
||||
export const creditTreatDemand = testBaseUrl + '/walletService/credits/treatDemand';
|
||||
export const creditCancelDemand = testBaseUrl + '/walletService/credits/cancelDemand';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import { walletActionUrl, commissionAmount, walletDetailUrl } from "./IlinkConstants";
|
||||
import { walletActionUrl, commissionAmount, walletDetailUrl, walletUserSimpleActionUrl } 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";
|
||||
|
@ -47,7 +47,16 @@ 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}`;
|
||||
|
||||
console.log("isAgentCall", isAgentCall);
|
||||
let url = null;
|
||||
if (isAgentCall === null)
|
||||
url = `${walletUserSimpleActionUrl}/${id}`;
|
||||
else if (isAgentCall === false)
|
||||
url = `${walletDetailUrl}/${id}`;
|
||||
else
|
||||
url = `${walletActionUrl}/${id}/activated`;
|
||||
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchWalletListDetailPending());
|
||||
|
@ -60,11 +69,11 @@ export const getWalletDetailActivated = (id, isAgentCall) => {
|
|||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
console.log("RESPONSE", response);
|
||||
dispatch(fetchWalletListDetailSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
console.log("ERROR", error);
|
||||
dispatch(fetchWalletListDetailError(error.message));
|
||||
if (error.response)
|
||||
dispatch(fetchWalletListDetailError(error.response));
|
||||
|
|
Loading…
Reference in New Issue