Commit b7ec065c authored by Trisno's avatar Trisno

tampilin reason apabila status cancel

parent 4fff1efc
......@@ -26,7 +26,9 @@ class OrderDetail extends React.Component {
modalVisible: false,
reason: '',
is_reviewed: '',
review_rating: 0
review_rating: 0,
cancelled_by_display: '',
cancelled_reason: ''
}
......@@ -107,7 +109,7 @@ class OrderDetail extends React.Component {
// console.log("PARAMETER : " + JSON.stringify(params))
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail', params).then(res => {
let data = res.data
console.log(data)
if (data.trans_status_display == 'On Queue') {
data.trans_status_display = 'Queueing'
} else
......@@ -141,7 +143,9 @@ class OrderDetail extends React.Component {
is_reviewed: data.is_reviewed,
review_rating: data.review_rating,
trans_status: data.trans_status,
numberId: data.id.substring(0, 5).toUpperCase()
numberId: data.id.substring(0, 5).toUpperCase(),
cancelled_by_display: data.cancelled_by_display,
cancelled_reason: data.cancelled_reason
})
}).catch(error => {
......@@ -158,7 +162,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)
// console.log(this.state.transaction_detail)
return (
<View style={styles.container}>
<Modal animationType="slide"
......@@ -202,6 +206,32 @@ class OrderDetail extends React.Component {
<Text style={{ fontSize: 26, fontFamily: 'Gotham-Light', textAlign: 'center', color: 'grey' }}>#{this.state.numberId}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center', color: 'grey' }}>{moment(this.state.detail_trans.trans_time).format('DD MMMM YYYY HH:mm:ss')}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center', color: 'grey' }}>{this.state.detail_trans.trans_status_display}</Text>
{/* jaga jaga klo minta di tampilin cancel by siapa */}
{/* {
this.state.detail_trans.trans_status_display == 'Cancelled' ? (
this.state.cancelled_by_display == 'Outlet' ? (
<View style={{ flexDirection: 'row', justifyContent:'center' }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center', color: '#d34343' }}>{this.state.cancelled_by_display} </Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center', color: '#d34343' }}>{this.state.cancelled_reason}</Text>
</View>
) : (
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center', color: '#d34343' }}>{this.state.cancelled_reason}</Text>
)
) : (
null
)
} */}
{
this.state.detail_trans.trans_status_display == 'Cancelled' ? (
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center', color: '#d34343' }}>{this.state.cancelled_reason}</Text>
) : (
null
)
}
</View>
<ScrollView style={styles.body}>
......@@ -258,12 +288,12 @@ 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>
{
item.item_note == '' ? (
null
) : (
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light', color: '#838383'}}>Keterangan : {item.item_note} </Text>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light', color: '#838383' }}>Keterangan : {item.item_note} </Text>
)
}
......@@ -416,7 +446,7 @@ class OrderDetail extends React.Component {
<View style={{ marginVertical: 20 }} />
</ScrollView>
</View>
</View >
)
}
}
......@@ -428,11 +458,12 @@ const styles = StyleSheet.create({
},
header: {
justifyContent: 'center',
flex: 0.1,
flex: 0.12,
borderBottomWidth: 1,
borderColor: '#838383',
marginHorizontal: 10,
padding: 10
padding: 10,
},
body: {
......
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