Commit 37bed8b2 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	view/Home.js
parents 31d8beef 3f11d92e
...@@ -396,7 +396,7 @@ class Home extends React.Component { ...@@ -396,7 +396,7 @@ class Home extends React.Component {
// style={styles.submitUpgradePemium} // style={styles.submitUpgradePemium}
activeOpacity={.5} onPress={() => this.props.navigation.navigate('TopUpInfo')}> activeOpacity={.5} onPress={() => this.props.navigation.navigate('TopUpInfo')}>
<View style={styles.topUseBalance}> <View style={styles.topUseBalance}>
<Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 15 }}>TOP BALANCE </Text> <Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 15 }}>TOP UP BALANCE </Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
...@@ -489,14 +489,14 @@ const styles = StyleSheet.create({ ...@@ -489,14 +489,14 @@ const styles = StyleSheet.create({
topUseBalance: { topUseBalance: {
flex: 0.5, flex: 0.5,
height: 40, height: 40,
backgroundColor: 'green',
top: 20, top: 20,
margin: 5, margin: 5,
padding: 10, padding: 10,
paddingHorizontal: 15, paddingBottom : 10,
paddingHorizontal: 16,
borderRadius: 10, borderRadius: 10,
backgroundColor: '#CFB368', backgroundColor: '#CFB368',
paddingBottom: -5 // paddingBottom: -5
}, },
line: { line: {
......
...@@ -245,7 +245,7 @@ class OrderDetail extends React.Component { ...@@ -245,7 +245,7 @@ class OrderDetail extends React.Component {
</View> </View>
<View style={{ flex: 0.4, alignItems: 'baseline', justifyContent: 'center', alignItems: 'flex-start', paddingLeft: 10 }}> <View style={{ flex: 0.4, alignItems: 'baseline', justifyContent: 'center', alignItems: 'flex-start', paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{item.item_name} </Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{item.item_name} </Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey',top:10 }}>{item.item_note} </Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey',top:10 }}>Keterangan : {item.item_note} </Text>
</View> </View>
<View style={{ flex: 0.3, alignItems: 'flex-end', justifyContent: 'center', paddingRight: 10 }}> <View style={{ flex: 0.3, alignItems: 'flex-end', justifyContent: 'center', paddingRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.item_quantity * item.item_price} </Text> */} {/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.item_quantity * item.item_price} </Text> */}
...@@ -375,7 +375,7 @@ class OrderDetail extends React.Component { ...@@ -375,7 +375,7 @@ class OrderDetail extends React.Component {
this.state.is_reviewed ? ( this.state.is_reviewed ? (
<View style={{ height: 70, borderWidth: 1, borderRadius: 10, justifyContent: 'center', margin: 30, borderColor: '#CFB368' }}> <View style={{ height: 70, borderWidth: 1, borderRadius: 10, justifyContent: 'center', margin: 30, borderColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}> You Rated ({this.state.review_rating}) </Text> <Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}> You Rated </Text>
<Rating imageSize={20} style={{ top: 5 }} readonly startingValue={this.state.review_rating} ratingBackgroundColor='#CFB368' /> <Rating imageSize={20} style={{ top: 5 }} readonly startingValue={this.state.review_rating} ratingBackgroundColor='#CFB368' />
</View> </View>
......
...@@ -57,6 +57,16 @@ class RedeemCode extends React.Component { ...@@ -57,6 +57,16 @@ class RedeemCode extends React.Component {
} else { } else {
let response = error.response.data; let response = error.response.data;
Alert.alert('', response.msg); Alert.alert('', response.msg);
let redeemProps = {
in_payment: false,
redeem_code: '',
balance_redeem: '',
point_redeem: ''
}
this.props.setRedeem(redeemProps)
this.props.navigation.navigate('Home', { screen: 'HOME' });
} }
}) })
...@@ -64,7 +74,7 @@ class RedeemCode extends React.Component { ...@@ -64,7 +74,7 @@ class RedeemCode extends React.Component {
} }
render() { render() {
console.log(this.props) // console.log(this.props)
return ( return (
<View style={styles.container}> <View style={styles.container}>
{/* <View style={styles.header}> {/* <View style={styles.header}>
......
...@@ -59,7 +59,15 @@ class UseBalance extends React.Component { ...@@ -59,7 +59,15 @@ class UseBalance extends React.Component {
kasproPoint: dataCard.kaspro_point.replace(/,/g, '') kasproPoint: dataCard.kaspro_point.replace(/,/g, '')
}) })
console.log("INI SESSION " + this.props.session_id) // // Buat Debug
// this.setState({
// current_balance: '5,000',
// kaspro_point: '10,000',
// kasproBalance: '5,000'.replace(/,/g, ''),
// kasproPoint: '10,000'.replace(/,/g, '')
// })
// console.log("INI SESSION " + this.props.session_id)
// console.log(this.state.kasproPoint) // console.log(this.state.kasproPoint)
}).catch(error => { }).catch(error => {
// console.log('ini error ' + error) // console.log('ini error ' + error)
...@@ -120,10 +128,10 @@ class UseBalance extends React.Component { ...@@ -120,10 +128,10 @@ class UseBalance extends React.Component {
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
pin: this.state.pin, pin: this.state.pin,
balance: this.state.input_redeem, balance: parseInt(this.state.input_redeem),
point: 0 point: 0
} }
// console.log(params) console.log(params)
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/point/redeem', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/point/redeem', params).then(res => {
// console.log(res.data) // console.log(res.data)
...@@ -160,7 +168,7 @@ class UseBalance extends React.Component { ...@@ -160,7 +168,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id, session_id: this.props.session_id,
pin: this.state.pin, pin: this.state.pin,
balance: 0, balance: 0,
point: this.state.input_redeem point: parseInt(this.state.input_redeem)
} }
console.log(params) console.log(params)
...@@ -201,7 +209,7 @@ class UseBalance extends React.Component { ...@@ -201,7 +209,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id, session_id: this.props.session_id,
pin: this.state.pin, pin: this.state.pin,
balance: parseInt(this.state.input_redeem) - parseInt(this.state.kasproPoint), balance: parseInt(this.state.input_redeem) - parseInt(this.state.kasproPoint),
point: this.state.kasproPoint point: parseInt(this.state.kasproPoint)
} }
console.log(params) console.log(params)
...@@ -236,7 +244,7 @@ class UseBalance extends React.Component { ...@@ -236,7 +244,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id, session_id: this.props.session_id,
pin: this.state.pin, pin: this.state.pin,
balance: 0, balance: 0,
point: this.state.input_redeem point: parseInt(this.state.input_redeem)
} }
console.log(params) console.log(params)
...@@ -273,7 +281,9 @@ class UseBalance extends React.Component { ...@@ -273,7 +281,9 @@ class UseBalance extends React.Component {
} }
render() { render() {
console.log(parseInt(this.state.kasproPoint) - parseInt(this.state.input_redeem)) // console.log(parseInt(this.state.kasproPoint) - parseInt(this.state.input_redeem))
// console.log(this.state.kasproBalance)
// console.log(this.state.kasproPoint)
return ( return (
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
<Modal animationType="slide" <Modal animationType="slide"
...@@ -341,7 +351,7 @@ class UseBalance extends React.Component { ...@@ -341,7 +351,7 @@ class UseBalance extends React.Component {
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
{ {
this.state.input_redeem == 0 ? ( this.state.input_redeem == 0 || parseInt(this.state.input_redeem) > parseInt(this.state.kasproBalance) ? (
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}> <Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View> <View>
...@@ -379,7 +389,7 @@ class UseBalance extends React.Component { ...@@ -379,7 +389,7 @@ class UseBalance extends React.Component {
</View> </View>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
{ {
this.state.input_redeem == 0 ? ( this.state.input_redeem == 0 || parseInt(this.state.input_redeem) > parseInt(this.state.kasproPoint) ? (
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}> <Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View> <View>
...@@ -418,7 +428,19 @@ class UseBalance extends React.Component { ...@@ -418,7 +428,19 @@ class UseBalance extends React.Component {
</View> </View>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
{ {
this.state.input_redeem != 0 ? ( this.state.input_redeem == 0 || parseInt(this.state.input_redeem) > parseInt(this.state.kasproPoint) + parseInt(this.state.kasproBalance) ? (
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'white' }}>EXCELSO BALANCE + POINTS</Text>
</View>
<View>
<FontAwesome name='circle-o' size={30} color={'#ccb46c'} />
</View>
</View>
</Card>
) : (
<TouchableOpacity onPress={() => { <TouchableOpacity onPress={() => {
this.checkedSelection('balancepoint') this.checkedSelection('balancepoint')
}}> }}>
...@@ -441,18 +463,6 @@ class UseBalance extends React.Component { ...@@ -441,18 +463,6 @@ class UseBalance extends React.Component {
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
) : (
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'white' }}>EXCELSO BALANCE + POINTS</Text>
</View>
<View>
<FontAwesome name='circle-o' size={30} color={'#ccb46c'} />
</View>
</View>
</Card>
) )
} }
</View> </View>
......
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