提交 b7a8bf02 作者: 翁进城

加盟福利改为接口获取

上级 ea6070d9
......@@ -6,11 +6,23 @@ export interface CooperationApplyParams {
remark?: string,
userAccountId: number,
cooperationTagId: number
}
}
export interface GetTagIdResp {
id: number,
tagName: string,
tagImg: string,
tagDescription: string,
createTime: string
}
export default {
//请加盟
cooperationApply(params: CooperationApplyParams):Promise<Response<string>>{
//请加盟
cooperationApply(params: CooperationApplyParams): Promise<Response<string>> {
return request('/userapp/cooperation/apply', 'post', params)
},
//加盟标签相关内容
getTagById(params: { id: number }): Promise<Response<GetTagIdResp>> {
return request('/userapp/cooperation/getTagById', 'get', params)
}
}
\ No newline at end of file
import { Button, Col, Divider, Form, Input, Row } from "antd";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import LayoutView from "~/components/layout";
import api from "./api";
import styles from "./index.module.scss";
export default function JoinPolicy() {
const router = useRouter();
const [content, setContent] = useState(""); //福利内容
const tagId = Number(router.query.tagId);
useEffect(() => {
if (tagId) {
api
.getTagById({
id: tagId,
})
.then((res) => {
setContent(res.result?.tagDescription.replace("\n", "<br/>") || "");
});
}
}, []);
//提交
const onFinish = (values: any) => {
console.log(values);
api
.cooperationApply({
...values,
userAccountId: 1,
cooperationTagId: router.query.tagId,
cooperationTagId: tagId,
})
.then((res) => {
console.log("提交结果", res);
if (res.result === "已通过") {
if (res.code === "200") {
window.messageApi.success(res.result);
setTimeout(() => {
router.push("/");
}, 1500);
} else {
window.messageApi.error(res.message);
}
});
};
......@@ -50,24 +62,8 @@ export default function JoinPolicy() {
<div
className={styles.font2}
style={{ paddingLeft: 50, paddingRight: 50 }}
>
1.每月自动获取一张高额度优惠券
<br /> 2.流量扶持和店铺曝光度
<br />
3成为科比特指定官方生态合作伙伴
<br /> 4.享受不低于1亿制造采购补贴
<br /> 5.无人机产业链资源共享
<br /> 6.享受价值5亿产业链订单
<br /> 7.享受一对一代运营服务
<br /> 8.享受无人机生态圈资源
<br /> 9.成为科比特指定官方生态
<br />
10.享受无人机生态圈资源合作伙伴
<br />
11.受价值5亿产业链订单
<br />
12.成为科比特指定官方生态合作伙伴
</div>
dangerouslySetInnerHTML={{ __html: content }}
></div>
<Divider />
<div
className={styles.font1}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论