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
2b748105
Commit
2b748105
authored
Jun 18, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set base url
parent
68b7aeb4
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
161 additions
and
214 deletions
+161
-214
Base_Model.js
model/Base_Model.js
+2
-21
globalActionType.js
redux/globalActionType.js
+1
-0
globalReducer.js
redux/globalReducer.js
+1
-0
Account.js
view/Account.js
+9
-5
AddreesDetail.js
view/AddreesDetail.js
+7
-8
Auth.js
view/Auth.js
+2
-0
ChangePassword.js
view/ChangePassword.js
+3
-2
DeliveryAddrees.js
view/DeliveryAddrees.js
+6
-60
Home.js
view/Home.js
+4
-7
MenuSelection.js
view/MenuSelection.js
+3
-24
OrderDetail.js
view/OrderDetail.js
+6
-3
OrderHistory.js
view/OrderHistory.js
+3
-2
Outlets.js
view/Outlets.js
+4
-47
ProfilePage.js
view/ProfilePage.js
+2
-1
Renewal.js
view/Renewal.js
+5
-5
RewardDetail.js
view/RewardDetail.js
+2
-1
RewardSelect.js
view/RewardSelect.js
+2
-1
RewardsList.js
view/RewardsList.js
+4
-2
TopUpInfo.js
view/TopUpInfo.js
+14
-3
TransactionHistory.js
view/TransactionHistory.js
+3
-13
TransferBalance.js
view/TransferBalance.js
+5
-3
UseBalance.js
view/UseBalance.js
+7
-6
setBaseUrl.js
view/setBaseUrl.js
+66
-0
No files found.
model/Base_Model.js
View file @
2b748105
...
...
@@ -4,24 +4,5 @@ export const BASE_URL_REGISTER_CONFIRM ='https://excelsocrm.ravintoladev.com/crm
export
const
BASE_URL_GET_ENUM
=
'https://excelsocrm.ravintoladev.com/crm/v2/auth/register_get_enum'
;
export
const
BASE_URL_GET_CARAOUSEL
=
'https://excelsocrm.ravintoladev.com/cms/v2/list/promotions-carousel'
;
export
const
BASE_URL_RESET_PASSWORD
=
'https://excelsocrm.ravintoladev.com/crm/v2/auth/forgot_password'
;
export
const
BASE_URL_CHANGE_PASSWORD
=
'https://excelsocrm.ravintoladev.com/crm/v2/auth/change_password'
;
//
export const BASE_URL_CHANGE_PASSWORD = 'https://excelsocrm.ravintoladev.com/crm/v2/auth/change_password';
export
const
BASE_URL_NEW_PASSWORD
=
'https://excelsocrm.ravintoladev.com/crm/v2/auth/reset_password'
;
\ No newline at end of file
// =======
// export const BASE_URL_REGISTER = 'http://192.168.2.188:8000/crm/v2/auth/register';
// export const BASE_URL_REGISTER_CONFIRM ='http://192.168.2.188:8000/crm/v2/auth/register_confirm';
// export const BASE_URL_GET_ENUM = 'http://192.168.2.188:8000/crm/v2/auth/register_get_enum';
// export const BASE_URL_GET_CARAOUSEL = 'http://192.168.2.188:8000/cms/v2/list/promotions-carousel';
// export const BASE_URL_RESET_PASSWORD = 'http://192.168.2.188:8000/crm/v2/auth/forgot_password';
// export const BASE_URL_CHANGE_PASSWORD = 'http://192.168.2.188:8000/crm/v2/auth/change_password';
// // export const BASE_URL_NEW_PASSWORD = 'http://192.168.2.188:8000/crm/v2/auth/reset_password';
// >>>>>>> b5ca15bca6f7d685a79d0bf93fb703568fc68c60
// export const BASE_URL_LOGIN = 'https://192.168.2.187:8000/crm/v2/auth/login';
// export const BASE_URL_REGISTER = 'https://192.168.2.187:8000/crm/v2/auth/register';
// export const BASE_URL_REGISTER_CONFIRM ='https://192.168.2.187:8000/crm/v2/auth/register_confirm';
// export const BASE_URL_GET_ENUM = 'https://192.168.2.188:8000/crm/v2/auth/register_get_enum';
// export const BASE_URL_GET_CARAOUSEL = 'https://192.168.2.187:8000/cms/v2/list/promotions-carousel';
// export const BASE_URL_RESET_PASSWORD = 'https://192.168.2.187:8000/crm/v2/auth/forgot_password';
// export const BASE_URL_CHANGE_PASSWORD = 'https://192.168.2.187:8000/crm/v2/auth/change_password';
// export const BASE_URL_NEW_PASSWORD = 'https://192.168.2.187:8000/crm/v2/auth/reset_password';
\ No newline at end of file
redux/globalActionType.js
View file @
2b748105
...
...
@@ -43,6 +43,7 @@ const ActionType = {
SET_REEDEM
:
'SET_REEDEM'
,
REMOVE_VOUCHER
:
'REMOVE_VOUCHER'
,
SET_CHANGE_RESET_PASSWORD
:
'SET_CHANGE_RESET_PASSWORD'
,
//set url
SET_BASE_URL
:
'SET_BASE_URL'
}
...
...
redux/globalReducer.js
View file @
2b748105
...
...
@@ -89,6 +89,7 @@ const globalState = {
outlet_detailadress
:
''
,
isSubmitResetPassword
:
false
,
BASE_URL
:
'https://excelsocrm.ravintoladev.com/'
}
...
...
view/Account.js
View file @
2b748105
...
...
@@ -44,7 +44,8 @@ class Account extends React.Component {
my_lat
:
0
,
my_long
:
0
,
full_name
:
''
,
indicator
:
true
indicator
:
true
,
clickSettings
:
0
,
}
}
...
...
@@ -111,7 +112,7 @@ class Account extends React.Component {
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
const
dataCard
=
res
.
data
let
email
=
dataCard
.
email
let
point
=
dataCard
.
kaspro_point
...
...
@@ -190,11 +191,11 @@ class Account extends React.Component {
handleSettings
()
{
if
(
this
.
state
.
clickSettings
==
8
)
{
this
.
props
.
navigation
.
navigate
(
'Setting
sScreen
'
)
if
(
this
.
state
.
clickSettings
==
1
)
{
this
.
props
.
navigation
.
navigate
(
'Setting'
)
this
.
setState
({
clickSettings
:
0
})
}
else
{
new_count
=
this
.
state
.
clickSettings
let
new_count
=
this
.
state
.
clickSettings
this
.
setState
({
clickSettings
:
new_count
+
1
})
}
}
...
...
@@ -405,11 +406,13 @@ class Account extends React.Component {
}
<
View
style
=
{{
flex
:
1
,
marginBottom
:
10
}}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
handleSettings
()}
>
{
Platform
.
OS
===
'ios'
?
(
<
Text
style
=
{{
color
:
'grey'
,
fontSize
:
12
,
textAlign
:
'center'
}}
>
Version
{
Constants
.
manifest
.
version
}
Build
{
Constants
.
manifest
.
ios
.
buildNumber
}
<
/Text
>
)
:
(
<
Text
style
=
{{
color
:
'grey'
,
fontSize
:
12
,
textAlign
:
'center'
}}
>
Version
{
Constants
.
manifest
.
version
}
Build
{
Constants
.
manifest
.
android
.
versionCode
}
<
/Text
>
)}
<
/TouchableOpacity
>
<
/View
>
<
/ScrollView
>
...
...
@@ -530,6 +533,7 @@ const mapStateToProps = (state) => {
set_card
:
state
.
set_card
,
in_payment
:
state
.
in_payment
,
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
,
}
}
...
...
view/AddreesDetail.js
View file @
2b748105
...
...
@@ -11,6 +11,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
import
{
MaterialCommunityIcons
,
Ionicons
}
from
'@expo/vector-icons'
;
import
ActionType
from
'../redux/globalActionType'
;
import
i18n
from
'i18n-js'
;
import
session
from
'../function/session'
;
class
AddreesDetail
extends
React
.
Component
{
...
...
@@ -126,7 +127,7 @@ class AddreesDetail extends React.Component {
}
// console.log(params)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/member/set_address'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/member/set_address'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
'Berhasil'
,
'Berhasil menambahkan Alamat !'
...
...
@@ -222,21 +223,18 @@ class AddreesDetail extends React.Component {
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
}}
>
{
this
.
state
.
postalCode
}
<
/Text
>
<
/View
>
)}
<
View
style
=
{{
flex
:
1
}}
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
field_name_addrees
}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
"#ccb46c"
,
textAlign
:
'center'
,
fontSize
:
18
}}
>
{
i18n
.
t
(
'label'
)}
<
/Text
>
<
TextInput
style
=
{{
height
:
40
,
borderWidth
:
1
,
padding
:
5
,
flex
:
1
,
margin
:
10
,
borderRadius
:
10
,
borderColor
:
'grey
'
}}
onChangeText
=
{(
name
)
=>
this
.
setState
({
name
})}
/
>
<
TextInput
style
=
{{
color
:
'grey'
,
fontFamily
:
'Gotham-Black'
,
height
:
40
,
borderWidth
:
1
,
padding
:
5
,
flex
:
1
,
margin
:
10
,
borderRadius
:
10
,
borderColor
:
'grey'
,
textAlign
:
'center
'
}}
onChangeText
=
{(
name
)
=>
this
.
setState
({
name
})}
/
>
<
/View
>
<
View
style
=
{
styles
.
field_detail_addrees
}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
"#ccb46c"
,
textAlign
:
'center'
,
fontSize
:
18
}}
>
{
i18n
.
t
(
'detail'
)}
<
/Text
>
<
TextInput
style
=
{{
height
:
15
0
,
borderWidth
:
1
,
padding
:
5
,
flex
:
1
,
margin
:
10
,
borderRadius
:
10
,
borderColor
:
'grey'
}}
style
=
{{
color
:
'grey'
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'center'
,
height
:
12
0
,
borderWidth
:
1
,
padding
:
5
,
flex
:
1
,
margin
:
10
,
borderRadius
:
10
,
borderColor
:
'grey'
}}
onChangeText
=
{(
description
)
=>
this
.
setState
({
description
})}
numberOfLines
=
{
10
}
multiline
=
{
true
}
/
>
...
...
@@ -248,7 +246,7 @@ class AddreesDetail extends React.Component {
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
height
:
8
0
}}
><
/View
>
<
View
style
=
{{
height
:
2
0
}}
><
/View
>
<
/View
>
<
/View
>
<
/ScrollView
>
...
...
@@ -301,7 +299,6 @@ const styles = StyleSheet.create({
},
field_detail_addrees
:
{
flexDirection
:
'column'
,
top
:
40
,
},
...
...
@@ -317,6 +314,8 @@ const mapStateToProps = (state) => {
session_id
:
state
.
session_id
,
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
,
}
}
...
...
view/Auth.js
View file @
2b748105
...
...
@@ -56,6 +56,7 @@ import RatingOrder from './RatingOrder';
import
UseBalance
from
'./UseBalance'
;
import
PaymentCode
from
'./PaymentCode'
;
import
UpdateVersion
from
'./UpdateVersion'
;
import
SettingUrl
from
'./setBaseUrl'
;
enableScreens
();
...
...
@@ -381,6 +382,7 @@ class Auth extends React.Component {
},
title
:
'RENEWAL'
}}
/
>
<
Stack
.
Screen
name
=
"Account"
component
=
{
Account
}
/
>
<
Stack
.
Screen
name
=
"Setting"
component
=
{
SettingUrl
}
/
>
<
Stack
.
Screen
name
=
"Login"
component
=
{
Login
}
options
=
{{
headerShown
:
false
}}
/
>
<
Stack
.
Screen
name
=
"Transfer Balance"
component
=
{
TransferBalance
}
options
=
{{
headerStyle
:
{
backgroundColor
:
"#CFB368"
},
...
...
view/ChangePassword.js
View file @
2b748105
...
...
@@ -28,7 +28,7 @@ class ChangePassword extends React.Component {
"password"
:
this
.
state
.
Password
,
"password_confirmation"
:
this
.
state
.
Password_confirmation
}
Axios
.
post
(
BASE_URL_CHANGE_PASSWORD
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/auth/change_password'
,
params
).
then
(
res
=>
{
this
.
props
.
navigation
.
navigate
(
'Profile'
);
}).
catch
(
error
=>
{
console
.
log
(
error
)
...
...
@@ -159,7 +159,8 @@ const styles = StyleSheet.create({
const
mapStateToProps
=
(
state
)
=>
{
return
{
session_id
:
state
.
session_id
,
language
:
state
.
language
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
}
}
...
...
view/DeliveryAddrees.js
View file @
2b748105
...
...
@@ -41,7 +41,7 @@ class DeliveryAddrees extends React.Component {
}
// console.log(params)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/member/get_address'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/member/get_address'
,
params
).
then
(
res
=>
{
const
dataAlamat
=
res
.
data
.
data
;
console
.
log
(
"INI DATA :"
+
JSON
.
stringify
(
dataAlamat
))
let
address
=
[]
...
...
@@ -82,7 +82,7 @@ class DeliveryAddrees extends React.Component {
// console.log("INI PRAMETER NYA : " + JSON.stringify(params))
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
// this.setState({
// grabamount: res.data.data.amount,
...
...
@@ -162,7 +162,7 @@ class DeliveryAddrees extends React.Component {
address_id
:
id
,
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
let
setGrabProps
=
{
// grabdestination: this.state.grabdestination,
...
...
@@ -291,8 +291,6 @@ class DeliveryAddrees extends React.Component {
keyExtractor
=
{
item
=>
item
.
id
}
/
>
)}
<
/View
>
<
/ScrollView
>
<
/View
>
...
...
@@ -343,7 +341,8 @@ const mapStateToProps = (state) => {
session_id
:
state
.
session_id
,
addressId
:
state
.
addressId
,
language
:
state
.
language
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
}
}
...
...
@@ -398,56 +397,3 @@ const mapDispatchToProps = (dispacth) => {
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
DeliveryAddrees
)
\ No newline at end of file
{
/* <TouchableOpacity onPress={() => this.onSave(item.address, item.id)}>
<View style={{ margin: 5, }}>
<Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text>
</View>
<Text style={{ margin: 5 }}>
{item.address}
</Text>
</TouchableOpacity> */
}
// <View style={styles.searchBar}>
// <View style={{ height: 50, borderWidth: 1, borderColor: 'black', borderRadius: 15, margin: 15, flexDirection: 'row' }}>
// <View style={{ flex: 1 }}>
// </View>
// <View style={{ flex: 4 }}></View>
// <View style={{ flex: 1 }}></View>
// </View>
// </View>
// <View style={styles.btnAddress}>
// <TouchableOpacity onPress={() => this.addAdreess()}>
// <View style={{ height: 40, borderRadius: 15, marginRight: 70, marginLeft: 70, backgroundColor: '#CFB368', justifyContent: 'center', alignContent: 'center' }}>
// <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', color: 'white', fontSize: 20 }}> + Tambah Alamat </Text>
// </View>
// </TouchableOpacity>
// </View>
// <View style={styles.listAddress}>
// <FlatList
// data={this.state.data}
// renderItem={this.renderItem}
// keyExtractor={item => item.id}
// />
// </View>
// <View style={styles.body}>
// {/* <ScrollView> */}
// <View style={styles.btn_addreess}>
// <Button title="Tambah Alamat" onPress={() => this.addAdreess()}></Button>
// </View>
// <FlatList
// data={this.state.data}
// renderItem={this.renderItem}
// keyExtractor={item => item.id}
// />
// </View>
\ No newline at end of file
view/Home.js
View file @
2b748105
...
...
@@ -39,9 +39,7 @@ class Home extends React.Component {
}
componentDidMount
()
{
// const { navigation } = this.props
// CheckVersion(navigation)
console
.
log
(
"INI BASE_URL : "
+
this
.
props
.
BASE_URL
)
const
screenWidth
=
Math
.
round
(
Dimensions
.
get
(
'window'
).
width
);
this
.
setState
({
slider_height
:
screenWidth
...
...
@@ -118,7 +116,7 @@ class Home extends React.Component {
this
.
_getOutletClosest
();
}
_renderCarousell
()
{
Axios
.
get
(
'https://excelsocrm.ravintoladev.com/
cms/v2/list/promotions-carousel'
).
then
(
respon
=>
{
Axios
.
get
(
this
.
props
.
BASE_URL
+
'
cms/v2/list/promotions-carousel'
).
then
(
respon
=>
{
const
dataCarousell
=
respon
.
data
.
contents
;
let
imageLink
=
[]
let
slugs
=
[]
...
...
@@ -146,7 +144,7 @@ class Home extends React.Component {
session_id
:
this
.
props
.
session_id
,
}
// console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
const
dataCard
=
res
.
data
let
point
=
dataCard
.
kaspro_point
...
...
@@ -175,7 +173,7 @@ class Home extends React.Component {
long
:
this
.
state
.
my_long
}
// console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/outlet/get_closest'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/outlet/get_closest'
,
params
).
then
(
res
=>
{
// console.log(res.data.data)
let
outletId
=
res
.
data
.
data
.
outlet_id
...
...
@@ -663,7 +661,6 @@ const mapDispatchToProps = (dispacth) => {
const
mapStateToProps
=
(
state
)
=>
{
return
{
// login
in_payment
:
state
.
in_payment
,
BASE_URL
:
state
.
BASE_URL
,
...
...
view/MenuSelection.js
View file @
2b748105
...
...
@@ -100,7 +100,7 @@ class MenuSelection extends React.Component {
long
:
this
.
state
.
my_long
}
// console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/outlet/get_closest'
,
params
).
then
((
res
)
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/outlet/get_closest'
,
params
).
then
((
res
)
=>
{
let
outletId
=
res
.
data
.
data
.
outlet_id
...
...
@@ -126,7 +126,7 @@ class MenuSelection extends React.Component {
outlet_id
:
this
.
props
.
outlet_id
}
// console.log("INI YA " + params)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/menu/get_list'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/menu/get_list'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
// console.log("INI DATANYA" + JSON.stringify(data))
...
...
@@ -382,6 +382,7 @@ const mapStateToProps = (state) => {
return
{
type_pickup
:
state
.
type_pickup
,
BASE_URL
:
state
.
BASE_URL
,
session_id
:
state
.
session_id
,
grabamount
:
state
.
grabamount
,
outlet_id
:
state
.
outlet_id
,
...
...
@@ -430,25 +431,3 @@ const mapDispatchToProps = (dispacth) => {
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
MenuSelection
)
{
/* <Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button> */
}
// {
// this.state.indicator == true ? (<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />) : (
// <View style={{ flexDirection: 'row', }}>
// <Text style={{ fontSize: 12, margin: 10, fontFamily:'Gotham-Black' }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
// <Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text>
// )} </Text>
// <Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
// </View>
// )
// }
{
/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', textAlign: 'center',top:10,marginLeft:45 }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
<Text style={{ fontSize: 12 }}> Ongkir {this.props.grabamount} </Text>
)} </Text>
<NumberFormat decimalScale={0} value={this.props.order_total} renderText={value => <Text style={{ fontSize: 20, fontFamily: 'Gotham-Light', top: 20, textAlign: 'center' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> */
}
view/OrderDetail.js
View file @
2b748105
...
...
@@ -39,6 +39,8 @@ class OrderDetail extends React.Component {
componentDidMount
()
{
// console.log("INI URL NYA : " + this.props.BASE_URL )
BackHandler
.
addEventListener
(
'hardwareBackPress'
,
this
.
handleBackButtonClick
);
this
.
getDetailTrans
()
...
...
@@ -89,7 +91,7 @@ class OrderDetail extends React.Component {
reason
:
"Cancelled By User"
}
// console.log(params)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/transaction/cancel'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/transaction/cancel'
,
params
).
then
(
res
=>
{
let
respon
=
res
.
data
.
status
Alert
.
alert
(
respon
,
'Order was canceled'
)
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'ORDER'
});
...
...
@@ -109,9 +111,9 @@ class OrderDetail extends React.Component {
transaction_id
:
this
.
props
.
route
.
params
.
idTrans
}
// console.log("PARAMETER : " + JSON.stringify(params))
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
console
.
log
(
data
)
//
console.log(data)
if
(
data
.
trans_status_display
==
'On Queue'
)
{
data
.
trans_status_display
=
'Queueing'
}
else
...
...
@@ -653,6 +655,7 @@ const mapStateToProps = (state) => {
trans_id
:
state
.
trans_id
,
lat
:
state
.
lat
,
long
:
state
.
long
,
BASE_URL
:
state
.
BASE_URL
}
}
...
...
view/OrderHistory.js
View file @
2b748105
...
...
@@ -43,7 +43,7 @@ class OrderHistory extends React.Component {
let
params
=
{
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/transaction/list'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/transaction/list'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
// console.log(data)
data
.
map
((
item
)
=>
{
...
...
@@ -152,7 +152,8 @@ const mapStateToProps = (state) => {
return
{
session_id
:
state
.
session_id
,
language
:
state
.
language
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
,
}
}
...
...
view/Outlets.js
View file @
2b748105
...
...
@@ -96,7 +96,7 @@ class Outlets extends React.Component {
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
"https://excelsocrm.ravintoladev.com/
crm/v2/outlet/get_list"
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
"
crm/v2/outlet/get_list"
,
params
).
then
(
res
=>
{
let
dataOutlets
=
res
.
data
.
outlets
;
for
(
let
i
=
0
;
i
<
dataOutlets
.
length
;
i
++
)
{
dataOutlets
[
i
][
'distance'
]
=
this
.
distance
(
dataOutlets
[
i
][
'lat'
],
dataOutlets
[
i
][
'long'
]);
...
...
@@ -147,7 +147,7 @@ class Outlets extends React.Component {
}
OrderedList
()
{
Axios
.
get
(
"https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_city_list"
).
then
(
res
=>
{
Axios
.
get
(
this
.
props
.
BASE_URL
+
'crm/v2/outlet/get_city_list'
).
then
(
res
=>
{
let
cities
=
res
.
data
.
city
let
data_city
=
[]
...
...
@@ -175,31 +175,6 @@ 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);
// })
// }
toRad
(
value
)
{
return
value
*
Math
.
PI
/
180
;
...
...
@@ -389,26 +364,8 @@ const mapStateToProps = (state) => {
name_outlet
:
state
.
name_outlet
,
lat
:
state
.
lat
,
long
:
state
.
long
,
BASE_URL
:
state
.
BASE_URL
,
}
}
export
default
connect
(
mapStateToProps
)(
Outlets
);
\ No newline at end of file
{
/* <View style={{flex:1,backgroundColor:'red'}}>
</View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={styles.list_addrees}>
<View style={{ margin: 5 }}>
<Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text>
<Text style={{ fontWeight: 'bold', fontSize: 15, color: '#ccb46c' }}>OPEN - </Text>
</View>
<Text style={{ margin: 5, color: '#b1b1b2' }}>
{item.full_address}
</Text>
<Text style={{ margin: 5, color: '#aeaead' }}>
{item.distance} KM
</Text>
</View>
</View> */
}
\ No newline at end of file
view/ProfilePage.js
View file @
2b748105
...
...
@@ -34,7 +34,7 @@ class ProfilePage extends PureComponent {
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
console
.
log
(
"INI DATANYA : "
+
JSON
.
stringify
(
data
));
...
...
@@ -197,6 +197,7 @@ const mapStateToProps = (state) => {
language
:
state
.
language
,
full_name
:
state
.
full_name
,
gender_display
:
state
.
gender_display
,
BASE_URL
:
state
.
BASE_URL
}
}
...
...
view/Renewal.js
View file @
2b748105
...
...
@@ -19,15 +19,15 @@ class Renewal extends React.Component {
componentDidMount
()
{
this
.
_getProfile
();
// console.log(this.props.BASE_URL)
}
_renewal
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
}
// console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/card/renewal'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/card/renewal'
,
params
).
then
(
res
=>
{
// console.log('ini res ' + JSON.stringify(res.data))
this
.
_getProfile
();
this
.
props
.
navigation
.
navigate
(
'HOME'
,{
screen
:
'Account'
});
...
...
@@ -43,7 +43,7 @@ class Renewal extends React.Component {
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
// console.log('ini res ' + JSON.stringify(res.data))
const
dataCard
=
res
.
data
...
...
@@ -57,7 +57,6 @@ class Renewal extends React.Component {
date
.
setFullYear
(
date
.
getFullYear
()
+
1
);
let
date_nextyear_string
=
date
.
getFullYear
()
+
"-"
+
date
.
getMonth
()
+
"-"
+
date
.
getDate
()
console
.
log
(
"INI YA : "
+
date_nextyear_string
)
this
.
setState
({
current_balance
:
balance
,
...
...
@@ -171,7 +170,8 @@ const styles = StyleSheet.create({
const
mapStateToProps
=
(
state
)
=>
{
return
{
session_id
:
state
.
session_id
,
language
:
state
.
language
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
}
}
export
default
connect
(
mapStateToProps
)(
Renewal
);
view/RewardDetail.js
View file @
2b748105
...
...
@@ -45,7 +45,7 @@ class RewardDetail extends React.Component {
session_id
:
this
.
props
.
session_id
,
reward_id
:
this
.
props
.
route
.
params
.
rewardId
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/reward/get_detail'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/reward/get_detail'
,
params
).
then
(
res
=>
{
let
expire_date
=
moment
(
res
.
data
.
reward
.
expire_time
).
format
(
'DD MMMM YYYY'
)
...
...
@@ -272,6 +272,7 @@ const mapStateToProps = (state) => {
session_id
:
state
.
session_id
,
lat
:
state
.
lat
,
long
:
state
.
long
,
BASE_URL
:
state
.
BASE_URL
,
}
}
...
...
view/RewardSelect.js
View file @
2b748105
...
...
@@ -16,6 +16,7 @@ class RewardSelect extends React.Component {
}
componentDidMount
()
{
console
.
log
(
this
.
props
.
BASE_URL
);
this
.
getRewardsList
()
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
getRewardsList
()
...
...
@@ -156,7 +157,7 @@ const mapStateToProps = (state) => {
session_id
:
state
.
session_id
,
value_voucher
:
state
.
value_voucher
,
voucher
:
state
.
voucher
,
BASE_URL
:
state
.
BASE_URL
}
}
...
...
view/RewardsList.js
View file @
2b748105
...
...
@@ -16,6 +16,7 @@ class RewardsList extends React.Component {
}
componentDidMount
()
{
// console.log("INI YA REWARD URL :"+this.props.BASE_URL)
this
.
getRewardsList
()
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
setState
({
...
...
@@ -34,7 +35,7 @@ class RewardsList extends React.Component {
let
params
=
{
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/reward/get_list'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/reward/get_list'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
rewards
// console.log(data)
data
.
map
((
item
,
key
)
=>
{
...
...
@@ -129,7 +130,8 @@ const mapStateToProps = (state) => {
return
{
session_id
:
state
.
session_id
,
language
:
state
.
language
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
,
}
}
...
...
view/TopUpInfo.js
View file @
2b748105
...
...
@@ -6,9 +6,10 @@ import HTML from 'react-native-render-html';
import
{
Collapse
,
CollapseHeader
,
CollapseBody
,
AccordionList
}
from
'accordion-collapse-react-native'
import
{
getStatusBarHeight
}
from
'react-native-status-bar-height'
;
import
MyStatusBar
from
'./MyStatusBar'
;
import
{
connect
}
from
'react-redux'
;
export
default
class
TopUpInfo
extends
React
.
Component
{
class
TopUpInfo
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
...
...
@@ -18,11 +19,12 @@ export default class TopUpInfo extends React.Component {
}
componentDidMount
()
{
console
.
log
(
"ii"
+
this
.
props
.
BASE_URL
)
const
statusBarHeight
=
getStatusBarHeight
();
this
.
setState
({
statusbar_height
:
statusBarHeight
})
Axios
.
get
(
'https://excelsocrm.ravintoladev.com/
cms/v2/list/topup-info'
).
then
(
res
=>
{
Axios
.
get
(
this
.
props
.
BASE_URL
+
'
cms/v2/list/topup-info'
).
then
(
res
=>
{
let
data
=
res
.
data
;
this
.
setState
({
topup_info
:
data
.
contents
...
...
@@ -124,3 +126,12 @@ const styles = StyleSheet.create({
alignItems
:
'flex-end'
}
})
const
mapStateToProps
=
(
state
)
=>
{
return
{
session_id
:
state
.
session_id
,
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
}
}
export
default
connect
(
mapStateToProps
)(
TopUpInfo
);
\ No newline at end of file
view/TransactionHistory.js
View file @
2b748105
...
...
@@ -38,7 +38,7 @@ class TransactionHistory extends React.Component {
let
params
=
{
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/transaction/history'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/transaction/history'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
transactions
console
.
log
(
data
)
data
.
map
((
item
)
=>
{
...
...
@@ -208,16 +208,6 @@ class TransactionHistory extends React.Component {
<
/View
>
<
/View
>
)
))
))
)
:
(
...
...
@@ -257,7 +247,7 @@ const mapStateToProps = (state) => {
return
{
session_id
:
state
.
session_id
,
BASE_URL
:
state
.
BASE_URL
}
}
...
...
view/TransferBalance.js
View file @
2b748105
...
...
@@ -24,13 +24,14 @@ class TransferBalance extends React.Component {
componentDidMount
()
{
this
.
getBalance
()
console
.
log
(
this
.
props
.
BASE_URL
);
}
getBalance
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
// console.log('ini res nya : ' + data.kaspro_balance)
this
.
setState
({
...
...
@@ -57,7 +58,7 @@ class TransferBalance extends React.Component {
}
// console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/card/transfer'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/card/transfer'
,
params
).
then
(
res
=>
{
// console.log('ini res ' + JSON.stringify(res.data))
Alert
.
alert
(
'Transaksi Berhasil'
)
this
.
props
.
navigation
.
goBack
()
...
...
@@ -182,7 +183,8 @@ const mapStateToProps = (state) => {
return
{
session_id
:
state
.
session_id
,
set_card
:
state
.
set_card
,
language
:
state
.
language
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
}
}
...
...
view/UseBalance.js
View file @
2b748105
...
...
@@ -43,7 +43,7 @@ class UseBalance extends React.Component {
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
// console.log('ini res ' + JSON.stringify(res.data))
const
dataCard
=
res
.
data
...
...
@@ -135,7 +135,7 @@ class UseBalance extends React.Component {
}
console
.
log
(
params
)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
// console.log(res.data)
let
respon
=
res
.
data
// Alert.alert('', 'Sukses Redeem')
...
...
@@ -174,7 +174,7 @@ class UseBalance extends React.Component {
}
console
.
log
(
params
)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
// console.log(res.data)
let
respon
=
res
.
data
console
.
log
(
"INI DATANYA "
+
respon
)
...
...
@@ -215,7 +215,7 @@ class UseBalance extends React.Component {
}
console
.
log
(
params
)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
let
respon
=
res
.
data
console
.
log
(
"INI DATANYA "
+
respon
)
// Alert.alert('', 'Sukses Redeem')
...
...
@@ -250,7 +250,7 @@ class UseBalance extends React.Component {
}
console
.
log
(
params
)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/
crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'
crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
let
respon
=
res
.
data
console
.
log
(
"INI DATANYA "
+
respon
)
// Alert.alert('', 'Sukses Redeem')
...
...
@@ -558,7 +558,8 @@ const mapStateToProps = (state) => {
return
{
session_id
:
state
.
session_id
,
language
:
state
.
language
,
pageEmailConfirmation
:
state
.
pageEmailConfirmation
pageEmailConfirmation
:
state
.
pageEmailConfirmation
,
BASE_URL
:
state
.
BASE_URL
}
}
...
...
view/setBaseUrl.js
0 → 100644
View file @
2b748105
import
{
Text
,
TouchableOpacity
,
View
,
StyleSheet
,
TextInput
,
Alert
}
from
'react-native'
;
import
React
from
'react'
;
import
ActionType
from
'../redux/globalActionType'
;
import
{
connect
}
from
'react-redux'
;
class
setBaseUrl
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
base_url
:
""
,
}
}
componentDidMount
()
{
console
.
log
(
"INI YAAA: "
+
this
.
props
.
BASE_URL
)
}
handleSetUrl
()
{
if
(
this
.
state
.
base_url
==
''
)
{
Alert
.
alert
(
''
,
'Url tidak boleh kosong!'
)
}
else
{
let
setUrls
=
{
BASE_URL
:
this
.
state
.
base_url
}
this
.
props
.
setUrlProps
(
setUrls
);
Alert
.
alert
(
'Berhasil'
,
'berhasil set ke : '
+
this
.
props
.
BASE_URL
)
}
}
render
()
{
return
(
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
}}
>
<
View
style
=
{{
flex
:
3
}}
>
<
View
style
=
{{
flex
:
1
,
marginRight
:
30
,
marginLeft
:
30
,
top
:
60
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
URL
<
/Text
>
<
TextInput
style
=
{{
height
:
40
,
borderWidth
:
1
,
padding
:
5
,
margin
:
5
,
borderRadius
:
10
,
borderColor
:
'grey'
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'center'
,
color
:
'grey'
,
fontWeight
:
'bold'
,
fontSize
:
12
}}
onChangeText
=
{(
base_url
)
=>
this
.
setState
({
base_url
})}
value
=
{
this
.
state
.
base_url
}
autoCapitalize
=
"none"
placeholder
=
{
this
.
props
.
BASE_URL
}
/
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
marginTop
:
20
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
16
,
textAlign
:
'center'
}}
>
CHANGE
URL
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
}
}
const
mapStateToProps
=
(
state
)
=>
{
return
{
BASE_URL
:
state
.
BASE_URL
}
}
const
mapDispatchToProps
=
(
dispacth
)
=>
{
return
{
setUrlProps
:
(
setUrls
)
=>
dispacth
({
type
:
ActionType
.
SET_BASE_URL
,
data
:
{
BASE_URL
:
setUrls
.
BASE_URL
}
}),
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
setBaseUrl
)
\ No newline at end of file
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