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