Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InvestCustomer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Giang Tran
InvestCustomer
Commits
7ad84561
Commit
7ad84561
authored
May 17, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ghep api
parent
a98562a5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
ServiceCustomerView.js
src/Screens/ServiceCustomer/ServiceCustomerView.js
+24
-3
General.js
src/apis/Functions/General.js
+4
-0
url.js
src/apis/url.js
+1
-0
No files found.
src/Screens/ServiceCustomer/ServiceCustomerView.js
View file @
7ad84561
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
import
{
View
,
Text
,
StyleSheet
,
Platform
}
from
'react-native'
;
import
R
from
'../../assets/R'
;
import
R
from
'../../assets/R'
;
import
AppText
from
'../../components/AppText'
;
import
AppText
from
'../../components/AppText'
;
import
TextMulti
from
'../../components/Input/TextMulti'
;
import
TextMulti
from
'../../components/Input/TextMulti'
;
...
@@ -8,9 +8,28 @@ import {connect} from 'react-redux';
...
@@ -8,9 +8,28 @@ import {connect} from 'react-redux';
import
HeaderBack
from
'../../components/Header/HeaderBack'
;
import
HeaderBack
from
'../../components/Header/HeaderBack'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
{
TouchableOpacity
}
from
'react-native-gesture-handler'
;
import
{
TouchableOpacity
}
from
'react-native-gesture-handler'
;
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
import
{
showAlert
,
TYPE
}
from
'../../components/DropdownAlert'
;
import
{
sendRequest
}
from
'../../apis/Functions/General'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
const
ServiceCustomerView
=
(
props
)
=>
{
const
ServiceCustomerView
=
(
props
)
=>
{
const
naviation
=
useNavigation
();
const
[
content
,
setContent
]
=
useState
(
''
);
const
[
content
,
setContent
]
=
useState
(
''
);
const
onClickSend
=
async
()
=>
{
props
.
showLoading
();
const
res
=
await
sendRequest
({
content
,
platform
:
Platform
.
OS
});
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
naviation
.
goBack
();
showAlert
(
TYPE
.
SUCCESS
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
};
const
{
const
{
name
,
name
,
email
,
email
,
...
@@ -85,7 +104,7 @@ const ServiceCustomerView = (props) => {
...
@@ -85,7 +104,7 @@ const ServiceCustomerView = (props) => {
alignItems
:
'center'
,
alignItems
:
'center'
,
marginBottom
:
20
,
marginBottom
:
20
,
}}
>
}}
>
<
TouchableOpacity
style
=
{
styles
.
btn
}
>
<
TouchableOpacity
onPress
=
{
onClickSend
}
style
=
{
styles
.
btn
}
>
<
AppText
style
=
{
styles
.
txtBtn
}
i18nKey
=
{
'Send'
}
/
>
<
AppText
style
=
{
styles
.
txtBtn
}
i18nKey
=
{
'Send'
}
/
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
...
@@ -135,4 +154,6 @@ const mapStateToProps = (state) => {
...
@@ -135,4 +154,6 @@ const mapStateToProps = (state) => {
user
:
state
.
userReducer
,
user
:
state
.
userReducer
,
};
};
};
};
export
default
connect
(
mapStateToProps
,
{})(
ServiceCustomerView
);
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
ServiceCustomerView
,
);
src/apis/Functions/General.js
View file @
7ad84561
...
@@ -11,3 +11,7 @@ export const sendFeedBack = async (body) =>
...
@@ -11,3 +11,7 @@ export const sendFeedBack = async (body) =>
PostFormData
(
url
.
urlFeedback
,
body
)
PostFormData
(
url
.
urlFeedback
,
body
)
.
then
((
res
)
=>
res
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
.
catch
((
err
)
=>
err
);
export
const
sendRequest
=
async
(
body
)
=>
PostData
(
url
.
urlSendRequest
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
7ad84561
...
@@ -52,4 +52,5 @@ export default {
...
@@ -52,4 +52,5 @@ export default {
urlUploadImage
:
root
+
'api/v1/uploads/upload-image'
,
urlUploadImage
:
root
+
'api/v1/uploads/upload-image'
,
urlFeedback
:
root
+
'api/v1/customers/send-feedback'
,
urlFeedback
:
root
+
'api/v1/customers/send-feedback'
,
urlSendRequest
:
root
+
'api/v1/customers/send-request'
,
};
};
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