Commit 62271999 authored by Trisno's avatar Trisno

translate order

parent 179e48f2
......@@ -121,7 +121,13 @@
"paymentDetails":"PAYMENT DETAILS",
"note":"Note",
"headerConfirmOrder":"CONFIRM YOUR ORDER",
"orderProcess":"ORDER PROCESS"
"orderProcess":"ORDER PROCESS",
"seeOrderDetail":"See Order Detail",
"lookingForDriver":"Looking For Driver",
"help":"HELP",
"youRated":"You Rated",
"rateOrder":"Rate Order"
}
\ No newline at end of file
......@@ -121,7 +121,12 @@
"yourBalanceUsed": "Saldo Kamu Digunakan",
"yourPointsUsed": "Poin Kamu Digunakan",
"paymentDetails": "DETAIL PEMBAYARAN",
"note":"Keterangan",
"headerConfirmOrder":"CONFIRM YOUR ORDER@",
"orderProcess":"PROSES PESANAN"
"note": "Keterangan",
"headerConfirmOrder": "CONFIRM YOUR ORDER@",
"orderProcess": "PROSES PESANAN",
"seeOrderDetail": "Lihat Detail Pemesanan",
"lookingForDriver": "Mencari Driver",
"help": "BANTUAN",
"youRated": "You Rated@",
"rateOrder": "Rate Order@"
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import NumberFormat from 'react-number-format';
import { FontAwesome } from '@expo/vector-icons';
import { Icon } from 'react-native-elements'
import MyStatusBar from './MyStatusBar';
import i18n from 'i18n-js';
class OrderDetail extends React.Component {
......@@ -264,11 +265,11 @@ class OrderDetail extends React.Component {
{
this.state.detail_trans.trans_type_display == 'Pick Up' ? (
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>PICKUP</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pickup')}</Text>
</View>
) : (
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>DELIVERY</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('delivery')}</Text>
</View>
)
......@@ -298,11 +299,11 @@ class OrderDetail extends React.Component {
{
this.state.detail_trans.trans_type_display == 'Pick Up' ? (
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>PICKUP</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pickup')}</Text>
</View>
) : (
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>DELIVERY</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('delivery')}</Text>
</View>
)
......@@ -315,7 +316,7 @@ class OrderDetail extends React.Component {
{
this.state.detail_trans.grab_driver_name == '' ? (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-SemiBoldItalic', color: 'grey' }}>Looking For Driver</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-SemiBoldItalic', color: 'grey' }}>{i18n.t('lookingForDriver')}</Text>
</View>
) : (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
......@@ -366,7 +367,7 @@ class OrderDetail extends React.Component {
<View style={{ marginLeft: 10, marginTop: 10, paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>PESANAN</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('yourOrders')}</Text>
</View>
{
......@@ -393,7 +394,7 @@ class OrderDetail extends React.Component {
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' }}>{i18n.t('note')} : {item.item_note} </Text>
)
}
......@@ -425,7 +426,7 @@ class OrderDetail extends React.Component {
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: this.state.detail_trans.used_reward[0].id })}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#CFB368' }}>View Detail</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#CFB368' }}>{i18n.t('viewDetail')}</Text>
</TouchableOpacity>
{/* <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>
......@@ -436,12 +437,12 @@ class OrderDetail extends React.Component {
}
<View style={{ borderTopWidth: 1, borderColor: 'grey', marginHorizontal: 10, marginTop: 5 }}>
<View style={{ paddingLeft: 10, paddingTop: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>PAYMENT</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('payment')}</Text>
</View>
</View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginHorizontal: 10 }}>
<View style={{ flex: 0.5, marginLeft: 20, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Balance Used</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('balanceUsed')}</Text>
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.state.detail_trans.trans_paid}</Text> */}
......@@ -450,7 +451,7 @@ class OrderDetail extends React.Component {
</View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginHorizontal: 10 }}>
<View style={{ flex: 0.5, marginLeft: 20, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Point Used</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pointUsed')}</Text>
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.state.detail_trans.point_booked}</Text> */}
......@@ -459,7 +460,7 @@ class OrderDetail extends React.Component {
</View>
<View style={{ marginTop: 5, borderTopWidth: 1, borderColor: 'grey', marginHorizontal: 10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Harga</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('price')}</Text>
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'right' }}>{this.state.detail_trans.trans_subtotal}</Text> */}
......@@ -471,7 +472,7 @@ class OrderDetail extends React.Component {
this.state.detail_trans.used_reward.length ? (
<View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Voucher</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('discount')}</Text>
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'right' }}>- {this.state.detail_trans.trans_discount}</Text> */}
......@@ -486,7 +487,7 @@ class OrderDetail extends React.Component {
this.state.detail_trans.trans_type == 2 ? (
<View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Ongkos kirim</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('rateDelivery')}</Text>
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{
......@@ -507,7 +508,7 @@ class OrderDetail extends React.Component {
}
<View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10, marginTop: 5 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: '#CFB368' }}>Total</Text>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('total')}</Text>
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.state.detail_trans.trans_total}</Text> */}
......@@ -528,7 +529,7 @@ class OrderDetail extends React.Component {
/>
</View>
<View style={{ paddingRight: 25 }}>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>Bantuan</Text>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>{i18n.t('help')}</Text>
</View>
</View>
</View>
......@@ -538,7 +539,7 @@ class OrderDetail extends React.Component {
{
this.state.trans_status == 0 ? (<TouchableOpacity onPress={() => this.handleCancel()}>
<View style={styles.button}>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>Cancel</Text>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>{i18n.t('cancel')}</Text>
</View>
</TouchableOpacity>) : (null)
}
......@@ -548,14 +549,14 @@ class OrderDetail extends React.Component {
this.state.is_reviewed ? (
<View style={{ height: 70, borderWidth: 1, borderRadius: 10, justifyContent: 'center', margin: 30, borderColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}> You Rated </Text>
<Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}> {i18n.t('youRated')} </Text>
<Rating imageSize={20} style={{ top: 5 }} readonly startingValue={this.state.review_rating} ratingBackgroundColor='#CFB368' />
</View>
) : (
<TouchableOpacity style={{ justifyContent: 'center' }} onPress={() => this.props.navigation.navigate('RatingOrder', { idTrans: this.state.detail_trans.id })}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginRight: 20, marginLeft: 20, marginTop: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}>Rate Order</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}>{i18n.t('rateOrder')}</Text>
</View>
</TouchableOpacity>
)
......
......@@ -43,28 +43,28 @@ class OrderHistory extends React.Component {
let params = {
session_id: this.props.session_id
}
Axios.post(this.props.BASE_URL+'crm/v2/transaction/list', params).then(res => {
Axios.post(this.props.BASE_URL + 'crm/v2/transaction/list', params).then(res => {
let data = res.data.data
// console.log(data)
data.map((item) => {
if (item.trans_status_display == 'On Queue') {
item.trans_status_display = 'Queueing'
} else
if (item.trans_status_display == 'On Process') {
item.trans_status_display = 'Processing'
} else
if (item.trans_status_display == 'Ready to Pickup') {
item.trans_status_display = 'Ready for Pickup'
} else
if (item.trans_status_display == 'On Delivery') {
item.trans_status_display = 'Delivering'
} else
if (item.trans_status_display == 'On Completed') {
item.trans_status_display = 'Completed'
} else
if (item.trans_status_display == 'Cancelled') {
item.trans_status_display = 'Cancelled'
}
if (item.trans_status_display == 'On Process') {
item.trans_status_display = 'Processing'
} else
if (item.trans_status_display == 'Ready to Pickup') {
item.trans_status_display = 'Ready for Pickup'
} else
if (item.trans_status_display == 'On Delivery') {
item.trans_status_display = 'Delivering'
} else
if (item.trans_status_display == 'On Completed') {
item.trans_status_display = 'Completed'
} else
if (item.trans_status_display == 'Cancelled') {
item.trans_status_display = 'Cancelled'
}
// console.log(data)
})
......@@ -94,18 +94,18 @@ class OrderHistory extends React.Component {
this.state.order_list.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: item.id })}>
<View style={{ marginTop: 5 }} key={key}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor:'#838383', flexDirection: 'row' }}>
<View style={{ flex:1.1, justifyContent: 'center', margin: 10}}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{item.outlet}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(item.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12, margin: 2 }}>{item.trans_type_display}</Text>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: item.id })}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginVertical:5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 12, textAlign: 'center',paddingHorizontal:5}}>Lihat Detail Pemesanan</Text>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginVertical: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 12, textAlign: 'center', paddingHorizontal: 5 }}>{i18n.t('seeOrderDetail')}</Text>
</View>
</TouchableOpacity>
</View>
<View style={{ flex:0.9, justifyContent: 'center', alignItems:'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{item.trans_status_display}</Text>
</View>
......
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