Historique Superviseur OK
This commit is contained in:
parent
5c15bcb421
commit
7ac6080020
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,3 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
buildToolsVersion = "28.0.3"
|
buildToolsVersion = "28.0.3"
|
||||||
|
@ -12,7 +10,7 @@ buildscript {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath('com.android.tools.build:gradle:3.6.1')
|
classpath('com.android.tools.build:gradle:4.0.2')
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#Fri Mar 13 13:41:48 WAT 2020
|
#Wed Oct 14 15:00:41 WAT 2020
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
"start": "node node_modules/react-native/local-cli/cli.js start",
|
"start": "node node_modules/react-native/local-cli/cli.js start",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"postinstall": "node ./fix-android/android-release-fix.js",
|
"postinstall": "node ./fix-android/android-release-fix.js",
|
||||||
"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",
|
"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",
|
"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_29 -dns-server 8.8.8.8",
|
"start-emulator": "emulator -avd Nexus_5X_API_29 -dns-server 8.8.8.8",
|
||||||
"start-emulator-pixel": "emulator -avd Pixel_2_API_29 -dns-server 8.8.8.8",
|
"start-emulator-pixel": "emulator -avd Pixel_2_API_29 -dns-server 8.8.8.8",
|
||||||
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
|
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
|
||||||
|
|
|
@ -25,7 +25,11 @@ import {
|
||||||
LINK_CARD_PENDING,
|
LINK_CARD_PENDING,
|
||||||
LINK_CARD_RESET,
|
LINK_CARD_RESET,
|
||||||
LINK_CARD_SUCCESS,
|
LINK_CARD_SUCCESS,
|
||||||
LINK_CARD_ERROR
|
LINK_CARD_ERROR,
|
||||||
|
WALLET_HISTORY_HYPER_SUPER_PENDING,
|
||||||
|
WALLET_HISTORY_HYPER_SUPER__SUCCESS,
|
||||||
|
WALLET_HISTORY_HYPER_SUPER__ERROR,
|
||||||
|
WALLET_HISTORY_HYPER_SUPER__RESET
|
||||||
} from "../types/WalletType";
|
} from "../types/WalletType";
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,6 +92,26 @@ export const fetchWalletHistoryError = (error) => ({
|
||||||
type: WALLET_HISTORY_ERROR,
|
type: WALLET_HISTORY_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
/**
|
||||||
|
* ---------------------------------------------------
|
||||||
|
*/
|
||||||
|
export const fetchWalletHistoryHyperSuperPending = () => ({
|
||||||
|
type: WALLET_HISTORY_HYPER_SUPER_PENDING
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchWalletHistoryHyperSuperReset = () => ({
|
||||||
|
type: WALLET_HISTORY_HYPER_SUPER__RESET
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchWalletHistoryHyperSuperSuccess = (res) => ({
|
||||||
|
type: WALLET_HISTORY_HYPER_SUPER__SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchWalletHistoryHyperSuperError = (error) => ({
|
||||||
|
type: WALLET_HISTORY_HYPER_SUPER__ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
/**
|
/**
|
||||||
* ---------------------------------------------------
|
* ---------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
import { WALLET_HISTORY_HYPER_SUPER_PENDING, WALLET_HISTORY_HYPER_SUPER__RESET, WALLET_HISTORY_HYPER_SUPER__ERROR, WALLET_HISTORY_HYPER_SUPER__SUCCESS } from "../types/WalletType";
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: null
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (state = initialState, action) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case WALLET_HISTORY_HYPER_SUPER_PENDING: return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case WALLET_HISTORY_HYPER_SUPER__SUCCESS: return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case WALLET_HISTORY_HYPER_SUPER__ERROR: return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
case WALLET_HISTORY_HYPER_SUPER__RESET: return initialState;
|
||||||
|
|
||||||
|
default: {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -41,6 +41,7 @@ import EpargnerArgentUserReducer from "./EpargnerArgentUserReducer";
|
||||||
import CasserEpargneUserReducer from "./CasserEpargneUserReducer";
|
import CasserEpargneUserReducer from "./CasserEpargneUserReducer";
|
||||||
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
||||||
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
|
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
|
||||||
|
import GetHyperSuperHistoryReducer from "./GetHyperSuperHistoryReducer";
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'root',
|
key: 'root',
|
||||||
|
@ -91,7 +92,8 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
epargnerArgentUserReducer: EpargnerArgentUserReducer,
|
epargnerArgentUserReducer: EpargnerArgentUserReducer,
|
||||||
casserEpargneUserReducer: CasserEpargneUserReducer,
|
casserEpargneUserReducer: CasserEpargneUserReducer,
|
||||||
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
|
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
|
||||||
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer
|
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer,
|
||||||
|
getHyperSuperHistoryReducer: GetHyperSuperHistoryReducer
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
|
@ -13,6 +13,11 @@ export const WALLET_HISTORY_SUCCESS = 'WALLET_HISTORY_SUCCESS';
|
||||||
export const WALLET_HISTORY_ERROR = 'WALLET_HISTORY_ERROR';
|
export const WALLET_HISTORY_ERROR = 'WALLET_HISTORY_ERROR';
|
||||||
export const WALLET_HISTORY_RESET = 'WALLET_HISTORY_RESET';
|
export const WALLET_HISTORY_RESET = 'WALLET_HISTORY_RESET';
|
||||||
|
|
||||||
|
export const WALLET_HISTORY_HYPER_SUPER_PENDING = 'WALLET_HISTORY_HYPER_SUPER_PENDING';
|
||||||
|
export const WALLET_HISTORY_HYPER_SUPER__SUCCESS = 'WALLET_HISTORY_HYPER_SUPER__SUCCESS';
|
||||||
|
export const WALLET_HISTORY_HYPER_SUPER__ERROR = 'WALLET_HISTORY_HYPER_SUPER__ERROR';
|
||||||
|
export const WALLET_HISTORY_HYPER_SUPER__RESET = 'WALLET_HISTORY_HYPER_SUPER__RESET';
|
||||||
|
|
||||||
export const WALLET_GET_COMMISSION_PENDING = 'WALLET_GET_COMMISSION_PENDING';
|
export const WALLET_GET_COMMISSION_PENDING = 'WALLET_GET_COMMISSION_PENDING';
|
||||||
export const WALLET_GET_COMMISSION_SUCCESS = 'WALLET_GET_COMMISSION_SUCCESS';
|
export const WALLET_GET_COMMISSION_SUCCESS = 'WALLET_GET_COMMISSION_SUCCESS';
|
||||||
export const WALLET_GET_COMMISSION_ERROR = 'WALLET_GET_COMMISSION_ERROR';
|
export const WALLET_GET_COMMISSION_ERROR = 'WALLET_GET_COMMISSION_ERROR';
|
||||||
|
|
|
@ -84,6 +84,7 @@ export class HistoryItem extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
console.log("ITEM RENDER", this.props.selfData)
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={() =>
|
<TouchableOpacity onPress={() =>
|
||||||
this.props.navigator.navigate(route.historyItemDetails, {
|
this.props.navigator.navigate(route.historyItemDetails, {
|
||||||
|
@ -102,7 +103,7 @@ export class HistoryItem extends React.Component {
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
color: this.state.colorstate,
|
color: this.state.colorstate,
|
||||||
|
|
||||||
}}>{item.nombre_validation}</Text>
|
}}>{this.props.selfData.nombre_validation}</Text>
|
||||||
<Text style={style.time}>{this.state.time}</Text>
|
<Text style={style.time}>{this.state.time}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={style.bottomSeparator} />
|
<View style={style.bottomSeparator} />
|
||||||
|
@ -197,7 +198,9 @@ export class HistoryListItem extends React.Component {
|
||||||
_onPressItem = (id: string) => {
|
_onPressItem = (id: string) => {
|
||||||
|
|
||||||
};
|
};
|
||||||
_renderItem = ({ item }) => (
|
_renderItem = ({ item }) => {
|
||||||
|
console.log('ITEM ', item);
|
||||||
|
return (
|
||||||
<HistoryItem
|
<HistoryItem
|
||||||
isDemandSend={this.props.isDemandSend}
|
isDemandSend={this.props.isDemandSend}
|
||||||
user={this.props.user}
|
user={this.props.user}
|
||||||
|
@ -206,7 +209,7 @@ export class HistoryListItem extends React.Component {
|
||||||
selfData={item}
|
selfData={item}
|
||||||
refresh={this.props.refresh}
|
refresh={this.props.refresh}
|
||||||
/>
|
/>
|
||||||
);
|
)};
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = this.initState();
|
this.state = this.initState();
|
||||||
|
|
|
@ -692,7 +692,7 @@ class MyHistory extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderListDemandsSend() {
|
_renderListDemandsSend() {
|
||||||
console.log('this.state', this.state);
|
//console.log('this.state', this.state);
|
||||||
return (<View style={styles.container}>
|
return (<View style={styles.container}>
|
||||||
{
|
{
|
||||||
this.state.isLoaded ?
|
this.state.isLoaded ?
|
||||||
|
|
|
@ -1540,13 +1540,11 @@ class Home extends BaseScreen {
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user.category !== undefined) {
|
if (user.category !== undefined) {
|
||||||
if (user.category === "geolocated") {
|
|
||||||
this.saveOneSignal(false, {
|
this.saveOneSignal(false, {
|
||||||
code_membre: user.code_membre,
|
code_membre: user.code_membre,
|
||||||
player_id: global.onesignalIds,
|
player_id: global.onesignalIds,
|
||||||
set_default: true
|
set_default: true
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.saveOneSignal(true, {
|
this.saveOneSignal(true, {
|
||||||
user_code: user.user_code,
|
user_code: user.user_code,
|
||||||
|
|
|
@ -28,8 +28,9 @@ import { cutString, cutStringWithoutDot, isEmptyObject, transactionHistoryIlinkL
|
||||||
import { depositActionReset } from '../../webservice/DepositApi';
|
import { depositActionReset } from '../../webservice/DepositApi';
|
||||||
import { baseUrl } from '../../webservice/IlinkConstants';
|
import { baseUrl } from '../../webservice/IlinkConstants';
|
||||||
import { getWalletDetailActivated, resetWalletListDetailReducer } from '../../webservice/WalletApi';
|
import { getWalletDetailActivated, resetWalletListDetailReducer } from '../../webservice/WalletApi';
|
||||||
import { getWalletTransactionHistory, getWalletTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi';
|
import { getWalletTransactionHistory, getWalletTransactionHistoryReset,getHyperSuperTransactionHistoryAction, getHyperSuperTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi';
|
||||||
import { resetCommissionReducer, transferCommissionAction } from '../../webservice/WalletTransferCommission';
|
import { resetCommissionReducer, transferCommissionAction } from '../../webservice/WalletTransferCommission';
|
||||||
|
import { readUser } from '../../webservice/AuthApi';
|
||||||
let moment = require('moment-timezone');
|
let moment = require('moment-timezone');
|
||||||
const thousands = require('thousands');
|
const thousands = require('thousands');
|
||||||
|
|
||||||
|
@ -55,6 +56,7 @@ class WalletDetail extends Component {
|
||||||
isTriggerRefresh: false,
|
isTriggerRefresh: false,
|
||||||
scrollHeaderY: 0,
|
scrollHeaderY: 0,
|
||||||
displayModalHistory: false,
|
displayModalHistory: false,
|
||||||
|
displaySuperHyperModalHistory: false,
|
||||||
historyItemDetail: null
|
historyItemDetail: null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -81,6 +83,8 @@ class WalletDetail extends Component {
|
||||||
if (this.isHomeRootView) {
|
if (this.isHomeRootView) {
|
||||||
let agentId = this.props.navigation.state.params.agentId;
|
let agentId = this.props.navigation.state.params.agentId;
|
||||||
this.props.getWalletDetailActivated(agentId, true);
|
this.props.getWalletDetailActivated(agentId, true);
|
||||||
|
this.props.getHyperSuperTransactionHistoryReset();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.props.getWalletDetailActivated(this.props.navigation.state.params.wallet.id, false);
|
this.props.getWalletDetailActivated(this.props.navigation.state.params.wallet.id, false);
|
||||||
|
@ -151,6 +155,21 @@ class WalletDetail extends Component {
|
||||||
if (result !== null) {
|
if (result !== null) {
|
||||||
if (typeof result.response !== 'undefined') {
|
if (typeof result.response !== 'undefined') {
|
||||||
const wallet = result.response[0];
|
const wallet = result.response[0];
|
||||||
|
readUser().then((user) => {
|
||||||
|
if (user !== null && user !== undefined) {
|
||||||
|
if (user.category !== undefined) {
|
||||||
|
switch (user.category) {
|
||||||
|
case "super":
|
||||||
|
this.props.getHyperSuperTransactionHistoryAction(result.response.id, false);
|
||||||
|
break;
|
||||||
|
case "hyper":
|
||||||
|
this.props.getHyperSuperTransactionHistoryAction(result.response.id, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.setState({});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
wallet: wallet,
|
wallet: wallet,
|
||||||
isTriggerRefresh: false
|
isTriggerRefresh: false
|
||||||
|
@ -606,6 +625,250 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderSuperHyperHistoryTransactionItem = (item, index) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TouchableOpacity onPress={() => { this.setState({ displaySuperHyperModalHistory: true, historyItemDetail: item }) }} style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
|
{
|
||||||
|
Object.keys(omit(item, ['id', 'id_transaction', 'type_historique', 'frais', 'init_country', 'final_country', 'source', 'emetteur', 'montant_net_final', 'montant_net_init', 'reseau_payeur', 'operation'])).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, 'destinataire') ?
|
||||||
|
item[element].length > 13 ? cutString(item[element], 13) : item[element]
|
||||||
|
: isEqual(element, 'date_creation') ?
|
||||||
|
cutStringWithoutDot(item[element], 16)
|
||||||
|
: item[element]
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
renderModalSuperHyperHistoryDetail = () => {
|
||||||
|
const { historyItemDetail } = this.state;
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
<Dialog.Container useNativeDriver={true} visible={this.state.displaySuperHyperModalHistory}>
|
||||||
|
|
||||||
|
<Dialog.Title>Détail de l'historique</Dialog.Title>
|
||||||
|
|
||||||
|
<View>
|
||||||
|
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('OPERATION')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.operation}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('TRANSACTION_ID')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.id_transaction}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>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('INIT_COUNTRY')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.init_country}</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}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.frais}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('NET_AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_net_init}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('EMETTEUR')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.emetteur}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('DESTINATAIRE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.destinataire}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('FINAL_COUNTRY')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.final_country}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('NET_AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_net_final}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('ACTIVE_WALLET')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.reseau_payeur}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('OK')} onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
displaySuperHyperModalHistory: !this.state.displaySuperHyperModalHistory,
|
||||||
|
});
|
||||||
|
|
||||||
|
}} />
|
||||||
|
|
||||||
|
</Dialog.Container>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderSuperHyperHistoryTransactionList = () => {
|
||||||
|
|
||||||
|
const { resultHistoryHyperSuper, errorHistoryHyperSuper } = this.props;
|
||||||
|
if (errorHistoryHyperSuper !== null) {
|
||||||
|
if (typeof errorHistoryHyperSuper.data !== 'undefined') {
|
||||||
|
return (
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Text style={Typography.body1}>{errorHistoryHyperSuper.data.error}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Text style={Typography.body1}>{errorHistoryHyperSuper}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resultHistoryHyperSuper !== null) {
|
||||||
|
if (resultHistoryHyperSuper.response !== null) {
|
||||||
|
return (
|
||||||
|
Array.isArray(resultHistoryHyperSuper.response) && (resultHistoryHyperSuper.response.length) > 0 ?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
|
{
|
||||||
|
transactionHistoryIlinkLabel().map((item, index) => (
|
||||||
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
|
{item.label}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
resultHistoryHyperSuper.response.map((item, index) => (
|
||||||
|
this.renderSuperHyperHistoryTransactionItem(item, index)
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
(
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'flex-start' }}>
|
||||||
|
<Text style={Typography.body1}>{I18n.t('NO_WALLET_HISTORY')}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
renderSuperHyperHistoryTransaction = () => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
this.props.loadingHistoryHyperSuper ?
|
||||||
|
(
|
||||||
|
<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>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.title3, Typography.semibold]}>
|
||||||
|
{I18n.t('TRANSACTION_HISTORY')}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{this.renderSuperHyperHistoryTransactionList()}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
renderDetailWallet = (wallet) => {
|
renderDetailWallet = (wallet) => {
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
@ -903,6 +1166,7 @@ class WalletDetail extends Component {
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!this.isHomeRootView && this.renderHistoryTransaction(wallet)}
|
{!this.isHomeRootView && this.renderHistoryTransaction(wallet)}
|
||||||
|
{this.isHomeRootView && this.renderSuperHyperHistoryTransaction()}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1150,6 +1414,7 @@ class WalletDetail extends Component {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{this.state.displayModalHistory && this.renderModalHistoryDetail()}
|
{this.state.displayModalHistory && this.renderModalHistoryDetail()}
|
||||||
|
{this.state.displaySuperHyperModalHistory && this.renderModalSuperHyperHistoryDetail()}
|
||||||
<StatusBar
|
<StatusBar
|
||||||
backgroundColor={Color.primaryDarkColor}
|
backgroundColor={Color.primaryDarkColor}
|
||||||
barStyle="light-content"
|
barStyle="light-content"
|
||||||
|
@ -1194,6 +1459,10 @@ const mapStateToProps = state => ({
|
||||||
loadingTransferCommission: state.walletTransferCommissionReducer.loadingTransferCommission,
|
loadingTransferCommission: state.walletTransferCommissionReducer.loadingTransferCommission,
|
||||||
resultTransferCommission: state.walletTransferCommissionReducer.resultTransferCommission,
|
resultTransferCommission: state.walletTransferCommissionReducer.resultTransferCommission,
|
||||||
errorTransferCommission: state.walletTransferCommissionReducer.errorTransferCommission,
|
errorTransferCommission: state.walletTransferCommissionReducer.errorTransferCommission,
|
||||||
|
|
||||||
|
loadingHistoryHyperSuper: state.getHyperSuperHistoryReducer.loading,
|
||||||
|
resultHistoryHyperSuper: state.getHyperSuperHistoryReducer.result,
|
||||||
|
errorHistoryHyperSuper: state.getHyperSuperHistoryReducer.error,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
@ -1203,7 +1472,9 @@ const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
resetWalletListDetailReducer,
|
resetWalletListDetailReducer,
|
||||||
resetCommissionReducer,
|
resetCommissionReducer,
|
||||||
getWalletTransactionHistoryReset,
|
getWalletTransactionHistoryReset,
|
||||||
depositActionReset
|
depositActionReset,
|
||||||
|
getHyperSuperTransactionHistoryAction,
|
||||||
|
getHyperSuperTransactionHistoryReset
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(WalletDetail);
|
export default connect(mapStateToProps, mapDispatchToProps)(WalletDetail);
|
||||||
|
|
|
@ -68,6 +68,8 @@ export const getNotificationUrl = testBaseUrl + '/notificationService/notificati
|
||||||
export const getNanoCreditAccount = testBaseUrl + '/walletService/groups/nanoCredit/accounts';
|
export const getNanoCreditAccount = testBaseUrl + '/walletService/groups/nanoCredit/accounts';
|
||||||
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
|
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
|
||||||
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
|
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
|
||||||
|
export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_hyper_history';
|
||||||
|
export const getSuperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_super_history';
|
||||||
|
|
||||||
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
||||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
import { transactionUrl, transactionIlinkUrl } from "./IlinkConstants";
|
import { transactionUrl, transactionIlinkUrl, getHyperviseurHistoriqueUrl, getSuperviseurHistoriqueUrl } from "./IlinkConstants";
|
||||||
import { store } from "../redux/store";
|
import { store } from "../redux/store";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
import { fetchWalletHistoryPending, fetchWalletHistorySuccess, fetchWalletHistoryError, fetchWalletHistoryReset } from "../redux/actions/WalletActions";
|
import { fetchWalletHistoryPending, fetchWalletHistorySuccess, fetchWalletHistoryError, fetchWalletHistoryReset, fetchWalletHistoryHyperSuperPending, fetchWalletHistoryHyperSuperSuccess, fetchWalletHistoryHyperSuperError, fetchWalletHistoryHyperSuperReset } from "../redux/actions/WalletActions";
|
||||||
|
|
||||||
export const getWalletTransactionHistory = (walletID, isiLinkWorldWallet) => {
|
export const getWalletTransactionHistory = (walletID, isiLinkWorldWallet) => {
|
||||||
|
|
||||||
|
@ -73,3 +73,41 @@ export const getWalletTransactionHistoryReset = () => {
|
||||||
dispatch(fetchWalletHistoryReset());
|
dispatch(fetchWalletHistoryReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getHyperSuperTransactionHistoryAction = (walletID, isHyper) => {
|
||||||
|
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
|
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchWalletHistoryHyperSuperPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: isHyper ? `${getHyperviseurHistoriqueUrl}/${walletID}` : `${getSuperviseurHistoriqueUrl}/${walletID}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchWalletHistoryHyperSuperSuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchWalletHistoryHyperSuperError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchWalletHistoryHyperSuperError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchWalletHistoryHyperSuperError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getHyperSuperTransactionHistoryReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchWalletHistoryHyperSuperReset());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue