Commit c5f58433 authored by Trisno's avatar Trisno

update

parent 6ffbb141
......@@ -227,21 +227,41 @@ class ShoppingCart extends React.Component {
// console.log(val)
if (val == 'balance') {
if (this.props.type_pickup == true) {
this.setState({
checkedBalance: true,
checkedPoint: false,
checkedBalancePoint: false,
balanceused: Math.max(0, this.props.order_total - this.props.voucher.reward.value),
pointsused: 0
})
if (this.props.value_voucher == '') {
this.setState({
checkedBalance: true,
checkedPoint: false,
checkedBalancePoint: false,
balanceused: this.props.order_total,
pointsused: 0
})
} else {
this.setState({
checkedBalance: true,
checkedPoint: false,
checkedBalancePoint: false,
balanceused: Math.max(0, this.props.order_total - this.props.voucher.reward.value),
pointsused: 0
})
}
} else {
this.setState({
checkedBalance: true,
checkedPoint: false,
checkedBalancePoint: false,
balanceused: Math.max(0, this.props.order_total - this.props.voucher.reward.value + this.props.grabamount),
pointsused: 0
})
if (this.props.value_voucher == '') {
this.setState({
checkedBalance: true,
checkedPoint: false,
checkedBalancePoint: false,
balanceused: Math.max(0, this.props.order_total + this.props.grabamount),
pointsused: 0
})
} else {
this.setState({
checkedBalance: true,
checkedPoint: false,
checkedBalancePoint: false,
balanceused: Math.max(0, this.props.order_total - this.props.voucher.reward.value + this.props.grabamount),
pointsused: 0
})
}
}
} else if (val == 'point') {
if (this.props.type_pickup == true) {
......@@ -665,10 +685,15 @@ class ShoppingCart extends React.Component {
</View>
) : (
<View style={{ marginTop: 15, paddingRight: 30, paddingTop: 10, alignItems: 'flex-end' }}>
{this.props.order_item.length ? (
{/* {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' }}>{this.props.order_total + this.state.diskon}</Text>
)} */}
{this.props.value_voucher == '' ? (
<Text style={{ fontSize: 35, color: '#ccb46c' }}>{this.props.order_total + 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>
)}
</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