diff --git a/src/components/CapitalModal/CapitalModal.tsx b/src/components/CapitalModal/CapitalModal.tsx new file mode 100644 index 0000000..4ba76e4 --- /dev/null +++ b/src/components/CapitalModal/CapitalModal.tsx @@ -0,0 +1,326 @@ +import { useEffect, useState } from 'react' +import { get } from '../../util/AjaxUtils' +import useMessage from "antd/es/message/useMessage"; +import { Table, Tag, Spin, Input, DatePicker, Button, Tooltip } from 'antd'; +import { SearchOutlined, ClearOutlined } from '@ant-design/icons'; +import type { TableProps, DatePickerProps } from 'antd'; +// import dayjs, { } from 'dayjs'; +import locale from 'antd/es/date-picker/locale/zh_CN'; + +export default function CapitalModal() { + // const dateFormat = 'YYYY年MM月DD日'; + const [messageApi, messageContext] = useMessage(); + const [isLoading, setIsLoading] = useState(false) + const [page, setPage] = useState(1); + const [total, setTotal] = useState(0); + const [newkeywords, setnewkeywords] = useState('')//临时过度 + const [keywords, setkeywords] = useState('') + const [newstartTime, setnewstartTime] = useState()//临时过度 + const [showStartTime,setShowStartTime] = useState() + const [startTime, setstartTime] = useState() + const [newendTime, setnewendTime] = useState() //临时过度 + const [showEndTime,setShowEndTime] = useState() + const [endTime, setendTime] = useState() + const [tableData, setTableData] = useState() + + // 更改开始日期 + const startTimeChange: DatePickerProps['onChange'] = (date,dateString) => { + // const time = dayjs(date).format(dateFormat) + setShowStartTime(date) + setnewstartTime(dateString) + + + }; + const endTimeChange: DatePickerProps['onChange'] = (date,dateString) => { + // console.log(date, dateString); + setShowEndTime(date) + setnewendTime(dateString) + // dayjs(formInfo.getFieldValue('projDevCompleteDate')).format(dateFormat), + // console.log('日期', dayjs(date).format(dateFormat)); + + }; + // 点击搜索 + const onSearch = () => { + console.log(newstartTime); + + + setPage(1) + setkeywords(newkeywords) + setstartTime(newstartTime) + setnewendTime(newendTime) + get({ + messageApi, + url: '/api/account/listpage-item/self', + config: { + // dayjs(data.projDevCompleteDate, 'YYYY-MM-DD') + params: { + + keywords: newkeywords ? newkeywords : '', + startTime: newstartTime ? newstartTime: '', + endTime: newendTime ? newendTime : '', + page: 1, + rows: 10 + } + }, + onBefore() { + setIsLoading(true); + }, + onSuccess(data: any) { + console.log(page); + + setTableData(data.data.rows) + // console.log(data.data); + setTotal(data.data.total) + + }, + onFinally() { + setIsLoading(false); + } + }) + } + // 初始化搜索条件及分页 + const init = () => { + setShowEndTime(undefined) + setShowStartTime(undefined) + setPage(1) + setkeywords('') + setnewkeywords('') + setstartTime('') + setnewstartTime('') + setendTime('') + setnewendTime('') + get({ + messageApi, + url: '/api/account/listpage-item/self', + config: { + params: { + keywords: '', + startTime: '', + endTime: '', + page: 1, + rows: 10 + } + }, + onBefore() { + setIsLoading(true); + }, + onSuccess(data: any) { + setTableData(data.data.rows) + // console.log(data.data); + setTotal(data.data.total) + + }, + onFinally() { + setIsLoading(false); + } + }) + } + + + const getData = () => { + get({ + messageApi, + url: '/api/account/listpage-item/self', + config: { + // dayjs(date).format(dateFormat) + params: { + keywords: keywords ? keywords : '', + startTime: startTime ? startTime : '', + endTime: endTime ? endTime : '', + page: page, + rows: 10 + } + }, + onBefore() { + setIsLoading(true); + }, + onSuccess(data: any) { + setTableData(data.data.rows) + console.log(data.data); + setTotal(data.data.total) + + }, + onFinally() { + setIsLoading(false); + } + }) + } + useEffect(() => { + getData() + }, [page]) + interface DataType { + index?: number; + type: number; + // 交易前金额 + accountBeforeMoneyDouble: string; + // 交易金额 + accountMoneyDouble: string; + // 余额 + accountAfterMoneyDouble: string; + // 关联订单编号 + orderId: string; + // 关联订单类型 + orderType: string; + // 交易时间 + gmtCreate: string; + // 描述 + description: string; + } + + const columns: TableProps['columns'] = [ + { + title: () =>
序号
, + dataIndex: 'index', + width: 70, // 设置宽度 + key: 'index', + render: (text, record, index) => (page - 1) * 10 + index + 1, + }, + { + title:
类型
, + key: 'type', + width: 100, // 设置宽度 + dataIndex: 'type', + render: (text) => { + const tagProps = + text === 1 ? { color: '#f50', label: '充值' } : + text === 2 ? { color: '#2db7f5', label: '支出' } : + text === 3 ? { color: '#87d068', label: '提现' } : + text === 4 ? { color: '#108ee9', label: '系统扣款' } : + text === 5 ? { color: '#10e98f', label: '订单收入' } : + { color: '#d9d9d9', label: '未知' }; // 默认值 + return {tagProps.label}; + } + , + }, + { + title:
交易前金额
, + width: 120, + dataIndex: 'accountBeforeMoneyDouble', + key: 'accountBeforeMoneyDouble', + render:(text) => ( +
{text}
+ ) + }, + { + title:
交易金额
, + width: 120, + dataIndex: 'accountMoneyDouble', + key: 'accountMoneyDouble', + render:(text) => ( +
{text}
+ ) + }, + { + title:
交易后余额
, + width: 120, + dataIndex: 'accountAfterMoneyDouble', + key: 'accountAfterMoneyDouble', + render:(text) => ( +
{text}
+ ) + }, + { + title:
关联订单编号
, + dataIndex: 'orderId', + // fixed: 'right', + width: 300, + key: 'orderId', + }, + { + title:
关联订单类型
, + dataIndex: 'orderType', + key: 'orderType', + width: 160, + }, + { + title:
交易时间
, + dataIndex: 'gmtCreate', + key: 'gmtCreate', + }, + { + title:
描述
, + dataIndex: 'description', + key: 'description', + ellipsis: { + showTitle: false, + }, + render: (text) => { + return {text} + } + }, + ]; + + return ( +
+ {messageContext} + +
+ { + setnewkeywords(e.target.value) + }} + style={{ width: 198, height: 36, marginRight: 12 }} + > + + + + +
+ { + setPage(currentPage); + }, + showSizeChanger: false, + current: page + + } + } + scroll={{ y: 500 }} + bordered + key="dataTable" rowKey="orderId" + /> + {/*
+ { + setPage(page) + }} /> +
*/} + + + ) +} diff --git a/src/components/RecordModal/RecordModal.tsx b/src/components/RecordModal/RecordModal.tsx new file mode 100644 index 0000000..79cf93b --- /dev/null +++ b/src/components/RecordModal/RecordModal.tsx @@ -0,0 +1,248 @@ +import { useEffect, useState } from 'react' +import { get } from '../../util/AjaxUtils' +import useMessage from "antd/es/message/useMessage"; +import { Table, Spin, DatePicker, Button,Tooltip } from 'antd'; +import { SearchOutlined, ClearOutlined } from '@ant-design/icons'; +import type { TableProps, DatePickerProps } from 'antd'; +// import dayjs, { } from 'dayjs'; +import locale from 'antd/es/date-picker/locale/zh_CN'; + +export default function RecordModal() { + // const dateFormat = 'YYYY年MM月DD日'; + const [messageApi, messageContext] = useMessage(); + const [isLoading, setIsLoading] = useState(false) + const [page, setPage] = useState(1); + const [total, setTotal] = useState(0); + const [newstartTime, setnewstartTime] = useState()//临时过度 + const [showStartTime, setShowStartTime] = useState() + const [startTime, setstartTime] = useState() + const [newendTime, setnewendTime] = useState() //临时过度 + const [showEndTime, setShowEndTime] = useState() + const [endTime, setendTime] = useState() + const [tableData, setTableData] = useState() + + // 更改开始日期 + const startTimeChange: DatePickerProps['onChange'] = (date, dateString) => { + // const time = dayjs(date).format(dateFormat) + setShowStartTime(date) + setnewstartTime(dateString) + + + }; + const endTimeChange: DatePickerProps['onChange'] = (date, dateString) => { + // console.log(date, dateString); + setShowEndTime(date) + setnewendTime(dateString) + // dayjs(formInfo.getFieldValue('projDevCompleteDate')).format(dateFormat), + // console.log('日期', dayjs(date).format(dateFormat)); + + }; + // 点击搜索 + const onSearch = () => { + console.log(newstartTime); + setPage(1) + setstartTime(newstartTime) + setnewendTime(newendTime) + get({ + messageApi, + url: '/api/payment/split/listpage/self', + config: { + // dayjs(data.projDevCompleteDate, 'YYYY-MM-DD') + params: { + startTime: newstartTime ? newstartTime : '', + endTime: newendTime ? newendTime : '', + page: 1, + rows: 10 + } + }, + onBefore() { + setIsLoading(true); + }, + onSuccess(data: any) { + console.log(page); + + setTableData(data.data.rows) + // console.log(data.data); + setTotal(data.data.total) + + }, + onFinally() { + setIsLoading(false); + } + }) + } + // 初始化搜索条件及分页 + const init = () => { + setShowEndTime(undefined) + setShowStartTime(undefined) + setPage(1) + setstartTime('') + setnewstartTime('') + setendTime('') + setnewendTime('') + get({ + messageApi, + url: '/api/payment/split/listpage/self', + config: { + params: { + startTime: '', + endTime: '', + page: 1, + rows: 10 + } + }, + onBefore() { + setIsLoading(true); + }, + onSuccess(data: any) { + setTableData(data.data.rows) + // console.log(data.data); + setTotal(data.data.total) + + }, + onFinally() { + setIsLoading(false); + } + }) + } + + + const getData = () => { + get({ + messageApi, + url: '/api/payment/split/listpage/self', + config: { + // dayjs(date).format(dateFormat) + params: { + startTime: startTime ? startTime : '', + endTime: endTime ? endTime : '', + page: page, + rows: 10 + } + }, + onBefore() { + setIsLoading(true); + }, + onSuccess(data: any) { + setTableData(data.data.rows) + console.log(data.data); + setTotal(data.data.total) + + }, + onFinally() { + setIsLoading(false); + } + }) + } + useEffect(() => { + getData() + }, [page]) + interface DataType { + index?: number; + // 金额 + amount: number; + // 备注 + notes: string + } + + const columns: TableProps['columns'] = [ + { + title: () =>
序号
, + dataIndex: 'index', + width: 70, // 设置宽度 + key: 'index', + render: (text, record, index) => (page - 1) * 10 + index + 1, + }, + { + title:
金额
, + width: 120, + dataIndex: 'amount', + key: 'amount', + render:(text) => ( +
{text}
+ ) + }, + { + title:
备注
, + + dataIndex: 'notes', + key: 'notes', + ellipsis: { + showTitle: false, + }, + render: (text) => { + return {text} + } + }, + + ]; + + return ( +
+ {messageContext} + +
+ + + + +
+
{ + setPage(currentPage); + }, + showSizeChanger: false, + current: page + + } + } + scroll={{ y: 500 }} + bordered + key="dataTable" rowKey="paymentSplitId" + /> + {/*
+ { + setPage(page) + }} /> +
*/} + + + ) +} diff --git a/src/components/ai/AiHelper.tsx b/src/components/ai/AiHelper.tsx index 3a2a097..367a2e4 100644 --- a/src/components/ai/AiHelper.tsx +++ b/src/components/ai/AiHelper.tsx @@ -619,13 +619,13 @@ export default function AiHelper(props: PropsType) { const imgSrc = `${Axios.defaults?.baseURL}/route/file/v2/download/true/${item.previewImgs}`; return (
{ setloginpageId(item.loginpageId) put({ messageApi, url: `/api/proj/update-loginpage-id/proj-id/${props.projId}/loginpage-id/${item.loginpageId}`, - + onSuccess() { messageApi.open({ @@ -646,14 +646,14 @@ export default function AiHelper(props: PropsType) { + style={{ borderRadius: 15 }} />
{/*
{props.title ? props.title : '标题'}
*/}
- - + + ) }) @@ -662,12 +662,14 @@ export default function AiHelper(props: PropsType) {
{/* defaultCurrent: 默认当前页数 total:数据总数 defaultPageSize:'页面显示几条' */} - { - // console.log(page); - // setPage(page) - setloginpageArray([]) - getlistLoginpage(page) - }} /> + { + // console.log(page); + // setPage(page) + setloginpageArray([]) + getlistLoginpage(page) + }} />
@@ -679,7 +681,7 @@ export default function AiHelper(props: PropsType) { const imgSrc = `${Axios.defaults?.baseURL}/route/file/v2/download/true/${item.previewImgs}`; return (
{ // setSelectedId(item.codeTypePageId) // setSelectedImg(item.previewImgs) @@ -705,7 +707,7 @@ export default function AiHelper(props: PropsType) {
+ preview={false} width={265} height={135} style={{ borderRadius: 15 }} />
@@ -719,12 +721,14 @@ export default function AiHelper(props: PropsType) {
{/* defaultCurrent: 默认当前页数 total:数据总数 defaultPageSize:'页面显示几条' */} - { - console.log(page); - // setPage(page) - setpageImgArray([]) - getPageImgData(page) - }} /> + { + console.log(page); + // setPage(page) + setpageImgArray([]) + getPageImgData(page) + }} />
diff --git a/src/components/balance/BalanceHead.tsx b/src/components/balance/BalanceHead.tsx index 88cd821..d854fa8 100644 --- a/src/components/balance/BalanceHead.tsx +++ b/src/components/balance/BalanceHead.tsx @@ -1,20 +1,107 @@ import './balance-head.css' -import {useContext} from "react"; -import {GlobalContext} from "../../context/GlobalContext.ts"; +import { useContext, useState } from "react"; +import { GlobalContext } from "../../context/GlobalContext.ts"; +import { Modal } from 'antd'; import moneyImg from '../../static/head/money.png' +import CapitalModal from '../CapitalModal/CapitalModal.tsx'; +import RecordModal from '../RecordModal/RecordModal.tsx' +import capitalImg from '../../static/capita.png' +import recordImg from '../../static/record.png' export default function BalanceHead() { const globalContext = useContext(GlobalContext); + // const [isLoading, setIsLoading] = useState(false) + // const [moneyModal, setMoneyModal] = useState(false) + // 资金流水弹窗 + const [capitalModal, setCapitalModal] = useState(false) + // 分账记录弹窗 + const [recordModal, setRecordModal] = useState(false) - return ( -
+ return ( +
余额
- +
{ // console.log('查看余额') - }}>¥{globalContext.user.balance}
-
+ // setMoneyModal(true) + }}>¥{globalContext.user.balance} +
+
+
+
+
{ + setCapitalModal(true) + }}> + +
+ 资金流水 +
+
+
+
{ + setRecordModal(true) + }}> + +
+ 分账记录 +
+
+
+
+
+ {/* { + setMoneyModal(false) + + }}> +
{ + setCapitalModal(true) + }}>资金流水
+
{ + setRecordModal(true) + }}>分账记录
+
*/} + { + setCapitalModal(false) + + }}> + + + + + { + setRecordModal(false) + + }}> + + + + + ) } \ No newline at end of file diff --git a/src/components/balance/balance-head.css b/src/components/balance/balance-head.css index 79a5025..d8f4f8f 100644 --- a/src/components/balance/balance-head.css +++ b/src/components/balance/balance-head.css @@ -7,7 +7,8 @@ display: flex; } -.balance-head .label img{ + +.balance-head .label img { width: 17px; height: 19px; margin-right: 5px; @@ -17,4 +18,63 @@ font-size: 18px; color: #f78e4c; margin-top: 8px; + cursor: pointer; + /* background-color: pink; */ + position: relative; +} + +.moneyModal { + display: none; + background-color: #ffffff; + position: absolute; + width: 120px; + height: 100px; + left: -50px; + top: 40px; + /* border: 1px solid red; */ + box-shadow: 0px 5px 6px 5px rgba(0, 0, 0, 0.03); + /* border-radius: 10px; */ + /* font-size: 22px; */ + cursor: default; +} + +.moneyModal-box { + width: 120px; + height: 100px; + display: flex; + flex-direction: column; + justify-content: space-evenly; + align-items: center; + position: relative; +} +.moneyModal-triangle{ + position: absolute; + top: -10px; + /* left: calc(50% - 5px); */ + left: 110px; + width: 0; + height: 0; + border-left: 10px solid transparent; + border-right: 0px solid transparent; + border-bottom: 10px solid #ffffff; /* 87px 是一个正三角形的高度 */ +} +.balance-head .balance:hover .moneyModal { + /* cursor: pointer */ + display: block; +} + +.moneyModal-title { + cursor: pointer; + display: flex; + font-size: 16px; + color: #333333; + font-weight: 400; +} +.transparentBox{ + background-color: transparent; + /* background-color: pink; */ + position: absolute; + width: 100px; + height: 20px; + /* left: -50px; */ } \ No newline at end of file diff --git a/src/components/invoice/order/InvoiceOrderList.tsx b/src/components/invoice/order/InvoiceOrderList.tsx index 43a301a..95aa765 100644 --- a/src/components/invoice/order/InvoiceOrderList.tsx +++ b/src/components/invoice/order/InvoiceOrderList.tsx @@ -170,6 +170,7 @@ export default function InvoiceInfoList(props: ListProps) { { pageSize: 20, total: total, + showSizeChanger: false, onChange: (currentPage) => { setPage(currentPage); } diff --git a/src/components/invoice/order/InvoiceOrderSelectedList.tsx b/src/components/invoice/order/InvoiceOrderSelectedList.tsx index 2943bac..0b16f22 100644 --- a/src/components/invoice/order/InvoiceOrderSelectedList.tsx +++ b/src/components/invoice/order/InvoiceOrderSelectedList.tsx @@ -152,9 +152,11 @@ export default function InvoiceInfoSelectedList(props: ListProps) { { pageSize: 20, total: total, + showSizeChanger: false, onChange: (currentPage) => { setPage(currentPage); } + } } scroll={{y: 500}} bordered key="dataTable" rowKey="orderId"/> diff --git a/src/components/list/ListProj.tsx b/src/components/list/ListProj.tsx index 193edc3..2fee054 100644 --- a/src/components/list/ListProj.tsx +++ b/src/components/list/ListProj.tsx @@ -41,6 +41,7 @@ export default function ListProj() { const [messageApi, contextHolder] = message.useMessage(); const [page, setPage] = useState(1); + // const [pageSize,setPageSize] = useState(10) const [showPage, setShowPage] = useState(true); const [total, setTotal] = useState(0); @@ -75,7 +76,7 @@ export default function ListProj() { onSuccess({ data }) { // console.log('数据', data); // console.log('得到数据'); - + setPage(data.page); setTotal(data.total); setProjs(data.rows); @@ -118,11 +119,11 @@ export default function ListProj() { } }) } - useEffect(()=>{ + useEffect(() => { getTag() // console.log('这啥啊',indexListContext.categoryChangeCount); // console.log('这啥啊2',indexListContext.category) - },[]) + }, []) // 更新数据 // const upreqData = () => { // get>({ @@ -200,8 +201,8 @@ export default function ListProj() { setTimeout(() => { setShowPage(true) }, 0); - - + + }, [indexListContext.status, keywords, type, chargeAdditionals, tagDataId, authorId]) useEffect(() => { @@ -214,7 +215,7 @@ export default function ListProj() { // alert(1) // console.log('什么玩意',indexListContext.categoryChangeCount); // console.log('什么玩意',indexListContext.category); - + }, [indexListContext.categoryChangeCount, indexListContext.category]) // const renderStatus = () => { @@ -242,7 +243,14 @@ export default function ListProj() { {/* defaultCurrent: 默认当前页数 total:数据总数 */} {showPage ? { reqData(page); - }} /> : null} + }} + showSizeChanger={false} // 隐藏每页条数选择器 + // onShowSizeChange={(current, size) => { + // // 处理每页条数的变化 + // setPageSize(size); + // reqData(current, size); + // }} + /> : null} diff --git a/src/components/myOrder/MyOrder.tsx b/src/components/myOrder/MyOrder.tsx new file mode 100644 index 0000000..15a4fb3 --- /dev/null +++ b/src/components/myOrder/MyOrder.tsx @@ -0,0 +1,176 @@ +import React from 'react' +import { Table, TableProps, Tooltip, Spin } from "antd"; +import { useEffect, useState } from "react"; +import useMessage from "antd/es/message/useMessage"; +import { get } from "../../util/AjaxUtils"; +import './myorder.css' +type IListPage = { + page: number; + total: number; + rows: T[] +} +type DetailDataType = { + productType: string; + quantity: number; + unitPrice: number; + notes: string; + productDescription: string; +} +type DataType = { + orderId: string; + orderNo: string; + totalAmount: number; + detail: DetailDataType; + orderStatus: string; + gmtCreate: string; +} +export default function MyOrder() { + const [messageApi, messageContext] = useMessage(); + const [isLoading, setIsLoading] = useState(false) + const [page, setPage] = useState(1); + const [total, setTotal] = useState(0); + const [dataArray, setDataArray] = useState([]); + const getData = () => { + get>({ + messageApi, + url: '/api/order/listpage/complete/no-invoiced/self', + config: { + params: { + page: page, + rows: 20 + } + }, + onBefore() { + setIsLoading(true); + }, + onSuccess({ data }) { + // console.log(data); + + setPage(data.page); + setTotal(data.total); + setDataArray(data.rows); + }, + onFinally() { + setIsLoading(false); + } + }) + } + const columns: TableProps['columns'] = [ + { + title: '订单号', + dataIndex: 'orderNo', + align: 'center', + width: 250, + fixed: 'left' + }, + { + title: '总金额', + dataIndex: 'totalAmount', + align: 'center', + width: 100, + fixed: 'left', + render: (value) => { + return (value / 100).toFixed(2) + } + }, + { + title: '订单状态', + dataIndex: 'orderStatus', + align: 'center', + width: 100, + render: (value) => { + if (value === 'COMPLETE') { + return '完成'; + } + if (value === 'CHARGEBACK') { + return '已退款'; + } + } + }, + { + title: '创建时间', + dataIndex: 'gmtCreate', + align: 'center', + width: 180 + }, + { + title: '产品类型', + dataIndex: 'detail.productType', + align: 'center', + width: 100, + render: (_value, record) => { + if (record.detail.productType === 'PROJ') { + return '项目创建' + } + if (record.detail.productType === 'AGENT') { + return '项目代理' + } + return record.detail.productType + } + }, + { + title: '数量', + dataIndex: 'detail.quantity', + align: 'center', + width: 100, + render: (_value, record) => { + return record.detail.quantity + } + }, + { + title: '单价', + dataIndex: 'detail.unitPrice', + align: 'center', + width: 100, + render: (_value, record) => { + return (record.detail.unitPrice / 100).toFixed(2) + } + }, + { + title: '订单备注', + dataIndex: 'detail.notes', + align: 'center', + width: 120, + render: (_value, record) => { + return record.detail.notes + } + }, + { + title: '描述', + dataIndex: 'detail.productDescription', + align: 'center', + width: 200, + ellipsis: { + showTitle: false, + }, + render: (_value, record) => { + return {record.detail.productDescription} + } + }, + ] + // useEffect(() => { + // getData(); + // }, []); + useEffect(() => { + getData(); + }, [page]); + return ( +
+ {messageContext} + +
{ + setPage(currentPage); + }, + showSizeChanger:false + } + } + scroll={{ y: 500 }} bordered key="dataTable" rowKey="orderId" />; + + + ) +} diff --git a/src/components/myOrder/myorder.css b/src/components/myOrder/myorder.css new file mode 100644 index 0000000..e69de29 diff --git a/src/layout/head/Head.tsx b/src/layout/head/Head.tsx index 8a4c686..b09a922 100644 --- a/src/layout/head/Head.tsx +++ b/src/layout/head/Head.tsx @@ -2,10 +2,10 @@ 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 } from "antd"; -import { DownOutlined, UserOutlined, KeyOutlined, LogoutOutlined, AccountBookOutlined, MenuFoldOutlined, UsergroupAddOutlined } from "@ant-design/icons"; +import { Dropdown, MenuProps, message, Modal, Space, Spin, Input } from "antd"; +import { DownOutlined, UserOutlined, KeyOutlined, LogoutOutlined, AccountBookOutlined, ContainerOutlined, MenuFoldOutlined, UsergroupAddOutlined } from "@ant-design/icons"; import { useContext, useEffect, useState } from "react"; -import { put,get} from "../../util/AjaxUtils.ts"; +import { put, get, post } 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"; @@ -17,11 +17,144 @@ import { reMenuActive } from '../../util/cache'; // import BelongPeople from '../../components/BelongPeople/BelongPeople.tsx' import BelongPeople from '../../components/BelongPeople/BelongPeople.tsx' import ContactPeople from '../../components/ContactPeople/ContactPeople.tsx' - +import inv from '../../static/inv.png' +import MyOrder from '../../components/myOrder/MyOrder.tsx' export default function Head() { + // 邀请码弹窗 + const [invitationModal, setinvitationModal] = useState(false) + // 解除绑定邀请码弹窗 + // const [relieveModal, setRelieveModal] = useState(false) + // 申请的邀请码 + const [invNum, setInvNum] = useState('') + // 输入的邀请码 + const [inInvNum, setInInvNum] = useState('') + // 已绑定的邀请码 + const [bindingInvNum, setBindingInvNum] = useState('') + // 邀请码申请状态 + const [icStatus, setIcStatus] = useState('') + // 邀请码返利比例 + const [icRebateRatio, seticRebateRatio] = useState('') + // 获取邀请码申请状态 + const getIcStatus = () => { + get({ + messageApi, + url: '/api/ic/apply/get/self', + onSuccess({ data }) { + console.log(data); + if (data) { + setIcStatus(data.applyStatus) + } + } + }) + } + // 获取邀请码信息 + const getIc = () => { + get({ + messageApi, + url: '/api/ic/get/self', + onSuccess({ data }) { + console.log(data); + setInvNum(data.ic) + setBindingInvNum(data.relationIc) + seticRebateRatio(data.icRebateRatio) + if (data.ic == '') { + getIcStatus() + } + } + }) + } + // 绑定邀请码 + const putIc = () => { + put({ + messageApi, + url: `/api/ic/update-relation-ic`, + body: { + value: inInvNum + }, + onBefore() { + + }, + onSuccess() { + // messageApi.success('保存成功,点击编辑按钮可继续修改项目简介'); + // console.log(data); + getIc() + }, + onFinally() { + + } + }) + } + // 确定输入的邀请码事件 + const postInvNum = () => { + if (!inInvNum) { + messageApi.open({ + type: 'error', + content: '请输入邀请码' + }) + } else { + // setBindingInvNum(inInvNum) + // messageApi.open({ + // type: 'success', + // content: '已绑定邀请码' + // }) + putIc() + } + } + // 点击获取邀请码 + const getInvNum = () => { + post({ + messageApi, + url: `/api/ic/apply/apply`, + onBefore() { + + }, + onSuccess() { + messageApi.success('已申请') + getIcStatus() + }, + onFinally() { + + } + }) + // setInvNum('RSDNQ5H7') + } + // 复制邀请码 + const copyInvNum = () => { + // navigator.clipboard.writeText(invNum) + // messageApi.open({ + // type: 'success', + // content: '已复制到剪切板' + // }) + // 创建一个临时的 input 元素 + const tempInput = document.createElement('input'); + document.body.appendChild(tempInput); + tempInput.value = invNum; + + // 选中 input 中的内容 + tempInput.select(); + tempInput.setSelectionRange(0, 99999); // 对于移动设备的支持 + + // 执行复制操作 + try { + document.execCommand('copy'); + messageApi.open({ + type: 'success', + content: '已复制到剪切板' + }) + } catch (err) { + messageApi.open({ + type: 'error', + content: '复制失败,请手动复制' + }) + } + + // 移除临时的 input 元素 + document.body.removeChild(tempInput); + } + const dispath = useDispatch() - // 更新所属者表格储存至redux - const upBelongArray = () => { + // 更新所属者表格储存至redux + const upBelongArray = () => { get({ messageApi, url: `/api/proj-owner/list/self`, @@ -50,6 +183,8 @@ export default function Head() { const [isSelfModalOpen, setIsSelfModalOpen] = useState(false); const [isPasswordModalOpen, setIsPasswordModalOpen] = useState(false); const [isInvoiceModalOpen, setIsInvoiceModalOpen] = useState(false); + // 我的订单弹窗 + const [myorderModal, setMyorderModal] = useState(false) // 所属者弹窗 const [belongModal, setBelongModal] = useState(false) const [belongPeopleInfo, setBelongPeopleInfo] = useState({ @@ -109,7 +244,7 @@ export default function Head() { // // console.log('所属者表格', data.data); // // setBelongPeopleArray(data.data) // console.log('查看结果',data.data != belongArray); - + // // if (data.data == belongArray) { // // window.location.reload(); // // } @@ -119,7 +254,7 @@ export default function Head() { // } // }) // } - + useEffect(() => { // getLength() reloadUser(messageApi, globalDispatchContext).then((data) => { @@ -128,7 +263,9 @@ export default function Head() { } }); }, [globalContext.user]); - + // useEffect(()=>{ + // getIc() + // },[]) const items: MenuProps['items'] = [ { key: 'userinfo', @@ -166,6 +303,19 @@ export default function Head() { setIsInvoiceModalOpen(true); } }, + { + key: 'myorder', + label: ( +
+ {/* */} + + 我的订单 +
+ ), + onClick: () => { + setMyorderModal(true) + } + }, { key: 'belong', label: ( @@ -190,6 +340,7 @@ export default function Head() { setContactModal(true) } }, + { key: 'logout', label: ( @@ -220,6 +371,12 @@ export default function Head() { {/*
*/}
+
{ + setinvitationModal(true) + getIc() + }}> + 邀请码 +
{ window.open('https://www.aimzhu.com/operator/route/agreementportal/view?agreementId=c0c5683a-bef3-40c3-8395-900a362ea234&title=系统操作流程') }}> @@ -364,6 +521,146 @@ export default function Head() { { setContactModal(false) }} setConcatPeopleInfo={setConcatPeopleInfo} concatPeopleInfo={concatPeopleInfo} setConcatValue={setConcatValue}> + { + // getNewLength() + setinvitationModal(false) + setInvNum('') + + }}> +
+
+
+ 我的邀请码 +
+
+
{ + getInvNum() + }} style={{ display: invNum || icStatus ? 'none' : 'block' }}> + 点击申请 +
+
+ 正在申请中 +
+
+
+
申请失败!
+
{ + getInvNum() + }}>重新申请
+
+ +
+
+
+
+ {invNum} +
+
{ + copyInvNum() + }}> + 复制 +
+
+
+
+ {/*
*/} +
+
+ {icRebateRatio ? `邀请码分享给他人,即可获得${icRebateRatio}%佣金` : '邀请码分享给他人,即可获得佣金'} + {/* 邀请码分享给他人,即可获得{icRebateRatio}%佣金 */} + +
+ {/*
+ 失败的原因可能是XXXXXX导致,如有疑问请您咨询客服人员 +
*/} +
+ {/*
*/} +
+
+
+
+ 他人邀请码 +
+
+
+
+ { + setInInvNum(e.target.value) + }} /> +
{ + postInvNum() + }}> + +
+
+
+
+
+
+
+ {bindingInvNum} +
+ {/*
{ + setRelieveModal(true) + }}> + 解绑 +
*/} +
+
+
+
+
+
+ {bindingInvNum ? '已绑定邀请码' : '输入他人的邀请码,即可获得相应优惠'} +
+ + +
+
+
+ {/* { + setBindingInvNum('') + setInInvNum('') + setRelieveModal(false) + }} + onCancel={() => { + setRelieveModal(false) + + }}> +
+ 确定解绑当前邀请码吗? +
+
*/} + { + // setBindingInvNum('') + // setInInvNum('') + // setRelieveModal(false) + // }} + width={1500} + onCancel={() => { + setMyorderModal(false) + + }}> + + {contextHolder} {modalHolder} diff --git a/src/layout/head/head.css b/src/layout/head/head.css index 7046c09..a3ca903 100644 --- a/src/layout/head/head.css +++ b/src/layout/head/head.css @@ -1,4 +1,3 @@ - .head { width: 100vw; height: 69px; @@ -23,7 +22,8 @@ position: relative; } -.head-nav{ + +.head-nav { margin-right: 50px; color: #f78e4c; font-size: 16px; @@ -90,4 +90,191 @@ } */ .ant-dropdown .dropdown-item .title { margin-left: 5px; +} + +.invitationButton { + width: 81px; + height: 36px; + background: linear-gradient(79deg, #FFB020 0%, #FF6508 100%); + border-radius: 27px; + text-align: center; + line-height: 36px; + font-weight: 300; + font-size: 16px; + color: #FFFFFF; + margin-right: 20px; + cursor: pointer; +} + +.invitation-box { + width: 530px; + height: 175px; + background: #F9F9F9; + margin-top: 16px; + border: 1px solid #EEEEEE; +} + +.invBox-top { + display: flex; + align-items: center; + height: 118px; + /* background-color: skyblue; */ +} + +.invBox-title { + /* height: 118px; */ + width: 165px; + /* background-color: pink; */ + font-weight: bold; + font-size: 24px; + color: #454545; + text-align: center; + /* line-height: 118px; */ +} + +.invBox-line { + width: 1px; + height: 22px; + background: #626262; +} + +.invBox-btn { + width: 362px; + /* height: 118px; */ + /* background-color: #fcc19d; */ + font-weight: 400; + font-size: 24px; + color: #009C1D; + text-decoration-line: underline; + text-align: center; + line-height: 118px; + cursor: pointer; + +} + +.invBox-btnTwo { + width: 362px; + height: 118px; + /* background-color: #fcc19d; */ + font-weight: 400; + font-size: 24px; + color: #009C1D; + text-decoration-line: underline; + text-align: center; + line-height: 118px; +} + +.invBox-btnthree { + width: 362px; + height: 118px; + /* background-color: #fcc19d; */ +} + +.invBox-Num { + width: 362px; + height: 118px; + /* background-color: #fcc19d; */ +} + +.invNum-box { + width: 362px; + height: 118px; + display: flex; + align-items: center; + justify-content: space-evenly; +} + +.invNum { + font-weight: bold; + font-size: 36px; + /* color: #454545; */ + /* background-color: skyblue; */ + color: #1677FF; + background: linear-gradient(81deg, #000000 0%, #FFAA1E 0%, #FF6E0B 99.0234375%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} + + + +.copyBtn { + font-size: 16px; + color: #FF9F08; + line-height: 24px; + text-decoration-line: underline; + cursor: pointer; +} + +.invBox-bot { + /* background-color: pink; */ + display: flex; + align-items: center; + justify-content: center; + font-weight: 400; + font-size: 18px; + height: 57px; + color: #818181; +} + +.invBox-tips { + width: 350px; + /* background-color: pink; */ + display: flex; + align-items: center; + justify-content: center; + text-align: center; +} + +.invBox-input { + width: 362px; + height: 118px; + /* background-color: #fcc19d; */ + +} + +.invInput { + width: 362px; + height: 118px; + display: flex; + align-items: center; + justify-content: space-evenly; +} + +.invImg { + width: 31px; + height: 30px; + /* background-color: pink; */ + cursor: pointer; +} + +.relieveBtn { + font-weight: 400; + font-size: 18px; + color: #366B77; + text-decoration-line: underline; + cursor: pointer; +} + +.errorBox { + width: 362px; + height: 118px; + align-items: center; + justify-content: space-evenly; + display: flex; + +} + +.errorBox-title { + font-weight: 400; + font-size: 24px; + color: #E21414; + text-decoration-line: underline; +} + +.errorBox-btn { + font-weight: 400; + font-size: 18px; + color: #535353; + text-decoration-line: underline; + cursor: pointer; } \ No newline at end of file diff --git a/src/route/CopyrightGgoods/CopyrightGgoods.tsx b/src/route/CopyrightGgoods/CopyrightGgoods.tsx index e209d48..9280b5e 100644 --- a/src/route/CopyrightGgoods/CopyrightGgoods.tsx +++ b/src/route/CopyrightGgoods/CopyrightGgoods.tsx @@ -2,7 +2,7 @@ import './copyrightG-goods.css' import { Select, DatePicker, Button, Table, // message, - Space, Empty, Pagination, InputNumber + Space, Empty, Pagination, InputNumber } from 'antd'; import type { InputNumberProps } from 'antd'; // import type { TableColumnsType } from 'antd'; @@ -15,20 +15,20 @@ export default function CopyrightGgoods() { const height = window.innerHeight - 180; // const [messageApi, contextHolder] = message.useMessage(); const dateFormat = 'YYYY年MM月DD日'; - const [minPrice,setMinPrice] = useState() //最低价格 - const [maxPrice,setMaxPrice] = useState() //最高价格 - const [date ,setDate] = useState() //获取时间 - const [sort,setSort] = useState() //排序 - const [language,setLanguage] = useState() //开发语言 - const [type,setType] = useState() //软著类型 - const [page,setPage] = useState(1) //分页 + const [minPrice, setMinPrice] = useState() //最低价格 + const [maxPrice, setMaxPrice] = useState() //最高价格 + const [date, setDate] = useState() //获取时间 + const [sort, setSort] = useState() //排序 + const [language, setLanguage] = useState() //开发语言 + const [type, setType] = useState() //软著类型 + const [page, setPage] = useState(1) //分页 // 更改最低价格 const minPriceChange: InputNumberProps['onChange'] = (value) => { console.log('changed', value); setMinPrice(value) }; - // 更改最高价格 - const maxPriceChange: InputNumberProps['onChange'] = (value) => { + // 更改最高价格 + const maxPriceChange: InputNumberProps['onChange'] = (value) => { console.log('changed', value); setMaxPrice(value) }; @@ -55,8 +55,8 @@ export default function CopyrightGgoods() { // 点击搜索 const onSearch = () => { setPage(1) - console.log(minPrice,maxPrice,date,sort,language,type); - + console.log(minPrice, maxPrice, date, sort, language, type); + } // 初始化搜索条件 const init = () => { @@ -191,14 +191,14 @@ export default function CopyrightGgoods() { onChange={minPriceChange} /> 至 - } onClick={onSearch} - > + > 搜索
@@ -330,10 +330,12 @@ export default function CopyrightGgoods() {
{/* defaultCurrent: 默认当前页数 total:数据总数 defaultPageSize:'页面显示几条' */}
- { - console.log(page) - setPage(page) - }} /> + { + console.log(page) + setPage(page) + }} />
)} diff --git a/src/route/ProductRelease/ProductRelease.tsx b/src/route/ProductRelease/ProductRelease.tsx index fd32df8..08850f9 100644 --- a/src/route/ProductRelease/ProductRelease.tsx +++ b/src/route/ProductRelease/ProductRelease.tsx @@ -21,10 +21,11 @@ export default function ProductRelease() { const [date, setDate] = useState() // 日期 const [language, setLanguage] = useState() // 开发者语言 const [type, setType] = useState() //软著类型 - const [page,setPage] = useState(1) // 分页 + const [page, setPage] = useState(1) // 分页 const [editModalOpen, setEditModalOpen] = useState(false) // 控制编辑弹窗 const [delModalOpen, setDelModalOpen] = useState(false) // 控制删除弹窗 const [sellModalOpen, setSellModalOpen] = useState(false) // 控制出售弹窗 + // 更改所属人类型 const belongTypeChange = (value: string) => { console.log(`selected ${value}`); @@ -64,7 +65,7 @@ export default function ProductRelease() { console.log(dayjs(date).format(dateFormat)); } } - + // 点击清除 const clearKeyWords = () => { init() @@ -90,7 +91,7 @@ export default function ProductRelease() { console.log('关闭', item.order); } } - + // 点击编辑 const edit = (item: any) => { console.log(item.order); @@ -168,11 +169,11 @@ export default function ProductRelease() { }, ]; - - useEffect(()=>{ - - },[]) + useEffect(() => { + + + }, []) return ( @@ -335,10 +336,12 @@ export default function ProductRelease() { {/* defaultCurrent: 默认当前页数 total:数据总数 defaultPageSize:'页面显示几条' */}
- { - // console.log(page) - setPage(page) - }} /> + { + // console.log(page) + setPage(page) + }} />
diff --git a/src/route/SearchList/SearchList.tsx b/src/route/SearchList/SearchList.tsx index cab9b5c..a6bb28d 100644 --- a/src/route/SearchList/SearchList.tsx +++ b/src/route/SearchList/SearchList.tsx @@ -18,9 +18,9 @@ export default function SearchList() { const [total, setTotal] = useState(0); // const [keywords, setKeywords] = useState(''); const [messageApi, contextHolder] = message.useMessage(); - const {state} = useLocation() + const { state } = useLocation() // console.log(state); - + const reqData = (currentPage: number) => { get>({ messageApi: messageApi, @@ -85,9 +85,11 @@ export default function SearchList() { {renderList()}
- { - setPage(page); - }} /> + { + setPage(page); + }} />
diff --git a/src/route/TradingGoods/TradingGoods.tsx b/src/route/TradingGoods/TradingGoods.tsx index cca31b1..06907ee 100644 --- a/src/route/TradingGoods/TradingGoods.tsx +++ b/src/route/TradingGoods/TradingGoods.tsx @@ -214,10 +214,12 @@ export default function TradingGoods() { {/* defaultCurrent: 默认当前页数 total:数据总数 defaultPageSize:'页面显示几条' */}
- { - console.log(page) - setPage(page) - }} /> + { + console.log(page) + setPage(page) + }} />
)} diff --git a/src/route/TransactionOrder/TransactionOrder.tsx b/src/route/TransactionOrder/TransactionOrder.tsx index 3cb86a9..00e4308 100644 --- a/src/route/TransactionOrder/TransactionOrder.tsx +++ b/src/route/TransactionOrder/TransactionOrder.tsx @@ -3,7 +3,7 @@ import './transaction-order.css' import { Select, DatePicker, Button, Table, // message, - Space, Empty, Pagination,Modal + Space, Empty, Pagination, Modal } from 'antd'; import dayjs, { } from 'dayjs'; // import type { TableColumnsType } from 'antd'; @@ -276,10 +276,12 @@ export default function TransactionOrder() { {/* defaultCurrent: 默认当前页数 total:数据总数 defaultPageSize:'页面显示几条' */}
- { - console.log(page) - setPage(page) - }} /> + { + console.log(page) + setPage(page) + }} />
)} diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index 48873f4..44a2c3a 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -484,7 +484,7 @@ export default function Index() { // authorId: '' // } // }) - + // } else { // nav('/home', { // state: { @@ -509,7 +509,7 @@ export default function Index() { // } // console.log('type',type); // console.log('chargeAdditionals',chargeAdditionals); - + }, [type, chargeAdditionals, keywords, tagDataId, authorId]); const handleSearch = (value: string) => { @@ -630,6 +630,7 @@ export default function Index() { */}
diff --git a/src/route/proj/edit/ProjConfigLoginpage.tsx b/src/route/proj/edit/ProjConfigLoginpage.tsx index 2c03131..574a366 100644 --- a/src/route/proj/edit/ProjConfigLoginpage.tsx +++ b/src/route/proj/edit/ProjConfigLoginpage.tsx @@ -570,7 +570,7 @@ export default function ProjConfigLoginpage(props: any) { }}> {/* src={`${Axios.defaults?.baseURL}/route/file/v2/download/true/${previewImgs}`} */} - +
@@ -664,7 +664,7 @@ export default function ProjConfigLoginpage(props: any) { // const imgSrc = `${Axios.defaults?.baseURL}/route/file/v2/download/true/${item.previewImgs}`; return (
{ setModalId(item.loginpageId) setModalImg(item.previewImgs) @@ -687,12 +687,14 @@ export default function ProjConfigLoginpage(props: any) {
{/* defaultCurrent: 默认当前页数 total:数据总数 defaultPageSize:'页面显示几条' */} - { - // console.log(page); - // setPage(page) - setloginpageArray([]) - getlistLoginpage(page) - }} /> + { + // console.log(page); + // setPage(page) + setloginpageArray([]) + getlistLoginpage(page) + }} />
diff --git a/src/route/proj/edit/ProjEditStep1.tsx b/src/route/proj/edit/ProjEditStep1.tsx index 66b89da..33e47c7 100644 --- a/src/route/proj/edit/ProjEditStep1.tsx +++ b/src/route/proj/edit/ProjEditStep1.tsx @@ -1,8 +1,8 @@ import './proj-edit-step.css'; -import { Col, Flex, message, Modal, Row, Spin, Pagination, Image } from "antd"; +import { Col, Flex, message, Modal, Row, Spin, Pagination, Image } from "antd"; import { useParams } from "react-router-dom"; import { useEffect, useState } from "react"; -import { get, put,downloadUrl } from "../../../util/AjaxUtils.ts"; +import { get, put, downloadUrl } from "../../../util/AjaxUtils.ts"; import { Button, Form, Input } from 'antd'; import { AxiosResponse, } from "axios"; import { errorImage } from "../../../util/CommonUtil.ts"; @@ -327,7 +327,7 @@ export default function ProjEditStep1(props: any) { // const imgSrc = `${Axios.defaults?.baseURL}/route/file/v2/download/true/${item.previewImgs}`; return (
{ setSelectedId(item.codeTypePageId) setSelectedImg(item.previewImgs) @@ -352,12 +352,14 @@ export default function ProjEditStep1(props: any) {
{/* defaultCurrent: 默认当前页数 total:数据总数 defaultPageSize:'页面显示几条' */} - { - // console.log(page); - setpage(page) - setpageImgArray([]) - getPageImgData(page) - }} /> + { + // console.log(page); + setpage(page) + setpageImgArray([]) + getPageImgData(page) + }} />
diff --git a/src/static/capita.png b/src/static/capita.png new file mode 100644 index 0000000..ba84188 Binary files /dev/null and b/src/static/capita.png differ diff --git a/src/static/inv.png b/src/static/inv.png new file mode 100644 index 0000000..c4706cd Binary files /dev/null and b/src/static/inv.png differ diff --git a/src/static/record.png b/src/static/record.png new file mode 100644 index 0000000..52023e0 Binary files /dev/null and b/src/static/record.png differ diff --git a/src/store/index.ts b/src/store/index.ts index 9b0f2ba..6894210 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,30 +1,30 @@ -import {createStore} from "redux" +import { createStore } from "redux" // 设置数据 const baseState = { - msg:'嘻嘻嘻嘻嘻嘻', - num:10, - shuju:{ - name:'小白', - hobby:'吃饭', - val:'' - }, - belongArray:[] - + // msg: '嘻嘻嘻嘻嘻嘻', + // num: 10, + // shuju: { + // name: '小白', + // hobby: '吃饭', + // val: '' + // }, + belongArray: [] + } // 创建仓库 -const reducer = (state = baseState,action:any)=>{ - const nstate:any = JSON.parse(JSON.stringify(state)) - if(action.type=="numadd"){ - nstate.num++ - // console.log('123'); - } - if(action.type=='new'){ - nstate.shuju.val = action.val - console.log(nstate.shuju.val); - } +const reducer = (state = baseState, action: any) => { + const nstate: any = JSON.parse(JSON.stringify(state)) + // if (action.type == "numadd") { + // nstate.num++ + // // console.log('123'); + // } + // if (action.type == 'new') { + // nstate.shuju.val = action.val + // console.log(nstate.shuju.val); + // } // redux 要求 state必须深拷贝一次 才能返回 - if(action.type == 'uparray'){ + if (action.type == 'uparray') { nstate.belongArray = action.val } return nstate