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