JumpThirdLink.js 866 Bytes
Newer Older
杨思琦's avatar
杨思琦 committed
1 2 3 4
import React, { useEffect } from 'react';
import { Button } from 'antd';
import BgImg from '@/assets/images/commonMenu/背景.jpg';
import styles from './index.less';
5
const JumpThirdLink = props => {
杨思琦's avatar
杨思琦 committed
6 7
  const linkUrl = props.params.linkUrl || '';
  const jumpLink = () => {
8 9
    let url = linkUrl.replaceAll('@','#').replaceAll('*','?');
    window.open(url, '_blank');
杨思琦's avatar
杨思琦 committed
10
  };
11

杨思琦's avatar
杨思琦 committed
12 13 14 15 16
  useEffect(() => {
    if (linkUrl) {
      jumpLink();
    }
  }, []);
17

杨思琦's avatar
杨思琦 committed
18 19 20 21 22 23 24 25 26 27 28 29 30
  return (
    <div
      className={styles['jump-panel']}
      style={{
        background: `url(${BgImg}) center/100% 100% no-repeat`,
      }}
    >
      <div className={styles['jump-text']}>当前已打开跳转页,点击按钮打开</div>
      <Button className={styles['jump-button']} type="primary" onClick={jumpLink}>
        立即前往
      </Button>
    </div>
  );
31 32 33
};

export default JumpThirdLink;