Merge pull request 'webview相关页面进入时先等待500毫秒等待cookie写入完成' (#14) from feat-20240118 into main
Reviewed-on: https://git.wishpal.cn/wishpal_ironfan/tiefen_space_web/pulls/14
This commit is contained in:
commit
8c1a9b71a1
|
@ -5,9 +5,9 @@ import { Toast } from "antd-mobile";
|
|||
import { generateSignature } from "@/utils/crypto";
|
||||
import webviewBaseRequest from "@/utils/webviewBaseRequest";
|
||||
|
||||
//todo:增加空数据展示图
|
||||
export default function BillDetail({ params }) {
|
||||
const [data, setData] = useState([]);
|
||||
const [isFetching, setIsFetching] = useState(true);
|
||||
useEffect(() => {
|
||||
const getData = async () => {
|
||||
let type;
|
||||
|
@ -58,11 +58,14 @@ export default function BillDetail({ params }) {
|
|||
return;
|
||||
}
|
||||
setData(temData.data.list);
|
||||
setIsFetching(false);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
getData();
|
||||
setTimeout(() => {
|
||||
getData();
|
||||
}, 500);
|
||||
}, []);
|
||||
|
||||
const RenderItem = ({ item }) => {
|
||||
|
@ -82,6 +85,14 @@ export default function BillDetail({ params }) {
|
|||
);
|
||||
};
|
||||
|
||||
if (isFetching) {
|
||||
return (
|
||||
<section className="flex flex-1 justify-center container">
|
||||
<span className="absolute top-1/2 loading loading-spinner loading-lg"></span>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="flex flex-1 flex-col">
|
||||
{data.length === 0 && (
|
||||
|
|
Loading…
Reference in New Issue