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 {
// style={styles.submitUpgradePemium}
activeOpacity={.5} onPress={() => this.props.navigation.navigate('TopUpInfo')}>
<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>
</TouchableOpacity>
<TouchableOpacity
......@@ -489,14 +489,14 @@ const styles = StyleSheet.create({
topUseBalance: {
flex: 0.5,
height: 40,
backgroundColor: 'green',
top: 20,
margin: 5,
padding: 10,
paddingHorizontal: 15,
paddingBottom : 10,
paddingHorizontal: 16,
borderRadius: 10,
backgroundColor: '#CFB368',
paddingBottom: -5
// paddingBottom: -5
},
line: {
......
......@@ -245,7 +245,7 @@ class OrderDetail extends React.Component {
</View>
<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',top:10 }}>{item.item_note} </Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey',top:10 }}>Keterangan : {item.item_note} </Text>
</View>
<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> */}
......@@ -375,7 +375,7 @@ class OrderDetail extends React.Component {
this.state.is_reviewed ? (
<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' />
</View>
......
......@@ -57,6 +57,16 @@ class RedeemCode extends React.Component {
} else {
let response = error.response.data;
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 {
}
render() {
console.log(this.props)
// console.log(this.props)
return (
<View style={styles.container}>
{/* <View style={styles.header}>
......
......@@ -59,7 +59,15 @@ class UseBalance extends React.Component {
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)
}).catch(error => {
// console.log('ini error ' + error)
......@@ -120,10 +128,10 @@ class UseBalance extends React.Component {
let params = {
session_id: this.props.session_id,
pin: this.state.pin,
balance: this.state.input_redeem,
balance: parseInt(this.state.input_redeem),
point: 0
}
// console.log(params)
console.log(params)
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/point/redeem', params).then(res => {
// console.log(res.data)
......@@ -160,7 +168,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id,
pin: this.state.pin,
balance: 0,
point: this.state.input_redeem
point: parseInt(this.state.input_redeem)
}
console.log(params)
......@@ -201,7 +209,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id,
pin: this.state.pin,
balance: parseInt(this.state.input_redeem) - parseInt(this.state.kasproPoint),
point: this.state.kasproPoint
point: parseInt(this.state.kasproPoint)
}
console.log(params)
......@@ -236,7 +244,7 @@ class UseBalance extends React.Component {
session_id: this.props.session_id,
pin: this.state.pin,
balance: 0,
point: this.state.input_redeem
point: parseInt(this.state.input_redeem)
}
console.log(params)
......@@ -273,7 +281,9 @@ class UseBalance extends React.Component {
}
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 (
<ScrollView style={styles.container}>
<Modal animationType="slide"
......@@ -341,7 +351,7 @@ class UseBalance extends React.Component {
<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' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
......@@ -379,7 +389,7 @@ class UseBalance extends React.Component {
</View>
<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' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
......@@ -418,7 +428,19 @@ class UseBalance extends React.Component {
</View>
<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={() => {
this.checkedSelection('balancepoint')
}}>
......@@ -441,18 +463,6 @@ class UseBalance extends React.Component {
</Card>
</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>
......
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