提交 7b100249 作者: 翁进城

招投标申请修正

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