group display with account

This commit is contained in:
Brice Zele 2020-05-19 08:57:56 +01:00
parent 4c45aa6e42
commit 5344a3c2a2
18 changed files with 3059 additions and 2807 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,9 @@
"ABOUT_TEXT": "iLink is an application that will facilitate your financial transactions near your location, and give you multiservice points near you.", "ABOUT_TEXT": "iLink is an application that will facilitate your financial transactions near your location, and give you multiservice points near you.",
"GEOLOCATED_USER": "Geo located user", "GEOLOCATED_USER": "Geo located user",
"SUPERVISOR": "Supervisor", "SUPERVISOR": "Supervisor",
"THE_SUPERVISOR": "Supervisor",
"AGENT": "Agent", "AGENT": "Agent",
"THE_AGENT": "Agent",
"USER": "User", "USER": "User",
"HYPERVISOR": "Hypervisor", "HYPERVISOR": "Hypervisor",
"OPEN": "Open", "OPEN": "Open",
@ -267,6 +269,7 @@
"MY_DEMANDE": "My requests", "MY_DEMANDE": "My requests",
"PHONE_TRANSACTION": "Transaction number", "PHONE_TRANSACTION": "Transaction number",
"DEMAND_TEXT_FIRST_PART": "made a request for", "DEMAND_TEXT_FIRST_PART": "made a request for",
"DEMAND_TEXT_FIRST_PART_YOU": "You made a request for ",
"REQUEST_SEND": "Request Sent", "REQUEST_SEND": "Request Sent",
"DEMAND_RECEIVE": "Requests received", "DEMAND_RECEIVE": "Requests received",
"TO_": "credit to", "TO_": "credit to",
@ -321,8 +324,12 @@
"TEXT_NETWORK_UNABLE": "Network not available, want to try again?", "TEXT_NETWORK_UNABLE": "Network not available, want to try again?",
"LOADING_TEXT_MARKERS": "More points", "LOADING_TEXT_MARKERS": "More points",
"LOADING_TEXT_MARKERS_2": "around,", "LOADING_TEXT_MARKERS_2": "around,",
"NO_NETWORK_MARKER": "No points found in the area ",
"NO_POINT_FOUND": "No points found ",
"LAUNCH_POINT_WITH_FILTER": "Do you want to restart the search within a radius of ",
"UNABLE_GET_INFORMATION": "Problem of retrieval of information", "UNABLE_GET_INFORMATION": "Problem of retrieval of information",
"UNABLE_GET_INFORMATION_TEXT": "Make sure your GPS is turned on and put in high precision mode and restart iLink World", "UNABLE_GET_INFORMATION_TEXT": "Make sure your GPS is turned on and put in high precision mode and restart iLink World",
"TITLE_HELP_SOON": "Help not available!", "TITLE_HELP_SOON": "Help not available!",
"YOUR_NETWORK": "Select your network",
"HELP_SOON": "A tutorial helping you in understanding the features of the application will soon be available." "HELP_SOON": "A tutorial helping you in understanding the features of the application will soon be available."
} }

View File

@ -8,9 +8,12 @@
"ABOUT_TEXT": "iLink est une application qui facilitera vos transactions financières près de votre position, et vous donne les points multiservices prêt de chez vous.", "ABOUT_TEXT": "iLink est une application qui facilitera vos transactions financières près de votre position, et vous donne les points multiservices prêt de chez vous.",
"GEOLOCATED_USER": "Utilisateur géo-localisé", "GEOLOCATED_USER": "Utilisateur géo-localisé",
"SUPERVISOR": "Superviseur", "SUPERVISOR": "Superviseur",
"THE_SUPERVISOR": "Le superviseur",
"AGENT": "Agent", "AGENT": "Agent",
"THE_AGENT": "L'agent",
"USER": "Utilisateur", "USER": "Utilisateur",
"HYPERVISOR": "Hyperviseur", "HYPERVISOR": "Hyperviseur",
"YOU_HAVE": "Vous avez",
"OPEN": "Ouvert", "OPEN": "Ouvert",
"POSITION": "Ma position", "POSITION": "Ma position",
"TAKE_MY_PLACE": "Prendre ma position", "TAKE_MY_PLACE": "Prendre ma position",
@ -268,6 +271,7 @@
"MY_DEMANDE": "Mes demandes", "MY_DEMANDE": "Mes demandes",
"PHONE_TRANSACTION": "Numéro de transaction", "PHONE_TRANSACTION": "Numéro de transaction",
"DEMAND_TEXT_FIRST_PART": "a effectué une demande de ", "DEMAND_TEXT_FIRST_PART": "a effectué une demande de ",
"DEMAND_TEXT_FIRST_PART_YOU": "Vous avez effectué une demande de ",
"DEMANDE_SEND": " Demande Envoyée", "DEMANDE_SEND": " Demande Envoyée",
"DEMAND_RECEIVE": "Demandes reçues", "DEMAND_RECEIVE": "Demandes reçues",
"TO_": " crédit auprès de ", "TO_": " crédit auprès de ",
@ -320,9 +324,13 @@
"TEXT_FORGOTTEN_PASSWORD": "Saisissez votre identifiant,nous vous enverrons un nouveau mot de passe\n", "TEXT_FORGOTTEN_PASSWORD": "Saisissez votre identifiant,nous vous enverrons un nouveau mot de passe\n",
"TEXT_NETWORK_UNABLE": "Réseau non disponible, voulez vous réessayer ?", "TEXT_NETWORK_UNABLE": "Réseau non disponible, voulez vous réessayer ?",
"LOADING_TEXT_MARKERS": "Suite des points ", "LOADING_TEXT_MARKERS": "Suite des points ",
"NO_NETWORK_MARKER": "Aucun point trouvé dans la zone ",
"NO_POINT_FOUND": "Aucun point trouvé ",
"LAUNCH_POINT_WITH_FILTER": "Voulez-vous relancer la recherche dans un rayon de ",
"LOADING_TEXT_MARKERS_2": "autour", "LOADING_TEXT_MARKERS_2": "autour",
"UNABLE_GET_INFORMATION": "Problème de récuperation des Informations", "UNABLE_GET_INFORMATION": "Problème de récuperation des Informations",
"UNABLE_GET_INFORMATION_TEXT": "Vérifiez que votre GPS est activé et mis en mode haute precision et relancez iLink World", "UNABLE_GET_INFORMATION_TEXT": "Vérifiez que votre GPS est activé et mis en mode haute precision et relancez iLink World",
"TITLE_HELP_SOON": "Aide non disponible !", "TITLE_HELP_SOON": "Aide non disponible !",
"YOUR_NETWORK": "Sélectionner votre réseau",
"HELP_SOON": "Un tutoriel vous aidant dans la compréhension des fonctionnalités de l'application vous sera bientôt mis à disposition." "HELP_SOON": "Un tutoriel vous aidant dans la compréhension des fonctionnalités de l'application vous sera bientôt mis à disposition."
} }

View File

@ -8,7 +8,7 @@
"postinstall": "node ./fix-android/android-release-fix.js", "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", "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", "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_6P_API_29 -dns-server 8.8.8.8", "start-emulator": "emulator -avd Nexus_5X_API_R -dns-server 8.8.8.8",
"start-emulator-pixel": "emulator -avd Pixel_2_API_29_1 -dns-server 8.8.8.8", "start-emulator-pixel": "emulator -avd Pixel_2_API_29_1 -dns-server 8.8.8.8",
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android", "run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
"run-release": "cd android && ./gradlew clean && cd .. && react-native run-android --variant=release" "run-release": "cd android && ./gradlew clean && cd .. && react-native run-android --variant=release"

View File

@ -8,7 +8,8 @@ import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimen
import { listAllMembers } from './../../webservice/MemberGeolocatedApi' import { listAllMembers } from './../../webservice/MemberGeolocatedApi'
import { listFreeCodesSuperViseur } from './../../webservice/NetworkApi' import { listFreeCodesSuperViseur } from './../../webservice/NetworkApi'
import { readUser, listDemandAdhesion, acceptDemandAdhesion, deleteUser } from "../../webservice/AuthApi"; import { readUser, listDemandAdhesion, acceptDemandAdhesion, deleteUser } from "../../webservice/AuthApi";
import Icon from 'react-native-vector-icons/MaterialIcons' import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import Icons from 'react-native-vector-icons/Ionicons'
import Swipeout from 'react-native-swipeout' import Swipeout from 'react-native-swipeout'
import { theme } from "../BaseScreen"; import { theme } from "../BaseScreen";
require("./../../utils/Translations"); require("./../../utils/Translations");
@ -16,6 +17,7 @@ import I18n from 'react-native-i18n'
const route = require('./../../route.json') const route = require('./../../route.json')
import LottieView from 'lottie-react-native'; // if you have "esModuleInterop": true import LottieView from 'lottie-react-native'; // if you have "esModuleInterop": true
import { IndicatorViewPager, PagerTabIndicator } from 'react-native-best-viewpager'; import { IndicatorViewPager, PagerTabIndicator } from 'react-native-best-viewpager';
import Tag from '../../components/Tag';
import { Card, CardTitle, CardContent, CardAction, CardButton, CardImage } from 'react-native-material-cards' import { Card, CardTitle, CardContent, CardAction, CardButton, CardImage } from 'react-native-material-cards'
let moment = require('moment-timezone'); let moment = require('moment-timezone');
@ -28,6 +30,10 @@ import 'moment/locale/en-il'
import 'moment/locale/en-nz' import 'moment/locale/en-nz'
import { Header } from "react-native-elements"; import { Header } from "react-native-elements";
import { IlinkEmitter } from "../../utils/events"; import { IlinkEmitter } from "../../utils/events";
import DeviceInfo from 'react-native-device-info'
import { Color } from '../../config/Color'
import { Typography, FontWeight } from '../../config/typography'
import { thousandsSeparators } from '../../utils/UtilsFunction'
var users = null; var users = null;
@ -117,6 +123,8 @@ export default class SuperViseurGroupeHome extends BaseScreen {
} }
}) })
IlinkEmitter.on("langueChange", this.updateLangue.bind(this)) IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
} }
updateLangue() { updateLangue() {
@ -270,7 +278,83 @@ export default class SuperViseurGroupeHome extends BaseScreen {
subtitle={item.adresse} subtitle={item.adresse}
/> />
<CardContent> <CardContent>
<View Style={{ flex: 1, flexDirection: 'row' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<View style={{ flex: 1, alignItems: 'flex-start' }}>
<View style={{
flexDirection: 'row',
backgroundColor: theme.primary,
justifyContent: 'center',
marginRight: 10,
width: 150,
marginTop: 35,
alignItems: 'center',
borderRadius: 10,
}}>
<Icon name={"phone"} color={"white"} size={24}
style={styles.callIcon} />
<Text style={styles.phone}>{item.phone}</Text>
</View>
</View>
<View style={{
width: 1,
backgroundColor: Color.borderColor
}} />
<View style={{ flex: 1, flexDirection: 'column' }}>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
}}>
<View
style={[
styles.circlePoint,
{ backgroundColor: Color.whiteColor },
]}>
<Icons name='md-wallet'
size={32}
color={Color.primaryColor}
/>
</View>
<View>
<Text style={[Typography.title3, Color.primaryColor], { marginBottom: 1 }}>
{I18n.t('PRINCIPAL_ACCOUNT_TITLE')}
</Text>
<Text style={[Typography.body2]}>{thousandsSeparators(item.balance_princ)}</Text>
</View>
</View>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
}}>
<View
style={[
styles.circlePoint,
{ backgroundColor: Color.whiteColor },
]}>
<Icons name='md-cash'
size={32}
color={Color.primaryColor}
/>
</View>
<View>
<Text style={[Typography.title3, Color.primaryColor], { marginBottom: 1 }}>
{I18n.t('COMMISSION_ACCOUNT_TITLE')}
</Text>
<Text style={Typography.body2}>{thousandsSeparators(item.balance_com)}</Text>
</View>
</View>
</View>
</View>
{/* <View Style={{ flex: 1, flexDirection: 'row' }}>
<View Style={{ flex: 1 }} /> <View Style={{ flex: 1 }} />
<View style={{ <View style={{
@ -285,8 +369,9 @@ export default class SuperViseurGroupeHome extends BaseScreen {
style={styles.callIcon} /> style={styles.callIcon} />
<Text style={styles.phone}>{item.phone}</Text> <Text style={styles.phone}>{item.phone}</Text>
</View> </View>
</View> */}
</View>
</CardContent> </CardContent>
<CardAction <CardAction
separator={true} separator={true}
@ -538,6 +623,13 @@ export default class SuperViseurGroupeHome extends BaseScreen {
} }
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
circlePoint: {
width: 50,
height: 50,
marginRight: 5,
alignItems: 'center',
justifyContent: 'center',
},
container: { container: {
flex: 1, flex: 1,
backgroundColor: 'white' backgroundColor: 'white'

View File

@ -28,7 +28,6 @@ export class HistoryItem extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = this.initState(); this.state = this.initState();
console.log("HISTORY ITEM PROPS", this.props);
} }
statusLabel = (status) => { statusLabel = (status) => {
@ -47,6 +46,21 @@ export class HistoryItem extends React.Component {
} }
} }
descriptionLabelUserType = (user) => {
console.log("USER")
let textDescription = (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' ' + this.props.selfData.reseau;
switch (user.category) {
case 'geolocated': return `${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`;
case 'super': return this.props.isDemandSend ?
`${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`
:
`${I18n.t('THE_AGENT')} ${this.props.selfData.lastname} (${this.props.selfData.phone}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
case 'hyper': return `${I18n.t('THE_SUPERVISOR')} ${this.props.selfData.lastname} (${this.props.selfData.phone}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
}
}
initState() { initState() {
var textTitle = ' Transaction ' + this.props.selfData.id; var textTitle = ' Transaction ' + this.props.selfData.id;
var textDescription = I18n.t('PHONE') + ' ' + this.props.selfData.phone + " " + I18n.t('DEMAND_TEXT_FIRST_PART') + ' ' + (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' '; var textDescription = I18n.t('PHONE') + ' ' + this.props.selfData.phone + " " + I18n.t('DEMAND_TEXT_FIRST_PART') + ' ' + (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' ';
@ -60,7 +74,7 @@ export class HistoryItem extends React.Component {
re = moment(re) re = moment(re)
return { return {
title: textTitle, title: textTitle,
description: textDescription, description: this.descriptionLabelUserType(this.props.user),
status: this.statusLabel(this.props.selfData.status), status: this.statusLabel(this.props.selfData.status),
time: re.fromNow(), time: re.fromNow(),
navigator: this.props.navigator, navigator: this.props.navigator,
@ -185,6 +199,8 @@ export class HistoryListItem extends React.Component {
}; };
_renderItem = ({ item }) => ( _renderItem = ({ item }) => (
<HistoryItem <HistoryItem
isDemandSend={this.props.isDemandSend}
user={this.props.user}
refresh={this.props.refresh} refresh={this.props.refresh}
navigator={this.props.navigator} navigator={this.props.navigator}
selfData={item} selfData={item}

View File

@ -23,6 +23,8 @@ import { Color } from '../../config/Color'
const route = require("./../../route.json"); const route = require("./../../route.json");
import Dialog from "react-native-dialog"; import Dialog from "react-native-dialog";
import { FontWeight } from '../../config/typography' import { FontWeight } from '../../config/typography'
import DeviceInfo from 'react-native-device-info'
class HistoryItemDetails extends Component { class HistoryItemDetails extends Component {
static navigatorStyle = { static navigatorStyle = {
@ -75,7 +77,11 @@ class HistoryItemDetails extends Component {
networks = await getAgentNetworksList(user.agentId); networks = await getAgentNetworksList(user.agentId);
this.setState({ user: user, networks: networks.networks }) this.setState({ user: user, networks: networks.networks })
}) });
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
} }
isNormalInteger = (str) => { isNormalInteger = (str) => {

View File

@ -92,7 +92,7 @@ class MyHistory extends React.Component {
this.navigation = this.props.navigation this.navigation = this.props.navigation
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb"; this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale); //moment.locale(this.currentLocale);
}; };
@ -313,60 +313,6 @@ class MyHistory extends React.Component {
clearInterval(this.intervaller) clearInterval(this.intervaller)
} }
renderList(list) {
if (this.state.isLoaded && list instanceof Array) {
let data = list;
if (data !== null) {
if (data.length > 0) {
return (<HistoryListItem
list={list}
refreshing={() => { this.refreshData() }}
refresh={() => this.refreshData()}
isRefreshing={this.state.isRefreshing}
navigator={this.props.navigation}
style={styles.listbackground} />)
} else if (this.state.filter) {
return (
<View style={styles.emptyListe}>
<Text>{I18n.t('NO_ITEM_REQUEST')}</Text>
</View>
)
} else if (data.length === 0) {
return (
<View style={styles.emptyListe}>
<Text>{I18n.t('NO_ITEM_REQUEST')}</Text>
</View>
)
} else {
return (
<View style={styles.emptyListe}>
<ProgressBarAndroid />
<Text>{I18n.t('LOADING_DOTS')}</Text>
</View>
)
}
} else {
return (
<View style={styles.emptyListe}>
<Text>{I18n.t('EMPTY_LIST_REQUEST')} </Text>
</View>
)
}
} else if (list.length === 0) {
return (
<View style={styles.emptyListe}>
<Text>{I18n.t('NO_ITEM_REQUEST')}</Text>
</View>
)
}
}
renderOptionsMenu() { renderOptionsMenu() {
return ( return (
<View <View
@ -521,6 +467,7 @@ class MyHistory extends React.Component {
if (data !== null) { if (data !== null) {
if (data.length > 0) { if (data.length > 0) {
return (<HistoryItemSectionned return (<HistoryItemSectionned
user={this.state.user}
list={list} list={list}
refresh={() => this.refreshData()} refresh={() => this.refreshData()}
style={styles.listbackground} />) style={styles.listbackground} />)
@ -549,6 +496,64 @@ class MyHistory extends React.Component {
} }
} }
} }
renderList(list) {
if (this.state.isLoaded && list instanceof Array) {
let data = list;
if (data !== null) {
if (data.length > 0) {
return (<HistoryListItem
user={this.state.user}
list={list}
refreshing={() => { this.refreshData() }}
refresh={() => this.refreshData()}
isRefreshing={this.state.isRefreshing}
navigator={this.props.navigation}
style={styles.listbackground}
isDemandSend={this.state.position === 0} />)
} else if (this.state.filter) {
return (
<View style={styles.emptyListe}>
<Text>{I18n.t('NO_ITEM_REQUEST')}</Text>
</View>
)
} else if (data.length === 0) {
return (
<View style={styles.emptyListe}>
<Text>{I18n.t('NO_ITEM_REQUEST')}</Text>
</View>
)
} else {
return (
<View style={styles.emptyListe}>
<ProgressBarAndroid />
<Text>{I18n.t('LOADING_DOTS')}</Text>
</View>
)
}
} else {
return (
<View style={styles.emptyListe}>
<Text>{I18n.t('EMPTY_LIST_REQUEST')} </Text>
</View>
)
}
} else if (list.length === 0) {
return (
<View style={styles.emptyListe}>
<Text>{I18n.t('NO_ITEM_REQUEST')}</Text>
</View>
)
}
}
renderLoading() { renderLoading() {
return (<View><ProgressBarAndroid /><Text>{I18n.t('LOADING_DOTS')}</Text></View>) return (<View><ProgressBarAndroid /><Text>{I18n.t('LOADING_DOTS')}</Text></View>)
} }
@ -687,8 +692,7 @@ class MyHistory extends React.Component {
} }
_renderListDemandsSend() { _renderListDemandsSend() {
console.log('this.state', this.state);
console.log("REQUEST DATA", this.state.listdataSend);
return (<View style={styles.container}> return (<View style={styles.container}>
{ {
this.state.isLoaded ? this.state.isLoaded ?
@ -754,7 +758,6 @@ class MyHistory extends React.Component {
tabs={tabs} />; tabs={tabs} />;
} }
refreshData(autoref = true) { refreshData(autoref = true) {
if (autoref) if (autoref)
this.setState({ isRefreshing: true }) this.setState({ isRefreshing: true })

View File

@ -95,27 +95,34 @@ class Home extends BaseScreen {
) )
onLoadMore() { onLoadMore() {
const { user, prevRegion, boundarie } = this.state const { user, prevRegion, boundarie } = this.state;
if (user.category === undefined || user.category === null) { if (user.category === undefined || user.category === null) {
if (this.promiseRegion) this.promiseRegion.done()
if (this.promiseRegion) this.promiseRegion.done();
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()
const zoom = camera.zoom - 10 const zoom = camera.zoom - 10
let res = [] let res = []
this.setState({ isLoadingMap: true })
this.setState({ isLoadingMap: true });
if (this.state.filternetworkTemp !== undefined) { if (this.state.filternetworkTemp !== undefined) {
let net = this.state.filternetworkTemp.id let net = this.state.filternetworkTemp.id
res = this.state.networks.filter(function (item) { res = this.state.networks.filter(function (item) {
return item.id === net return item.id === net
}) });
} }
if (res.length > 0) { if (res.length > 0) {
let reseau = res[0]; let reseau = res[0];
const pos = { longitude: user.longitude, latitude: user.latitude } const pos = { longitude: user.longitude, latitude: user.latitude }
try { try {
//let data = await loadMarkers(pos, reseau, 5000, this.state.page) //let data = await loadMarkers(pos, reseau, 5000, this.state.page)
let data = await this.loadingMarkers(this.state.myPosition, this.state.filternetwork, this.state.value) let data = await this.loadingMarkers(this.state.myPosition, this.state.filternetwork, this.filterOptions[this.state.increasePas].value);
this.treatNewData(pos, data, false) this.treatNewData(pos, data, false)
} catch (e) { } catch (e) {
this.setState({ isNeedLoadMore: false, isLoadingMap: false }) this.setState({ isNeedLoadMore: false, isLoadingMap: false })
@ -608,7 +615,7 @@ class Home extends BaseScreen {
Icon.getImageSource('md-car', 24, 'white').then((resutl) => { Icon.getImageSource('md-car', 24, 'white').then((resutl) => {
this.setState({ caricon: resutl }) this.setState({ caricon: resutl })
}); });
this._renderFavoriteIcon = this._renderFavoriteIcon.bind(this); //this._renderFavoriteIcon = this._renderFavoriteIcon.bind(this);
this.makeMarkerInformation = this.makeMarkerInformation.bind(this); this.makeMarkerInformation = this.makeMarkerInformation.bind(this);
//IlinkEmitter.on("langueChange", this.updateLangue.bind(this)) //IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
@ -673,10 +680,13 @@ class Home extends BaseScreen {
} }
} }
renderSupplementInformation() { renderSupplementInformation() {
if (this.state.user && this.state.user.category === "geolocated") { if (this.state.user && this.state.user.category === "geolocated") {
return (<View />) return (<View />)
} else } else
return (<View style={{ flexDirection: "row" }}> return (<View style={{ flexDirection: "row" }}>
<View style={{ <View style={{
backgroundColor: "#FFFFFFA0", backgroundColor: "#FFFFFFA0",
@ -987,6 +997,7 @@ class Home extends BaseScreen {
) )
} }
toggleSlidingUp(state) { toggleSlidingUp(state) {
if (state && this.bottomSheetRef) { if (state && this.bottomSheetRef) {
this.bottomSheetRef.snapTo(1) this.bottomSheetRef.snapTo(1)
@ -1019,6 +1030,7 @@ class Home extends BaseScreen {
} }
}); });
} }
makeSlidingUp() { makeSlidingUp() {
/*return ( /*return (
<Animated.View <Animated.View
@ -1038,7 +1050,8 @@ class Home extends BaseScreen {
renderHeader={() => this.markerView()} renderHeader={() => this.markerView()}
/>) />)
} }
_renderFavoriteIcon() {
/* _renderFavoriteIcon() {
const { top, bottom } = this.props.draggableRange const { top, bottom } = this.props.draggableRange
const draggedValue = this._draggedValue.interpolate({ const draggedValue = this._draggedValue.interpolate({
inputRange: [bottom, top], inputRange: [bottom, top],
@ -1060,7 +1073,8 @@ class Home extends BaseScreen {
</Animated.View> </Animated.View>
</TouchableNativeFeedback> </TouchableNativeFeedback>
) )
} } */
geInitialState() { geInitialState() {
return { return {
region: { region: {
@ -1074,6 +1088,7 @@ class Home extends BaseScreen {
latitude: 0, latitude: 0,
longitude: 0, longitude: 0,
}, },
increasePas: 0,
isPubShow: true, isPubShow: true,
loadingDialog: true, loadingDialog: true,
textreach: "", textreach: "",
@ -1978,11 +1993,14 @@ class Home extends BaseScreen {
showLoadingMapView() { showLoadingMapView() {
if (this.state.isLoadingMap) if (this.state.isLoadingMap)
return (<View return (
<View
style={{ flexDirection: 'row', margin: 10, width: responsiveWidth(95), backgroundColor: 'white', justifyContent: "center", alignSelf: "center" }}> style={{ flexDirection: 'row', margin: 10, width: responsiveWidth(95), backgroundColor: 'white', justifyContent: "center", alignSelf: "center" }}>
<Text style={{ fontSize: 12, alignSelf: 'center' }}>{I18n.t("LOADING_TEXT_MARKERS") + " " + this.state.value + " km " + I18n.t("DISTANCE_ARROUND")}</Text> <Text style={{ fontSize: 12, alignSelf: 'center' }}>{I18n.t("LOADING_TEXT_MARKERS") + " " + this.filterOptions[this.state.increasePas].value + " km " + I18n.t("DISTANCE_ARROUND")}</Text>
<ProgressBarAndroid style={{ alignSelf: 'center' }} /> <ProgressBarAndroid style={{ alignSelf: 'center' }} />
</View>) </View>
)
} }
loadingMarkers(myPosition, filternetwork, value, p = undefined) { loadingMarkers(myPosition, filternetwork, value, p = undefined) {
@ -2007,14 +2025,52 @@ class Home extends BaseScreen {
} catch (e) { } catch (e) {
console.debug("after " + e.message) console.debug("after " + e.message)
} }
/* if (this.state.user.category !== 'geolocated' && this.state.user.category !== 'super'
&& this.state.user.category !== 'hyper') {
if (data.length === 0) {
this.loadMoreIfHasNoPoint();
}
} */
console.debug("data:", data, "value" + value * 1000) console.debug("data:", data, "value" + value * 1000)
resolve(data) resolve(data)
}) })
} }
loadMoreIfHasNoPoint = () => {
Alert.alert(
I18n.t("NO_NETWORK_MARKER"),
`${I18n.t('LAUNCH_POINT_WITH_FILTER')} ${this.filterOptions[this.state.increasePas + 1].label} ?`,
[
{ text: I18n.t("NO"), onPress: () => { } },
{
text: I18n.t("YES"), onPress: () => {
if (this.state.increasePas === this.filterOptions.length - 1) {
this.setState({ snack_visible: true, snack_text_message: I18n.t('NO_NETWORK_MARKER') })
setTimeout(() => {
this.setState({ snack_visible: false })
}, 5000)
}
else {
this.setState({ increasePas: this.state.increasePas + 1, isLoadingMap: true });
this.onLoadMore();
}
}
}
],
{ cancelable: false }
)
}
treatNewData(pos, data, isFilter = false) { treatNewData(pos, data, isFilter = false) {
this.setState({ isLoadingMap: false })
this.setState({ isLoadingMap: false });
let items = data; let items = data;
if (data.length > 0) { if (data.length > 0) {
let corrent = items; let corrent = items;
if (isFilter) if (isFilter)
@ -2026,12 +2082,9 @@ class Home extends BaseScreen {
if (items.length < this.state.currentNetworkSize) { if (items.length < this.state.currentNetworkSize) {
this.setState({ isNeedLoadMore: true }) this.setState({ isNeedLoadMore: true })
} else { } else {
if (isFilter && items.length <= 0) { /* if (isFilter && items.length <= 0) {
this.setState({ snack_visible: true, snack_text_message: "Ce réseau n'a aucun point" }) this.loadMoreIfHasNoPoint();
setTimeout(() => { } */
this.setState({ snack_visible: false })
}, 5000)
}
this.setState({ isNeedLoadMore: false }) this.setState({ isNeedLoadMore: false })
} }

View File

@ -87,7 +87,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.lastname = text; use.lastname = text;
this.setState({user:use})}} this.setState({ user: use })
}}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
@ -102,7 +103,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.address = text; use.address = text;
this.setState({user:use})}} this.setState({ user: use })
}}
> >
</Fumi> </Fumi>
@ -117,7 +119,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.email = text; use.email = text;
this.setState({user:use})}} this.setState({ user: use })
}}
style={styles.input} style={styles.input}
> >
@ -131,7 +134,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.member = text; use.member = text;
this.setState({user:use})}} this.setState({ user: use })
}}
iconSize={20} iconSize={20}
style={styles.input} style={styles.input}
@ -147,7 +151,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.password = text; use.password = text;
this.setState({user:use})}} this.setState({ user: use })
}}
iconSize={20} iconSize={20}
style={styles.input} style={styles.input}
> >
@ -163,7 +168,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.confirmpass = text; use.confirmpass = text;
this.setState({user:use})}} this.setState({ user: use })
}}
iconSize={20} iconSize={20}
style={styles.input} style={styles.input}
@ -198,7 +204,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.lastname = text; use.lastname = text;
this.setState({user:use})}} this.setState({ user: use })
}}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
style={styles.input} style={styles.input}
@ -215,7 +222,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.address = text; use.address = text;
this.setState({user:use})}} this.setState({ user: use })
}}
style={styles.input} style={styles.input}
> >
@ -231,7 +239,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.email = text; use.email = text;
this.setState({user:use})}} this.setState({ user: use })
}}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
@ -246,7 +255,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.password = text; use.password = text;
this.setState({user:use})}} this.setState({ user: use })
}}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
@ -261,7 +271,8 @@ export default class CreateAccount extends Component{
onChangeText={(text) => { onChangeText={(text) => {
let use = this.state.user; let use = this.state.user;
use.confirmpass = text; use.confirmpass = text;
this.setState({user:use})}} this.setState({ user: use })
}}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
@ -297,7 +308,8 @@ export default class CreateAccount extends Component{
} }
} }
}} }
}
} else { } else {
/*this.props.navigator.showSnackbar({ /*this.props.navigator.showSnackbar({
text:"impossible de trouvé l'utilisateur" text:"impossible de trouvé l'utilisateur"
@ -338,7 +350,8 @@ export default class CreateAccount extends Component{
} }
} else this.setState({ isLoging: false }) } else this.setState({ isLoging: false })
}).catch((e)=>{ this.setState({isLoging:false}) }).catch((e) => {
this.setState({ isLoging: false })
}) })
} else this.setState({ isLoging: false }) } else this.setState({ isLoging: false })

View File

@ -144,8 +144,10 @@ export default class CreateUserStep2 extends Component{
if (result.child) { if (result.child) {
this.setState({ disableNetwork: true }) this.setState({ disableNetwork: true })
if (result.network) if (result.network)
this.setState({modalVisible:false,networks:[result.network], this.setState({
network:result.network,select_network:I18n.t("YOUR_NETWORK")}) modalVisible: false, networks: [result.network],
network: result.network, select_network: I18n.t("YOUR_NETWORK")
})
else { else {
Alert.alert(I18n.t('TITLE_PROBLE_COME'), "Impossible de recuperer les informations du code parrain", [{ text: "Revenir", onPress: () => this.props.navigation.pop() }]) Alert.alert(I18n.t('TITLE_PROBLE_COME'), "Impossible de recuperer les informations du code parrain", [{ text: "Revenir", onPress: () => this.props.navigation.pop() }])
@ -192,10 +194,12 @@ export default class CreateUserStep2 extends Component{
} else { } else {
this.setState({ modalDialog: false }) this.setState({ modalDialog: false })
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," + Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
"et que vous êtes connecté à internet puis ressayer",[{text:"Recommencer",onPress:()=>{ "et que vous êtes connecté à internet puis ressayer", [{
text: "Recommencer", onPress: () => {
this.setState({ modalDialog: true }) this.setState({ modalDialog: true })
this.watchLocation() this.watchLocation()
}},{text:"Annuler",onPress:()=>{this.props.navigation.popToTop()}}]) }
}, { text: "Annuler", onPress: () => { this.props.navigation.popToTop() } }])
} }
@ -203,9 +207,11 @@ export default class CreateUserStep2 extends Component{
showErrorDialog() { showErrorDialog() {
this.setState({ modalDialog: false }) this.setState({ modalDialog: false })
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," + Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
"et que vous êtes connecté à internet puis ressayer",[{text:"Recommencer",onPress:()=>{ "et que vous êtes connecté à internet puis ressayer", [{
text: "Recommencer", onPress: () => {
this.watchLocation() this.watchLocation()
}},{text:"Annuler",onPress:()=>{this.props.navigation.popToTop()}}]) }
}, { text: "Annuler", onPress: () => { this.props.navigation.popToTop() } }])
} }
componentDidMount() { componentDidMount() {
@ -240,21 +246,28 @@ export default class CreateUserStep2 extends Component{
this.setState({ modalDialog: false }) this.setState({ modalDialog: false })
Alert.alert("Echec à l'autorisation", Alert.alert("Echec à l'autorisation",
"L'application n'est pas autorisé à acceder à votre position veuillez verifier que votre GPS est activé et configurer en mode Haute Precision", "L'application n'est pas autorisé à acceder à votre position veuillez verifier que votre GPS est activé et configurer en mode Haute Precision",
[{text:"Ok",onPress:()=>{ [{
this.props.navigation.popToTop() }}]) text: "Ok", onPress: () => {
this.props.navigation.popToTop()
}
}])
} }
} catch (err) { } catch (err) {
this.setState({ modalDialog: false }) this.setState({ modalDialog: false })
Alert.alert("Une erreur est Survenue", Alert.alert("Une erreur est Survenue",
"Une erreur est survenu lors du demarrage de l'application veuillez relancer l'application", "Une erreur est survenu lors du demarrage de l'application veuillez relancer l'application",
[{text:"Ok",onPress:()=>{ [{
text: "Ok", onPress: () => {
BackHandler.exitApp() BackHandler.exitApp()
}}]) } }
}])
}
} }
async watchLocation() { async watchLocation() {
Geolocation.getCurrentPosition((position) => { Geolocation.getCurrentPosition((position) => {
this.treatPosition(position)}, (e)=>{ this.treatPosition(position)
}, (e) => {
this.showErrorDialog() this.showErrorDialog()
}, this.props.geolocationOptions); }, this.props.geolocationOptions);
if (!this.watchID) { if (!this.watchID) {
@ -358,13 +371,15 @@ export default class CreateUserStep2 extends Component{
</View> </View>
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
<View <View
style={{width:responsiveWidth(90), style={{
width: responsiveWidth(90),
marginTop: 20, marginTop: 20,
alignSelf: 'center', alignSelf: 'center',
borderRadius: 10, borderRadius: 10,
paddingLeft: 20, paddingLeft: 20,
paddingRight: 20, paddingRight: 20,
backgroundColor:'white'}} backgroundColor: 'white'
}}
> >
<Dropdown <Dropdown
@ -391,7 +406,8 @@ export default class CreateUserStep2 extends Component{
editable={false} editable={false}
onChangeText={(text) => { onChangeText={(text) => {
let phonenum = text + this.state.contact !== undefined ? this.state.contact : ""; let phonenum = text + this.state.contact !== undefined ? this.state.contact : "";
this.setState({indicatif:text,phone:phonenum})}} this.setState({ indicatif: text, phone: phonenum })
}}
style={{ style={{
width: responsiveWidth(30), width: responsiveWidth(30),
height: responsiveHeight(10), height: responsiveHeight(10),
@ -410,7 +426,8 @@ export default class CreateUserStep2 extends Component{
iconSize={20} iconSize={20}
onChangeText={(text) => { onChangeText={(text) => {
let phonenumber = text let phonenumber = text
this.setState({phone:phonenumber,contact:text})}} this.setState({ phone: phonenumber, contact: text })
}}
style={{ style={{
marginTop: responsiveHeight(2), marginTop: responsiveHeight(2),
@ -428,7 +445,8 @@ export default class CreateUserStep2 extends Component{
iconSize={20} iconSize={20}
onChangeText={(text) => { onChangeText={(text) => {
let phonenumber = text let phonenumber = text
this.setState({phoneTransaction:phonenumber,contactTransaction:text})}} this.setState({ phoneTransaction: phonenumber, contactTransaction: text })
}}
style={{ style={{
marginTop: responsiveHeight(2), marginTop: responsiveHeight(2),
@ -445,13 +463,15 @@ export default class CreateUserStep2 extends Component{
<Animatable.View ref={(comp) => { this.networkanim = comp }}> <Animatable.View ref={(comp) => { this.networkanim = comp }}>
<View <View
style={{width:responsiveWidth(90), style={{
width: responsiveWidth(90),
marginTop: 20, marginTop: 20,
alignSelf: 'center', alignSelf: 'center',
borderRadius: 10, borderRadius: 10,
paddingLeft: 20, paddingLeft: 20,
paddingRight: 20, paddingRight: 20,
backgroundColor:'white'}} backgroundColor: 'white'
}}
> >
<Button <Button
@ -469,9 +489,11 @@ export default class CreateUserStep2 extends Component{
</View> </View>
</Animatable.View> </Animatable.View>
<Text <Text
style={{fontSize:16, style={{
fontSize: 16,
marginTop: 10, marginTop: 10,
marginLeft:responsiveWidth(6),marginRight:responsiveWidth(6),color:'white',fontWeight:'bold'}} marginLeft: responsiveWidth(6), marginRight: responsiveWidth(6), color: 'white', fontWeight: 'bold'
}}
>{I18n.t('WAIT_LOADING_POSITION')}</Text> >{I18n.t('WAIT_LOADING_POSITION')}</Text>
<Animatable.View <Animatable.View
ref={(comp) => { this.mapanim = comp }} ref={(comp) => { this.mapanim = comp }}
@ -493,13 +515,17 @@ export default class CreateUserStep2 extends Component{
<TouchableOpacity style={{ flexDirection: 'row', alignItems: 'center' }}> <TouchableOpacity style={{ flexDirection: 'row', alignItems: 'center' }}>
<Image <Image
style={{width:24,height:24, style={{
marginLeft:responsiveWidth(6)}} width: 24, height: 24,
marginLeft: responsiveWidth(6)
}}
source={require('./../../datas/img/userplace.png')} source={require('./../../datas/img/userplace.png')}
/> />
<Text <Text
style={{fontSize:16, style={{
marginTop:10,marginRight:responsiveWidth(6),color:'white',fontWeight:'bold'}} fontSize: 16,
marginTop: 10, marginRight: responsiveWidth(6), color: 'white', fontWeight: 'bold'
}}
>{this.state.textadress !== undefined ? this.state.textadress : I18n.t('TAKE_MY_POSITION')}</Text> >{this.state.textadress !== undefined ? this.state.textadress : I18n.t('TAKE_MY_POSITION')}</Text>
</TouchableOpacity> </TouchableOpacity>
<Button style={styles.btnvalide} textStyle={styles.textbtnvalide} <Button style={styles.btnvalide} textStyle={styles.textbtnvalide}
@ -559,13 +585,15 @@ export default class CreateUserStep2 extends Component{
</View> </View>
<View <View
style={{width:responsiveWidth(90), style={{
width: responsiveWidth(90),
marginTop: 20, marginTop: 20,
alignSelf: 'center', alignSelf: 'center',
borderRadius: 10, borderRadius: 10,
paddingLeft: 20, paddingLeft: 20,
paddingRight: 20, paddingRight: 20,
backgroundColor:'white'}} backgroundColor: 'white'
}}
> >
<Dropdown <Dropdown
@ -591,7 +619,8 @@ export default class CreateUserStep2 extends Component{
onChangeText={(text) => { onChangeText={(text) => {
this.setState({indicatif:text})}} this.setState({ indicatif: text })
}}
style={{ style={{
width: responsiveWidth(30), width: responsiveWidth(30),
marginTop: responsiveHeight(2), marginTop: responsiveHeight(2),
@ -607,7 +636,8 @@ export default class CreateUserStep2 extends Component{
iconSize={20} iconSize={20}
onChangeText={(text) => { onChangeText={(text) => {
let phonenumber = text let phonenumber = text
this.setState({phone:phonenumber})}} this.setState({ phone: phonenumber })
}}
style={{ style={{
marginTop: responsiveHeight(2), marginTop: responsiveHeight(2),
@ -623,13 +653,15 @@ export default class CreateUserStep2 extends Component{
<Animatable.View ref={(comp) => { this.networkanim = comp }}> <Animatable.View ref={(comp) => { this.networkanim = comp }}>
<View <View
style={{width:responsiveWidth(90), style={{
width: responsiveWidth(90),
marginTop: 20, marginTop: 20,
alignSelf: 'center', alignSelf: 'center',
borderRadius: 10, borderRadius: 10,
paddingLeft: 20, paddingLeft: 20,
paddingRight: 20, paddingRight: 20,
backgroundColor:'white'}} backgroundColor: 'white'
}}
> >
<Dropdown <Dropdown
@ -637,7 +669,8 @@ export default class CreateUserStep2 extends Component{
data={this.state.networks} data={this.state.networks}
value={this.state.network == null ? "" : this.state.network} value={this.state.network == null ? "" : this.state.network}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
this.setState({network:value})}} this.setState({ network: value })
}}
valueExtractor={(value) => { return value }} valueExtractor={(value) => { return value }}
labelExtractor={(value) => { return value.name }} labelExtractor={(value) => { return value.name }}
/> />
@ -669,14 +702,18 @@ export default class CreateUserStep2 extends Component{
for (let i in user) { for (let i in user) {
data[i] = user[i]; data[i] = user[i];
} }
console.log(data); //console.log(data);
createUserAccount(data).then((result) => { createUserAccount(data).then((result) => {
console.log(data) console.log("result", result)
if (result.success !== undefined && result.success === 1) { if (result.success !== undefined && result.success === 1) {
Alert.alert(I18n.t("CONNEXION_SUCCESSFUL"), Alert.alert(I18n.t("CONNEXION_SUCCESSFUL"),
I18n.t('ACCOUNT_CREATED_SUCCESS') I18n.t('ACCOUNT_CREATED_SUCCESS')
,[ {text: 'OK', onPress: () => { this.props.navigation.popToTop() , [{
this.setState({isLoading:false})}}],{ cancelable: false }) text: 'OK', onPress: () => {
this.props.navigation.popToTop()
this.setState({ isLoading: false })
}
}], { cancelable: false })
} else { } else {
if (result.error !== undefined) { if (result.error !== undefined) {
switch (result.error) { switch (result.error) {
@ -733,7 +770,8 @@ export default class CreateUserStep2 extends Component{
: I18n.t("ACCOUNT_SUCCESSFULL_CREATED") : I18n.t("ACCOUNT_SUCCESSFULL_CREATED")
Alert.alert("", message, [{ Alert.alert("", message, [{
text: "Ok", text: "Ok",
onPress:()=>{ this.props.navigation.popToTop() onPress: () => {
this.props.navigation.popToTop()
} }
}]) }])
setTimeout(() => { setTimeout(() => {

View File

@ -44,11 +44,9 @@ export default class OptionsMenu extends Component {
IlinkEmitter.on("langueChange", this.updateLangue.bind(this)) IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
this.configuration = new Configuration(); this.configuration = new Configuration();
readUser().then((user) => { readUser().then((user) => {
if (user.id !== this.state.user.id) {
if (user !== null && user !== undefined) { if (user !== null && user !== undefined) {
this.setState({ user }); this.setState({ user });
} }
}
}); });
} }
@ -540,8 +538,8 @@ export default class OptionsMenu extends Component {
} }
watchUser() { watchUser() {
readUser().then((user) => { readUser().then((user) => {
if (user.id !== this.state.user.id) {
if (user !== null && user !== undefined) { if (user !== null && user !== undefined) {
if (user.id !== this.state.user.id) {
this.updateUser(user); this.updateUser(user);
} }
} }

View File

@ -497,11 +497,9 @@ export default class OptionsMenu extends Component<Props> {
} }
watchUser() { watchUser() {
readUser().then((user) => { readUser().then((user) => {
if (user.id !== this.state.user.id) {
if (user !== null && user !== undefined) { if (user !== null && user !== undefined) {
this.updateUser(user); this.updateUser(user);
} }
}
}); });
} }
} }

View File

@ -54,7 +54,7 @@ class WalletDepot extends Component {
super(props); super(props);
this.state = { this.state = {
type: "credit", type: "credit",
montant: null, montant: '',
numCarte: 0, numCarte: 0,
cvv: 0, cvv: 0,
expiration_date: '', expiration_date: '',
@ -237,7 +237,7 @@ class WalletDepot extends Component {
onSubmitDeposit = () => { onSubmitDeposit = () => {
const { creditCardInput } = this.state; const { creditCardInput } = this.state;
if (this.isMontantValid().isValid && creditCardInput.valid) { if (this.isMontantValid().isValid && creditCardInput.valid && this.state.montant.length > 0) {
console.log("Is Montant Valid", this.isMontantValid.isValid); console.log("Is Montant Valid", this.isMontantValid.isValid);
console.log("creditCardInput Valid", creditCardInput.valid); console.log("creditCardInput Valid", creditCardInput.valid);
@ -259,7 +259,7 @@ class WalletDepot extends Component {
displayCardError: true displayCardError: true
}) })
} }
this.setState({ isSubmitClick: !this.state.isSubmitClick }) this.setState({ isSubmitClick: true });
} }
@ -391,7 +391,7 @@ class WalletDepot extends Component {
<Text style={{ color: 'red', marginTop: 2 }}>{this.isMontantValid().errorMessage}</Text> <Text style={{ color: 'red', marginTop: 2 }}>{this.isMontantValid().errorMessage}</Text>
} }
{ {
(this.state.isSubmitClick && this.state.montant === null) && (this.state.isSubmitClick && this.state.montant.length === 0) &&
<Text style={{ color: 'red', marginTop: 2 }}>{I18n.t('PLEASE_ENTER_THE_AMOUNT')}</Text> <Text style={{ color: 'red', marginTop: 2 }}>{I18n.t('PLEASE_ENTER_THE_AMOUNT')}</Text>
} }
<Text></Text> <Text></Text>

View File

@ -54,7 +54,7 @@ class WalletRetrait extends Component {
super(props); super(props);
this.state = { this.state = {
type: "debit", type: "debit",
montant: null, montant: '',
numCarte: 0, numCarte: 0,
cvv: 0, cvv: 0,
expiration_date: '', expiration_date: '',
@ -238,7 +238,7 @@ class WalletRetrait extends Component {
onSubmitDeposit = () => { onSubmitDeposit = () => {
const { creditCardInput } = this.state; const { creditCardInput } = this.state;
if (this.isMontantValid().isValid && creditCardInput.valid) { if (this.isMontantValid().isValid && creditCardInput.valid && this.state.montant.length > 0) {
console.log("Is Montant Valid", this.isMontantValid.isValid); console.log("Is Montant Valid", this.isMontantValid.isValid);
console.log("creditCardInput Valid", creditCardInput.valid); console.log("creditCardInput Valid", creditCardInput.valid);
@ -392,7 +392,7 @@ class WalletRetrait extends Component {
<Text style={{ color: 'red', marginTop: 2 }}>{this.isMontantValid().errorMessage}</Text> <Text style={{ color: 'red', marginTop: 2 }}>{this.isMontantValid().errorMessage}</Text>
} }
{ {
(this.state.isSubmitClick && this.state.montant === null) && (this.state.isSubmitClick && this.state.montant.length === 0) &&
<Text style={{ color: 'red', marginTop: 2 }}>{I18n.t('PLEASE_ENTER_THE_AMOUNT')}</Text> <Text style={{ color: 'red', marginTop: 2 }}>{I18n.t('PLEASE_ENTER_THE_AMOUNT')}</Text>
} }
<Text></Text> <Text></Text>

View File

@ -8,7 +8,9 @@
"ABOUT_TEXT": "iLink is an application that will facilitate your financial transactions near your location, and give you multiservice points near you.", "ABOUT_TEXT": "iLink is an application that will facilitate your financial transactions near your location, and give you multiservice points near you.",
"GEOLOCATED_USER": "Geo located user", "GEOLOCATED_USER": "Geo located user",
"SUPERVISOR": "Supervisor", "SUPERVISOR": "Supervisor",
"THE_SUPERVISOR": "Supervisor",
"AGENT": "Agent", "AGENT": "Agent",
"THE_AGENT": "Agent",
"USER": "User", "USER": "User",
"HYPERVISOR": "Hypervisor", "HYPERVISOR": "Hypervisor",
"OPEN": "Open", "OPEN": "Open",
@ -267,6 +269,7 @@
"MY_DEMANDE": "My requests", "MY_DEMANDE": "My requests",
"PHONE_TRANSACTION": "Transaction number", "PHONE_TRANSACTION": "Transaction number",
"DEMAND_TEXT_FIRST_PART": "made a request for", "DEMAND_TEXT_FIRST_PART": "made a request for",
"DEMAND_TEXT_FIRST_PART_YOU": "You made a request for ",
"REQUEST_SEND": "Request Sent", "REQUEST_SEND": "Request Sent",
"DEMAND_RECEIVE": "Requests received", "DEMAND_RECEIVE": "Requests received",
"TO_": "credit to", "TO_": "credit to",
@ -321,8 +324,12 @@
"TEXT_NETWORK_UNABLE": "Network not available, want to try again?", "TEXT_NETWORK_UNABLE": "Network not available, want to try again?",
"LOADING_TEXT_MARKERS": "More points", "LOADING_TEXT_MARKERS": "More points",
"LOADING_TEXT_MARKERS_2": "around,", "LOADING_TEXT_MARKERS_2": "around,",
"NO_NETWORK_MARKER": "No points found in the area ",
"NO_POINT_FOUND": "No points found ",
"LAUNCH_POINT_WITH_FILTER": "Do you want to restart the search within a radius of ",
"UNABLE_GET_INFORMATION": "Problem of retrieval of information", "UNABLE_GET_INFORMATION": "Problem of retrieval of information",
"UNABLE_GET_INFORMATION_TEXT": "Make sure your GPS is turned on and put in high precision mode and restart iLink World", "UNABLE_GET_INFORMATION_TEXT": "Make sure your GPS is turned on and put in high precision mode and restart iLink World",
"TITLE_HELP_SOON": "Help not available!", "TITLE_HELP_SOON": "Help not available!",
"YOUR_NETWORK": "Select your network",
"HELP_SOON": "A tutorial helping you in understanding the features of the application will soon be available." "HELP_SOON": "A tutorial helping you in understanding the features of the application will soon be available."
} }

View File

@ -8,9 +8,12 @@
"ABOUT_TEXT": "iLink est une application qui facilitera vos transactions financières près de votre position, et vous donne les points multiservices prêt de chez vous.", "ABOUT_TEXT": "iLink est une application qui facilitera vos transactions financières près de votre position, et vous donne les points multiservices prêt de chez vous.",
"GEOLOCATED_USER": "Utilisateur géo-localisé", "GEOLOCATED_USER": "Utilisateur géo-localisé",
"SUPERVISOR": "Superviseur", "SUPERVISOR": "Superviseur",
"THE_SUPERVISOR": "Le superviseur",
"AGENT": "Agent", "AGENT": "Agent",
"THE_AGENT": "L'agent",
"USER": "Utilisateur", "USER": "Utilisateur",
"HYPERVISOR": "Hyperviseur", "HYPERVISOR": "Hyperviseur",
"YOU_HAVE": "Vous avez",
"OPEN": "Ouvert", "OPEN": "Ouvert",
"POSITION": "Ma position", "POSITION": "Ma position",
"TAKE_MY_PLACE": "Prendre ma position", "TAKE_MY_PLACE": "Prendre ma position",
@ -268,6 +271,7 @@
"MY_DEMANDE": "Mes demandes", "MY_DEMANDE": "Mes demandes",
"PHONE_TRANSACTION": "Numéro de transaction", "PHONE_TRANSACTION": "Numéro de transaction",
"DEMAND_TEXT_FIRST_PART": "a effectué une demande de ", "DEMAND_TEXT_FIRST_PART": "a effectué une demande de ",
"DEMAND_TEXT_FIRST_PART_YOU": "Vous avez effectué une demande de ",
"DEMANDE_SEND": " Demande Envoyée", "DEMANDE_SEND": " Demande Envoyée",
"DEMAND_RECEIVE": "Demandes reçues", "DEMAND_RECEIVE": "Demandes reçues",
"TO_": " crédit auprès de ", "TO_": " crédit auprès de ",
@ -320,9 +324,13 @@
"TEXT_FORGOTTEN_PASSWORD": "Saisissez votre identifiant,nous vous enverrons un nouveau mot de passe\n", "TEXT_FORGOTTEN_PASSWORD": "Saisissez votre identifiant,nous vous enverrons un nouveau mot de passe\n",
"TEXT_NETWORK_UNABLE": "Réseau non disponible, voulez vous réessayer ?", "TEXT_NETWORK_UNABLE": "Réseau non disponible, voulez vous réessayer ?",
"LOADING_TEXT_MARKERS": "Suite des points ", "LOADING_TEXT_MARKERS": "Suite des points ",
"NO_NETWORK_MARKER": "Aucun point trouvé dans la zone ",
"NO_POINT_FOUND": "Aucun point trouvé ",
"LAUNCH_POINT_WITH_FILTER": "Voulez-vous relancer la recherche dans un rayon de ",
"LOADING_TEXT_MARKERS_2": "autour", "LOADING_TEXT_MARKERS_2": "autour",
"UNABLE_GET_INFORMATION": "Problème de récuperation des Informations", "UNABLE_GET_INFORMATION": "Problème de récuperation des Informations",
"UNABLE_GET_INFORMATION_TEXT": "Vérifiez que votre GPS est activé et mis en mode haute precision et relancez iLink World", "UNABLE_GET_INFORMATION_TEXT": "Vérifiez que votre GPS est activé et mis en mode haute precision et relancez iLink World",
"TITLE_HELP_SOON": "Aide non disponible !", "TITLE_HELP_SOON": "Aide non disponible !",
"YOUR_NETWORK": "Sélectionner votre réseau",
"HELP_SOON": "Un tutoriel vous aidant dans la compréhension des fonctionnalités de l'application vous sera bientôt mis à disposition." "HELP_SOON": "Un tutoriel vous aidant dans la compréhension des fonctionnalités de l'application vous sera bientôt mis à disposition."
} }

View File

@ -4,13 +4,17 @@ export const isDebugMode = false
//base url production //base url production
//export const baseUrl = "https://ilink-app.com/mobilebackend"; //export const baseUrl = "https://ilink-app.com/mobilebackend";
//export const baseUrl = "https://test.ilink-app.com/mobilebackendtest"; //export const baseUrl = "https://test.ilink-app.com/mobilebackendtest";
export const baseUrl = "http://test.ilink-app.com:8080/mobilebackendtest"; //export const baseUrl = "http://test.ilink-app.com:8080/mobilebackendtest";
export const testBaseUrl = "https://test.ilink-app.com";
//base url agent
//const baseUrl = "https://ilink-app.com/mobilebackendtest2" //const baseUrl = "https://ilink-app.com/mobilebackendtest2"
/*
export const baseUrl = "http://test.ilink-app.com:8080/mobilebackend";
export const testBaseUrl = "https://test.ilink-app.com"; */
export const baseUrl = "https://preprod.ilink-app.com:8080/mobilebackend";
export const testBaseUrl = "https://preprod.ilink-app.com";
//base url agent test //base url agent test
//const baseUrl = "https://ilink-app.com/mobilebackendtest" //const baseUrl = "https://ilink-app.com/mobilebackendtest";
export const adhesionUrl = baseUrl + '/interacted/LoginAction.php'; export const adhesionUrl = baseUrl + '/interacted/LoginAction.php';
export const memberActionUrl = baseUrl + '/interacted/MembersAction.php'; export const memberActionUrl = baseUrl + '/interacted/MembersAction.php';
@ -18,6 +22,7 @@ export const networkActionUrl = baseUrl + '/interacted/NetworkAction.php';
export const locationActionUrl = baseUrl + '/interacted/LocationAction.php'; export const locationActionUrl = baseUrl + '/interacted/LocationAction.php';
export const demandeActionUrl = baseUrl + '/interacted/DemandeAction.php'; export const demandeActionUrl = baseUrl + '/interacted/DemandeAction.php';
export const configActionUrl = baseUrl + '/interacted/ConfigAction.php'; export const configActionUrl = baseUrl + '/interacted/ConfigAction.php';
export const walletActionUrl = testBaseUrl + '/walletService/wallets'; export const walletActionUrl = testBaseUrl + '/walletService/wallets';
export const walletDetailUrl = testBaseUrl + '/walletService/wallets'; export const walletDetailUrl = testBaseUrl + '/walletService/wallets';
export const creditTreatDemand = testBaseUrl + '/walletService/credits/treatDemand'; export const creditTreatDemand = testBaseUrl + '/walletService/credits/treatDemand';