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}
@ -319,7 +404,7 @@ export default class SuperViseurGroupeHome extends BaseScreen {
color="crimson" color="crimson"
/> />
</CardAction> </CardAction>
</Card>) </Card >)
} else } else
return (<View> return (<View>
<Swipeout left={[ <Swipeout left={[
@ -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

@ -1,44 +1,44 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {StyleSheet,Text,View,Image,ScrollView} from 'react-native'; import { StyleSheet, Text, View, Image, ScrollView } from 'react-native';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'; import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import Icon from 'react-native-vector-icons/MaterialIcons'; import Icon from 'react-native-vector-icons/MaterialIcons';
import { responsiveHeight,responsiveWidth,responsiveFontSize } from 'react-native-responsive-dimensions'; import { responsiveHeight, responsiveWidth, responsiveFontSize } from 'react-native-responsive-dimensions';
import {Fumi,Kaede} from 'react-native-textinput-effects' import { Fumi, Kaede } from 'react-native-textinput-effects'
import * as Animatable from 'react-native-animatable' import * as Animatable from 'react-native-animatable'
import Button from 'apsl-react-native-button' import Button from 'apsl-react-native-button'
import {categoryChild} from './../../webservice/AuthApi' import { categoryChild } from './../../webservice/AuthApi'
let theme=require('./../../utils/theme.json') let theme = require('./../../utils/theme.json')
let route=require('./../../route.json') let route = require('./../../route.json')
import I18n from 'react-native-i18n'; import I18n from 'react-native-i18n';
export default class CreateAccount extends Component{ export default class CreateAccount extends Component {
static navigatorStyle = { static navigatorStyle = {
drawUnderNavBar: true, drawUnderNavBar: true,
navBarHidden:true, navBarHidden: true,
drawUnderStatusBar: false, drawUnderStatusBar: false,
statusBarHidden: true, statusBarHidden: true,
statusBarTextColorScheme: 'light', statusBarTextColorScheme: 'light',
}; };
static options(passProps){ static options(passProps) {
return { return {
topBar:{ topBar: {
visible:false, visible: false,
enabled:false, enabled: false,
drawBehind: true, drawBehind: true,
}, },
statusBar:{ statusBar: {
drawBehind: true, drawBehind: true,
enabled:false, enabled: false,
} }
} }
} }
constructor(props){ constructor(props) {
super(props); super(props);
this.state=this.initState(); this.state = this.initState();
const { navigation } = this.props; const { navigation } = this.props;
this.type = navigation.getParam('type', 0); this.type = navigation.getParam('type', 0);
@ -57,113 +57,119 @@ export default class CreateAccount extends Component{
isLoging: false, isLoging: false,
snackVisible: false, snackVisible: false,
snackText: '', snackText: '',
user: {category:this.type===0?'user':'geolocated'} user: { category: this.type === 0 ? 'user' : 'geolocated' }
} }
} }
render(){ render() {
return this.type===1?this.renderUserGeoAccount():this.renderUserAccount() return this.type === 1 ? this.renderUserGeoAccount() : this.renderUserAccount()
} }
renderUserGeoAccount() { renderUserGeoAccount() {
return (<ScrollView style={styles.container}> return (<ScrollView style={styles.container}>
<View style={{flexDirection:"row"}}> <View style={{ flexDirection: "row" }}>
<Icon.Button name={"keyboard-backspace"} <Icon.Button name={"keyboard-backspace"}
color={"white"} color={"white"}
size={24} size={24}
backgroundColor={'transparent'} backgroundColor={'transparent'}
onPress={()=>this.props.navigation.pop()} onPress={() => this.props.navigation.pop()}
/> />
<Text style={styles.bigtitle}>{I18n.t('TEXT_BIG_CREATE_AGENT_1')}</Text> <Text style={styles.bigtitle}>{I18n.t('TEXT_BIG_CREATE_AGENT_1')}</Text>
</View> </View>
<Text style={styles.subbigtitle}>{I18n.t('TEXT_SUBTITLE_CREATE_1')}</Text> <Text style={styles.subbigtitle}>{I18n.t('TEXT_SUBTITLE_CREATE_1')}</Text>
<Animatable.View ref={(comp)=>{this.nameanim=comp}}> <Animatable.View ref={(comp) => { this.nameanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user'} <Fumi iconClass={FontAwesomeIcon} iconName={'user'}
label={I18n.t('NAME')} label={I18n.t('NAME')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
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>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.surnameanim=comp}}> <Animatable.View ref={(comp) => { this.surnameanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user-md'} <Fumi iconClass={FontAwesomeIcon} iconName={'user-md'}
label={I18n.t('ADDRESS')} label={I18n.t('ADDRESS')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
keyboardType={"email-address"} keyboardType={"email-address"}
style={styles.input} style={styles.input}
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>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.mailanim=comp}}> <Animatable.View ref={(comp) => { this.mailanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} <Fumi iconClass={FontAwesomeIcon}
iconName={'envelope'} iconName={'envelope'}
label={I18n.t('EMAIL')} label={I18n.t('EMAIL')}
keyboardType={"email-address"} keyboardType={"email-address"}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
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>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.memberanim=comp}}> <Animatable.View ref={(comp) => { this.memberanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} <Fumi iconClass={FontAwesomeIcon}
iconName={'unlock-alt'} iconName={'unlock-alt'}
label={I18n.t('SPONSOR_CODE')} label={I18n.t('SPONSOR_CODE')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
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}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.passanim=comp}}> <Animatable.View ref={(comp) => { this.passanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} <Fumi iconClass={FontAwesomeIcon}
iconName={'lock'} iconName={'lock'}
label={I18n.t('PASSWORD')} label={I18n.t('PASSWORD')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
secureTextEntry={true} secureTextEntry={true}
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}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.confirmanim=comp}}> <Animatable.View ref={(comp) => { this.confirmanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} <Fumi iconClass={FontAwesomeIcon}
iconName={'lock'} iconName={'lock'}
secureTextEntry={true} secureTextEntry={true}
label={I18n.t('CONFIRM_PASSWORD')} label={I18n.t('CONFIRM_PASSWORD')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
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}
@ -173,7 +179,7 @@ export default class CreateAccount extends Component{
<Button style={styles.btnvalide} <Button style={styles.btnvalide}
textStyle={styles.textbtnvalide} textStyle={styles.textbtnvalide}
isLoading={this.state.isLoging} isLoading={this.state.isLoging}
onPress={()=>{this.checkUserGeolocated()}}> onPress={() => { this.checkUserGeolocated() }}>
{I18n.t('NEXT')}</Button> {I18n.t('NEXT')}</Button>
</ScrollView>) </ScrollView>)
@ -182,113 +188,118 @@ export default class CreateAccount extends Component{
renderUserAccount() { renderUserAccount() {
return (<ScrollView style={styles.container}> return (<ScrollView style={styles.container}>
<View style={{flexDirection:'row'}}> <View style={{ flexDirection: 'row' }}>
<Icon.Button name={"keyboard-backspace"} <Icon.Button name={"keyboard-backspace"}
color={"white"} color={"white"}
size={24} size={24}
backgroundColor={'transparent'} backgroundColor={'transparent'}
onPress={()=>this.props.navigation.pop()} onPress={() => this.props.navigation.pop()}
/> />
<Text style={styles.bigtitle}>{I18n.t('TEXT_BIG_CREATE_1')}</Text> <Text style={styles.bigtitle}>{I18n.t('TEXT_BIG_CREATE_1')}</Text>
</View> </View>
<Text style={styles.subbigtitle}>{I18n.t('TEXT_SUBTITLE_CREATE_1')}</Text> <Text style={styles.subbigtitle}>{I18n.t('TEXT_SUBTITLE_CREATE_1')}</Text>
<Animatable.View ref={(comp)=>{this.nameanim=comp}}> <Animatable.View ref={(comp) => { this.nameanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user'} <Fumi iconClass={FontAwesomeIcon} iconName={'user'}
label={I18n.t('NAME')} label={I18n.t('NAME')}
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}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.surnameanim=comp}}> <Animatable.View ref={(comp) => { this.surnameanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user-md'} <Fumi iconClass={FontAwesomeIcon} iconName={'user-md'}
label={I18n.t('ADDRESS')} label={I18n.t('ADDRESS')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
keyboardType={"email-address"} keyboardType={"email-address"}
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}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.mailanim=comp}}> <Animatable.View ref={(comp) => { this.mailanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} <Fumi iconClass={FontAwesomeIcon}
iconName={'envelope'} iconName={'envelope'}
keyboardType={"email-address"} keyboardType={"email-address"}
label={I18n.t('EMAIL')} label={I18n.t('EMAIL')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
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>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.passanim=comp}}> <Animatable.View ref={(comp) => { this.passanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} <Fumi iconClass={FontAwesomeIcon}
iconName={'lock'} iconName={'lock'}
label={I18n.t('PASSWORD')} label={I18n.t('PASSWORD')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
secureTextEntry={true} secureTextEntry={true}
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>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp)=>{this.confirmanim=comp}}> <Animatable.View ref={(comp) => { this.confirmanim = comp }}>
<Fumi iconClass={FontAwesomeIcon} <Fumi iconClass={FontAwesomeIcon}
iconName={'lock'} iconName={'lock'}
secureTextEntry={true} secureTextEntry={true}
label={I18n.t('CONFIRM_PASSWORD')} label={I18n.t('CONFIRM_PASSWORD')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
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>
</Animatable.View> </Animatable.View>
<Button style={styles.btnvalide} textStyle={styles.textbtnvalide} <Button style={styles.btnvalide} textStyle={styles.textbtnvalide}
onPress={()=>{this._onUserCreateAccount()}}>{I18n.t('NEXT')}</Button> onPress={() => { this._onUserCreateAccount() }}>{I18n.t('NEXT')}</Button>
</ScrollView>) </ScrollView>)
} }
_onUserCreateAccount() { _onUserCreateAccount() {
let { user }=this.state; let { user } = this.state;
console.log(user) console.log(user)
if(user!==undefined) { if (user !== undefined) {
if (this.checkOrShake(user.lastname, this.nameanim)) { if (this.checkOrShake(user.lastname, this.nameanim)) {
if (this.checkOrShake(user.address, this.surnameanim)) { if (this.checkOrShake(user.address, this.surnameanim)) {
if (this.checkOrShake(user.email, this.mailanim)) { if (this.checkOrShake(user.email, this.mailanim)) {
if (this.checkOrShake(user.password, this.passanim)) { if (this.checkOrShake(user.password, this.passanim)) {
if (this.checkOrShake(user.confirmpass, this.confirmanim)) { if (this.checkOrShake(user.confirmpass, this.confirmanim)) {
if (user.confirmpass === user.password) { if (user.confirmpass === user.password) {
this.props.navigation.push(route.creationstep2,{ this.props.navigation.push(route.creationstep2, {
type: this.type, type: this.type,
user: user user: user
}) })
}else{ } else {
this.passanim.shake(800) this.passanim.shake(800)
this.confirmanim.shake(800) this.confirmanim.shake(800)
} }
@ -297,8 +308,9 @@ 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"
}) })
@ -308,19 +320,19 @@ export default class CreateAccount extends Component{
} }
checkUserGeolocated() { checkUserGeolocated() {
let { user }=this.state; let { user } = this.state;
this.setState({isLoging:true}) this.setState({ isLoging: true })
if(user!==undefined) { if (user !== undefined) {
if (this.checkOrShake(user.lastname, this.nameanim)) { if (this.checkOrShake(user.lastname, this.nameanim)) {
if (this.checkOrShake(user.address, this.surnameanim)) { if (this.checkOrShake(user.address, this.surnameanim)) {
if (this.checkOrShake(user.email, this.mailanim)) { if (this.checkOrShake(user.email, this.mailanim)) {
if (this.checkOrShake(user.member, this.memberanim)) { if (this.checkOrShake(user.member, this.memberanim)) {
categoryChild(user.member).then((codes)=>{ categoryChild(user.member).then((codes) => {
if (codes!==undefined && codes!==null&& codes.child !== undefined) { if (codes !== undefined && codes !== null && codes.child !== undefined) {
let user = this.state.user; let user = this.state.user;
user.category = codes.child; user.category = codes.child;
this.setState({user: user}) this.setState({ user: user })
} this.setState({isLoging:false}) } this.setState({ isLoging: false })
if (this.checkOrShake(user.password, this.passanim)) { if (this.checkOrShake(user.password, this.passanim)) {
if (this.checkOrShake(user.confirmpass, this.confirmanim)) { if (this.checkOrShake(user.confirmpass, this.confirmanim)) {
if (user.password === user.confirmpass) { if (user.password === user.confirmpass) {
@ -328,29 +340,30 @@ export default class CreateAccount extends Component{
type: this.type, type: this.type,
user: user user: user
}) })
}else{ } else {
this.passanim.shake(800) this.passanim.shake(800)
this.confirmanim.shake(800) this.confirmanim.shake(800)
this.setState({isLoging:false}) this.setState({ isLoging: false })
} }
}else { } else {
this.setState({isLoging:false}) this.setState({ isLoging: false })
} }
}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 })
}else this.setState({isLoging:false}) } else this.setState({ isLoging: false })
}else this.setState({isLoging:false}) } else this.setState({ isLoging: false })
}else this.setState({isLoging:false}) } else this.setState({ isLoging: false })
}else{ } else {
this.setState({isLoging:false}) this.setState({ isLoging: false })
/*this.props.navigator.showSnackbar({ /*this.props.navigator.showSnackbar({
text:"impossible de trouvé la variable user" text:"impossible de trouvé la variable user"
})*/ })*/
@ -359,54 +372,54 @@ export default class CreateAccount extends Component{
} }
checkOrShake(champ,view) { checkOrShake(champ, view) {
let res=false; let res = false;
if(champ!==undefined && champ.length>0) { if (champ !== undefined && champ.length > 0) {
res = true; res = true;
}else{ } else {
view.shake(800) view.shake(800)
} }
return res; return res;
} }
} }
const styles=StyleSheet.create({ const styles = StyleSheet.create({
container:{ container: {
flex:1, flex: 1,
backgroundColor:theme.primaryDark, backgroundColor: theme.primaryDark,
}, },
textbtnvalide:{ textbtnvalide: {
color:'white', color: 'white',
fontWeight:'bold' fontWeight: 'bold'
}, },
bigtitle:{ bigtitle: {
color:'white', color: 'white',
fontSize:20, fontSize: 20,
flex:1, flex: 1,
fontWeight:'bold', fontWeight: 'bold',
textAlign:'center', textAlign: 'center',
margin:20, margin: 20,
}, },
subbigtitle:{ subbigtitle: {
color:'white', color: 'white',
fontSize:17, fontSize: 17,
textAlign:'center', textAlign: 'center',
margin:5, margin: 5,
}, },
btnvalide:{ btnvalide: {
marginTop:20, marginTop: 20,
marginLeft:20, marginLeft: 20,
marginRight:20, marginRight: 20,
borderColor:'transparent', borderColor: 'transparent',
backgroundColor:theme.accentLight, backgroundColor: theme.accentLight,
height:52 height: 52
}, },
input:{ input: {
height:60, height: 60,
marginTop:responsiveHeight(2), marginTop: responsiveHeight(2),
marginLeft:responsiveWidth(5), marginLeft: responsiveWidth(5),
marginRight:responsiveWidth(5), marginRight: responsiveWidth(5),
borderRadius:5, borderRadius: 5,
} }
}) })

File diff suppressed because it is too large Load Diff

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';