import React, { useCallback, useEffect, useState } from 'react' import styles from './index.module.scss' import TopCom from '@/components/TopCom' import classNames from 'classnames' import MyPopconfirm from '@/components/MyPopconfirm' import succImg from '@/assets/img/my/succ.png' import errImg from '@/assets/img/my/err.png' import succImg2 from '@/assets/img/my/succ2.png' import errImg2 from '@/assets/img/my/err2.png' import { A6_APIcancelAuth, A6_APIgetListRenZheng, A6_APIgetListYuYue } from '@/store/action/all' import { A6tableType1, A6tableType2 } from './type' import { FileType } from '@/types' import { baseURL } from '@/utils/http' import { MessageFu } from '@/utils/message' import history, { wxDownFu } from '@/utils/history' import { ImageViewer } from 'antd-mobile' import useWxXcx from '@/components/AownUse/useWxXcx' function A6my() { // 是否是微信小程序 const { isWXxcx } = useWxXcx() const [topAc, setTopAc] = useState( window.location.hash.includes('?m=1') ? '认证申请' : '预约申请' ) const [list1, setList1] = useState([]) const [loding1, setLoding1] = useState(false) // 获取预约申请 const getList1 = useCallback(async () => { const res = await A6_APIgetListYuYue() if (res.code === 0) { setLoding1(true) setList1(res.data) } }, []) const [list2, setList2] = useState([]) const [loding2, setLoding2] = useState(false) // 获取认证申请 const getList2 = useCallback(async () => { const res = await A6_APIgetListRenZheng() if (res.code === 0) { setLoding2(true) setList2(res.data) } }, []) useEffect(() => { getList1() getList2() }, [getList1, getList2]) // 点击撤回 const recallFu = useCallback( async (id: number, type: 'apply' | 'auth') => { const res = await A6_APIcancelAuth(id, type) if (res.code === 0) { MessageFu.success('撤回申请成功!') if (type === 'apply') getList1() else getList2() } }, [getList1, getList2] ) const lookImgFu = useCallback((url: string) => { MessageFu.info('可长按图片保存') ImageViewer.show({ image: baseURL + url }) }, []) return (
history.push('/')} />
{['预约申请', '认证申请'].map(item => (
setTopAc(item)} className={classNames('A6tRow', topAc === item ? 'A6tRowAc' : '')} key={item} > {item}
))}
{/* 预约申请 */} {/* 认证申请 */}
) } const MemoA6my = React.memo(A6my) export default MemoA6my