/** * orderquerycomp * created by xzp on 2017-4-28 10:25:29 */ //***********************查询订单*********************** /*comps.orderquerycomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.txt_orderqueryurl = option.txt_orderqueryurl; } comps.orderquerycomp.prototype.init = function(){ var that = this; utils.ajaxloadcomplate(that); $("#"+this.compid+"_orderqueryurl").attr("href",contextpath+this.txt_orderqueryurl); }*/ var cansendmsgflag = true;//是否发送验证码的标识,防止重复请求 comps.orderquerycomp = function(option) { this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.codeurl = option.codeurl; //this.codeurl = "/sendphonecode"; this.ordersearchurl = option.txt_orderqueryurl; this.orderquerytitle = option.orderquerytitle; } comps.orderquerycomp.prototype.init = function(){ var that = this; if (this.needasyncinit) { $("#" + that.compid + "_orderquerytitle").html(that.orderquerytitle); } utils.ajaxloadcomplate(that); that.bindsomeevent(); } comps.orderquerycomp.prototype.bindsomeevent=function(){ var that=this; $("#"+that.compid+"_codequeryurl").click(function(){ var phone = $("#"+that.compid+"_phone").val(); var reg = /^1\d{10}$/; if(phone==null || phone ==""){ alert("请输入手机号"); return; }else if(!reg.test(phone)){ alert("请输入正确的手机号"); return; } //$("#" + that.compid + "_a").attr("href",that.codeurl+"?phone="+phone); //window.open(contextpath+that.codeurl+"?phone="+phone); if(cansendmsgflag){ var url = contextpath+that.codeurl; $.getjson(url,{phone:phone, rannum:math.random()},function(data){ if(data.flag=="sendregmsgfail"){ alert("短信验证码发送失败!"); return; }else{ var sessionid = data.sessionid; $("#"+that.compid).append(""); $("#sessionid").val(sessionid); time(that); } }) } }); $("#"+this.compid+"_orderqueryurl").click(function(){ var phone = $("#"+that.compid+"_phone").val(); var code = $("#"+that.compid+"_code").val(); var sessionid = $("#sessionid").val(); if(sessionid == null ||sessionid =="undefine"){ sessionid = ""; } var reg = /^1\d{10}$/; if(phone==null || phone ==""){ alert("请输入手机号"); return; }else if(!reg.test(phone)){ alert("请输入正确的手机号"); return; }else if(code==null || code ==""){ alert("验证码不能为空"); return; } window.open(contextpath+that.ordersearchurl+"?phone="+phone+"&code="+code+"&sessionid="+sessionid); }) } var wait=60; function time(o) { if (wait == 0) { cansendmsgflag = true; //获取验证码按钮解除禁用 $("#"+o.compid+"_codequeryurl").attr("disabled", false); $("#"+o.compid+"_codequeryurl").text("重新获取验证码"); wait = 60; } else { cansendmsgflag = false; // 禁用获取验证码按钮 $("#"+o.compid+"_codequeryurl").attr("disabled", true); $("#"+o.compid+"_codequeryurl").text(wait+"秒后重发"); wait--; settimeout(function() { time(o); }, 1000) } } /** * hotsellcomp * created by xzp on 2017-5-2 15:44:16 */ //***********************热卖套餐*********************** comps.hotsellcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.name = option.name; this.imgsrc = option.imgsrc; this.definewidth = option.definewidth; this.defineheight = option.defineheight; this.param_inproductuuids = option.param_inproductuuids; } comps.hotsellcomp.prototype.init = function(){ var that =this; if (this.needasyncinit) { $("#"+that.compid+"_img").attr("src",that.imgsrc); $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); $("#"+that.compid+"_name").val(that.name); $("#"+that.compid+"_defineurl").attr("href", contextpath +"/item/"+ that.param_inproductuuids+".htm"); } this.bindevent(); utils.ajaxloadcomplate(that); } comps.hotsellcomp.prototype.bindevent = function(){ var that =this; //热卖套餐 $(".m-recommended").hover(function(){ $(this).addclass('active'); },function(){ $(this).removeclass('active'); }); for(var i=0;i<$(".m-recommended").length;i++){ if(i==1){ $(".m-recommended").eq(1).addclass("m-li1"); }else if(i==2){ $(".m-recommended").eq(2).addclass("m-li2"); }else{ $(".m-recommended").eq(3).addclass("m-li3"); } } }; /** * burstproductcomp * created by xzp on 2017-5-3 16:59:36 */ //***********************爆款单品*********************** comps.burstproductcomp = function(option){ this.compid = option.compid; this.productuuid = option.param_inproductuuids; this.needasyncinit = option.needasyncinit; this.producturl=option.producturl; this.layoutname=option.layoutname; this.definewidth=option.definewidth; this.defineheight=option.defineheight; this.imgsrc=option.imgsrc; this.definewidthsales=option.definewidthsales; this.defineheightsales=option.defineheightsales; this.imgsrcsales=option.imgsrcsales; } comps.burstproductcomp.prototype.init=function(){ var that=this; if(that.layoutname){ $("#"+that.compid+"_across").show(); $("#"+that.compid+"_erect").remove(); }else{ $("#"+that.compid+"_across").remove(); $("#"+that.compid+"_erect").show(); } if (this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/burstproductcomp/ajaxloaddata", data: { productuuid: that.productuuid }, datatype: "json", async: true, success: function(data) { $("#"+that.compid+"_price").html("¥"+data.price.tofixed(2)); $("#"+that.compid+"_href").attr("uuid",data.productuuid); $("#"+that.compid+"_href").attr("href",contextpath + "/item/" + data.productno+".htm"); $("#"+that.compid+"_name").html(data.name); $("#"+that.compid+"_img").attr("src",that.imgsrc); $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); $("#"+that.compid+"_sales").attr("src",that.imgsrcsales); $("#"+that.compid+"_sales").attr("width",that.definewidthsales); $("#"+that.compid+"_sales").attr("height",that.defineheightsales); utils.ajaxloadcomplate(that); } }) } else { utils.ajaxloadcomplate(that); } } /** * emphasiscasecomp * created by xzp on 2017年5月11日14:45:30 */ //***********************重点案例*********************** comps.emphasiscasecomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.caseuuid = option.param_incaseuuids; this.definewidth = option.definewidth; this.defineheight=option.defineheight; this.defineurl=option.defineurl; this.layout=option.layout; this.imagesrc=option.imagesrc; } comps.emphasiscasecomp.prototype.init=function(){ var that=this; //如果是右侧 if (!this.layout) { $("#"+ that.compid +"_casea").removeclass('c-casea').addclass('case-right'); $("#"+ that.compid +"_character").removeclass('item-h').addclass('item-w'); }; if (this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/emphasiscasecomp/ajaxloaddata", data: { caseuuid: that.caseuuid }, datatype: "json", async: true, success: function(data) { $("#"+that.compid+"_character").text(data.casename); $("#"+that.compid+"_img").attr("src",that.imagesrc); if(data.anothername != ""){ $("#"+that.compid+"_character").attr("href",that.defineurl+"/"+data.anothername+".htm"); }else{ $("#"+that.compid+"_character").attr("href",that.defineurl+"/"+that.caseuuid+".htm"); } $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); utils.ajaxloadcomplate(that); } }) } else { utils.ajaxloadcomplate(that); } } /** * videprefecturecomp * created by xzp on 2017年5月12日09:59:07 */ //***********************视频专区*********************** comps.videprefecturecomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.videourl = option.videourl; this.videoname = option.videoname; this.imgsrc = option.imgsrc; this.definewidth = option.definewidth; this.defineheight = option.defineheight; } comps.videprefecturecomp.prototype.init=function(){ var that=this; if (this.needasyncinit) { $("#"+that.compid+"_text").text(that.videoname); $("#"+that.compid+"_vide").attr("src",that.videourl); utils.ajaxloadcomplate(that); } else { utils.ajaxloadcomplate(that); } $(".v-gallery-play").on("click",function(){ var videodom = document.queryselector("video").play(); $(".v-gallery-play").css("display","none"); }) $(".v-list-bottom li .video-img").on("click",function() { var imgsrc = $(this).attr("num"); $("#"+that.compid+"_text").html($(this).attr("videoname")); var videodom = document.queryselector("video"); videodom.src = imgsrc; videodom.play(); $(".v-gallery-play").css("display","none"); }); //$(".v-list-bottom").nicescroll(); } /** * videprefecturecomp * created by xzp on 2017年5月12日10:40:48 */ //***********************视频列表*********************** comps.videolistcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.aduuid = option.aduuid; } comps.videolistcomp.prototype.init = function() { var that = this; if (this.aduuid == "" || this.aduuid == undefined || this.aduuid == null) { utils.ajaxloadcomplate(that); return; } if (this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/slideads/ajaxloaddata", data: { aduuid: this.aduuid }, datatype: "json", success: function(data) { //1.获取返回的广告、图片url var listdata = eval(data); var urllist; //3、获取广告图片所在ul,并克隆节点 var bgul = $("#videolist"); var bgulclone = ""; var bgliclone = bgul.children(0); //4、生成锚点及广告图片节点 var imgurl = ""; var downloadurl = ""; var videourl = ""; var name = ""; for (var i = 0; i < listdata.length; i++) { adurl = listdata[i]; urllist = adurl.split(";"); if (urllist.length == 4) { imgurl = urllist[0]; downloadurl = urllist[1]; name = urllist[2]; videourl = urllist[3]; } //视频地址 bgliclone.find("a").first().children().attr("src",imgurl); bgliclone.find("a").last().attr("href",downloadurl); bgliclone.find("a").first().attr("num",videourl); bgliclone.find("a").first().attr("videoname",name); bgliclone.find("p").text(name); bgulclone += bgliclone[0].outerhtml; } //5、替换原有节点 bgul.children(0).replacewith(bgulclone); utils.ajaxloadcomplate(that); } }); } else { utils.ajaxloadcomplate(that); } } /** * starproductcomp * created by xzp on 2017年5月16日09:33:01 */ //***********************明星商品*********************** comps.starproductcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.imgsrc = option.imgsrc; this.producturl = option.producturl; this.definewidth = option.definewidth; this.defineheight = option.defineheight; this.param_inproductuuids = option.param_inproductuuids; } comps.starproductcomp.prototype.init=function(){ var that=this; if (this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/burstproductcomp/ajaxloaddata", data: { productuuid: that.param_inproductuuids }, datatype: "json", async: true, success: function(data) { if(data.productno != ""){ $("#"+that.compid+"_href").attr("href",contextpath +"/citem/"+data.productno+".htm"); }else{ $("#"+that.compid+"_href").attr("href",contextpath +"/citem/"+data.productuuid+".htm"); } $("#"+that.compid+"_name").html(data.name); $("#"+that.compid+"_img").attr("src",that.imgsrc); $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); utils.ajaxloadcomplate(that); } }) } else { utils.ajaxloadcomplate(that); } } /** * hotinformationcomp * created by xzp on 2017年5月19日15:05:56 */ //***********************热门资讯*********************** comps.hotinformationcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.informationurl = option.informationurl; this.definewidth = option.definewidth; this.defineheight = option.defineheight; this.contentuuid = option.contentuuid; this.wheresize = option.wheresize; } comps.hotinformationcomp.prototype.init=function(){ var that=this; if (this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/hotinformationcomp/ajaxloaddata", data: { contentuuid: that.contentuuid }, datatype: "json", async: true, success: function(data) { if (that.wheresize) { $("#"+that.compid+"_size").attr("class",'item_l'); }else{ $("#"+that.compid+"_size").attr("class",'m_item'); } $("#"+that.compid+"_img").attr("src",data.contentimgurl); $("#"+that.compid+"_text").text(data.contenttitle); $("#"+that.compid+"_href").attr("href",that.informationurl); $("#"+that.compid+"_text").attr("href",that.informationurl); $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); utils.ajaxloadcomplate(that); } }) } else { utils.ajaxloadcomplate(that); } } /** * hotnewscomp * created by xzp on 2017年5月22日10:38:14 */ //***********************热门新闻*********************** comps.hotnewscomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.informationurl = option.informationurl; this.definewidth = option.definewidth; this.defineheight = option.defineheight; this.contentuuid = option.contentuuid; this.wheresize = option.wheresize; } comps.hotnewscomp.prototype.init=function(){ var that=this; if (that.wheresize) { $("#"+that.compid+"_left").show(); $("#"+that.compid+"_right").remove(); }else{ $("#"+that.compid+"_left").remove(); $("#"+that.compid+"_right").show(); } if (this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/hotnewscomp/ajaxloaddata", data: { contentuuid: that.contentuuid }, datatype: "json", async: true, success: function(data) { $("#"+that.compid+"_img").attr("src",data.contentimgurl); $("#"+that.compid+"_name").text(data.contenttitle); $("#"+that.compid+"_text").text(data.contentvalue); $("#"+that.compid+"_href").attr("href",that.informationurl); $("#"+that.compid+"_name").attr("href",that.informationurl); $("#"+that.compid+"_text").attr("href",that.informationurl); $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); utils.ajaxloadcomplate(that); } }) } else { utils.ajaxloadcomplate(that); } } /** * headlinecomp * created by xzp on 2017-4-28 10:25:29 */ //***********************资讯标题*********************** comps.headlinecomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.titlename = option.titlename; this.informationurl = option.informationurl; this.isdisplay = option.display; } comps.headlinecomp.prototype.init = function(){ var that = this; if (that.needasyncinit) { //是否隐藏链接 if (!that.isdisplay) { $("#"+that.compid+"_href").hide(); }else{ $("#"+that.compid+"_href").attr("href",that.informationurl); } $("#"+that.compid+"_name").text(that.titlename); utils.ajaxloadcomplate(that); }else{ utils.ajaxloadcomplate(that); } } /** * hotcontentcomp * created by xzp on 2017年5月22日10:38:14 */ //***********************资讯内容*********************** comps.hotcontentcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.informationurl = option.informationurl; this.definewidth = option.definewidth; this.defineheight = option.defineheight; this.contentuuid = option.contentuuid; } comps.hotcontentcomp.prototype.init=function(){ var that=this; if (this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/hotcontentcomp/ajaxloaddata", data: { contentuuid: that.contentuuid }, datatype: "json", async: true, success: function(data) { $("#"+that.compid+"_img").attr("src",data.contentimgurl); $("#"+that.compid+"_name").text(data.contenttitle); $("#"+that.compid+"_text").text(data.contentvalue); $("#"+that.compid+"_href").attr("href",that.informationurl); $("#"+that.compid+"_name").attr("href",that.informationurl); $("#"+that.compid+"_text").attr("href",that.informationurl); $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); utils.ajaxloadcomplate(that); } }) } else { utils.ajaxloadcomplate(that); } } /** * recommendcomp * created by xzp on 2017年5月22日18:30:14 */ //***********************资讯推荐*********************** comps.recommendcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.categoryuuid2 = option.categoryuuid2; this.definewidth = option.definewidth; this.defineheight = option.defineheight; this.pageshow = option.pageshow; this.categpryname2 = option.categpryname2; } comps.recommendcomp.prototype.init=function(){ var that=this; if (this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/recommendcomp/ajaxloaddata", data: { categoryuuid: that.categoryuuid2, pageshow: that.pageshow }, datatype: "json", async: true, success: function(data) { if (data.rows.length == 0) { $("#"+that.compid).remove(); return }; var a = $("#"+that.compid+"_a").parents().clone(); var b = $("#"+that.compid+"_b").parents().clone(); $("#"+that.compid+"_show_a").empty(); $("#"+that.compid+"_show_b").empty(); $("#"+that.compid+"_title").text(that.categpryname2); $.each(data.rows, function(index, val) { if(val.contentimgurl == '' || val.contentimgurl == 'null'){ b.find('a').attr("href",val.url).text(val.contenttitle) $("#"+that.compid+"_show_b").append(b.html()); }else{ a.find('a').first().attr("href",val.url); a.find('img').attr("src",val.contentimgurl).attr("width",that.definewidth).attr("height",that.defineheight); a.find('p').first().attr("href",val.url).text(val.contenttitle); $("#"+that.compid+"_show_a").append(a.html()); } }); utils.ajaxloadcomplate(that); } }) } else { utils.ajaxloadcomplate(that); } } /** * commercialbuttcomp * created by xzp on 2017年5月25日15:50:37 */ //***********************商务对接*********************** comps.commercialbuttcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.definewidth = option.definewidth; this.defineheight = option.defineheight; this.definewidth1 = option.definewidth1; this.defineheight1 = option.defineheight1; this.title = option.title; this.skipurl = option.skipurl; this.imgsrc = option.imgsrc; this.imgsrc1 = option.imgsrc1; this.describe = option.describe; } comps.commercialbuttcomp.prototype.init=function(){ var that=this; if (that.needasyncinit) { $("#"+that.compid+"_href").attr("href",that.skipurl); $("#"+that.compid+"_text").text(that.title); $("#"+that.compid+"_describe").html(decodeuri($.base64.decode(that.describe))); $("#"+that.compid+"_log").attr("imgsrc",that.imgsrc); $("#"+that.compid+"_log").attr("width",that.definewidth); $("#"+that.compid+"_log").attr("height",that.defineheight); $("#"+that.compid+"_img").attr("src",that.imgsrc1); $("#"+that.compid+"_img").attr("width",that.definewidth1); $("#"+that.compid+"_img").attr("height",that.defineheight1); that._bindevent(); } else { utils.ajaxloadcomplate(that); //绑定事件 that._bindevent(); } } comps.commercialbuttcomp.prototype._bindevent = function () { $(".m_business").hover(function(){ $(this).find(".business_tit").addclass('active'); },function(){ $(this).find(".business_tit").removeclass('active'); }); } /** * commercialbuttcomp * created by xzp on 2017年5月25日15:50:37 */ //***********************服务支持*********************** comps.servesupportcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.definewidth = option.definewidth; this.defineheight = option.defineheight; this.uuids = option.uuids; this.imgurl = option.imgurl; this.title = option.title; } comps.servesupportcomp.prototype.init=function(){ var that=this; if (that.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/servesupportcomp/ajaxloaddata", data: { uuids: that.uuids }, datatype: "json", async: true, success: function(data) { var li = $("#"+that.compid+"_ul").children().clone(); $("#"+that.compid+"_ul").empty(); $("#"+that.compid+"_img").attr("src",that.imgurl); $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); $("#"+that.compid+"_text").text(that.title); if (data.length == 0) { return ; }; $.each(data, function(index, val) { var htm = li.clone(); htm.find('a').attr("href", contextpath + "/brandnews/" +val.contentid+".htm").text(val.contenttitle); $("#"+that.compid+"_ul").append(htm); }); utils.ajaxloadcomplate(that); } }) } else { utils.ajaxloadcomplate(that); } } /** * luckdrawcomp * created by xzp on 2017年6月12日10:52:33 */ //***********************抽奖*********************** comps.luckdrawcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.activityname = option.activityname; this.activityremark = option.activityremark; this.imgsrc = option.imgsrc; this.definewidth = option.definewidth; this.defineheight = option.defineheight; } comps.luckdrawcomp.prototype.init = function(){ var that = this; if (that.needasyncinit) { $("#"+that.compid+"_img").attr("src",that.imgsrc); $("#"+that.compid+"_img").attr("width",that.definewidth); $("#"+that.compid+"_img").attr("height",that.defineheight); $("#"+that.compid+"_title").html(that.activityname); $("#"+that.compid+"_remark").html(that.activityremark); }; utils.ajaxloadcomplate(that); compmessage.subscribe("openluckdraw",function(a,b){ $.ajax({ url: contextpath+"/luckdrawcomp/openluckdraw", datatype:"html", type:"get", "success": function (data) { $("#" + that.compid + "_show").html(data); a(); } }) }); //是否自动显示抽奖 var luckdraw = $("#luckdraw").val(); if ("show" == luckdraw) { openlucjdraw(); }; } //防止重复点击 var luckflag = true; function openlucjdraw(){ var loginurl = contextpath +"/cart/islogin" $.get(loginurl,{rannum:math.random()} ,function(data){ if("0"==data) { $("#modal-login-form").modal(); }else{ if (luckflag) { luckflag = false; compmessage.publish("openluckdraw", function () { luckflag = true; }); }; } }); } /** * contentlistcomp * created by xzp on 2017-5-2 15:44:16 */ //***********************内容列表*********************** comps.contentlistcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.tagsuuids = option.tagsuuids; this.tagsnames = option.tagsnames; } comps.contentlistcomp.prototype.init = function(){ var that = this; if (this.needasyncinit) { var ul = $("#"+that.compid).find("ul"); var li = ul.find("li"); ul.empty(); var tagsuuids = this.tagsuuids.split(","); var tagsnames = this.tagsnames.split(","); for (var i = 0; i < tagsnames.length; i++) { var uuid = tagsuuids[i]; var name = tagsnames[i]; li = li.clone(); li.find("a").attr("href",contextpath +"/frontshow/tagscategory/tocategory/"+ uuid +".html").text(name); ul.append(li); } $("#"+that.compid+"_more").attr("href",contextpath +"/frontshow/tagscategory/getallcategory"); } this.bindevent(); } comps.contentlistcomp.prototype.bindevent = function(){ var that = this; //展开列表 $("#"+that.compid+"_content").load(contextpath +"/frontshow/content/getcontentlist?categoryuuid=jomoohomehecoration"); }; /** * contentrecommendcomp * created by xzp on 2017-5-2 15:44:16 */ //***********************热门推荐*********************** comps.contentrecommendcomp = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.contentuuids = option.contentuuids; this.contentnames = option.contentnames; } comps.contentrecommendcomp.prototype.init = function() { var that = this; if(this.needasyncinit) { $.ajax({ type: "get", url: contextpath + "/contentrecommend/ajaxloaddata", data: { contentuuids: that.contentuuids }, datatype: "json", async: true, success: function(data) { var div = $("#" + that.compid); var ul = div.find("ul"); var li = ul.find("li"); ul.empty(); $.each(data, function(i,v) { li = li.clone(); li.find(".m-pic").find("a").attr("href", contextpath + "/frontshow/content/channel/" + v.uuid + ".html").find("img").attr("src",v.iconpath); li.find(".m_tit").find("a").attr("href", contextpath + "/frontshow/content/channel/" + v.uuid + ".html").text(v.note); ul.append(li); }); } }) } }