Commit b7ec065c authored by Trisno's avatar Trisno

tampilin reason apabila status cancel

parent 4fff1efc
...@@ -26,7 +26,9 @@ class OrderDetail extends React.Component { ...@@ -26,7 +26,9 @@ class OrderDetail extends React.Component {
modalVisible: false, modalVisible: false,
reason: '', reason: '',
is_reviewed: '', is_reviewed: '',
review_rating: 0 review_rating: 0,
cancelled_by_display: '',
cancelled_reason: ''
} }
...@@ -107,7 +109,7 @@ class OrderDetail extends React.Component { ...@@ -107,7 +109,7 @@ class OrderDetail extends React.Component {
// console.log("PARAMETER : " + JSON.stringify(params)) // console.log("PARAMETER : " + JSON.stringify(params))
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
console.log(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
...@@ -141,7 +143,9 @@ class OrderDetail extends React.Component { ...@@ -141,7 +143,9 @@ class OrderDetail extends React.Component {
is_reviewed: data.is_reviewed, is_reviewed: data.is_reviewed,
review_rating: data.review_rating, review_rating: data.review_rating,
trans_status: data.trans_status, 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 => { }).catch(error => {
...@@ -158,7 +162,7 @@ class OrderDetail extends React.Component { ...@@ -158,7 +162,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) // console.log(this.state.transaction_detail)
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Modal animationType="slide" <Modal animationType="slide"
...@@ -202,6 +206,32 @@ class OrderDetail extends React.Component { ...@@ -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: 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' }}>{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> <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> </View>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
...@@ -263,7 +293,7 @@ class OrderDetail extends React.Component { ...@@ -263,7 +293,7 @@ class OrderDetail extends React.Component {
item.item_note == '' ? ( item.item_note == '' ? (
null 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 { ...@@ -416,7 +446,7 @@ class OrderDetail extends React.Component {
<View style={{ marginVertical: 20 }} /> <View style={{ marginVertical: 20 }} />
</ScrollView> </ScrollView>
</View> </View >
) )
} }
} }
...@@ -428,11 +458,12 @@ const styles = StyleSheet.create({ ...@@ -428,11 +458,12 @@ const styles = StyleSheet.create({
}, },
header: { header: {
justifyContent: 'center', justifyContent: 'center',
flex: 0.1, flex: 0.12,
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: '#838383', borderColor: '#838383',
marginHorizontal: 10, marginHorizontal: 10,
padding: 10 padding: 10,
}, },
body: { 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