Authored by 郭成尧

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuy-node into release/4.6

... ... @@ -95,7 +95,7 @@ exports.getOutletsGoodsList = (params) => {
// 接口可接收的参数
let apiParams = ['outlets', 'page', 'limit', 'order', 'productSize', 'yh_channel', 'query',
'p_d', 'gender', 'msort', 'misort', 'sort', 'brand', 'color', 'size', 'saleType',
'breakSize', 'breakSort', 'productPool', 'price'];
'breakSize', 'breakSort', 'productPool', 'price', 'method'];
// 初始化必填的接口参数
let tempParams = {
... ...
... ... @@ -58,7 +58,9 @@ const handleOutletsGoodsMenuData = (origin, params) => {
let dest = {
title: '最新折扣',
more: '/product/outlets/list',
menuList: []
menuList: [],
msort: [],
misort: []
};
var oldParam = _.cloneDeep(params);
... ... @@ -78,9 +80,11 @@ const handleOutletsGoodsMenuData = (origin, params) => {
if (urlSuffix.msort) {
Object.assign(oldParam, {msort: urlSuffix.msort});
dest.msort.push(urlSuffix.msort);
}
if (urlSuffix.misort) {
Object.assign(oldParam, {misort: urlSuffix.misort});
dest.misort.push(urlSuffix.misort);
}
goodsmenu.href = '?' + queryString.stringify(oldParam) + '#otspool';
... ...
... ... @@ -18,6 +18,7 @@ const headerModel = require('../../../doraemon/models/header');
const _ = require('lodash');
const publicHandler = require('./public-handler');
const log = require(`${global.library}/logger`);
// 奥莱频道资源码
const channelCode = {
... ... @@ -41,10 +42,6 @@ exports.getOutletsIndexData = (params, channel) => {
outletsApi.getOutletsActivityOrigin({type: '1', channel: channel}), // 获取限时活动列表
outletsApi.getOutletsActivityOrigin({type: '2', channel: channel}), // 获取即将结束列表
outletsApi.getOutletsTrendData({limit: '30', channel: channel}), // 获取潮流速递商品数据
outletsApi.getOutletsGoodsList(Object.assign(
params,
{limit: params.limit || '100', channel: channel}
)), // 获取底部商品数据
outletsApi.getOutletsActivityOrigin({type: '3', channel: channel}) // tar add 16171552 即将上线数据
]).then(result => {
... ... @@ -77,37 +74,57 @@ exports.getOutletsIndexData = (params, channel) => {
finalResult.limitedBuy.extra.trendGood = outletsProcess.handleOutletstrendGoodData(result[4].data);
}
// 处理底部商品数据
// 处理即将上架品牌数据
if (result[5].code === 200 && !_.isEmpty(result[5].data)) {
if (!finalResult.goodsBoard) {
finalResult.goodsBoard = {};
}
Object.assign(finalResult.goodsBoard, {
sort: Object.assign(publicHandler.handleSaleOptsData(params, result[5].data.total), {newPage: true}),
list: productProcess.processProductList(result[5].data.product_list)
});
// 添加锚点
if (finalResult.goodsBoard.sort.sortType) {
_.forEach(finalResult.goodsBoard.sort.sortType, (value, key) => {
finalResult.goodsBoard.sort.sortType[key].href += '#otspool';
});
if (finalResult.goodsBoard.sort.preHref) {
finalResult.goodsBoard.sort.preHref += '#otspool';
}
if (finalResult.goodsBoard.sort.nextHref) {
finalResult.goodsBoard.sort.nextHref += '#otspool';
}
}
finalResult.goodsBoard.footPager = publicHandler.handlePagerData(result[5].data.total, params);
finalResult.limitedBuy.extra.comeSoon = outletsProcess.handleComeSoonData(result[5].data);
}
// 处理即将上架品牌数据
if (result[6].code === 200 && !_.isEmpty(result[6].data)) {
finalResult.limitedBuy.extra.comeSoon = outletsProcess.handleComeSoonData(result[6].data);
// 如果后台没配分类,不显示商品列表
if (!finalResult.goodsBoard.goodsMenu.msort && !finalResult.goodsBoard.goodsMenu.msort) {
log.info('no config index sort');
return finalResult;
}
return finalResult;
// 获取底部商品数据
if (!params.msort || !params.misort) {
Object.assign(
params,
{
msort: finalResult.goodsBoard.goodsMenu.msort.join(','),
misort: finalResult.goodsBoard.goodsMenu.misort.join(',')
}
);
}
return api.all([
outletsApi.getOutletsGoodsList(Object.assign(
params,
{limit: params.limit || '100', channel: channel, method: 'app.search.category'}
))
]).then(data => {
// 处理底部商品数据
if (data[0].code === 200 && !_.isEmpty(data[0].data)) {
Object.assign(finalResult.goodsBoard, {
sort: Object.assign(publicHandler.handleSaleOptsData(params, data[0].data.total), {newPage: true}),
list: productProcess.processProductList(data[0].data.product_list)
});
// 添加锚点
if (finalResult.goodsBoard.sort.sortType) {
_.forEach(finalResult.goodsBoard.sort.sortType, (value, key) => {
finalResult.goodsBoard.sort.sortType[key].href += '#otspool';
});
if (finalResult.goodsBoard.sort.preHref) {
finalResult.goodsBoard.sort.preHref += '#otspool';
}
if (finalResult.goodsBoard.sort.nextHref) {
finalResult.goodsBoard.sort.nextHref += '#otspool';
}
}
finalResult.goodsBoard.footPager = publicHandler.handlePagerData(data[0].data.total, params);
}
return finalResult;
});
});
};
... ... @@ -137,10 +154,7 @@ exports.getOutletsChannelData = (params, channel) => {
size: 0,
channel: channel,
type: 1
}),
// 获取奥莱商品列表
outletsApi.getOutletsGoodsList(Object.assign(params, {channel: channel}))
})
];
return api.all(apiArr).then(result => {
... ... @@ -164,31 +178,47 @@ exports.getOutletsChannelData = (params, channel) => {
channelData.nearOver = outletsProcess.handleOutletsActivityData(result[2].data, '限时嗨购');
}
// 商品列表
if (result[3].code === 200) {
if (!channelData.goodsBoard) {
channelData.goodsBoard = {};
}
channelData.goodsBoard.sort = publicHandler.handleSaleOptsData(params, result[3].data.total);
channelData.goodsBoard.sort.newPage = true;
channelData.goodsBoard.list = productProcess.processProductList(result[3].data.product_list);
channelData.goodsBoard.footPager = publicHandler.handlePagerData(result[3].data.total, params);
// 添加锚点
if (channelData.goodsBoard.sort.sortType) {
_.forEach(channelData.goodsBoard.sort.sortType, (value, key) => {
channelData.goodsBoard.sort.sortType[key].href += '#otspool';
});
if (channelData.goodsBoard.sort.preHref) {
channelData.goodsBoard.sort.preHref += '#otspool';
// 如果后台没配分类,不显示商品列表
if (!channelData.goodsBoard || !channelData.goodsBoard.goodsMenu ||
(!channelData.goodsBoard.goodsMenu.msort && !channelData.goodsBoard.goodsMenu.msort)) {
log.info('no config ' + channel + 'channel sort');
return channelData;
}
// 获取底部商品数据
return api.all([
outletsApi.getOutletsGoodsList(Object.assign(
params,
{limit: params.limit || '100', channel: channel, method: 'app.search.category',
msort: channelData.goodsBoard.goodsMenu.msort.join(),
misort: channelData.goodsBoard.goodsMenu.misort.join()
}
))
]).then(data => {
if (data[0].code === 200) {
if (!channelData.goodsBoard) {
channelData.goodsBoard = {};
}
if (channelData.goodsBoard.sort.nextHref) {
channelData.goodsBoard.sort.nextHref += '#otspool';
channelData.goodsBoard.sort = publicHandler.handleSaleOptsData(params, data[0].data.total);
channelData.goodsBoard.sort.newPage = true;
channelData.goodsBoard.list = productProcess.processProductList(data[0].data.product_list);
channelData.goodsBoard.pager = publicHandler.handlePagerData(data[0].data.total, params);
// 添加锚点
if (channelData.goodsBoard.sort.sortType) {
_.forEach(channelData.goodsBoard.sort.sortType, (value, key) => {
channelData.goodsBoard.sort.sortType[key].href += '#otspool';
});
if (channelData.goodsBoard.sort.preHref) {
channelData.goodsBoard.sort.preHref += '#otspool';
}
if (channelData.goodsBoard.sort.nextHref) {
channelData.goodsBoard.sort.nextHref += '#otspool';
}
}
}
}
return channelData;
return channelData;
});
});
};
... ...
This diff could not be displayed because it is too large.
webpackJsonp([3],[function(e,t,i){function n(e){var t=36e5,i=6e4,n=1e3,s="",a=0,l=0,o=0,r=0;return e>1e3&&(a=Math.floor(e/t/24),l=Math.floor(e/t%24),o=Math.floor(e/i%60),r=Math.floor(e/n%60),s+=a>0?a+"天":"",s+=l>0?l+"时":"",s+=o>0?o+"分":"",s+=r>0?r+"秒":""),s}function s(){var e,t,i,s;for(e=0;e<p.length;e++){if(p[e].time<0)return;p[e].time-=1e3,i=n(p[e].time),i?(t=i,p[e].pre&&(t=p[e].pre+" "+t)):(s=p[e].dom.closest(".item-info").parent(),s.find("a").attr("onclick","return false;"),t="活动已结束"),p[e].dom.text(t)}}function a(e,t){e.animate({"margin-left":10*-t+"0%"},"fast").data({page:t})}function l(e,t){var i="",n=[],s=0;if(e.length){for(e.each(function(){s%t===0&&n.push(""),n[n.length-1]+=e[s].outerHTML,s++}),n.length>3&&(n.length=3),s=0;s<n.length;s++)i+='<div class="list-page">'+n[s]+"</div>";return{length:n.length,html:i}}}function o(){var e=l(h.find(".good-item"),5),t=l(u.find(".brand-item"),9);e&&e.length>1&&(h.html(e.html).data({max:e.length}),h.siblings(".page-btns").show()),t&&t.length>1&&(u.html(t.html).data({max:t.length}),u.siblings(".page-btns").show())}var r,d=i(1),c=i(2),h=d(".limit-main .good-list"),u=d(".limit-main .brand-list"),f=d(".sort-layer .full-line"),m=d(".outlets-page").data("page"),p=[];i(4),i(5),i(20),f.length&&(r=f.parent(),d(window).scroll(function(){var e=r.position().top;d(this).scrollTop()>=e?f.addClass("fixed"):f.removeClass("fixed")})),d(".time").each(function(){var e=d(this).data();e.limit&&p.push({dom:d(this),time:e.limit,pre:e.pre?e.pre:""})}),d(".page-btns > label").click(function(){var e,t,i,n,s=(new Date).getTime();e=d(this).closest(".good-page-btns").length?h:u,t=e.data(),i=t.max?t.max:1,n=t.page?t.page:0,t.time&&s-t.time<500||(e.data({time:s}),n+=d(this).hasClass("pre-page-btn")?i-1:1,n%=i,a(e,n))}),setInterval(s,1e3),m?d(".slide-container").slider({orient:!1}):d(".slide-container").slider({orient:!0}),o(),c(d("img.lazy"))},,,,,function(e,t,i){var n=i(1),s=i(2);!function(){var e=function(e,t){this.$element=n(e),this.options=n.extend({},n.fn.slider.defaults,t),this.bigItem=this.$element.find(".slide-wrapper").find("li"),this.smallItem=null,this.len=this.bigItem.size(),this.index=0,this.timer=null,this.init()};e.prototype={init:function(){if(this.$element){if(this.len<=1)return void s(this.$element.find("img.lazy"));this.options.pagination?this.smallItem=n(this.options.pagination).find("li"):this._createPage(),this.options.orient&&this._createOrient(),this._slideShow(),this._bindEvent(),this._autoplay()}},_createOrient:function(){var e='<div class="slide-switch"><a class="prev" href="javascript:;"><span class="iconfont">&#xe609;</span></a><a class="next" href="javascript:;"><span class="iconfont">&#xe608;</span></a></div>';this.$element.find(".slide-switch").length>0||this.$element.append(e)},_createPage:function(){var e='<div class="slide-pagination"><div class="slide-pagination-inner"><div class="slide-shade"></div><div class="slide-pagination-last">',t=0;if(!(this.len<=1)){for(t=0;t<this.len;t++)e+="<span></span>";e+="</div></div></div>",this.$element.append(n(e)),this.smallItem=this.$element.find(".slide-pagination-inner span")}},_bindEvent:function(){var e=this;this.$element.find(".slide-switch").on("click",".next",function(){e._nextSlide(),clearInterval(e.timer),e.timer=setInterval(function(){e._nextSlide()},e.options.time)}).on("click",".prev",function(){e._prevSlide(),clearInterval(e.timer),e.timer=setInterval(function(){e._nextSlide()},e.options.time)}),this.smallItem.on("mouseenter",function(){e.index=n(this).index(),clearInterval(e.timer),e._slideShow()}).on("mouseleave",function(){e._autoplay()}),this.$element.on("mouseenter",function(){n(this).find(".slide-switch").addClass("show")}).on("mouseleave",function(){n(this).find(".slide-switch").removeClass("show")})},_nextSlide:function(){this.index===this.len-1?this.index=0:this.index++,this._slideShow()},_prevSlide:function(){0===this.index?this.index=this.len-1:this.index--,this._slideShow()},_slideShow:function(){var e=this.bigItem.eq(this.index).find("img.lazy");e.attr("src")!==e.data("original")&&(s(e,{event:"sporty"}),e.trigger("sporty")),this.smallItem.eq(this.index).addClass("focus").siblings().removeClass("focus"),this.bigItem.eq(this.index).show().stop().animate({opacity:1},function(){n(this).find(".slide-tips > p").removeClass("hide")}).siblings().stop().animate({opacity:0},function(){n(this).hide().find(".slide-tips > p").addClass("hide")})},_autoplay:function(){var e=this;clearInterval(this.timer),this.timer=setInterval(function(){e._nextSlide()},this.options.time)}},n.fn.slider=function(t){return this.each(function(){var i=n(this),s=i.data("Slider"),a="object"==typeof t&&t;s||i.data("Slider",s=new e(this,a)),"string"==typeof t&&s[t]()})},n.fn.slider.Constructor=e,n.fn.slider.defaults={time:5e3,orient:!0,pagination:null}}(n)},function(e,t,i){function n(e,t){e.each(function(){v(this).closest(".attr").hasClass("checked")||v(this).removeClass("checked").html(C.unchecked)}),t.find(".checkbox").addClass("checked").html(C.checked)}function s(){k.addClass("hide"),w.removeClass("hide")}function a(){w.addClass("hide"),k.removeClass("hide"),S.children("span").removeClass("hover")}function l(e,t){var i,n=window.queryString();n[e]=t,delete n.page,i="?"+decodeURIComponent(v.param(n)),window.location.href=i}function o(){$.children(".senior-sub:eq("+p+")").addClass("hide"),z.children(".attr:eq("+p+")").removeClass("hover"),p=-1}var r,d,c,h,u,f,m,p,v=i(1),g=i(3),C={unchecked:"&#xe612;",checked:"&#xe613;"},b={up:"&#xe607;",down:"&#xe60b;"},k=v(".brand .default"),x=v("#brand-search-input"),w=v(".brand .brand-panel"),y=w.find(".attr"),I=v("#brand-more"),_=v("#brand-multi"),S=v(".brands-index"),T=v(".ud-price-range"),q=/^\d+$/,M=v(".sort-sub-wrap"),$=v(".senior-sub-wrap"),z=v(".senior-attr-wrap"),L='{{# size}}<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>{{/ size}}',j={},D=v(".filter-box .size");L=g.compile(L),v(".filter-box").on("selectstart",".attr, .brands-index span",function(){return!1}),v(".sort-pre").on("click","li",function(){var e=v(this),t=e.index(),i=e.data("id");return e.hasClass("active")?(e.removeClass("active"),M.children(":eq("+t+")").addClass("hide"),void D.addClass("hide")):(e.siblings(".active").removeClass("active"),e.addClass("active"),M.children(":not(.hide)").addClass("hide"),M.children(":eq("+t+")").removeClass("hide"),void(D.data("load")||(j[i]?(D.find(".attr-content").html(j[i]),D.removeClass("hide")):v.ajax({url:"/product/search/sortSize",data:{msort:i}}).then(function(e){"array"===v.type(e)&&e.length?(j[i]=L({size:e}),D.find(".attr-content").html(j[i]),D.removeClass("hide")):D.addClass("hide")}))))}),I.length>0&&(r=I.children("em"),d=I.children(".iconfont")),_.click(function(){"none"===w.css("display")&&I.trigger("click"),s(),w.removeClass("hide").addClass("multi"),v(this).addClass("hide"),I.addClass("hide")}),I.click(function(){var e=v(this);e.hasClass("more")?(a(),r.text("更多"),d.html(b.down),x.val("").trigger("keyup")):(s(),r.text("收起"),d.html(b.up)),v(this).toggleClass("more")}),S.on("mouseenter","span",function(){var e=v(this),t=e.data("index");e.hasClass("hover")||setTimeout(function(){e.siblings("span.hover").removeClass("hover"),e.addClass("hover"),0===e.index()?y.removeClass("hide"):y.addClass("hide").filter("[data-index="+t+"]").removeClass("hide")},120)}),x.keyup(function(){var e=v(this).val().toLowerCase();""===e?y.removeClass("hide"):y.addClass("hide").filter('[data-key*="'+e+'"]').removeClass("hide")}),v("#brand-multi-ok").click(function(){var e=[];v(this).hasClass("dis")||(w.find("span.checked").each(function(){e.push(v(this).data("id"))}),l("brand",e.join(",")))}),v(".multi-select-cancel").click(function(){var e=v(this).closest(".multi");e.hasClass("brand-panel")&&(_.removeClass("hide"),I.trigger("click"),I.removeClass("hide"),x.val("").trigger("keyup"),a()),e.addClass("hide").removeClass("multi"),n(e.find(".checkbox.checked"),e.find(".attr.checked")),v(this).siblings(".multi-select-ok").addClass("dis")}),v(".check-container").on("click",".attr",function(){var e=v(this),t=e.find(".checkbox"),i=e.closest(".brand-panel, .senior-sub").find(".multi-select-ok");t.toggleClass("checked"),t.hasClass("checked")?t.html(C.checked):t.html(C.unchecked),t.hasClass("checked")||e.siblings(".attr").find(".checked").length>0?i.removeClass("dis"):i.addClass("dis")}),v(".brand, .senior").on("click",".attr > a",function(e){v(this).closest(".multi").length>0&&e.preventDefault()}),v(".filter-box").on("click","li.checked, a.checked",function(e){e.preventDefault()}),T.length>0&&(c=T.find(".limit"),h=c.filter(".min"),u=c.filter(".max"),f=T.find(".price-sure"),c.keyup(function(){var e,t,i,n=v.trim(v(this).val()),s=q.test(n);s||(e=parseInt(n,10),v(this).val(isNaN(e)?"":e)),t=v.trim(h.val()),i=v.trim(u.val()),""!==t||""!==i?f.removeClass("hide"):f.addClass("hide")}),f.click(function(){var e,t=v.trim(h.val()),i=v.trim(u.val());""!==t&&""!==i&&+t>+i&&(e=i,i=t,t=e),l("price",t+","+i)})),z.on("mouseenter",".attr",function(){var e=v(this),t=e.index();e.hasClass("no-sub")||(e.addClass("hover").siblings().removeClass("hover"),$.children(".senior-sub:eq("+t+")").removeClass("hide").siblings().addClass("hide"))}).on("mouseleave",".attr",function(){var e=v(this),t=e.index();e.hasClass("no-sub")||(p=t,m=setTimeout(function(){o()},100))}),v(".senior-sub").on("click",".multi-select",function(){v(this).closest(".senior-sub").addClass("multi")}).on("click",".multi-select-ok",function(){var e=v(this),t=e.closest(".senior-sub"),i=[];e.hasClass("dis")||(t.find("span.checked").each(function(){i.push(v(this).data("id"))}),l(t.data("attr"),i.join(",")))}).on("mouseenter",function(){clearTimeout(m)}).on("mouseleave",function(){o()})},function(e,t,i){var n=i(1),s=n("#count-per-page"),a=s.next("ul"),l=200;n(document).click(function(e){n(e.target).closest(".page-count").length>0||a&&a.slideUp(l)}),s.click(function(){"none"===a.css("display")?a.slideDown(l):a.slideUp(l)})},,,function(e,t,i){function n(){this.handlers={}}var s=i(1);n.prototype={constructor:n,addHandler:function(e,t){"undefined"==typeof this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e){var t,i;if(e.target||(e.target=this),this.handlers[e.type]instanceof Array)for(t=this.handlers[e.type],i=0;i<t.length;i++)t[i](e)},removeHandler:function(e,t){var i,n;if(this.handlers[e]instanceof Array){for(i=this.handlers[e],n=0;n<i.length&&i[n]!==t;n++);i.splice(n,1)}}},e.exports=function(e,t){function i(e){var i,n=0,h=0,u=t,f=0,m="",p=0,v=0;switch(e.type){case"mouseenter":i=s(this),a=setTimeout(function(){l=!0,m=i.clone(),f=i.index()+1,n=f%u===0?u:f%u,h=Math.ceil(f/u),p=i.offset().left,v=c-(p+r),o.fire({type:"MouseEnter",target:i,targetWidth:r,targetHeight:d,targetX:n,targetY:h,rowWidth:u,activeIndex:f,targetDuplicate:m,offsetL:p,offsetR:v})},150);break;case"mouseleave":l||(a&&clearTimeout(a),o.fire({type:"MouseLeave"})),l=!1}}var a,l,o=new n,r=e.eq(0).width(),d=e.eq(0).height(),c=s(window).width();return e.bind({mouseenter:i,mouseleave:i}),o}},function(e,t,i){var n,s=i(1),a=i(2),l=i(3),o=i(10),r=s(".goods-container"),d=r.find(".good-info"),c=r.find(".good-item-wrapper"),h=r.find(".good-info-main"),u=r.find(".good-select-color"),f=s(".product-list-nav");a(s("img.lazy")),t.init=function(e){function t(e,t){var i,n,s,a="",l=e.length,o=4,r=Math.ceil(l/o),d=0;for(i=0;r>i;i++)for(a+="<ul>",n=0;o>n&&(s=i*o+n,s!==l);n++)a+='<li><a target="_blank" href="'+e[i*o+n].url+t+'"><img src="'+e[i*o+n].src+'" data-cover="'+e[i*o+n].coverImg+'" /></a></li>',n===o-1&&(a+="</ul>",d++);return r>d&&(a+="</ul>"),{colorListStr:a,ulNum:r}}function i(){h.html(""),u.html(""),c.css({display:"none"})}n=null,d.unbind(),n=o(d,e),n.addHandler("MouseEnter",function(e){var n,a,l,o,d,f,m,p,v,g,C,b,k=10,x=35,w=e.target.attr("data-from")||"";l=[],e.target.find(".hideList > li").each(function(){a=s(this).data(),a.coverImg=a.src,l.push(a)}),n=t(l,w),i(),d=n.colorListStr,o=n.ulNum,h.append(e.targetDuplicate),u.append(s(d)),g=c.css("paddingLeft"),C=c.css("paddingTop"),b=r.css("paddingTop"),f=10+65*o+e.targetWidth,p=(e.targetX-1)*(e.targetWidth+k)-(parseInt(g,10)+1),v=(e.targetY-1)*(e.targetHeight+x)+parseInt(b,10)-(parseInt(C,10)+1),m=e.offsetR-(65*o+25),0>=m&&(p=p+m-25),c.css({width:f,left:p,top:v,display:"inline-block"}),l[0]&&l[0].src&&h.find(".good-thumb img").attr("src",l[0].src)}),n.addHandler("MouseLeave",function(){i()}),c.mouseleave(function(){i()})},s(document).on("mouseenter",".good-select-color li",function(){var e=s(this).find("img").attr("data-cover"),t=s(this).closest(".good-item-wrapper").find(".good-detail-img img");t.attr("src",e)}),f.find("h3").click(function(){var e=s(this).closest(".product-list-nav");e.hasClass("active")?e.find(".sort-child-list").stop(!0,!0).slideUp():e.find(".sort-child-list").stop(!0,!0).slideDown(),e.toggleClass("active")}),function(){var e,t=s("#brand-card"),i=s("#brand-favor");t.length&&s.ajax({type:"POST",url:"/product/index/getNodeContent",data:{node:t.data("node")}}).then(function(e){t.html(e)}),i.length&&(e=s("#pic-link-tpl").html(),s.ajax({type:"POST",url:"/product/index/getAdnav",data:{brandId:i.data("id")}}).then(function(t){t&&s("#brand-ad").html(l.compile(e)({picLink:t}))}))}()},,,,,,,,,function(e,t,i){var n=i(11);i(6),i(7),n.init(4)}]);
\ No newline at end of file
webpackJsonp([3],[function(e,t,i){function n(e){var t=36e5,i=6e4,n=1e3,s="",a=0,l=0,o=0,r=0;return e>1e3&&(a=Math.floor(e/t/24),l=Math.floor(e/t%24),o=Math.floor(e/i%60),r=Math.floor(e/n%60),s+=a>0?a+"天":"",s+=l>0?l+"时":"",s+=o>0?o+"分":"",s+=r>0?r+"秒":""),s}function s(){var e,t,i,s;for(e=0;e<m.length;e++){if(m[e].time<0)return;m[e].time-=1e3,i=n(m[e].time),i?(t=i,m[e].pre&&(t=m[e].pre+" "+t)):(s=m[e].dom.closest(".item-info").parent(),s.find("a").attr("onclick","return false;"),t="活动已结束"),m[e].dom.text(t)}}function a(e,t){e.animate({"margin-left":10*-t+"0%"},"fast").data({page:t})}function l(e,t){var i="",n=[],s=0;if(e.length){for(e.each(function(){s%t===0&&n.push(""),n[n.length-1]+=e[s].outerHTML,s++}),n.length>3&&(n.length=3),s=0;s<n.length;s++)i+='<div class="list-page">'+n[s]+"</div>";return{length:n.length,html:i}}}function o(){var e=l(h.find(".good-item"),5),t=l(u.find(".brand-item"),9);e&&e.length>1&&(h.html(e.html).data({max:e.length}),h.siblings(".page-btns").show()),t&&t.length>1&&(u.html(t.html).data({max:t.length}),u.siblings(".page-btns").show())}var r,d=i(1),c=i(2),h=d(".limit-main .good-list"),u=d(".limit-main .brand-list"),f=d(".sort-layer .full-line"),m=[];i(4),i(5),i(20),f.length&&(r=f.parent(),d(window).scroll(function(){var e=r.position().top;d(this).scrollTop()>=e?f.addClass("fixed"):f.removeClass("fixed")})),d(".time").each(function(){var e=d(this).data();e.limit&&m.push({dom:d(this),time:e.limit,pre:e.pre?e.pre:""})}),d(".page-btns > label").click(function(){var e,t,i,n,s=(new Date).getTime();e=d(this).closest(".good-page-btns").length?h:u,t=e.data(),i=t.max?t.max:1,n=t.page?t.page:0,t.time&&s-t.time<500||(e.data({time:s}),n+=d(this).hasClass("pre-page-btn")?i-1:1,n%=i,a(e,n),d(window).trigger("scroll"))}),setInterval(s,1e3),d(".slide-container").slider({orient:!0}),o(),c(d("img.lazy"))},,,,,function(e,t,i){var n=i(1),s=i(2);!function(){var e=function(e,t){this.$element=n(e),this.options=n.extend({},n.fn.slider.defaults,t),this.bigItem=this.$element.find(".slide-wrapper").find("li"),this.smallItem=null,this.len=this.bigItem.size(),this.index=0,this.timer=null,this.init()};e.prototype={init:function(){if(this.$element){if(this.len<=1)return void s(this.$element.find("img.lazy"));this.options.pagination?this.smallItem=n(this.options.pagination).find("li"):this._createPage(),this.options.orient&&this._createOrient(),this._slideShow(),this._bindEvent(),this._autoplay()}},_createOrient:function(){var e='<div class="slide-switch"><a class="prev" href="javascript:;"><span class="iconfont">&#xe609;</span></a><a class="next" href="javascript:;"><span class="iconfont">&#xe608;</span></a></div>';this.$element.find(".slide-switch").length>0||this.$element.append(e)},_createPage:function(){var e='<div class="slide-pagination"><div class="slide-pagination-inner"><div class="slide-shade"></div><div class="slide-pagination-last">',t=0;if(!(this.len<=1)){for(t=0;t<this.len;t++)e+="<span></span>";e+="</div></div></div>",this.$element.append(n(e)),this.smallItem=this.$element.find(".slide-pagination-inner span")}},_bindEvent:function(){var e=this;this.$element.find(".slide-switch").on("click",".next",function(){e._nextSlide(),clearInterval(e.timer),e.timer=setInterval(function(){e._nextSlide()},e.options.time)}).on("click",".prev",function(){e._prevSlide(),clearInterval(e.timer),e.timer=setInterval(function(){e._nextSlide()},e.options.time)}),this.smallItem.on("mouseenter",function(){e.index=n(this).index(),clearInterval(e.timer),e._slideShow()}).on("mouseleave",function(){e._autoplay()}),this.$element.on("mouseenter",function(){n(this).find(".slide-switch").addClass("show")}).on("mouseleave",function(){n(this).find(".slide-switch").removeClass("show")})},_nextSlide:function(){this.index===this.len-1?this.index=0:this.index++,this._slideShow()},_prevSlide:function(){0===this.index?this.index=this.len-1:this.index--,this._slideShow()},_slideShow:function(){var e=this.bigItem.eq(this.index).find("img.lazy");e.attr("src")!==e.data("original")&&(s(e,{event:"sporty"}),e.trigger("sporty")),this.smallItem.eq(this.index).addClass("focus").siblings().removeClass("focus"),this.bigItem.eq(this.index).show().stop().animate({opacity:1},function(){n(this).find(".slide-tips > p").removeClass("hide")}).siblings().stop().animate({opacity:0},function(){n(this).hide().find(".slide-tips > p").addClass("hide")})},_autoplay:function(){var e=this;clearInterval(this.timer),this.timer=setInterval(function(){e._nextSlide()},this.options.time)}},n.fn.slider=function(t){return this.each(function(){var i=n(this),s=i.data("Slider"),a="object"==typeof t&&t;s||i.data("Slider",s=new e(this,a)),"string"==typeof t&&s[t]()})},n.fn.slider.Constructor=e,n.fn.slider.defaults={time:5e3,orient:!0,pagination:null}}(n)},function(e,t,i){function n(e,t){e.each(function(){v(this).closest(".attr").hasClass("checked")||v(this).removeClass("checked").html(C.unchecked)}),t.find(".checkbox").addClass("checked").html(C.checked)}function s(){k.addClass("hide"),w.removeClass("hide")}function a(){w.addClass("hide"),k.removeClass("hide"),S.children("span").removeClass("hover")}function l(e,t){var i,n=window.queryString();n[e]=t,delete n.page,i="?"+decodeURIComponent(v.param(n)),window.location.href=i}function o(){$.children(".senior-sub:eq("+p+")").addClass("hide"),z.children(".attr:eq("+p+")").removeClass("hover"),p=-1}var r,d,c,h,u,f,m,p,v=i(1),g=i(3),C={unchecked:"&#xe612;",checked:"&#xe613;"},b={up:"&#xe607;",down:"&#xe60b;"},k=v(".brand .default"),x=v("#brand-search-input"),w=v(".brand .brand-panel"),y=w.find(".attr"),I=v("#brand-more"),_=v("#brand-multi"),S=v(".brands-index"),T=v(".ud-price-range"),q=/^\d+$/,M=v(".sort-sub-wrap"),$=v(".senior-sub-wrap"),z=v(".senior-attr-wrap"),L='{{# size}}<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>{{/ size}}',j={},D=v(".filter-box .size");L=g.compile(L),v(".filter-box").on("selectstart",".attr, .brands-index span",function(){return!1}),v(".sort-pre").on("click","li",function(){var e=v(this),t=e.index(),i=e.data("id");return e.hasClass("active")?(e.removeClass("active"),M.children(":eq("+t+")").addClass("hide"),void D.addClass("hide")):(e.siblings(".active").removeClass("active"),e.addClass("active"),M.children(":not(.hide)").addClass("hide"),M.children(":eq("+t+")").removeClass("hide"),void(D.data("load")||(j[i]?(D.find(".attr-content").html(j[i]),D.removeClass("hide")):v.ajax({url:"/product/search/sortSize",data:{msort:i}}).then(function(e){"array"===v.type(e)&&e.length?(j[i]=L({size:e}),D.find(".attr-content").html(j[i]),D.removeClass("hide")):D.addClass("hide")}))))}),I.length>0&&(r=I.children("em"),d=I.children(".iconfont")),_.click(function(){"none"===w.css("display")&&I.trigger("click"),s(),w.removeClass("hide").addClass("multi"),v(this).addClass("hide"),I.addClass("hide")}),I.click(function(){var e=v(this);e.hasClass("more")?(a(),r.text("更多"),d.html(b.down),x.val("").trigger("keyup")):(s(),r.text("收起"),d.html(b.up)),v(this).toggleClass("more")}),S.on("mouseenter","span",function(){var e=v(this),t=e.data("index");e.hasClass("hover")||setTimeout(function(){e.siblings("span.hover").removeClass("hover"),e.addClass("hover"),0===e.index()?y.removeClass("hide"):y.addClass("hide").filter("[data-index="+t+"]").removeClass("hide")},120)}),x.keyup(function(){var e=v(this).val().toLowerCase();""===e?y.removeClass("hide"):y.addClass("hide").filter('[data-key*="'+e+'"]').removeClass("hide")}),v("#brand-multi-ok").click(function(){var e=[];v(this).hasClass("dis")||(w.find("span.checked").each(function(){e.push(v(this).data("id"))}),l("brand",e.join(",")))}),v(".multi-select-cancel").click(function(){var e=v(this).closest(".multi");e.hasClass("brand-panel")&&(_.removeClass("hide"),I.trigger("click"),I.removeClass("hide"),x.val("").trigger("keyup"),a()),e.addClass("hide").removeClass("multi"),n(e.find(".checkbox.checked"),e.find(".attr.checked")),v(this).siblings(".multi-select-ok").addClass("dis")}),v(".check-container").on("click",".attr",function(){var e=v(this),t=e.find(".checkbox"),i=e.closest(".brand-panel, .senior-sub").find(".multi-select-ok");t.toggleClass("checked"),t.hasClass("checked")?t.html(C.checked):t.html(C.unchecked),t.hasClass("checked")||e.siblings(".attr").find(".checked").length>0?i.removeClass("dis"):i.addClass("dis")}),v(".brand, .senior").on("click",".attr > a",function(e){v(this).closest(".multi").length>0&&e.preventDefault()}),v(".filter-box").on("click","li.checked, a.checked",function(e){e.preventDefault()}),T.length>0&&(c=T.find(".limit"),h=c.filter(".min"),u=c.filter(".max"),f=T.find(".price-sure"),c.keyup(function(){var e,t,i,n=v.trim(v(this).val()),s=q.test(n);s||(e=parseInt(n,10),v(this).val(isNaN(e)?"":e)),t=v.trim(h.val()),i=v.trim(u.val()),""!==t||""!==i?f.removeClass("hide"):f.addClass("hide")}),f.click(function(){var e,t=v.trim(h.val()),i=v.trim(u.val());""!==t&&""!==i&&+t>+i&&(e=i,i=t,t=e),l("price",t+","+i)})),z.on("mouseenter",".attr",function(){var e=v(this),t=e.index();e.hasClass("no-sub")||(e.addClass("hover").siblings().removeClass("hover"),$.children(".senior-sub:eq("+t+")").removeClass("hide").siblings().addClass("hide"))}).on("mouseleave",".attr",function(){var e=v(this),t=e.index();e.hasClass("no-sub")||(p=t,m=setTimeout(function(){o()},100))}),v(".senior-sub").on("click",".multi-select",function(){v(this).closest(".senior-sub").addClass("multi")}).on("click",".multi-select-ok",function(){var e=v(this),t=e.closest(".senior-sub"),i=[];e.hasClass("dis")||(t.find("span.checked").each(function(){i.push(v(this).data("id"))}),l(t.data("attr"),i.join(",")))}).on("mouseenter",function(){clearTimeout(m)}).on("mouseleave",function(){o()})},function(e,t,i){var n=i(1),s=n("#count-per-page"),a=s.next("ul"),l=200;n(document).click(function(e){n(e.target).closest(".page-count").length>0||a&&a.slideUp(l)}),s.click(function(){"none"===a.css("display")?a.slideDown(l):a.slideUp(l)})},,,function(e,t,i){function n(){this.handlers={}}var s=i(1);n.prototype={constructor:n,addHandler:function(e,t){"undefined"==typeof this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e){var t,i;if(e.target||(e.target=this),this.handlers[e.type]instanceof Array)for(t=this.handlers[e.type],i=0;i<t.length;i++)t[i](e)},removeHandler:function(e,t){var i,n;if(this.handlers[e]instanceof Array){for(i=this.handlers[e],n=0;n<i.length&&i[n]!==t;n++);i.splice(n,1)}}},e.exports=function(e,t){function i(e){var i,n=0,h=0,u=t,f=0,m="",p=0,v=0;switch(e.type){case"mouseenter":i=s(this),a=setTimeout(function(){l=!0,m=i.clone(),f=i.index()+1,n=f%u===0?u:f%u,h=Math.ceil(f/u),p=i.offset().left,v=c-(p+r),o.fire({type:"MouseEnter",target:i,targetWidth:r,targetHeight:d,targetX:n,targetY:h,rowWidth:u,activeIndex:f,targetDuplicate:m,offsetL:p,offsetR:v})},150);break;case"mouseleave":l||(a&&clearTimeout(a),o.fire({type:"MouseLeave"})),l=!1}}var a,l,o=new n,r=e.eq(0).width(),d=e.eq(0).height(),c=s(window).width();return e.bind({mouseenter:i,mouseleave:i}),o}},function(e,t,i){var n,s=i(1),a=i(2),l=i(3),o=i(10),r=s(".goods-container"),d=r.find(".good-info"),c=r.find(".good-item-wrapper"),h=r.find(".good-info-main"),u=r.find(".good-select-color"),f=s(".product-list-nav");a(s("img.lazy")),t.init=function(e){function t(e,t){var i,n,s,a="",l=e.length,o=4,r=Math.ceil(l/o),d=0;for(i=0;r>i;i++)for(a+="<ul>",n=0;o>n&&(s=i*o+n,s!==l);n++)a+='<li><a target="_blank" href="'+e[i*o+n].url+t+'"><img src="'+e[i*o+n].src+'" data-cover="'+e[i*o+n].coverImg+'" /></a></li>',n===o-1&&(a+="</ul>",d++);return r>d&&(a+="</ul>"),{colorListStr:a,ulNum:r}}function i(){h.html(""),u.html(""),c.css({display:"none"})}n=null,d.unbind(),n=o(d,e),n.addHandler("MouseEnter",function(e){var n,a,l,o,d,f,m,p,v,g,C,b,k=10,x=35,w=e.target.attr("data-from")||"";l=[],e.target.find(".hideList > li").each(function(){a=s(this).data(),a.coverImg=a.src,l.push(a)}),n=t(l,w),i(),d=n.colorListStr,o=n.ulNum,h.append(e.targetDuplicate),u.append(s(d)),g=c.css("paddingLeft"),C=c.css("paddingTop"),b=r.css("paddingTop"),f=10+65*o+e.targetWidth,p=(e.targetX-1)*(e.targetWidth+k)-(parseInt(g,10)+1),v=(e.targetY-1)*(e.targetHeight+x)+parseInt(b,10)-(parseInt(C,10)+1),m=e.offsetR-(65*o+25),0>=m&&(p=p+m-25),c.css({width:f,left:p,top:v,display:"inline-block"}),l[0]&&l[0].src&&h.find(".good-thumb img").attr("src",l[0].src)}),n.addHandler("MouseLeave",function(){i()}),c.mouseleave(function(){i()})},s(document).on("mouseenter",".good-select-color li",function(){var e=s(this).find("img").attr("data-cover"),t=s(this).closest(".good-item-wrapper").find(".good-detail-img img");t.attr("src",e)}),f.find("h3").click(function(){var e=s(this).closest(".product-list-nav");e.hasClass("active")?e.find(".sort-child-list").stop(!0,!0).slideUp():e.find(".sort-child-list").stop(!0,!0).slideDown(),e.toggleClass("active")}),function(){var e,t=s("#brand-card"),i=s("#brand-favor");t.length&&s.ajax({type:"POST",url:"/product/index/getNodeContent",data:{node:t.data("node")}}).then(function(e){t.html(e)}),i.length&&(e=s("#pic-link-tpl").html(),s.ajax({type:"POST",url:"/product/index/getAdnav",data:{brandId:i.data("id")}}).then(function(t){t&&s("#brand-ad").html(l.compile(e)({picLink:t}))}))}()},,,,,,,,,function(e,t,i){var n=i(11);i(6),i(7),n.init(4)}]);
\ No newline at end of file
... ...
... ... @@ -10,8 +10,7 @@ var $ = require('yoho-jquery'),
var $limitList = $('.limit-main .good-list'),
$limitBrand = $('.limit-main .brand-list'),
$fixNav = $('.sort-layer .full-line'),
$navPar,
homePage = $('.outlets-page').data('page');
$navPar;
var limitTime = [];
... ... @@ -181,19 +180,14 @@ $('.page-btns > label').click(function() {
page = page % max;
limitPageSwitch($dom, page);
$(window).trigger('scroll');
});
setInterval(setPageTime, 1000);
if (homePage) {
$('.slide-container').slider({
orient: false
});
} else {
$('.slide-container').slider({
orient: true
});
}
$('.slide-container').slider({
orient: true
});
extraInfo();
... ...
... ... @@ -58,36 +58,8 @@
.slide-switch {
display: block;
a {
position: absolute;
top: 50%;
margin: -30px 0 0;
width: 60px;
height: 60px;
line-height: 56px;
text-align: center;
z-index: 2;
background: #fff;
opacity: 0.55;
&.prev {
left: 50%;
margin-left: -575px;
}
&.next {
right: 50%;
margin-right: -575px;
}
&:hover {
opacity: 0.9;
}
.iconfont {
font-size: 32px;
color: #59585a;
}
.next {
right: 290px;
}
}
... ...
... ... @@ -112,7 +112,7 @@
}
.brand-list {
width: 300%;
width: 1135px;
max-height: 273px;
overflow: hidden;
... ...