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
IMAGE_TO_TEXT
=
MAIN_HOST
+
'/uploadimg'
export
const
SERVICE_HOST
=
"http://202.28.49.67/api"
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 {
...
@@ -49,7 +49,7 @@ class ReminderDialogForm extends Component {
const
Loading
=
({
uploadProgress
})
=>
{
const
Loading
=
({
uploadProgress
})
=>
{
return
(
return
(
<
View
>
<
View
>
<
Text
>
{
"Upload : "
+
uploadProgress
+
"%
\n
"
+
onOk
.
toString
()
}
<
/Text
>
<
Text
>
{
"Upload : "
+
uploadProgress
+
"%
"
}
<
/Text
>
<
/View
>
<
/View
>
)
)
}
}
...
@@ -60,7 +60,7 @@ class ReminderDialogForm extends Component {
...
@@ -60,7 +60,7 @@ class ReminderDialogForm extends Component {
if
(
imageToText
&&
imageToText
.
closeMatches
!=
-
1
)
{
if
(
imageToText
&&
imageToText
.
closeMatches
!=
-
1
)
{
return
(
return
(
<
View
>
<
View
>
<
Text
>
{
imageToText
.
closeMatches
}
<
/Text
>
<
Text
>
{
imageToText
.
closeMatches
[
0
]
}
<
/Text
>
<
Picker
<
Picker
selectedValue
=
{
this
.
state
.
selectedTime
}
selectedValue
=
{
this
.
state
.
selectedTime
}
onValueChange
=
{(
value
)
=>
this
.
setState
({
selectedTime
:
value
})}
onValueChange
=
{(
value
)
=>
this
.
setState
({
selectedTime
:
value
})}
...
@@ -91,6 +91,9 @@ class ReminderDialogForm extends Component {
...
@@ -91,6 +91,9 @@ class ReminderDialogForm extends Component {
<
TouchableOpacity
onPress
=
{()
=>
this
.
setState
({
singlePickerVisible
:
true
})}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
setState
({
singlePickerVisible
:
true
})}
>
<
Text
>
{
"Dose: "
+
this
.
state
.
dose
}
<
/Text
>
<
Text
>
{
"Dose: "
+
this
.
state
.
dose
}
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
TouchableOpacity
>
<
Text
>
{
"Add"
}
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
)
)
}
else
if
(
imageToText
&&
imageToText
.
closeMatches
==
-
1
)
{
}
else
if
(
imageToText
&&
imageToText
.
closeMatches
==
-
1
)
{
...
...
src/screens/CameraScreen.js
View file @
a4f7541e
...
@@ -76,7 +76,6 @@ class AppCamera extends Component {
...
@@ -76,7 +76,6 @@ class AppCamera extends Component {
<
ReminderDialogForm
<
ReminderDialogForm
uploadProgress
=
{
this
.
state
.
uploadProgress
}
uploadProgress
=
{
this
.
state
.
uploadProgress
}
imageToText
=
{
this
.
state
.
imageToText
}
imageToText
=
{
this
.
state
.
imageToText
}
onOk
=
{
this
.
state
.
onAddReminder
}
/
>
/
>
<
/MaterialDialog
>
<
/MaterialDialog
>
<
MaterialDialog
<
MaterialDialog
...
@@ -102,6 +101,7 @@ class AppCamera extends Component {
...
@@ -102,6 +101,7 @@ class AppCamera extends Component {
type
:
'imge/jpeg'
,
type
:
'imge/jpeg'
,
name
:
'image'
name
:
'image'
})
})
console
.
log
(
image
)
futch
(
IMAGE_TO_TEXT
,
{
futch
(
IMAGE_TO_TEXT
,
{
method
:
'post'
,
method
:
'post'
,
...
@@ -114,7 +114,6 @@ class AppCamera extends Component {
...
@@ -114,7 +114,6 @@ class AppCamera extends Component {
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
this
.
setState
({
imageToText
:
JSON
.
stringify
(
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