import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Picker } from 'antd-mobile';
import DocumentTitle from 'react-document-title';
import 'antd-mobile/dist/antd-mobile.less';
import styles from './index.less';
import router from 'umi/router';
const CustomChildren = props => {
return (
{props.extra}
);
};
@connect(({ ckuApply }) => ({ ckuApply }))
class Index extends Component {
constructor(props) {
super(props);
this.state = {};
}
componentWillMount = () => {};
componentDidMount = () => {
const { birthCode } = this.props.location.query;
if (birthCode) {
this.props.dispatch({
type: 'ckuApply/checkBirthCode',
payload: {
birthCode,
},
});
}
};
componentWillUnmount = () => {
this.props.dispatch({
type: 'ckuApply/clean',
});
};
onChangeText = type => e => {
this.props.dispatch({
type: 'ckuApply/updateState',
payload: {
[type]: e.target.value,
},
});
};
onChangePicker = type => v => {
if (type === 'provinceName') {
this.props.dispatch({
type: 'ckuApply/org',
payload: {
provinceName: v[0],
},
});
}
this.props.dispatch({
type: 'ckuApply/updateState',
payload: {
[type]: v[0],
},
});
};
onChangeFlag = type => {
this.props.dispatch({
type: 'ckuApply/updateState',
payload: {
[type]: this.props.ckuApply[type] === '0' ? '1' : '0',
},
});
};
changeFlag = () => {
const { ecertFlag } = this.props.ckuApply;
this.props.dispatch({
type: 'ckuApply/updateState',
payload: {
ecertFlag: ecertFlag === '0' ? '1' : '0',
},
});
};
render() {
const {
id,
birthCerRegCode,
dogEnName,
callName,
dogBreedName,
dogColorMarkCn,
dogGender,
dogBirthday,
breeder,
memberName,
ecertFlag,
showDna,
dnaSaveWay,
isDnaParentsCompare,
provinceName,
hospitalCode,
province,
orgList,
} = this.props.ckuApply;
return (
{id ? (
申请犬只
犬主信息
{showDna ? (
DNA留存方式
双亲比对
{
this.onChangeFlag('isDnaParentsCompare');
}}
className={`${styles.checkbox} ${
isDnaParentsCompare === '1' ? styles.checkbox_a : null
}`}
/>
选择合作机构
) : null}
纸质证书申请
{
this.props.dispatch({
type: 'ckuApply/save',
});
}}
>
确认申请
) : null}
);
}
}
export default Index;