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

check

parent 8d4a5efe
...@@ -139,6 +139,9 @@ ...@@ -139,6 +139,9 @@
"noInboxData":"No incoming message", "noInboxData":"No incoming message",
"headerInboxDetail":"INBOX DETAIL", "headerInboxDetail":"INBOX DETAIL",
"alertdeleteaddress":"Are you sure you want to delete the address ?", "alertdeleteaddress":"Are you sure you want to delete the address ?",
"alertclaimcredit":"Success credit claim",
"success":"SUCCESS",
"alertyes":"Yes", "alertyes":"Yes",
"alertno":"No" "alertno":"No",
"active": "Active"
} }
\ No newline at end of file
...@@ -141,6 +141,10 @@ ...@@ -141,6 +141,10 @@
"noInboxData":"Tidak ada pesan masuk", "noInboxData":"Tidak ada pesan masuk",
"headerInboxDetail":"DETIL INBOX", "headerInboxDetail":"DETIL INBOX",
"alertdeleteaddress":"Apakah anda yakin ingin menghapus alamat ?", "alertdeleteaddress":"Apakah anda yakin ingin menghapus alamat ?",
"alertclaimcredit":"Sukses klaim kredit",
"success":"SUKSES",
"alertyes":"Ya", "alertyes":"Ya",
"alertno":"Tidak" "alertno":"Tidak",
"active": "Aktif "
} }
\ No newline at end of file
...@@ -4,7 +4,7 @@ import * as Device from 'expo-device'; ...@@ -4,7 +4,7 @@ import * as Device from 'expo-device';
import * as Location from 'expo-location'; import * as Location from 'expo-location';
import * as Permissions from 'expo-permissions'; import * as Permissions from 'expo-permissions';
import * as React from 'react'; import * as React from 'react';
import { ActivityIndicator, Alert, Dimensions, ScrollView, StyleSheet, Text, TouchableOpacity, View, SafeAreaView,StatusBar } from 'react-native'; import { ActivityIndicator, Alert, Dimensions, ScrollView, StyleSheet, Text, TouchableOpacity, View, SafeAreaView, StatusBar } from 'react-native';
import { SliderBox } from "react-native-image-slider-box"; import { SliderBox } from "react-native-image-slider-box";
import { Card } from 'react-native-shadow-cards'; import { Card } from 'react-native-shadow-cards';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -36,7 +36,10 @@ class Home extends React.Component { ...@@ -36,7 +36,10 @@ class Home extends React.Component {
slider_height: 350, slider_height: 350,
slugs: [], slugs: [],
placeholder: true, placeholder: true,
inbox: "0" inbox: "0",
is_expired_date: true,
old_balance_claimed: true,
member_since: ""
} }
} }
...@@ -172,15 +175,23 @@ class Home extends React.Component { ...@@ -172,15 +175,23 @@ class Home extends React.Component {
let point = dataCard.kaspro_point let point = dataCard.kaspro_point
let balance = dataCard.kaspro_balance let balance = dataCard.kaspro_balance
let expire = dataCard.expire_date let expire = dataCard.expire_date
let account_number = dataCard.card_number let account_number = dataCard.kaspro_account_number
let is_expired = dataCard.is_expired
let old_balance_claimed = dataCard.old_balance_claimed
let member_since = dataCard.member_since
this.setState({ this.setState({
point: point, point: point,
balance: balance, balance: balance,
account_number: account_number, account_number: account_number,
expire_date: expire, expire_date: expire,
indicatorProfileCard: false indicatorProfileCard: false,
is_expired: is_expired,
old_balance_claimed: old_balance_claimed,
member_since: member_since
}) })
console.log("INI HASIL RESPON NYA :" + JSON.stringify(res))
}).catch(error => { }).catch(error => {
let response = error.response.data let response = error.response.data
// Alert.alert('',response.msg); // Alert.alert('',response.msg);
...@@ -249,6 +260,21 @@ class Home extends React.Component { ...@@ -249,6 +260,21 @@ class Home extends React.Component {
} }
} }
handleClaimCredit() {
let params = {
session_id: this.props.session_id
}
Axios.post(this.props.BASE_URL + '/crm/v2/card/claim_old_balance', params).then(res => {
Alert.alert(i18n.t('success'), i18n.t('alertclaimcredit'))
}).catch(error => {
let response = error.response.data
Alert.alert(error,response.msg)
console.log("INI RESPON CLAMI"+JSON.stringify(error))
})
}
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
...@@ -394,9 +420,7 @@ class Home extends React.Component { ...@@ -394,9 +420,7 @@ class Home extends React.Component {
</TouchableOpacity> </TouchableOpacity>
</Card> </Card>
) )
} }
{ {
this.state.indicatorProfileCard == true ? ( this.state.indicatorProfileCard == true ? (
<View style={styles.card}> <View style={styles.card}>
...@@ -405,7 +429,7 @@ class Home extends React.Component { ...@@ -405,7 +429,7 @@ class Home extends React.Component {
</Card> </Card>
</View> </View>
) : ) :
this.state.account_number === "" ? ( this.state.account_number == "" ? (
<View style={styles.card}> <View style={styles.card}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center', backgroundColor: '#838383' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center', backgroundColor: '#838383' }}>
<View style={{ flex: 1, backgroundColor: 'grey', height: 150, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, backgroundColor: 'grey', height: 150, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
...@@ -416,27 +440,72 @@ class Home extends React.Component { ...@@ -416,27 +440,72 @@ class Home extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View>
</Card>
</View>
) :
this.state.account_number !== "" && this.state.is_expired == false ? (
<View style={styles.card}>
<Card style={{ padding: 20, margin: 10, alignContent: 'center' }}>
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}> {i18n.t('active')} {this.state.member_since}</Text>
</View>
</View>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
{this.state.account_number}
</Text>
</View>
<View style={styles.line}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>{i18n.t('balance')} : </Text>
</View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text>
</View>
</View>
<View style={styles.line2}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>{i18n.t('point')} : </Text>
</View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.point}</Text>
</View>
</View> </View>
</Card> </Card>
{this.state.old_balance_claimed == false ? (
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : 200.000 </Text>
<View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.handleClaimCredit()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', margin: 15 }}>CLAIM CREDIT</Text>
</View>
</TouchableOpacity>
</View>
</View>
</Card>) : (null)}
</View> </View>
) : ) :
this.state.account_number == "" && this.state.is_expired == true ? (
(
<View style={styles.card}> <View style={styles.card}>
<Card style={{ padding: 20, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 20, margin: 10, alignContent: 'center' }}>
{/* <Text>
{i18n.t('yourCardNumber')} | {this.state.expire_date}{'\n'}
</Text> */}
{/* <Text>
YOUR CARD NUMBER | {this.state.expire_date}
</Text> */}
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}> <View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light', color: 'red' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View> </View>
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
...@@ -445,12 +514,6 @@ class Home extends React.Component { ...@@ -445,12 +514,6 @@ class Home extends React.Component {
</Text> </Text>
</View> </View>
<View style={styles.line}></View> <View style={styles.line}></View>
{/* <Text style={{ textAlign: 'left', fontWeight: 'bold' }}>
{i18n.t('balance')} {this.state.balance}
</Text> */}
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */} {/* <Text>{i18n.t('balance')}</Text> */}
...@@ -460,12 +523,7 @@ class Home extends React.Component { ...@@ -460,12 +523,7 @@ class Home extends React.Component {
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text>
</View> </View>
</View> </View>
<View style={styles.line2}></View> <View style={styles.line2}></View>
{/* <Text style={{ textAlign: 'left', fontWeight: 'bold' }}>
{i18n.t('point')} {this.state.point}
</Text> */}
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */} {/* <Text>{i18n.t('balance')}</Text> */}
...@@ -474,6 +532,71 @@ class Home extends React.Component { ...@@ -474,6 +532,71 @@ class Home extends React.Component {
<View style={{ flex: 0.7, alignItems: 'center' }}> <View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.point}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.point}</Text>
</View> </View>
<View style={styles.line2}></View>
<View style={{ justifyContent: 'center', marginTop: 20 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Renewal')}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', margin: 15 }}>RENEWAL</Text>
</View>
</TouchableOpacity>
</View>
</View>
</Card>
{this.state.old_balance_claimed == false ? (
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : 200.000 </Text>
<View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.handleClaimCredit()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>CLAIM CREDIT</Text>
</View>
</TouchableOpacity>
</View>
</View>
</Card>) : (null)}
</View>
) : (
<View style={styles.card}>
<Card style={{ padding: 20, margin: 10, alignContent: 'center' }}>
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View>
</View>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
{this.state.account_number}
</Text>
</View>
<View style={styles.line}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>{i18n.t('balance')} : </Text>
</View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text>
</View>
</View>
<View style={styles.line2}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>{i18n.t('point')} : </Text>
</View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.point}</Text>
</View>
</View>
<View style={styles.line2}></View>
<View style={{ justifyContent: 'center', marginTop: 20 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Renewal')}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', margin: 15 }}>RENEWAL</Text>
</View>
</TouchableOpacity>
</View> </View>
</Card> </Card>
</View> </View>
...@@ -483,7 +606,8 @@ class Home extends React.Component { ...@@ -483,7 +606,8 @@ class Home extends React.Component {
<TouchableOpacity <TouchableOpacity
// style={styles.submitUpgradePemium} // style={styles.submitUpgradePemium}
activeOpacity={.5} activeOpacity={.5}
onPress={() => this.props.navigation.navigate('TopUpInfo')} // onPress={() => this.props.navigation.navigate('TopUpInfo')}
onPress={() => this.handleClaimCredit()}
> >
<View style={{ <View style={{
flex: 0.5, flex: 0.5,
...@@ -501,8 +625,7 @@ class Home extends React.Component { ...@@ -501,8 +625,7 @@ class Home extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
// style={styles.submitUpgradePemium} onPress={() => this._useBalance()}>
activeOpacity={.5} onPress={() => this._useBalance()}>
<View style={{ <View style={{
flex: 0.5, flex: 0.5,
height: 40, height: 40,
......
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