notification demand request OK
This commit is contained in:
parent
e597ceb6c3
commit
4a539e7c41
34
App.js
34
App.js
|
|
@ -438,11 +438,19 @@ class App extends React.Component {
|
|||
|
||||
goToScreen = (routeName, params, isReset = true) => {
|
||||
const { navigator } = this.refs;
|
||||
if (typeof this.refs.navigator !== 'undefined') {
|
||||
if (typeof navigator !== 'undefined') {
|
||||
console.log("APP HAS LOADED", global.appHasLoaded);
|
||||
if (global.appHasLoaded) {
|
||||
readUser().then((result) => {
|
||||
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName,
|
||||
params
|
||||
});
|
||||
/* readUser().then((result) => {
|
||||
if (result === null || result === undefined) {
|
||||
console.warn("APP HAS LOADED NOTIFICATION PARAMS", params);
|
||||
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName: "first",
|
||||
|
|
@ -455,9 +463,8 @@ class App extends React.Component {
|
|||
params
|
||||
});
|
||||
}
|
||||
});
|
||||
}); */
|
||||
} else {
|
||||
console.warn("NOTIFICATION PARAMS", params);
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName: "first",
|
||||
|
|
@ -471,9 +478,22 @@ class App extends React.Component {
|
|||
const data = openResult.notification.payload.additionalData;
|
||||
//const dataParse = data.replace("'", "\"");
|
||||
console.warn("HANDLE DEEP LINK", data);
|
||||
this.goToScreen(data.screen, {
|
||||
id: data.data.id
|
||||
});
|
||||
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, {
|
||||
id: data.data.id
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
/* if (data && data.id) {
|
||||
this.goToScreen(data.screen, {
|
||||
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 { updateCreditDemand } from "../../webservice/HistoryRequestApi";
|
||||
import { readUser } from "../../webservice/AuthApi";
|
||||
let typesta = 0
|
||||
let typesta = 0;
|
||||
import isNil from 'lodash/isNil';
|
||||
let moment = require('moment-timezone')
|
||||
var colorback = 'white'
|
||||
import I18n from "react-native-i18n";
|
||||
|
|
@ -36,13 +37,21 @@ class HistoryItemDetails extends Component {
|
|||
static navigationOptions = ({ navigation }) => {
|
||||
return {
|
||||
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) {
|
||||
super(props);
|
||||
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 = ''
|
||||
if (this.item.status === '1') {
|
||||
typesta = 1
|
||||
|
|
@ -261,7 +270,8 @@ class HistoryItemDetails extends Component {
|
|||
if (resultTreatDemand.status === 200) {
|
||||
this.displayToast(resultTreatDemand.response);
|
||||
this.props.navigation.goBack();
|
||||
this.props.navigation.state.params.onGoBack();
|
||||
if(!isNil(this.props.navigation.state.params.onGoBack))
|
||||
this.props.navigation.state.params.onGoBack();
|
||||
this.props.creditCancelResetReducer();
|
||||
this.props.creditDemandResetReducer();
|
||||
}
|
||||
|
|
@ -273,7 +283,8 @@ class HistoryItemDetails extends Component {
|
|||
|
||||
this.displayToast(resultCancelDemand.response);
|
||||
this.props.navigation.goBack();
|
||||
this.props.navigation.state.params.onGoBack();
|
||||
if(!isNil(this.props.navigation.state.params.onGoBack))
|
||||
this.props.navigation.state.params.onGoBack();
|
||||
this.props.creditCancelResetReducer();
|
||||
this.props.creditDemandResetReducer();
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,6 @@ class Home extends BaseScreen {
|
|||
console.log("ONESIGNAL", global.onesignalIds);
|
||||
if (user !== undefined) {
|
||||
if (user.category !== undefined) {
|
||||
if (user.category === "geolocated") {
|
||||
this.saveOneSignal(false, {
|
||||
code_membre: user.code_membre,
|
||||
player_id: global.onesignalIds,
|
||||
|
|
@ -201,7 +200,6 @@ class Home extends BaseScreen {
|
|||
player_id: onesignalIds,
|
||||
set_default: false
|
||||
}); */
|
||||
}
|
||||
} else {
|
||||
this.saveOneSignal(true, {
|
||||
user_code: user.user_code,
|
||||
|
|
@ -1572,7 +1570,7 @@ class Home extends BaseScreen {
|
|||
translucent={true}
|
||||
/>
|
||||
{/* Start here to comment */}
|
||||
{
|
||||
{/* {
|
||||
(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' }}
|
||||
|
|
@ -1608,7 +1606,7 @@ class Home extends BaseScreen {
|
|||
this.setState({ showProgress: false })
|
||||
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
||||
}}
|
||||
/>
|
||||
/> */}
|
||||
{this.makeCardSearch()}
|
||||
{this.makeSlidingUp()}
|
||||
{this.makeDialogLoader()}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import Geolocation from 'react-native-geolocation-service';
|
|||
import { identityPieces } from '../../utils/UtilsFunction';
|
||||
import { connect } from 'react-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 moment = require('moment');
|
||||
|
||||
|
|
@ -121,6 +121,7 @@ class CreateIdentificationUser extends Component {
|
|||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.createIndentificationResetAction();
|
||||
this.props.getUserIdentificationAction(this.state.user.phone);
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
|
|
@ -580,7 +581,8 @@ const maptStateToProps = state => ({
|
|||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
createIndentificationAction,
|
||||
createIndentificationResetAction
|
||||
createIndentificationResetAction,
|
||||
getUserIdentificationAction
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(CreateIdentificationUser);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import Geolocation from 'react-native-geolocation-service';
|
|||
import { identityPieces } from '../../utils/UtilsFunction';
|
||||
import { connect } from 'react-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 moment = require('moment');
|
||||
|
||||
|
|
@ -126,6 +126,7 @@ class CreateIdentification extends Component {
|
|||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.createIndentificationResetAction();
|
||||
this.props.getUserIdentificationAction(this.state.user.phone);
|
||||
this.setState({ triggerSubmitClick: false });
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
|
|
@ -704,7 +705,8 @@ const mapDispatchToProps = dispatch => bindActionCreators({
|
|||
createIndentificationAction,
|
||||
createIndentificationResetAction,
|
||||
getNumberDetailAction,
|
||||
getNumberResetAction
|
||||
getNumberResetAction,
|
||||
getUserIdentificationAction
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(CreateIdentification);
|
||||
|
|
|
|||
|
|
@ -107,9 +107,22 @@ class Notifications extends BaseScreen {
|
|||
<TouchableOpacity
|
||||
key={item.id}
|
||||
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}
|
||||
onPress={() => this.props.navigation.navigate(item.data.screen, {
|
||||
id: item.data.data.id
|
||||
})}>
|
||||
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
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
}}>
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||
{/* <View style={styles.iconContent}>
|
||||
<Image style={{ width: 48, height: 48 }} source={{ uri: icon }} />
|
||||
|
|
|
|||
|
|
@ -54,9 +54,24 @@ export default class SplashScreen extends Component {
|
|||
workUserResult(result) {
|
||||
console.log("SPLASHSCREEN PROPS", this.props);
|
||||
if (typeof this.props.navigation.state.params !== 'undefined') {
|
||||
this.props.navigation.navigate(this.props.navigation.state.params.routeName, {
|
||||
id: this.props.navigation.state.params.params.id
|
||||
});
|
||||
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, {
|
||||
id: this.props.navigation.state.params.params.id
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
var way = "";
|
||||
var way2 = "";
|
||||
|
|
|
|||
|
|
@ -631,7 +631,7 @@ class WalletDetail extends Component {
|
|||
return (
|
||||
<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}>
|
||||
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||
{
|
||||
|
|
@ -915,7 +915,7 @@ class WalletDetail extends Component {
|
|||
<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>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant2}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
|
|
|
|||
|
|
@ -427,6 +427,7 @@
|
|||
"SAVED": "Registered",
|
||||
"CREATE": "Create",
|
||||
"JOIN": "Join",
|
||||
"INVALID_MONTANT": "Invalid amount",
|
||||
"PROFILE_PICTURE": "Profile picture",
|
||||
"FRONT_FACE_CB": "CB front side",
|
||||
"BACK_FACE_CB": "CB back side",
|
||||
|
|
|
|||
Loading…
Reference in New Issue