Commit 189f580d authored by Fred's avatar Fred

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	view/Outlets.js
parents 39002021 75aab192
import Axios from 'axios';
import Constants from 'expo-constants';
import { Alert } from 'react-native';
export default function CheckVersion(navigation) {
let version = Constants.manifest.version
Axios.get('https://excelsocrm.ravintoladev.com/cms/v2/detail/apps-version').then(respon => {
let version_server = respon.data.content5
let msg_res = respon.data.content6
if (version_server !== '2.0.1') {
Alert.alert(
'Update Version',
msg_res,
[
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel'
},
{ text: 'OK', onPress: () => navigation.navigate('UpdateVersion') }
],
{ cancelable: false }
);
}
}).catch(error => {
console.log(error)
})
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -19,7 +19,7 @@ class EmailConfirmation extends React.Component {
}
componentDidMount() {
// console.log("SESSION " + this.props.session_id)
console.log("SESSION " + this.props.pageEmailConfirmation)
}
handleSubmit() {
......@@ -115,11 +115,20 @@ class EmailConfirmation extends React.Component {
}
handleCancel() {
let pageProps = {
pageEmailConfirmation: false
if (this.props.proses !== 'Register') {
let pageProps = {
isEmailverif: false
}
this.props.setPage(pageProps)
this.props.navigation.navigate('Login');
} else {
let pageProps = {
isEmailverif: false
}
this.props.setPage(pageProps)
this.props.navigation.navigate('New Register');
}
this.props.setPage(pageProps)
this.props.navigation.navigate('New Register');
}
handleResend() {
......@@ -147,7 +156,7 @@ class EmailConfirmation extends React.Component {
}).catch(error => {
let response = error.response.data;
Alert.alert('','Silahkan Cek Email Kembali');
Alert.alert('', 'Silahkan Cek Email Kembali');
this.setState({
spinner: false,
})
......@@ -186,6 +195,7 @@ class EmailConfirmation extends React.Component {
}
render() {
console.log(this.props.proses)
return (
<View style={styles.container}>
<MyStatusBar />
......@@ -216,9 +226,11 @@ class EmailConfirmation extends React.Component {
<TouchableOpacity style={{ height: 60 }} onPress={() => this.handleResend()}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, top: 10 }}>RESEND EMAIL TOKEN</Text>
</TouchableOpacity>
<TouchableOpacity style={{ height: 60 }} onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, }}>CHANGE EMAIL</Text>
</TouchableOpacity>
{this.props.proses == 'Register' ? (
<TouchableOpacity style={{ height: 60 }} onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, }}>CHANGE EMAIL</Text>
</TouchableOpacity>
) : (null)}
</View>
</View>
<View style={{ flex: 1, flexDirection: 'row' }}>
......
......@@ -10,6 +10,7 @@ import { Card } from 'react-native-shadow-cards';
import { connect } from 'react-redux';
import info from '../app.json';
import session from '../function/session';
import CheckVersion from '../function/CheckVersion';
import ActionType from '../redux/globalActionType';
import Toast from 'react-native-tiny-toast';
......@@ -29,6 +30,7 @@ class Home extends React.Component {
my_lat: 0,
my_long: 0,
indicator: true,
indicatorProfileCard: true,
slider_height: 350,
slugs: [],
placeholder: true
......@@ -36,10 +38,9 @@ class Home extends React.Component {
}
componentDidMount() {
console.log('ini outlet id' + this.props.outlet_id)
console.log('ini nama outlet ' + this.props.name_outlet)
console.log('ini alamat outlet ' + this.props.outlet_detailadress)
// const { navigation } = this.props
// CheckVersion(navigation)
const screenWidth = Math.round(Dimensions.get('window').width);
this.setState({
slider_height: screenWidth
......@@ -59,17 +60,19 @@ class Home extends React.Component {
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true,
indicatorProfileCard: true
})
this._account();
if (this.props.outlet_id == '' && this.props.name_outlet == '' && this.props.outlet_detailadress == '') {
this._getPermissions()
} else {
this.setState({
indicator: false
indicator: false,
})
}
this._renderCarousell()
// CheckVersion(navigation)
});
}
......@@ -155,7 +158,7 @@ class Home extends React.Component {
balance: balance,
account_number: account_number,
expire_date: expire,
indicator: false
indicatorProfileCard: false
})
}).catch(error => {
let response = error.response.data
......@@ -372,7 +375,13 @@ class Home extends React.Component {
{
this.state.indicator == true ? (<ActivityIndicator style={{ top: 20, justifyContent: "center" }} size="large" color="#c9af6d" />) :
this.state.indicatorProfileCard == true ? (
<View style={styles.card}>
<Card style={{ padding: 50, margin: 10, alignContent: 'center' }}>
<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />
</Card>
</View>
) :
this.state.account_number === "" ? (
<View style={styles.card}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
......@@ -453,9 +462,9 @@ class Home extends React.Component {
<View style={{ flexDirection: 'row', flex: 1 }}>
<TouchableOpacity
// style={styles.submitUpgradePemium}
activeOpacity={.5}
activeOpacity={.5}
onPress={() => this.props.navigation.navigate('TopUpInfo')}
>
>
<View style={{
flex: 0.5,
height: 40,
......@@ -662,6 +671,7 @@ const mapStateToProps = (state) => {
// login
in_payment: state.in_payment,
BASE_URL : state.BASE_URL,
email: state.email,
outlet_id: state.outlet_id,
name_outlet: state.name_outlet,
......
......@@ -43,8 +43,8 @@ class Item extends React.Component {
handleEdit = (item) => {
let note = ''
if (this.state.notes === '') {
note = item.note;
if (this.state.notes == '') {
note = '';
} else {
note = this.state.notes;
}
......
......@@ -45,7 +45,7 @@ class ItemShoping extends React.Component {
handleEdit = (item) =>{
let note = ''
if (this.state.note === '') {
note = item.note;
note = '';
} else {
note = this.state.note;
}
......
......@@ -11,6 +11,7 @@ import { BASE_URL_LOGIN } from '../model/Base_Model';
import { Notifications } from 'expo';
import Spinner from 'react-native-loading-spinner-overlay';
import Toast from 'react-native-tiny-toast';
import CheckVersion from '../function/CheckVersion';
class Login extends React.Component {
constructor(props) {
......@@ -31,11 +32,10 @@ class Login extends React.Component {
}
componentDidMount() {
// console.log(this.props.language)
const { navigation } = this.props
console.log(this.props.navigation)
CheckVersion(navigation)
this._getDeviceInfo()
}
_getDeviceInfo = async () => {
......@@ -166,7 +166,7 @@ class Login extends React.Component {
}
let prosesProps = {
proses: 'Register'
proses: ''
}
this.props.setProses(prosesProps);
......@@ -185,8 +185,6 @@ class Login extends React.Component {
],
})
}).catch(error => {
let response = error.response.data;
......@@ -228,11 +226,12 @@ class Login extends React.Component {
}
render() {
console.log(this.props.device_id)
console.log(this.props.os_name)
console.log(this.props.fb_token)
console.log(this.props.os_version)
console.log(this.props.app_version)
// console.log(this.props.device_id)
// console.log(this.props.os_name)
// console.log(this.props.fb_token)
// console.log(this.props.os_version)
// console.log(this.props.app_version)
return (
<View style={styles.container}>
<Spinner
......
import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, Alert, TouchableOpacity, Image } from 'react-native';
import { View, Text, TextInput, StyleSheet, Button, Alert, TouchableOpacity, Image, ImageBackground, ScrollView } from 'react-native';
import { connect } from 'react-redux';
import Axios from 'axios';
import ActionType from '../redux/globalActionType';
......@@ -82,7 +82,7 @@ class NewPassword extends React.Component {
textStyle={styles.spinnerTextStyle}
/>
<View style={{ flex: 3 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Email</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 18, textAlign: 'center', margin: 3, marginBottom: 15 }}>{this.props.email}</Text>
......@@ -112,7 +112,7 @@ class NewPassword extends React.Component {
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={styles.v_logo}>
<View style={{ flex: 1, alignSelf: 'flex-start' }}>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo}></Image>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo} />
</View>
<View style={{ flex: 1 }}>
</View>
......
......@@ -37,18 +37,26 @@ class Outlets extends React.Component {
}
componentDidMount() {
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true,
})
// this._getOutletClosest()
this.OrderedList()
this._getPermissions()
});
// this._getOutletClosest()
this.OrderedList()
this._getPermissions()
// this._unsubscribe = this.props.navigation.addListener('focus', () => {
// this.setState({
// indicator: true,
// })
// // this._getOutletClosest()
// this.OrderedList()
// this._getPermissions()
// });
}
// componentWillUnmount() {
// this._unsubscribe()
// }
_getPermissions = async () => {
let { status } = await Permissions.askAsync(Permissions.LOCATION);
if (status !== 'granted') {
......@@ -176,7 +184,7 @@ class Outlets extends React.Component {
// let outletName = res.data.data.outlet_name
// this.setState({
// indicator: false,
// // indicator: false,
// data_name: outletName
// })
......@@ -315,24 +323,25 @@ class Outlets extends React.Component {
placeholder={{ label: 'All City' }}
onValueChange={(label) => this.filterData(label)}
items={this.state.data_outlet}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}}
style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/>
</View>
</View>
<View style={styles.body}>
{this.state.dataOutlets.length > 0 ? (
<FlatList
data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])}
renderItem={this.RenderItem}
keyExtractor={item => item.id}
windowSize={5}
initialNumToRender={18}
maxToRenderPerBatch={2}
onEndReachedThreshold={0.5}
/>
) : (
<Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2', textAlign:'center' }}> Tidak Ada Outlets di area anda !</Text>
)}
{this.state.indicator ? (<ActivityIndicator style={{ top: 20, justifyContent: "center" }} size="large" color="#c9af6d" />) : (
this.state.dataOutlets.length > 0 ? (
<FlatList
data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])}
renderItem={this.RenderItem}
keyExtractor={item => item.id}
windowSize={5}
initialNumToRender={18}
maxToRenderPerBatch={2}
onEndReachedThreshold={0.5}
/>
) : (
<Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2', textAlign: 'center' }}> Tidak Ada Outlets di area anda !</Text>
))}
</View>
</View>
......
import React from 'react';
import { View, Text, Image, StyleSheet, ScrollView, Alert, TouchableOpacity } from 'react-native';
import { View, Text, Image, StyleSheet, ScrollView, Alert, TouchableOpacity, ActivityIndicator } from 'react-native';
import { Card } from 'react-native-shadow-cards'
import { connect } from 'react-redux';
import Axios from 'axios';
......@@ -9,13 +9,17 @@ class RewardsList extends React.Component {
constructor(props) {
super(props)
this.state = {
rewardsList: []
rewardsList: [],
indicator: true
}
}
componentDidMount() {
this.getRewardsList()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true
})
this.getRewardsList()
});
......@@ -38,7 +42,8 @@ class RewardsList extends React.Component {
})
// console.log(data)
this.setState({
rewardsList: data
rewardsList: data,
indicator: false
})
}).catch(error => {
......@@ -55,36 +60,37 @@ class RewardsList extends React.Component {
</View>
<ScrollView style={styles.body}>
{
this.state.rewardsList.length ? (
this.state.rewardsList.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}>
<View style={{ alignItems: 'center' }}>
<Card style={{ padding: 5, margin: 5 }}>
<View>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View style={{ flex: 0.6}}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}>{item.reward.title}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.reward.subtitle}</Text>
this.state.indicator ? (<ActivityIndicator style={{ top: 20, justifyContent: "center" }} size="large" color="#c9af6d" />) : (
this.state.rewardsList.length ? (
this.state.rewardsList.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}>
<View style={{ alignItems: 'center' }}>
<Card style={{ padding: 5, margin: 5 }}>
<View>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flex: 0.4}}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>Expired On</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.expire_time}</Text>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View style={{ flex: 0.6 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}>{item.reward.title}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.reward.subtitle}</Text>
</View>
<View style={{ flex: 0.4 }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>Expired On</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.expire_time}</Text>
</View>
</View>
</View>
</Card>
</Card>
</View>
</TouchableOpacity>
))
) : (
<View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>No E-Voucher Available</Text>
</View>
</TouchableOpacity>
))
) : (
<View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>No E-Voucher Available</Text>
</View>
)
))
}
<TouchableOpacity style={{ marginVertical: 20 }} onPress={() => this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text>
......@@ -103,7 +109,7 @@ const styles = StyleSheet.create({
},
header: {
flex: 0.1,
marginBottom:5,
marginBottom: 5,
backgroundColor: '#CFB368',
justifyContent: 'center'
},
......
import Axios from 'axios';
import React from 'react';
import { ScrollView, StyleSheet, Text, View, Image, StatusBar } from 'react-native';
import { TouchableOpacity } from 'react-native-gesture-handler';
import HTML from 'react-native-render-html';
import { Collapse, CollapseHeader, CollapseBody, AccordionList } from 'accordion-collapse-react-native'
import { getStatusBarHeight } from 'react-native-status-bar-height';
import MyStatusBar from './MyStatusBar';
export default class UpdateVersion extends React.Component {
constructor(props) {
super(props);
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<View style={{ justifyContent: 'center', alignItems: 'center', flex: 1, backgroundColor:'white' }}>
<Text>Mohon update aplikasi terlebih dahulu</Text>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white'
},
headerTitle: {
flex: 1,
textAlign: 'center',
margin: 20,
fontSize: 23,
alignSelf: 'center',
color: 'white',
fontFamily: 'Gotham-Black'
},
image_container: (height) => ({
height: height,
backgroundColor: 'gray'
}),
image: (height) => ({
width: '100%',
height: height
}),
title: {
textAlign: 'center',
fontFamily: 'Gotham-Black',
fontSize: 22,
marginBottom: 10,
color: '#CFB368'
},
content: {
paddingHorizontal: 20,
paddingVertical: 25
},
item_container: {
borderColor: 'gray',
borderWidth: 1,
borderRadius: 10,
marginBottom: 20,
color: '#adadad'
},
item_title: {
fontSize: 18,
color: '#adadad',
fontFamily: 'Gotham-Black',
flex: 1,
alignSelf: 'center',
},
item_image: {
width: 96,
height: 28,
alignItems: 'flex-end'
}
})
\ No newline at end of file
import * as React from 'react';
import { Button, View, Text, TextInput, StyleSheet, Alert, Platform, Image, TouchableOpacity, StatusBar, ImageBackground, ScrollView } from 'react-native';
import Spinner from 'react-native-loading-spinner-overlay';
import CheckVersion from '../function/CheckVersion';
export default class WelcomeLog extends React.Component {
constructor(props) {
......@@ -11,7 +12,8 @@ export default class WelcomeLog extends React.Component {
}
componentDidMount() {
// console.log(this.props.language)
const { navigation } = this.props
CheckVersion(navigation)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment