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
4ca6b8af
Commit
4ca6b8af
authored
Sep 03, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
34881b06
c1520d14
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
73 deletions
+97
-73
app.json
app.json
+4
-4
CheckVersion.js
function/CheckVersion.js
+31
-6
en.json
lib/en.json
+2
-1
id.json
lib/id.json
+2
-1
Account.js
view/Account.js
+1
-1
NewPassword.js
view/NewPassword.js
+19
-25
RatingOrder.js
view/RatingOrder.js
+5
-1
Renewal.js
view/Renewal.js
+26
-15
ResetPassword.js
view/ResetPassword.js
+7
-19
No files found.
app.json
View file @
4ca6b8af
{
"expo"
:
{
"extra"
:
{
"buildNumber"
:
"14
1
"
,
"buildNumber"
:
"14
3
"
,
"remarks"
:
""
},
...
...
@@ -15,7 +15,7 @@
"web"
],
"version"
:
"2.0.
0
"
,
"version"
:
"2.0.
1
"
,
"orientation"
:
"portrait"
,
"icon"
:
"./assets/excelso.png"
,
...
...
@@ -33,7 +33,7 @@
"ios"
:
{
"supportsTablet"
:
false
,
"bundleIdentifier"
:
"id.web.ravintola.excelsocrm"
,
"buildNumber"
:
"200
826
2200"
,
"buildNumber"
:
"200
902
2200"
,
"config"
:
{
"googleMapsApiKey"
:
"AIzaSyCvIFNvXKmBNetqPrV4VnjvF772avYbA3M"
},
...
...
@@ -44,7 +44,7 @@
},
"android"
:
{
"package"
:
"id.web.ravintola.excelsocrm"
,
"versionCode"
:
200
826
2200
,
"versionCode"
:
200
902
2200
,
"config"
:
{
"googleMaps"
:
{
"apiKey"
:
"AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo"
...
...
function/CheckVersion.js
View file @
4ca6b8af
import
Axios
from
'axios'
;
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
)
{
let
version
=
Constants
.
manifest
.
version
Axios
.
get
(
'https://excelso.ravintolavip.com/cms/v2/detail/apps-version'
).
then
(
respon
=>
{
let
version_server
=
respon
.
data
.
content5
let
msg_res
=
respon
.
data
.
content6
if
(
version_server
!==
version
)
{
if
(
compareVersion
(
version
,
version_server
)
==
-
1
)
{
Alert
.
alert
(
'Update Version'
,
msg_res
,
[
{
text
:
'Cancel'
,
onPress
:
()
=>
console
.
log
(
'Cancel Pressed'
),
text
:
'Nanti'
,
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
}
);
...
...
lib/en.json
View file @
4ca6b8af
...
...
@@ -234,5 +234,6 @@
"alertVoucher"
:
"Voucher cannot be used with point"
,
"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
lib/id.json
View file @
4ca6b8af
...
...
@@ -234,5 +234,6 @@
"alertVoucher"
:
"Voucher tidak bisa digunakan dengan point"
,
"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
view/Account.js
View file @
4ca6b8af
...
...
@@ -375,7 +375,7 @@ class Account extends React.Component {
<
Text
style
=
{{
fontSize
:
10
,
fontFamily
:
'Gotham-Light'
}}
>
{
i18n
.
t
(
'cardnumber'
)}
<
/Text
>
<
/View
>
<
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
}
<
/Text>
<
/View
>
...
...
view/NewPassword.js
View file @
4ca6b8af
...
...
@@ -121,7 +121,8 @@ class NewPassword extends React.Component {
textStyle
=
{
styles
.
spinnerTextStyle
}
/
>
<
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
:
'#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
>
...
...
@@ -145,24 +146,18 @@ class NewPassword extends React.Component {
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
secureTextEntry
=
{
true
}
/
>
<
TouchableOpacity
style
=
{{
height
:
100
}}
onPress
=
{()
=>
this
.
validation
()}
>
<
View
style
=
{{
backgroundColor
:
'#CFB368'
,
height
:
45
,
top
:
20
,
borderRadius
:
10
,
marginRight
:
50
,
marginLeft
:
50
}}
>
<
Text
style
=
{{
alignSelf
:
'center'
,
top
:
10
,
color
:
'white'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
}}
>
{
i18n
.
t
(
'submit'
)}
<
/Text
>
<
TouchableOpacity
style
=
{{
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
>
<
/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
>
...
...
@@ -183,15 +178,14 @@ const styles = StyleSheet.create({
marginTop
:
0
,
},
v_logo
:
{
flex
:
2
,
flexDirection
:
'column-reverse'
,
alignContent
:
'flex-start'
,
},
// v_logo: {
// flex: 2,
// flexDirection: 'column-reverse',
// alignContent: 'flex-start',
// },
logo
:
{
alignSelf
:
'flex-start'
,
marginTop
:
5
0
,
marginTop
:
20
0
,
width
:
290
,
height
:
290
,
bottom
:
150
,
...
...
view/RatingOrder.js
View file @
4ca6b8af
...
...
@@ -108,7 +108,11 @@ class RatingOrder extends React.Component {
return
(
<
ScrollView
style
=
{
styles
.
container
}
>
<
MyStatusBar
/>
<
Spinner
visible
=
{
this
.
state
.
spinner
}
textContent
=
{
'Loading...'
}
textStyle
=
{
styles
.
spinnerTextStyle
}
/
>
<
View
style
=
{{
flex
:
3
}}
>
<
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
>
...
...
view/Renewal.js
View file @
4ca6b8af
...
...
@@ -7,6 +7,7 @@ import i18n from 'i18n-js';
import
Toast
from
'react-native-tiny-toast'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
import
moment
from
'moment'
import
NumberFormat
from
'react-number-format'
;
class
Renewal
extends
React
.
Component
{
...
...
@@ -16,11 +17,11 @@ class Renewal extends React.Component {
current_balance
:
""
,
expired
:
""
,
card_number
:
""
,
biaya_renewal
:
"100.000"
,
renew_until
:
""
,
indicator
:
true
,
spinner
:
false
,
renew_button
:
false
hide_renew_button
:
false
,
renewal_cost
:
0
}
}
...
...
@@ -93,26 +94,34 @@ class Renewal extends React.Component {
let
balance
=
dataCard
.
kaspro_balance
let
expired
=
dataCard
.
expire_date
let
renew
=
dataCard
.
renew_until
let
renewal_cost
=
dataCard
.
renewal_cost
let
balance_replace
=
balance
.
replace
(
','
,
''
)
// cek apakah saldo sama dengan 0
if
(
balance
==
0
)
{
//kalau saldo sama dengan 0 disable renew button = true
this
.
setState
({
renewal_cost
:
renewal_cost
})
// 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
({
current_balance
:
balance
,
expired
:
expired
,
renew_until
:
renew
,
indicator
:
false
,
renew_button
:
true
hide_
renew_button
:
true
})
}
else
{
// kalau tidak renew button = false
// kalau tidak
hide
renew button = false
this
.
setState
({
current_balance
:
balance
,
expired
:
expired
,
renew_until
:
renew
,
indicator
:
false
,
renew_button
:
false
hide_
renew_button
:
false
})
}
}).
catch
(
error
=>
{
...
...
@@ -165,7 +174,7 @@ class Renewal extends React.Component {
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>
{
i18n
.
t
(
'renewalfees'
)}
<
/Text
>
<
/View
>
<
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
style
=
{
styles
.
cont_curent_balance
}
>
...
...
@@ -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
>
<
/View
>
<
/View>
{
/* <View style={styles.btn_renewal}>
<Button title="Renew" onPress={() => this._renewal()}></Button>
</View> */
}
{
/* 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
}
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
16
,
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
}}
>
{
i18n
.
t
(
'renew'
)}
<
/Text
>
<
/View
>
<
/TouchableOpacity>
}
<
/TouchableOpacity
>
}
<
/View
>
)
}
...
...
view/ResetPassword.js
View file @
4ca6b8af
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
{
BASE_URL_RESET_PASSWORD
}
from
'../model/Base_Model'
;
import
ActionType
from
'../redux/globalActionType'
;
...
...
@@ -87,12 +87,14 @@ class ResetPassword extends React.Component {
render
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
MyStatusBar
/>
<
Spinner
visible
=
{
this
.
state
.
spinner
}
textContent
=
{
'Loading...'
}
textStyle
=
{
styles
.
spinnerTextStyle
}
/
>
<
View
style
=
{{
flex
:
3
}}
>
<
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
>
...
...
@@ -111,19 +113,11 @@ class ResetPassword extends React.Component {
<
TouchableOpacity
style
=
{{
height
:
60
}}
onPress
=
{()
=>
this
.
handleEnterToken
()}
>
<
Text
style
=
{{
alignSelf
:
'center'
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
}}
>
{
i18n
.
t
(
'enterToken'
)}
<
/Text
>
<
/TouchableOpacity
>
<
View
style
=
{{
flex
:
2
}}
>
<
ImageBackground
source
=
{
require
(
'../assets/images/daun.png'
)}
style
=
{
styles
.
logo
}
>
<
/ImageBackground
>
<
/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
>
)
...
...
@@ -164,13 +158,8 @@ const styles = StyleSheet.create({
width
:
290
,
height
:
290
,
bottom
:
145
,
flexDirection
:
'column-reverse'
},
v_logo
:
{
flex
:
2
,
flexDirection
:
'column-reverse'
,
alignContent
:
'flex-start'
,
}
})
const
mapStateToProps
=
(
state
)
=>
{
...
...
@@ -198,7 +187,6 @@ const mapDispatchToProps = (dispacth) => {
})
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
ResetPassword
);
...
...
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