Commit 99a45653 authored by Trisno's avatar Trisno

voucher tidak bisa dipakai menggunakan point

parent 9d02f0da
{ {
"expo": { "expo": {
"extra" : { "extra" : {
"buildNumber" : "135", "buildNumber" : "136",
"remarks": "" "remarks": ""
}, },
......
...@@ -227,5 +227,6 @@ ...@@ -227,5 +227,6 @@
"alertNewPassword": "Please insert new password", "alertNewPassword": "Please insert new password",
"alerConfirmNewPassword": "Please insert confirm password", "alerConfirmNewPassword": "Please insert confirm password",
"alertLabelAddress": "Please insert label address", "alertLabelAddress": "Please insert label address",
"alertDetailAddress": "Please insert detail address" "alertDetailAddress": "Please insert detail address",
"alertVoucher":"Voucher cannot be used with point"
} }
\ No newline at end of file
...@@ -227,5 +227,6 @@ ...@@ -227,5 +227,6 @@
"alertNewPassword": "Silahkan masukan password baru", "alertNewPassword": "Silahkan masukan password baru",
"alerConfirmNewPassword": "Silahkan masukan konfirmasi password baru", "alerConfirmNewPassword": "Silahkan masukan konfirmasi password baru",
"alertLabelAddress": "Silahkan masukan nama alamat", "alertLabelAddress": "Silahkan masukan nama alamat",
"alertDetailAddress": "Silahkan masukan detail alamat" "alertDetailAddress": "Silahkan masukan detail alamat",
"alertVoucher":"Voucher tidak bisa digunakan dengan point"
} }
\ No newline at end of file
import React from 'react'; import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, TouchableOpacity, ScrollView, FlatList, Image, Alert, ActivityIndicator } from 'react-native'; import { View, Text, TextInput, StyleSheet, Button, TouchableOpacity, ScrollView, FlatList, Image, Alert, ActivityIndicator, TouchableWithoutFeedback } from 'react-native';
import { connect } from 'react-redux' import { connect } from 'react-redux'
import CheckBox from 'react-native-check-box' import CheckBox from 'react-native-check-box'
import { Card } from 'react-native-shadow-cards' import { Card } from 'react-native-shadow-cards'
...@@ -12,6 +12,7 @@ import { YellowBox } from 'react-native'; ...@@ -12,6 +12,7 @@ import { YellowBox } from 'react-native';
import session from '../function/session'; import session from '../function/session';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import MyStatusBar from './MyStatusBar'; import MyStatusBar from './MyStatusBar';
import Toast from 'react-native-tiny-toast';
YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']); YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
...@@ -474,6 +475,7 @@ class ShoppingCart extends React.Component { ...@@ -474,6 +475,7 @@ class ShoppingCart extends React.Component {
}) })
} }
render() { render() {
// console.log('tes balance poin selection') // console.log('tes balance poin selection')
// console.log(this.props.order_total + ' total belanja') // console.log(this.props.order_total + ' total belanja')
...@@ -744,83 +746,33 @@ class ShoppingCart extends React.Component { ...@@ -744,83 +746,33 @@ class ShoppingCart extends React.Component {
} }
</View> </View>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
{ <TouchableOpacity activeOpacity={1} onPress={() => {Toast.show(i18n.t('alertVoucher'))}}>
this.state.kasproPoint < this.props.order_total - parseInt(this.props.voucher.reward.value) + this.props.grabamount || this.props.order_total == 0 ? ( <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> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'white' }}>EXCELSO {i18n.t('point')}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'white' }}>EXCELSO {i18n.t('point')}</Text>
</View>
<View>
<FontAwesome name='circle-o' size={30} color={'#ccb46c'} />
</View>
</View> </View>
</Card> <View>
) : ( <FontAwesome name='circle-o' size={30} color={'#ccb46c'} />
</View>
</View>
</Card>
</TouchableOpacity>
<TouchableOpacity onPress={() => {
this.checkedSelection('point')
}}>
<Card style={{ margin: 5, padding: 10 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'grey' }}>EXCELSO {i18n.t('point')}</Text>
</View>
<View>
<CheckBox
onClick={() => {
this.checkedSelection('point')
}}
isChecked={this.state.checkedPoint}
checkedImage={<FontAwesome name='check-circle' size={30} color={'#ccb46c'} />}
unCheckedImage={<FontAwesome name='circle-o' size={30} color={'#ccb46c'} />}
/>
</View>
</View>
</Card>
</TouchableOpacity>
)
}
</View> </View>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
{ <TouchableOpacity activeOpacity={1} onPress={() => {Toast.show(i18n.t('alertVoucher'))}}>
parseInt(this.state.kasproPoint) + parseInt(this.state.kasproBalance) >= this.props.order_total - parseInt(this.props.voucher.reward.value) + this.props.grabamount && this.state.kasproBalance != 0 && this.state.kasproPoint != 0 && this.props.order_total != 0 ? ( <Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<TouchableOpacity onPress={() => { <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
this.checkedSelection('balancepoint') <View>
}}> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'white' }}>EXCELSO {i18n.t('balance')} + {i18n.t('point')}</Text>
<Card style={{ margin: 5, padding: 10 }}> </View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}> <View>
<View> <FontAwesome name='circle-o' size={30} color={'#ccb46c'} />
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: 'grey' }}>EXCELSO {i18n.t('balance')} + {i18n.t('point')}</Text> </View>
</View> </View>
<View> </Card>
<CheckBox </TouchableOpacity>
onClick={() => {
this.checkedSelection('balancepoint')
}}
isChecked={this.state.checkedBalancePoint}
checkedImage={<FontAwesome name='check-circle' size={30} color={'#ccb46c'} />}
unCheckedImage={<FontAwesome name='circle-o' size={30} color={'#ccb46c'} />}
/>
</View>
</View>
</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 {i18n.t('balance')} + {i18n.t('point')}</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