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.",
"GEOLOCATED_USER": "Geo located user",
"SUPERVISOR": "Supervisor",
"THE_SUPERVISOR": "Supervisor",
"AGENT": "Agent",
"THE_AGENT": "Agent",
"USER": "User",
"HYPERVISOR": "Hypervisor",
"OPEN": "Open",
@ -267,6 +269,7 @@
"MY_DEMANDE": "My requests",
"PHONE_TRANSACTION": "Transaction number",
"DEMAND_TEXT_FIRST_PART": "made a request for",
"DEMAND_TEXT_FIRST_PART_YOU": "You made a request for ",
"REQUEST_SEND": "Request Sent",
"DEMAND_RECEIVE": "Requests received",
"TO_": "credit to",
@ -321,8 +324,12 @@
"TEXT_NETWORK_UNABLE": "Network not available, want to try again?",
"LOADING_TEXT_MARKERS": "More points",
"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_TEXT": "Make sure your GPS is turned on and put in high precision mode and restart iLink World",
"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."
}

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.",
"GEOLOCATED_USER": "Utilisateur géo-localisé",
"SUPERVISOR": "Superviseur",
"THE_SUPERVISOR": "Le superviseur",
"AGENT": "Agent",
"THE_AGENT": "L'agent",
"USER": "Utilisateur",
"HYPERVISOR": "Hyperviseur",
"YOU_HAVE": "Vous avez",
"OPEN": "Ouvert",
"POSITION": "Ma position",
"TAKE_MY_PLACE": "Prendre ma position",
@ -268,6 +271,7 @@
"MY_DEMANDE": "Mes demandes",
"PHONE_TRANSACTION": "Numéro de transaction",
"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",
"DEMAND_RECEIVE": "Demandes reçues",
"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_NETWORK_UNABLE": "Réseau non disponible, voulez vous réessayer ?",
"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",
"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",
"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."
}

View File

@ -8,7 +8,7 @@
"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",
"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",
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
"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 { listFreeCodesSuperViseur } from './../../webservice/NetworkApi'
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 { theme } from "../BaseScreen";
require("./../../utils/Translations");
@ -16,6 +17,7 @@ import I18n from 'react-native-i18n'
const route = require('./../../route.json')
import LottieView from 'lottie-react-native'; // if you have "esModuleInterop": true
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'
let moment = require('moment-timezone');
@ -28,6 +30,10 @@ import 'moment/locale/en-il'
import 'moment/locale/en-nz'
import { Header } from "react-native-elements";
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;
@ -117,6 +123,8 @@ export default class SuperViseurGroupeHome extends BaseScreen {
}
})
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
}
updateLangue() {
@ -270,7 +278,83 @@ export default class SuperViseurGroupeHome extends BaseScreen {
subtitle={item.adresse}
/>
<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={{
@ -285,8 +369,9 @@ export default class SuperViseurGroupeHome extends BaseScreen {
style={styles.callIcon} />
<Text style={styles.phone}>{item.phone}</Text>
</View>
</View> */}
</View>
</CardContent>
<CardAction
separator={true}
@ -319,7 +404,7 @@ export default class SuperViseurGroupeHome extends BaseScreen {
color="crimson"
/>
</CardAction>
</Card>)
</Card >)
} else
return (<View>
<Swipeout left={[
@ -538,6 +623,13 @@ export default class SuperViseurGroupeHome extends BaseScreen {
}
}
const styles = StyleSheet.create({
circlePoint: {
width: 50,
height: 50,
marginRight: 5,
alignItems: 'center',
justifyContent: 'center',
},
container: {
flex: 1,
backgroundColor: 'white'

View File

@ -28,7 +28,6 @@ export class HistoryItem extends React.Component {
constructor(props) {
super(props);
this.state = this.initState();
console.log("HISTORY ITEM PROPS", this.props);
}
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() {
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_') + ' ';
@ -60,7 +74,7 @@ export class HistoryItem extends React.Component {
re = moment(re)
return {
title: textTitle,
description: textDescription,
description: this.descriptionLabelUserType(this.props.user),
status: this.statusLabel(this.props.selfData.status),
time: re.fromNow(),
navigator: this.props.navigator,
@ -185,6 +199,8 @@ export class HistoryListItem extends React.Component {
};
_renderItem = ({ item }) => (
<HistoryItem
isDemandSend={this.props.isDemandSend}
user={this.props.user}
refresh={this.props.refresh}
navigator={this.props.navigator}
selfData={item}

View File

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

View File

@ -92,7 +92,7 @@ class MyHistory extends React.Component {
this.navigation = this.props.navigation
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)
}
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() {
return (
<View
@ -521,6 +467,7 @@ class MyHistory extends React.Component {
if (data !== null) {
if (data.length > 0) {
return (<HistoryItemSectionned
user={this.state.user}
list={list}
refresh={() => this.refreshData()}
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() {
return (<View><ProgressBarAndroid /><Text>{I18n.t('LOADING_DOTS')}</Text></View>)
}
@ -687,8 +692,7 @@ class MyHistory extends React.Component {
}
_renderListDemandsSend() {
console.log("REQUEST DATA", this.state.listdataSend);
console.log('this.state', this.state);
return (<View style={styles.container}>
{
this.state.isLoaded ?
@ -754,7 +758,6 @@ class MyHistory extends React.Component {
tabs={tabs} />;
}
refreshData(autoref = true) {
if (autoref)
this.setState({ isRefreshing: true })

View File

@ -95,27 +95,34 @@ class Home extends BaseScreen {
)
onLoadMore() {
const { user, prevRegion, boundarie } = this.state
const { user, prevRegion, boundarie } = this.state;
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.setState({ isNeedLoadMore: false, isLoadingMap: true })
const camera = await this.mapRef.getCamera()
const zoom = camera.zoom - 10
let res = []
this.setState({ isLoadingMap: true })
this.setState({ isLoadingMap: true });
if (this.state.filternetworkTemp !== undefined) {
let net = this.state.filternetworkTemp.id
res = this.state.networks.filter(function (item) {
return item.id === net
})
});
}
if (res.length > 0) {
let reseau = res[0];
const pos = { longitude: user.longitude, latitude: user.latitude }
try {
//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)
} catch (e) {
this.setState({ isNeedLoadMore: false, isLoadingMap: false })
@ -608,7 +615,7 @@ class Home extends BaseScreen {
Icon.getImageSource('md-car', 24, 'white').then((resutl) => {
this.setState({ caricon: resutl })
});
this._renderFavoriteIcon = this._renderFavoriteIcon.bind(this);
//this._renderFavoriteIcon = this._renderFavoriteIcon.bind(this);
this.makeMarkerInformation = this.makeMarkerInformation.bind(this);
//IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
@ -673,10 +680,13 @@ class Home extends BaseScreen {
}
}
renderSupplementInformation() {
if (this.state.user && this.state.user.category === "geolocated") {
return (<View />)
} else
return (<View style={{ flexDirection: "row" }}>
<View style={{
backgroundColor: "#FFFFFFA0",
@ -987,6 +997,7 @@ class Home extends BaseScreen {
)
}
toggleSlidingUp(state) {
if (state && this.bottomSheetRef) {
this.bottomSheetRef.snapTo(1)
@ -1019,6 +1030,7 @@ class Home extends BaseScreen {
}
});
}
makeSlidingUp() {
/*return (
<Animated.View
@ -1038,7 +1050,8 @@ class Home extends BaseScreen {
renderHeader={() => this.markerView()}
/>)
}
_renderFavoriteIcon() {
/* _renderFavoriteIcon() {
const { top, bottom } = this.props.draggableRange
const draggedValue = this._draggedValue.interpolate({
inputRange: [bottom, top],
@ -1060,7 +1073,8 @@ class Home extends BaseScreen {
</Animated.View>
</TouchableNativeFeedback>
)
}
} */
geInitialState() {
return {
region: {
@ -1074,6 +1088,7 @@ class Home extends BaseScreen {
latitude: 0,
longitude: 0,
},
increasePas: 0,
isPubShow: true,
loadingDialog: true,
textreach: "",
@ -1978,11 +1993,14 @@ class Home extends BaseScreen {
showLoadingMapView() {
if (this.state.isLoadingMap)
return (<View
return (
<View
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' }} />
</View>)
</View>
)
}
loadingMarkers(myPosition, filternetwork, value, p = undefined) {
@ -2007,14 +2025,52 @@ class Home extends BaseScreen {
} catch (e) {
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)
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) {
this.setState({ isLoadingMap: false })
this.setState({ isLoadingMap: false });
let items = data;
if (data.length > 0) {
let corrent = items;
if (isFilter)
@ -2026,12 +2082,9 @@ class Home extends BaseScreen {
if (items.length < this.state.currentNetworkSize) {
this.setState({ isNeedLoadMore: true })
} else {
if (isFilter && items.length <= 0) {
this.setState({ snack_visible: true, snack_text_message: "Ce réseau n'a aucun point" })
setTimeout(() => {
this.setState({ snack_visible: false })
}, 5000)
}
/* if (isFilter && items.length <= 0) {
this.loadMoreIfHasNoPoint();
} */
this.setState({ isNeedLoadMore: false })
}

View File

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

View File

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

View File

@ -54,7 +54,7 @@ class WalletDepot extends Component {
super(props);
this.state = {
type: "credit",
montant: null,
montant: '',
numCarte: 0,
cvv: 0,
expiration_date: '',
@ -237,7 +237,7 @@ class WalletDepot extends Component {
onSubmitDeposit = () => {
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("creditCardInput Valid", creditCardInput.valid);
@ -259,7 +259,7 @@ class WalletDepot extends Component {
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>
}
{
(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></Text>

View File

@ -54,7 +54,7 @@ class WalletRetrait extends Component {
super(props);
this.state = {
type: "debit",
montant: null,
montant: '',
numCarte: 0,
cvv: 0,
expiration_date: '',
@ -238,7 +238,7 @@ class WalletRetrait extends Component {
onSubmitDeposit = () => {
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("creditCardInput Valid", creditCardInput.valid);
@ -392,7 +392,7 @@ class WalletRetrait extends Component {
<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></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.",
"GEOLOCATED_USER": "Geo located user",
"SUPERVISOR": "Supervisor",
"THE_SUPERVISOR": "Supervisor",
"AGENT": "Agent",
"THE_AGENT": "Agent",
"USER": "User",
"HYPERVISOR": "Hypervisor",
"OPEN": "Open",
@ -267,6 +269,7 @@
"MY_DEMANDE": "My requests",
"PHONE_TRANSACTION": "Transaction number",
"DEMAND_TEXT_FIRST_PART": "made a request for",
"DEMAND_TEXT_FIRST_PART_YOU": "You made a request for ",
"REQUEST_SEND": "Request Sent",
"DEMAND_RECEIVE": "Requests received",
"TO_": "credit to",
@ -321,8 +324,12 @@
"TEXT_NETWORK_UNABLE": "Network not available, want to try again?",
"LOADING_TEXT_MARKERS": "More points",
"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_TEXT": "Make sure your GPS is turned on and put in high precision mode and restart iLink World",
"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."
}

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.",
"GEOLOCATED_USER": "Utilisateur géo-localisé",
"SUPERVISOR": "Superviseur",
"THE_SUPERVISOR": "Le superviseur",
"AGENT": "Agent",
"THE_AGENT": "L'agent",
"USER": "Utilisateur",
"HYPERVISOR": "Hyperviseur",
"YOU_HAVE": "Vous avez",
"OPEN": "Ouvert",
"POSITION": "Ma position",
"TAKE_MY_PLACE": "Prendre ma position",
@ -268,6 +271,7 @@
"MY_DEMANDE": "Mes demandes",
"PHONE_TRANSACTION": "Numéro de transaction",
"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",
"DEMAND_RECEIVE": "Demandes reçues",
"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_NETWORK_UNABLE": "Réseau non disponible, voulez vous réessayer ?",
"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",
"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",
"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."
}

View File

@ -4,13 +4,17 @@ export const isDebugMode = false
//base url production
//export const baseUrl = "https://ilink-app.com/mobilebackend";
//export const baseUrl = "https://test.ilink-app.com/mobilebackendtest";
export const baseUrl = "http://test.ilink-app.com:8080/mobilebackendtest";
export const testBaseUrl = "https://test.ilink-app.com";
//base url agent
//export const baseUrl = "http://test.ilink-app.com:8080/mobilebackendtest";
//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
//const baseUrl = "https://ilink-app.com/mobilebackendtest"
//const baseUrl = "https://ilink-app.com/mobilebackendtest";
export const adhesionUrl = baseUrl + '/interacted/LoginAction.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 demandeActionUrl = baseUrl + '/interacted/DemandeAction.php';
export const configActionUrl = baseUrl + '/interacted/ConfigAction.php';
export const walletActionUrl = testBaseUrl + '/walletService/wallets';
export const walletDetailUrl = testBaseUrl + '/walletService/wallets';
export const creditTreatDemand = testBaseUrl + '/walletService/credits/treatDemand';