Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
new_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
new_excelso
Commits
f9ddae3b
Commit
f9ddae3b
authored
Jun 17, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
560cf6e7
d15bcc8e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
72 deletions
+98
-72
app.json
app.json
+5
-2
AddreesDetail.js
view/AddreesDetail.js
+3
-2
CardActivation.js
view/CardActivation.js
+1
-1
ChangeLanguage.js
view/ChangeLanguage.js
+5
-4
Login.js
view/Login.js
+14
-10
Outlets.js
view/Outlets.js
+37
-37
TransactionHistory.js
view/TransactionHistory.js
+33
-16
No files found.
app.json
View file @
f9ddae3b
...
@@ -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"
:
20061
518
00
,
"versionCode"
:
20061
709
00
,
"config"
:
{
"config"
:
{
"googleMaps"
:
{
"googleMaps"
:
{
"apiKey"
:
"AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo"
"apiKey"
:
"AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo"
...
...
view/AddreesDetail.js
View file @
f9ddae3b
...
@@ -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
:
{
...
...
view/CardActivation.js
View file @
f9ddae3b
...
@@ -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
>
...
...
view/ChangeLanguage.js
View file @
f9ddae3b
...
@@ -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
:
1
2
,
fontFamily
:
'Gotham-Black'
}}
>
Save
<
/Text
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
1
6
,
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
:
1
5
,
borderRadius
:
1
0
,
padding
:
20
,
//
padding: 20,
alignItems
:
'center'
,
alignItems
:
'center'
,
justifyContent
:
'center'
justifyContent
:
'center'
},
},
...
...
view/Login.js
View file @
f9ddae3b
...
@@ -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'
);
}
}
}
}
...
...
view/Outlets.js
View file @
f9ddae3b
...
@@ -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
;
...
...
view/TransactionHistory.js
View file @
f9ddae3b
...
@@ -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
>
)
))
))
))
))
)
:
(
)
:
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment