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

add delivery address

parent 470fab22
{
"expo": {
"name": "Excelso_update 09.00 / 14.05.2020",
"name": "Excelso_update 16.30 / 14.05.2020",
"slug": "excelso-pro",
"privacy": "public",
"sdkVersion": "36.0.0",
......
This diff is collapsed.
......@@ -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": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz",
......
......@@ -66,6 +66,7 @@
"react-native-web": "~0.11.7",
"react-native-webview": "^7.4.3",
"react-navigation": "^4.2.2",
"react-number-format": "^4.4.1",
"react-redux": "^7.2.0",
"react-redux-i18n": "^1.9.3",
"redux": "^4.0.5",
......
......@@ -103,7 +103,6 @@ class Account extends React.Component {
}
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
let email = dataCard.email
let point = dataCard.kaspro_point
......@@ -181,10 +180,10 @@ class Account extends React.Component {
source={require('../assets/images/people-actv.png')}
/>
</View>
<View style={{ height: 60, flexDirection: 'row', justifyContent: 'center' }}>
<View style={{ height: 50, flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', margin: 15 }}>
{this.state.email} {this.props.set_card}
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 17, textAlign: 'center', margin: 15 }}>
{this.state.email}
</Text>
</TouchableOpacity>
<Icon
......@@ -244,14 +243,14 @@ class Account extends React.Component {
<View style={styles.Card}>
<Card style={{ padding: 10, margin: 20, alignContent: 'center' }}>
<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 style={{ fontFamily: 'Gotham-Black', textAlign: "center", fontSize: 40, color: '#c9af6d' }}>
{this.state.account_number}
</Text>
<View style={styles.line}></View>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold' }}> {'\n'}
BALANCE : {this.state.balance}{'\n'}
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold',fontSize:15 }}> {'\n'}
BALANCE : {this.state.balance}{'\n'}
</Text>
<View style={styles.line}></View>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold' }}>{'\n'}
......@@ -369,11 +368,20 @@ const styles = StyleSheet.create({
line: {
top:3,
borderRadius:1,
borderColor:'#c9af6d',
borderColor:'black',
borderWidth:1,
alignSelf: 'stretch',
width: "100%",
height: 3,
height: 1,
bottom: 5,
},
line1: {
top:3,
borderRadius:1,
borderColor:'black',
borderWidth:1,
width: "100%",
height: 1,
bottom: 5,
},
......
......@@ -257,7 +257,17 @@ class Auth extends React.Component {
<Stack.Screen name="Camera" component={Cameras} />
<Stack.Screen name="Delivery Address" component={DeliveryAddress} />
<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={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
......
......@@ -34,6 +34,7 @@ class DeliveryAddrees extends React.Component {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_address', params).then(res => {
const dataAlamat = res.data.data;
console.log("INI DATA :" + JSON.stringify(dataAlamat))
let address = []
for (let i = 0; i < dataAlamat.length; i++) {
const element = dataAlamat[i];
......@@ -96,7 +97,7 @@ class DeliveryAddrees extends React.Component {
}).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 {
}
this.props.setAddress(setDataAddress);
// this.getRate(id)
let params = {
session_id: this.props.session_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 => {
// this.setState({
// grabamount: res.data.data.amount,
// grabdestination: res.data.data.outlet_name,
// })
let setGrabProps = {
// grabdestination: this.state.grabdestination,
// grabamount: this.state.grabamount,
......@@ -142,29 +134,16 @@ class DeliveryAddrees extends React.Component {
}
this.props.setGrab(setGrabProps);
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)
// console.log(this.props)
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 {
this.props.navigation.navigate('Home', {
screen: 'MENU',
params: { user: 'janeT' },
});
});
}
......@@ -172,10 +151,10 @@ class DeliveryAddrees extends React.Component {
let response = error.response.data;
Alert.alert(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 {
renderItem = ({ item }) => {
return (
<View style={styles.list_addrees}>
<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>
<Text style={{ margin: 5 }}>
Patokan : {item.description}
</Text>
</TouchableOpacity>
</View>
<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>
<Text style={{ margin: 5 }}>
Patokan : {item.description}
</Text>
</TouchableOpacity>
</View>
);
}
render() {
......@@ -238,6 +218,7 @@ class DeliveryAddrees extends React.Component {
/>
</View>
</View>
)
}
}
......@@ -270,6 +251,7 @@ const styles = StyleSheet.create({
borderWidth: 1,
}
})
const mapStateToProps = (state) => {
......@@ -324,11 +306,47 @@ const mapDispatchToProps = (dispacth) => {
setTypePickup: (type) => dispacth({
type: ActionType.SET_TYPE,
data: {
type_pickup: type
type_pickup: type
}
}),
}),
}
}
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 { 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 ActionType from '../redux/globalActionType';
import NumberFormat from 'react-number-format';
class Item extends React.Component {
......@@ -15,9 +16,9 @@ class Item extends React.Component {
handleChangeQuantity = (item, qty) => {
if (qty == '') {
item.qty=0
item.qty = 0
} else {
const order_item = {
id: item.id,
code: item.code,
......@@ -40,28 +41,34 @@ class Item extends React.Component {
<View style={{ flex: 1, margin: 10 }} key={item.id} ref={this.props._scrollView}>
<ScrollView ref={view => this._scrollView = view}>
{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 >
<Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 5, top: 5 }}></Image>
<View style={{ flex: 1, flexDirection: 'row', height: 100 }}>
<View style={{ flex: 1, height: 100 }}>
<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 >
<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={{ 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 style={styles.shadowAdd}>
<TouchableOpacity onPress={() => this.props.handleMin()}>
<Text style={{ fontSize: 20, margin: 2 }}> - </Text>
<Text style={{ fontSize:25,alignSelf:'center' }}> - </Text>
</TouchableOpacity>
<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'}
onChangeText={(qty) => this.handleChangeQuantity(item, qty)}>{item.qty}</TextInput>
<TouchableOpacity onPress={() => this.props.handleAdd()}>
<Text style={{ fontSize: 20, margin: 2 }}> + </Text>
<TouchableOpacity style={{alignSelf:'center'}} onPress={() => this.props.handleAdd()}>
<Text style={{ fontSize: 25,alignSelf:'center' }}> + </Text>
</TouchableOpacity>
</View>
</View>
......@@ -77,7 +84,7 @@ class Item extends React.Component {
const styles = StyleSheet.create({
shadowEdit: {
height: 30,
width: 25,
width: 40,
borderWidth: 1,
borderRadius: 2,
borderColor: '#ddd',
......@@ -89,11 +96,11 @@ const styles = StyleSheet.create({
elevation: 1,
marginLeft: 5,
marginRight: 5,
marginTop: 10,
marginTop: 5,
},
shadowAdd: {
height: 30,
width: 75,
width: 90,
borderWidth: 1,
borderRadius: 2,
borderColor: '#ddd',
......@@ -105,7 +112,7 @@ const styles = StyleSheet.create({
elevation: 1,
marginLeft: 5,
marginRight: 5,
marginTop: 10,
marginTop: 5,
flexDirection: 'row'
},
shadowMin: {
......@@ -122,7 +129,7 @@ const styles = StyleSheet.create({
elevation: 1,
marginLeft: 5,
marginRight: 5,
marginTop: 10,
marginTop: 5,
}
})
......
......@@ -4,23 +4,22 @@ import Axios from 'axios';
export default function MenuDetail({ route, navigation }) {
const { desc } = route.params;
const { nama } = route.params;
const { Foto } = route.params;
const { nameMenu } = route.params;
const { image } = route.params;
return (
<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.images}> */}
<Image style={{ height: '50%', width: '100%' }}
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}>
<Text style={{ margin: 20, textAlign: 'justify' }}>
<Text style={{ fontSize:15, fontFamily:'Gotham-Light',textAlign:'center',marginTop:10 }}>
{desc}
</Text>
</View>
......@@ -35,10 +34,6 @@ const styles = StyleSheet.create({
flex: 1,
backgroundColor: 'white',
},
header: {
flex: 0.5,
},
images: {
margin: 10,
flex: 2,
......
......@@ -39,8 +39,10 @@ class MenuSelection extends React.Component {
})
this._getPermissions()
}
// console.log("INI OUTLET : "+ this.props.outlet_id)
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true
})
if (this.props.outlet_id != '') {
this.getMenuList()
} else {
......@@ -48,6 +50,7 @@ class MenuSelection extends React.Component {
indicator: true
})
this._getPermissions()
}
});
}
......@@ -176,10 +179,9 @@ class MenuSelection extends React.Component {
}
renderTabBar = ({ item }) => {
return (
<View style={{ margin: 10 }}>
<View style={{ flex: 1, height: 270 }}>
<TouchableOpacity>
<Image style={{ height: 50, width: 50, borderRadius: 25 }} source={{ uri: item.image }} />
<Text>{item.name}</Text>
<Image style={{ height: 70, width: 70,top:5}} source={{ uri: item.image }} />
</TouchableOpacity>
</View>
)
......@@ -245,9 +247,9 @@ class MenuSelection extends React.Component {
}
}
onChange(params){
onChange(params) {
console.log(params);
}
}
handleMin(item, index) {
......@@ -278,8 +280,7 @@ class MenuSelection extends React.Component {
return (
<View style={styles.container}>
<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' }}
showsHorizontalScrollIndicator={false}
data={this.state.listCategory}
......@@ -287,12 +288,12 @@ class MenuSelection extends React.Component {
keyExtractor={(item) => item.id}
/>
</View>
<View style={{height:1,backgroundColor:'grey',marginRight:10,marginLeft:10,marginTop:5}}></View>
<View style={{ flex: 3 }}>
{this.state.indicator == true ? (
<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />
) : (
<FlatList
data={this.props.menu_item}
renderItem={({ item, index }) => (
<Item navigation={this.props.navigation}
......@@ -305,24 +306,25 @@ class MenuSelection extends React.Component {
/>
)}
</View>
<View style={styles.shadow}>
{
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>
<Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button>
</View>
<View style={styles.shadow}>
<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>
<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>
......@@ -348,8 +350,8 @@ const styles = StyleSheet.create({
shadowRadius: 5,
elevation: 1,
marginTop: 10,
flex: 0.8,
height: 80,
flex: 0.5,
height: 50,
}
})
......@@ -396,8 +398,26 @@ const mapDispatchToProps = (dispacth) => {
name_outlet: OutletChange.name_outlet,
}
}),
}
}
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 {
<View style={styles.container}>
<ScrollView>
<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}>
<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 style={styles.expire_time}>
<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 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}>
{this.state.cur_time >= this.state.exp_time ? (<Button
style={{ margin: 5 }}
title="EXPIRED"
onPress={() => console.log('inin')}
buttonStyle={{ height: 50, backgroundColor: 'red' }}
/>)
{this.state.cur_time >= this.state.exp_time ? (
<View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
<TouchableOpacity>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'red' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>EXPIRED</Text>
</View>
</TouchableOpacity>
</View>
)
: this.state.used == 0 ? (
<Button
style={{ margin: 5 }}
title="USE VOUCHER"
onPress={() => this.useVoucher()}
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }}
/>
<View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.useVoucher()}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>USE VOUCHER</Text>
</View>
</TouchableOpacity>
</View>
) : (
<Button
style={{ margin: 5 }}
title="USED"
onPress={() => this.useDVoucher()}
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }}
/>
<TouchableOpacity onPress={() => this.useDVoucher()}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>USED VOUCHER</Text>
</View>
</TouchableOpacity>
)}
</View>
<View style={styles.content}>
<View style={{ margin: 10 }}>
<HTML html={this.state.content} />
</View>
</View>
</ScrollView>
</View>
)
......@@ -155,18 +162,18 @@ const styles = StyleSheet.create({
},
voucher_code: {
fontFamily: 'Gotham-Black',
height: 70,
marginLeft: 20,
marginRight: 20,
backgroundColor: '#01919c',
flex: 1,
marginTop:-140
marginTop: -140
},
expire_time: {
fontFamily: 'Gotham-Black',
flex: 1,
marginLeft: 20,
marginRight: 20,
......@@ -175,12 +182,14 @@ const styles = StyleSheet.create({
},
text_voucher: {
fontFamily: 'Gotham-Black',
fontSize: 14,
marginLeft: 10,
color: 'white'
},
text_c_voucher: {
fontFamily: 'Gotham-Black',
textAlign: 'center',
fontWeight: 'bold',
fontSize: 30,
......@@ -189,6 +198,7 @@ const styles = StyleSheet.create({
},
text_expire: {
fontFamily: 'Gotham-Black',
fontSize: 15,
marginLeft: 10,
top: 5,
......@@ -196,16 +206,18 @@ const styles = StyleSheet.create({
},
text_c_expire: {
fontFamily: 'Gotham-Black',
textAlign: 'center',
fontWeight: 'bold',
fontSize: 30,
top: 5,
color: 'white'
color: 'white',
},
content: {
flex: 1,
marginBottom: 20,
},
button: {
flex: 1,
......
......@@ -37,7 +37,7 @@ class RewardSelect extends React.Component {
// this.props.navigation.navigate('Home', { screen: 'MENU' })
// }
handleSelect(item) {
let params = {
session_id: this.props.session_id,
......@@ -51,7 +51,7 @@ class RewardSelect extends React.Component {
voucher: detail
}
// console.log(voucherProps)
this.props.setVoucher(voucherProps);
// this.props.navigation.navigate('Home', { screen: 'MENU' })
// console.log(this.props.voucher)
......@@ -84,9 +84,9 @@ class RewardSelect extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={{ color: 'white', textAlign: 'center', fontSize: 28 }}>REWARDS E-VOUCHER</Text>
</View>
{/* <View style={styles.header}> */}
{/* <Text style={{ color: 'white', textAlign: 'center', fontSize: 28 }}>REWARDS E-VOUCHER</Text> */}
{/* </View> */}
<ScrollView style={styles.body}>
{
this.state.rewardsList.map((item, key) => (
......@@ -97,16 +97,16 @@ class RewardSelect extends React.Component {
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 150, width: '100%' }} />
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View>
<Text style={{fontWeight:'bold', textAlign:'left'}}>{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.title}</Text>
<Text style={{ color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center' }}>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{textAlign:'right'}}>Expired</Text>
<Text style={{textAlign:'right'}}>{item.expire_time}</Text>
<Text style={{ color: '#CFB368', textAlign: 'right', fontFamily: 'Gotham-Black', fontSize: 12 }}>Expired</Text>
<Text style={{ color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 12, textAlign: 'center' }}>{item.expire_time}</Text>
</View>
</View>
</Card>
......@@ -114,9 +114,9 @@ class RewardSelect extends React.Component {
</TouchableOpacity>
))
}
<TouchableOpacity>
{/* <TouchableOpacity>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity>
</TouchableOpacity> */}
</ScrollView>
</View>
)
......
......@@ -63,16 +63,16 @@ class RewardsList extends React.Component {
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 150, width: '100%' }} />
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}>
<View>
<Text style={{fontWeight:'bold', textAlign:'left'}}>{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.title}</Text>
<Text style={{ color:'#CFB368',fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center'}}>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{textAlign:'right'}}>Expired</Text>
<Text style={{textAlign:'right'}}>{item.expire_time}</Text>
<Text style={{color:'#CFB368', textAlign:'right',fontFamily: 'Gotham-Black', fontSize: 12}}>Expired</Text>
<Text style={{ color:'#CFB368',fontFamily: 'Gotham-Black', fontSize: 12, textAlign: 'center'}}>{item.expire_time}</Text>
</View>
</View>
</Card>
......@@ -80,8 +80,8 @@ class RewardsList extends React.Component {
</TouchableOpacity>
))
}
<TouchableOpacity onPress={()=> this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text>
<TouchableOpacity style={{margin:20}} onPress={()=> this.props.navigation.navigate('Reward History')}>
<Text style={{ color:'#CFB368', fontFamily: 'Gotham-Black', fontSize: 15, textAlign: 'center'}}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity>
</ScrollView>
</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