Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
pill_minder
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
Phuengton Chummuel
pill_minder
Commits
a4f7541e
Commit
a4f7541e
authored
Jul 25, 2018
by
Phuengton Chummuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
06f24f6b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
ServiceUrl.js
src/ServiceUrl.js
+2
-1
ReminderDialogForm.js
src/components/ReminderDialogForm.js
+5
-2
CameraScreen.js
src/screens/CameraScreen.js
+1
-2
No files found.
src/ServiceUrl.js
View file @
a4f7541e
export
const
MAIN_HOST
=
'http://192.168.
1.17
:8000'
;
export
const
MAIN_HOST
=
'http://192.168.
43.188
:8000'
;
export
const
IMAGE_TO_TEXT
=
MAIN_HOST
+
'/uploadimg'
export
const
SERVICE_HOST
=
"http://202.28.49.67/api"
\ No newline at end of file
src/components/ReminderDialogForm.js
View file @
a4f7541e
...
...
@@ -49,7 +49,7 @@ class ReminderDialogForm extends Component {
const
Loading
=
({
uploadProgress
})
=>
{
return
(
<
View
>
<
Text
>
{
"Upload : "
+
uploadProgress
+
"%
\n
"
+
onOk
.
toString
()
}
<
/Text
>
<
Text
>
{
"Upload : "
+
uploadProgress
+
"%
"
}
<
/Text
>
<
/View
>
)
}
...
...
@@ -60,7 +60,7 @@ class ReminderDialogForm extends Component {
if
(
imageToText
&&
imageToText
.
closeMatches
!=
-
1
)
{
return
(
<
View
>
<
Text
>
{
imageToText
.
closeMatches
}
<
/Text
>
<
Text
>
{
imageToText
.
closeMatches
[
0
]
}
<
/Text
>
<
Picker
selectedValue
=
{
this
.
state
.
selectedTime
}
onValueChange
=
{(
value
)
=>
this
.
setState
({
selectedTime
:
value
})}
...
...
@@ -91,6 +91,9 @@ class ReminderDialogForm extends Component {
<
TouchableOpacity
onPress
=
{()
=>
this
.
setState
({
singlePickerVisible
:
true
})}
>
<
Text
>
{
"Dose: "
+
this
.
state
.
dose
}
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
>
<
Text
>
{
"Add"
}
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
)
}
else
if
(
imageToText
&&
imageToText
.
closeMatches
==
-
1
)
{
...
...
src/screens/CameraScreen.js
View file @
a4f7541e
...
...
@@ -76,7 +76,6 @@ class AppCamera extends Component {
<
ReminderDialogForm
uploadProgress
=
{
this
.
state
.
uploadProgress
}
imageToText
=
{
this
.
state
.
imageToText
}
onOk
=
{
this
.
state
.
onAddReminder
}
/
>
<
/MaterialDialog
>
<
MaterialDialog
...
...
@@ -102,6 +101,7 @@ class AppCamera extends Component {
type
:
'imge/jpeg'
,
name
:
'image'
})
console
.
log
(
image
)
futch
(
IMAGE_TO_TEXT
,
{
method
:
'post'
,
...
...
@@ -114,7 +114,6 @@ class AppCamera extends Component {
}).
catch
(
err
=>
{
this
.
setState
({
imageToText
:
JSON
.
stringify
(
err
)
})
})
}
}
...
...
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