-
-
huxh 小试身手Lv3
发表于2018-9-17 15:04
悬赏1
已解决
3个回答
具体要做成什么样子的提醒效果,我之前项目上做的是右上角信封上有红色数字提醒,那个是定制开发实现的
在门户布局中添加
<div data-id='anchor1' data-role='widget' widget-id='widget_anchor' data-droppable='resource' class='container_layout_fixed' style='background-position: center center; padding: 2px; border: 0px transparent; width: 80px; height: 32px; overflow: hidden; opacity: 1; background-repeat: repeat; background-color: transparent; right: 128px; top: 30px;'>
<a data-name='anchor' data-event-bind='data-on-click:evt_click;data-on-mousedown:evt_mousedown;data-on-mousemove:evt_mousemove;data-on-mouseup:evt_mouseup;data-on-mouseover:evt_mouseover;data-on-mouseout:evt_mouseout;' href='../../esmain/message.do?cmd=receivebox' style='width: 100%; height: 100%; text-align: center; color: rgb(0, 0, 0); line-height: 20px; font-family: 微软雅黑; font-size: 14px; font-weight: bold; text-decoration: none; display: block; outline-style: none;' target='iframe1'>
<img src='../../vfs/root/portals/pages/esp/index/info_mail.png'/>
<span data-id='msgcnt' style='position: absolute; bottom: 12px; border-radius: 15px;left: 35px;width:14px;line-height:12px;height:12px;background:#f23;font-size: 5px;color:#fff'/>
</a>
</div>
在门户加载完成脚本中添加一下脚本
var curWwwPath = window.document.location.href;
var pathName = window.document.location.pathname;
var pos = curWwwPath.indexOf(pathName);
var localhostPaht = curWwwPath.substring(0,pos);
var msgurl = localhostPaht +sys.getContextPath()+'esmain/message.do?cmd=queryNewMessageCount';
$.ajax({//页面初次加载时异步请求指定页签的第一页数据
type:'GET',
url:msgurl,
success:function (data) {
$("span[data-id='msgcnt']").text(data);
}
});