Commit 99a45653 authored by Trisno's avatar Trisno

voucher tidak bisa dipakai menggunakan point

parent 9d02f0da
{
"expo": {
"extra" : {
"buildNumber" : "135",
"buildNumber" : "136",
"remarks": ""
},
......
......@@ -227,5 +227,6 @@
"alertNewPassword": "Please insert new password",
"alerConfirmNewPassword": "Please insert confirm password",
"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 @@
"alertNewPassword": "Silahkan masukan password baru",
"alerConfirmNewPassword": "Silahkan masukan konfirmasi password baru",
"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 { 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 CheckBox from 'react-native-check-box'
import { Card } from 'react-native-shadow-cards'
......@@ -12,6 +12,7 @@ import { YellowBox } from 'react-native';
import session from '../function/session';
import NumberFormat from 'react-number-format';
import MyStatusBar from './MyStatusBar';
import Toast from 'react-native-tiny-toast';
YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
......@@ -474,6 +475,7 @@ class ShoppingCart extends React.Component {
})
}
render() {
// console.log('tes balance poin selection')
// console.log(this.props.order_total + ' total belanja')
......@@ -744,8 +746,7 @@ class ShoppingCart extends React.Component {
}
</View>
<View style={{ alignItems: 'center' }}>
{
this.state.kasproPoint < this.props.order_total - parseInt(this.props.voucher.reward.value) + this.props.grabamount || this.props.order_total == 0 ? (
<TouchableOpacity activeOpacity={1} onPress={() => {Toast.show(i18n.t('alertVoucher'))}}>
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
......@@ -756,58 +757,11 @@ class ShoppingCart extends React.Component {
</View>
</View>
</Card>
) : (
<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 style={{ alignItems: 'center' }}>
{
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 ? (
<TouchableOpacity onPress={() => {
this.checkedSelection('balancepoint')
}}>
<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('balance')} + {i18n.t('point')}</Text>
</View>
<View>
<CheckBox
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>
) : (
<TouchableOpacity activeOpacity={1} onPress={() => {Toast.show(i18n.t('alertVoucher'))}}>
<Card style={{ margin: 5, padding: 10, backgroundColor: 'gray' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View>
......@@ -818,9 +772,7 @@ class ShoppingCart extends React.Component {
</View>
</View>
</Card>
)
}
</TouchableOpacity>
</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