Commit ccd3831e authored by Trisno's avatar Trisno
parents 6c2952f9 fe4cca37
{ {
"expo": { "expo": {
"name": "Excelso_update 09.00 / 14.05.2020", "name": "Excelso_update 13.00 / 18.05.2020",
"slug": "excelso-pro", "slug": "excelso-pro",
"privacy": "public", "privacy": "public",
"sdkVersion": "36.0.0", "sdkVersion": "36.0.0",
......
...@@ -7130,6 +7130,14 @@ ...@@ -7130,6 +7130,14 @@
} }
} }
}, },
"react-number-format": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-4.4.1.tgz",
"integrity": "sha512-ZGFMXZ0U7DcmQ3bSZY3FULOA1mfqreT9NIMYZNoa/ouiSgiTQiYA95Uj2KN8ge6BRr+ghA5vraozqWqsHZQw3Q==",
"requires": {
"prop-types": "^15.7.2"
}
},
"react-redux": { "react-redux": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz",
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
"react-native-web": "~0.11.7", "react-native-web": "~0.11.7",
"react-native-webview": "^7.4.3", "react-native-webview": "^7.4.3",
"react-navigation": "^4.2.2", "react-navigation": "^4.2.2",
"react-number-format": "^4.4.1",
"react-redux": "^7.2.0", "react-redux": "^7.2.0",
"react-redux-i18n": "^1.9.3", "react-redux-i18n": "^1.9.3",
"redux": "^4.0.5", "redux": "^4.0.5",
......
...@@ -38,7 +38,8 @@ class Account extends React.Component { ...@@ -38,7 +38,8 @@ class Account extends React.Component {
expire_date: "", expire_date: "",
premium: "", premium: "",
my_lat: 0, my_lat: 0,
my_long: 0 my_long: 0,
full_name:''
} }
} }
...@@ -103,7 +104,6 @@ class Account extends React.Component { ...@@ -103,7 +104,6 @@ class Account extends React.Component {
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => {
console.log('WAKWAWWWW ' + JSON.stringify(res.data))
const dataCard = res.data const dataCard = res.data
let email = dataCard.email let email = dataCard.email
let point = dataCard.kaspro_point let point = dataCard.kaspro_point
...@@ -113,6 +113,7 @@ class Account extends React.Component { ...@@ -113,6 +113,7 @@ class Account extends React.Component {
let expire = dataCard.expire_date let expire = dataCard.expire_date
let premium = dataCard.kaspro_is_premium let premium = dataCard.kaspro_is_premium
let kaspro = dataCard.kaspro_account_number let kaspro = dataCard.kaspro_account_number
let full_name = dataCard.name
if (kaspro === "") { if (kaspro === "") {
...@@ -141,6 +142,7 @@ class Account extends React.Component { ...@@ -141,6 +142,7 @@ class Account extends React.Component {
img_card: img_card, img_card: img_card,
expire_date: expire, expire_date: expire,
premium: premium, premium: premium,
full_name:full_name
}) })
}).catch(error => { }).catch(error => {
...@@ -181,17 +183,24 @@ class Account extends React.Component { ...@@ -181,17 +183,24 @@ class Account extends React.Component {
source={require('../assets/images/people-actv.png')} source={require('../assets/images/people-actv.png')}
/> />
</View> </View>
<View style={{ height: 60, flexDirection: 'row', justifyContent: 'center' }}> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center',top:5 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}> {this.state.full_name}
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', margin: 15 }}> </Text>
{this.state.email} {this.props.set_card} <View style={{ height: 90, flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity style={{flexDirection:'row'}} onPress={() => this.props.navigation.navigate('Profile')}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 17, textAlign: 'center',top:10 }}>
{this.state.email}
</Text> </Text>
</TouchableOpacity>
<Icon <Icon
containerStyle={{ top: 8 }} containerStyle={{margin:5}}
name='ios-create' name='ios-create'
type='ionicon' type='ionicon'
color='#CFB368'
/> />
</TouchableOpacity>
</View> </View>
</View> </View>
...@@ -228,7 +237,7 @@ class Account extends React.Component { ...@@ -228,7 +237,7 @@ class Account extends React.Component {
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', top: 20 }}>No card yet</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', top: 20 }}>No card yet</Text>
<TouchableOpacity onPress={() => this.handleLoggin()}> <TouchableOpacity onPress={() => this.handleLoggin()}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, top: 90 }}> <View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, top: 90 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>ACTIVATION CARD</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>ACTIVATE CARD</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -244,18 +253,18 @@ class Account extends React.Component { ...@@ -244,18 +253,18 @@ class Account extends React.Component {
<View style={styles.Card}> <View style={styles.Card}>
<Card style={{ padding: 10, margin: 20, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 20, alignContent: 'center' }}>
<Text style={{fontSize:12, fontFamily: 'Gotham-Black', }}> <Text style={{fontSize:12, fontFamily: 'Gotham-Black', }}>
YOUR CARD NUMBER | EXPIRED ON {this.state.expire_date}{'\n'} YOUR CARD NUMBER | <Text style={{fontFamily:'Gotham-Light'}}>EXPIRED ON </Text> <Text style={{fontFamily:'Gotham-Light'}}>{this.state.expire_date}</Text> {'\n'}
</Text> </Text>
<Text style={{ fontFamily: 'Gotham-Black', textAlign: "center", fontSize: 40, color: '#c9af6d' }}> <Text style={{ fontFamily: 'Gotham-Black', textAlign: "center", fontSize: 40, color: '#c9af6d' }}>
{this.state.account_number} {this.state.account_number}
</Text> </Text>
<View style={styles.line}></View> <View style={styles.line}></View>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold' }}> {'\n'} <Text style={{fontFamily: 'Gotham-Light', textAlign: 'left',fontSize:15 }}> {'\n'}
BALANCE : {this.state.balance}{'\n'} BALANCE : {this.state.balance}{'\n'}
</Text> </Text>
<View style={styles.line}></View> <View style={styles.line}></View>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold' }}>{'\n'} <Text style={{fontFamily: 'Gotham-Light', textAlign: 'left',fontSize:15 }}> {'\n'}
POINTS : {this.state.points} POINTS : {this.state.points}{'\n'}
</Text> </Text>
</Card> </Card>
</View> </View>
...@@ -360,7 +369,8 @@ const styles = StyleSheet.create({ ...@@ -360,7 +369,8 @@ const styles = StyleSheet.create({
}, },
Card: { Card: {
top: 50, top: 60,
alignItems: 'center', alignItems: 'center',
backgroundColor: 'white', backgroundColor: 'white',
alignContent: 'center', alignContent: 'center',
...@@ -369,11 +379,20 @@ const styles = StyleSheet.create({ ...@@ -369,11 +379,20 @@ const styles = StyleSheet.create({
line: { line: {
top:3, top:3,
borderRadius:1, borderRadius:1,
borderColor:'#c9af6d', borderColor:'black',
borderWidth:1,
width: "100%",
height: 1,
bottom: 5,
},
line1: {
top:3,
borderRadius:1,
borderColor:'black',
borderWidth:1, borderWidth:1,
alignSelf: 'stretch',
width: "100%", width: "100%",
height: 3, height: 1,
bottom: 5, bottom: 5,
}, },
......
...@@ -8,8 +8,9 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'; ...@@ -8,8 +8,9 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
import { MaterialCommunityIcons, Ionicons } from '@expo/vector-icons';
class AddreesDetail extends React.Component { class AddreesDetail extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
...@@ -18,18 +19,18 @@ import Spinner from 'react-native-loading-spinner-overlay'; ...@@ -18,18 +19,18 @@ import Spinner from 'react-native-loading-spinner-overlay';
longitude: 0, longitude: 0,
location: null, location: null,
error_message: null, error_message: null,
name:'', name: '',
address_id:'', address_id: '',
description:'', description: '',
lat:'', lat: '',
long:'', long: '',
street: '', street: '',
city: '', city: '',
region: '', region: '',
name: '', name: '',
postalCode: '', postalCode: '',
address: '', address: '',
address_d:'', address_d: '',
spinner: false, spinner: false,
} }
} }
...@@ -116,9 +117,9 @@ import Spinner from 'react-native-loading-spinner-overlay'; ...@@ -116,9 +117,9 @@ import Spinner from 'react-native-loading-spinner-overlay';
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
address_id: '', address_id: '',
address: this.state.street + ' ' + this.state.city + ' ' + this.state.region + ' ' + this.state.postalCode , address: this.state.street + ' ' + this.state.city + ' ' + this.state.region + ' ' + this.state.postalCode,
name: this.state.name, name: this.state.name,
description: this.state.description , description: this.state.description,
lat: this.state.latitude, lat: this.state.latitude,
long: this.state.longitude long: this.state.longitude
} }
...@@ -138,8 +139,8 @@ import Spinner from 'react-native-loading-spinner-overlay'; ...@@ -138,8 +139,8 @@ import Spinner from 'react-native-loading-spinner-overlay';
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
const {navigation} = this.props const { navigation } = this.props
session(response,navigation) session(response, navigation)
Alert.alert( Alert.alert(
'', '',
response.msg response.msg
...@@ -159,19 +160,20 @@ import Spinner from 'react-native-loading-spinner-overlay'; ...@@ -159,19 +160,20 @@ import Spinner from 'react-native-loading-spinner-overlay';
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> />
<ScrollView> <ScrollView>
<View style={styles.header}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Tambah Alamat</Text>
</View>
<View style={styles.content}> <View style={styles.content}>
<View style={styles.field_search}> <View style={{ height: 45, borderRadius: 10, borderColor: 'grey', borderWidth: 1, flexDirection: 'row', marginTop: 15, marginLeft: 10, marginRight: 10 }}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Cari</Text>
</View>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }} onChangeText={(address) => this.setState({ address })} /> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View>
<View style={{ flex: 6 }}>
<TextInput style={{ height: 45 }} placeholder="Cari Alamat"
onChangeText={(address) => this.setState({ address })}>
</TextInput>
</View> </View>
<View style={{ alignSelf: 'center' }}> <View style={{ flex: 1, margin: 5 }}>
<Button title="cari" onPress={() => this._searchLocation()}></Button> <TouchableOpacity onPress={() => this._searchLocation()}>
<Ionicons name="ios-search" size={32} color="#ccb46c" />
</TouchableOpacity>
</View> </View>
</View> </View>
<View style={styles.cont_google_map}> <View style={styles.cont_google_map}>
...@@ -189,45 +191,53 @@ import Spinner from 'react-native-loading-spinner-overlay'; ...@@ -189,45 +191,53 @@ import Spinner from 'react-native-loading-spinner-overlay';
loadingEnabled={true} loadingEnabled={true}
showsUserLocation={true} showsUserLocation={true}
showsScale={true} showsScale={true}
style={styles.cont_google_map} style={styles.cont_google_map}>
<MapView.Marker
coordinate={{
latitude: this.state.latitude,
longitude:this.state.longitude
}}
title={"Lokasi Kamu "}
description={this.state.street}
/> />
</MapView>
<View style={{ position: 'absolute', top: '50%', alignSelf: 'flex-end' }}> <View style={{ position: 'absolute', top: '50%', alignSelf: 'flex-end' }}>
<View style={{ margin: 15 }}> <View style={{ margin: 15 }}>
<TouchableOpacity style={{ height: 30, width: 30, backgroundColor: '#e6e6e6' }} onPress={() => this._getLocationAsync()}> <TouchableOpacity style={{ height: 30, width: 30, backgroundColor: '#e6e6e6' }} onPress={() => this._getLocationAsync()}>
<Image source={require('../assets/icon/gps.png')} style={{ height: 30, width: 30 }} /> {/* <Image source={require('../assets/icon/gps.png')} style={{ height: 30, width: 30 }} /> */}
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
</View> </View>
<View style={styles.name_addrees_input}> <View style={styles.name_addrees_input}>
<View style={styles.field_name_addrees}> <View style={{ flexDirection: 'row', top: 20 }}>
<View style={{ width: 55, justifyContent: 'center' }}> <View style={{ flex: 0.5 }}>
<Text>Nama</Text> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View> </View>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10 }} onChangeText={(name) => this.setState({ name })} /> <View style={{ flex: 3 }}>
<Text style={{ fontFamily: 'Gotham-Light' }}>{this.state.street}</Text><Text style={{ fontFamily: 'Gotham-Light' }}>{this.state.city} <Text>{this.state.region}</Text><Text>{this.state.postalCode}</Text></Text>
</View> </View>
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Detail</Text>
</View>
<TextInput style={{ height: 80, borderWidth: 1, padding: 5, flex: 1, margin: 10 }} onChangeText={(description) => this.setState({ description })} />
</View> </View>
<View style={styles.field_name_addrees}> <View style={styles.field_name_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}> <View style={{ width: 55, justifyContent: 'center' }}>
<Text>Alamat</Text> <Text style={{ fontFamily: 'Gotham-Black', marginLeft: 10, color: "#ccb46c" }}>Nama</Text>
</View> </View>
<View style={{ flex: 1, height: 80, borderWidth: 1, padding: 5, margin: 10 }}> <TextInput style={{ height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} onChangeText={(name) => this.setState({ name })} />
<View style={{ padding: 5 }}>
<Text>{this.state.street}</Text>
<Text>{this.state.city}</Text>
<Text>{this.state.region}</Text>
<Text>{this.state.postalCode}</Text>
</View> </View>
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', marginLeft: 10, color: "#ccb46c" }} >Detail</Text>
</View> </View>
<TextInput style={{ height: 80, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} onChangeText={(description) => this.setState({ description })} />
</View> </View>
<View style={{ margin: 50, justifyContent: 'center' }}> <View style={{ margin: 50, justifyContent: 'center' }}>
<Button title="Simpan" onPress={() => this.saveAddress()} /> <TouchableOpacity onPress={() => this.saveAddress()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center' }}>+ Tambah Alamat</Text>
</View>
</TouchableOpacity>
</View> </View>
</View> </View>
</View> </View>
...@@ -255,13 +265,12 @@ const styles = StyleSheet.create({ ...@@ -255,13 +265,12 @@ const styles = StyleSheet.create({
}, },
field_search: { field_search: {
flexDirection: 'row' flexDirection: 'column'
}, },
cont_google_map: { cont_google_map: {
flex: 1, flex: 1,
borderWidth: 1, top: 5,
margin: 5,
height: 250, height: 250,
}, },
...@@ -271,11 +280,13 @@ const styles = StyleSheet.create({ ...@@ -271,11 +280,13 @@ const styles = StyleSheet.create({
}, },
field_name_addrees: { field_name_addrees: {
flexDirection: 'row' flexDirection: 'column',
top: 25,
}, },
field_detail_addrees: { field_detail_addrees: {
flexDirection: 'row' flexDirection: 'column',
top: 25,
}, },
button: { button: {
...@@ -291,6 +302,8 @@ const mapStateToProps = (state) => { ...@@ -291,6 +302,8 @@ const mapStateToProps = (state) => {
session_id: state.session_id, session_id: state.session_id,
} }
} }
export default connect(mapStateToProps)(AddreesDetail)
export default connect(mapStateToProps)(AddreesDetail) // <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10,borderRadius:5 }} onChangeText={(address) => this.setState({ address })} />
\ No newline at end of file \ No newline at end of file
...@@ -269,8 +269,30 @@ class Auth extends React.Component { ...@@ -269,8 +269,30 @@ class Auth extends React.Component {
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> <Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Upgrade Premium" component={UpgradePremium} /> <Stack.Screen name="Upgrade Premium" component={UpgradePremium} />
<Stack.Screen name="Camera" component={Cameras} /> <Stack.Screen name="Camera" component={Cameras} />
<Stack.Screen name="Delivery Address" component={DeliveryAddress} /> <Stack.Screen name="Delivery Address" component={DeliveryAddress} options={{
<Stack.Screen name="Address Detail" component={AddressDetail} /> headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'Delivery Address'
}} />
<Stack.Screen name="Address Detail" component={AddressDetail} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'Tambah Alamat'
}} />
<Stack.Screen name="Menu Detail" component={MenuDetail} /> <Stack.Screen name="Menu Detail" component={MenuDetail} />
<Stack.Screen name="Pickup Name" component={PickupName} options={{ <Stack.Screen name="Pickup Name" component={PickupName} options={{
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
......
import React from 'react'; import React from 'react';
import { View, Text, StyleSheet, Button, FlatList, Alert } from 'react-native'; import { View, Text, StyleSheet, Button, FlatList, Alert, TextInput, Image } from 'react-native';
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'; import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { CheckBox, Icon } from 'react-native-elements';
import Axios from 'axios'; import Axios from 'axios';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import { MaterialCommunityIcons, Ionicons } from '@expo/vector-icons';
// import ravLog from '../helper/debug'; // import ravLog from '../helper/debug';
class DeliveryAddrees extends React.Component { class DeliveryAddrees extends React.Component {
...@@ -11,6 +13,8 @@ class DeliveryAddrees extends React.Component { ...@@ -11,6 +13,8 @@ class DeliveryAddrees extends React.Component {
super(props) super(props)
this.state = { this.state = {
data: [], data: [],
data_before_search: [],
search: '',
// outlet_id: '', // outlet_id: '',
// grabamount: '' // grabamount: ''
} }
...@@ -34,6 +38,7 @@ class DeliveryAddrees extends React.Component { ...@@ -34,6 +38,7 @@ class DeliveryAddrees extends React.Component {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_address', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_address', params).then(res => {
const dataAlamat = res.data.data; const dataAlamat = res.data.data;
console.log("INI DATA :" + JSON.stringify(dataAlamat))
let address = [] let address = []
for (let i = 0; i < dataAlamat.length; i++) { for (let i = 0; i < dataAlamat.length; i++) {
const element = dataAlamat[i]; const element = dataAlamat[i];
...@@ -41,7 +46,8 @@ class DeliveryAddrees extends React.Component { ...@@ -41,7 +46,8 @@ class DeliveryAddrees extends React.Component {
} }
this.setState({ this.setState({
data: address data: address,
data_before_search: dataAlamat,
}) })
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
...@@ -96,7 +102,7 @@ class DeliveryAddrees extends React.Component { ...@@ -96,7 +102,7 @@ class DeliveryAddrees extends React.Component {
}).catch(error => { }).catch(error => {
Alert.alert('ini error get rate ' , error.msg) Alert.alert('ini error get rate ', error.msg)
}) })
} }
...@@ -105,6 +111,27 @@ class DeliveryAddrees extends React.Component { ...@@ -105,6 +111,27 @@ class DeliveryAddrees extends React.Component {
} }
filterData(text) {
const newData = this.state.data_before_search.filter(function (item) {
const itemData = item.name ? item.name.toUpperCase() : ''.toUpperCase();
const textData = text.toUpperCase();
return itemData.indexOf(textData) > -1;
});
if (text === '') {
this.setState({
data: this.state.data_before_search,
search: ''
})
} else {
this.setState({
data: newData,
search: text
});
}
}
onSave(address, id) { onSave(address, id) {
let setDataAddress = { let setDataAddress = {
...@@ -113,22 +140,13 @@ class DeliveryAddrees extends React.Component { ...@@ -113,22 +140,13 @@ class DeliveryAddrees extends React.Component {
} }
this.props.setAddress(setDataAddress); this.props.setAddress(setDataAddress);
// this.getRate(id)
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
address_id: id, address_id: id,
} }
// console.log("INI PRAMETER NYA : " + JSON.stringify(params))
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate', params).then(res => {
// this.setState({
// grabamount: res.data.data.amount,
// grabdestination: res.data.data.outlet_name,
// })
let setGrabProps = { let setGrabProps = {
// grabdestination: this.state.grabdestination, // grabdestination: this.state.grabdestination,
// grabamount: this.state.grabamount, // grabamount: this.state.grabamount,
...@@ -142,24 +160,11 @@ class DeliveryAddrees extends React.Component { ...@@ -142,24 +160,11 @@ class DeliveryAddrees extends React.Component {
} }
this.props.setGrab(setGrabProps); this.props.setGrab(setGrabProps);
this.props.setChangeOutletProps(OutletChange); this.props.setChangeOutletProps(OutletChange);
// console.log("INI SUKSES RESPONNYA ")
// console.log('Delivery Amount Address : ' + res.data.data.amount)
// let setOrdersProps = {
// balanceUsed: this.state.balanceused,
// pointused: this.state.pointsused,
// }
// this.props.setOrder(setOrdersProps);
this.props.setTypePickup(false) this.props.setTypePickup(false)
// console.log(this.props)
if (this.props.route.params.from == 'shoppingCart') { if (this.props.route.params.from == 'shoppingCart') {
this.props.navigation.navigate('Shopping Cart', {outlet_change: true, outlet_id: res.data.data.outlet_id}) this.props.navigation.navigate('Shopping Cart', { outlet_change: true, outlet_id: res.data.data.outlet_id })
} else { } else {
this.props.navigation.navigate('Home', { this.props.navigation.navigate('Home', {
screen: 'MENU', screen: 'MENU',
...@@ -172,7 +177,7 @@ class DeliveryAddrees extends React.Component { ...@@ -172,7 +177,7 @@ class DeliveryAddrees extends React.Component {
let response = error.response.data; let response = error.response.data;
Alert.alert(response.msg) Alert.alert(response.msg)
console.log('ini error ' + response.msg) console.log('ini error ' + response.msg)
Alert.alert('ini error get rate ' , error.msg) Alert.alert('ini error get rate ', error.msg)
}) })
...@@ -204,17 +209,32 @@ class DeliveryAddrees extends React.Component { ...@@ -204,17 +209,32 @@ class DeliveryAddrees extends React.Component {
return ( return (
<View style={styles.list_addrees}> <View style={styles.list_addrees}>
<TouchableOpacity onPress={() => this.onSave(item.address, item.id)}> <TouchableOpacity onPress={() => this.onSave(item.address, item.id)}>
<View style={{ margin: 5, }}> <View style={{ flex: 1, flexDirection: 'row', margin: 5, }}>
<Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text> <View style={{ flex: 1, marginBottom: 10, justifyContent: 'center' }}>
<View>
<CheckBox
checkedIcon='dot-circle-o'
uncheckedIcon='circle-o'
checked={this.state.checked}
checkedColor="#ccb46c"
uncheckedColor="#ccb46c"
/>
</View>
<View>
<Text style={{textAlign:'center', color: '#ccb46c', fontFamily: 'Gotham-Light' ,marginRight:20}}>PILIH</Text>
</View>
</View>
<View style={{ flex: 3, justifyContent: 'center' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 15 }}>{item.name}</Text>
</View>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 15 }}>{item.address}</Text>
</View>
</View> </View>
<Text style={{ margin: 5 }}>
{item.address}
</Text>
<Text style={{ margin: 5 }}>
Patokan : {item.description}
</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
); );
} }
render() { render() {
...@@ -222,15 +242,29 @@ class DeliveryAddrees extends React.Component { ...@@ -222,15 +242,29 @@ class DeliveryAddrees extends React.Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row', marginTop: 15, marginLeft: 10, marginRight: 10 }}>
<Text style={{ textAlign: 'center', margin: 20, fontSize: 25, alignSelf: 'center' }}>Delivery Address</Text> <View style={{ flex: 1 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View>
<View style={{ flex: 6 }}>
<TextInput style={{ height: 45 }} placeholder="Cari Alamat"
onChangeText={text => this.filterData(text)}
onClear={text => this.filterData('')}
value={this.state.search}></TextInput>
</View>
<View style={{ flex: 1, margin: 5 }}>
<Ionicons name="ios-search" size={32} color="#ccb46c" />
</View>
</View> </View>
<View style={styles.body}>
{/* <ScrollView> */}
<View style={styles.btn_addreess}> <View style={styles.btn_addreess}>
<Button title="Tambah Alamat" onPress={() => this.addAdreess()}></Button> <TouchableOpacity onPress={() => this.addAdreess()}>
<View style={{ height: 40, borderRadius: 15, marginRight: 70, marginLeft: 70, backgroundColor: '#CFB368', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', color: 'white', fontSize: 20 }}> + Tambah Alamat </Text>
</View> </View>
</TouchableOpacity>
</View>
<View style={styles.listAddress}>
<FlatList <FlatList
data={this.state.data} data={this.state.data}
renderItem={this.renderItem} renderItem={this.renderItem}
...@@ -238,6 +272,7 @@ class DeliveryAddrees extends React.Component { ...@@ -238,6 +272,7 @@ class DeliveryAddrees extends React.Component {
/> />
</View> </View>
</View> </View>
) )
} }
} }
...@@ -254,6 +289,7 @@ const styles = StyleSheet.create({ ...@@ -254,6 +289,7 @@ const styles = StyleSheet.create({
body: { body: {
flex: 3, flex: 3,
marginTop: 10,
marginRight: 20, marginRight: 20,
marginLeft: 20, marginLeft: 20,
marginBottom: 20, marginBottom: 20,
...@@ -261,15 +297,18 @@ const styles = StyleSheet.create({ ...@@ -261,15 +297,18 @@ const styles = StyleSheet.create({
}, },
btn_addreess: { btn_addreess: {
margin: 20, margin: 10,
}, },
list_addrees: { list_addrees: {
flex: 1, flex: 1,
margin: 20, margin: 20,
borderWidth: 1, borderWidth: 1,
borderColor: 'grey',
borderRadius: 10,
} }
}) })
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
...@@ -332,3 +371,55 @@ const mapDispatchToProps = (dispacth) => { ...@@ -332,3 +371,55 @@ const mapDispatchToProps = (dispacth) => {
export default connect(mapStateToProps, mapDispatchToProps)(DeliveryAddrees) export default connect(mapStateToProps, mapDispatchToProps)(DeliveryAddrees)
{/* <TouchableOpacity onPress={() => this.onSave(item.address, item.id)}>
<View style={{ margin: 5, }}>
<Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text>
</View>
<Text style={{ margin: 5 }}>
{item.address}
</Text>
</TouchableOpacity> */}
// <View style={styles.searchBar}>
// <View style={{ height: 50, borderWidth: 1, borderColor: 'black', borderRadius: 15, margin: 15, flexDirection: 'row' }}>
// <View style={{ flex: 1 }}>
// </View>
// <View style={{ flex: 4 }}></View>
// <View style={{ flex: 1 }}></View>
// </View>
// </View>
// <View style={styles.btnAddress}>
// <TouchableOpacity onPress={() => this.addAdreess()}>
// <View style={{ height: 40, borderRadius: 15, marginRight: 70, marginLeft: 70, backgroundColor: '#CFB368', justifyContent: 'center', alignContent: 'center' }}>
// <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', color: 'white', fontSize: 20 }}> + Tambah Alamat </Text>
// </View>
// </TouchableOpacity>
// </View>
// <View style={styles.listAddress}>
// <FlatList
// data={this.state.data}
// renderItem={this.renderItem}
// keyExtractor={item => item.id}
// />
// </View>
// <View style={styles.body}>
// {/* <ScrollView> */}
// <View style={styles.btn_addreess}>
// <Button title="Tambah Alamat" onPress={() => this.addAdreess()}></Button>
// </View>
// <FlatList
// data={this.state.data}
// renderItem={this.renderItem}
// keyExtractor={item => item.id}
// />
// </View>
\ No newline at end of file
import React from 'react'; import React from 'react';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, TextInput } from 'react-native'; import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, TextInput,Modal } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import NumberFormat from 'react-number-format';
class Item extends React.Component { class Item extends React.Component {
...@@ -15,7 +16,7 @@ class Item extends React.Component { ...@@ -15,7 +16,7 @@ class Item extends React.Component {
handleChangeQuantity = (item, qty) => { handleChangeQuantity = (item, qty) => {
if (qty == '') { if (qty == '') {
item.qty=0 item.qty = 0
} else { } else {
const order_item = { const order_item = {
...@@ -40,28 +41,34 @@ class Item extends React.Component { ...@@ -40,28 +41,34 @@ class Item extends React.Component {
<View style={{ flex: 1, margin: 10 }} key={item.id} ref={this.props._scrollView}> <View style={{ flex: 1, margin: 10 }} key={item.id} ref={this.props._scrollView}>
<ScrollView ref={view => this._scrollView = view}> <ScrollView ref={view => this._scrollView = view}>
{item.code == 'CATEGORY' ? ( {item.code == 'CATEGORY' ? (
<Text style={{ fontSize: 20, color: '#c9af6d' }}>{item.name}</Text> <Text style={{ fontSize: 15, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>{item.name}</Text>
) : ( ) : (
<View style={{ flexDirection: 'row' }}> <View style={{ flex: 1, flexDirection: 'row', height: 100 }}>
<View > <View style={{ flex: 1, height: 100 }}>
<Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 5, top: 5 }}></Image> <TouchableOpacity onPress={() => this.props.navigation.navigate('Menu Detail', {nameMenu:item.name,desc:item.description,image:item.image})}>
<Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 10, }}></Image>
</TouchableOpacity>
</View>
<View style={{ flex: 2, height: 150 }}>
<View style={{ marginLeft: 5, marginRight: 5 }}>
<Text style={{ fontSize: 15, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black' }}>{item.name}</Text>
<NumberFormat decimalScale={0} value={item.price} renderText={value => <Text style={{ fontSize: 12, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
<View style={{ marginLeft: 5, marginRight: 5, flexDirection: 'row' }}>
<View style={styles.shadowEdit}>
<Image source={(require('../assets/icon/icon-pencil.png'))} style={{ height: 25, width: 25, marginLeft: 5, marginRight: 5 }}></Image>
</View> </View>
<View >
<Text style={{ fontSize: 20, margin: 5, marginRight: 10, fontWeight: 'bold' }}>{item.name}</Text>
<Text style={{ fontSize: 15, margin: 5, marginRight: 10 }}>Rp. {item.price}</Text>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={styles.shadowEdit}></View>
<View style={styles.shadowAdd}> <View style={styles.shadowAdd}>
<TouchableOpacity onPress={() => this.props.handleMin()}> <TouchableOpacity onPress={() => this.props.handleMin()}>
<Text style={{ fontSize: 20, margin: 2 }}> - </Text> <Text style={{ fontSize:25,alignSelf:'center' }}> - </Text>
</TouchableOpacity> </TouchableOpacity>
<TextInput <TextInput
style={{ height: 25, padding: 2, textAlign: 'center', margin: 2 }} style={{ padding: 2, textAlign: 'center', fontFamily: 'Gotham-Black',fontSize:15,marginRight:5,marginLeft:5 }}
keyboardType={'numeric'} keyboardType={'numeric'}
onChangeText={(qty) => this.handleChangeQuantity(item, qty)}>{item.qty}</TextInput> onChangeText={(qty) => this.handleChangeQuantity(item, qty)}>{item.qty}</TextInput>
<TouchableOpacity onPress={() => this.props.handleAdd()}> <TouchableOpacity style={{alignSelf:'center'}} onPress={() => this.props.handleAdd()}>
<Text style={{ fontSize: 20, margin: 2 }}> + </Text> <Text style={{ fontSize: 25,alignSelf:'center' }}> + </Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
...@@ -77,7 +84,7 @@ class Item extends React.Component { ...@@ -77,7 +84,7 @@ class Item extends React.Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
shadowEdit: { shadowEdit: {
height: 30, height: 30,
width: 25, width: 40,
borderWidth: 1, borderWidth: 1,
borderRadius: 2, borderRadius: 2,
borderColor: '#ddd', borderColor: '#ddd',
...@@ -89,11 +96,11 @@ const styles = StyleSheet.create({ ...@@ -89,11 +96,11 @@ const styles = StyleSheet.create({
elevation: 1, elevation: 1,
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
marginTop: 10, marginTop: 5,
}, },
shadowAdd: { shadowAdd: {
height: 30, height: 30,
width: 75, width: 90,
borderWidth: 1, borderWidth: 1,
borderRadius: 2, borderRadius: 2,
borderColor: '#ddd', borderColor: '#ddd',
...@@ -105,7 +112,7 @@ const styles = StyleSheet.create({ ...@@ -105,7 +112,7 @@ const styles = StyleSheet.create({
elevation: 1, elevation: 1,
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
marginTop: 10, marginTop: 5,
flexDirection: 'row' flexDirection: 'row'
}, },
shadowMin: { shadowMin: {
...@@ -122,7 +129,7 @@ const styles = StyleSheet.create({ ...@@ -122,7 +129,7 @@ const styles = StyleSheet.create({
elevation: 1, elevation: 1,
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
marginTop: 10, marginTop: 5,
} }
}) })
......
...@@ -4,23 +4,22 @@ import Axios from 'axios'; ...@@ -4,23 +4,22 @@ import Axios from 'axios';
export default function MenuDetail({ route, navigation }) { export default function MenuDetail({ route, navigation }) {
const { desc } = route.params; const { desc } = route.params;
const { nama } = route.params; const { nameMenu } = route.params;
const { Foto } = route.params; const { image } = route.params;
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}>
<Text style={{ textAlign: 'center', margin: 20, fontSize: 25, alignSelf: 'center' }}>{nama}</Text>
</View>
<View style={styles.body}> <View style={styles.body}>
{/* <View style={styles.images}> */}
<Image style={{ height: '50%', width: '100%' }} <Image style={{ height: '50%', width: '100%' }}
source={{ source={{
uri: Foto uri: image
}} }}
/> />
{/* </View> */} <View style={{height:50,justifyContent:'center'}}>
<Text style={{fontFamily:'Gotham-Black',fontSize:25,textAlign:'center',color:'grey'}}>{nameMenu}</Text>
</View>
<View style={{height:1,backgroundColor:'grey',marginRight:15,marginLeft:15,borderWidth:1,borderColor:'grey'}}></View>
<View style={styles.content}> <View style={styles.content}>
<Text style={{ margin: 20, textAlign: 'justify' }}> <Text style={{ fontSize:15, fontFamily:'Gotham-Light',textAlign:'center',marginTop:10 }}>
{desc} {desc}
</Text> </Text>
</View> </View>
...@@ -35,10 +34,6 @@ const styles = StyleSheet.create({ ...@@ -35,10 +34,6 @@ const styles = StyleSheet.create({
flex: 1, flex: 1,
backgroundColor: 'white', backgroundColor: 'white',
}, },
header: {
flex: 0.5,
},
images: { images: {
margin: 10, margin: 10,
flex: 2, flex: 2,
......
...@@ -39,8 +39,10 @@ class MenuSelection extends React.Component { ...@@ -39,8 +39,10 @@ class MenuSelection extends React.Component {
}) })
this._getPermissions() this._getPermissions()
} }
// console.log("INI OUTLET : "+ this.props.outlet_id)
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true
})
if (this.props.outlet_id != '') { if (this.props.outlet_id != '') {
this.getMenuList() this.getMenuList()
} else { } else {
...@@ -48,6 +50,7 @@ class MenuSelection extends React.Component { ...@@ -48,6 +50,7 @@ class MenuSelection extends React.Component {
indicator: true indicator: true
}) })
this._getPermissions() this._getPermissions()
} }
}); });
} }
...@@ -176,10 +179,9 @@ class MenuSelection extends React.Component { ...@@ -176,10 +179,9 @@ class MenuSelection extends React.Component {
} }
renderTabBar = ({ item }) => { renderTabBar = ({ item }) => {
return ( return (
<View style={{ margin: 10 }}> <View style={{ flex: 1, height: 270 }}>
<TouchableOpacity> <TouchableOpacity>
<Image style={{ height: 50, width: 50, borderRadius: 25 }} source={{ uri: item.image }} /> <Image style={{ height: 70, width: 70,top:5}} source={{ uri: item.image }} />
<Text>{item.name}</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
) )
...@@ -245,9 +247,9 @@ class MenuSelection extends React.Component { ...@@ -245,9 +247,9 @@ class MenuSelection extends React.Component {
} }
} }
onChange(params){ onChange(params) {
console.log(params); console.log(params);
} }
handleMin(item, index) { handleMin(item, index) {
...@@ -278,8 +280,7 @@ class MenuSelection extends React.Component { ...@@ -278,8 +280,7 @@ class MenuSelection extends React.Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<StatusBar hidden={true} /> <StatusBar hidden={true} />
<View style={{ flex: 0.7, height: 90, flexDirection: 'row', borderWidth: 1, }}> <View style={{ flex:0.5, height: 50, flexDirection: 'row' }}>
<FlatList horizontal={true} style={{ flexDirection: 'row' }} <FlatList horizontal={true} style={{ flexDirection: 'row' }}
showsHorizontalScrollIndicator={false} showsHorizontalScrollIndicator={false}
data={this.state.listCategory} data={this.state.listCategory}
...@@ -287,12 +288,12 @@ class MenuSelection extends React.Component { ...@@ -287,12 +288,12 @@ class MenuSelection extends React.Component {
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id}
/> />
</View> </View>
<View style={{height:1,backgroundColor:'grey',marginRight:10,marginLeft:10,marginTop:5}}></View>
<View style={{ flex: 3 }}> <View style={{ flex: 3 }}>
{this.state.indicator == true ? ( {this.state.indicator == true ? (
<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" /> <ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />
) : ( ) : (
<FlatList <FlatList
data={this.props.menu_item} data={this.props.menu_item}
renderItem={({ item, index }) => ( renderItem={({ item, index }) => (
<Item navigation={this.props.navigation} <Item navigation={this.props.navigation}
...@@ -305,24 +306,25 @@ class MenuSelection extends React.Component { ...@@ -305,24 +306,25 @@ class MenuSelection extends React.Component {
/> />
)} )}
</View> </View>
<View style={styles.shadow}> <View>
{
this.state.indicator == true ? (<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />) : (
<View style={{ flexDirection: 'row', }}> </View>
<Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text> <View style={styles.shadow}>
{this.props.type_pickup == true ? (null) : ( <Text style={{ fontSize: 12, margin: 10, fontFamily: 'Gotham-Black' }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
<Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text> <Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text>
)} )} </Text>
<View style={{ flex: 1, flexDirection: 'row' }}>
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text> <View style={{ flex: 1 }}>
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10, fontFamily: 'Gotham-Light' }}> Rp. {this.props.order_total}</Text>
</View>
<View style={{ flex: 1,height:100,marginBottom:30}}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Shopping Cart')}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368',marginRight:20,flexDirection:'row',marginBottom:30}}>
<Image source={(require('../assets/icon/icon-order.png'))} style={{height:50,width:40,tintColor:'white',}}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15,alignSelf:'center', textAlign: 'center' }}>View Cart</Text>
</View>
</TouchableOpacity>
</View> </View>
)
}
<View>
<Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button>
</View> </View>
<View> <View>
</View> </View>
...@@ -348,8 +350,8 @@ const styles = StyleSheet.create({ ...@@ -348,8 +350,8 @@ const styles = StyleSheet.create({
shadowRadius: 5, shadowRadius: 5,
elevation: 1, elevation: 1,
marginTop: 10, marginTop: 10,
flex: 0.8, flex: 0.5,
height: 80, height: 50,
} }
}) })
...@@ -400,4 +402,22 @@ const mapDispatchToProps = (dispacth) => { ...@@ -400,4 +402,22 @@ const mapDispatchToProps = (dispacth) => {
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection) export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection)
{/* <Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button> */ }
// {
// this.state.indicator == true ? (<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />) : (
// <View style={{ flexDirection: 'row', }}>
// <Text style={{ fontSize: 12, margin: 10, fontFamily:'Gotham-Black' }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
// <Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text>
// )} </Text>
// <Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
// </View>
// )
// }
\ No newline at end of file
...@@ -101,6 +101,7 @@ class PickupName extends React.Component { ...@@ -101,6 +101,7 @@ class PickupName extends React.Component {
Axios.post("https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_list", params).then(res => { Axios.post("https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_list", params).then(res => {
let dataOutlets = res.data.outlets; let dataOutlets = res.data.outlets;
console.log("INI ADALAH DATA OUTLETS : "+ JSON.stringify(dataOutlets))
for (let i = 0; i < dataOutlets.length; i++) { for (let i = 0; i < dataOutlets.length; i++) {
dataOutlets[i]['distance'] = this.distance(dataOutlets[i]['lat'], dataOutlets[i]['long']); dataOutlets[i]['distance'] = this.distance(dataOutlets[i]['lat'], dataOutlets[i]['long']);
let address = dataOutlets[i]['address']; let address = dataOutlets[i]['address'];
...@@ -200,21 +201,21 @@ class PickupName extends React.Component { ...@@ -200,21 +201,21 @@ class PickupName extends React.Component {
<View> <View>
<TouchableOpacity onPress={() => this.getOutletDetail(item.id, item.name)}> <TouchableOpacity onPress={() => this.getOutletDetail(item.id, item.name)}>
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View> <View>
<MaterialCommunityIcons name="map-marker" size={32} color="brown" /> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View> </View>
<View style={styles.list_addrees}> <View style={styles.list_addrees}>
<View style={{ margin: 5 }}> <View style={{ margin: 5 }}>
<Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20 }}>{item.name}</Text>
<Text style={{ fontWeight: 'bold', fontSize: 15, color: '#ccb46c' }}>OPEN - </Text> <View style={{flexDirection:'row'}}>
{item.can_accept_order == true ? (<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c",top:5}}>OPEN </Text>)
:(<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c"}}>CLOSED </Text>) }
</View>
</View> </View>
<Text style={{ margin: 5, color: '#b1b1b2' }}> <Text style={{ fontFamily: 'Gotham-Light', color: '#CFB368'}}> Opening Hours : {item.open_time} - {item.close_time}</Text>
<Text style={{ margin: 5, color: '#b1b1b2',fontFamily: 'Gotham-Light' }}>
{item.full_address} {item.full_address}
</Text> </Text>
<Text style={{ margin: 5, color: '#aeaead' }}>
{item.distance} KM
</Text>
</View> </View>
<View> <View>
<CheckBox <CheckBox
...@@ -222,8 +223,10 @@ class PickupName extends React.Component { ...@@ -222,8 +223,10 @@ class PickupName extends React.Component {
checkedIcon='dot-circle-o' checkedIcon='dot-circle-o'
uncheckedIcon='circle-o' uncheckedIcon='circle-o'
checked={this.state.checked} checked={this.state.checked}
checkedColor="#ccb46c"
uncheckedColor="#ccb46c"
/> />
<Text style={{textAlign:'center',color:'#ccb46c',fontFamily:'Gotham-Light' }}>{item.distance} KM</Text>
</View> </View>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
...@@ -242,7 +245,7 @@ class PickupName extends React.Component { ...@@ -242,7 +245,7 @@ class PickupName extends React.Component {
<View style={styles.searchbar}> <View style={styles.searchbar}>
<View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row' }}> <View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row' }}>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="brown" /> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View> </View>
<View style={{ flex: 6 }}> <View style={{ flex: 6 }}>
<TextInput style={{ height: 45 }} placeholder="Cari lokasi Pickup Store" <TextInput style={{ height: 45 }} placeholder="Cari lokasi Pickup Store"
...@@ -251,10 +254,9 @@ class PickupName extends React.Component { ...@@ -251,10 +254,9 @@ class PickupName extends React.Component {
value={this.state.search}></TextInput> value={this.state.search}></TextInput>
</View> </View>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 5 }}>
<Ionicons name="ios-search" size={32} color="brown" /> <Ionicons name="ios-search" size={32} color="#ccb46c" />
</View> </View>
</View> </View>
</View> </View>
<View style={styles.body}> <View style={styles.body}>
<FlatList <FlatList
......
...@@ -97,46 +97,53 @@ class RewardDetail extends React.Component { ...@@ -97,46 +97,53 @@ class RewardDetail extends React.Component {
<View style={styles.container}> <View style={styles.container}>
<ScrollView> <ScrollView>
<View style={styles.images}> <View style={styles.images}>
<Image style={{ height: 250 ,width:'100%' }} source={this.state.image ? { uri: this.state.image } : null} /> <Image style={{ height: 250, width: '100%' }} source={this.state.image ? { uri: this.state.image } : null} />
<View style={styles.voucher_code}> <View style={styles.voucher_code}>
<Text style={styles.text_voucher}>Voucher Code : </Text> <Text style={styles.text_voucher}>Voucher Code : </Text>
<Text style={styles.text_c_voucher}>{this.state.code}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 18, textAlign: 'center', marginBottom: 5, top: 15 }}>{this.state.code}</Text>
</View> </View>
<View style={styles.expire_time}> <View style={styles.expire_time}>
<Text style={styles.text_expire}>Expire Time : </Text> <Text style={styles.text_expire}>Expire Time : </Text>
<Text style={styles.text_c_expire}>{this.state.expire}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', marginBottom: 5, top: 7 }}>{this.state.expire}</Text>
</View> </View>
</View> </View>
<View style={styles.content}>
<View style={{ marginRight: 5, marginLeft: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>{this.state.title}</Text>
</View>
<View style={{ marginRight: 20, marginLeft: 20 }}>
<HTML html={this.state.content} />
</View>
</View>
<View style={styles.content}> <View style={styles.content}>
{this.state.cur_time >= this.state.exp_time ? (<Button {this.state.cur_time >= this.state.exp_time ? (
style={{ margin: 5 }} <View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
title="EXPIRED" <TouchableOpacity>
onPress={() => console.log('inin')} <View style={{ height: 50, borderRadius: 20, backgroundColor: 'red' }}>
buttonStyle={{ height: 50, backgroundColor: 'red' }} <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>EXPIRED</Text>
/>) </View>
</TouchableOpacity>
</View>
)
: this.state.used == 0 ? ( : this.state.used == 0 ? (
<Button <View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
style={{ margin: 5 }} <TouchableOpacity onPress={() => this.useVoucher()}>
title="USE VOUCHER" <View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368' }}>
onPress={() => this.useVoucher()} <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>USE VOUCHER</Text>
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }} </View>
/> </TouchableOpacity>
</View>
) : ( ) : (
<Button <TouchableOpacity onPress={() => this.useDVoucher()}>
style={{ margin: 5 }} <View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368' }}>
title="USED" <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>USED VOUCHER</Text>
onPress={() => this.useDVoucher()} </View>
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }} </TouchableOpacity>
/>
)} )}
</View> </View>
<View style={styles.content}>
<View style={{ margin: 10 }}>
<HTML html={this.state.content} />
</View>
</View>
</ScrollView> </ScrollView>
</View> </View>
) )
...@@ -155,32 +162,36 @@ const styles = StyleSheet.create({ ...@@ -155,32 +162,36 @@ const styles = StyleSheet.create({
}, },
voucher_code: { voucher_code: {
fontFamily: 'Gotham-Black',
height: 70, height: 70,
marginLeft: 20, marginLeft: 20,
marginRight: 20, marginRight: 20,
backgroundColor: '#01919c', backgroundColor: '#01919c',
flex: 1, flex: 1,
marginTop:-140 marginTop: -140
}, },
expire_time: { expire_time: {
fontFamily: 'Gotham-Black',
flex: 1, flex: 1,
marginLeft: 20, marginLeft: 20,
marginRight: 20, marginRight: 20,
height: 70, height: 70,
justifyContent:'center',
backgroundColor: 'black', backgroundColor: 'black',
}, },
text_voucher: { text_voucher: {
fontFamily: 'Gotham-Black',
fontSize: 14, fontSize: 14,
marginLeft: 10, marginLeft: 10,
top:5,
color: 'white' color: 'white'
}, },
text_c_voucher: { text_c_voucher: {
fontFamily: 'Gotham-Black',
textAlign: 'center', textAlign: 'center',
fontWeight: 'bold', fontWeight: 'bold',
fontSize: 30, fontSize: 30,
...@@ -189,6 +200,7 @@ const styles = StyleSheet.create({ ...@@ -189,6 +200,7 @@ const styles = StyleSheet.create({
}, },
text_expire: { text_expire: {
fontFamily: 'Gotham-Black',
fontSize: 15, fontSize: 15,
marginLeft: 10, marginLeft: 10,
top: 5, top: 5,
...@@ -196,16 +208,18 @@ const styles = StyleSheet.create({ ...@@ -196,16 +208,18 @@ const styles = StyleSheet.create({
}, },
text_c_expire: { text_c_expire: {
fontFamily: 'Gotham-Black',
textAlign: 'center', textAlign: 'center',
fontWeight: 'bold', fontWeight: 'bold',
fontSize: 30, fontSize: 30,
top: 5, top: 5,
color: 'white' color: 'white',
}, },
content: { content: {
flex: 1, flex: 1,
marginBottom: 20,
}, },
button: { button: {
flex: 1, flex: 1,
......
...@@ -99,7 +99,7 @@ class RewardSelect extends React.Component { ...@@ -99,7 +99,7 @@ class RewardSelect extends React.Component {
resizeMode='cover' resizeMode='cover'
style={{ height: 100, width: '100%' }} /> style={{ height: 100, width: '100%' }} />
</View> </View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View> <View>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</Text> <Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</Text>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.reward.subtitle}</Text> <Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.reward.subtitle}</Text>
......
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