Commit 70f52f85 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

add review in order detaiil

parent b33f1cac
...@@ -272,32 +272,32 @@ class OrderDetail extends React.Component { ...@@ -272,32 +272,32 @@ class OrderDetail extends React.Component {
{ {
this.state.detail_trans != '' ? ( this.state.detail_trans != '' ? (
this.state.detail_trans.used_reward.length ? ( this.state.detail_trans.used_reward.length ? (
<View style={{flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10}}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}> <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' }}>Voucher</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 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'right' }}>- {this.state.detail_trans.trans_discount}</Text> */} {/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'right' }}>- {this.state.detail_trans.trans_discount}</Text> */}
<NumberFormat decimalScale={0} value={this.state.detail_trans.used_reward[0].reward.value} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey', textAlign: 'right' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <NumberFormat decimalScale={0} value={this.state.detail_trans.used_reward[0].reward.value} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey', textAlign: 'right' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View> </View>
</View> </View>
) :(null) ) : (null)
) : (null) ) : (null)
} }
{ {
this.state.detail_trans != '' ? ( this.state.detail_trans != '' ? (
this.state.detail_trans.trans_type == 2 ? ( this.state.detail_trans.trans_type == 2 ? (
<View style={{flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10}}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}> <View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Ongkis kirim</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Ongkis kirim</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 }}>
{ {
this.state.detail_trans.transaction_detail.map((item,index) => { this.state.detail_trans.transaction_detail.map((item, index) => {
// console.log(item) // console.log(item)
if (item.item_code == 'GRAB-DELIVERY') { if (item.item_code == 'GRAB-DELIVERY') {
return( return (
<NumberFormat decimalScale={0} value={item.item_price} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey', textAlign: 'right' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <NumberFormat decimalScale={0} value={item.item_price} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey', textAlign: 'right' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
) )
} }
}) })
...@@ -305,14 +305,14 @@ class OrderDetail extends React.Component { ...@@ -305,14 +305,14 @@ class OrderDetail extends React.Component {
{/* <NumberFormat decimalScale={0} value={this.state.detail_trans.trans_discount} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey', textAlign: 'right' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> */} {/* <NumberFormat decimalScale={0} value={this.state.detail_trans.trans_discount} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey', textAlign: 'right' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> */}
</View> </View>
</View> </View>
) :(null) ) : (null)
) : (null) ) : (null)
} }
<View style={{flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10, marginTop:5}}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10, marginTop: 5 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 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' }}>Total</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 }}>
{/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.state.detail_trans.trans_total}</Text> */} {/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.state.detail_trans.trans_total}</Text> */}
<NumberFormat decimalScale={0} value={this.state.detail_trans.point_reduce} renderText={value => <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <NumberFormat decimalScale={0} value={this.state.detail_trans.point_reduce} renderText={value => <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View> </View>
...@@ -321,11 +321,23 @@ class OrderDetail extends React.Component { ...@@ -321,11 +321,23 @@ class OrderDetail extends React.Component {
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: 22, fontFamily: 'Gotham-Black' }}>Cancel</Text> <Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>Cancel</Text>
</View> </View>
</TouchableOpacity>) : (null) </TouchableOpacity>) : (null)
} }
{
this.state.trans_status == 4 ? (
<TouchableOpacity style={{ justifyContent: 'center' }} onPress={() => this.props.navigation.navigate('RatingOrder', { idTrans: item.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 }}>Rating Order</Text>
</View>
</TouchableOpacity>
) : (
null
)
}
...@@ -385,9 +397,10 @@ const styles = StyleSheet.create({ ...@@ -385,9 +397,10 @@ const styles = StyleSheet.create({
borderWidth: 1, borderWidth: 1,
}, },
button: { button: {
backgroundColor: '#CFB368', backgroundColor: '#d34343',
height:40,
marginTop: 25, marginTop: 25,
marginHorizontal: 30, marginHorizontal: 20,
borderRadius: 10, borderRadius: 10,
paddingVertical: 5, paddingVertical: 5,
alignItems: 'center', alignItems: 'center',
......
...@@ -88,18 +88,6 @@ class OrderHistory extends React.Component { ...@@ -88,18 +88,6 @@ class OrderHistory extends React.Component {
<View> <View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{item.trans_status_display}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{item.trans_status_display}</Text>
</View> </View>
{
this.trans_status == 4 ?(
<TouchableOpacity style={{justifyContent:'center'}} onPress={() => this.props.navigation.navigate('RatingOrder', { idTrans: item.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: 12, textAlign: 'center',paddingHorizontal:5}}>Rating Order</Text>
</View>
</TouchableOpacity>
):(
null
)
}
</View> </View>
</View> </View>
</View> </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