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}
@ -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

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

View File

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

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