Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_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
clone_excelso
Commits
f959e7bc
Commit
f959e7bc
authored
Jun 16, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
fd30eff1
189f580d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
49 deletions
+56
-49
app.json
app.json
+5
-2
Login.js
view/Login.js
+14
-10
Outlets.js
view/Outlets.js
+37
-37
No files found.
app.json
View file @
f959e7bc
...
@@ -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"
:
"2006161400"
,
"config"
:
{
"googleMapsApiKey"
:
"AIzaSyCvIFNvXKmBNetqPrV4VnjvF772avYbA3M"
}
},
},
"android"
:
{
"android"
:
{
"package"
:
"id.web.ravintola.excelsocrm"
,
"package"
:
"id.web.ravintola.excelsocrm"
,
"versionCode"
:
20061
518
00
,
"versionCode"
:
20061
614
00
,
"config"
:
{
"config"
:
{
"googleMaps"
:
{
"googleMaps"
:
{
"apiKey"
:
"AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo"
"apiKey"
:
"AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo"
...
...
view/Login.js
View file @
f959e7bc
...
@@ -39,15 +39,18 @@ class Login extends React.Component {
...
@@ -39,15 +39,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
...
@@ -63,7 +66,8 @@ d } else {
...
@@ -63,7 +66,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 @
f959e7bc
...
@@ -38,24 +38,24 @@ class Outlets extends React.Component {
...
@@ -38,24 +38,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
);
...
@@ -173,31 +173,31 @@ class Outlets extends React.Component {
...
@@ -173,31 +173,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
;
...
...
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