提交 0f45d305 authored 作者: 吴强's avatar 吴强

Add tags

上级 05e21486
......@@ -7515,6 +7515,15 @@
"prop-types": "15.6.0"
}
},
"react-native-tag-input": {
"version": "0.0.18",
"resolved": "http://registry.npm.taobao.org/react-native-tag-input/download/react-native-tag-input-0.0.18.tgz",
"integrity": "sha1-VsJb3CqaSdKnoBN3+whIEbSnW2U=",
"requires": {
"invariant": "2.2.2",
"prop-types": "15.6.0"
}
},
"react-native-vector-icons": {
"version": "4.4.2",
"resolved": "http://registry.npm.taobao.org/react-native-vector-icons/download/react-native-vector-icons-4.4.2.tgz",
......
......@@ -48,6 +48,7 @@
"react-native-device-info": "^0.12.1",
"react-native-fetch-polyfill": "^1.1.2",
"react-native-splash-screen": "^3.0.6",
"react-native-tag-input": "0.0.18",
"react-native-vector-icons": "^4.4.2",
"react-navigation": "^1.0.0-beta.19",
"react-redux": "^5.0.6",
......
......@@ -13,6 +13,7 @@ import { errors } from '../utils/error';
import { encrypt } from '../utils/helper';
import config from '../utils/config';
import { futch } from '../utils/polyfill';
import { userApi } from '../services/interfaces';
const styles = StyleSheet.create({
container: {
......@@ -164,21 +165,19 @@ class CameraComponent extends React.Component {
const name = 'addTags';// 添加标签
const PicUri = `${config.apiContextPath}/api/interface/user/${name}/invoke`;
console.info(PicUri);
const postjson = { uri: response.data[0], tags: ['当事人信息', '当事人'] };
const postjson = { uri: response.data[0], tags: ['当事人信息', '当事人信息'] };
console.info(JSON.stringify(postjson));
futch(PicUri, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(postjson),
}, (progressEvent) => {
console.info(progressEvent);
})
.then(request => request.responseText)// response.text())
.then((responseData2) => {
console.info(responseData2);
});
userApi.invokeInterface(name, postjson)
// futch(PicUri, {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// },
// body: JSON.stringify(postjson),
// }, (progressEvent) => {
// console.info(progressEvent);
// })
.then(request => console.info(request));// response.text())
// 这里需要调用接口,对图片数据进行绑定,等待完善
// 页面跳转,跳转到前面的详情的页面
console.info('跳转');
......
import React, { PureComponent } from 'react';
import {
View,
Stylesheet,
Text,
TouchableOpacity,
Dimensions,
Image,
} from 'react-native';
import TagInput from 'react-native-tag-input';
import { InputItem } from 'antd-mobile';
class UploadPageComponent extends PureComponent {
onCancel = () => {
this.props.onCancel();
};
onUploadPhoto = () => {
this.props.onUploadPhoto();
};
renderHeaderMenu() {
return (
<View style={[styles.view_header_container, { backgroundColor: this.props.bgColor }]}>
<TouchableOpacity
onPress={this.onCancel()}
>
<Text style={[styles.text_title, { color: this.props.titleColor }]}>取消</Text>
</TouchableOpacity>
<Text style={[styles.text_title, { color: this.props.titleColor }]}>传照片</Text>
<TouchableOpacity
onPress={this.onUploadPhoto()}
>
<Text style={styles.text_right_title}>
上传
</Text>
</TouchableOpacity>
</View>
);
}
render() {
const { getFieldProps, getFieldError } = this.props.form;
return (
<View style={styles.container}>
{this.renderHeaderMenu()}
<Image
style={{ height: Dimensions.get('window').height, width: Dimensions.get('window').width }}
source={{ uri: this.props.imageURI, isStatic: true }}
/>
<InputItem
{...getFieldProps('account', {
initialValue: 'little ant',
rules: [
{ required: true, message: '名称不能为空' },
],
})}
clear
error={!!getFieldError('account')}
placeholder="请输入名字"
>照片名称
</InputItem>
</View>
);
}
}
const styles = Stylesheet.create({
container: {
flex: 1,
},
view_header_container: {
height: 56,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
},
text_right_title: {
color: '#000',
position: 'absolute',
right: 16,
},
text_left_title: {
color: '#000',
position: 'absolute',
left: 16,
},
text_title: {
color: '#000',
fontSize: 18,
},
uploadImage: {
height: Dimensions.get('window').height,
width: Dimensions.get('window').width,
},
});
export default UploadPageComponent;
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论