Commit 774d4b0f authored by Prasetya Saputra's avatar Prasetya Saputra

enable button cek & fix migrasi card cek

parent 75b76c77
...@@ -238,6 +238,7 @@ ...@@ -238,6 +238,7 @@
"alertVoucher":"Voucher cannot be used with point", "alertVoucher":"Voucher cannot be used with point",
"alertemailblank":"Email cannot be empty", "alertemailblank":"Email cannot be empty",
"check":"Check Card", "check":"Check Card",
"cardAvailable":"Card Found",
"waCallCenter":"Hello, I have a problem with trans no", "waCallCenter":"Hello, I have a problem with trans no",
"renewal_notEnoughBalance": "You don't have enough balance", "renewal_notEnoughBalance": "You don't have enough balance",
......
...@@ -238,6 +238,7 @@ ...@@ -238,6 +238,7 @@
"alertVoucher":"Voucher tidak bisa digunakan dengan point", "alertVoucher":"Voucher tidak bisa digunakan dengan point",
"alertemailblank":"Email tidak boleh kosong", "alertemailblank":"Email tidak boleh kosong",
"check":"Cek Kartu", "check":"Cek Kartu",
"cardAvailable":"Kartu Ditemukan",
"waCallCenter":"Halo, saya ada masalah dengan trans no", "waCallCenter":"Halo, saya ada masalah dengan trans no",
"renewal_notEnoughBalance": "Saldo anda tidak mencukupi.", "renewal_notEnoughBalance": "Saldo anda tidak mencukupi.",
......
...@@ -20,34 +20,37 @@ class CardActivation extends React.Component { ...@@ -20,34 +20,37 @@ class CardActivation extends React.Component {
timer: 80, timer: 80,
onclickToken: false, onclickToken: false,
onclick: false, onclick: false,
onClickCard: false, // Modifikasi Aktivasi Kartu | Hidden Check Card Button
spinner: false, spinner: false,
caretHidden: true, caretHidden: true,
tnc_link:'', tnc_link: '',
TextInputDisableStatus: true, // Modifikasi Aktivasi Kartu | Disable Edit TextInputDisableStatus: true, // Modifikasi Aktivasi Kartu | Disable Edit
} }
} }
checkCard = () => { checkCard = () => {
// Modifikasi Aktivasi Kartu | Function Disable Edit + Check Card API // Modifikasi Aktivasi Kartu | Function Disable Edit + Check Card API
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
card_number: this.state.card_number, card_number: this.props.card_number || this.state.card_number,
} }
Axios.post(this.props.BASE_URL + 'crm/v2/card/series_info', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/card/series_info', params).then(res => {
// Mengambil Data TnC Link dari API // Mengambil Data TnC Link dari API
console.log('LINK TNC : ', res.data.data.tnc_link); console.log('LINK TNC : ', res.data.data.tnc_link);
this.setState({ TextInputDisableStatus: false, tnc_link: res.data.data.tnc_link, onClickCard: true }) this.setState({ TextInputDisableStatus: false, tnc_link: res.data.data.tnc_link })
Alert.alert(
'',
i18n.t('cardAvailable'))
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
Alert.alert( Alert.alert(
'', '',
response.msg, response.msg,
[ [
{ {
text: "OK", text: "OK",
onPress: () => this.setState({ spinner: false }) } onPress: () => this.setState({ spinner: false })
}
], ],
); );
}) })
...@@ -330,6 +333,41 @@ class CardActivation extends React.Component { ...@@ -330,6 +333,41 @@ class CardActivation extends React.Component {
/> />
<View style={styles.form}> <View style={styles.form}>
{/* Modifikasi Aktivasi Kartu | Disable Edit */}
<View style={styles.field_email}>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>{i18n.t('cardNumber')}</Text>
{this.state.card_nums == "" ? (
<TextInput
style={{ backgroundColor: this.state.TextInputDisableStatus ? '#FFF' : '#e3e3e3', height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10, textAlign: 'center', fontFamily: 'Gotham-Black', color: 'grey', fontSize: 16 }}
onChangeText={card_number => this.setState({ card_number })}
keyboardType='numeric'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })}
editable={this.state.TextInputDisableStatus}
/>
) : (
<TextInput
style={{ backgroundColor: this.state.TextInputDisableStatus ? '#FFF' : '#e3e3e3', height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10, textAlign: 'center', fontFamily: 'Gotham-Black', color: 'grey', fontSize: 16 }}
onChangeText={card_nums => this.setState({ card_nums })}
value={this.state.card_nums}
editable={false}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })}
/>
)
}
</View>
{/* Modifikasi Aktivasi Kartu | Cek Kartu */}
<View style={styles.button}>
<TouchableOpacity style={{ top: 25 }} onPress={this.checkCard}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 10 }}>{i18n.t('check')}</Text>
</View>
</TouchableOpacity>
</View>
</View>
<View style={styles.field_phone}> <View style={styles.field_phone}>
<View style={{ flex: 1, margin: 10 }}> <View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>{i18n.t('mobilePhone')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>{i18n.t('mobilePhone')}</Text>
...@@ -344,13 +382,13 @@ class CardActivation extends React.Component { ...@@ -344,13 +382,13 @@ class CardActivation extends React.Component {
/> />
</View> </View>
{this.state.onclick == true ? (null) : ( {this.state.onclick == true ? (null) : (
<View style={styles.button}> <View style={styles.button}>
<TouchableOpacity disabled={this.state.mobile_phone.length<1} style={{ top: 25 }} onPress={() => this.handleToken()}> <TouchableOpacity style={{ top: 25 }} onPress={() => this.handleToken()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: this.state.mobile_phone.length<1 ? '#e3e3e3' : '#CFB368', justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368' , justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 10 }}>{i18n.t('sendtoken')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 10 }}>{i18n.t('sendtoken')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
)} )}
</View> </View>
{ {
...@@ -370,42 +408,6 @@ class CardActivation extends React.Component { ...@@ -370,42 +408,6 @@ class CardActivation extends React.Component {
</TouchableOpacity> </TouchableOpacity>
) : (null)} ) : (null)}
{/* Modifikasi Aktivasi Kartu | Disable Edit */}
<View style={styles.field_email}>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>{i18n.t('cardNumber')}</Text>
{this.state.card_nums == "" ? (
<TextInput
style={{ backgroundColor: this.state.TextInputDisableStatus ? '#FFF' : '#e3e3e3', height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10, textAlign: 'center', fontFamily: 'Gotham-Black', color: 'grey', fontSize: 16 }}
onChangeText={card_number => this.setState({ card_number })}
keyboardType='numeric'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })}
editable={this.state.TextInputDisableStatus}
/>
) : (
<TextInput
style={{ backgroundColor: this.state.TextInputDisableStatus ? '#FFF' : '#e3e3e3', height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10, textAlign: 'center', fontFamily: 'Gotham-Black', color: 'grey', fontSize: 16 }}
onChangeText={card_nums => this.setState({ card_nums })}
value={this.state.card_nums}
editable={false}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })}
/>
)
}
</View>
{/* Modifikasi Aktivasi Kartu | Cek Kartu */}
{this.state.onClickCard == true ? (null) : (
<View style={styles.button}>
<TouchableOpacity disabled={this.state.card_number.length<1} style={{ top: 25 }} onPress={this.checkCard}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: this.state.card_number.length<1 ? '#e3e3e3' : '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 10 }}>{i18n.t('check')}</Text>
</View>
</TouchableOpacity>
</View>
)}
</View>
<View style={styles.field_email}> <View style={styles.field_email}>
<View style={{ flex: 1, margin: 10 }}> <View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>Token</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>Token</Text>
...@@ -437,7 +439,7 @@ class CardActivation extends React.Component { ...@@ -437,7 +439,7 @@ class CardActivation extends React.Component {
<ListItem style={{ borderBottomColor: 'white', alignItems: 'center', alignContent: 'center' }}> <ListItem style={{ borderBottomColor: 'white', alignItems: 'center', alignContent: 'center' }}>
<CheckBox color="#CFB368" checked={this.state.terms_condition} onPress={() => this.checkboxPressed()} /> <CheckBox color="#CFB368" checked={this.state.terms_condition} onPress={() => this.checkboxPressed()} />
<Body> <Body>
<TouchableWithoutFeedback onPress={() => {this.props.navigation.navigate('Card Privacy Statement', {tnc_link:this.state.tnc_link})}}> <TouchableWithoutFeedback onPress={() => { this.props.navigation.navigate('Card Privacy Statement', { tnc_link: this.state.tnc_link }) }}>
<Text style={{ marginLeft: 16, color: '#CFB368', fontWeight: 'bold' }}>{i18n.t('accept_terms_condition')}</Text> <Text style={{ marginLeft: 16, color: '#CFB368', fontWeight: 'bold' }}>{i18n.t('accept_terms_condition')}</Text>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
</Body> </Body>
......
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