Commit 4ca6b8af authored by Trisno's avatar Trisno
parents 34881b06 c1520d14
{ {
"expo": { "expo": {
"extra" : { "extra" : {
"buildNumber" : "141", "buildNumber" : "143",
"remarks": "" "remarks": ""
}, },
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"web" "web"
], ],
"version": "2.0.0", "version": "2.0.1",
"orientation": "portrait", "orientation": "portrait",
"icon": "./assets/excelso.png", "icon": "./assets/excelso.png",
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
"ios": { "ios": {
"supportsTablet": false, "supportsTablet": false,
"bundleIdentifier": "id.web.ravintola.excelsocrm", "bundleIdentifier": "id.web.ravintola.excelsocrm",
"buildNumber": "2008262200", "buildNumber": "2009022200",
"config": { "config": {
"googleMapsApiKey": "AIzaSyCvIFNvXKmBNetqPrV4VnjvF772avYbA3M" "googleMapsApiKey": "AIzaSyCvIFNvXKmBNetqPrV4VnjvF772avYbA3M"
}, },
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
}, },
"android": { "android": {
"package": "id.web.ravintola.excelsocrm", "package": "id.web.ravintola.excelsocrm",
"versionCode": 2008262200, "versionCode": 2009022200,
"config": { "config": {
"googleMaps": { "googleMaps": {
"apiKey": "AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo" "apiKey": "AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo"
......
import Axios from 'axios'; import Axios from 'axios';
import Constants from 'expo-constants'; import Constants from 'expo-constants';
import { Alert } from 'react-native'; import { Alert, Linking } from 'react-native';
function compareVersion(v1, v2) {
if (typeof v1 !== 'string') return false;
if (typeof v2 !== 'string') return false;
v1 = v1.split('.');
v2 = v2.split('.');
const k = Math.min(v1.length, v2.length);
for (let i = 0; i < k; ++ i) {
v1[i] = parseInt(v1[i], 10);
v2[i] = parseInt(v2[i], 10);
if (v1[i] > v2[i]) return 1;
if (v1[i] < v2[i]) return -1;
}
return v1.length == v2.length ? 0: (v1.length < v2.length ? -1 : 1);
}
export default function CheckVersion(navigation) { export default function CheckVersion(navigation) {
let version = Constants.manifest.version let version = Constants.manifest.version
Axios.get('https://excelso.ravintolavip.com/cms/v2/detail/apps-version').then(respon => { Axios.get('https://excelso.ravintolavip.com/cms/v2/detail/apps-version').then(respon => {
let version_server = respon.data.content5 let version_server = respon.data.content5
let msg_res = respon.data.content6 let msg_res = respon.data.content6
if (version_server !== version) { if (compareVersion(version, version_server) == -1) {
Alert.alert( Alert.alert(
'Update Version', 'Update Version',
msg_res, msg_res,
[ [
{ {
text: 'Cancel', text: 'Nanti',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel' style: 'cancel'
}, },
{ text: 'OK', onPress: () => navigation.navigate('UpdateVersion') } {
text: 'Update', onPress: () => {
if (Platform.OS === 'ios') {
Linking.openURL('https://apps.apple.com/id/app/excelso/id1434669847')
} else {
Linking.openURL('https://play.google.com/store/apps/details?id=id.web.ravintola.excelsocrm')
}
}
}
], ],
{ cancelable: false } { cancelable: false }
); );
......
...@@ -234,5 +234,6 @@ ...@@ -234,5 +234,6 @@
"alertVoucher":"Voucher cannot be used with point", "alertVoucher":"Voucher cannot be used with point",
"alertemailblank":"Email cannot be empty", "alertemailblank":"Email cannot be empty",
"waCallCenter":"Hello, I have a problem with trans no" "waCallCenter":"Hello, I have a problem with trans no",
"renewal_notEnoughBalance": "You don't have enough balance"
} }
\ No newline at end of file
...@@ -234,5 +234,6 @@ ...@@ -234,5 +234,6 @@
"alertVoucher":"Voucher tidak bisa digunakan dengan point", "alertVoucher":"Voucher tidak bisa digunakan dengan point",
"alertemailblank":"Email tidak boleh kosong", "alertemailblank":"Email tidak boleh kosong",
"waCallCenter":"Halo, saya ada masalah dengan trans no" "waCallCenter":"Halo, saya ada masalah dengan trans no",
"renewal_notEnoughBalance": "Saldo anda tidak mencukupi."
} }
\ No newline at end of file
...@@ -375,7 +375,7 @@ class Account extends React.Component { ...@@ -375,7 +375,7 @@ class Account extends React.Component {
<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', color: this.state.is_expired ? "#d34343" : "" }}> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light', color: this.state.is_expired ? "#d34343" : "#333333" }}>
{i18n.t('expired')} {this.state.expire_date} {i18n.t('expired')} {this.state.expire_date}
</Text> </Text>
</View> </View>
......
...@@ -121,7 +121,8 @@ class NewPassword extends React.Component { ...@@ -121,7 +121,8 @@ class NewPassword extends React.Component {
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> />
<View style={{ flex: 3 }}> <View style={{ flex: 3 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 20 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 20}}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('email')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('email')}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 18, textAlign: 'center', margin: 3, marginBottom: 15 }}>{this.props.email}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 18, textAlign: 'center', margin: 3, marginBottom: 15 }}>{this.props.email}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('token')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('token')}</Text>
...@@ -145,24 +146,18 @@ class NewPassword extends React.Component { ...@@ -145,24 +146,18 @@ class NewPassword extends React.Component {
caretHidden={this.state.caretHidden} caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})} onFocus={() => this.setState({caretHidden: false})}
secureTextEntry={true} /> secureTextEntry={true} />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.validation()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}> <TouchableOpacity style={{
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('submit')}</Text> marginBottom: 50, top: 20, marginRight: 50, marginLeft: 50 }}
onPress={() => this.validation()} >
<View style={{ backgroundColor: '#CFB368', height: 45, paddingVertical:10, borderRadius: 10 }}>
<Text style={{ alignSelf: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('submit')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View>
</View>
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={styles.v_logo}>
<View style={{ flex: 1, alignSelf: 'flex-start' }}>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo} />
</View>
<View style={{ flex: 1 }}>
</View>
</View>
<View style={{ flex: 0.5 }}>
<View style={{flex:2}}>
<ImageBackground source={require('../assets/images/daun.png')} style={styles.logo}></ImageBackground>
</View>
</View> </View>
</View> </View>
</View> </View>
...@@ -183,15 +178,14 @@ const styles = StyleSheet.create({ ...@@ -183,15 +178,14 @@ const styles = StyleSheet.create({
marginTop: 0, marginTop: 0,
}, },
// v_logo: {
v_logo: { // flex: 2,
flex: 2, // flexDirection: 'column-reverse',
flexDirection: 'column-reverse', // alignContent: 'flex-start',
alignContent: 'flex-start', // },
},
logo: { logo: {
alignSelf: 'flex-start', alignSelf: 'flex-start',
marginTop: 50, marginTop: 200,
width: 290, width: 290,
height: 290, height: 290,
bottom: 150, bottom: 150,
......
...@@ -108,7 +108,11 @@ class RatingOrder extends React.Component { ...@@ -108,7 +108,11 @@ class RatingOrder extends React.Component {
return ( return (
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
<MyStatusBar /> <MyStatusBar />
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<View style={{ flex: 3 }}> <View style={{ flex: 3 }}>
<View style={{ height: 100, justifyContent: 'center' }}> <View style={{ height: 100, justifyContent: 'center' }}>
<Text style={{ margin: 20, fontFamily: 'Gotham-Light', fontSize: 14, color: '#838383' }}>{i18n.t('reviewText')} <Text style={{ color: 'red' }}>{this.state.detail_trans.trans_type_display}</Text> {i18n.t('reviewText2')} {this.state.outlet} {i18n.t('reviewText3')} <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center', color: '#838383' }}>{moment(this.state.detail_trans.trans_time).format('DD MMMM YYYY HH:mm:ss')}</Text> </Text> <Text style={{ margin: 20, fontFamily: 'Gotham-Light', fontSize: 14, color: '#838383' }}>{i18n.t('reviewText')} <Text style={{ color: 'red' }}>{this.state.detail_trans.trans_type_display}</Text> {i18n.t('reviewText2')} {this.state.outlet} {i18n.t('reviewText3')} <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center', color: '#838383' }}>{moment(this.state.detail_trans.trans_time).format('DD MMMM YYYY HH:mm:ss')}</Text> </Text>
......
...@@ -7,6 +7,7 @@ import i18n from 'i18n-js'; ...@@ -7,6 +7,7 @@ import i18n from 'i18n-js';
import Toast from 'react-native-tiny-toast'; import Toast from 'react-native-tiny-toast';
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
import moment from 'moment' import moment from 'moment'
import NumberFormat from 'react-number-format';
class Renewal extends React.Component { class Renewal extends React.Component {
...@@ -16,11 +17,11 @@ class Renewal extends React.Component { ...@@ -16,11 +17,11 @@ class Renewal extends React.Component {
current_balance: "", current_balance: "",
expired: "", expired: "",
card_number: "", card_number: "",
biaya_renewal: "100.000",
renew_until: "", renew_until: "",
indicator: true, indicator: true,
spinner: false, spinner: false,
renew_button: false hide_renew_button: false,
renewal_cost: 0
} }
} }
...@@ -93,26 +94,34 @@ class Renewal extends React.Component { ...@@ -93,26 +94,34 @@ class Renewal extends React.Component {
let balance = dataCard.kaspro_balance let balance = dataCard.kaspro_balance
let expired = dataCard.expire_date let expired = dataCard.expire_date
let renew = dataCard.renew_until let renew = dataCard.renew_until
let renewal_cost = dataCard.renewal_cost
let balance_replace = balance.replace(',','')
// cek apakah saldo sama dengan 0 this.setState({
if (balance == 0) { renewal_cost : renewal_cost
//kalau saldo sama dengan 0 disable renew button = true })
// cek apakah saldo kurang dari renewal_cost
if (balance_replace < this.state.renewal_cost) {
//kalau saldo sama kurang dari renewal cost disable renew button = true
this.setState({ this.setState({
current_balance: balance, current_balance: balance,
expired: expired, expired: expired,
renew_until: renew, renew_until: renew,
indicator: false, indicator: false,
renew_button: true hide_renew_button: true
}) })
} else { } else {
// kalau tidak renew button = false // kalau tidak hide renew button = false
this.setState({ this.setState({
current_balance: balance, current_balance: balance,
expired: expired, expired: expired,
renew_until: renew, renew_until: renew,
indicator: false, indicator: false,
renew_button: false hide_renew_button: false
}) })
} }
}).catch(error => { }).catch(error => {
...@@ -165,7 +174,7 @@ class Renewal extends React.Component { ...@@ -165,7 +174,7 @@ class Renewal extends React.Component {
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('renewalfees')}</Text> <Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('renewalfees')}</Text>
</View> </View>
<View style={styles.value_current_balance}> <View style={styles.value_current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.biaya_renewal}</Text> <NumberFormat decimalScale={0} value={this.state.renewal_cost} renderText={value => <Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View> </View>
</View> </View>
<View style={styles.cont_curent_balance}> <View style={styles.cont_curent_balance}>
...@@ -185,16 +194,18 @@ class Renewal extends React.Component { ...@@ -185,16 +194,18 @@ class Renewal extends React.Component {
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: 'gray' }}>{this.state.renew_until}</Text> <Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: 'gray' }}>{this.state.renew_until}</Text>
</View> </View>
</View> </View>
{/* <View style={styles.btn_renewal}>
<Button title="Renew" onPress={() => this._renewal()}></Button>
</View> */}
{/* cek tombol berdasarkan state renew_button */} {/* cek tombol berdasarkan state renew_button */}
{this.state.renew_button == true ? (null) : <TouchableOpacity onPress={() => this._handleRenewal()}> {this.state.hide_renew_button == true ?
<View style={{marginTop: 30}} >
<Text style={{ color: 'red', fontSize: 16, textAlign: 'center', fontFamily: 'Gotham-Black' }}>{i18n.t('renewal_notEnoughBalance')}</Text>
</View>
: <TouchableOpacity onPress={() => this._handleRenewal()}>
<View style={styles.button}> <View style={styles.button}>
<Text style={{ color: 'white', fontSize: 16, textAlign: 'center', fontFamily: 'Gotham-Black' }}>{i18n.t('renew')}</Text> <Text style={{ color: 'white', fontSize: 16, textAlign: 'center', fontFamily: 'Gotham-Black' }}>{i18n.t('renew')}</Text>
</View> </View>
</TouchableOpacity>} </TouchableOpacity>
}
</View> </View>
) )
} }
......
import React from 'react'; import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, Alert, Image, TouchableOpacity } from 'react-native'; import { View, Text, TextInput, StyleSheet, Button, Alert, Image, TouchableOpacity,ImageBackground } from 'react-native';
import Axios from 'axios'; import Axios from 'axios';
import { BASE_URL_RESET_PASSWORD } from '../model/Base_Model'; import { BASE_URL_RESET_PASSWORD } from '../model/Base_Model';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
...@@ -87,12 +87,14 @@ class ResetPassword extends React.Component { ...@@ -87,12 +87,14 @@ class ResetPassword extends React.Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<MyStatusBar /> <MyStatusBar />
<Spinner <Spinner
visible={this.state.spinner} visible={this.state.spinner}
textContent={'Loading...'} textContent={'Loading...'}
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> />
<View style={{ flex: 3 }}> <View style={{ flex: 3 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}> <View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('email')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('email')}</Text>
...@@ -111,19 +113,11 @@ class ResetPassword extends React.Component { ...@@ -111,19 +113,11 @@ class ResetPassword extends React.Component {
<TouchableOpacity style={{ height: 60 }} onPress={() => this.handleEnterToken()}> <TouchableOpacity style={{ height: 60 }} onPress={() => this.handleEnterToken()}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('enterToken')}</Text> <Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('enterToken')}</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{flex:2}}>
<ImageBackground source={require('../assets/images/daun.png')} style={styles.logo}>
</ImageBackground>
</View> </View>
</View> </View>
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={styles.v_logo}>
<View style={{ flex: 1, alignSelf: 'flex-start' }}>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo}></Image>
</View>
<View style={{ flex: 1 }}>
</View>
</View>
<View style={{ flex: 0.5 }}>
</View>
</View> </View>
</View> </View>
) )
...@@ -164,13 +158,8 @@ const styles = StyleSheet.create({ ...@@ -164,13 +158,8 @@ const styles = StyleSheet.create({
width: 290, width: 290,
height: 290, height: 290,
bottom: 145, bottom: 145,
flexDirection:'column-reverse'
}, },
v_logo: {
flex: 2,
flexDirection: 'column-reverse',
alignContent: 'flex-start',
}
}) })
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
...@@ -198,7 +187,6 @@ const mapDispatchToProps = (dispacth) => { ...@@ -198,7 +187,6 @@ const mapDispatchToProps = (dispacth) => {
}) })
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ResetPassword); export default connect(mapStateToProps, mapDispatchToProps)(ResetPassword);
......
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