Commit c5ecd381 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo
parents 689da5c8 6ffbb141
......@@ -43,7 +43,7 @@ class ShoppingCart extends React.Component {
componentDidMount() {
console.log(this.props.voucher.reward.value)
console.log(this.props.voucher)
console.log('INI VALUE : ' + this.props.value_voucher)
if (!this.props.type_pickup) {
this.getRate()
......@@ -231,7 +231,7 @@ class ShoppingCart extends React.Component {
checkedBalance: true,
checkedPoint: false,
checkedBalancePoint: false,
balanceused: Math.max(0,this.props.order_total - this.props.voucher.reward.value),
balanceused: Math.max(0, this.props.order_total - this.props.voucher.reward.value),
pointsused: 0
})
} else {
......@@ -239,7 +239,7 @@ class ShoppingCart extends React.Component {
checkedBalance: true,
checkedPoint: false,
checkedBalancePoint: false,
balanceused: Math.max(0,this.props.order_total - this.props.voucher.reward.value + this.props.grabamount),
balanceused: Math.max(0, this.props.order_total - this.props.voucher.reward.value + this.props.grabamount),
pointsused: 0
})
}
......@@ -636,9 +636,18 @@ class ShoppingCart extends React.Component {
<View>
<Text style={{ paddingLeft: 20, paddingTop: 10, color: 'gray' }}>Diskon</Text>
</View>
{
this.props.value_voucher == '' ? (
<View style={{ paddingRight: 30, paddingTop: 10, alignItems: 'flex-end' }}>
<Text style={{ color: 'gray' }}>{this.state.diskon}</Text>
</View>
) : (
<View style={{ paddingRight: 30, paddingTop: 10, alignItems: 'flex-end' }}>
<Text style={{ color: 'gray' }}>{this.props.voucher.reward.value}</Text>
</View>
)
}
</View>
<View style={{ flexDirection: 'row', marginTop: 10, justifyContent: 'space-between' }}>
<View style={{ marginTop: 15, paddingLeft: 20, paddingTop: 10 }}>
......@@ -646,12 +655,18 @@ class ShoppingCart extends React.Component {
</View>
{this.props.type_pickup == true ? (
<View style={{ marginTop: 15, paddingRight: 30, paddingTop: 10, alignItems: 'flex-end' }}>
<Text style={{ fontSize: 35, color: '#ccb46c' }}>{ Math.max(0,this.props.order_total - this.props.voucher.reward.value)}</Text>
{
this.props.value_voucher == '' ? (
<Text style={{ fontSize: 35, color: '#ccb46c' }}>{this.props.order_total}</Text>
) : (
<Text style={{ fontSize: 35, color: '#ccb46c' }}>{Math.max(0, this.props.order_total - this.props.voucher.reward.value)}</Text>
)
}
</View>
) : (
<View style={{ marginTop: 15, paddingRight: 30, paddingTop: 10, alignItems: 'flex-end' }}>
{this.props.order_item.length ? (
<Text style={{ fontSize: 35, color: '#ccb46c' }}>{Math.max(0,this.props.order_total - this.props.voucher.reward.value + this.props.grabamount)}</Text>
<Text style={{ fontSize: 35, color: '#ccb46c' }}>{Math.max(0, this.props.order_total - this.props.voucher.reward.value + this.props.grabamount)}</Text>
) : (
<Text style={{ fontSize: 35, color: '#ccb46c' }}>{this.props.order_total + this.state.diskon}</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