Commit 897f4248 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

use balance pin

parent 87d5cd48
...@@ -15,6 +15,7 @@ class UseBalance extends React.Component { ...@@ -15,6 +15,7 @@ class UseBalance extends React.Component {
redeem_balance: 0, redeem_balance: 0,
redeem_point: 0, redeem_point: 0,
modalVisible: false, modalVisible: false,
pin:''
} }
} }
...@@ -49,7 +50,19 @@ class UseBalance extends React.Component { ...@@ -49,7 +50,19 @@ class UseBalance extends React.Component {
}) })
} }
handleBack(){
this.setState({
modalVisible: false
})
}
handleSubmit(){
this.redeem()
this.setState({
modalVisible: false,
pin:'',
})
}
modal() { modal() {
this.setState({ this.setState({
modalVisible: true modalVisible: true
...@@ -64,7 +77,7 @@ class UseBalance extends React.Component { ...@@ -64,7 +77,7 @@ class UseBalance extends React.Component {
} else { } else {
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
pin: '', pin: this.state.pin,
balance: this.state.redeem_balance, balance: this.state.redeem_balance,
point: this.state.redeem_point point: this.state.redeem_point
} }
...@@ -82,7 +95,6 @@ class UseBalance extends React.Component { ...@@ -82,7 +95,6 @@ class UseBalance extends React.Component {
}) })
} }
} }
render() { render() {
...@@ -102,17 +114,17 @@ class UseBalance extends React.Component { ...@@ -102,17 +114,17 @@ class UseBalance extends React.Component {
<View style={{ margin: 10 }}> <View style={{ margin: 10 }}>
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
onChangeText={(reason) => this.setState({ reason })} onChangeText={(pin) => this.setState({ pin })}
value={this.state.reason} value={this.state.pin}
textAlign='center' textAlign='center'
/> />
</View> </View>
<View> <View>
</View> </View>
<View style={{margin:5}}> <View style={{margin:5}}>
<TouchableOpacity style={{marginBottom:10}} onPress={() => this.handleOrderCancel()}> <TouchableOpacity style={{marginBottom:10}} onPress={() => this.handleSubmit()}>
<View style={styles.button2}> <View style={styles.button2}>
<Text style={{ color: 'white', fontWeight: 'bold', fontSize: 16 }}>Cancel</Text> <Text style={{ color: 'white', fontWeight: 'bold', fontSize: 16 }}>submit</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity onPress={() => this.handleBack()}> <TouchableOpacity onPress={() => this.handleBack()}>
......
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