Commit 7ebf6ad8 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

add delivery address

parent 470fab22
{ {
"expo": { "expo": {
"name": "Excelso_update 09.00 / 14.05.2020", "name": "Excelso_update 16.30 / 14.05.2020",
"slug": "excelso-pro", "slug": "excelso-pro",
"privacy": "public", "privacy": "public",
"sdkVersion": "36.0.0", "sdkVersion": "36.0.0",
......
This diff is collapsed.
...@@ -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",
......
...@@ -103,7 +103,6 @@ class Account extends React.Component { ...@@ -103,7 +103,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
...@@ -181,10 +180,10 @@ class Account extends React.Component { ...@@ -181,10 +180,10 @@ 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' }}> <View style={{ height: 50, flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', margin: 15 }}> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 17, textAlign: 'center', margin: 15 }}>
{this.state.email} {this.props.set_card} {this.state.email}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
<Icon <Icon
...@@ -244,14 +243,14 @@ class Account extends React.Component { ...@@ -244,14 +243,14 @@ 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', fontWeight: 'bold',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', fontWeight: 'bold' }}>{'\n'}
...@@ -369,11 +368,20 @@ const styles = StyleSheet.create({ ...@@ -369,11 +368,20 @@ const styles = StyleSheet.create({
line: { line: {
top:3, top:3,
borderRadius:1, borderRadius:1,
borderColor:'#c9af6d', borderColor:'black',
borderWidth:1, borderWidth:1,
alignSelf: 'stretch',
width: "100%", width: "100%",
height: 3, height: 1,
bottom: 5,
},
line1: {
top:3,
borderRadius:1,
borderColor:'black',
borderWidth:1,
width: "100%",
height: 1,
bottom: 5, bottom: 5,
}, },
......
...@@ -257,7 +257,17 @@ class Auth extends React.Component { ...@@ -257,7 +257,17 @@ class Auth extends React.Component {
<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} />
<Stack.Screen name="Address Detail" component={AddressDetail} /> <Stack.Screen name="Address Detail" component={AddressDetail} />
<Stack.Screen name="Menu Detail" component={MenuDetail} /> <Stack.Screen name="Menu Detail" component={MenuDetail} options={({route})=>({title:route.params.nameMenu,
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}}) } />
<Stack.Screen name="Pickup Name" component={PickupName} options={{ <Stack.Screen name="Pickup Name" component={PickupName} options={{
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' }, headerTitleContainerStyle: { alignContent: 'center' },
......
...@@ -34,6 +34,7 @@ class DeliveryAddrees extends React.Component { ...@@ -34,6 +34,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];
...@@ -96,7 +97,7 @@ class DeliveryAddrees extends React.Component { ...@@ -96,7 +97,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)
}) })
} }
...@@ -113,22 +114,13 @@ class DeliveryAddrees extends React.Component { ...@@ -113,22 +114,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,29 +134,16 @@ class DeliveryAddrees extends React.Component { ...@@ -142,29 +134,16 @@ 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',
params: { user: 'janeT' }, params: { user: 'janeT' },
}); });
} }
...@@ -172,10 +151,10 @@ class DeliveryAddrees extends React.Component { ...@@ -172,10 +151,10 @@ 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)
}) })
...@@ -203,18 +182,19 @@ class DeliveryAddrees extends React.Component { ...@@ -203,18 +182,19 @@ class DeliveryAddrees extends React.Component {
renderItem = ({ item }) => { renderItem = ({ item }) => {
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={{ margin: 5, }}>
<Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text> <Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text>
</View> </View>
<Text style={{ margin: 5 }}> <Text style={{ margin: 5 }}>
{item.address} {item.address}
</Text> </Text>
<Text style={{ margin: 5 }}> <Text style={{ margin: 5 }}>
Patokan : {item.description} Patokan : {item.description}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
); );
} }
render() { render() {
...@@ -238,6 +218,7 @@ class DeliveryAddrees extends React.Component { ...@@ -238,6 +218,7 @@ class DeliveryAddrees extends React.Component {
/> />
</View> </View>
</View> </View>
) )
} }
} }
...@@ -270,6 +251,7 @@ const styles = StyleSheet.create({ ...@@ -270,6 +251,7 @@ const styles = StyleSheet.create({
borderWidth: 1, borderWidth: 1,
} }
}) })
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
...@@ -324,11 +306,47 @@ const mapDispatchToProps = (dispacth) => { ...@@ -324,11 +306,47 @@ const mapDispatchToProps = (dispacth) => {
setTypePickup: (type) => dispacth({ setTypePickup: (type) => dispacth({
type: ActionType.SET_TYPE, type: ActionType.SET_TYPE,
data: { data: {
type_pickup: type type_pickup: type
} }
}), }),
} }
} }
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>
\ 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,9 +16,9 @@ class Item extends React.Component { ...@@ -15,9 +16,9 @@ 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 = {
id: item.id, id: item.id,
code: item.code, code: item.code,
...@@ -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>
<View > <View style={{ flex: 2, height: 150 }}>
<Text style={{ fontSize: 20, margin: 5, marginRight: 10, fontWeight: 'bold' }}>{item.name}</Text> <View style={{ marginLeft: 5, marginRight: 5 }}>
<Text style={{ fontSize: 15, margin: 5, marginRight: 10 }}>Rp. {item.price}</Text> <Text style={{ fontSize: 15, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black' }}>{item.name}</Text>
<View style={{ flexDirection: 'row', flex: 1 }}> <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 style={styles.shadowEdit}></View> </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 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', }}>
<Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text>
{this.props.type_pickup == true ? (null) : (
<Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text>
)}
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
</View>
) </View>
} <View style={styles.shadow}>
<View> <Text style={{ fontSize: 12, margin: 10, fontFamily: 'Gotham-Black' }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
<Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button> <Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text>
)} </Text>
<View style={{ flex: 1, flexDirection: 'row' }}>
<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',marginLeft:10,top:2}}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15,alignSelf:'center', textAlign: 'center' }}>View Cart</Text>
</View>
</TouchableOpacity>
</View>
</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,
} }
}) })
...@@ -396,8 +398,26 @@ const mapDispatchToProps = (dispacth) => { ...@@ -396,8 +398,26 @@ const mapDispatchToProps = (dispacth) => {
name_outlet: OutletChange.name_outlet, name_outlet: OutletChange.name_outlet,
} }
}), }),
} }
} }
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
...@@ -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: 29, textAlign: 'center', marginBottom: 5, top: 5 }}>{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: 29, 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,18 +162,18 @@ const styles = StyleSheet.create({ ...@@ -155,18 +162,18 @@ 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,
...@@ -175,12 +182,14 @@ const styles = StyleSheet.create({ ...@@ -175,12 +182,14 @@ const styles = StyleSheet.create({
}, },
text_voucher: { text_voucher: {
fontFamily: 'Gotham-Black',
fontSize: 14, fontSize: 14,
marginLeft: 10, marginLeft: 10,
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 +198,7 @@ const styles = StyleSheet.create({ ...@@ -189,6 +198,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 +206,18 @@ const styles = StyleSheet.create({ ...@@ -196,16 +206,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,
......
...@@ -37,7 +37,7 @@ class RewardSelect extends React.Component { ...@@ -37,7 +37,7 @@ class RewardSelect extends React.Component {
// this.props.navigation.navigate('Home', { screen: 'MENU' }) // this.props.navigation.navigate('Home', { screen: 'MENU' })
// } // }
handleSelect(item) { handleSelect(item) {
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
...@@ -51,7 +51,7 @@ class RewardSelect extends React.Component { ...@@ -51,7 +51,7 @@ class RewardSelect extends React.Component {
voucher: detail voucher: detail
} }
// console.log(voucherProps) // console.log(voucherProps)
this.props.setVoucher(voucherProps); this.props.setVoucher(voucherProps);
// this.props.navigation.navigate('Home', { screen: 'MENU' }) // this.props.navigation.navigate('Home', { screen: 'MENU' })
// console.log(this.props.voucher) // console.log(this.props.voucher)
...@@ -84,9 +84,9 @@ class RewardSelect extends React.Component { ...@@ -84,9 +84,9 @@ class RewardSelect extends React.Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> {/* <View style={styles.header}> */}
<Text style={{ color: 'white', textAlign: 'center', fontSize: 28 }}>REWARDS E-VOUCHER</Text> {/* <Text style={{ color: 'white', textAlign: 'center', fontSize: 28 }}>REWARDS E-VOUCHER</Text> */}
</View> {/* </View> */}
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {
this.state.rewardsList.map((item, key) => ( this.state.rewardsList.map((item, key) => (
...@@ -97,16 +97,16 @@ class RewardSelect extends React.Component { ...@@ -97,16 +97,16 @@ class RewardSelect extends React.Component {
<Image source={{ uri: item.reward.title_image }} <Image source={{ uri: item.reward.title_image }}
resizeMethod="resize" resizeMethod="resize"
resizeMode='cover' resizeMode='cover'
style={{ height: 150, 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={{fontWeight:'bold', textAlign:'left'}}>{item.reward.title}</Text> <Text style={{ color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center' }}>{item.reward.title}</Text>
<Text style={{textAlign:'left'}}>{item.reward.subtitle}</Text> <Text style={{ color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center' }}>{item.reward.subtitle}</Text>
</View> </View>
<View> <View>
<Text style={{textAlign:'right'}}>Expired</Text> <Text style={{ color: '#CFB368', textAlign: 'right', fontFamily: 'Gotham-Black', fontSize: 12 }}>Expired</Text>
<Text style={{textAlign:'right'}}>{item.expire_time}</Text> <Text style={{ color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 12, textAlign: 'center' }}>{item.expire_time}</Text>
</View> </View>
</View> </View>
</Card> </Card>
...@@ -114,9 +114,9 @@ class RewardSelect extends React.Component { ...@@ -114,9 +114,9 @@ class RewardSelect extends React.Component {
</TouchableOpacity> </TouchableOpacity>
)) ))
} }
<TouchableOpacity> {/* <TouchableOpacity>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text> <Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity> </TouchableOpacity> */}
</ScrollView> </ScrollView>
</View> </View>
) )
......
...@@ -63,16 +63,16 @@ class RewardsList extends React.Component { ...@@ -63,16 +63,16 @@ class RewardsList extends React.Component {
<Image source={{ uri: item.reward.title_image }} <Image source={{ uri: item.reward.title_image }}
resizeMethod="resize" resizeMethod="resize"
resizeMode='cover' resizeMode='cover'
style={{ height: 150, 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={{fontWeight:'bold', textAlign:'left'}}>{item.reward.title}</Text> <Text style={{ color:'#CFB368',fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center'}}>{item.reward.title}</Text>
<Text style={{textAlign:'left'}}>{item.reward.subtitle}</Text> <Text style={{ color:'#CFB368',fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center'}}>{item.reward.subtitle}</Text>
</View> </View>
<View> <View>
<Text style={{textAlign:'right'}}>Expired</Text> <Text style={{color:'#CFB368', textAlign:'right',fontFamily: 'Gotham-Black', fontSize: 12}}>Expired</Text>
<Text style={{textAlign:'right'}}>{item.expire_time}</Text> <Text style={{ color:'#CFB368',fontFamily: 'Gotham-Black', fontSize: 12, textAlign: 'center'}}>{item.expire_time}</Text>
</View> </View>
</View> </View>
</Card> </Card>
...@@ -80,8 +80,8 @@ class RewardsList extends React.Component { ...@@ -80,8 +80,8 @@ class RewardsList extends React.Component {
</TouchableOpacity> </TouchableOpacity>
)) ))
} }
<TouchableOpacity onPress={()=> this.props.navigation.navigate('Reward History')}> <TouchableOpacity style={{margin:20}} onPress={()=> this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text> <Text style={{ color:'#CFB368', fontFamily: 'Gotham-Black', fontSize: 15, textAlign: 'center'}}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity> </TouchableOpacity>
</ScrollView> </ScrollView>
</View> </View>
......
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