notification demand request OK
This commit is contained in:
parent
e597ceb6c3
commit
4a539e7c41
28
App.js
28
App.js
|
|
@ -438,11 +438,19 @@ class App extends React.Component {
|
||||||
|
|
||||||
goToScreen = (routeName, params, isReset = true) => {
|
goToScreen = (routeName, params, isReset = true) => {
|
||||||
const { navigator } = this.refs;
|
const { navigator } = this.refs;
|
||||||
if (typeof this.refs.navigator !== 'undefined') {
|
if (typeof navigator !== 'undefined') {
|
||||||
console.log("APP HAS LOADED", global.appHasLoaded);
|
console.log("APP HAS LOADED", global.appHasLoaded);
|
||||||
if (global.appHasLoaded) {
|
if (global.appHasLoaded) {
|
||||||
readUser().then((result) => {
|
|
||||||
|
navigator.dispatch({
|
||||||
|
type: "Navigation/NAVIGATE",
|
||||||
|
routeName,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
/* readUser().then((result) => {
|
||||||
if (result === null || result === undefined) {
|
if (result === null || result === undefined) {
|
||||||
|
console.warn("APP HAS LOADED NOTIFICATION PARAMS", params);
|
||||||
|
|
||||||
navigator.dispatch({
|
navigator.dispatch({
|
||||||
type: "Navigation/NAVIGATE",
|
type: "Navigation/NAVIGATE",
|
||||||
routeName: "first",
|
routeName: "first",
|
||||||
|
|
@ -455,9 +463,8 @@ class App extends React.Component {
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
}); */
|
||||||
} else {
|
} else {
|
||||||
console.warn("NOTIFICATION PARAMS", params);
|
|
||||||
navigator.dispatch({
|
navigator.dispatch({
|
||||||
type: "Navigation/NAVIGATE",
|
type: "Navigation/NAVIGATE",
|
||||||
routeName: "first",
|
routeName: "first",
|
||||||
|
|
@ -471,9 +478,22 @@ class App extends React.Component {
|
||||||
const data = openResult.notification.payload.additionalData;
|
const data = openResult.notification.payload.additionalData;
|
||||||
//const dataParse = data.replace("'", "\"");
|
//const dataParse = data.replace("'", "\"");
|
||||||
console.warn("HANDLE DEEP LINK", data);
|
console.warn("HANDLE DEEP LINK", data);
|
||||||
|
switch (data.screen) {
|
||||||
|
case 'historyItemDetails':
|
||||||
|
console.log("History Item");
|
||||||
|
this.goToScreen(data.screen, {
|
||||||
|
item: data.data
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
console.log("Not History Item");
|
||||||
this.goToScreen(data.screen, {
|
this.goToScreen(data.screen, {
|
||||||
id: data.data.id
|
id: data.data.id
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* if (data && data.id) {
|
/* if (data && data.id) {
|
||||||
this.goToScreen(data.screen, {
|
this.goToScreen(data.screen, {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -6,7 +6,8 @@ import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimen
|
||||||
import Icons from 'react-native-vector-icons/Ionicons'
|
import Icons from 'react-native-vector-icons/Ionicons'
|
||||||
import { updateCreditDemand } from "../../webservice/HistoryRequestApi";
|
import { updateCreditDemand } from "../../webservice/HistoryRequestApi";
|
||||||
import { readUser } from "../../webservice/AuthApi";
|
import { readUser } from "../../webservice/AuthApi";
|
||||||
let typesta = 0
|
let typesta = 0;
|
||||||
|
import isNil from 'lodash/isNil';
|
||||||
let moment = require('moment-timezone')
|
let moment = require('moment-timezone')
|
||||||
var colorback = 'white'
|
var colorback = 'white'
|
||||||
import I18n from "react-native-i18n";
|
import I18n from "react-native-i18n";
|
||||||
|
|
@ -36,13 +37,21 @@ class HistoryItemDetails extends Component {
|
||||||
static navigationOptions = ({ navigation }) => {
|
static navigationOptions = ({ navigation }) => {
|
||||||
return {
|
return {
|
||||||
drawerLabel: () => null,
|
drawerLabel: () => null,
|
||||||
title: "Transaction N°" + navigation.getParam("item", { id: "-" }).id
|
title: isNil(navigation.getParam("item", null).item) ?
|
||||||
|
"Transaction N°" + navigation.getParam("item", { id: "-" }).id :
|
||||||
|
"Transaction N°" + navigation.getParam("item", { id: "-" }).item.id
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.item = this.props.navigation.getParam("item", null);
|
this.item = this.props.navigation.getParam("item", null);
|
||||||
|
if(isNil(this.props.navigation.getParam("item", null).item)) {
|
||||||
|
this.item = this.props.navigation.getParam("item", null);
|
||||||
|
} else {
|
||||||
|
this.item = this.props.navigation.getParam("item", null).item;
|
||||||
|
}
|
||||||
|
console.log('HISTORY ITEM PROPS', this.props);
|
||||||
let sta = ''
|
let sta = ''
|
||||||
if (this.item.status === '1') {
|
if (this.item.status === '1') {
|
||||||
typesta = 1
|
typesta = 1
|
||||||
|
|
@ -261,6 +270,7 @@ class HistoryItemDetails extends Component {
|
||||||
if (resultTreatDemand.status === 200) {
|
if (resultTreatDemand.status === 200) {
|
||||||
this.displayToast(resultTreatDemand.response);
|
this.displayToast(resultTreatDemand.response);
|
||||||
this.props.navigation.goBack();
|
this.props.navigation.goBack();
|
||||||
|
if(!isNil(this.props.navigation.state.params.onGoBack))
|
||||||
this.props.navigation.state.params.onGoBack();
|
this.props.navigation.state.params.onGoBack();
|
||||||
this.props.creditCancelResetReducer();
|
this.props.creditCancelResetReducer();
|
||||||
this.props.creditDemandResetReducer();
|
this.props.creditDemandResetReducer();
|
||||||
|
|
@ -273,6 +283,7 @@ class HistoryItemDetails extends Component {
|
||||||
|
|
||||||
this.displayToast(resultCancelDemand.response);
|
this.displayToast(resultCancelDemand.response);
|
||||||
this.props.navigation.goBack();
|
this.props.navigation.goBack();
|
||||||
|
if(!isNil(this.props.navigation.state.params.onGoBack))
|
||||||
this.props.navigation.state.params.onGoBack();
|
this.props.navigation.state.params.onGoBack();
|
||||||
this.props.creditCancelResetReducer();
|
this.props.creditCancelResetReducer();
|
||||||
this.props.creditDemandResetReducer();
|
this.props.creditDemandResetReducer();
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,6 @@ class Home extends BaseScreen {
|
||||||
console.log("ONESIGNAL", global.onesignalIds);
|
console.log("ONESIGNAL", global.onesignalIds);
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
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,
|
||||||
|
|
@ -201,7 +200,6 @@ class Home extends BaseScreen {
|
||||||
player_id: onesignalIds,
|
player_id: onesignalIds,
|
||||||
set_default: false
|
set_default: false
|
||||||
}); */
|
}); */
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.saveOneSignal(true, {
|
this.saveOneSignal(true, {
|
||||||
user_code: user.user_code,
|
user_code: user.user_code,
|
||||||
|
|
@ -1572,7 +1570,7 @@ class Home extends BaseScreen {
|
||||||
translucent={true}
|
translucent={true}
|
||||||
/>
|
/>
|
||||||
{/* Start here to comment */}
|
{/* Start here to comment */}
|
||||||
{
|
{/* {
|
||||||
(this.state.loadingDialog || this.props.loading) ?
|
(this.state.loadingDialog || this.props.loading) ?
|
||||||
<View
|
<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' }}
|
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' }}
|
||||||
|
|
@ -1608,7 +1606,7 @@ class Home extends BaseScreen {
|
||||||
this.setState({ showProgress: false })
|
this.setState({ showProgress: false })
|
||||||
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
{this.makeCardSearch()}
|
{this.makeCardSearch()}
|
||||||
{this.makeSlidingUp()}
|
{this.makeSlidingUp()}
|
||||||
{this.makeDialogLoader()}
|
{this.makeDialogLoader()}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import Geolocation from 'react-native-geolocation-service';
|
||||||
import { identityPieces } from '../../utils/UtilsFunction';
|
import { identityPieces } from '../../utils/UtilsFunction';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { createIndentificationAction, createIndentificationResetAction } from '../../webservice/IdentificationApi';
|
import { createIndentificationAction, createIndentificationResetAction, getUserIdentificationAction } from '../../webservice/IdentificationApi';
|
||||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
|
|
||||||
|
|
@ -121,6 +121,7 @@ class CreateIdentificationUser extends Component {
|
||||||
{
|
{
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.createIndentificationResetAction();
|
this.props.createIndentificationResetAction();
|
||||||
|
this.props.getUserIdentificationAction(this.state.user.phone);
|
||||||
this.setState({ triggerSubmitClick: false });
|
this.setState({ triggerSubmitClick: false });
|
||||||
this.props.navigation.pop();
|
this.props.navigation.pop();
|
||||||
}
|
}
|
||||||
|
|
@ -580,7 +581,8 @@ const maptStateToProps = state => ({
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
createIndentificationAction,
|
createIndentificationAction,
|
||||||
createIndentificationResetAction
|
createIndentificationResetAction,
|
||||||
|
getUserIdentificationAction
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
export default connect(maptStateToProps, mapDispatchToProps)(CreateIdentificationUser);
|
export default connect(maptStateToProps, mapDispatchToProps)(CreateIdentificationUser);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import Geolocation from 'react-native-geolocation-service';
|
||||||
import { identityPieces } from '../../utils/UtilsFunction';
|
import { identityPieces } from '../../utils/UtilsFunction';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { createIndentificationAction, createIndentificationResetAction, getNumberResetAction, getNumberDetailAction } from '../../webservice/IdentificationApi';
|
import { createIndentificationAction, createIndentificationResetAction, getNumberResetAction, getNumberDetailAction, getUserIdentificationAction } from '../../webservice/IdentificationApi';
|
||||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
|
|
||||||
|
|
@ -126,6 +126,7 @@ class CreateIdentification extends Component {
|
||||||
{
|
{
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.createIndentificationResetAction();
|
this.props.createIndentificationResetAction();
|
||||||
|
this.props.getUserIdentificationAction(this.state.user.phone);
|
||||||
this.setState({ triggerSubmitClick: false });
|
this.setState({ triggerSubmitClick: false });
|
||||||
this.props.navigation.pop();
|
this.props.navigation.pop();
|
||||||
}
|
}
|
||||||
|
|
@ -704,7 +705,8 @@ const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
createIndentificationAction,
|
createIndentificationAction,
|
||||||
createIndentificationResetAction,
|
createIndentificationResetAction,
|
||||||
getNumberDetailAction,
|
getNumberDetailAction,
|
||||||
getNumberResetAction
|
getNumberResetAction,
|
||||||
|
getUserIdentificationAction
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
export default connect(maptStateToProps, mapDispatchToProps)(CreateIdentification);
|
export default connect(maptStateToProps, mapDispatchToProps)(CreateIdentification);
|
||||||
|
|
|
||||||
|
|
@ -107,9 +107,22 @@ class Notifications extends BaseScreen {
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={item.id}
|
key={item.id}
|
||||||
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}
|
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}
|
||||||
onPress={() => this.props.navigation.navigate(item.data.screen, {
|
onPress={() => {
|
||||||
|
switch (item.data.screen) {
|
||||||
|
case 'historyItemDetails':
|
||||||
|
this.props.navigation.navigate(item.data.screen, {
|
||||||
|
item: item.data.data
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
this.props.navigation.navigate(item.data.screen, {
|
||||||
id: item.data.data.id
|
id: item.data.data.id
|
||||||
})}>
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}}>
|
||||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||||
{/* <View style={styles.iconContent}>
|
{/* <View style={styles.iconContent}>
|
||||||
<Image style={{ width: 48, height: 48 }} source={{ uri: icon }} />
|
<Image style={{ width: 48, height: 48 }} source={{ uri: icon }} />
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,24 @@ export default class SplashScreen extends Component {
|
||||||
workUserResult(result) {
|
workUserResult(result) {
|
||||||
console.log("SPLASHSCREEN PROPS", this.props);
|
console.log("SPLASHSCREEN PROPS", this.props);
|
||||||
if (typeof this.props.navigation.state.params !== 'undefined') {
|
if (typeof this.props.navigation.state.params !== 'undefined') {
|
||||||
|
if (result === null || result === undefined) {
|
||||||
|
this.props.navigation.navigate("Auth");
|
||||||
|
} else {
|
||||||
|
switch (this.props.navigation.state.params.routeName) {
|
||||||
|
case 'historyItemDetails':
|
||||||
|
this.props.navigation.navigate(this.props.navigation.state.params.routeName, {
|
||||||
|
item: this.props.navigation.state.params.params
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
this.props.navigation.navigate(this.props.navigation.state.params.routeName, {
|
this.props.navigation.navigate(this.props.navigation.state.params.routeName, {
|
||||||
id: this.props.navigation.state.params.params.id
|
id: this.props.navigation.state.params.params.id
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var way = "";
|
var way = "";
|
||||||
var way2 = "";
|
var way2 = "";
|
||||||
|
|
|
||||||
|
|
@ -631,7 +631,7 @@ class WalletDetail extends Component {
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={() => { this.setState({ displaySuperHyperModalHistory: true, historyItemDetail: item }) }} style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
<TouchableOpacity onPress={() => { this.setState({ displaySuperHyperModalHistory: true, historyItemDetail: item }) }} style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
{
|
{
|
||||||
Object.keys(omit(item, ['id', 'id_transaction', 'date_cassation', 'etat', 'type', 'date_fin', 'duree_mois', 'id_epargne', 'type_historique', 'frais', 'init_country', 'final_country', 'source', 'emetteur', 'montant_net_final', 'montant_net_init', 'reseau_payeur', 'operation', 'retrait_cash', 'type_historique', 'type_caution', 'id_demande', 'montant_rembourse', 'partiellement_rembourse', 'duree_mois', 'etat', 'interet', 'taxe', 'date_validation', 'date_remboursement_prevu', 'date_remboursement', 'id_user', 'id_wallet_agent', 'id_network', 'user', 'user_phone', 'agent', 'codeParrain'])).map((element, i) => (
|
Object.keys(omit(item, ['id', 'id_transaction', 'montant2', 'date_cassation', 'etat', 'type', 'date_fin', 'duree_mois', 'id_epargne', 'type_historique', 'frais', 'init_country', 'final_country', 'source', 'emetteur', 'montant_net_final', 'montant_net_init', 'reseau_payeur', 'operation', 'retrait_cash', 'type_historique', 'type_caution', 'id_demande', 'montant_rembourse', 'partiellement_rembourse', 'duree_mois', 'etat', 'interet', 'taxe', 'date_validation', 'date_remboursement_prevu', 'date_remboursement', 'id_user', 'id_wallet_agent', 'id_network', 'user', 'user_phone', 'agent', 'codeParrain'])).map((element, i) => (
|
||||||
<View style={{ alignItems: 'center' }} key={i}>
|
<View style={{ alignItems: 'center' }} key={i}>
|
||||||
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
{
|
{
|
||||||
|
|
@ -915,7 +915,7 @@ class WalletDetail extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
|
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant}</Text>
|
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant2}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
|
||||||
|
|
@ -427,6 +427,7 @@
|
||||||
"SAVED": "Registered",
|
"SAVED": "Registered",
|
||||||
"CREATE": "Create",
|
"CREATE": "Create",
|
||||||
"JOIN": "Join",
|
"JOIN": "Join",
|
||||||
|
"INVALID_MONTANT": "Invalid amount",
|
||||||
"PROFILE_PICTURE": "Profile picture",
|
"PROFILE_PICTURE": "Profile picture",
|
||||||
"FRONT_FACE_CB": "CB front side",
|
"FRONT_FACE_CB": "CB front side",
|
||||||
"BACK_FACE_CB": "CB back side",
|
"BACK_FACE_CB": "CB back side",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue