提示小红点样式

                                                                                      提示小红点样式_第1张图片



小红点样式:

.con_bot a .span_position{

position:absolute;
border-radius:50%;
background-color:#ff2122;
color:#fff;
font-size:0.3rem;
width:0.4rem;
height:0.4rem;
line-height:0.4rem;
top:-0.1rem;
right:-0.3rem;
z-index:1;

}

js:

$(function(){
$("#mywork").css("display","none");
$("#cmporder").css("display","none");
$("#homeorder").css("display","none");
$("#serviceorder").css("display","none");
$.ajax({
url :context + 'orderconts',
type : 'post',
dataType : 'json',
async:true, 
data:{},
success : function(result) {
if(result.success){
$("#mywork").css("display","block");
$("#cmporder").css("display","block");
$("#homeorder").css("display","block");
$("#serviceorder").css("display","block");
var mycomplainCont=result.obj.mycomplainCont;
var cmpOrderwordCont=result.obj.cmpOrderwordCont;
var homeOrderwordCont=result.obj.homeOrderwordCont;
var serviceOrderCont=result.obj.serviceOrderCont;
if(mycomplainCont<=0){
$("#mywork").css("display","none");
}
if(cmpOrderwordCont<=0){
$("#cmporder").css("display","none");
}
if(homeOrderwordCont<=0){
$("#homeorder").css("display","none");
}
if(serviceOrderCont<=0){
$("#serviceorder").css("display","none");
}
$("#mywork").html(mycomplainCont);
$("#cmporder").html(cmpOrderwordCont);
$("#homeorder").html(homeOrderwordCont);
$("#serviceorder").html(serviceOrderCont);


} else {
$("#mywork").css("display","none");
$("#cmporder").css("display","none");
$("#homeorder").css("display","none");
$("#serviceorder").css("display","none");
}
}
});





});


jsp页面:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="project.property.web.runtime.Runtime"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>




首页


href="${pageContext.request.contextPath}/resources/css/home.css<%=Runtime.version()%>" />










<%--

  • ">我要报修 

  • --%>




    controller方法:

    @RequestMapping(value = "orderconts")
    @ResponseBody
    public AjaxResult loadOrderConts(HttpServletRequest req) throws Exception {
    AjaxResult result = new AjaxResult();
    Map map = new HashMap();
    SessionInfo si = HttpUtils
    .getSessionInfo(req);


    TEnterpriseUsersModal auth = si.getAuthInfo();
    TWorkOrderIntf orderIntf = (TWorkOrderIntf) ImplementorFactory
    .getImplemetator(TWorkOrderIntf.class, "TWorkOrderIntf");
    TSendASingleIntf singleIntf = (TSendASingleIntf) ImplementorFactory
    .getImplemetator(TSendASingleIntf.class, "TSendASingleIntf");
    TServiceOrdersIntf serviceIntf = (TServiceOrdersIntf) ImplementorFactory
    .getImplemetator(TServiceOrdersIntf.class, "TServiceOrdersIntf");
    VariantHolder> data = new VariantHolder>();
    Criteria criteria = new Criteria(TWorkOrderModal.class);
    criteria.addExpression(Restrictions.eq("TWorkOrderModal.UserId", si
    .getAuthInfo().getEUserId()));
    criteria.setPagination(new Pagination(1, 1));
    List list = new ArrayList();
    list.add(1);
    list.add(2);
    list.add(3);
    criteria.addExpression(Restrictions.in("TWorkOrderModal.Status", list));
    orderIntf.list(auth, criteria, data);
    map.put("mycomplainCont", criteria.getPagination().getTotal());


    // 公共报修


    VariantHolder> singleList = new VariantHolder>();
    Criteria c = new Criteria(TSendASingleModal.class);
    OrExpression or = new OrExpression();
    or.addExpression(Restrictions.eq("TSendASingleModal.Type",WorkOrderType.TWO));
    or.addExpression(Restrictions.eq("TSendASingleModal.Type",WorkOrderType.ONE));
    c.addExpression(or);
    c.addExpression(Restrictions.eq("TSendASingleModal.RepairsId",
    auth.getEUserId()));
    c.addExpression(Restrictions.eq("TSendASingleModal.IsInvalid", 0));
    singleIntf.list(auth, c, singleList);


    data = new VariantHolder>();
    criteria = new Criteria(TWorkOrderModal.class);
    criteria.setPagination(new Pagination(1, 1));
    list = new ArrayList();
    List typeList = new ArrayList();
    list.add(-1);
    for (int i = 0; i < singleList.value.size(); i++) {
    TSendASingleModal single = singleList.value.get(i);
    list.add(single.getWorkOrderId());
    }


    typeList.add(1);
    typeList.add(2);
    typeList.add(3);
    criteria.addExpression(Restrictions.in("TWorkOrderModal.Status",
    typeList));
    if (list.size() > 0) {
    criteria.addExpression(Restrictions.in("TWorkOrderModal.Id", list));
    }


    criteria.addExpression(Restrictions.eq("TWorkOrderModal.WorkOrderType",
    2));
    orderIntf.list(auth, criteria, data);
    map.put("cmpOrderwordCont", criteria.getPagination().getTotal());


    singleList = new VariantHolder>();
    c = new Criteria(TSendASingleModal.class);
    c.addExpression(Restrictions.eq("TSendASingleModal.Type",
    WorkOrderType.FOUR));
    c.addExpression(Restrictions.eq("TSendASingleModal.RepairsId",
    auth.getEUserId()));
    c.addExpression(Restrictions.eq("TSendASingleModal.IsInvalid", 0));
    singleIntf.list(auth, c, singleList);


    criteria = new Criteria(TWorkOrderModal.class);
    criteria.setPagination(new Pagination(1, 1));
    data = new VariantHolder>();
    criteria.addExpression(Restrictions.in("TWorkOrderModal.Status",
    typeList));
    if (list.size() > 0) {
    criteria.addExpression(Restrictions.in("TWorkOrderModal.Id", list));
    }
    criteria.addExpression(Restrictions.eq("TWorkOrderModal.WorkOrderType",
    1));
    criteria.addExpression(Restrictions.eq("TWorkOrderModal.IsTurn", 0));


    orderIntf.list(auth, criteria, data);
    map.put("homeOrderwordCont", criteria.getPagination().getTotal());


    // 预约服务
    singleList = new VariantHolder>();
    c = new Criteria(TSendASingleModal.class);
    c.addExpression(Restrictions.eq("TSendASingleModal.Type",
    WorkOrderType.FOUR));
    c.addExpression(Restrictions.eq("TSendASingleModal.RepairsId",
    auth.getEUserId()));
    c.addExpression(Restrictions.eq("TSendASingleModal.IsInvalid", 0));
    singleIntf.list(auth, c, singleList);


    VariantHolder> orders = new VariantHolder>();
    criteria = new Criteria(TServiceOrdersModal.class);


    criteria.setPagination(new Pagination(1, 1));
    list = new ArrayList();
    typeList = new ArrayList();
    list.add(-1);


    for (int i = 0; i < singleList.value.size(); i++) {
    TSendASingleModal single = singleList.value.get(i);
    list.add(single.getWorkOrderId());
    }


    typeList.add(1);
    typeList.add(2);
    typeList.add(3);
    criteria.addExpression(Restrictions.in("TServiceOrdersModal.Status",typeList));
    criteria.addExpression(Restrictions.in("TServiceOrdersModal.Id", list));


    serviceIntf.list(auth, criteria, orders);
    map.put("serviceOrderCont", criteria.getPagination().getTotal());


    result.setSuccess(true);
    result.setObj(map);
    return result;


    }

    你可能感兴趣的:(提示小红点样式)