Commit f7eeee7f authored by Trisno's avatar Trisno

minimum transaksi reward

parent b7ec065c
import React from 'react'; import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, TouchableOpacity, ScrollView, FlatList, Image, Alert, ActivityIndicator } from 'react-native'; import { View, Text, TextInput, StyleSheet, Button, TouchableOpacity, ScrollView, FlatList, Image, Alert, ActivityIndicator, ToastAndroid } from 'react-native';
import { connect } from 'react-redux' import { connect } from 'react-redux'
import CheckBox from 'react-native-check-box' import CheckBox from 'react-native-check-box'
import { Card } from 'react-native-shadow-cards' import { Card } from 'react-native-shadow-cards'
...@@ -392,8 +392,15 @@ class ShoppingCart extends React.Component { ...@@ -392,8 +392,15 @@ class ShoppingCart extends React.Component {
Alert.alert('Error', 'Please choose your order first') Alert.alert('Error', 'Please choose your order first')
} else if (this.state.checkedBalance == false && this.state.checkedPoint == false && this.state.checkedBalancePoint == false) { } else if (this.state.checkedBalance == false && this.state.checkedPoint == false && this.state.checkedBalancePoint == false) {
Alert.alert('Error', 'Please insert payment methods') Alert.alert('Error', 'Please insert payment methods')
} else if (this.props.value_voucher !== '') {
if (parseInt(this.props.value_voucher.reward.min_transaction) > parseInt(this.props.order_total)) {
Alert.alert('', 'Reward tidak bisa dipakai karena minimum transaksi kurang, ayo tambah pesanan mu lagi')
} else {
this.props.navigation.navigate('CONFIRM YOUR ORDER', { balanceUsed: this.state.balanceused, pointused: this.state.pointsused })
}
} else { } else {
this.props.navigation.navigate('CONFIRM YOUR ORDER', { balanceUsed: this.state.balanceused, pointused: this.state.pointsused }) this.props.navigation.navigate('CONFIRM YOUR ORDER', { balanceUsed: this.state.balanceused, pointused: this.state.pointsused })
} }
} }
...@@ -409,7 +416,7 @@ class ShoppingCart extends React.Component { ...@@ -409,7 +416,7 @@ class ShoppingCart extends React.Component {
kasproPoint: kaspro_point.replace(/,/g, '') kasproPoint: kaspro_point.replace(/,/g, '')
}) })
console.log(this.state.kasproBalance, this.state.kasproPoint) // console.log(this.state.kasproBalance, this.state.kasproPoint)
}).catch(error => { }).catch(error => {
const { navigation } = this.props const { navigation } = this.props
let response = error.response.data let response = error.response.data
...@@ -423,6 +430,7 @@ class ShoppingCart extends React.Component { ...@@ -423,6 +430,7 @@ class ShoppingCart extends React.Component {
// console.log(this.props) // console.log(this.props)
// console.log(this.props.order_total) // console.log(this.props.order_total)
// console.log(this.props.order_item.length) // console.log(this.props.order_item.length)
console.log(this.props.value_voucher)
return ( return (
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
<View style={{ flexDirection: 'row', justifyContent: 'center' }}> <View style={{ flexDirection: 'row', justifyContent: 'center' }}>
......
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