guang.detail-list.js 6.2 KB
webpackJsonp([10],{0:function(n,e,o){function t(n){var e,o,t;c.showLoadingMask(),a.ajax({type:"GET",url:"/guang/star/detailList",data:{page:n,tag:a(".detail-list").data("name")},dataType:"html",success:function(n){h=!1,""===n&&(h=!0,s.show("没有更多内容了")),a(".detail-list").append(n),a(".cont-area").each(function(){e=a(this),o=e.find(".title"),t=e.find(".cont-txt"),o[0].mlellipsis(2),t[0].mlellipsis(2)}),r(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),r=o(6),d=o(10),l=a(".detail-list"),h=!1,u=1;o(16),d.init(),a(window).scroll(function(){i()}),0===l.find("li").length&&t(1)},2:function(n,e,o){function t(n,e){var o,t;"undefined"!=typeof n&&(o=n.toString(),t=e&&e>0?e:2e3,i.text(o).show(),a=setTimeout(function(){"block"===i.css("display")&&i.hide()},t))}var i,a,s=o(1);!function(){var n='<div id="yoho-tip" class="yoho-tip"></div>';s(".yoho-page").append(n),i=s("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(a)})}(),e.show=t},3:function(n,e,o){function t(n){var e,o,t=document.cookie;return document.cookie&&""!==document.cookie&&(o=t.indexOf(n+"="),o>-1&&(o+=n.length+1,e=decodeURIComponent(p.trim(t.substring(o,t.indexOf(";",o)))))),e}function i(n,e,o){var t,i,a,s,c="";"undefined"!=typeof e&&(o=o||{},null===e&&(e="",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=[n,"=",encodeURIComponent(e),c,t,i,a].join(""))}function a(){var n=!!navigator.cookieEnabled;return"undefined"!=typeof navigator.cookieEnabled||n||(document.cookie="testcookie",n=-1!==document.cookie.indexOf("testcookie")),n}function s(){var n,e=t("_UID");return"undefined"==typeof e?0:(n=e.split("::"),"undefined"==typeof n||n.length<4?0:n)}function c(){var n=s();return 0===n?0:n[1]}function r(){var n=t("_g");return"undefined"==typeof n?"":JSON.parse(n).k}function d(){var n;0!==m.length&&(n=Math.min(p(window).height(),window.screen.availHeight),p("body").height()<=n-parseInt(m.css("height"),0)?m.addClass("bottom"):m.removeClass("bottom"))}function l(n){var e=p(n).outerHeight();n&&m.css("margin-bottom",e+"px")}function h(){var n,e,o=[],t=window.location.search.slice(1).split("&");for(e=0;e<t.length;e++)n=t[e].split("="),o.push(n[0]),o[n[0]]=n[1];return o}function u(n){return n.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var p=o(1),f=o(4),m=p("#yoho-footer"),g=p(".yoho-page"),w=p(".yoho-header");!function(){var n,e=m.children(".op-row"),o=p(".back-to-top"),t=s();d(),0===t?e.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>'):e.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&&(n=new f(o[0]),n.on("tap",function(n){return p(window).scrollTop(0),n.srcEvent.preventDefault(),!1})),m.removeClass("hide")}(),function(n,e,o,t,i){var a=e.createElement(o),s=e.getElementsByTagName(o)[0];n.YohoAcquisitionObject=i,n[i]=function(){n[i].p=arguments},a.async=1,a.src=t,s.parentNode.insertBefore(a,s)}(window,document,"script","http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js","_yas"),function(){var n=c();n=0===n?"":n,window._ozuid=n,window._yas&&window._yas(1*new Date,"1.0.14","yohobuy_m",n,"","")}(),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 n,e,o=0,t="webkit moz ms o".split(" "),i=window.requestAnimationFrame,a=window.cancelAnimationFrame;for(e=0;e<t.length&&(!i||!a);e++)n=t[e],i=i||window[n+"RequestAnimationFrame"],a=a||window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"];i&&a||(i=function(n){var e=(new Date).getTime(),t=Math.max(0,16-(e-o)),i=window.setTimeout(function(){n(e+t)},t);return o=e+t,i},a=function(n){window.clearTimeout(n)}),window.requestAnimationFrame=i,window.cancelAnimationFrame=a}(),p.extend({queryString:h}),11===m.find(".user-name").text().length&&m.find(".user-name").html(u(m.find(".user-name").text())),window.cookie=t,window.setCookie=i,window.isCookiesEnabled=a,window.getUser=s,window.getUid=c,window.getShoppingKey=r,window.rePosFooter=d,window.reMarginFooter=l,window.queryString=h()},5:function(n,e,o){function t(n){var e='<div class="loading-mask hide"><div class="loading"><div></div><div></div><div></div></div></div>';d=!0,n||(n=r),n.append(e),s=n.children(".loading-mask"),c("body").on("touchstart touchmove touchend",".loading-mask",function(){return!1})}function i(){d||(t(),d=!0),s.removeClass("hide")}function a(){s.addClass("hide")}var s,c=o(1),r=c(".yoho-page"),d=!1;e.init=t,e.showLoadingMask=i,e.hideLoadingMask=a,e.show=i,e.hide=a},16:function(n,e,o){var t=o(1),i=o(2);o(3),t(document).on("click",".collection",function(){var n,e=t(this),o=e.find(".collected-ico");n=o.hasClass("collected")?"del":"fav",t.ajax({type:"POST",url:"/guang/star/setFavorite",data:{articleId:e.parents("li").attr("articleId"),type:n},success:function(n){var e=n.code;200===e&&(o.hasClass("collected")?o.removeClass("collected"):o.addClass("collected")),401===e&&(t("#collocation-link").length<=0&&t("body").append("<a href='"+n.data+'\' style="display:none;" id="collocation-link"><span class="collocation-link"></span></a>'),t(".collocation-link").click())},error:function(){i.show("网络断开连接了~")}})}),window.successShare=function(){t.ajax({type:"POST",url:"/guang/starclass/forward",success:function(n){var e=n.code;200===e&&n.data>0&&i.show("分享成功,亲密度+10")},error:function(){i.show("网络断开连接了~")}})}}});