Commit 835a7a79 authored by Trisno's avatar Trisno

benerin metode pembayaran use balance

parent 167e71a7
......@@ -42,7 +42,7 @@ class UseBalance extends React.Component {
}
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => {
console.log('ini res ' + JSON.stringify(res.data))
// console.log('ini res ' + JSON.stringify(res.data))
const dataCard = res.data
......@@ -61,13 +61,13 @@ class UseBalance extends React.Component {
// // Buat Debug
// this.setState({
// current_balance: '10,000',
// kaspro_point: '0',
// kasproBalance: '10,000'.replace(/,/g, ''),
// kasproPoint: '0'.replace(/,/g, '')
// current_balance: '5,000',
// kaspro_point: '10,000',
// kasproBalance: '5,000'.replace(/,/g, ''),
// kasproPoint: '10,000'.replace(/,/g, '')
// })
console.log("INI SESSION " + this.props.session_id)
// console.log("INI SESSION " + this.props.session_id)
// console.log(this.state.kasproPoint)
}).catch(error => {
// console.log('ini error ' + error)
......@@ -168,7 +168,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id,
pin: this.state.pin,
balance: 0,
point: this.state.input_redeem
point: parseInt(this.state.input_redeem)
}
console.log(params)
......@@ -209,7 +209,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id,
pin: this.state.pin,
balance: parseInt(this.state.input_redeem) - parseInt(this.state.kasproPoint),
point: this.state.kasproPoint
point: parseInt(this.state.kasproPoint)
}
console.log(params)
......@@ -244,7 +244,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id,
pin: this.state.pin,
balance: 0,
point: this.state.input_redeem
point: parseInt(this.state.input_redeem)
}
console.log(params)
......@@ -281,7 +281,9 @@ class UseBalance extends React.Component {
}
render() {
console.log(parseInt(this.state.kasproPoint) - parseInt(this.state.input_redeem))
// console.log(parseInt(this.state.kasproPoint) - parseInt(this.state.input_redeem))
// console.log(this.state.kasproBalance)
// console.log(this.state.kasproPoint)
return (
<ScrollView style={styles.container}>
<Modal animationType="slide"
......@@ -349,7 +351,7 @@ class UseBalance extends React.Component {
<View style={{ alignItems: 'center' }}>
{
this.state.input_redeem == 0 ? (
this.state.input_redeem == 0 || parseInt(this.state.input_redeem) > parseInt(this.state.kasproBalance) ? (
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
......@@ -387,7 +389,7 @@ class UseBalance extends React.Component {
</View>
<View style={{ alignItems: 'center' }}>
{
this.state.input_redeem == 0 ? (
this.state.input_redeem == 0 || parseInt(this.state.input_redeem) > parseInt(this.state.kasproPoint) ? (
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
......@@ -426,7 +428,19 @@ class UseBalance extends React.Component {
</View>
<View style={{ alignItems: 'center' }}>
{
this.state.input_redeem != 0 ? (
this.state.input_redeem == 0 || parseInt(this.state.input_redeem) > parseInt(this.state.kasproPoint) + parseInt(this.state.kasproBalance) ? (
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'white' }}>EXCELSO BALANCE + POINTS</Text>
</View>
<View>
<FontAwesome name='circle-o' size={30} color={'#ccb46c'} />
</View>
</View>
</Card>
) : (
<TouchableOpacity onPress={() => {
this.checkedSelection('balancepoint')
}}>
......@@ -449,18 +463,6 @@ class UseBalance extends React.Component {
</Card>
</TouchableOpacity>
) : (
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'white' }}>EXCELSO BALANCE + POINTS</Text>
</View>
<View>
<FontAwesome name='circle-o' size={30} color={'#ccb46c'} />
</View>
</View>
</Card>
)
}
</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