guang.detail-list.js 6.17 KB
webpackJsonp([12],{0:function(e,n,o){function t(e){var n,o,t;c.showLoadingMask(),a.ajax({type:"GET",url:"/guang/star/detailList",data:{page:e,tag:a(".detail-list").data("name")},dataType:"html",success:function(e){h=!1,""===e&&(h=!0,s.show("没有更多内容了")),a(".detail-list").append(e),a(".cont-area").each(function(){n=a(this),o=n.find(".title"),t=n.find(".cont-txt"),o[0].mlellipsis(2),t[0].mlellipsis(2)}),d(a("img.lazy")),c.hideLoadingMask()},error:function(){s.show("网络断开连接了~")}})}function i(){!h&&a(window).scrollTop()+a(window).height()>a("body").height()-100&&(h=!0,u++,t(u))}var a=o(1),s=o(2),c=o(5),d=o(6),r=o(10),l=a(".detail-list"),h=!1,u=1;o(17),r.init(),a(window).scroll(function(){i()}),0===l.find("li").length&&t(1)},2:function(e,n,o){function t(e,n){var o,t;"undefined"!=typeof e&&(o=e.toString(),t=n&&n>0?n:2e3,i.text(o).show(),a=setTimeout(function(){"block"===i.css("display")&&i.hide()},t))}var i,a,s=o(1);!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';s(".yoho-page").append(e),i=s("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(a)})}(),n.show=t},3:function(e,n,o){function t(e){var n,o,t=document.cookie;return document.cookie&&""!==document.cookie&&(o=t.indexOf(e+"="),o>-1&&(o+=e.length+1,n=decodeURIComponent(p.trim(t.substring(o,t.indexOf(";",o)))))),n}function i(e,n,o){var t,i,a,s,c="";"undefined"!=typeof n&&(o=o||{},null===n&&(n="",o.expires=-1),o.expires&&("number"==typeof o.expires||o.expires.toUTCString)&&("number"==typeof o.expires?(s=new Date,s.setTime(s.getTime()+24*o.expires*60*60*1e3)):s=o.expires,c="; expires="+s.toUTCString()),t=o.path?"; path="+o.path:"",i=o.domain?"; domain="+o.domain:"",a=o.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(n),c,t,i,a].join(""))}function a(){var e=!!navigator.cookieEnabled;return"undefined"!=typeof navigator.cookieEnabled||e||(document.cookie="testcookie",e=-1!==document.cookie.indexOf("testcookie")),e}function s(){var e,n=t("_UID");return"undefined"==typeof n?0:(e=n.split("::"),"undefined"==typeof e||e.length<4?0:e)}function c(){var e=s();return 0===e?0:e[1]}function d(){var e=t("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function r(){var e;0!==f.length&&(e=Math.min(p(window).height(),window.screen.availHeight),p("body").height()<=e-parseInt(f.css("height"),0)?f.addClass("bottom"):f.removeClass("bottom"))}function l(e){var n=p(e).outerHeight();e&&f.css("margin-bottom",n+"px")}function h(){var e,n,o=[],t=window.location.search.slice(1).split("&");for(n=0;n<t.length;n++)e=t[n].split("="),o.push(e[0]),o[e[0]]=e[1];return o}function u(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var p=o(1),m=o(4),f=p("#yoho-footer"),g=p(".yoho-page"),w=p(".yoho-header");!function(){var e,n=f.children(".op-row"),o=p(".back-to-top"),t=s();r(),0===t?n.prepend('<a href="http://m.yohobuy.com/signin.html?refer='+location.href+'">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):n.prepend('<span>Hi,</span><a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+t[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index">退出</a>'),o.length>0&&(e=new m(o[0]),e.on("tap",function(e){return p(window).scrollTop(0),e.srcEvent.preventDefault(),!1})),f.removeClass("hide")}(),function(e,n,o,t,i){var a=n.createElement(o),s=n.getElementsByTagName(o)[0];e.YohoAcquisitionObject=i,e[i]=function(){e[i].p=arguments},a.async=1,a.src=t,s.parentNode.insertBefore(a,s)}(window,document,"script",("https:"===document.location.protocol?"https":"http")+"://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js","_yas"),function(){var e=c();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.17","yohobuy_m",e,"","")}(),w.on("touchstart","a",function(){w.find("a").removeClass("highlight"),p(this).addClass("highlight")}).on("touchend touchcancel","a",function(){p(this).removeClass("highlight")}),g.on("touchstart",".tap-hightlight",function(){p(this).siblings(".tap-hightlight").removeClass("highlight"),p(this).addClass("highlight")}).on("touchend touchcancel",".tap-hightlight",function(){p(this).removeClass("highlight")}),p(".nav-home").on("touchstart",function(){p(".homebuttom").toggleClass("hide")}),function(){var e,n,o=0,t="webkit moz ms o".split(" "),i=window.requestAnimationFrame,a=window.cancelAnimationFrame;for(n=0;n<t.length&&(!i||!a);n++)e=t[n],i=i||window[e+"RequestAnimationFrame"],a=a||window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"];i&&a||(i=function(e){var n=(new Date).getTime(),t=Math.max(0,16-(n-o)),i=window.setTimeout(function(){e(n+t)},t);return o=n+t,i},a=function(e){window.clearTimeout(e)}),window.requestAnimationFrame=i,window.cancelAnimationFrame=a}(),p.extend({queryString:h}),11===f.find(".user-name").text().length&&f.find(".user-name").html(u(f.find(".user-name").text())),window.cookie=t,window.setCookie=i,window.isCookiesEnabled=a,window.getUser=s,window.getUid=c,window.getShoppingKey=d,window.rePosFooter=r,window.reMarginFooter=l,window.queryString=h()},5:function(e,n,o){function t(e){var n='<div class="loading-mask hide"><div class="loading"><div></div><div></div><div></div></div></div>';r=!0,e||(e=d),e.append(n),s=e.children(".loading-mask"),c("body").on("touchstart touchmove touchend",".loading-mask",function(){return!1})}function i(){r||(t(),r=!0),s.removeClass("hide")}function a(){s.addClass("hide")}var s,c=o(1),d=c(".yoho-page"),r=!1;n.init=t,n.showLoadingMask=i,n.hideLoadingMask=a,n.show=i,n.hide=a},17:function(e,n,o){var t=o(1),i=o(2);o(3),t(".collocation-list,.detail-list").on("click",".collection",function(){var e,n,o,a=t(this),s=a.find(".collected-ico");e=s.hasClass("collected")?"del":"fav",t(this).parents(".collocation-list").length>0?(n="1",o=""):(n="2",o=t(".detail-list").data("name")),t.ajax({type:"POST",url:"/guang/star/setFavorite",data:{articleId:a.parents("li").attr("articleId"),type:e,pageType:n,tag:o},success:function(e){var n=e.code;200===n&&(s.hasClass("collected")?s.removeClass("collected"):s.addClass("collected")),400===n&&(t("#collocation-link").length<=0&&t("body").append("<a href='"+e.data+'\' style="display:none;" id="collocation-link"><span class="collocation-link"></span></a>'),t(".collocation-link").click())},error:function(){i.show("网络断开连接了~")}})})}});