diff --git a/src/components/card/CardProj.tsx b/src/components/card/CardProj.tsx index 93d2d9e..141e2ab 100644 --- a/src/components/card/CardProj.tsx +++ b/src/components/card/CardProj.tsx @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import './card-proj.css'; // import { useDispatch } from 'react-redux' +import { GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts"; import { CheckOutlined, ClockCircleOutlined, @@ -11,12 +12,14 @@ import { LoadingOutlined, SearchOutlined, WarningOutlined, + RedoOutlined, + CloseOutlined } from '@ant-design/icons'; import { Button, Tag, Modal, Carousel } from 'antd'; import { GenerateStatus } from "../../interfaces/proj/IProj.ts"; import { useNavigate } from "react-router-dom"; import { Axios, post, downloadUrl, get, del } from "../../util/AjaxUtils.ts"; -import { useEffect, useState } from "react"; +import { useEffect, useState, useContext } from "react"; import useMessage from "antd/es/message/useMessage"; import setImg from '../../static/right/set.png' import orderImg from '../../static/right/order.png' @@ -31,6 +34,7 @@ import SoftwareManagementShow from '../../route/proj/edit/ProjConfigModListShow. import DisplayOrder from '../../route/proj/edit/ProjConfigMenuList.tsx' import DisplayOrderShow from '../../route/proj/edit/ProjConfigMenuListShow.tsx' export default function CardProj(props: any) { + const globalDispatchContext = useContext(GlobalDispatchContext); const height = window.innerHeight - 250; // 下载等待弹窗 const [downModal, setDownModal] = useState(false) @@ -64,13 +68,174 @@ export default function CardProj(props: any) { // }) // } const data = props.item; + // const [data, setData] = useState(props.item); // data.generate.generateStatus == GenerateStatus.SUCCESS ?'查看':'编辑' const [tagIdArray, setTagIdArray] = useState(data.tagDataIds) const [RemindIdArray, setRemindIdArray] = useState(data.projRemindIds) + const [showBuyPic, setShowBuyPic] = useState(data.projPkg.payStatus == 'UNPAID' ? true : false) //显示购买安装包 + const [showBuyPicIng, setShowBuyPicIng] = useState(data.projPkg.pkgStatus == 'PKGING' ? true : false) //显示安装包正在打包 + const [showBuyPicAgain, setShowBuyPicAgain] = useState(data.projPkg.pkgStatus == 'SUCCESS') //显示重新购买安装包 + const [showBuyPicError, setShowBuyPicError] = useState(data.projPkg.pkgStatus == 'FAIL' ? true : false) //显示安装包打包失败 + const [showBuyVideo, setShowBuyVideo] = useState(data.projVideo.payStatus == 'UNPAID' ? true : false) //显示购买视频 + const [showBuyVideoIng, setShowBuyVideoIng] = useState(data.projVideo.videoStatus == 'PKGING' ? true : false) //显示视频正在打包 + const [showBuyVideoAgain, setShowBuyVideoAgain] = useState(data.projVideo.videoStatus == 'SUCCESS' ? true : false) //显示重新购买视频 + const [showBuyVideoError, setShowBuyVideoError] = useState(data.projVideo.videoStatus == 'FAIL' ? true : false) //显示视频打包失败 + // const [showBuyPic, setShowBuyPic] = useState(true) //显示购买安装包 + // const [showBuyPicIng, setShowBuyPicIng] = useState(false) //显示安装包正在打包 + // const [showBuyPicAgain, setShowBuyPicAgain] = useState(false) //显示重新购买安装包 + const [buyModalShow, setBuyModalShow] = useState(false) //显示购买安装包提示弹窗 + const [buyVideoModalShow, setBuyVideoModalShow] = useState(false) //显示购买视频提示弹窗 + // const [pkgPrice, setPkgPrice] = useState(0) //安装包价格 + // const [videoPrice, setVideoPrice] = useState(0) //视频价格 + // const getPrice = () => { + // get({ + // messageApi: messageApi, + // url: '/api/proj/charge/get', + // onSuccess({ data }) { + // console.log('获取价格', data.additional.pkg/100,data.additional.videoDemo/100); + // setPkgPrice(data.additional.pkg/100) + // setVideoPrice(data.additional.videoDemo/100) + // } + // }) + // } + // 付款安装包 + const payPkg = () => { + post({ + messageApi, + url: `/api/proj/pkg/save-pkg/proj-id/${projId}`, + onBefore() { + }, + onSuccess() { + reloadUser(messageApi, globalDispatchContext).then(() => { + messageApi.success('扣款成功'); + setShowBuyPic(false); + setShowBuyPicIng(true); + setBuyModalShow(false); + setShowBuyPicAgain(false) + }); + }, + onFinally() { + + } + }) + } + // 重新打包安装包 + const againPkg = () => { + post({ + messageApi, + url: `/api/proj/pkg/save-pkg/proj-id/${projId}`, + + onBefore() { + + }, + onSuccess() { + messageApi.success('重新打包安装包'); + setShowBuyPic(false); + setShowBuyPicIng(true); + setBuyModalShow(false); + setShowBuyPicAgain(false) + setShowBuyPicError(false) + }, + onFinally() { + + } + }) + } + // 付款视频 + const payVideo = () => { + post({ + messageApi, + url: `/api/proj/video/save-pkg/proj-id/${projId}`, + + onBefore() { + + }, + onSuccess() { + reloadUser(messageApi, globalDispatchContext).then(() => { + messageApi.success('扣款成功'); + setShowBuyVideo(false); + setShowBuyVideoIng(true); + setBuyVideoModalShow(false); + setShowBuyVideoAgain(false) + }); + + }, + onFinally() { + + } + }) + } + // 重新打包视频 + const againVideo = () => { + post({ + messageApi, + url: `/api/proj/video/save-pkg/proj-id/${projId}`, + + onBefore() { + + }, + onSuccess() { + messageApi.success('重新打包演示视频'); + setShowBuyVideo(false); + setShowBuyVideoIng(true); + setBuyVideoModalShow(false); + setShowBuyVideoAgain(false) + setShowBuyVideoError(false) + + }, + onFinally() { + + } + }) + } + // 点击刷新页面数据获取安装包状态 + const upData = () => { + get({ + messageApi: messageApi, + url: `api/proj/pkg/get/proj-id/${projId}`, + onSuccess({ data }) { + // console.log(data); + if (data.pkgStatus == 'SUCCESS') { + messageApi.success('安装包生成完毕,请下载'); + setShowBuyPicAgain(true) + setShowBuyPicIng(false) + } else if (data.pkgStatus == 'FAIL') { + messageApi.error('安装包打包失败,点击重新打包'); + setShowBuyPicError(true) + setShowBuyPicIng(false) + } else { + messageApi.error('安装包正在生成,请稍后'); + } + } + }) + + } + // 点击刷新页面数据获取演示视频状态 + const upVideoData = () => { + get({ + messageApi: messageApi, + url: `api/proj/video/get/proj-id/${projId}`, + onSuccess({ data }) { + // console.log(data); + if (data.videoStatus == 'SUCCESS') { + messageApi.success('演示视频生成完毕,请下载'); + setShowBuyVideoAgain(true) + setShowBuyVideoIng(false) + } else if (data.videoStatus == 'FAIL') { + messageApi.error('演示视频打包失败,点击重新打包'); + setShowBuyPicError(true) + setShowBuyVideoIng(false) + }else{ + messageApi.error('演示视频正在生成,请稍后'); + } + } + }) + + } const downAll = (projId: string, name: string) => { setHasDown(true) if (!hasDown) { @@ -311,7 +476,6 @@ export default function CardProj(props: any) { // getTag() // console.log('查看数据', data); // console.log('查看状态', data.pay.payStatus); - }, []) return ( @@ -329,6 +493,7 @@ export default function CardProj(props: any) { }}> {payCharge} +
| - - { - window.open(`${Axios.defaults?.baseURL}/${data.previewUrl}`, '_blank') - }}/> - { - window.open(`${Axios.defaults?.baseURL}/${data.previewUrl}`, '_blank') - }}>预览 - + + { + window.open(`${Axios.defaults?.baseURL}/${data.previewUrl}`, '_blank') + }} /> + { + window.open(`${Axios.defaults?.baseURL}/${data.previewUrl}`, '_blank') + }}>预览 +
@@ -474,8 +639,8 @@ export default function CardProj(props: any) {
{/*
基础费用:{basicsValue}
*/} 加急:{URGENTvalue} - 安装包:{pkgValue} - 演示视频:{videoDemoValue} + {/* 安装包:{pkgValue} + 演示视频:{videoDemoValue} */}
@@ -598,9 +763,8 @@ export default function CardProj(props: any) { window.open(`${Axios.defaults?.baseURL}/route/proj/download/apply/${data.projId}`) }}> 申请表 - {/* */} + +
操作手册 @@ -616,12 +780,12 @@ export default function CardProj(props: any) { }}> pdf
- { + {/* { isShow && - } + } */} {/* */} @@ -647,6 +811,16 @@ export default function CardProj(props: any) { // window.open(`${Axios.defaults?.baseURL}/route/proj/download/all/${data.projId}`) downAll(data.projId, data.projName) }}> 全部 + +
) : <> } @@ -698,13 +872,118 @@ export default function CardProj(props: any) { {/*
*/} -
+
-当前状态-
{renderGenerateStatus()}
+
+
+
{ + setBuyModalShow(true); + }} + >购买安装包
+
{ + upData() + }} + > + 安装包制作中 +
+
{ + setBuyModalShow(true); + }} + style={{ + display: showBuyPicAgain ? 'unset' : 'none' + }} + >重新购买安装包
+
{ + // setBuyModalShow(true); + againPkg() + }} + style={{ + display: showBuyPicError ? 'unset' : 'none', + cursor: 'pointer', + textWrap: 'nowrap' + }} + > + 安装包打包失败 +
+
+
+
{ + setBuyVideoModalShow(true); + }} + >购买演示视频
+
{ + // upData() + upVideoData() + }} + > + 演示视频制作中 +
+
{ + setBuyVideoModalShow(true); + }} + style={{ + display: showBuyVideoAgain ? 'unset' : 'none' + }} + >重新购买演示视频
+
{ + // setBuyModalShow(true); + // againPkg() + againVideo() + }} + style={{ + display: showBuyVideoError ? 'unset' : 'none', + cursor: 'pointer', + textWrap: 'nowrap' + }} + > + 演示视频打包失败 +
+
+
+ +
+ < Modal open={buyModalShow} + centered + title="提示" + destroyOnClose={true} + width={500} + onCancel={() => { + setBuyModalShow(false); + } + } + // onOk={() => { + // setShowBuyPic(false) + // setShowBuyPicIng(true) + // setBuyModalShow(false); + + // } + // } + footer={[ + , + , + ]} + + > +
购买安装包需要花费{props.pkgPrice}元,是否继续购买?
+
*注:购买后无法退款,修改后需重新购买下载!
+ {/*
注:安装包制作时长为1-3个工作日
*/} + + < Modal open={buyVideoModalShow} + centered + title="提示" + destroyOnClose={true} + width={500} + onCancel={() => { + setBuyVideoModalShow(false); + } + } + // onOk={() => { + // setShowBuyPic(false) + // setShowBuyPicIng(true) + // setBuyModalShow(false); + + // } + // } + footer={[ + , + , + ]} + + > +
购买演示视频需要花费{props.videoPrice}元,是否继续购买?
+
*注:购买后无法退款,修改后需重新购买下载!
+ {/*
注:安装包制作时长为1-3个工作日
*/} + ) } \ No newline at end of file diff --git a/src/components/card/CardProjDownload.tsx b/src/components/card/CardProjDownload.tsx index a40c54d..5fbae4c 100644 --- a/src/components/card/CardProjDownload.tsx +++ b/src/components/card/CardProjDownload.tsx @@ -1,7 +1,14 @@ import './card-proj-download.css'; import { IProjDownload } from "../../interfaces/card/ICardProj.ts"; - +import { + CloseOutlined, RedoOutlined, +} from '@ant-design/icons'; +// import { useEffect } from "react"; export default function CardProjDownload(props: IProjDownload) { + // useEffect(() => { + // console.log(props); + + // }, []) return ( //
@@ -12,15 +19,68 @@ export default function CardProjDownload(props: IProjDownload) { { props.canBtnClick ? (
-
+ +
+ { + e.preventDefault(); + props.handleDownload(); + }}>下载 +
{ + props.againPkg() + }} + style={{ minWidth: 30, display: props.pkgStatus == 'FAIL' ? 'unset' : 'none',color:'red',fontWeight:700,cursor:'pointer',whiteSpace: 'nowrap', }}> + 打包失败 +
+
{ + props.upData() + }} + > + 正在打包< RedoOutlined spin /> +
+ +
+
+ { + e.preventDefault(); + props.handleDownload(); + }}>下载 +
{ + // props.againPkg() + props.againVideo() + }} + style={{ minWidth: 30, display: props.videoStatus == 'FAIL' ? 'unset' : 'none',color:'red',fontWeight:700,cursor:'pointer' ,whiteSpace: 'nowrap',}}> + 打包失败 +
+
{ + // props.upData() + props.upVideoData() + }} + > + 正在打包< RedoOutlined spin /> +
+ + +
下载 : - { + { e.preventDefault(); props.handleDownload(); }}>word @@ -41,7 +101,7 @@ export default function CardProjDownload(props: IProjDownload) { }}>下载
- +
下载 : { e.preventDefault(); }} >word { diff --git a/src/components/card/card-proj.css b/src/components/card/card-proj.css index 3d6e6b7..f7f01f7 100644 --- a/src/components/card/card-proj.css +++ b/src/components/card/card-proj.css @@ -1,15 +1,16 @@ @media (min-width: 1571px) { .selectTagmin { - + display: none; } .selectTagmax { display: flex; - - - + + + } + .option { display: flex; /* background-color: red; */ @@ -29,7 +30,7 @@ } .down-pdf { - margin-left: 5px; + /* margin-left: 5px; */ } .card-proj { @@ -302,7 +303,7 @@ align-items: center; margin-right: 24px; color: #707070; - + } /* .threeBtn:hover { @@ -895,6 +896,7 @@ margin-right: 24px; color: #707070; margin-bottom: 5px; + text-wrap: nowrap; } /* .threeBtn:hover { @@ -1203,4 +1205,57 @@ justify-content: space-between; align-items: center; } */ +} + +.buyBtn { + /* width: 120px; */ + padding: 0 10px 0 10px; + height: 19px; + background: #FFEDED; + border-radius: 5px; + border: 1px solid #D45C56; + font-size: 12px; + color: #C52A2A; + cursor: pointer; +} +.buyBox{ + /* display: flex; + align-items: center; + justify-content: center; */ + text-align: center; + line-height: 19px; + +} +.buyIng{ + /* width: 120px; */ + padding: 0 10px 0 10px; + height: 19px; + background: #F4FFED; + border-radius: 3px; + border: 1px solid #389D3A; + font-size: 12px; + color: #389D3A; +} +.buyAgein{ + /* width: 120px; */ + padding: 0 10px 0 10px; + height: 19px; + background: #FFEDED; + border-radius: 5px; + border: 1px solid #D45C56; + font-size: 12px; + color: #C52A2A; + cursor: pointer; + /* 禁止换行 */ + white-space: nowrap; +} +.modalText{ + font-size: 16px; + font-weight: 700; +} +.modalTip{ + font-size: 14px; + color: #ff0000; + font-weight: 700; + margin-top: 10px; } \ No newline at end of file diff --git a/src/components/list/ListProj.tsx b/src/components/list/ListProj.tsx index 9925703..b8c85bb 100644 --- a/src/components/list/ListProj.tsx +++ b/src/components/list/ListProj.tsx @@ -50,6 +50,19 @@ export default function ListProj() { const [total, setTotal] = useState(0); const [projs, setProjs] = useState([]); const [isLoading, setIsLoading] = useState(false); + const [pkgPrice, setPkgPrice] = useState(0) //安装包价格 + const [videoPrice, setVideoPrice] = useState(0) //视频价格 + const getPrice = () => { + get({ + messageApi: messageApi, + url: '/api/proj/charge/get', + onSuccess({ data }) { + // console.log('获取价格', data.additional.pkg/100,data.additional.videoDemo/100); + setPkgPrice(data.additional.pkg/100) + setVideoPrice(data.additional.videoDemo/100) + } + }) + } // const [keywords, setKeywords] = useState(''); const domHeight = window.innerHeight - 250; // const navigate = useNavigate() @@ -157,7 +170,7 @@ export default function ListProj() { // console.log('这啥啊',indexListContext.categoryChangeCount); // console.log('这啥啊2',indexListContext.category) getremindTag() - + getPrice() }, []) // 更新数据 // const upreqData = () => { @@ -212,6 +225,8 @@ export default function ListProj() {
diff --git a/src/interfaces/card/ICardProj.ts b/src/interfaces/card/ICardProj.ts index 46ca8b5..ea4d601 100644 --- a/src/interfaces/card/ICardProj.ts +++ b/src/interfaces/card/ICardProj.ts @@ -39,7 +39,13 @@ export interface IProjDownload { canBtnClick?: boolean; handleDownload(): void; - downPdf():void + downPdf():void; + pkgStatus?:string; + videoStatus?:string; + upData?:any; + againPkg?:any; + upVideoData?:any; + againVideo?:any; } export interface IProjJump { diff --git a/src/layout/head/Head.tsx b/src/layout/head/Head.tsx index b02dd71..8c58096 100644 --- a/src/layout/head/Head.tsx +++ b/src/layout/head/Head.tsx @@ -3,10 +3,103 @@ import './head.css' import { useDispatch } from 'react-redux' import BalanceHead from '../../components/balance/BalanceHead.tsx'; import RechargeHead from '../../components/recharge/RechargeHead.tsx'; -import { Dropdown, MenuProps, message, Modal, Space, Spin, Input } from "antd"; +import { Empty, Dropdown, MenuProps, message, Modal, Space, Spin, Input, Table, Form, Button, InputNumber } from "antd"; +import type { TableProps, FormProps } from 'antd'; +interface DataType { + usericId: string; + icPriceMaterial: number; + icPriceAll: number; + createTime: string; + +} +interface icDataType { + contactName: string;//联系人姓名 + contactPhone: string;//联系人电话 + idCardNumber: string;//证件号 + idCardType: string;//证件类型 + lastLoginTime: string;//最后登录时间 + userId: string;//用户id + userInfoId: string;//主键 + userInfoName: string;//用户名称 + userInfoNameEn: string;//用户英文名称 + userInfoType: string;//用户类型 + userUsername: string;//用户名 +} +type FieldType = { + icPriceMaterial: string; + icPriceAll: string; +}; + +// const data: DataType[] = [ +// { +// key: '1', +// code: 'xixi112', +// price: 32, + +// }, +// { +// key: '2', +// code: 'xixi22', +// price: 42, + +// }, +// { +// key: '3', +// code: 'hehe23', +// price: 32, + +// }, +// { +// key: '4', +// code: 'hehe1232', +// price: 32, + +// }, +// { +// key: '4', +// code: 'hehe123', +// price: 32, + +// }, +// { +// key: '5', +// code: 'hehe1235', +// price: 32, + +// }, +// { +// key: '6', +// code: 'hehe1236', +// price: 32, + +// }, +// { +// key: '7', +// code: 'hehe1237', +// price: 32, + +// }, +// { +// key: '8', +// code: 'hehe1238', +// price: 32, + +// }, +// { +// key: '9', +// code: 'hehe1239', +// price: 32, + +// }, +// ]; + import { DownOutlined, UserOutlined, QuestionCircleOutlined, BellOutlined, KeyOutlined, LogoutOutlined, GiftOutlined, AccountBookOutlined, ContainerOutlined, MenuFoldOutlined, UsergroupAddOutlined, } from "@ant-design/icons"; import { useContext, useEffect, useState } from "react"; -import { put, get, post, getUseUrl } from "../../util/AjaxUtils.ts"; +import { + put, get, + post, + getUseUrl +} from "../../util/AjaxUtils.ts"; import { GlobalContext, GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts"; import UserEdit from "../../components/user/UserEdit.tsx"; import PasswordChange from "../../components/password/PasswordChange.tsx"; @@ -25,6 +118,14 @@ import MyOrder from '../../components/myOrder/MyOrder.tsx' import NoticeModal from '../../components/NoticeModal/NoticeModal.tsx'; // import HeadCouponModal from '../../components/CouponModal/HeadCouponModal.tsx' export default function Head() { + const [page, setPage] = useState(1) //邀请码使用人数分页 + const [total, setTotal] = useState(0) //邀请码使用人数总量 + const [icListLoading, setIcListLoading] = useState(false) + + const [myInvModal, setMyInvModal] = useState(false) //我的邀请码弹窗 + const [createInvModal, setCreateInvModal] = useState(false) //创建邀请码弹窗 + const [icModal, setIcModal] = useState(false) //查看邀请码详情弹窗 + const [selectIc, setSelectIc] = useState('') //选中的邀请码 // const redxuState: any = useSelector(state => state) // const couponModal = redxuState.couponModal // 消息通知弹窗 @@ -52,13 +153,13 @@ export default function Head() { // 解除绑定邀请码弹窗 // const [relieveModal, setRelieveModal] = useState(false) // 申请的邀请码 - const [invNum, setInvNum] = useState('') + // const [invNum, setInvNum] = useState('') // 输入的邀请码 const [inInvNum, setInInvNum] = useState('') // 已绑定的邀请码 const [bindingInvNum, setBindingInvNum] = useState('') // 邀请码申请状态 - const [icStatus, setIcStatus] = useState('') + // const [icStatus, setIcStatus] = useState('') // 邀请码返利比例 const [icRebateRatio, seticRebateRatio] = useState('') // 全托管分账 @@ -66,18 +167,18 @@ export default function Head() { // 写材料分账 const [icPriceMaterial, seticPriceMaterial] = useState(0) // 获取邀请码申请状态 - const getIcStatus = () => { - get({ - messageApi, - url: '/api/ic/apply/get/self', - onSuccess({ data }) { - // console.log(data); - if (data) { - setIcStatus(data.applyStatus) - } - } - }) - } + // const getIcStatus = () => { + // get({ + // messageApi, + // url: '/api/ic/apply/get/self', + // onSuccess({ data }) { + // // console.log(data); + // if (data) { + // setIcStatus(data.applyStatus) + // } + // } + // }) + // } // 获取邀请码信息 const getIc = () => { get({ @@ -88,13 +189,13 @@ export default function Head() { }, onSuccess({ data }) { // console.log(data); - setInvNum(data.ic) + // setInvNum(data.ic) setBindingInvNum(data.relationIc) seticRebateRatio(data.icRebateRatio) seticPriceAll(Number(data.icPriceAll) / 100 * Number(data.icRebateRatio) / 100) seticPriceMaterial(Number(data.icPriceMaterial) / 100 * Number(data.icRebateRatio) / 100) if (data.ic == '') { - getIcStatus() + // getIcStatus() } }, onFinally() { @@ -139,35 +240,158 @@ export default function Head() { putIc() } } - // 点击获取邀请码 - const getInvNum = () => { - post({ + // 我的邀请码列表 + const [myIcList, setMyIcList] = useState([]) + // 获取我得邀请码列表 + const getMyIcList = () => { + get({ messageApi, - url: `/api/ic/apply/apply`, + url: '/api/ic/v2/list/self', + // body: { + // value: inInvNum + // }, + onBefore() { + setIcListLoading(true) + }, + onSuccess({ data }) { + // console.log(data); + setMyIcList(data) + // setMyIcList([]) + }, + onFinally() { + setIcListLoading(false) + } + }) + } + const [minAllPrice, setMinAllPrice] = useState(0) //最低全托管折扣价 + const [minMaterialPrice, setMinMaterialPrice] = useState(0) //最低写材料折扣价 + // 查看我得最低定价 + const getMyIcMinPrice = () => { + get({ + messageApi, + url: '/api/proj/charge/get', onBefore() { }, - onSuccess() { - messageApi.success('已申请') - getIcStatus() + onSuccess({ data }) { + // console.log(data.projTypes); + // console.log((data.projTypes.find((item:any) => item.type === 'MATERIAL')).price/100); + + setMinAllPrice((data.projTypes.find((item: any) => item.type === 'ALL')).price / 100) + setMinMaterialPrice((data.projTypes.find((item: any) => item.type === 'MATERIAL')).price / 100) + }, onFinally() { } }) - // setInvNum('RSDNQ5H7') + } + // 查看我的邀请码是否超出限制 + const getIcLimit = () => { + get({ + messageApi, + url: '/api/ic/v2/list/self', + onBefore() { + + }, + onSuccess({ data }) { + // console.log(data); + // console.log(data.length); + + if (data.length >= 10) { + messageApi.open({ + type: 'error', + content: '您的邀请码已达上限' + }) + } else { + setCreateInvModal(true) + getMyIcMinPrice() + } + } + }) + } + // 点击获取邀请码 + // const getInvNum = () => { + // post({ + // messageApi, + // url: `/api/ic/apply/apply`, + // onBefore() { + + // }, + // onSuccess() { + // messageApi.success('已申请') + // getIcStatus() + // }, + // onFinally() { + + // } + // }) + // // setInvNum('RSDNQ5H7') + // } + + // 表单事件 + const onFinish: FormProps['onFinish'] = (values: any) => { + // console.log('Success:', values.icPriceAll); + // console.log('Success:', values.icPriceMaterial); + post({ + messageApi, + url: `/api/ic/v2/save`, + body: { + icPriceAll: values.icPriceAll * 100, + icPriceMaterial: values.icPriceMaterial * 100 + }, + onBefore() { + setIcListLoading(true) + }, + onSuccess() { + // console.log(data); + messageApi.success('创建成功') + // 关闭弹窗 + setCreateInvModal(false) + + }, + onFinally() { + setIcListLoading(false) + } + }) + }; + + // const onFinishFailed: FormProps['onFinishFailed'] = (errorInfo) => { + // console.log('Failed:', errorInfo); + // }; + // 使用的邀请码的人的信息列表 + const [icList, setIcList] = useState([]); + // 获取使用的邀请码的人的信息 + const getIcUserInfo = (id: string, page: number) => { + get({ + messageApi, + url: `/api/ic/v2/user-list/${id}`, + config: { + params: { + page: page, + rows: 10 + } + }, + onBefore() { + setIcListLoading(true) + }, + onSuccess({ data }) { + setIcList(data.rows) + setTotal(data.total) + + }, + onFinally() { + setIcListLoading(false) + } + + }) } // 复制邀请码 - const copyInvNum = () => { - // navigator.clipboard.writeText(invNum) - // messageApi.open({ - // type: 'success', - // content: '已复制到剪切板' - // }) + const copyInvNum = (code: any) => { // 创建一个临时的 input 元素 const tempInput = document.createElement('input'); document.body.appendChild(tempInput); - tempInput.value = invNum; + tempInput.value = code; // 选中 input 中的内容 tempInput.select(); @@ -190,7 +414,123 @@ export default function Head() { // 移除临时的 input 元素 document.body.removeChild(tempInput); } + const columns: TableProps['columns'] = [ + { + title: '序号', + align: 'center', + dataIndex: 'usericId', + key: 'usericId', + render: (_text, _record, index) =>
+ {index + 1} +
, + }, + { + title: '邀请码', + align: 'center', + dataIndex: 'usericId', + key: 'usericId', + // render: (text) =>
{text}, + }, + { + title: '创建时间', + align: 'center', + dataIndex: 'createTime', + key: 'usericId', + // render: (text) => {text}, + }, + { + title: '写材料价格', + align: 'center', + dataIndex: 'icPriceMaterial', + key: 'usericId', + render: (text) => <>{text / 100}元 + }, + { + title: '全托管价格', + align: 'center', + dataIndex: 'icPriceAll', + key: 'usericId', + render: (text) => <>{text / 100}元 + }, + // { + // title: '返利比例', + // align: 'center', + // dataIndex: 'icRebateTatio', + // key: 'usericId', + // render: (text) => <>{text}%, + // }, + // { + // title: '产生的成交金额', + // align: 'center', + // dataIndex: 'totalMoney', + // key: 'usericId', + // }, + { + title: '操作', + align: 'center', + key: 'usericId', + render: (_, record) => ( + + + { + copyInvNum(record.usericId) + }}>复制 + { + setIcModal(true) + setSelectIc(record.usericId) + getIcUserInfo(record.usericId, page) + }}>查看使用用户 + + + + ), + }, + ]; + const icColumns: TableProps['columns'] = [ + { + title: '序号', + align: 'center', + dataIndex: 'index', + key: 'userInfoId', + render: (_text, _record, index) =>
+ {index + 1} +
, + }, + // { + // title: '用户ID', + // align: 'center', + // dataIndex: 'userId', + // key: 'userInfoId', + // // render: (text) => {text}, + // }, + { + title: '账号', + align: 'center', + dataIndex: 'userUsername', + key: 'userInfoId', + // render: (text) => {text}, + }, + { + title: '昵称', + align: 'center', + dataIndex: 'userInfoName', + key: 'userInfoId', + // render: (text) => {text}, + }, + { + title: '最近登录时间', + align: 'center', + dataIndex: 'lastLoginTime', + key: 'userInfoId', + // render: (text) => {text}, + }, + + ] const dispath = useDispatch() // 更新所属者表格储存至redux const upBelongArray = () => { @@ -624,7 +964,7 @@ export default function Head() { { // getNewLength() setinvitationModal(false) - setInvNum('') + // setInvNum('') setInInvNum('') }}>
-
+ {/*
我的邀请码
@@ -671,7 +1011,34 @@ export default function Head() {
+
*/} +
+
+ { + getMyIcList() + setMyInvModal(true) + }} + style={{ + cursor: 'pointer' + }}>查看我的邀请码 +
+
+
+ { + // setCreateInvModal(true) + getIcLimit() + + }} + style={{ + cursor: 'pointer' + }}>创建邀请码 +
+ {/*
*/}
@@ -756,6 +1123,7 @@ export default function Head() { */}
若已登录电脑端, { - window.open('https://work.weixin.qq.com/kfid/kfc599f9d40b65ac392') - } - }>点击联系客服 + () => { + window.open('https://work.weixin.qq.com/kfid/kfc599f9d40b65ac392') + } + }>点击联系客服
@@ -826,7 +1194,202 @@ export default function Head() { // setCouponModal(false) }}> */} + { + setMyInvModal(false) + }}> + +
+ + { + return ( +
+ +
+ ) + }, + }} + /> + + + + { + setCreateInvModal(false) + + }}> +
+ +
+
* 全托管价格
+ + // label={ + //
全托管价格
+ // } + name="icPriceAll" + rules={[ + { required: true, message: '请输入写全托管价格' }, + { + validator: (_, value) => { + if (value && Number(value) < minAllPrice) { + return Promise.reject(new Error(`全托管价格不能小于${minAllPrice}`)); + } + return Promise.resolve(); + }, + }, + ]} + > + + +
+
+
* 写材料价格
+ + + // label={ + //
写材料价格
+ // } + name="icPriceMaterial" + rules={[ + { required: true, message: '请输入写材料价格' }, + { + validator: (_, value) => { + if (value && Number(value) < minMaterialPrice) { + return Promise.reject(new Error(`写材料价格不能小于${minMaterialPrice}`)); + } + return Promise.resolve(); + }, + }, + ]} + > + + +
+ + + +
+ +
+
+ + +
+
+
+ { + setIcModal(false) + + }}> + + + +
{ + setPage(currentPage); + getIcUserInfo(selectIc, currentPage) + }, + showSizeChanger: false, + current: page + + } + } + bordered + key="userInfoId" + rowKey="userInfoId" + locale={{ + emptyText: () => { + return ( +
+ +
+ ) + }, + }} + /> + + + {contextHolder} {modalHolder} diff --git a/src/layout/head/head.css b/src/layout/head/head.css index 3e1390d..ebe539d 100644 --- a/src/layout/head/head.css +++ b/src/layout/head/head.css @@ -48,22 +48,26 @@ justify-content: right; align-items: center; } + .head .center .right .kf { /* margin-right: 20px; */ - display: flex; - /* background-color: pink; */ - justify-content: center; - cursor: pointer; + display: flex; + /* background-color: pink; */ + justify-content: center; + cursor: pointer; } + .head .center .right .kf .kfText { margin-left: 5px; font-size: 16px; font-weight: 700; - } - .head .center .right .kf .kfIcon { +} + +.head .center .right .kf .kfIcon { font-size: 16px; color: #FF9F08; - } +} + /* .head .center .left .logo { width: 38px; @@ -138,9 +142,41 @@ /* background-color: skyblue; */ } +.invBox-titleTop { + width: 50%; + font-weight: bold; + font-size: 24px; + display: flex; + justify-content: center; + /* cursor: ; */ +} + +.createInv { + width: 50%; + /* font-weight: bold; + font-size: 24px; + display: flex; + justify-content: center; */ + font-weight: 400; + font-size: 24px; + color: #009C1D; + text-decoration-line: underline; + text-align: center; + line-height: 118px; + /* cursor: pointer; */ +} + +.invBox-lineTop { + width: 1px; + height: 22px; + background: #626262; +} + .invBox-title { /* height: 118px; */ width: 165px; + width: 200px; + /* background-color: pink; */ font-weight: bold; font-size: 24px; @@ -149,6 +185,16 @@ /* line-height: 118px; */ } +/* .invBox-titleTop{ + width:190px; + font-weight: bold; + font-size: 24px; + color: #454545; + text-align: center; + background-color: pink; + +} */ + .invBox-line { width: 1px; height: 22px; @@ -169,6 +215,7 @@ } + .invBox-btnTwo { width: 362px; height: 118px; @@ -295,21 +342,24 @@ text-decoration-line: underline; cursor: pointer; } -.headLine{ + +.headLine { height: 20px; width: 1px; background-color: rgb(218, 218, 218); margin-left: 10px; margin-right: 10px; } -.head-notice{ + +.head-notice { color: #f78e4c; font-size: 28px; /* background-color: pink; */ position: relative; cursor: pointer; } -.noticeNum{ + +.noticeNum { top: 0; left: 15px; position: absolute; @@ -320,10 +370,10 @@ color: white; font-size: 12px; text-align: center; - line-height: 20px; + line-height: 20px; } -.kfBox{ +.kfBox { /* background-color: pink; */ /* border: 1px solid rgb(209, 209, 209); */ /* border-radius: 5px; */ @@ -332,22 +382,26 @@ align-items: center; padding: 20px 10px; } -.kfTitle{ + +.kfTitle { font-size: 25px; font-weight: 700; } -.kfImg{ + +.kfImg { border: 1px solid rgb(226, 226, 226); border-radius: 5px; padding: 10px; margin-top: 20px; } -.kfHttp{ - font-size: 16px; - margin-top: 20px; - color: rgb(124, 124, 124); + +.kfHttp { + font-size: 16px; + margin-top: 20px; + color: rgb(124, 124, 124); } -.kfHttpText{ + +.kfHttpText { cursor: pointer; color: #5980B5; } \ No newline at end of file diff --git a/src/route/proj/ProjEdit.tsx b/src/route/proj/ProjEdit.tsx index 02f64c8..a1952ed 100644 --- a/src/route/proj/ProjEdit.tsx +++ b/src/route/proj/ProjEdit.tsx @@ -101,7 +101,15 @@ export default function ProjEdit() { const nav = useNavigate(); const pathParams = useParams(); // 是否显示下载代码压缩包模块 - const [showZpi, setShowZpi] = useState(false) + // const [showZpi, setShowZpi] = useState(false) + // 是否显示下载安装包模块 + const [showPkg, setShowPkg] = useState(false) + // 安装包模块生成状态 + const [pkgStatus, setPkgStatus] = useState('') + // 视频模块生成状态 + const [videoStatus, setVideoStatus] = useState('') + // 是否显示下载演示视频 + const [showVideo, setShowVideo] = useState(false) const [messageApi, contextHolder] = message.useMessage(); const [editStepArray, setEditStepArray] = useState([]); const [configArray, setConfigArray] = useState([]); @@ -124,8 +132,85 @@ export default function ProjEdit() { }); + // 点击刷新页面数据获取安装包状态 + const upData = () => { + get({ + messageApi: messageApi, + url: `api/proj/pkg/get/proj-id/${pathParams.projId}`, + onSuccess({ data }) { + // console.log(data); + if (data.pkgStatus == 'SUCCESS') { + messageApi.success('安装包生成完毕,请下载'); + setPkgStatus('SUCCESS') + } else if (data.pkgStatus == 'FAIL') { + setPkgStatus('FAIL') + messageApi.error('安装包打包失败,点击重新打包'); + } else { + messageApi.error('安装包正在生成,请稍后'); + } + } + }) + + } + // 点击刷新页面数据获取演示视频状态 + const upVideoData = () => { + get({ + messageApi: messageApi, + url: `api/proj/video/get/proj-id/${pathParams.projId}`, + onSuccess({ data }) { + // console.log(data); + if (data.videoStatus == 'SUCCESS') { + messageApi.success('演示视频生成完毕,请下载'); + setVideoStatus('SUCCESS') + } else if (data.videoStatus == 'FAIL') { + messageApi.error('演示视频打包失败,点击重新打包'); + setVideoStatus('FAIL') + + } else { + messageApi.error('演示视频正在生成,请稍后'); + } + } + }) + + } + // 重新打包安装包 + const againPkg = () => { + post({ + messageApi, + url: `/api/proj/pkg/save-pkg/proj-id/${pathParams.projId}`, + + onBefore() { + + }, + onSuccess() { + messageApi.success('重新打包安装包'); + setPkgStatus('PKGING') + }, + onFinally() { + + } + }) + } + const againVideo = () => { + post({ + messageApi, + url: `/api/proj/video/save-pkg/proj-id/${pathParams.projId}`, + + onBefore() { + + }, + onSuccess() { + messageApi.success('重新打包演示视频'); + setVideoStatus('PKGING') + + }, + onFinally() { + + } + }) + } // const height = window.innerHeight - 240; const renderEditStep = (data: any, isEdited: boolean, isGenerateSuccess: boolean) => { @@ -332,14 +417,24 @@ export default function ProjEdit() { } // console.log('状态判断', data.pay.chargeAdditionals); // setShowZpi(true) - const isShow = data.pay.chargeAdditionals.includes('PKG') - // console.log(isShow); - if (isShow) { - setShowZpi(true) - } else { - setShowZpi(false) - } + // const isShow = data.pay.chargeAdditionals.includes('PKG') + // // console.log(isShow); + // if (isShow) { + // setShowZpi(true) + // } else { + // setShowZpi(false) + // } + // console.log(data.projVideo.videoStatus); + // console.log(data.projPkg.pkgStatus); + if (data.projPkg.payStatus == 'PAID') { + setShowPkg(true) + setPkgStatus(data.projPkg.pkgStatus) + } + if (data.projVideo.payStatus == 'PAID') { + setShowVideo(true) + setVideoStatus(data.projVideo.videoStatus) + } // const isEdited = data.editSteps[0].editStatus == EditStepEnum.EDITED // && data.editSteps[1].editStatus == EditStepEnum.EDITED @@ -627,7 +722,7 @@ export default function ProjEdit() { window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/pdf/${pathParams.projId}`) }} /> - {showZpi && ( + {/* {showZpi && ( + )} */} + {showPkg && ( + { + ///route/proj/download/pkg/{projId} + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/apply/${pathParams.projId}`) + window.open(`${Axios.defaults?.baseURL}/route/proj/download/pkg/${pathParams.projId}`) + }} + downPdf={() => { + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/apply/pdf/${pathParams.projId}`) + }} + pkgStatus={pkgStatus} + + upData={() => { + upData() + }} + againPkg={() => { + againPkg() + }} + /> + )} + {showVideo && ( + { + ///route/proj/download/pkg/{projId} + window.open(`${Axios.defaults?.baseURL}/route/proj/download/video/${pathParams.projId}`) + }} + downPdf={() => { + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/apply/pdf/${pathParams.projId}`) + }} + upVideoData={() => { + upVideoData() + }} + againVideo={() => { + againVideo() + }} + /> )} {/* >[0]; export default function ProjEditAll() { + // 是否显示下载安装包模块 + const [showPkg, setShowPkg] = useState(false) + // 是否显示下载演示视频 + const [showVideo, setShowVideo] = useState(false) + // 安装包模块生成状态 + const [pkgStatus, setPkgStatus] = useState('') + // 视频模块生成状态 + const [videoStatus, setVideoStatus] = useState('') + // 点击刷新页面数据获取安装包状态 + const upData = () => { + get({ + messageApi: messageApi, + url: `api/proj/pkg/get/proj-id/${pathParams.projId}`, + onSuccess({ data }) { + // console.log(data); + if (data.pkgStatus == 'SUCCESS') { + messageApi.success('安装包生成完毕,请下载'); + setPkgStatus('SUCCESS') + + } else if (data.pkgStatus == 'FAIL') { + setPkgStatus('FAIL') + messageApi.error('安装包打包失败,点击重新打包'); + + } else { + messageApi.error('安装包正在生成,请稍后'); + } + } + }) + + } + // 点击刷新页面数据获取演示视频状态 + const upVideoData = () => { + get({ + messageApi: messageApi, + url: `api/proj/video/get/proj-id/${pathParams.projId}`, + onSuccess({ data }) { + // console.log(data); + if (data.videoStatus == 'SUCCESS') { + messageApi.success('演示视频生成完毕,请下载'); + setVideoStatus('SUCCESS') + } else if (data.videoStatus == 'FAIL') { + messageApi.error('演示视频打包失败,点击重新打包'); + setVideoStatus('FAIL') + + } else { + messageApi.error('演示视频正在生成,请稍后'); + } + } + }) + + } + // 重新打包安装包 + const againPkg = () => { + post({ + messageApi, + url: `/api/proj/pkg/save-pkg/proj-id/${pathParams.projId}`, + + onBefore() { + + }, + onSuccess() { + messageApi.success('重新打包安装包'); + setPkgStatus('PKGING') + }, + onFinally() { + + } + }) + } + const againVideo = () => { + post({ + messageApi, + url: `/api/proj/video/save-pkg/proj-id/${pathParams.projId}`, + + onBefore() { + + }, + onSuccess() { + messageApi.success('重新打包演示视频'); + setVideoStatus('PKGING') + + }, + onFinally() { + + } + }) + } // 项目状态 const [projStatus, setprojStatus] = useState('') // 进度提示弹窗 @@ -396,6 +483,14 @@ export default function ProjEditAll() { // }) // setAiHelperModalOpen(!data.projIntroduction || !data.projDesc) setprojStatus(data.projStatus) + if (data.projPkg.payStatus == 'PAID') { + setShowPkg(true) + setPkgStatus(data.projPkg.pkgStatus) + } + if (data.projVideo.payStatus == 'PAID') { + setShowVideo(true) + setVideoStatus(data.projVideo.videoStatus) + } } }) @@ -579,7 +674,7 @@ export default function ProjEditAll() { }} /> {/* {showZpi && ( */} - { @@ -588,7 +683,49 @@ export default function ProjEditAll() { downPdf={() => { // window.open(`${Axios.defaults?.baseURL}/route/proj/download/code-zip/pdf/${pathParams.projId}`) }} - /> + /> */} + {showPkg && ( + { + ///route/proj/download/pkg/{projId} + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/apply/${pathParams.projId}`) + window.open(`${Axios.defaults?.baseURL}/route/proj/download/pkg/${pathParams.projId}`) + }} + downPdf={() => { + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/apply/pdf/${pathParams.projId}`) + }} + pkgStatus={pkgStatus} + + upData={() => { + upData() + }} + againPkg={() => { + againPkg() + }} + /> + )} + {showVideo && ( + { + ///route/proj/download/pkg/{projId} + window.open(`${Axios.defaults?.baseURL}/route/proj/download/video/${pathParams.projId}`) + }} + downPdf={() => { + // window.open(`${Axios.defaults?.baseURL}/route/proj/download/apply/pdf/${pathParams.projId}`) + }} + videoStatus={videoStatus} + upVideoData={() => { + upVideoData() + }} + againVideo={() => { + againVideo() + }} + /> + )} {/* )} */} {/* -
该操作会扣除 {(chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum} 元,确定操作码?
+
该操作会扣除 {(chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum} 元,确定操作吗?
{ + sessionStorage.setItem('projName', projInfo.projName); if (pathParams.projChargeType == ProjChargeType.ALL) { nav(`/proj-eall/${createProjId}`); } else if (pathParams.projChargeType == ProjChargeType.FREE) { diff --git a/src/static/buyimg.png b/src/static/buyimg.png new file mode 100644 index 0000000..109320a Binary files /dev/null and b/src/static/buyimg.png differ diff --git a/src/util/AjaxUtils.ts b/src/util/AjaxUtils.ts index e242f28..20a74a0 100644 --- a/src/util/AjaxUtils.ts +++ b/src/util/AjaxUtils.ts @@ -14,7 +14,7 @@ export const WebSocketBaseUrl: string = 'ws://192.168.0.15:7025/copyright'; // export const WebSocketBaseUrl: string = 'ws://192.168.0.103:7025/copyright'; // export const WebSocketBaseUrl: string = '/copyright'; export const DevUserId: string = '80d3365e-0597-4988-979e-18ef1c3ec671'; // 18634604067 -// export const DevUserId: string = 'eb9a82a6-6ed3-4ba0-90e6-d836cefff915'; // 15042810561 +// export const DevUserId: string = 'eb9a82a6-6ed3-4ba0-90e6-d836cefff915'; // 15042810561 密码123456 // export const DevUserId: string = 'c2438eb8-2685-49a9-bf02-5111a5192d96'; // 18647109157 // export const DevUserId: string = '';