import React from 'react'; import Taro from '@tarojs/taro'; import { View, CoverView } from '@tarojs/components'; import { CellGroup, Cell, Field, RadioGroup, Radio, Icon } from '@antmjs/vantui'; import Map from '@/components/map'; import { getTaCheckItemAnswer } from '@/services/tacheckitem'; import mapIcon from '@/assets/icons/marker.png'; import AgePicker from './AgePicker'; export default (props) => { const { checkItemInfo, checkType, answer, readonly, onChange, onLoadingChange } = props; const [showAgePicker, setShowAgePicker] = React.useState(false); const setLoading = (v) => { if (onLoadingChange) { onLoadingChange(v) } } const setFieldChange = (key, val) => { onChange({ ...answer || {}, [key]: val, }) } // // 获取答题主记录信息 // React.useEffect(() => { // if (checkItemInfo?.itemId) { // setLoading(true); // getTaCheckItemAnswer(checkItemInfo?.itemId).then((res) => { // if (res) { // onChange(res); // } // setLoading(false); // }).catch(() => { // setLoading(false); // }); // } // }, [checkItemInfo?.itemId]) // console.log('answer', answer); return ( setFieldChange('location', e)} /> { checkType == 'loc' && ( ) } { checkType == 'survey' && ( setFieldChange('communityName', e.detail)} /> ) } setFieldChange('addr', e.detail)} /> { checkType == 'survey' && ( setFieldChange('sex', e.detail)} > !readonly && setShowAgePicker(true)} /> setFieldChange('age', e)} /> ) } ) }