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,19 +99,21 @@ class MenuConfirmation extends React.Component {
i18n.t('alertSuccessTitle'),
i18n.t('alertSuccessOrder'),
[
{ text: "OK", onPress: () => {
let data_order = res.data.data.id
this.setState({
spinner: false,
transId: data_order
})
let transIdProps = {
trans_id: data_order
{
text: "OK", onPress: () => {
let data_order = res.data.data.id
this.setState({
spinner: false,
transId: data_order
})
let transIdProps = {
trans_id: data_order
}
this.props.setTransId(transIdProps);
this.orderSuccess()
}
this.props.setTransId(transIdProps);
this.orderSuccess()
} }
}
],
{ cancelable: false }
......@@ -119,10 +121,10 @@ class MenuConfirmation extends React.Component {
}).catch(error => {
let response = error.response.data;
Alert.alert(
'',
'',
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,20 +174,22 @@ class MenuConfirmation extends React.Component {
i18n.t('alertSuccessTitle'),
i18n.t('alertSuccessOrder'),
[
{ text: "OK", onPress: () => {
let data_order = res.data.data.id
this.setState({
spinner: false,
transId: data_order
})
let transIdProps = {
trans_id: data_order
}
this.props.setTransId(transIdProps);
{
text: "OK", onPress: () => {
let data_order = res.data.data.id
this.setState({
spinner: false,
transId: data_order
})
let transIdProps = {
trans_id: data_order
}
this.props.setTransId(transIdProps);
this.orderSuccess()
} }
this.orderSuccess()
}
}
],
{ cancelable: false }
......@@ -193,10 +197,10 @@ class MenuConfirmation extends React.Component {
}).catch(error => {
let response = error.response.data;
Alert.alert(
'',
'',
response.msg,
[
{ text: "OK", onPress: () => this.setState({spinner: false}) }
{ text: "OK", onPress: () => this.setState({ spinner: false }) }
],
);
})
......@@ -226,37 +230,86 @@ 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> */}
<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" />
</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>
{
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" />
</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.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>
)
}
{
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>
) : (
<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>
......@@ -277,9 +330,9 @@ class MenuConfirmation extends React.Component {
</View> */}
<View style={{ flex: 0.4, alignItems: 'baseline', justifyContent: 'center', alignItems: 'flex-start', paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.name} </Text>
{
(item.note == undefined || item.note == "") ? (
(item.note == undefined || item.note == "") ? (
null
) : (
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light', color: '#838383' }}>{i18n.t('note')} : {item.note} </Text>
......@@ -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';
......@@ -115,7 +115,7 @@ class OrderDetail extends React.Component {
// console.log("PARAMETER : " + JSON.stringify(params))
Axios.post(this.props.BASE_URL + 'crm/v2/transaction/detail', params).then(res => {
let data = res.data
if (data.trans_status_display == 'On Queue') {
data.trans_status_display = 'Queueing'
} else
......@@ -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