import React, { useCallback, useEffect, useState } from 'react' import styles from './index.module.scss' import ZexhiBtn from '@/components/ZexhiBtn' import noImg from '@/assets/img/exhibit/no.png' import { B2_APIcancel, B2_APIgetList } from '@/store/action/all' import { B2ListType, B2SonListType } from './type' import history from '@/utils/history' import classNames from 'classnames' import MyPopconfirm from '@/components/MyPopconfirm' import { MessageFu } from '@/utils/message' import { QRCode } from 'antd' import { CloseCircleOutlined } from '@ant-design/icons' function B2myz() { const [loding, setLoding] = useState(false) const [list, setList] = useState([]) const getListFu = useCallback(async () => { const res = await B2_APIgetList() if (res.code === 0) { setLoding(true) setList(res.data) } }, []) useEffect(() => { getListFu() }, [getListFu]) const sonList = useCallback((val: string) => { let arr: B2SonListType[] = [] arr = JSON.parse(val) return arr }, []) // 点击撤回预约 const recallFu = useCallback( async (id: number) => { const res = await B2_APIcancel(id) if (res.code === 0) { MessageFu.success('撤回成功!') getListFu() } }, [getListFu] ) // 出示二维码 const [code, setCode] = useState('') return (
{list.length ? ( <> {list.map(item => (

预约日期: {item.bookDate}

入馆时间: {item.time}

来自地区: {item.province + '-' + item.city}

预约类型: {item.type === 'person' ? '个人预约' : '团体预约'}

{item.status === 0 ? '未核销' : '已核销'}
{sonList(item.rtf).map((item2, index2) => (
{item.type === 'person' ? `参观人信息${index2 + 1}` : '负责人信息'}

{item.type === 'person' ? '参观人' : '负责人'}姓名:{item2.name}

联系方式:{item2.phone}

{item2.papers || '证件号码'}:{item2.identity}

))} {/* 团队预约才有的 */} {item.type === 'team' ? (

参团人数:{item.pcs}

{item.teamDesc ? (
团队描述:
{item.teamDesc}
) : null}
) : null}
{item.status === 0 ? ( <> recallFu(item.id)} Dom={
撤回预约
} />
setCode(`HQ_CODE/${item.id}`)} > 出示二维码
) : null}
))}
联系方式:17722062600
) : ( )}
{}} backFu={() => history.push('/exhi')} /> {/* 出示二维码 */} {code ? (
setCode('')} />
) : null}
) } const MemoB2myz = React.memo(B2myz) export default MemoB2myz