修改
This commit is contained in:
parent
01e0891fa8
commit
22b6fa4f8f
@ -97,7 +97,9 @@ export default function Payment(props: IPaymentProps) {
|
|||||||
const [value, setValue] = useState('MATERIAL');//单选 服务包类型
|
const [value, setValue] = useState('MATERIAL');//单选 服务包类型
|
||||||
const onChange = (e: any) => {
|
const onChange = (e: any) => {
|
||||||
setValue(e.target.value);
|
setValue(e.target.value);
|
||||||
getPackageList(e.target.value, packPage);
|
// getPackageList(e.target.value, packPage);
|
||||||
|
setPackPage(1);
|
||||||
|
getPackageList(e.target.value, 1);
|
||||||
// setSelectedRowKeys([]);
|
// setSelectedRowKeys([]);
|
||||||
};
|
};
|
||||||
const [packList, setPackList] = useState<any[]>([]);
|
const [packList, setPackList] = useState<any[]>([]);
|
||||||
|
@ -5,19 +5,43 @@ import { useEffect, useState, useContext } from "react";
|
|||||||
import { Axios, DevUserId } from "../../util/AjaxUtils.ts";
|
import { Axios, DevUserId } from "../../util/AjaxUtils.ts";
|
||||||
import { EventSourcePolyfill } from 'event-source-polyfill';
|
import { EventSourcePolyfill } from 'event-source-polyfill';
|
||||||
import { GlobalContext, GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts";
|
import { GlobalContext, GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts";
|
||||||
|
import {
|
||||||
|
get,
|
||||||
|
|
||||||
|
} from "../../util/AjaxUtils.ts";
|
||||||
|
import { useDispatch } from 'react-redux'
|
||||||
type SseMsg = {
|
type SseMsg = {
|
||||||
msg: string;
|
msg: string;
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function RechargeHead() {
|
export default function RechargeHead() {
|
||||||
|
const dispath = useDispatch()
|
||||||
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
|
||||||
const globalContext = useContext(GlobalContext);
|
const globalContext = useContext(GlobalContext);
|
||||||
const globalDispatchContext = useContext(GlobalDispatchContext);
|
const globalDispatchContext = useContext(GlobalDispatchContext);
|
||||||
const [messageApi] = message.useMessage();
|
const [messageApi] = message.useMessage();
|
||||||
|
const getMyPackNum = () => {
|
||||||
|
get<any>({
|
||||||
|
messageApi,
|
||||||
|
url: `/api/proj/servicepkg/packageorder/count/self`,
|
||||||
|
onBefore() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onSuccess({ data }) {
|
||||||
|
dispath({
|
||||||
|
type: 'upPackNum',
|
||||||
|
val: {
|
||||||
|
ALL: data.ALL,
|
||||||
|
MATERIAL: data.MATERIAL,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onFinally() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// sse
|
// sse
|
||||||
const initSse = () => {
|
const initSse = () => {
|
||||||
let evtSource;
|
let evtSource;
|
||||||
@ -36,6 +60,8 @@ export default function RechargeHead() {
|
|||||||
reloadUser(messageApi, globalDispatchContext).then(() => {
|
reloadUser(messageApi, globalDispatchContext).then(() => {
|
||||||
setIsPaymentModalOpen(false);
|
setIsPaymentModalOpen(false);
|
||||||
});
|
});
|
||||||
|
getMyPackNum()
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import './head.css'
|
import './head.css'
|
||||||
// import { NodeJS } from 'types/node';
|
// import { NodeJS } from 'types/node';
|
||||||
import { useDispatch } from 'react-redux'
|
import { useDispatch,
|
||||||
|
// useSelector
|
||||||
|
} from 'react-redux'
|
||||||
import BalanceHead from '../../components/balance/BalanceHead.tsx';
|
import BalanceHead from '../../components/balance/BalanceHead.tsx';
|
||||||
import RechargeHead from '../../components/recharge/RechargeHead.tsx';
|
import RechargeHead from '../../components/recharge/RechargeHead.tsx';
|
||||||
import { Empty, Dropdown, MenuProps, message, Modal, Space, Spin, Input, Table, Form, Button, InputNumber } from "antd";
|
import { Empty, Dropdown, MenuProps, message, Modal, Space, Spin, Input, Table, Form, Button, InputNumber } from "antd";
|
||||||
@ -162,7 +164,7 @@ export default function Head() {
|
|||||||
const [icModal, setIcModal] = useState(false) //查看邀请码详情弹窗
|
const [icModal, setIcModal] = useState(false) //查看邀请码详情弹窗
|
||||||
const [selectIc, setSelectIc] = useState('') //选中的邀请码
|
const [selectIc, setSelectIc] = useState('') //选中的邀请码
|
||||||
// const redxuState: any = useSelector(state => state)
|
// const redxuState: any = useSelector(state => state)
|
||||||
// const couponModal = redxuState.couponModal
|
// const packNum = redxuState.packNum
|
||||||
// 消息通知弹窗
|
// 消息通知弹窗
|
||||||
const [noticeModal, setNoticeModal] = useState(false)
|
const [noticeModal, setNoticeModal] = useState(false)
|
||||||
// 客服弹窗
|
// 客服弹窗
|
||||||
@ -763,9 +765,33 @@ export default function Head() {
|
|||||||
const reloadUserInterval = async () => {
|
const reloadUserInterval = async () => {
|
||||||
await reloadUser(messageApi, globalDispatchContext);
|
await reloadUser(messageApi, globalDispatchContext);
|
||||||
};
|
};
|
||||||
|
// 我的套餐包统计
|
||||||
|
const getMyPackNum = () => {
|
||||||
|
get<any>({
|
||||||
|
messageApi,
|
||||||
|
url: `/api/proj/servicepkg/packageorder/count/self`,
|
||||||
|
onBefore() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onSuccess({ data }) {
|
||||||
|
// console.log(data);
|
||||||
|
dispath({
|
||||||
|
type: 'upPackNum',
|
||||||
|
val: {
|
||||||
|
ALL:data.ALL,
|
||||||
|
MATERIAL:data.MATERIAL,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onFinally() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getUnRead()
|
getUnRead()
|
||||||
setInterval(reloadUserInterval, 5 * 60 * 1000);
|
setInterval(reloadUserInterval, 5 * 60 * 1000);
|
||||||
|
getMyPackNum()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
@ -910,6 +936,7 @@ export default function Head() {
|
|||||||
setPackageModal(true)
|
setPackageModal(true)
|
||||||
setPackPage(1);
|
setPackPage(1);
|
||||||
getPickList(1)
|
getPickList(1)
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{
|
<div style={{
|
||||||
@ -924,8 +951,8 @@ export default function Head() {
|
|||||||
marginTop: 10,
|
marginTop: 10,
|
||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
}}>
|
}}>
|
||||||
<span>全托管:100件</span>
|
<span>全托管 : {packNum.ALL}件</span>
|
||||||
<span style={{marginLeft:10}}>写材料:100件</span>
|
<span style={{ marginLeft: 15 }}>写材料 : {packNum.MATERIAL}件</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> */}
|
</div> */}
|
||||||
|
@ -44,8 +44,31 @@ interface DataType {
|
|||||||
packageOrderId: string;
|
packageOrderId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import { useDispatch } from 'react-redux'
|
||||||
export default function ProjNew() {
|
export default function ProjNew() {
|
||||||
|
const dispath = useDispatch()
|
||||||
|
// 更新redux的套餐包信息
|
||||||
|
const getMyPackNum = () => {
|
||||||
|
get<any>({
|
||||||
|
messageApi,
|
||||||
|
url: `/api/proj/servicepkg/packageorder/count/self`,
|
||||||
|
onBefore() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onSuccess({ data }) {
|
||||||
|
dispath({
|
||||||
|
type: 'upPackNum',
|
||||||
|
val: {
|
||||||
|
ALL: data.ALL,
|
||||||
|
MATERIAL: data.MATERIAL,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onFinally() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
const [debounceTimer, setDebounceTimer] = useState<any>(null);
|
const [debounceTimer, setDebounceTimer] = useState<any>(null);
|
||||||
// 创建一个 ref 来引用推荐列表容器
|
// 创建一个 ref 来引用推荐列表容器
|
||||||
const recommendListRef = useRef<HTMLDivElement>(null);
|
const recommendListRef = useRef<HTMLDivElement>(null);
|
||||||
@ -1071,6 +1094,7 @@ export default function ProjNew() {
|
|||||||
reloadUser(messageApi, globalDispatchContext).then(() => {
|
reloadUser(messageApi, globalDispatchContext).then(() => {
|
||||||
messageApi.success('扣款成功');
|
messageApi.success('扣款成功');
|
||||||
});
|
});
|
||||||
|
getMyPackNum()
|
||||||
},
|
},
|
||||||
onFinally() {
|
onFinally() {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
@ -19,7 +19,11 @@ const baseState = {
|
|||||||
projName:'',
|
projName:'',
|
||||||
projStatus:'',
|
projStatus:'',
|
||||||
newRefun:false,
|
newRefun:false,
|
||||||
newCorrection:false
|
newCorrection:false,
|
||||||
|
packNum:{
|
||||||
|
ALL:0,
|
||||||
|
MATERIAL:0,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建仓库
|
// 创建仓库
|
||||||
@ -70,6 +74,9 @@ const reducer = (state = baseState, action: any) => {
|
|||||||
if (action.type == 'newCorrection') {
|
if (action.type == 'newCorrection') {
|
||||||
nstate.newCorrection = action.val
|
nstate.newCorrection = action.val
|
||||||
}
|
}
|
||||||
|
if (action.type == 'upPackNum') {
|
||||||
|
nstate.packNum = action.val
|
||||||
|
}
|
||||||
return nstate
|
return nstate
|
||||||
}
|
}
|
||||||
const store = createStore(reducer)
|
const store = createStore(reducer)
|
||||||
|
Loading…
Reference in New Issue
Block a user