我的通知tab栏跳转优化
This commit is contained in:
parent
3a816ce5e5
commit
26de781181
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue