Authored by baoss

注掉多余代码 review by guoshuai

... ... @@ -34,7 +34,7 @@ module.exports = class extends global.yoho.BaseModel {
this.searchApi = new SearchApi(ctx);
this.getGoodsFloor = {
最新上架: 'newArrivls',
新增导航: 'newFloor'
// 新增导航: 'newFloor'
};
this.floorMap = {
slide: this._getSlideData.bind(this),
... ... @@ -46,7 +46,7 @@ module.exports = class extends global.yoho.BaseModel {
ACCESSORIES: this._getSingleHotFloorData.bind(this),
优选品牌: this._getPreBrandTopData.bind(this),
最新上架: this._getGoodsFloorData.bind(this),
新增导航: this._getGoodsFloorData.bind(this),
// 新增导航: this._getGoodsFloorData.bind(this),
ad: this._getadbannerData.bind(this),
category: this._getCategoryFloorData.bind(this),
accordion: this._getAccordionFloorData.bind(this),
... ...
... ... @@ -87,9 +87,9 @@
{{> commodity}}
{{/ newArrivls}}
{{! 新分类楼层}}
{{# newFloor}}
{{!-- {{# newFloor}}
{{> new-category}}
{{/ newFloor}}
{{/ newFloor}} --}}
{{! 七个类别列表}}
{{# sevenCategory}}
{{> seven-product}}
... ...
... ... @@ -51,7 +51,7 @@ const getMenuData = () => (
* @param {String} type 频道类型
* @return {array} 导航数组
*/
const getNavBar = (data, type) => {
const getNavBar = (data) => {
// 统一默认为boys
let navBars = [];
... ... @@ -147,7 +147,7 @@ const getThirdNav = (data) => {
* @param {String} type 频道类型
* @return {array} 子菜单数组
*/
const getSubNavGroup = (data, type) => {
const getSubNavGroup = (data) => {
let subNavGroup = [];
_.forEach(data, it => {
... ... @@ -169,13 +169,14 @@ const getSubNavGroup = (data, type) => {
subNav.push(obj);
});
let lowEn = _.camelCase(it.sort_name_en).toLowerCase();
// let lowEn = _.camelCase(it.sort_name_en).toLowerCase();
subNavGroup.push({
// subType: lowEn,
subType: 'boys',
subNav: subNav,
active: true
// active: lowEn === type
});
});
... ...
... ... @@ -42,7 +42,7 @@ var logoAngle = 0,
loopTime = 500,
reg = /^[\^\!\+\-\(\)\:\[\]\\\{\}\~\*\?\|\&\;\/]{0,}$/g;
var dataLayer = [];
// var dataLayer = [];
var cartTimer;
... ... @@ -127,19 +127,19 @@ handlebars.registerHelper('gt', function(v1, v2, options) {
}
});
function getSource(column, postition, event) {
dataLayer.push({
louceng: column,
weizhi: postition,
event: event
});
}
// function getSource(column, postition, event) {
// dataLayer.push({
// louceng: column,
// weizhi: postition,
// event: event
// });
// }
function closeCover() {
var $cover = $('#cover');
// function closeCover() {
// var $cover = $('#cover');
$cover.remove();
}
// $cover.remove();
// }
// 设置头部banner
function setTopBanner(data) {
... ... @@ -816,100 +816,100 @@ $subNav.on({
* 首次进入有弹窗
* @return {[type]} [description]
*/
function actionCover() {
var gender = window.cookie('_Gender');
var newMask = '';
var windowheight = '';
var selfheight = '';
var containertop;
var length = '';
if (window.location.href === document.location.protocol + '//www.yohobuy.com/' &&
(typeof gender === 'undefined' || gender === '' || gender === null)) {
$.get('/guide', function(data) {
newMask = document.createElement('div');
newMask.id = 'cover';
newMask.innerHTML = data;
document.body.appendChild(newMask);
windowheight = $(window).height();
selfheight = $('.guide-box').height();
containertop = windowheight / 2 - selfheight / 2;
length = $('.guide-box .clear').find('li').length;
$('.guide-box').css({
width: (200 * length) + 'px',
top: containertop + 'px'
});
$('#cover').bind('click', function() {
window.setCookie('_Gender', '1,3', {
path: '/',
domain: '.yohobuy.com',
expires: 90
});
window.setCookie('_Channel', 'boys', {
path: '/',
domain: '.yohobuy.com',
expires: 7
});
closeCover();
});
$('#cover .guide-box .close').bind('click', function() {
getSource('弹窗', 'CLOSE', 'homepage_man');
window.setCookie('_Gender', '1,3', {
path: '/',
domain: '.yohobuy.com',
expires: 90
});
window.setCookie('_Channel', 'boys', {
path: '/',
domain: '.yohobuy.com',
expires: 7
});
closeCover();
});
$('.boys img , .boys .go').bind('click', function() {
getSource('弹窗', 'BOYS', 'homepage_man');
window.setCookie('_Gender', '1,3', {
path: '/',
domain: '.yohobuy.com',
expires: 90
});
window.setCookie('_Channel', 'boys', {
path: '/',
domain: '.yohobuy.com',
expires: 7
});
closeCover();
});
$('.girls img, .girls .go').bind('click', function() {
getSource('弹窗', 'GIRLS', 'homepage_woman');
window.setCookie('_Gender', '2,3', {
path: '/',
domain: '.yohobuy.com',
expires: 90
});
window.setCookie('_Channel', 'girls', {
path: '/',
domain: '.yohobuy.com',
expires: 7
});
});
$('.lifestyle img, .lifestyle .go').bind('click', function() {
window.setCookie('_Channel', 'lifestyle', {
path: '/',
domain: '.yohobuy.com',
expires: 7
});
getSource('弹窗', 'LIEFSTYLE', 'homepage_lifestyle');
});
$('#cover .guide-box').bind('click', function(event) {
event.stopPropagation();
});
});
$('#cover .guide-box').bind('click', function(e) {
e.stopPropagation();
});
}
}
// function actionCover() {
// var gender = window.cookie('_Gender');
// var newMask = '';
// var windowheight = '';
// var selfheight = '';
// var containertop;
// var length = '';
// if (window.location.href === document.location.protocol + '//www.yohobuy.com/' &&
// (typeof gender === 'undefined' || gender === '' || gender === null)) {
// $.get('/guide', function(data) {
// newMask = document.createElement('div');
// newMask.id = 'cover';
// newMask.innerHTML = data;
// document.body.appendChild(newMask);
// windowheight = $(window).height();
// selfheight = $('.guide-box').height();
// containertop = windowheight / 2 - selfheight / 2;
// length = $('.guide-box .clear').find('li').length;
// $('.guide-box').css({
// width: (200 * length) + 'px',
// top: containertop + 'px'
// });
// $('#cover').bind('click', function() {
// window.setCookie('_Gender', '1,3', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 90
// });
// window.setCookie('_Channel', 'boys', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 7
// });
// closeCover();
// });
// $('#cover .guide-box .close').bind('click', function() {
// getSource('弹窗', 'CLOSE', 'homepage_man');
// window.setCookie('_Gender', '1,3', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 90
// });
// window.setCookie('_Channel', 'boys', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 7
// });
// closeCover();
// });
// $('.boys img , .boys .go').bind('click', function() {
// getSource('弹窗', 'BOYS', 'homepage_man');
// window.setCookie('_Gender', '1,3', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 90
// });
// window.setCookie('_Channel', 'boys', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 7
// });
// closeCover();
// });
// $('.girls img, .girls .go').bind('click', function() {
// getSource('弹窗', 'GIRLS', 'homepage_woman');
// window.setCookie('_Gender', '2,3', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 90
// });
// window.setCookie('_Channel', 'girls', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 7
// });
// });
// $('.lifestyle img, .lifestyle .go').bind('click', function() {
// window.setCookie('_Channel', 'lifestyle', {
// path: '/',
// domain: '.yohobuy.com',
// expires: 7
// });
// getSource('弹窗', 'LIEFSTYLE', 'homepage_lifestyle');
// });
// $('#cover .guide-box').bind('click', function(event) {
// event.stopPropagation();
// });
// });
// $('#cover .guide-box').bind('click', function(e) {
// e.stopPropagation();
// });
// }
// }
window.submitSearch = submitSearch;
... ...