bug envoie cash a cash ok

This commit is contained in:
Brice Zele 2020-10-25 17:39:19 +01:00
parent 4a539e7c41
commit f5ca018edb
9 changed files with 260 additions and 233 deletions

File diff suppressed because one or more lines are too long

View File

@ -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",

View File

@ -463,6 +463,7 @@
"ASK_REQUEST_HISTORY": "Demander un historique", "ASK_REQUEST_HISTORY": "Demander un historique",
"GIVE_HISTORY_INFO": "Informations sur votre historique", "GIVE_HISTORY_INFO": "Informations sur votre historique",
"HISTORY_TYPE": "Type", "HISTORY_TYPE": "Type",
"INVALID_MONTANT": "Montant invalide",
"HISTORY_TYPE_ASK": "Demandes", "HISTORY_TYPE_ASK": "Demandes",
"DEMANDE_RECEIVE": "Demandes reçues", "DEMANDE_RECEIVE": "Demandes reçues",
"MY_DEMANDE": "Mes demandes", "MY_DEMANDE": "Mes demandes",

View File

@ -108,7 +108,7 @@ class Home extends BaseScreen {
this.promiseRegion = new Promise(async (resolve, reject) => { this.promiseRegion = new Promise(async (resolve, reject) => {
this.setState({ isNeedLoadMore: false, isLoadingMap: true }) this.setState({ isNeedLoadMore: false, isLoadingMap: true })
const camera = await this.mapRef.getCamera() const camera = await this.mapRef.getCamera();//comment this
const zoom = camera.zoom - 10 const zoom = camera.zoom - 10
let res = []; let res = [];
@ -274,6 +274,7 @@ class Home extends BaseScreen {
} }
componentDidMount() { componentDidMount() {
//this.onMapReady();//comment thi
readUser().then(async (user) => { readUser().then(async (user) => {
if (user) { if (user) {
if (user !== undefined) { if (user !== undefined) {
@ -605,13 +606,14 @@ class Home extends BaseScreen {
} }
this.setState({ myPosition: myPosition, region: reg }); this.setState({ myPosition: myPosition, region: reg });
if (this.mapRef && !this.state.myPositionIsAnimated) { if (this.mapRef && !this.state.myPositionIsAnimated) {
//comment
this.mapRef.animateCamera({ this.mapRef.animateCamera({
center: myPosition, center: myPosition,
pitch: 0, pitch: 0,
heading: 0, heading: 0,
altitude: 5, altitude: 5,
zoom: 12 zoom: 12
}, 1000) }, 1000);
this.setState({ myPositionIsAnimated: true }) this.setState({ myPositionIsAnimated: true })
} }
@ -1457,6 +1459,7 @@ class Home extends BaseScreen {
</View> </View>
</React.Fragment>) </React.Fragment>)
} }
renderFilterMarker() { renderFilterMarker() {
if (this.state.showFilterDistance) if (this.state.showFilterDistance)
return (<View style={{ height: responsiveHeight(80), justifyContent: 'center', backgroundColor: 'white', margin: 20 }}> return (<View style={{ height: responsiveHeight(80), justifyContent: 'center', backgroundColor: 'white', margin: 20 }}>
@ -1579,7 +1582,6 @@ class Home extends BaseScreen {
<Text style={{ fontSize: 20, color: 'white', fontWeight: 'bold' }}>{I18n.t("LOADING_DOTS")}</Text> <Text style={{ fontSize: 20, color: 'white', fontWeight: 'bold' }}>{I18n.t("LOADING_DOTS")}</Text>
</View> : null </View> : null
} }
<IMap <IMap
ref={(re) => { ref={(re) => {
this.map = re this.map = re

View File

@ -545,7 +545,7 @@ export default class OptionsMenu extends Component {
disconnect().then(() => { disconnect().then(() => {
IlinkEmitter.emit("userdisconnect"); IlinkEmitter.emit("userdisconnect");
AsyncStorage.clear(); AsyncStorage.clear();
this.props.navigation.navigate("Auth") this.props.navigation.navigate("Auth");
}) })
} }
}, },

View File

@ -433,10 +433,7 @@ class WalletOptionSelect extends Component {
</View> </View>
)) ))
: :
readUser().then((user) => { Object.keys(omit(item, ['id', 'type', 'id_epargne', 'type_historique', 'date_demande', 'date_fin', 'date_remboursement_prevu', 'date_validation', 'date_cassation', 'date_remboursement', 'id_demande', 'duree_mois', 'taxe', '', 'date_fin', 'date_cassation', 'etat', 'id_user', 'id_network', 'user', 'partiellement_rembourse', 'user_phone', 'type_caution', 'interet', 'date_remboursement_prevu', 'date_remboursement', 'id_wallet_agent', 'retrait_cash', 'codeParrain', 'agent', 'montant_rembourse', ''])).map((element, i) => (
(user !== undefined) &&
(typeof user.category === 'undefined') &&
Object.keys(omit(item, ['id', 'type', 'id_epargne', 'date_demande', 'id_demande', 'duree_mois', 'taxe', '', 'date_fin', 'date_cassation', 'etat', 'id_user', 'id_network', 'user', 'partiellement_rembourse', 'user_phone', 'type_caution', 'interet', 'date_remboursement_prevu', 'date_remboursement', 'id_wallet_agent', 'retrait_cash', 'codeParrain', 'agent', 'montant_rembourse', ''])).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 }}>
@ -444,15 +441,12 @@ class WalletOptionSelect extends Component {
isEqual(element, 'montant') ? isEqual(element, 'montant') ?
` ${thousands(item[element], ' ')} ${this.state.wallet.currency_code}` ` ${thousands(item[element], ' ')} ${this.state.wallet.currency_code}`
: isEqual(element, 'date_creation') ? : isEqual(element, 'date_creation') ?
cutStringWithoutDot(item[element], 16) : cutStringWithoutDot(item[element], 16)
isEqual(element, 'type_historique') ?
displayTransactionType(item[element])
: item[element] : item[element]
} }
</Text> </Text>
</View> </View>
)) ))
})
} }
</TouchableOpacity> </TouchableOpacity>
); );

View File

@ -194,6 +194,11 @@ class EnvoieWalletToCashUser extends Component {
[ [
{ {
text: I18n.t("OK"), onPress: () => { text: I18n.t("OK"), onPress: () => {
this.setState({
isDataSubmit: false,
isModalConfirmVisible: false,
triggerSubmitClick: false
});
this.props.getPayCountryNetworkReset(); this.props.getPayCountryNetworkReset();
} }
} }
@ -209,6 +214,11 @@ class EnvoieWalletToCashUser extends Component {
{ {
text: I18n.t("OK"), onPress: () => { text: I18n.t("OK"), onPress: () => {
this.props.getPayCountryNetworkReset(); this.props.getPayCountryNetworkReset();
this.setState({
isDataSubmit: false,
isModalConfirmVisible: false,
triggerSubmitClick: false
});
} }
} }
@ -231,6 +241,11 @@ class EnvoieWalletToCashUser extends Component {
[ [
{ {
text: I18n.t("OK"), onPress: () => { text: I18n.t("OK"), onPress: () => {
this.setState({
isDataSubmit: false,
isModalConfirmVisible: false,
triggerSubmitClick: false
});
this.props.envoieUserWalletToCashReset(); this.props.envoieUserWalletToCashReset();
} }
} }
@ -251,7 +266,11 @@ class EnvoieWalletToCashUser extends Component {
this.props.envoieUserWalletToCashReset(); this.props.envoieUserWalletToCashReset();
IlinkEmitter.emit("refreshWallet"); IlinkEmitter.emit("refreshWallet");
this.props.navigation.pop(); this.props.navigation.pop();
} this.setState({
isDataSubmit: false,
isModalConfirmVisible: false,
triggerSubmitClick: false
}); }
} }
], ],
@ -273,6 +292,11 @@ class EnvoieWalletToCashUser extends Component {
[ [
{ {
text: I18n.t("OK"), onPress: () => { text: I18n.t("OK"), onPress: () => {
this.setState({
isDataSubmit: false,
isModalConfirmVisible: false,
triggerSubmitClick: false
});
this.props.getCommissionUserWalletToCashReset(); this.props.getCommissionUserWalletToCashReset();
} }
} }
@ -387,11 +411,14 @@ class EnvoieWalletToCashUser extends Component {
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => { <Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => {
this.setState({ this.setState({
isModalConfirmVisible: false isDataSubmit: false,
isModalConfirmVisible: false,
triggerSubmitClick: false
}); });
}} /> }} />
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => { <Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
this.setState({ this.setState({
triggerSubmitClick: false,
isModalConfirmVisible: false, isModalConfirmVisible: false,
isDataSubmit: true isDataSubmit: true
}); });
@ -474,7 +501,7 @@ class EnvoieWalletToCashUser extends Component {
{(this.state.modalVisible || this.props.loadingEnvoieWalletToCashGetCommission || this.props.loadingEnvoieWalletToCash || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()} {(this.state.modalVisible || this.props.loadingEnvoieWalletToCashGetCommission || this.props.loadingEnvoieWalletToCash || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()}
{this.state.hasLoadActiveCountryList && this.renderGetActionCountryList()} {this.state.hasLoadActiveCountryList && this.renderGetActionCountryList()}
{this.state.hasLoadActivePayCountryNetworkList && this.renderGetPayCountryNetworkResponse()} {this.state.hasLoadActivePayCountryNetworkList && this.renderGetPayCountryNetworkResponse()}
{this.state.isDataSubmit && this.renderEnvoieWalletToWalletResponse()} {(this.state.isDataSubmit && !this.state.triggerSubmitClick) && this.renderEnvoieWalletToWalletResponse()}
{this.state.triggerSubmitClick && this.renderDialogGetCommissionResponse()} {this.state.triggerSubmitClick && this.renderDialogGetCommissionResponse()}
{ {
(resultEnvoieWalletToCashGetCommission !== null) && (resultEnvoieWalletToCashGetCommission !== null) &&

View File

@ -463,6 +463,7 @@
"ASK_REQUEST_HISTORY": "Demander un historique", "ASK_REQUEST_HISTORY": "Demander un historique",
"GIVE_HISTORY_INFO": "Informations sur votre historique", "GIVE_HISTORY_INFO": "Informations sur votre historique",
"HISTORY_TYPE": "Type", "HISTORY_TYPE": "Type",
"INVALID_MONTANT": "Montant invalide",
"HISTORY_TYPE_ASK": "Demandes", "HISTORY_TYPE_ASK": "Demandes",
"DEMANDE_RECEIVE": "Demandes reçues", "DEMANDE_RECEIVE": "Demandes reçues",
"MY_DEMANDE": "Mes demandes", "MY_DEMANDE": "Mes demandes",

View File

@ -80,7 +80,8 @@ const queryMap = async (data) => {
let responseText = await response.text() let responseText = await response.text()
//console.log("response= " + responseText) //console.log("response= " + responseText)
try { try {
let responseJson = JSON.parse(responseText) let responseJson = JSON.parse(responseText);
console.warn("JSON RESPONSE", responseJson);
return responseJson; return responseJson;
} catch (e) { } catch (e) {
//console.log("erreur=" + responseText) //console.log("erreur=" + responseText)