index.tsx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { Card, Tabs } from 'antd';
  2. import React from 'react';
  3. import '../../../tencentAdPutIn/index.less'
  4. import Group from './components/group';
  5. import SelectAdAccount from '@/components/SelectAdAccount';
  6. import PageTieUp from './components/pageTieUp';
  7. import LandingPageTieUp from './components/landingPageTieUp';
  8. import TencentGroup from './components/tencentGroup';
  9. /**
  10. * 客服管理
  11. * @returns
  12. */
  13. const EnterpriseWechat: React.FC = () => {
  14. /**********************************/
  15. const accountStr = localStorage.getItem('ADQ_ACCOUNTID')
  16. const [adAccountId, setAdAccountId] = React.useState<number | undefined>(accountStr ? Number(accountStr) : undefined);
  17. const [accessKey, setAccessKey] = React.useState<string>('1');
  18. /**********************************/
  19. return <Card
  20. className="cardResetCss"
  21. >
  22. <div className="flexStart" style={{ gap: 8, marginBottom: 16 }}>
  23. <SelectAdAccount
  24. isReturnFirstValue
  25. value={adAccountId ? [adAccountId] : undefined}
  26. type="radio"
  27. onChange={(value) => {
  28. setAdAccountId(value as number)
  29. localStorage.setItem('ADQ_ACCOUNTID', String(value))
  30. }}
  31. allowClear={false}
  32. />
  33. </div>
  34. <Tabs
  35. accessKey={accessKey}
  36. onChange={(key) => setAccessKey(key)}
  37. items={[
  38. { label: '客服组', key: '1', children: accessKey === '1' ? <Group adAccountId={adAccountId} /> : undefined },
  39. { label: '腾讯客服组', key: '2', children: accessKey === '2' ? <TencentGroup adAccountId={adAccountId} /> : undefined },
  40. { label: '官方落地页与客服组关系', key: '3', children: accessKey === '3' ? <PageTieUp adAccountId={adAccountId} /> : undefined },
  41. { label: '原生落地页与客服组关系', key: '4', children: accessKey === '4' ? <LandingPageTieUp adAccountId={adAccountId} /> : undefined },
  42. ]}
  43. size="small"
  44. />
  45. </Card>
  46. };
  47. export default EnterpriseWechat;