import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Picker, DatePicker, Progress, Toast } from 'antd-mobile';
import router from 'umi/router';
import { formatDatetime } from '../../../utils/helper';
import 'antd-mobile/dist/antd-mobile.less';
import styles from './index.less';
const CustomChildren = props => {
return (
{props.extra}
);
};
@connect(({ info }) => ({ info }))
class Index extends Component {
constructor(props) {
super(props);
this.state = {
progressFlag: false,
percent: 0,
};
}
componentDidMount = () => {
document.title = '犬只鉴定信息';
// this.props.dispatch({
// type: 'info/dogtype',
// payload: {},
// });
};
uploadImgs = e => {
const name = e.target.name;
this.props.dispatch({
type: 'info/updateState',
payload: {
[name + 'Value']: e.target.value,
},
});
this.setState({
progressFlag: true,
});
this.props.dispatch({
type: 'info/uploadImgs',
payload: {
name: name,
files: e.target.files,
},
progress: progressEvent => {
if (progressEvent.lengthComputable) {
this.setState({
percent: (progressEvent.loaded / progressEvent.total) * 100,
});
} else {
this.setState({
percent: 0.5,
});
}
},
callback: () => {
this.setState({
percent: 0,
progressFlag: false,
});
},
});
};
delete = name => {
this.props.dispatch({
type: 'info/updateState',
payload: {
[name]: null,
[name + 'Url']: null,
[name + 'Value']: '',
},
});
};
uploadVod = e => {
const name = e.target.name;
this.props.dispatch({
type: 'info/updateState',
payload: {
[name + 'Value']: e.target.value,
},
});
this.setState({
progressFlag: true,
});
this.props.dispatch({
type: 'info/uploadVod',
payload: {
name: name,
files: e.target.files,
},
progress: progressEvent => {
if (progressEvent.lengthComputable) {
this.setState({
percent: (progressEvent.loaded / progressEvent.total) * 100,
});
} else {
this.setState({
percent: 0.5,
});
}
},
callback: flag => {
if ('toBig' === flag) {
Toast.fail('视频大于200M');
}
this.setState({
percent: 0,
progressFlag: false,
});
},
});
};
save = () => {
this.props.dispatch({
type: 'info/save',
payload: {},
});
};
onChangeText = type => e => {
this.props.dispatch({
type: 'info/updateState',
payload: {
[type]: e.target.value,
},
});
};
onChangePicker = type => v => {
let value = null;
if (v instanceof Date) {
value = formatDatetime(v, 'YYYY-MM-DD');
} else {
value = v[0];
}
this.props.dispatch({
type: 'info/updateState',
payload: {
[type]: value,
},
});
};
render() {
const {
referee,
dogOwnerName,
gender,
mobile,
cardNo,
memberCode,
province,
city,
area,
address,
dogBreed,
// dogTypeList,
dogColor,
dogGender,
dogName,
dogBirthdate,
frontPicUrl,
frontPicValue,
leftSidePicUrl,
leftSidePicValue,
rightSidePicUrl,
rightSidePicValue,
backPicUrl,
backPicValue,
runVideo,
runVideoValue,
noseVideo,
noseVideoValue,
} = this.props.info;
const { progressFlag, percent } = this.state;
return (
{progressFlag ? (
) : null}
犬主信息
鉴定通过我们将根据您填写的详细地址直接为您邮寄证书,邮寄方式为顺丰到付,请您注意查收!
犬只信息
报名鉴定犬只最小年龄为6月龄(以申请当天时间为准)
犬只静态照片
犬只自然站立,距离拍摄位置约2-3米,拍摄高度约为坐姿
视角高度,拍摄4张犬只照片,照片大小需小于200M
{frontPicUrl ? (
{
this.delete('frontPic');
}}
>
) : null}
正面
{leftSidePicUrl ? (
{
this.delete('leftSidePic');
}}
>
) : null}
左侧面
{rightSidePicUrl ? (
{
this.delete('rightSidePic');
}}
>
) : null}
右侧面
{backPicUrl ? (
{
this.delete('backPic');
}}
>
) : null}
背面
犬只视频
视频需小于200M
{runVideo ? (
{
this.delete('runVideo');
}}
>
) : null}
直线往返和环形往返步态视频: 自然走动来回直线往返、绕场环
形奔跑一圈,两个步态均需要完成,视频时间不少于20-25秒
{noseVideo ? (
{
this.delete('noseVideo');
}}
>
) : null}
鼻纹视频:让犬只鼻头纹理充分展现出来,在光线较暗的地方建
议打开闪光灯,拍摄时间不少于 15秒
视频拍摄注意事项:
1.拍摄视频前建议清洁犬只、梳理犬只毛发;
2.注意鼻头清洁,避免沾有任何异物影响鼻纹的成功采集;
3.拍摄时避免手机抖动,保证视频的清晰度;
4.拍摄期间周围尽量不要有任何杂音;
5.拍摄时尽量让犬只保持在主视觉区域内。
);
}
}
export default Index;