提交 7b100249 作者: 翁进城

招投标申请修正

上级 78e4a5b6
import { Button, Empty, Pagination, Spin } from "antd"; import { Button, Empty, Pagination, Spin } from "antd";
import { useState, useEffect } from "react"; import { useState, useEffect, useContext } from "react";
import { UserContext } from "~/lib/userProvider";
import api, { Item } from "./api"; import api, { Item } from "./api";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
...@@ -21,6 +22,7 @@ export default function Bids(props: Props) { ...@@ -21,6 +22,7 @@ export default function Bids(props: Props) {
const [count, setCount] = useState(0); const [count, setCount] = useState(0);
const [abort, setAbort] = useState<AbortController | null>(null); const [abort, setAbort] = useState<AbortController | null>(null);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const {userInfo, setNeedLogin} = useContext(UserContext);
useEffect(() => { useEffect(() => {
//中断前一次请求 //中断前一次请求
...@@ -57,16 +59,22 @@ export default function Bids(props: Props) { ...@@ -57,16 +59,22 @@ export default function Bids(props: Props) {
}); });
}; };
//申请合作
const onApply = (item: Item) => { const onApply = (item: Item) => {
api if (userInfo) {
.apply({ api
tenderNewsId: item.id, .apply({
}) tenderNewsId: item.tenderNewsId,
.then((res) => { tenderInfoId: item.id,
if (res.code === "200") { })
window.messageApi.success("申请成功"); .then((res) => {
} if (res.code === "200") {
}); window.messageApi.success("申请成功");
}
});
} else {
setNeedLogin(true);
}
}; };
return ( return (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论