Commit dd6df037 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

nambah pesan kalau in_process_redeem == false tampilin pesan kode sudah tidak berlaku

parent 8acd73ef
......@@ -143,5 +143,6 @@
"success":"SUCCESS",
"alertyes":"Yes",
"alertno":"No",
"active": "Active"
"active": "Active",
"alertreedemexpired":"Sorry, the redemption code has expired, please cancel!"
}
\ No newline at end of file
......@@ -145,6 +145,7 @@
"success":"SUKSES",
"alertyes":"Ya",
"alertno":"Tidak",
"active": "Aktif "
"active": "Aktif ",
"alertreedemexpired":"Mohon maaf kode redeem sudah tidak berlaku, Mohon Batalkan !"
}
\ No newline at end of file
......@@ -13,11 +13,12 @@ class RedeemCode extends React.Component {
super(props);
this.handleBackButtonClick = this.handleBackButtonClick.bind(this)
this.state = {
in_process_redeem: false,
}
}
componentDidMount() {
this.CheckReddemProses()
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
......@@ -32,6 +33,24 @@ class RedeemCode extends React.Component {
return true;
}
CheckReddemProses() {
let params = {
session_id: this.props.session_id
}
Axios.post(this.props.BASE_URL + 'crm/v2/point/check', params).then(res => {
let in_process_redeem = res.data.in_process_redeem
this.setState({
in_process_redeem: in_process_redeem
})
console.log("DATA NYA : " + JSON.stringify(res))
}).catch(error => {
let response = error.response.data
Alert.alert(error, response.msg)
})
}
cancel() {
let params = {
session_id: this.props.session_id,
......@@ -118,6 +137,14 @@ class RedeemCode extends React.Component {
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>{i18n.t('cancel')} {i18n.t('payment')}</Text>
</View>
</TouchableOpacity>
<View style={{ justifyContent: 'center', top: 20 }}>
{this.state.in_process_redeem == false ? (
<Text style={{ textAlign: 'center', fontSize: 14, fontFamily: 'Gotham-Light', color: 'red' }}>{i18n.t('alertreedemexpired')}</Text>
) : (null)}
</View>
</View>
</View>
)
......@@ -172,6 +199,7 @@ const mapStateToProps = (state) => {
session_id: state.session_id,
redeem_code: state.redeem_code,
balance_redeem: state.balance_redeem,
BASE_URL: state.BASE_URL,
point_redeem: state.point_redeem
}
}
......
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