BESTKEEP| 登录/注册
购物车 | 我的订单| 手机版 | 企业采购
服get{{if success}}get le">服get{{if .length>0}}get get{{each as v i}}get G [ /{{v. No}} blank ="{{v. Name}} "" h i earbox fL 共< font-price-red id viewShopCarCount2 {{count}}""i>件商ss=""p 去购物0}}" href=" < t{{each as v i}}get t{{if i<10}}" href="" href=" < targettkeep.cn/goods/img/goods{{v.oods/imgId}} rce=globa< get t{{/if}}" href=" t{{/each}}" href=" < t t{{/if}}" hr 0}}" href=" < t{{each as v i}}get t{{if i<10}}" href="" href=" < targettkeep.cn/javascript:void(0)" onclicklf" cmitForPost(' -search','{{v. Name}}') < get t{{/if}}" href=" t{{/each}}" href=" < t t{{/if}}" hr =$("#funShopCarView ); t t var p={}; t t var viewShopCarCount1=$("#viewShopCarCount1 ); t t if(rs.success && rs. .length>0){ t t rs.count=rs. .length; t t rs.total=0.00; t t for (var i= 0; i < rs.count; i++) { t t var row=rs. [i]; t t rs.total = rs.total+row.price*row.amount; t t p[row.id]=row; t t } t t rs.total=rs.total.toFixed(2); t t viewShopCarCount1.html("("+rs.count+"""i>) ); t t }else{ t t rs.count=0; t t rs.total=0.00; t t } t t tegonsole.dir(rs); t t var view=$(templ ( FunShopCarView ,rs)); t t var btnDelL =view.fd(".btn-del ); t t btnDelL .on("click",function(){ t t var =$(this); t t if( .lock) return false; t t var id .attr("data-id"); t t var row= p[id]; t t var viewShopCarCount2=e">.fd("#viewShopCarCount2"); t t var viewShopCarTotal=e">.fd("#viewShopCarTotal ); t t t t if(row){ t t headerCtrl.requite.delShopCarI ({scid:row.id},function(data){ t t gonsole.dir(data); t t if(data.success){ t t .closite( r").remove(); t t rs.total=(rs.total-(row.price*row.amount)).toFixed(2); t t rs.count--; t t if(rs.count>0){ t t viewShopCarCount1.html("("+rs.count+"""i>) ); t t viewShopCarCount2.text(rs.count); t t viewShopCarTotal.text(rs.total); t t }else{ t t e">.fd(".innerle">).html(" pl 'no-data' 物0""i>) ); t t } t t _adwq.push([ ' tDataTyp ','dele ' ]); t t _adwq.push([ ' tCustomer','']); t t _adwq.push([ ' tI ',row. No,row. Name,row.price,row.amount,row.oods/imgId,row.oods/imgName]); t t _adwq.push([ ' trackTrans' ]); t t }else{ t t $.alert(data.msg); t t } t t }, ,"#funShopCarView ); t t } t t }); t t e">.html(view); t t t t }); t t } t t}, t t t trequite:{ t t baseAjax:function(url,param, ccu cc,btn,loadingParent){" href="//底层ajax封装 $.utouuAjax({ useLoading:loadingParent?true:false, loadingParent:loadingParent, url:url, data:param, dataTyp :"json", beforeSend:function(){ t if(btn){btn.lock = true;}g }, success: ccu cc, error:function(){ t if(btn){btn.lock = false;}g $.alert("请求异常,请稍后重试!","error ); t }, comple :function(xhr,status){ t if(status= meout"){ t $.alert("网络不稳定,请稍后重试!","error ); t } t if(btn){btn.lock = false;}g }g }); t }, funShopCar:function(param, uccess,btn,loadingParentId){" href=" ="//接口ajax封装 var url="/head shopcartBriefInfo? me="+getT meMark(); t headerCtrl.requite.baseAjax(url,param, uccess,btn,loadingParentId); t }, delShopCarI :function(param, uccess,btn,loadingParentId){ var url="/shopping-cart/delsc"; t headerCtrl.requite.baseAjax(url,param, uccess,btn,loadingParentId); t } t t} t }" hr templ .helper('$priceFormmat', function (price) { hr return (price*1).toFixed(2); hr }); " hr $(function(){ " hr headerCtrl.action.funShopCar(); " hr te根据滚动条位置显示 会顶部按钮 " hr $(wdow).scroll(function () { hr if ($(wdow).scrollTop() > 200) { hr $(".widget-side-msn .msn-lnk7).show(); " hr }else{ hr $(".widget-side-msn .msn-lnk7).hide(); " hr } " hr }); " hr " hr te获取用户未读系统消息数据 " hr $.ajax({ " hr url: '/msg/getUserUnreadMsgCount', " hr data: {}, " hr yp : 'post', " hr dataTyp : 'json', " hr success: function(data){ hr if(data.success){ hr if(data.unreadCount>0){ hr $("#imsgcount ).show(); " hr $(".fun .msg ).fd("i).html(data.unreadCount); " hr } " hr } " hr } " hr }); " hr " hr te初始化搜索数据 " hr var oods/img_html = ""; " hr $.ajax({ " hr" hr url: '/search-oods/img/good-num', " hr" hr data: {}, " hr" hr yp : 'post', " hr" hr dataTyp : 'json', " hr" hr success: function(data){ hr " hr var oods/imgL = data.good; hr " hr if(oods/imgL .length==0){ hr " hr return ; hr " hr } hr " hr hr " hr te设定input搜索框随机商ss=ss=类关键字 hr " hr var keyArr = new Array(); " hr" hr for(var i=0; i= 65 && v <= 90 || v == 8 || v == 46 || v == 32){ hr " hrrrrrrrrr if(v_val != ""){ hr " hrrrrrrrrr $.ajax({ " hr" hr" hrrrrrrrrr url: '/oods/imgL ', " hr" hr" hrrrrrrrrr data: {"iptSearch:v_val,"page":0,"size":10}, " hr" hr" hrrrrrrrrr yp : 'post', " hr" hr" hrrrrrrrrr dataTyp : 'json', " hr" hr" hrrrrrrrrr success: function(data){ hr " hr" hrrrrrrrrr te搜索框下拉选项 hr " hr" hrrrrrrrrr te过滤商ss=s称并设定临时值 hr " hr" hrrrrrrrrr hr " hr" hrrrrrrrrr var L = data.data.good; hr " hr" hrrrrrrrrr for(var i=0;i< L .length;i++){ hr " hr" hrrrrrrrrr var Name = g L [i]. Name; hr " hr" hrrrrrrrrr var pG Name = pG Name1( Name,v_val); hr " hrrrrrrrrrrrrr //alert( Name);alert( pG Name); hr " hrrrrrrrrrrrrr data.data.good[i]. pG Name= pG Name; hr " hrrrrrrrrrrrrr }" href="" href="rrrr autoComple _warp.hide();r l" iv>< =+;>r ourrIdex = -1; " l" iv>< =+;>r html = templ ( seachTempl G ",data.data); hr " hrrrrrrrrrrrrr autoComple _warp.html( html).show(); " hr" hrrrrrrrrrrrrr }" href="" href="rrrrrrrr}); " hr" hrrrrrrrrrrrrr}else{ hr " hrrrrrrrrrrrrr $(".autoComple warp").hide(); " hr" hrrrrrrrrrrrrr ourrIdex = -1; " l" iv>< =+;>r}" href="" href="}elserif(v == 38 || v == 40){ hr " hrrrrrrrrr if(autoComple _warp.css("displ y") === "block"){ t t var maxnum = $(".autoComple content).fd("ul li).length; trrrr " hr if(v == 38){ hr ourrIdex--; hr if(ourrIdex < 0){ourrIdex = 0;} hr autoComple _warp.fd("ul li).removeC ("active"); " hr autoComple _warp.fd("ul li).eq((ourrIdex <= -1 ? 0 : ourrIdex)).addC ("active"); " hr } hr " hr if(v == 40){ hr ourrIdex++; hr if(ourrIdex >= maxnum){ourrIdex = maxnum-1;} hr autoComple _warp.fd("ul li).removeC ("active"); " hr autoComple _warp.fd("ul li).eq(ourrIdex).addC ("active"); " hr } t t var thisVal = $(".autoComple content).fd("ul li).eq(ourrIdex).fd(". fl ).text(); t t var keyValue = $.trim($("#iptSearch).val()); t " hrrrrrrrrr if(keyValue == ''){ t " hrrrrrrrrr var oods/imgId = $(".autoComple content).fd("ul li).eq(ourrIdex).fd(". fl ).attr("oods/imgId ); t t _athis.attr("pl ceholder",thisVal); t t _athis.attr("pl ceholderId",oods/imgId); t t }else{ t t _athis.val(thisVal); t t } t t t t } " hr }elserif(v == 13){ hr /* var keyValue = $.trim($("#iptSearch).val()); hr if(ourrIdex == -1){ hr btnSearchClick(); " hr }elserif(keyValue == ''){ t" hrrrrrrrrr //location.ep.c = $(".autoComple content).fd("ul li).eq(ourrIdex).fd("a ).attr("ep.c ); t var ep.c = $(".autoComple content).fd("ul li).eq(ourrIdex).fd("a ).attr("ep.c ); t wdow.open(ep.c,' '); t }elser{ t" hrrrrrrrrr $(".autoComple content).fd("ul li).eq(ourrIdex).fd("a ).click(); t } */ " hr btnSearchClick(); t $(".autoComple warp").hide(); t ourrIdex = -1; t } " hrrrrrrrrr}); " hr " hr $("#iptSearch).on("focus",function(){ " hr var keyValue = $.trim($("#iptSearch).val()); hr rrrrrrrr if(keyValue == ""){ hr " hrrrrr $(".autoComple warp").html(oods/img_html).show(); " hr" hrrrrr } " hrrrrrrrrr ourrIdex = -1; " l" iv>< }); " hr $("#iptSearch).on("blur",function(){ //rrrrr $(".autoComple warp").hide(); " hr ourrIdex = -1; " l" iv>< }); " hr $(".search-e">).on("mou eave",function(){ " hr $(".autoComple warp").hide(); " hr ourrIdex = -1; " l" iv });r l }); " hr var howLogin = ''; " hr if(showLogin=='1'){ " hr tologin(""); " hr } " hr " hr function tologin(th){ " hr $.ajax({ " hr url: '/validUserId', " hr data:{}, " hr yp : 'post', " hr dataTyp : 'json', " hr async:true, " hr success: function(data){ hr if(data.success){ hr wdow.location.ep.c=$(th).attr("data"); " hr }else{ hr $(".box_yd ).attr("location_ep.c ,$(th).attr("data")); " hr $(".box_yd ).show(); " hr } " hr } " hr }); " hr } " hr " hr function btnSearchClick(){ hr var form = document.forms[0]; " hr $(form).fd("input").remove(); " hr form. ; " hr form.method="post ; " hr var iptSearch = $.trim($("#iptSearch).val()); hr if(iptSearch ==""){ hr iptSearch = $("#iptSearch).attr("pl ceholderId"); " hr form.actionn/goods/img/goods"+iptSearch; " hr form." cmit();r l }else{ hr //form.actionn/g -searchs"+iptSearch; " hr " cmitForPost(/g -search",iptSearch); " hr } " hr } " hr " hr function " cmitForPost(action,param){ hr //替换字符' " 为 "" " hr var str1 = "' ; " hr var str2 = '"' " hr param = param.repl ce(eval("s"+str1+/g i),"").repl ce(eval("s"+str2+/g i),""); " hr " hr var form = document.forms[0]; " hr $(form).fd("input").remove(); " hr var eiddenField = document.creodsElement("input"); t eiddenField.setAttribu ( yp ", "eidden"); t eiddenField.setAttribu ( name", "iptSearch); t eiddenField.setAttribu ( value", param); t form.appendChild(eiddenField); t form. ; " hr form.method="post ; " hr form.actionnaction; " hr form." cmit();r l } " hr //截取固定长度的字符串 " hr function getT pName(nameStr){ hr //搜索框可溶汉字长度(英clas符) " hr var full_length = 26; " hr var str_len = getStrlen(nameStr); hr if(str_len<=full_length){ hr return nameStr; " hr } " hr var idex = getIdexOf(nameStr,full_length); t var pName = nameStr." cstr(0,idex)+"... ; " hr return t pName; hr } " hr " hr //商ss=s称关键字标红,且按照一定长度截取 " hr function t pG Name1( Name,keyStr){ hr //搜索框可溶汉字长度(英clas符) " hr var full_length = 30; " hr var pG Name = ""; " hr //var pKeyStr = "<font color="red"> +keyStr+"</font> ; " hr var pKeyStr = ' full_length){ hr //关键字的长度 " hr var key_len = getStrlen(keyStr); " hr var idex = getIdexOf( Name,full_length-key_len); hr pG Name = Name." cstr(0,idex)+"... +keyStr; hr pG Name = pG Name.repl ce(keyStr, pKeyStr); " hr return t pG Name; hr } " hr t treturn t pG Name; hr } " hr //计算字符串长度(英clas1个s符,中cla汉字s2个s符) " hr function getStrlen(str) { hr var len = 0; hr for (var i=0; i127 || str.charCodeAt(i)==94) { hr len += 2; hr } elser{ hr len ++; hr } r l } r l return len; hr } " hr //获得指定长度的字符串的下标 " hr function getIdexOf(str,length) { hr var idexof_ = 0; hr var len = 0; hr for (var i=0; i<=str.length; i++) { hr hr hr if (str.charCodeAt(i)>127 || str.charCodeAt(i)==94) { hr hr len += 2; hr hr } elser{ hr hr len ++; hr hr } hr hr hr hr hr if(len < length){ hr hr hr idexof_++; hr hr } hr hr }r l return idexof_; hr } te返回顶部按钮 hr " l" ivfunction "howScroll(){ hr " hrrrrr$("html,body).anim ({scrollTop:$("body).offset().top},1000); " hr" hr} te时间戳 " hr" hrvar etT meMark = function(){ " hr hr return new D (). etT me(); " hr" hr}; " hr" hr " l" ivfunction loginedTo(getway){ " hr hr " hr hr var userId = ''; " hr hr var loginbox = $('.box_yd'); hr " hr hr " hr $("#login_ifram).attr("src",ass="catepassport.utouu.com/login?service=ss="://wwwy-item"> logined-dialog/"+getway+"&getway=dialog&pl form=-item"> ") ; hr " hrrrrr$('#login_ifram').attr('src',r$('#login_ifram').attr('src')); hr rrrr loginbox.show(); " hr" hr} " hrrrrr$(function(){ " hr hr var loginbox = $('.box_yd'); hr " hr hr " hr //loginbox.attr("location_ep.c ,wdow.location.ep.c); hr " hr hr " hr $('.login').click(function() { " hr hr loginbox.show(); " hr" hr }); hr " hr $('.closi_yd').click(function() { " hr hr loginbox.hide(); " hr" hr }); " hr" hr te消息样式控制 hr " hrrrrrvar imgsVal = $("#imsgcount ).text(); " hr" hr if(imgsVal.length>0){ hr " hrrrrr if(imgsVal.length===1){ hr " hrrrrr $("#imsgcount ).css({ hr " hrrrrrrrrr rrrr'border-radius': '12px', " hr" hr" hr }) " hr" hr" hr }elserif(imgsVal.length===2){ hr " hrrrrr $("#imsgcount ).css({ hr " hrrrrr 'border-radius': '10px', " hr" hr" hr }) " hr" hr" hr }elserif(imgsVal.length===3){ hr " hrrrrr $("#imsgcount ).css({ hr " hrrrrr 'border-radius': '8px', " hr" hr" hr }) " hr" hr" hr } " hr" hr } " hr" hr}); " hr" hr " l" ivfunction loginBoxShow(){ " hr hr var loginbox = $('.box_yd'); hr " hr loginbox.show(); " hr" hr} " hrrrrrfunction loginBoxClosi(){ " hr hr var loginbox = $('.box_yd'); hr " hr loginbox.hide(); " hr" hr} " hr" hr " l" ivfunction othSearch(){ " hr hr rvar e = wdow.event || arguments.callee.caller.arguments[0]; " hrrrrrrrrrrif (e && e.keyCode == 13 ) { " hr hr toSearch(); " hrrrrrrrrrr} " hr" hr} " hr" " hr" hfunction toSearch(){ " hr hr var arch = $("#othSearch).val(); " hrrrrrrrrr" cmitForPost(/g -search",search); " hr hr} " hr span  400-036-7718 "span span 系客服 "span span 系客服 "span span 回>< span span 回顶部 span ui/pc/skin/vendor/kefu-webim-easemob-webim-plugin-open1.0/static/css/im.css"/g script yp text/javascript" t* $(".gg-closibtn ).on("click",function(){ trrrrrrrrr$(this).parent().hide(); t });r*/ // var easemobIM = { fig: {}r}; // easemobIM. fig.tenantId = '40770';//企业id // easemobIM. fig.to = 'kefuchannelimid_107579';//必填, 指定关 对应的im号 // easemobIM. fig.appKey = '1111170503178206#kefuchannelapp40770';//必填, appKey // easemobIM. fig.staticPath='ss="category-item"> ui/pc/skin/vendor/kefu-webim-easemob-webim-plugin-open1.0/static'; // easemobIM. fig.hide = true; // easemobIM. fig.dragEn = true;te是否允许拖拽 // easemobIM. fig.authMode = 'token'; t //easemobIM. fig.user = {name:'',password: '',token: ''} t //var visitor = {}; t //visitor.info = {trueName:'',qq:'',phone:'',companyName:'用户id:'+'',userNickname:'',description:'',email:''}; t ui/pc/skin/vendor/kefu-webim-easemob-webim-plugin-open1.0/static/js/easemob.js script