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 {
|
||||
ext {
|
||||
buildToolsVersion = "28.0.3"
|
||||
|
@ -12,7 +10,7 @@ buildscript {
|
|||
jcenter()
|
||||
}
|
||||
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
|
||||
// in the individual module build.gradle files
|
||||
|
@ -46,4 +44,4 @@ allprojects {
|
|||
jcenter()
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
#Fri Mar 13 13:41:48 WAT 2020
|
||||
#Wed Oct 14 15:00:41 WAT 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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",
|
||||
"test": "jest",
|
||||
"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",
|
||||
"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",
|
||||
"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_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",
|
||||
|
|
|
@ -25,7 +25,11 @@ import {
|
|||
LINK_CARD_PENDING,
|
||||
LINK_CARD_RESET,
|
||||
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";
|
||||
|
||||
|
||||
|
@ -88,6 +92,26 @@ export const fetchWalletHistoryError = (error) => ({
|
|||
type: WALLET_HISTORY_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 GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
||||
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
|
||||
import GetHyperSuperHistoryReducer from "./GetHyperSuperHistoryReducer";
|
||||
|
||||
const persistConfig = {
|
||||
key: 'root',
|
||||
|
@ -91,7 +92,8 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
|||
epargnerArgentUserReducer: EpargnerArgentUserReducer,
|
||||
casserEpargneUserReducer: CasserEpargneUserReducer,
|
||||
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
|
||||
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer
|
||||
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer,
|
||||
getHyperSuperHistoryReducer: GetHyperSuperHistoryReducer
|
||||
});
|
||||
|
||||
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_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_SUCCESS = 'WALLET_GET_COMMISSION_SUCCESS';
|
||||
export const WALLET_GET_COMMISSION_ERROR = 'WALLET_GET_COMMISSION_ERROR';
|
||||
|
|
|
@ -84,6 +84,7 @@ export class HistoryItem extends React.Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
console.log("ITEM RENDER", this.props.selfData)
|
||||
return (
|
||||
<TouchableOpacity onPress={() =>
|
||||
this.props.navigator.navigate(route.historyItemDetails, {
|
||||
|
@ -102,7 +103,7 @@ export class HistoryItem extends React.Component {
|
|||
marginBottom: 10,
|
||||
color: this.state.colorstate,
|
||||
|
||||
}}>{item.nombre_validation}</Text>
|
||||
}}>{this.props.selfData.nombre_validation}</Text>
|
||||
<Text style={style.time}>{this.state.time}</Text>
|
||||
</View>
|
||||
<View style={style.bottomSeparator} />
|
||||
|
@ -197,7 +198,9 @@ export class HistoryListItem extends React.Component {
|
|||
_onPressItem = (id: string) => {
|
||||
|
||||
};
|
||||
_renderItem = ({ item }) => (
|
||||
_renderItem = ({ item }) => {
|
||||
console.log('ITEM ', item);
|
||||
return (
|
||||
<HistoryItem
|
||||
isDemandSend={this.props.isDemandSend}
|
||||
user={this.props.user}
|
||||
|
@ -206,7 +209,7 @@ export class HistoryListItem extends React.Component {
|
|||
selfData={item}
|
||||
refresh={this.props.refresh}
|
||||
/>
|
||||
);
|
||||
)};
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = this.initState();
|
||||
|
|
|
@ -692,7 +692,7 @@ class MyHistory extends React.Component {
|
|||
}
|
||||
|
||||
_renderListDemandsSend() {
|
||||
console.log('this.state', this.state);
|
||||
//console.log('this.state', this.state);
|
||||
return (<View style={styles.container}>
|
||||
{
|
||||
this.state.isLoaded ?
|
||||
|
|
|
@ -1540,13 +1540,11 @@ class Home extends BaseScreen {
|
|||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user.category !== undefined) {
|
||||
if (user.category === "geolocated") {
|
||||
this.saveOneSignal(false, {
|
||||
code_membre: user.code_membre,
|
||||
player_id: global.onesignalIds,
|
||||
set_default: true
|
||||
});
|
||||
}
|
||||
this.saveOneSignal(false, {
|
||||
code_membre: user.code_membre,
|
||||
player_id: global.onesignalIds,
|
||||
set_default: true
|
||||
});
|
||||
} else {
|
||||
this.saveOneSignal(true, {
|
||||
user_code: user.user_code,
|
||||
|
|
|
@ -28,8 +28,9 @@ import { cutString, cutStringWithoutDot, isEmptyObject, transactionHistoryIlinkL
|
|||
import { depositActionReset } from '../../webservice/DepositApi';
|
||||
import { baseUrl } from '../../webservice/IlinkConstants';
|
||||
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 { readUser } from '../../webservice/AuthApi';
|
||||
let moment = require('moment-timezone');
|
||||
const thousands = require('thousands');
|
||||
|
||||
|
@ -55,6 +56,7 @@ class WalletDetail extends Component {
|
|||
isTriggerRefresh: false,
|
||||
scrollHeaderY: 0,
|
||||
displayModalHistory: false,
|
||||
displaySuperHyperModalHistory: false,
|
||||
historyItemDetail: null
|
||||
};
|
||||
|
||||
|
@ -81,6 +83,8 @@ class WalletDetail extends Component {
|
|||
if (this.isHomeRootView) {
|
||||
let agentId = this.props.navigation.state.params.agentId;
|
||||
this.props.getWalletDetailActivated(agentId, true);
|
||||
this.props.getHyperSuperTransactionHistoryReset();
|
||||
|
||||
}
|
||||
else {
|
||||
this.props.getWalletDetailActivated(this.props.navigation.state.params.wallet.id, false);
|
||||
|
@ -151,6 +155,21 @@ class WalletDetail extends Component {
|
|||
if (result !== null) {
|
||||
if (typeof result.response !== 'undefined') {
|
||||
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({
|
||||
wallet: wallet,
|
||||
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) => {
|
||||
return (
|
||||
|
||||
|
@ -903,6 +1166,7 @@ class WalletDetail extends Component {
|
|||
)}
|
||||
|
||||
{!this.isHomeRootView && this.renderHistoryTransaction(wallet)}
|
||||
{this.isHomeRootView && this.renderSuperHyperHistoryTransaction()}
|
||||
</View>
|
||||
|
||||
|
||||
|
@ -1150,6 +1414,7 @@ class WalletDetail extends Component {
|
|||
return (
|
||||
<>
|
||||
{this.state.displayModalHistory && this.renderModalHistoryDetail()}
|
||||
{this.state.displaySuperHyperModalHistory && this.renderModalSuperHyperHistoryDetail()}
|
||||
<StatusBar
|
||||
backgroundColor={Color.primaryDarkColor}
|
||||
barStyle="light-content"
|
||||
|
@ -1194,6 +1459,10 @@ const mapStateToProps = state => ({
|
|||
loadingTransferCommission: state.walletTransferCommissionReducer.loadingTransferCommission,
|
||||
resultTransferCommission: state.walletTransferCommissionReducer.resultTransferCommission,
|
||||
errorTransferCommission: state.walletTransferCommissionReducer.errorTransferCommission,
|
||||
|
||||
loadingHistoryHyperSuper: state.getHyperSuperHistoryReducer.loading,
|
||||
resultHistoryHyperSuper: state.getHyperSuperHistoryReducer.result,
|
||||
errorHistoryHyperSuper: state.getHyperSuperHistoryReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
|
@ -1203,7 +1472,9 @@ const mapDispatchToProps = dispatch => bindActionCreators({
|
|||
resetWalletListDetailReducer,
|
||||
resetCommissionReducer,
|
||||
getWalletTransactionHistoryReset,
|
||||
depositActionReset
|
||||
depositActionReset,
|
||||
getHyperSuperTransactionHistoryAction,
|
||||
getHyperSuperTransactionHistoryReset
|
||||
}, dispatch);
|
||||
|
||||
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 getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_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 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 axios from "axios";
|
||||
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) => {
|
||||
|
||||
|
@ -72,4 +72,42 @@ export const getWalletTransactionHistoryReset = () => {
|
|||
return dispatch => {
|
||||
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