Commit f9ddae3b authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo
parents 560cf6e7 d15bcc8e
......@@ -26,11 +26,14 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "id.web.ravintola.excelsocrm",
"buildNumber": "2006151800"
"buildNumber": "2006170900",
"config": {
"googleMapsApiKey": "AIzaSyCvIFNvXKmBNetqPrV4VnjvF772avYbA3M"
}
},
"android": {
"package": "id.web.ravintola.excelsocrm",
"versionCode": 2006151800,
"versionCode": 2006170900,
"config": {
"googleMaps": {
"apiKey": "AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo"
......
......@@ -3,7 +3,7 @@ import { View, Text, TextInput, StyleSheet, Button, Platform, Dimensions, Alert,
import * as Device from 'expo-device';
import * as Permissions from 'expo-permissions';
import * as Location from 'expo-location';
import MapView, { Marker } from 'react-native-maps';
import MapView, { PROVIDER_GOOGLE, Marker } from 'react-native-maps';
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import { connect } from 'react-redux';
import Axios from 'axios';
......@@ -187,6 +187,7 @@ class AddreesDetail extends React.Component {
loadingEnabled={true}
showsUserLocation={true}
showsScale={true}
provider={PROVIDER_GOOGLE}
style={styles.cont_google_map}>
<MapView.Marker
coordinate={{
......@@ -246,6 +247,7 @@ class AddreesDetail extends React.Component {
</View>
</TouchableOpacity>
</View>
<View style={{ height: 80}}></View>
</View>
</View>
</ScrollView>
......@@ -259,7 +261,6 @@ const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffff'
},
header: {
......
......@@ -183,7 +183,7 @@ class CardActivation extends React.Component {
<View style={styles.button}>
<TouchableOpacity onPress={() => this.handleActivate()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368', margin: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>ACTIVATE</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center' }}>ACTIVATE</Text>
</View>
</TouchableOpacity>
</View>
......
......@@ -127,7 +127,7 @@ class Language extends React.Component {
<TouchableOpacity onPress={() => this.props.navigation.goBack()}>
<View style={styles.button}>
<Text style={{ color: 'white', fontSize: 12, fontFamily: 'Gotham-Black' }}>Save</Text>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>Save</Text>
</View>
</TouchableOpacity>
</View>
......@@ -167,12 +167,13 @@ const styles = StyleSheet.create({
marginLeft: 20
},
button: {
flex: 0.2,
// flex: 0.2,
height: 40,
backgroundColor: '#CFB368',
marginTop: 20,
marginHorizontal: 80,
borderRadius: 15,
padding: 20,
borderRadius: 10,
// padding: 20,
alignItems: 'center',
justifyContent: 'center'
},
......
......@@ -40,15 +40,18 @@ class Login extends React.Component {
}
_getDeviceInfo = async () => {
let { status } = await Permissions.getAsync(Permissions.NOTIFICATIONS);
if (status !== 'granted') {
// Alert.alert('Akses tidak dizinkan!')
Toast.show("Failed to get push token for push notification!", ToastAndroid.SHORT)
} else if (Device.osName == 'Android' && !Device.isDevice) {
// Alert.alert('Silahkan anda coba di real Device')
Toast.show("Silahkan anda coba di real Device", ToastAndroid.SHORT)
d } else {
if (Constants.isDevice) {
const { status: existingStatus } = await Permissions.getAsync(Permissions.NOTIFICATIONS);
let finalStatus = existingStatus;
if (existingStatus !== 'granted') {
const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
finalStatus = status;
}
if (finalStatus !== 'granted') {
Toast.show('Failed to get push token for push notification!');
return;
}
let fb_token = await Notifications.getExpoPushTokenAsync();
let device_id = Constants.deviceId
let os_name = Device.osName
......@@ -64,7 +67,8 @@ d } else {
}
// console.log(deviceInfoProps);
this.props.setDeviceInfo(deviceInfoProps)
} else {
Toast.show('Must use physical device for Push Notifications');
}
}
......
......@@ -40,24 +40,24 @@ class Outlets extends React.Component {
componentDidMount() {
this._getOutletClosest()
// this._getOutletClosest()
this.OrderedList()
this._getPermissions()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true,
})
this._getOutletClosest()
this.OrderedList()
this._getPermissions()
});
// this._unsubscribe = this.props.navigation.addListener('focus', () => {
// this.setState({
// indicator: true,
// })
// // this._getOutletClosest()
// this.OrderedList()
// this._getPermissions()
// });
}
componentWillUnmount() {
this._unsubscribe()
}
// componentWillUnmount() {
// this._unsubscribe()
// }
_getPermissions = async () => {
let { status } = await Permissions.askAsync(Permissions.LOCATION);
......@@ -175,31 +175,31 @@ class Outlets extends React.Component {
})
}
_getOutletClosest() {
let params = {
session_id: this.props.session_id,
lat: this.props.lat,
long: this.props.long
}
// console.log(params);
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_closest', params).then(res => {
let outletName = res.data.data.outlet_name
this.setState({
// indicator: false,
data_name: outletName
})
// console.log("INI ADALAH RESPON : + " + JSON.stringify(res))
// console.log("INI DATANYA NAME : " + outletName)
}).catch(error => {
const { navigation } = this.props
let response = error.response.data
session(response, navigation)
Alert.alert(response.msg);
})
}
// _getOutletClosest() {
// let params = {
// session_id: this.props.session_id,
// lat: this.props.lat,
// long: this.props.long
// }
// // console.log(params);
// Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_closest', params).then(res => {
// let outletName = res.data.data.outlet_name
// this.setState({
// // indicator: false,
// data_name: outletName
// })
// // console.log("INI ADALAH RESPON : + " + JSON.stringify(res))
// // console.log("INI DATANYA NAME : " + outletName)
// }).catch(error => {
// const { navigation } = this.props
// let response = error.response.data
// session(response, navigation)
// Alert.alert(response.msg);
// })
// }
toRad(value) {
return value * Math.PI / 180;
......
......@@ -88,27 +88,44 @@ class TransactionHistory extends React.Component {
this.state.history_list.map((item) => (
item.transactions.map((i, k) => (
<TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.outlet}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12, margin: 2 }}>{i.trans_type_display}</Text>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginVertical: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 12, textAlign: 'center', paddingHorizontal: 5 }}>Lihat Detail Pemesanan</Text>
i.type == 2 ? (
<TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.outlet}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12, margin: 2 }}>{i.trans_type_display}</Text>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginVertical: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 12, textAlign: 'center', paddingHorizontal: 5 }}>Lihat Detail Pemesanan</Text>
</View>
</TouchableOpacity>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{i.trans_status_display}</Text>
</View>
</TouchableOpacity>
</View>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{i.trans_status_display}</Text>
</View>
</TouchableOpacity>
) : (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}></Text>
</View>
</View>
</View>
</View>
</View>
</TouchableOpacity>
)
))
))
) : (
......
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