Commit a4f7541e authored by Phuengton Chummuel's avatar Phuengton Chummuel

.

parent 06f24f6b
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
...@@ -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) {
......
...@@ -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) })
}) })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment