|
@@ -3,8 +3,8 @@ import React, { useCallback, useEffect, useState } from "react";
|
|
|
import styles from "./index.module.scss";
|
|
|
import { A2_APItab5Info } from "@/store/action/A2Main";
|
|
|
import classNames from "classnames";
|
|
|
-import { domShowFu } from "@/utils/domShow";
|
|
|
-import SpinLoding from "@/components/SpinLoding";
|
|
|
+import { Spin } from "antd";
|
|
|
+import { LeftOutlined } from "@ant-design/icons";
|
|
|
|
|
|
type ListType = {
|
|
|
id: string;
|
|
@@ -15,9 +15,11 @@ type ListType = {
|
|
|
|
|
|
type Props = {
|
|
|
sId: number;
|
|
|
+ closeFu: () => void;
|
|
|
+ isOpen?: boolean;
|
|
|
};
|
|
|
|
|
|
-function Tab5Info({ sId }: Props) {
|
|
|
+function Tab5Info({ sId, closeFu, isOpen }: Props) {
|
|
|
const [data, setData] = useState([] as ListType[]);
|
|
|
|
|
|
const getInfoFu = useCallback(async () => {
|
|
@@ -74,10 +76,6 @@ function Tab5Info({ sId }: Props) {
|
|
|
const [waiUrl, setWaiUrl] = useState("");
|
|
|
|
|
|
useEffect(() => {
|
|
|
- domShowFu("#AsyncSpinLoding", true);
|
|
|
- }, [waiUrl]);
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
if (data[0]) {
|
|
|
if (data[0].link) {
|
|
|
setAcId(data[0].id);
|
|
@@ -93,6 +91,7 @@ function Tab5Info({ sId }: Props) {
|
|
|
}
|
|
|
}, [data]);
|
|
|
|
|
|
+ // 切换url
|
|
|
const cutAcFu = useCallback((id: string, url?: string) => {
|
|
|
if (url) {
|
|
|
setAcId(id);
|
|
@@ -100,6 +99,13 @@ function Tab5Info({ sId }: Props) {
|
|
|
}
|
|
|
}, []);
|
|
|
|
|
|
+ // 右边嵌套页面的加载loding
|
|
|
+ const [isLoding, setIsLoding] = useState(true);
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ setIsLoding(true);
|
|
|
+ }, [waiUrl]);
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.Tab5Info}>
|
|
|
<div className="Tab5Info1">
|
|
@@ -138,11 +144,28 @@ function Tab5Info({ sId }: Props) {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="Tab5Info2">
|
|
|
- <SpinLoding />
|
|
|
+ <div className="tab5Info2Loding" hidden={!isLoding}>
|
|
|
+ <Spin size="large" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* 遮挡原网址的 《 箭头 */}
|
|
|
+
|
|
|
+ <div
|
|
|
+ className={classNames(
|
|
|
+ "Tab5Info2Left",
|
|
|
+ isOpen ? "Tab5Info2LeftNo" : ""
|
|
|
+ )}
|
|
|
+ onClick={() => {
|
|
|
+ if (isOpen) {
|
|
|
+ } else closeFu();
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <LeftOutlined hidden={isOpen} />
|
|
|
+ </div>
|
|
|
|
|
|
{waiUrl ? (
|
|
|
<iframe
|
|
|
- onLoad={() => domShowFu("#AsyncSpinLoding", false)}
|
|
|
+ onLoad={() => setIsLoding(false)}
|
|
|
key={waiUrl}
|
|
|
src={waiUrl}
|
|
|
frameBorder="0"
|