document.write(""); document.write(""); var first = true; var isSubmited = false; function loadNewsList(id, orig, pagesize,pagenumber,state) { localStorage.setItem("search",orig ) /* * if(isSubmited){ alert("正在处理中..请勿操作频繁"); return; } */ isSubmited = true; $("#" + id + "List").html(""); $("#" + id + "List").show(); $("#" + id + "Data").hide(); $.ajax({ //url : url + "/wechat/AiWei!queryNews.action", url : url + "/wechat/AiWei!queryNews.action", type : 'post', data : { Search_vo_e_a_s_type : orig, rows : pagesize, page : pagenumber, Search_vo_e_a_b_deleted : false, }, timeout : 10000, dataType : 'json', success : function(data) { isSubmited = false; var tmp = data; var typeName=""; console.log(tmp) //console.log(JSON.stringify(tmp)); if (tmp.length > 0) { var ul = $(""); for (var i = 0; i < tmp.length; i++) { var length = tmp[i].num2; /*count表示总共多少页*/ var count = Math.ceil(length/pagesize); $("#news_count").html(length); var times = tmp[i].news.createTime.split(" "); var reg = new RegExp("-", "g"); var time = times[0].replace(reg, "."); /*====判断是否有简介,如果没有就获取详情,取前几行进行显示*/ var shrtcontent = ""; if(tmp[i].news.shortContent){ shrtcontent = tmp[i].news.shortContent; }else{ shrtcontent = shortcontent_(tmp[i].news.id) } /*==============*/ // console.log(shrtcontent); var str = "
  • " + "

    " + tmp[i].news.title + "" + shrtcontent + "

  • "; ul.append(str); } //console.log(st_) $("#" + id + "List").append(ul); $(".left").append(typeName); /*加载页码的点击事件*/ if($(".pagingUl")[0]== undefined || state == true){ loadPagecode(length,count,'#pageNum',function(page){ //console.log() var _org = localStorage.getItem('search'); loadNewsList('news',_org,5,page) }); } //console.log($(".pagingUl")[0]) } else { var str="暂时没有内容,敬请期待!" $("#" + id + "List").append(str); // $("#pageGro").hide(); } $("#" + id + "List a").bind("click", function() { loadNews(id, $(this).data("newsid"),orig) }); /*加载页码*/ }, error : function(data) { } }); } /*加载页码,用了jquery.page插件*/ function loadPagecode(total,pagesize,target,fn) { $(target).Page({ totalPages: pagesize,//分页总数 liNums: total,//分页的数字按钮数(建议取奇数) activeClass: 'activP', //active 类样式定义 hasPrv:false, hasNext:false, lastPage:'尾页', callBack : function(page){ return fn(page); } }) } /*点击菜单后再重新调用一下loadlist方法*/ function listClick(id, orig, pagesize,pagenumber){ var state = true; back('news'); loadNewsList(id, orig, pagesize,pagenumber,state); } /* 加载新闻内容 */ function loadNews(id, newsid,orig) { // $("#pageGro").hide(); $(".back_").show(); //清除原来内容 $("#newsTitle").html(''); $("#" + id + "Data").html(""); $("#" + id + "List").hide(); $("#" + id + "End").hide(); $("#news_content").show(); $("#" + id + "Data").show(); $.ajax({ url : url + "/wechat/AiWei!viewNews.action?newsId=" + newsid, type : 'post', timeout : 10000, dataType : 'json', success : function(data) { var params = {objId:newsid,objType:data.newsDetail.title}; PageView.prototype.addView(params); var str; var times = data.newsDetail.createTime.split(" "); var time = times[0].replace("-", "年"); var time = time.replace("-", "月"); var time = time+"日"; if (data.newsDetail.imgUrl == '' || data.newsDetail.imgUrl == null || data.newsDetail.showImg == false) { /*str = "
    " + data.newsDetail.title + "
    " + "
    " + data.newsDetail.content + "
    ";*/ $("#newsTitle").html(data.newsDetail.title); $("#news_visitnum").html(data.num); $("#newsTime").html("发布时间:"+time); str = data.newsDetail.content; } else { $("#newsTitle").html(data.newsDetail.title); $("#news_visitnum").html(data.num); $("#newsTime").html("发布时间:"+time); str = "
    " + data.newsDetail.content; } $("#" + id + "Data").html(str); //if(orig=='News'){ // $("#" + id + "Data").append("

    返回

    "); //}else{ // $("#" + id + "Data").append("

    返回

    "); //} }, error : function(data) { //alert('加载出错,请联系管理员'); } }); } function back(id) { $("#" + id + "List").show(); $("#" + id + "Data").hide(); $("#" + id + "_title").hide(); $("#" + id + "End").show(); $("#news_content").hide(); $(".back_").hide(); } function searchbefore(){ $("#button").click(function(){ window.location.href = "product.html?search=true"; // search="+encodeURI( encodeURI( $("#sech").val() ) )+"&id=category&haha"; localStorage.setItem('search',$("#sech").val()); }); } function loadSearchProductList(id,search,pagesize,pagenumber) { isSubmited = true; //隐藏详情 $("#link_one").html(">> 搜索产品"); $("#link_two").html(""); $("#"+id+"ProductList").html(""); $("#"+id+"ProductList").show(); $(".page_num").css("display","none"); $("#nameSearch").show(); $.ajax({ url : url + "/wechat/AiWei!queryProduct.action", type : 'post', data : { Search_vo_l_a_s_name : search, /*rows : pagesize, page : pagenumber*/ rows : 999, page : 1 }, timeout : 10000, dataType : 'json', success : function(data) { //console.log(data) isSubmited = false; var length = data.total; var count = Math.ceil(length/pagesize); $("#news_count").html(length); var tmp = data.rows; if (tmp.length > 0) { for (var i = 0; i < tmp.length; i++) { var div = $("
    "); var str = "

    "+tmp[i].name+"

    "; div.append(str); $("#" + id + "ProductList").append(div); } } else{ var str="
     
    暂时没有内容,敬请期待!"; $("#" + id + "ProductList").append(str); } $("#" + id + "ProductList a").bind("click", function() { var productType = $(this).data("producttype"); var productId = $(this).data("productid"); $(".pro_page,.top_tab").hide(); //if(productType==0){ detail0($(this).data("productid"),$(this).data("parentcategoryname"),$(this).data("categoryname"),"",$(this).data("categoryid")); //}else if(productType==1){ // window.location.href = "pro_detail.html?productId="+$(this).data('productid')+"&categoryname1="+$(this).data("parentcategoryname")+"&categoryname2="+$(this).data('categoryname')+"&categoryid1=''&categoryid2="+$(this).data('categoryid'); //}else{ // window.location.href = "detail_other.html?productId="+$(this).data('productid')+"&categoryname1="+$(this).data("parentcategoryname")+"&categoryname2="+$(this).data('categoryname')+"&categoryid1=''&categoryid2="+$(this).data('categoryid'); //} }); /*=======加载页码=====*/ if($(".pagingUl")[0]== undefined || state == true){ loadPagecode_(count,'#pagenum',function(page){ console.log(page) loadFirstProductList('category',12,page,false); //var _org = localStorage.getItem('search'); //loadFirstProductList('categoryProductList',2,page) }); } //------------------------- }, error : function(data) { } }); } function loadCategoryList(id, pagesize) { /* * if(isSubmited){ alert("正在处理中..请勿操作频繁"); return; } */ isSubmited = true; $("#" + id + "List").html(""); $("#" + id + "List").show(); $("#" + id + "Data").hide(); $.ajax({ url : url + "/wechat/AiWei!queryJson.action", type : 'post', data : { Search_vo_e_a_b_show : true, rows : pagesize, Search_vo_e_a_b_deleted : false }, timeout : 10000, dataType : 'json', success : function(data) { //console.log(data.rows) // $("#news_count").text(data.rows.length) isSubmited = false; var tmp = data.rows; if (tmp.length > 0) { var ul = $(""); for (var i = 0; i < tmp.length; i++) { var parentId = tmp[i].parentId; if (parentId == '' || parentId == null) { var li = $("
  • " + tmp[i].name + "
  • "); var div = $("
    "); var ul1 = $(""); for (var j = 0; j < tmp.length; j++) { if (tmp[j].parentId == tmp[i].id) { var str2 = "
  • " + tmp[j].name + "
  • " ul1.append(str2); } } div.append(ul1) li.append(div); ul.append(li); } } $("#" + id + "List").append(ul); // $(".hover_content").hover(function () { // //$(this).parents('.first_list').children('a').css("color","#fff"); // $(this).parents('.first_list').css('background','#2196f3'); // }); // $(".hover_content li a").date('click',false); $(".first_list").hover(function(){ $(".hover_content").hide(); $(this).find('.hover_content').show(); $(this).addClass('act'); },function(){ $(this).removeClass('act'); $(this).find('.hover_content').hide(); // $(".countBox").show(); // console.log(123); // },function(){ // }) //给二级菜单 添加点击事件 } $("#" + id + "List a").bind("click", function() { if($(this).data("categoryid2")!=''){ $(".viewport").hide(); console.log(123); $(".top_tab").show(); $('.countBox').show(); loadProductList(id, $(this).data("categoryid1"),$(this).data("categoryname1"),$(this).data("categoryid2"),$(this).data("categoryname2"),9,1,true); } }); }, error : function(data) { } }); } function loadProductList(id, categoryid1,categoryname1,categoryid2,categoryname2,pagesize,pagenumber,state) { /* * if(isSubmited){ alert("正在处理中..请勿操作频繁"); return; } */ // console.log("进来"); isSubmited = true; //console.log(categoryname2) $("#producName").text(categoryname2); $("#link_one").html(">>"+categoryname1); $("#link_one_id").val(categoryid1); $("#link_two_id").val(categoryid2); $("#link_one_name").val(categoryname1); $("#link_two_name").val(categoryname2); if(categoryname2!=""&&categoryname2!=null&&categoryname2!=undefined){ $("#link_two").html(">>"+categoryname2); }else{ $("#link_two").html(categoryname2); } var categoryId = categoryid1; if(categoryid2!=""&&categoryid2!=null&&categoryid2!=undefined){ categoryId = categoryid2; } $("#"+id+"ProductList").html(""); $("#"+id+"ProductList").show(); $(".page_num").css("display","none"); $("#categorySearch").show(); $.ajax({ url : url + "/wechat/AiWei!queryProduct.action", type : 'post', data : { rows : pagesize, page : pagenumber, Search_vo_e_a_s_categoryId : categoryId, }, timeout : 10000, dataType : 'json', success : function(data) { isSubmited = false; console.log(data) var length = data.total; var count = Math.ceil(length/pagesize); $("#news_count").text(length); $("#news_count1").html(length); $("#count1").html(count); var tmp = data.rows; if (tmp.length > 0) { for (var i = 0; i < tmp.length; i++) { //console.log(tmp[i].showType) var div = $("
    "); var str = "

    "+tmp[i].name+"

    "; div.append(str); $("#" + id + "ProductList").append(div); } } else{ var str="
     
    暂时没有内容,敬请期待!"; $("#" + id + "ProductList").append(str); } if($(".pagingUl")[0]== undefined || state == true){ loadPagecode_(count,'#pagenum',function(page){ console.log(page) loadProductList(id, categoryid1,categoryname1,categoryid2,categoryname2,pagesize,page,false); //var _org = localStorage.getItem('search'); //loadFirstProductList('categoryProductList',2,page) }); } $("#" + id + "ProductList a").bind("click", function() { var productType = $(this).data("producttype"); var productId = $(this).data("productid"); $(".pro_page,.top_tab").hide(); //if(productType==0){ detail0($(this).data("productid"),categoryname1,categoryname2,categoryid1,categoryid2); //}else if(productType==1){ // window.location.href = "pro_detail.html?productId="+$(this).data("productid")+"&categoryname1="+categoryname1+"&categoryname2="+categoryname2+"&categoryid1="+categoryid1+"&categoryid2="+categoryid2; //}else{ // window.location.href = "detail_other.html?productId="+$(this).data("productid")+"&categoryname1="+categoryname1+"&categoryname2="+categoryname2+"&categoryid1="+categoryid1+"&categoryid2="+categoryid2; //} }); }, error : function(data) { } }); } function loadProductList2(id, brandId,brandname,pagesize,pagenumber) { /* * if(isSubmited){ alert("正在处理中..请勿操作频繁"); return; } */ isSubmited = true; $("#link_brand").html("品牌类别:"); $("#link_one").html(">> "+brandname); $("#link_one_id").val(brandId); $("#link_one_name").val(brandname); $("#link_two").html(""); $("#"+id+"ProductList").html(""); $("#"+id+"ProductList").show(); $(".page_num").css("display","none"); $("#brandSearch").show(); $.ajax({ url : url + "/wechat/AiWei!queryProduct.action", type : 'post', data : { rows : pagesize, page : pagenumber, Search_vo_e_a_s_brandId : brandId, }, timeout : 10000, dataType : 'json', success : function(data) { isSubmited = false; var length = data.total; var count = Math.ceil(length/pagesize); $("#news_count").text(length); $("#news_count2").html(length); $("#count2").html(count); var tmp = data.rows; if (tmp.length > 0) { for (var i = 0; i < tmp.length; i++) { var div = $("
    "); var str = "

    "+tmp[i].name+"

    "; div.append(str); $("#" + id + "ProductList").append(div); } } else{ var str="
     
    暂时没有内容,敬请期待!"; $("#" + id + "ProductList").append(str); } $("#" + id + "ProductList a").bind("click", function() { var productType = $(this).data("producttype"); var productId = $(this).data("productid"); //if(productType==0){ $(".pro_page,.top_tab").hide(); detail0($(this).data("productid"),brandname,"",brandId,""); //}else if(productType==1){ // window.location.href = "pro_detail.html?productId="+$(this).data("productid")+"&categoryname1="+brandname+"&categoryname2=&categoryid1="+brandId+"&categoryid2="; //}else{ // window.location.href = "detail_other.html?productId="+$(this).data("productid")+"&categoryname1="+brandname+"&categoryname2=&categoryid1="+brandId+"&categoryid2="; //} }); }, error : function(data) { } }); } function loadProductDetail(href,num){ var theRequest = new Object(); if (href.indexOf("?") != -1) { var str = href.substr(1); strs = str.split("&"); for(var i = 0; i < strs.length; i ++) { theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]); } var productId = theRequest["productId"]; var categoryname1 = theRequest["categoryname1"]; var categoryname2 = theRequest["categoryname2"]; var categoryid1 = theRequest["categoryid1"]; var categoryid2 = theRequest["categoryid2"]; //if(num==0){ detail0(productId,categoryname1,categoryname2,categoryid1,categoryid2); //}else if(num==1){ // detail1(productId,categoryname1,categoryname2); //}else{ // detail2(productId,categoryname1,categoryname2); } } //} function detail0(productId,categoryname1,categoryname2,categoryid1,categoryid2,id){ $(".countBox").hide(); //先清空原来内容 $('#link_one1,#producttitle,#productimg,#productcontent,#producttechnology,#productfeature,#productmaterial').html(''); showdialog('viewport','container1'); $("#link_one1").html(categoryname2); if(categoryname2!=""&&categoryname2!=null&&categoryname2!=undefined){ $("#link_two2").html(">>"+categoryname2+""); } $(".backca").bind("click", function() { //loadProductList("category", categoryid1,categoryname1,categoryid2,categoryname2); window.location.href = "product.html?&categoryname1="+categoryname1+"&categoryname2="+categoryname2+"&categoryid1="+categoryid1+"&categoryid2="+categoryid2; }); $.ajax({ url : url + "/wechat/AiWei!viewProduct.action?productId=" + productId, type : 'post', timeout : 10000, dataType : 'json', success : function(data) { var params = {objId:productId,objType:data.productDetail.name}; PageView.prototype.addView(params); var str1 = ""; $("#producttitle").html(data.productDetail.name); $("#productimg").html(str1); $("#pro_type").html(data.productDetail.model); $("#visit_num").html(data.num); $("#productcontent").html(data.productDetail.content); $("#producttechnology").html(data.productDetail.technology); $("#productfeature").html(data.productDetail.feature); $("#productanalytical").html(data.productDetail.analytical); $("#productmaterial").html(""); //resetHeight(); if(data.materialList.length>0){ for(var i=0;i"+type+":

    "+data.materialList[i].content+"
    "; $("#productmaterial").append(str2); } } $(".matype").bind("click", function() { showhide($(this).data("maid")); }); //resetHeight(); } }, error : function(data) { //alert('加载出错,请联系管理员'); } }); } function resetHeight(){ if( $("#viewport").height() >= 1300){ $(".product_content").css("height",$("#viewport").height()+150); console.log($("#viewport").height()) } } function detail1(productId,categoryname1,categoryname2){ $("#link_one").html(categoryname1); if(categoryname2!=""&&categoryname2!=null&&categoryname2!=undefined){ $("#link_two").html(">> "+categoryname2); }else{ $("#link_two").html(categoryname2); } $.ajax({ url : url + "/wechat/AiWei!viewProduct.action?productId=" + productId, type : 'post', timeout : 10000, dataType : 'json', success : function(data) { var params = {objId:productId,objType:data.productDetail.name}; PageView.prototype.addView(params); var str1 = "

    "+data.productDetail.name+"

    "; $("#producttitle").html(str1); $("#pro_type").html(data.productDetail.model); $("#visit_num").html(data.num); $("#productcontent").html(data.productDetail.content); $("#producttechnology").html(data.productDetail.technology); $("#productfeature").html(data.productDetail.feature); $("#productanalytical").html(data.productDetail.analytical); if(data.materialList.length>0){ for(var i=0;i"+type+":

    "+data.materialList[i].content+"
    "; $("#productmaterial").append(str2); } } $(".matype").bind("click", function() { showhide($(this).data("maid")); }); } }, error : function(data) { //alert('加载出错,请联系管理员'); } }); } function detail2(productId,categoryname1,categoryname2){ $("#link_one").html("> "+categoryname1+""); if(categoryname2!=""&&categoryname2!=null&&categoryname2!=undefined){ $("#link_two").html("> "+categoryname2+""); }else{ $("#link_two").html(categoryname2); } $.ajax({ url : url + "/wechat/AiWei!viewProduct.action?productId=" + productId, type : 'post', timeout : 10000, dataType : 'json', success : function(data) { var params = {objId:productId,objType:data.productDetail.name}; PageView.prototype.addView(params); var img1 = $("
    "); var img2 = $("
    "); if(data.productDetail.otherImg.length>0){ for(var i=0;i" img1.append(bigimg); break; } for(var i=0;i" img2.append(smallimg); } } $("#productimg").append(img1); $("#productimg").append(img2); $("#producttitle").html("> "+data.productDetail.name+""); //$("#pro_type").html(data.productDetail.model); var head = "

    "+categoryname2+"

    "+data.productDetail.name+"

    "; $("#contentHead").html(head); $("#productcontent").html(data.productDetail.content); $("#producttechnology").html(data.productDetail.technology); $("#productfeature").html(data.productDetail.feature); $("#productanalytical").html(data.productDetail.analytical); if(data.materialList.length>0){ for(var i=0;i> 最新产品"); $("#link_two").html(""); $("#"+id+"ProductList").html(""); $("#"+id+"ProductList").show(); $.ajax({ url : url + "/wechat/AiWei!queryProduct.action", type : 'post', data : { rows : pagesize, page : pagenumber }, timeout : 10000, dataType : 'json', success : function(data) { //console.log(data) isSubmited = false; var length = data.total; var count = Math.ceil(length/pagesize); $("#news_count").html(length); var tmp = data.rows; if (tmp.length > 0) { for (var i = 0; i < tmp.length; i++) { var div = $("
    "); var str = "

    "+tmp[i].name+"

    "; div.append(str); $("#" + id + "ProductList").append(div); } } else{ var str="
     
    暂时没有内容,敬请期待!"; $("#" + id + "ProductList").append(str); } $("#" + id + "ProductList a").bind("click", function() { var productType = $(this).data("producttype"); var productId = $(this).data("productid"); $(".pro_page,.top_tab").hide(); //if(productType==0){ detail0($(this).data("productid"),$(this).data("parentcategoryname"),$(this).data("categoryname"),"",$(this).data("categoryid")); //}else if(productType==1){ // window.location.href = "pro_detail.html?productId="+$(this).data('productid')+"&categoryname1="+$(this).data("parentcategoryname")+"&categoryname2="+$(this).data('categoryname')+"&categoryid1=''&categoryid2="+$(this).data('categoryid'); //}else{ // window.location.href = "detail_other.html?productId="+$(this).data('productid')+"&categoryname1="+$(this).data("parentcategoryname")+"&categoryname2="+$(this).data('categoryname')+"&categoryid1=''&categoryid2="+$(this).data('categoryid'); //} }); /*=======加载页码=====*/ if($(".pagingUl")[0]== undefined || state == true){ loadPagecode_(count,'#pagenum',function(page){ console.log(page) loadFirstProductList('category',12,page,false); //var _org = localStorage.getItem('search'); //loadFirstProductList('categoryProductList',2,page) }); } /*===================*/ }, error : function(data) { } }); } function loadRecomProductList(id){ $("#"+id+"ProductList").html(""); $("#"+id+"ProductList").show(); $.ajax({ url : url + "/wechat/AiWei!queryProduct2.action", // url : url + "//wechat/AiWei!queryProduct.action", type : 'post', data : { page_size : 9 }, timeout : 10000, dataType : 'json', success : function(data) { isSubmited = false; var tmp = data.rows; console.log(tmp) if (tmp.length > 0) { var ul_ = $("
    "); var li_box = $("
    "); for (var i = 0; i < tmp.length; i++) { var div = $("
  • "); var str = "

    "+tmp[i].name+"

    "; div.append(str); li_box.append(div); } ul_.append($("
    ").append(li_box)); // console.log(ul_[0].outerHTML); $("#" + id + "ProductList").append(ul_); /*====小箭头的点击方法*/ window.swiper_time = 0; $(".right-click").click(function(){ // $('.li-box').css('left',$('.li-box').offset().left - 520); // $('.li-box').animate({left: 537}); if(window.swiper_time < $(".li-box li").length -3){ window.swiper_time++; console.log(window.swiper_time); $('.li-box').animate({left:-(window.swiper_time*300)}); $('.left-click img').attr('src','images/left_.png') }else{ console.log('到头了right'); $('.right-click img').attr('src','images/right_end.png') } }); $(".left-click").click(function(){ // $('.li-box').css('left',$('.li-box').offset().left - 520); // $('.li-box').animate({left: 537}); if(window.swiper_time > 0){ window.swiper_time--; console.log(window.swiper_time); $('.li-box').animate({left:-(window.swiper_time*300)}); $('.right-click img').attr('src','images/right_.png') }else{ console.log($('.li-box').offset().left); console.log('到头了left'); $('.left-click img').attr('src','images/left_end.png') } }); } else{ var str="
     
    暂时没有内容,敬请期待!"; $("#" + id + "ProductList").append(str); } $("#" + id + "ProductList a").bind("click", function() { var productType = $(this).data("producttype"); var productId = $(this).data("productid"); //if(productType==0){ console.log(123) //console.log('product.html?search=true&&productid='+productId+"&&parentcategoryname="+encodeURI($(this).data("parentcategoryname"))+"&&categoryname="+encodeURI($(this).data("categoryname"))+"&&categoryid="+$(this).data("categoryid")) location.href = 'product.html?search=true&&productid='+productId+"&&parentcategoryname="+encodeURI(encodeURI($(this).data("parentcategoryname")))+"&&categoryname="+encodeURI(encodeURI($(this).data("categoryname")))+"&&categoryid="+$(this).data("categoryid"); detail0($(this).data("productid"),$(this).data("parentcategoryname"),$(this).data("categoryname"),"",$(this).data("categoryid")); //}else if(productType==1){ // window.location.href = "pro_detail.html?productId="+$(this).data('productid')+"&categoryname1="+$(this).data("parentcategoryname")+"&categoryname2="+$(this).data('categoryname')+"&categoryid1=''&categoryid2="+$(this).data('categoryid'); //}else{ // window.location.href = "detail_other.html?productId="+$(this).data('productid')+"&categoryname1="+$(this).data("parentcategoryname")+"&categoryname2="+$(this).data('categoryname')+"&categoryid1=''&categoryid2="+$(this).data('categoryid'); //} }); }, error : function(data) { } }); } function loadPosition(){ $.ajax({ url : url + "/wechat/AiWei!queryPosition.action", type : 'post', timeout : 10000, dataType : 'json', success : function(data) { var tmp = data.rows; if (tmp.length > 0) { for (var i = 0; i < tmp.length; i++) { var index = i+1; var str1 = ""; var str2 = "

    "+tmp[i].name+"

    "+tmp[i].require; $("#positionName").append(str1); $("#positioninfo").append(str2); } } else{ var str="
     
    暂时没有内容,敬请期待!
     
    "; $("#positioninfo").append(str); } }, error : function(data) { //alert('加载出错,请联系管理员'); } }); } function loadActivity(){ $("#activity").html(""); $.ajax({ url:url +"/wechat/Activity!getActivityContent.action", success : function(data) { console.log(data) var tmp = data; if (tmp.length > 0) { $("#news_count").text(tmp.length); for (var i = 0; i < tmp.length; i++) { var times = tmp[i].activity.startTime.split(" "); var reg = new RegExp("-", "g"); var time = times[0].replace(reg, "/"); if(tmp[i].activity.content!=''){ var str = "

    " + time+" "+tmp[i].activity.title+"" + "" + ">>详细

    "; var str0 = $(""); if(tmp[i].profile!=null){ if (tmp[i].profile.length > 0) { var title = "

    我要报名

    "; var str1 = $("
    "); str0.append(title); var str2 = $("
    "); for (var j = 0; j < tmp[i].profile.length; j++) { var label = "