我的通知tab栏跳转优化

This commit is contained in:
谢思 2021-09-27 11:32:05 +08:00
parent 3a816ce5e5
commit 26de781181
3 changed files with 4 additions and 8 deletions

View File

@ -448,7 +448,7 @@ class NewHeader extends Component {
onVisibleChange={this.handleVisibleChange}
destroyTooltipOnHide
>
<Link to={{pathname:"/settings/notice",state:{noticeType:"notification"}}} className="message-icon">
<Link to={"/settings/notice"} className="message-icon">
<Badge count={current_user.message_unread_total}>
<i className="iconfont icon-xiaoxilingdang color-grey-6 ml15 mr15"></i>
</Badge>

View File

@ -61,7 +61,7 @@ function Index(props){
</ul>
<ul className="securityUl ul-border-buttom">
<li>消息通知</li>
<li className={(pathname.indexOf("/settings/notice")>-1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}><Link to={{pathname:"/settings/notice",state:{noticeType:"notification"}}}><i className="iconfont icon-wodetongzhi"></i><span className="text-shodow-bold">我的通知</span></Link></li>
<li className={(pathname.indexOf("/settings/notice")>-1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}><Link to={"/settings/notice"}><i className="iconfont icon-wodetongzhi"></i><span className="text-shodow-bold">我的通知</span></Link></li>
{/* <li className={pathname.indexOf("/settings/notice/config")>-1 ?"active":""}><Link to={'/settings/notice/config'}><i className="iconfont icon-tongzhiguanli"></i><span className="text-shodow-bold">通知管理</span></Link></li> */}
</ul>
<ul className="securityUl">

View File

@ -9,14 +9,12 @@ import './Index.scss';
import '../manager/Index.scss'
function MyNotice(props) {
// console.log(props.location.state);
let current_user = props.current_user;
let resetUserInfo = props.resetUserInfo;
//tab
let popover = props.location.state && props.location.state.noticeType;
let pageSize = 15;
const [noticeType, setNoticeType] = useState(popover==="atme"?"2":"0");//tab
const [noticeType, setNoticeType] = useState(popover?popover==="atme"?"2":"0":"0");//tab
const [selectedNum, setSelectedNum] = useState(0);//@
const [isBatchDelete, setIsBatchDelete] = useState(false);//@
const [batchDeleteCheckedAll, setBatchDeleteCheckAll] = useState(false);//@--
@ -30,7 +28,7 @@ function MyNotice(props) {
const [onlyUnread, setOnlyUnread] = useState();
useEffect(()=>{
popover==="notification" ? setNoticeType("0"):setNoticeType("2");
popover?popover==="notification" ? setNoticeType("0"):setNoticeType("2"):"0";
},[popover])
useEffect(()=>{
@ -136,8 +134,6 @@ function MyNotice(props) {
//
let totlaPage = Math.ceil((messTotalCount-1)/pageSize);
setCurrentPage(currentPage>=totlaPage? totlaPage : currentPage);
console.log(totlaPage);
console.log(currentPage);
setSelectedNum(0);
setBatchDeleteCheckAll(false);
}