Commit fe11b661 authored by Trisno's avatar Trisno

apabila keterangan kosong tidak di tampilkan

parent 7f8bd94c
......@@ -118,7 +118,7 @@ class MenuConfirmation extends React.Component {
console.log(error.response)
if (error.response.status <= 500) {
let response = error.response.data;
Alert.alert('',response.msg);
Alert.alert('', response.msg);
} else {
let response = error.response.data;
Alert.alert('', response.msg);
......@@ -213,7 +213,7 @@ class MenuConfirmation extends React.Component {
render() {
// console.log(this.props.session_id)
// console.log(this.props.order_item)
let total = 0
return (
<ScrollView style={styles.container}>
......@@ -276,7 +276,13 @@ 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>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.note} </Text>
{
item.note == undefined ? (
null
) : (
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>Keterangan : {item.note} </Text>
)
}
</View>
<View style={{ flex: 0.3, alignItems: 'flex-end', justifyContent: 'center', paddingRight: 5 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color:'#838383' }}>{item.quantity * item.price} </Text> */}
......
......@@ -56,7 +56,7 @@ class OrderDetail extends React.Component {
})
}
handleBack(){
handleBack() {
this.setState({
modalVisible: false
})
......@@ -64,8 +64,8 @@ class OrderDetail extends React.Component {
handleOrderCancel() {
if (this.state.reason == '') {
Alert.alert('', 'Reason must be filled !' )
}else{
Alert.alert('', 'Reason must be filled !')
} else {
let params = {
session_id: this.props.session_id,
transaction_id: this.props.route.params.idTrans,
......@@ -78,7 +78,7 @@ class OrderDetail extends React.Component {
this.props.navigation.navigate('Home', { screen: 'ORDER' });
}).catch(error => {
let response = error.response.data;
Alert.alert('',response.msg);
Alert.alert('', response.msg);
})
this.setState({
modalVisible: false
......@@ -96,22 +96,22 @@ class OrderDetail extends React.Component {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail', params).then(res => {
let data = res.data
if(data.trans_status_display == 'On Queue') {
if (data.trans_status_display == 'On Queue') {
data.trans_status_display = 'Queueing'
} else
if(data.trans_status_display == 'On Process') {
if (data.trans_status_display == 'On Process') {
data.trans_status_display = 'Processing'
} else
if(data.trans_status_display == 'Ready to Pickup') {
if (data.trans_status_display == 'Ready to Pickup') {
data.trans_status_display = 'Ready for Pickup'
} else
if(data.trans_status_display == 'On Delivery') {
if (data.trans_status_display == 'On Delivery') {
data.trans_status_display = 'Delivering'
} else
if(data.trans_status_display == 'On Completed') {
if (data.trans_status_display == 'On Completed') {
data.trans_status_display = 'Completed'
} else
if(data.trans_status_display == 'Cancelled') {
if (data.trans_status_display == 'Cancelled') {
data.trans_status_display = 'Cancelled'
}
......@@ -146,6 +146,7 @@ class OrderDetail extends React.Component {
render() {
// console.log(this.state.detail_trans)
// console.log(this.state.detail_trans.used_reward)
console.log(this.state.transaction_detail)
return (
<View style={styles.container}>
<Modal animationType="slide"
......@@ -169,13 +170,13 @@ class OrderDetail extends React.Component {
</View>
<View>
</View>
<View style={{margin:5,flexDirection:'row'}}>
<TouchableOpacity style={{ margin:5}} onPress={() => this.handleOrderCancel()}>
<View style={{ margin: 5, flexDirection: 'row' }}>
<TouchableOpacity style={{ margin: 5 }} onPress={() => this.handleOrderCancel()}>
<View style={styles.button2}>
<Text style={{ color: 'white', fontWeight: 'bold', fontSize: 16 }}>Cancel</Text>
</View>
</TouchableOpacity>
<TouchableOpacity style={{margin:5}} onPress={() => this.handleBack()}>
<TouchableOpacity style={{ margin: 5 }} onPress={() => this.handleBack()}>
<View style={styles.button2}>
<Text style={{ color: 'white', fontWeight: 'bold', fontSize: 16 }}>Back</Text>
</View>
......@@ -245,7 +246,15 @@ class OrderDetail 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: 'grey' }}>{item.item_name} </Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey',top:10 }}>Keterangan : {item.item_note} </Text>
{
item.item_note == '' ? (
null
) : (
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383'}}>Keterangan : {item.item_note} </Text>
)
}
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey', top: 10 }}>Keterangan : {item.item_note} </Text> */}
</View>
<View style={{ flex: 0.3, alignItems: 'flex-end', justifyContent: 'center', paddingRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.item_quantity * item.item_price} </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