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