Last commit before switching mac
This commit is contained in:
parent
5bfad5f025
commit
9363fc3f1d
File diff suppressed because one or more lines are too long
|
@ -249,7 +249,7 @@
|
||||||
"DELETE_GROUP": "Supprimer le groupe",
|
"DELETE_GROUP": "Supprimer le groupe",
|
||||||
"CREATOR": "Créateur",
|
"CREATOR": "Créateur",
|
||||||
"NOTIFICATIONS": "Notification",
|
"NOTIFICATIONS": "Notification",
|
||||||
"NO_NOTIFICATION": "Vous n'avez aucune Fnotification",
|
"NO_NOTIFICATION": "Vous n'avez aucune notification",
|
||||||
"CONFIGURATIONS": "Configuration",
|
"CONFIGURATIONS": "Configuration",
|
||||||
"LOGOUT": "Déconnexion",
|
"LOGOUT": "Déconnexion",
|
||||||
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
||||||
|
|
|
@ -90,7 +90,7 @@ export class HistoryItem extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
console.log("ITEM RENDER", this.props.selfData)
|
//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, {
|
||||||
|
@ -231,7 +231,7 @@ export class HistoryListItem extends React.Component {
|
||||||
|
|
||||||
};
|
};
|
||||||
_renderItem = ({item}) => {
|
_renderItem = ({item}) => {
|
||||||
console.log('ITEM ', item);
|
//console.log('ITEM ', item);
|
||||||
return (
|
return (
|
||||||
<HistoryItem
|
<HistoryItem
|
||||||
isDemandSend={this.props.isDemandSend}
|
isDemandSend={this.props.isDemandSend}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,147 +1,149 @@
|
||||||
|
import React from 'react';
|
||||||
|
import I18n from 'react-native-i18n'
|
||||||
|
import {demandeActionUrl, isDebugMode} from "./IlinkConstants"
|
||||||
|
|
||||||
|
import {readUser} from './AuthApi'
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
var DBEvents = require('react-native-db-models').DBEvents;
|
var DBEvents = require('react-native-db-models').DBEvents;
|
||||||
var db = require('./persistences/db.js');
|
var db = require('./persistences/db.js');
|
||||||
|
|
||||||
import I18n from 'react-native-i18n'
|
|
||||||
import { isDebugMode, adhesionUrl, locationActionUrl, memberActionUrl, networkActionUrl, demandeActionUrl } from "./IlinkConstants"
|
|
||||||
|
|
||||||
import { readUser } from './AuthApi'
|
|
||||||
export const loadDemandeCredit = async () => {
|
export const loadDemandeCredit = async () => {
|
||||||
const user = await readUser();
|
const user = await readUser();
|
||||||
const data = { "tag": "credit_demands", 'id': user.code_membre, "lang": I18n.currentLocale(), test: isDebugMode };
|
const data = {"tag": "credit_demands", 'id': user.code_membre, "lang": I18n.currentLocale(), test: isDebugMode};
|
||||||
|
|
||||||
const response = await fetch(demandeActionUrl, {
|
const response = await fetch(demandeActionUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
let responseJson = await response.json()
|
let responseJson = await response.json()
|
||||||
console.log(responseJson)
|
console.log(responseJson)
|
||||||
return responseJson;
|
return responseJson;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(response.text())
|
console.log(response.text())
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
export const loadMyDemandeCredit = async () => {
|
export const loadMyDemandeCredit = async () => {
|
||||||
const user = await readUser();
|
const user = await readUser();
|
||||||
console.log("USER ID", user.agentId);
|
console.log("USER ID", user.agentId);
|
||||||
const data = {
|
const data = {
|
||||||
"tag": "credit_demands_of_agent", id: user.agentId
|
"tag": "credit_demands_of_agent", id: user.agentId
|
||||||
, "lang": I18n.currentLocale(),
|
, "lang": I18n.currentLocale(),
|
||||||
test: isDebugMode
|
test: isDebugMode
|
||||||
|
|
||||||
};
|
};
|
||||||
console.log(data)
|
console.log(data)
|
||||||
const response = await fetch(demandeActionUrl, {
|
const response = await fetch(demandeActionUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
console.log(response, "my demande")
|
console.log(response, "my demande")
|
||||||
let responseJson = await response.json()
|
let responseJson = await response.json()
|
||||||
console.log(responseJson)
|
console.log(responseJson)
|
||||||
return responseJson;
|
return responseJson;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
export const updateCreditDemand = (phone, id) => {
|
export const updateCreditDemand = (phone, id) => {
|
||||||
const data = {
|
const data = {
|
||||||
"tag": "update_ask_credit", "phone": phone, "id": id,
|
"tag": "update_ask_credit", "phone": phone, "id": id,
|
||||||
"lang": I18n.currentLocale(),
|
"lang": I18n.currentLocale(),
|
||||||
test: isDebugMode
|
test: isDebugMode
|
||||||
}
|
}
|
||||||
return fetch(demandeActionUrl, {
|
return fetch(demandeActionUrl, {
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
return response.json()
|
return response.json()
|
||||||
})
|
})
|
||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
return responseJson
|
return responseJson
|
||||||
})
|
})
|
||||||
.catch((error) => { console.warn(error) })
|
.catch((error) => {
|
||||||
|
console.warn(error)
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sendDemande = async (credit) => {
|
export const sendDemande = async (credit) => {
|
||||||
const muser = await readUser()
|
const muser = await readUser()
|
||||||
if (muser !== undefined && muser.code_parrain !== undefined
|
if (muser !== undefined && muser.code_parrain !== undefined
|
||||||
&& muser.code_membre !== undefined &&
|
&& muser.code_membre !== undefined &&
|
||||||
muser.code_membre !== muser.code_parrain) {
|
muser.code_membre !== muser.code_parrain) {
|
||||||
let data = {
|
let data = {
|
||||||
"tag": "ask_credit",
|
"tag": "ask_credit",
|
||||||
"phone": muser.phone,
|
"phone": muser.phone,
|
||||||
"code": muser.code,
|
"code": muser.code,
|
||||||
"lang": I18n.currentLocale(),
|
"lang": I18n.currentLocale(),
|
||||||
test: isDebugMode,
|
test: isDebugMode,
|
||||||
"montant": credit
|
"montant": credit
|
||||||
};
|
};
|
||||||
|
|
||||||
let response = await fetch(demandeActionUrl, {
|
let response = await fetch(demandeActionUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
})
|
})
|
||||||
let responseTxt = "";
|
let responseTxt = "";
|
||||||
try {
|
try {
|
||||||
responseTxt = await response.text()
|
responseTxt = await response.text()
|
||||||
let responseJson = JSON.parse(responseTxt)
|
let responseJson = JSON.parse(responseTxt)
|
||||||
return responseJson
|
return responseJson
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
console.log("error", responseTxt)
|
console.log("error", responseTxt)
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
} else
|
} else
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
export const sendDemandeSpecificque = async (credit, phone, code_membre) => {
|
export const sendDemandeSpecificque = async (credit, phone, code_membre) => {
|
||||||
let data = {
|
let data = {
|
||||||
"tag": "ask_credit",
|
"tag": "ask_credit",
|
||||||
"phone": phone,
|
"phone": phone,
|
||||||
test: isDebugMode,
|
test: isDebugMode,
|
||||||
code: code_membre,
|
code: code_membre,
|
||||||
"montant": credit, "lang": I18n.currentLocale()
|
"montant": credit, "lang": I18n.currentLocale()
|
||||||
};
|
};
|
||||||
|
|
||||||
let response = await fetch(demandeActionUrl, {
|
let response = await fetch(demandeActionUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
})
|
})
|
||||||
try {
|
try {
|
||||||
let responseJson = await response.json()
|
let responseJson = await response.json()
|
||||||
console.log(responseJson)
|
console.warn("server response", responseJson);
|
||||||
return responseJson
|
return responseJson
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(response)
|
console.warn("server response", response);
|
||||||
console.warn(e)
|
console.warn("server response", e);
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue