Commit 0b4aad77 authored by Trisno's avatar Trisno

tampilkan nama outlet saat mode delivery

parent 9939621f
import { FontAwesome } from '@expo/vector-icons';
import { FontAwesome, FontAwesome5 } from '@expo/vector-icons';
import Axios from 'axios';
import i18n from 'i18n-js';
import React from 'react';
......@@ -72,7 +72,7 @@ class MenuConfirmation extends React.Component {
// console.log(params)
Axios.post(this.props.BASE_URL+'crm/v2/transaction/booking', params).then(res => {
Axios.post(this.props.BASE_URL + 'crm/v2/transaction/booking', params).then(res => {
// add API use voucher here
......@@ -99,7 +99,8 @@ class MenuConfirmation extends React.Component {
i18n.t('alertSuccessTitle'),
i18n.t('alertSuccessOrder'),
[
{ text: "OK", onPress: () => {
{
text: "OK", onPress: () => {
let data_order = res.data.data.id
this.setState({
......@@ -111,7 +112,8 @@ class MenuConfirmation extends React.Component {
}
this.props.setTransId(transIdProps);
this.orderSuccess()
} }
}
}
],
{ cancelable: false }
......@@ -122,7 +124,7 @@ class MenuConfirmation extends React.Component {
'',
response.msg,
[
{ text: "OK", onPress: () => this.setState({spinner: false}) }
{ text: "OK", onPress: () => this.setState({ spinner: false }) }
],
);
})
......@@ -147,7 +149,7 @@ class MenuConfirmation extends React.Component {
// console.log(params)
Axios.post(this.props.BASE_URL+'crm/v2/transaction/booking', params).then(res => {
Axios.post(this.props.BASE_URL + 'crm/v2/transaction/booking', params).then(res => {
// add API use voucher here
// let param = {
// session_id: this.props.session_id,
......@@ -172,7 +174,8 @@ class MenuConfirmation extends React.Component {
i18n.t('alertSuccessTitle'),
i18n.t('alertSuccessOrder'),
[
{ text: "OK", onPress: () => {
{
text: "OK", onPress: () => {
let data_order = res.data.data.id
this.setState({
......@@ -185,7 +188,8 @@ class MenuConfirmation extends React.Component {
this.props.setTransId(transIdProps);
this.orderSuccess()
} }
}
}
],
{ cancelable: false }
......@@ -196,7 +200,7 @@ class MenuConfirmation extends React.Component {
'',
response.msg,
[
{ text: "OK", onPress: () => this.setState({spinner: false}) }
{ text: "OK", onPress: () => this.setState({ spinner: false }) }
],
);
})
......@@ -226,6 +230,8 @@ class MenuConfirmation extends React.Component {
{/* <View style={{ margin: 10, padding: 20, borderBottomWidth: 1 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center' }}>{moment().utcOffset('+07:00').format('DD MMMM YYYY HH:mm:ss')}</Text>
</View> */}
{
this.props.type_pickup == true ? (
<View style={{ flex: 1, flexDirection: 'row', borderBottomWidth: 1, borderColor: '#838383', margin: 10, paddingBottom: 20, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center' }}>
<FontAwesome name="map-marker" size={24} color="red" />
......@@ -256,7 +262,54 @@ class MenuConfirmation extends React.Component {
)
}
</View>
) : (
<View>
<View style={{ flex: 1, flexDirection: 'row', margin: 10, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center' }}>
<FontAwesome name="map-marker" size={24} color="red" />
</View>
{
this.props.type_pickup == true ? (
<View style={{ flex: 0.7, justifyContent: 'center' }}>
<Text style={{ textAlign: 'left', fontSize: 14, fontFamily: 'Gotham-Black', color: '#838383' }}>{this.props.name_outlet}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{this.props.outlet_detailadress}</Text>
</View>
) : (
<View style={{ flex: 0.7, justifyContent: 'center' }}>
<Text style={{ textAlign: 'left', fontSize: 14, fontFamily: 'Gotham-Black', color: '#838383' }}>{this.props.home_address}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{this.props.address}</Text>
</View>
)
}
{
this.props.type_pickup == true ? (
<View style={{ flex: 0.2, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{i18n.t('pickup')}</Text>
</View>
) : (
<View style={{ flex: 0.2, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{i18n.t('delivery')}</Text>
</View>
)
}
</View>
<View style={{ flex: 1, flexDirection: 'row', borderBottomWidth: 1, borderColor: '#838383', marginHorizontal: 10, paddingBottom: 20, paddingHorizontal: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center' }}>
<FontAwesome5 name="store" size={18} color="#CFB368" />
</View>
<View style={{ flex: 0.7, justifyContent: 'center' }}>
<Text style={{ textAlign: 'left', fontSize: 14, fontFamily: 'Gotham-Black', color: '#838383' }}>{this.props.name_outlet}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{this.props.outlet_detailadress}</Text>
</View>
</View>
</View>
)
}
<View style={{ marginHorizontal: 10, paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{i18n.t('yourOrders')}</Text>
</View>
......@@ -330,7 +383,7 @@ class MenuConfirmation extends React.Component {
<NumberFormat decimalScale={0} value={this.props.route.params.balanceUsed} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginTop: -10, display:'none' }}>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginTop: -10, display: 'none' }}>
<View style={{ flex: 0.5, margin: 10, paddingLeft: 20 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{i18n.t('pointUsed')}</Text>
</View>
......@@ -559,7 +612,7 @@ const mapStateToProps = (state) => {
outlet_detailadress: state.outlet_detailadress,
lat: state.lat,
long: state.long,
BASE_URL : state.BASE_URL,
BASE_URL: state.BASE_URL,
}
}
......
import { FontAwesome } from '@expo/vector-icons';
import { FontAwesome, FontAwesome5 } from '@expo/vector-icons';
import Axios from 'axios';
import i18n from 'i18n-js';
import moment from 'moment';
......@@ -358,6 +358,16 @@ class OrderDetail extends React.Component {
)
}
</View>
<View style={{ flex: 1, flexDirection: 'row', borderColor: 'grey', marginHorizontal: 10, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center', alignItems: 'center' }}>
<FontAwesome5 name="store" size={18} color="#CFB368" />
</View>
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.outlet}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.outlet_address}</Text>
</View>
</View>
<View style={{ flex: 1, flexDirection: 'row', borderBottomWidth: 1, borderColor: 'grey', marginHorizontal: 10, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center' }}>
<Image source={require('../assets/grab-logo.png')} style={{ height: 32, width: 32, borderRadius: 5, }} />
......
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