Commit 835a7a79 authored by Trisno's avatar Trisno

benerin metode pembayaran use balance

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