Commit 24404605 authored by Trisno's avatar Trisno

tambah tombol lacak grab di transaction detail

parent dec30ddb
...@@ -235,5 +235,7 @@ ...@@ -235,5 +235,7 @@
"alertemailblank":"Email cannot be empty", "alertemailblank":"Email cannot be empty",
"waCallCenter":"Hello, I have a problem with trans no", "waCallCenter":"Hello, I have a problem with trans no",
"renewal_notEnoughBalance": "You don't have enough balance" "renewal_notEnoughBalance": "You don't have enough balance",
"track":"TRACK"
} }
\ No newline at end of file
...@@ -235,5 +235,7 @@ ...@@ -235,5 +235,7 @@
"alertemailblank":"Email tidak boleh kosong", "alertemailblank":"Email tidak boleh kosong",
"waCallCenter":"Halo, saya ada masalah dengan trans no", "waCallCenter":"Halo, saya ada masalah dengan trans no",
"renewal_notEnoughBalance": "Saldo anda tidak mencukupi." "renewal_notEnoughBalance": "Saldo anda tidak mencukupi.",
"track":"LACAK"
} }
\ No newline at end of file
...@@ -86,7 +86,7 @@ class OrderDetail extends React.Component { ...@@ -86,7 +86,7 @@ class OrderDetail extends React.Component {
handleOrderCancel() { handleOrderCancel() {
let params = Object.assign(requestParams,{ let params = Object.assign(requestParams, {
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,
reason: i18n.t('cancelByUser') reason: i18n.t('cancelByUser')
...@@ -107,14 +107,14 @@ class OrderDetail extends React.Component { ...@@ -107,14 +107,14 @@ class OrderDetail extends React.Component {
} }
getDetailTrans() { getDetailTrans() {
let params = Object.assign(requestParams,{ let params = Object.assign(requestParams, {
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
}) })
// console.log("PARAMETER : " + JSON.stringify(params)) // console.log("PARAMETER : " + JSON.stringify(params))
Axios.post(this.props.BASE_URL + 'crm/v2/transaction/detail', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/transaction/detail', params).then(res => {
let data = res.data let data = res.data
// console.log(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
...@@ -165,6 +165,16 @@ class OrderDetail extends React.Component { ...@@ -165,6 +165,16 @@ class OrderDetail extends React.Component {
}) })
} }
_grabTrackURL = () => {
Linking.canOpenURL(this.state.detail_trans.grab_track_url).then(supported => {
if (supported) {
Linking.openURL(this.state.detail_trans.grab_track_url);
} else {
console.log("Don't know how to open URI: " + this.state.detail_trans.grab_track_url);
}
});
}
onRefresh() { onRefresh() {
this.setState({ this.setState({
is_refreshing: true, is_refreshing: true,
...@@ -387,7 +397,7 @@ class OrderDetail extends React.Component { ...@@ -387,7 +397,7 @@ class OrderDetail extends React.Component {
<View> <View>
<TouchableOpacity onPress={() => { <TouchableOpacity onPress={() => {
Linking.openURL("whatsapp://send?phone="+this.state.detail_trans.grab_driver_phone+"&text=" ) Linking.openURL("whatsapp://send?phone=" + this.state.detail_trans.grab_driver_phone + "&text=")
}}> }}>
<Icon <Icon
name='whatsapp' name='whatsapp'
...@@ -534,7 +544,7 @@ class OrderDetail extends React.Component { ...@@ -534,7 +544,7 @@ class OrderDetail extends React.Component {
<NumberFormat decimalScale={0} value={this.state.detail_trans.point_reduce} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <NumberFormat decimalScale={0} value={this.state.detail_trans.point_reduce} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View> </View>
</View> </View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginHorizontal: 10, display:'none' }}> <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginHorizontal: 10, display: 'none' }}>
<View style={{ flex: 0.5, marginLeft: 20, marginVertical: 5 }}> <View style={{ flex: 0.5, marginLeft: 20, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pointUsed')}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pointUsed')}</Text>
</View> </View>
...@@ -584,7 +594,7 @@ class OrderDetail extends React.Component { ...@@ -584,7 +594,7 @@ class OrderDetail extends React.Component {
</View> </View>
) : ( ) : (
<View style={{ marginHorizontal: 10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}> <View style={{ marginHorizontal: 10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}>
<View style={{ flex: 0.7, marginLeft: 10, marginVertical: 5}}> <View style={{ flex: 0.7, marginLeft: 10, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('taxincluded')}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('taxincluded')}</Text>
</View> </View>
{/* <View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}> */} {/* <View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}> */}
...@@ -682,15 +692,37 @@ class OrderDetail extends React.Component { ...@@ -682,15 +692,37 @@ class OrderDetail extends React.Component {
)) : null )) : null
} }
{this.state.detail_trans.grab_track_url == '' ? (
null
) : (
<TouchableOpacity onPress={() => {
Linking.openURL(this.state.detail_trans.grab_track_url)
}}>
<View style={styles.button3}>
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
<View style={{ marginRight: 10 }}>
<Icon name='motorcycle' type='font-awesome' color='white' size={24} />
</View>
<View style={{}}>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>
{i18n.t('track')}
</Text>
</View>
</View>
</View>
</TouchableOpacity>
)}
<TouchableOpacity onPress={() => { <TouchableOpacity onPress={() => {
Linking.openURL("whatsapp://send?phone="+this.state.detail_trans.call_center_phone+"&text="+i18n.t('waCallCenter')+" "+this.state.numberId ) Linking.openURL("whatsapp://send?phone=" + this.state.detail_trans.call_center_phone + "&text=" + i18n.t('waCallCenter') + " " + this.state.numberId)
}}> }}>
<View style={styles.button3}> <View style={styles.button3}>
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}> <View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
<View style={{ marginRight: 10 }}> <View style={{ marginRight: 10 }}>
<Icon name='whatsapp' type='font-awesome' color='white' size={24} /> <Icon name='whatsapp' type='font-awesome' color='white' size={24} />
</View> </View>
<View style={{ }}> <View style={{}}>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}> <Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>
{i18n.t('help')} {i18n.t('help')}
</Text> </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