Authored by weiqingting

修改控制器 模块顺序可以变化

@@ -4,6 +4,47 @@ @@ -4,6 +4,47 @@
4 4
5 ### 商品 5 ### 商品
6 6
  7 +## 男首
  8 +
  9 + {
  10 + boy: [
  11 + //banner大图
  12 + bigSlide: [
  13 + {
  14 + 'href': '',
  15 + 'img': ''
  16 + },
  17 + ...
  18 + ],
  19 + //banner小图
  20 + smallSlide: [
  21 + {
  22 + 'href': '',
  23 + 'img': ''
  24 + },
  25 + ...
  26 + ],
  27 + //最新速报
  28 + newReport: {
  29 + name: '最新速报 NEW!', //楼层标题
  30 + list: [
  31 + {
  32 + 'href': '',
  33 + 'img': ''
  34 + },
  35 + ]
  36 + },
  37 + //优选品牌
  38 + preferenceBrand: {
  39 + name: '优选品牌 BRAND', //楼层标题
  40 + imgBrand: [
  41 + {
  42 +
  43 + }
  44 + ]
  45 + }
  46 + ]
  47 + }
7 48
8 ## 搜索页 49 ## 搜索页
9 50
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="home-page yoho-page"> 2 <div class="home-page yoho-page">
3 {{# boy}} 3 {{# boy}}
  4 +
  5 + {{! 头部banner}}
  6 + {{# slide}}
4 <div class="slide-container"> 7 <div class="slide-container">
5 - {{#if bigSlide}}  
6 <div class="big-slide"> 8 <div class="big-slide">
7 <ul> 9 <ul>
8 {{# bigSlide}} 10 {{# bigSlide}}
@@ -22,7 +24,6 @@ @@ -22,7 +24,6 @@
22 </a> 24 </a>
23 </div> 25 </div>
24 </div> 26 </div>
25 - {{/if}}  
26 27
27 {{#if smallSlide}} 28 {{#if smallSlide}}
28 <div class="small-slide"> 29 <div class="small-slide">
@@ -37,6 +38,9 @@ @@ -37,6 +38,9 @@
37 </div> 38 </div>
38 {{/if}} 39 {{/if}}
39 </div> 40 </div>
  41 + {{/ slide}}
  42 +
  43 + {{! 新品速报}}
40 {{# newReport}} 44 {{# newReport}}
41 <div class="new-report clearfix"> 45 <div class="new-report clearfix">
42 {{> index/floor_header}} 46 {{> index/floor_header}}
@@ -46,7 +50,7 @@ @@ -46,7 +50,7 @@
46 {{#unless @last}} 50 {{#unless @last}}
47 <li> 51 <li>
48 <a href="{{href}}"> 52 <a href="{{href}}">
49 - <img src="{{img}}" alt=""> 53 + <img class="lazy" data-original="{{img}}" alt="">
50 </a> 54 </a>
51 </li> 55 </li>
52 {{/unless}} 56 {{/unless}}
@@ -57,13 +61,15 @@ @@ -57,13 +61,15 @@
57 {{#if @last}} 61 {{#if @last}}
58 <div class="last-item"> 62 <div class="last-item">
59 <a href="{{href}}"> 63 <a href="{{href}}">
60 - <img src="{{img}}" alt=""> 64 + <img class="lazy" data-original="{{img}}" alt="">
61 </a> 65 </a>
62 </div> 66 </div>
63 {{/if}} 67 {{/if}}
64 {{/ list}} 68 {{/ list}}
65 </div> 69 </div>
66 {{/ newReport}} 70 {{/ newReport}}
  71 +
  72 + {{! 优选品牌}}
67 {{# preferenceBrand}} 73 {{# preferenceBrand}}
68 <div class="preference-brand"> 74 <div class="preference-brand">
69 {{> index/floor_header}} 75 {{> index/floor_header}}
1 -<div class="footer-page yoho-page"> 1 +<div class="yoho-footer">
2 <div class="footertop"> 2 <div class="footertop">
3 <div class="index-foot"> 3 <div class="index-foot">
4 <dl class="clearfix screen"> 4 <dl class="clearfix screen">
1 {{#headerdata}} 1 {{#headerdata}}
2 -<div class="header-page yoho-page"> 2 +<div class="yoho-header">
3 <div class="header-topwrapper clearfix"> 3 <div class="header-topwrapper clearfix">
4 <div class="header-top"> 4 <div class="header-top">
5 <div class="leftpart float-left"> 5 <div class="leftpart float-left">
1 <script> 1 <script>
2 seajs.use('js/common'); 2 seajs.use('js/common');
3 - seajs.use('js/header'); 3 + seajs.use('js/header',function(header) {
  4 + if(header) {
  5 + header.init();
  6 + }
  7 + });
4 </script> 8 </script>
5 9
6 {{!-- 首页 --}} 10 {{!-- 首页 --}}
@@ -5,14 +5,506 @@ @@ -5,14 +5,506 @@
5 */ 5 */
6 6
7 var $ = require('jquery'); 7 var $ = require('jquery');
  8 +
  9 +
  10 +var noticeSuccess = false;
  11 +
  12 +function JsonPCallBack(data) {
  13 + var topbanner;
  14 +
  15 + if (+data.code === 200) {
  16 + if (typeof data.data === 'object') {
  17 + topbanner = '<a target="_blank" href="' + data.data.url + '" class="page-top-banner"' +
  18 + 'style="height:50px;border:none;background-image:url(' + window.unescape(data.data.src) + ');' +
  19 + 'background-position: center;display:block;background-color:#ff5409;">&nbsp;</a>';
  20 + $('body').prepend(topbanner);
  21 + }
  22 + }
  23 +}
  24 +
  25 +function NoticeCallBack(data) {
  26 + if (+data.code === 200) {
  27 + noticeSuccess = true;
  28 + }
  29 +}
  30 +window.JsonPCallBack = JsonPCallBack;
  31 +
  32 +window.NoticeCallBack = NoticeCallBack;
  33 +/**
  34 + * 检测是否获得公告
  35 + * @return {[type]} [description]
  36 + */
  37 +function checkNotice() {
  38 + var noticeinner;
  39 +
  40 + if (!noticeSuccess) {
  41 + noticeinner = '<div class="noticewrapper">' +
  42 + '<div class="noticecontainer">' +
  43 + '<h1 class="noticetitle">关于系统升级的公告</h1>' +
  44 + '<div class="noticecontent">' +
  45 + '<p class="tips">尊敬的顾客:</p>' +
  46 + '<p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p>' +
  47 + '<p class="detail">' +
  48 + '系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常' +
  49 + '</p>' +
  50 + '<p class="detail">使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p>' +
  51 + '</div>' +
  52 + '</div>' +
  53 + '</div>';
  54 + $('.header-topwrapper').append(noticeinner);
  55 + }
  56 +}
  57 +/**
  58 + * 获得banner数据
  59 + * @param {[string]} code [banner对应的编码]
  60 + * @return {[type]} [description]
  61 + */
  62 +function getBannerData(code) {
  63 + var script = document.createElement('script');
  64 +
  65 + script.src = 'http://new.yohobuy.com/resource/getbanner?content_code=' +
  66 + code + '&client_type=web&callback=JsonPCallBack';
  67 + document.getElementsByTagName('head')[0].appendChild(script);
  68 +}
  69 +/**
  70 + * 获取公告的jsonp请求
  71 + * @param {[type]} code [description]
  72 + * @return {[type]} [description]
  73 + */
  74 +function getNoticeData(code) {
  75 + var script = document.createElement('script');
  76 +
  77 + script.src = 'http://new.yohobuy.com/resource/getbanner?content_code=' +
  78 + code + '&client_type=web&callback=NoticeCallBack';
  79 + document.getElementsByTagName('head')[0].appendChild(script);
  80 + window.setTimeout(checkNotice, 5000); //5s后检测是否成功
  81 +}
  82 +/**
  83 + * 显示和隐藏
  84 + * @param {[type]} sourceClass [description]
  85 + * @param {[type]} targetClass [description]
  86 + * @return {[type]} [description]
  87 + */
  88 +function toggleDisplay(sourceClass, targetClass) {
  89 + var $that,
  90 + targetobj;
  91 +
  92 + $(sourceClass).hover(function(e) {
  93 + e.preventDefault();
  94 + $that = $(this);
  95 + targetobj = $(targetClass)[0];
  96 + if (targetobj.style.display === '') {
  97 + $that.addClass('acttags');
  98 + targetobj.style.display = 'block';
  99 + } else {
  100 + $that.removeClass('acttags');
  101 + targetobj.style.display = '';
  102 + }
  103 + });
  104 +}
  105 +
  106 +/**
  107 + * 执行顶部显示和隐藏
  108 + * @return {[type]} [description]
  109 + */
  110 +function actionTopTagToggle() {
  111 + var tags = [{
  112 + sourceClass: '.myyoho',
  113 + targetClass: '.myyoho-info'
  114 + }, {
  115 + sourceClass: '.phone',
  116 + targetClass: '.qr'
  117 + }],
  118 + obj,
  119 + i;
  120 +
  121 + for (i = 0; i < tags.length; i++) {
  122 + obj = tags[i];
  123 + toggleDisplay(obj.sourceClass, obj.targetClass);
  124 + }
  125 +}
  126 +/**
  127 + * 执行顶部群组鼠标交互
  128 + * @return {[type]} [description]
  129 + */
  130 +function actionYoHoGroup() {
  131 + var $this;
  132 +
  133 + $('.yohogroup').mouseenter(function() {
  134 + $this = $(this);
  135 + $this.text($this.attr('cn'));
  136 + });
  137 + $('.yohogroup').mouseleave(function() {
  138 + $this = $(this);
  139 + $this.text($this.attr('en'));
  140 + });
  141 +}
  142 +
  143 +/**
  144 + * 检测是否支持css3的动画
  145 + * @return {Boolean} [description]
  146 + */
  147 +function isSupportCss3Animation() {
  148 + var thisFunc,
  149 + prefixList = ['webkit', 'moz', 'ms'],
  150 + i;
  151 +
  152 + for (i = 0; i < prefixList.length; i++) {
  153 + thisFunc = prefixList[i] + 'RequestAnimationFrame';
  154 + if (window[thisFunc]) {
  155 + return true;
  156 + } else {
  157 + return false;
  158 + }
  159 + }
  160 +
  161 +}
  162 +/**
  163 + * css3动画
  164 + * @param {Array} ) { var thisFunc, prefixList [description]
  165 + * @return {[type]} [description]
  166 + */
  167 +function requestFrameCloser() {
  168 + var prefixList = ['webkit', 'moz', 'ms'];
  169 + var func1 = prefixList[0] + 'RequestAnimationFrame';
  170 + var func2 = prefixList[1] + 'RequestAnimationFrame';
  171 + var func3 = prefixList[2] + 'RequestAnimationFrame';
  172 +
  173 + if (window[func1]) {
  174 + return function(callback) {
  175 + window[func1](callback);
  176 + };
  177 + }
  178 + if (window[func2]) {
  179 + return function(callback) {
  180 + window[func2](callback);
  181 + };
  182 + }
  183 + if (window[func3]) {
  184 + return function(callback) {
  185 + window[func3](callback);
  186 + };
  187 + }
  188 + return function(callback) {
  189 + window.setTimeout(callback, 67);
  190 + };
  191 +}
  192 +
  193 +
  194 +window.requestFrame = requestFrameCloser();
  195 +window.start = 0;
  196 +window.$logotrans = $('.icon-logo');
  197 +window.isen = true;
  198 +
  199 +/**
  200 + * css3动画
  201 + * @return {[type]} [description]
  202 + */
  203 +
  204 +function tsAnimate() {
  205 + window.start += 10;
  206 + window.$logotrans.css({
  207 + transform: 'rotateX(' + window.start + 'deg)',
  208 + '-webkit-transform': 'rotateX(' + window.start + 'deg)',
  209 + '-moz-transform': 'rotateX(' + window.start + 'deg)'
  210 + });
  211 + if (window.start / 90 % 2 === 1) {
  212 + if (window.isen) {
  213 + window.$logotrans.css('background-image', 'url(http://static.yohobuy.com/newheader/img/logo1.png)');
  214 + window.isen = false;
  215 + } else {
  216 + window.$logotrans.css('background-image', 'url(http://static.yohobuy.com/newheader/img/logo_e.png)');
  217 + window.isen = true;
  218 + }
  219 + }
  220 + if (window.start / 90 % 2 === 0 && window.start % 360 !== 0) {
  221 + window.setTimeout(tsAnimate, 3000);
  222 + } else {
  223 + if (window.start % 360 === 0) {
  224 + window.setTimeout(tsAnimate, 1 * 60 * 1000);
  225 + } else {
  226 + window.requestFrame(function() {
  227 + tsAnimate();
  228 + });
  229 + }
  230 + }
  231 +}
  232 +
  233 +window.loopdurationtime = 500;
  234 +window.globaltimeout;
  235 +window.onetimeoout;
  236 +/**
  237 + * 淡出
  238 + * @return {[type]} [description]
  239 + */
  240 +function fadeAnimate() {
  241 + if (window.globaltimeout) {
  242 + window.clearTimeout(window.globaltimeout);
  243 + }
  244 + window.logotrans.fadeOut(window.loopdurationtime, function() {
  245 + window.isen = false;
  246 + window.logotrans.css('background-image', 'url(http://static.yohobuy.com/newheader/img/logo.png)');
  247 + window.logotrans.fadeIn(window.loopdurationtime, function() {
  248 + window.onetimeoout = window.setTimeout(function() {
  249 + window.logotrans.fadeOut(window.loopdurationtime, function() {
  250 + window.clearTimeout(window.onetimeoout);
  251 + window.isen = true;
  252 + window.logotrans.css('background-image', 'url(http://static.yohobuy.com/newheader/img/logo_e.png)');
  253 + window.logotrans.fadeIn(window.loopdurationtime, function() {
  254 + window.globaltimeout = window.setTimeout(fadeAnimate, 1 * 60 * 1000);
  255 + });
  256 + });
  257 + }, 3000);
  258 + });
  259 + });
  260 +}
  261 +/**
  262 + * 执行头部logo动画
  263 + * @return {[type]} [description]
  264 + */
  265 +function actionTopLogoAnimate() {
  266 + if (isSupportCss3Animation()) {
  267 + window.setTimeout(tsAnimate, 3000);
  268 + } else {
  269 + window.setTimeout(fadeAnimate, 3000);
  270 + }
  271 +}
8 /** 272 /**
9 - * 回到顶部  
10 - * @type {[type]} 273 + * 查询跳转后保留关键字
  274 + * @return {[type]} [description]
11 */ 275 */
12 -var $returnTop = $('.return-top'); 276 +function actionAddKeyWords() {
  277 + var $keywords = $('#nav_keyword').text();
  278 + var defaultsearch = 'vans';
  279 + var $querykey = $('#query_key');
13 280
14 -$returnTop.click(function() {  
15 - $('html,body').animate({  
16 - scrollTop: 0  
17 - }, 500);  
18 -});  
  281 + if ($keywords !== '') {
  282 + $querykey.css({
  283 + color: '#000'
  284 + });
  285 + $querykey.val($keywords);
  286 + } else {
  287 + $querykey.css({
  288 + color: '#e0e0e0'
  289 + });
  290 + $querykey.val(defaultsearch);
  291 + $querykey.on('focus', function(e) {
  292 + $querykey.css({
  293 + color: '#000'
  294 + });
  295 + $querykey.val('');
  296 + });
  297 + }
  298 +}
  299 +window.dataLayer = [];
  300 +
  301 +function getSource(column, postition, event) {
  302 + try {
  303 + window.dataLayer.push({
  304 + louceng: column,
  305 + weizhi: postition,
  306 + event: event
  307 + });
  308 + } catch (e) {}
  309 +}
  310 +/**
  311 + * 搜寻的时候过滤非法字符(+-/:等非法字符单独出现)
  312 + * @type {RegExp}
  313 + */
  314 +window.reg = /^[\^\!\+\-\(\)\:\[\]\\\{\}\~\*\?\|\&\;\/\s]{0,}$/g;
  315 +window.keyword = '';
  316 +window.link = '';
  317 +
  318 +window.submitSearch = function() {
  319 + var $keywordinput = $('#query_key').val();
  320 + var column = 'Search';
  321 + var postition = 'Head Search';
  322 + var event = 'Search';
  323 + var $formatkeyword,
  324 + $formatkeywordinput;
  325 +
  326 + $formatkeyword = $.trim(window.keyword.toLowerCase());
  327 + $formatkeywordinput = $.trim($keywordinput.toLowerCase());
  328 + getSource(column, postition, event);
  329 + if (window.link !== '' && window.keyword !== '' && $formatkeyword === $formatkeywordinput) {
  330 + location.href = window.link.replace('\'', '');
  331 + } else {
  332 + if (window.reg.test($keywordinput)) {
  333 + location.href = 'http://search.yohobuy.com/error?query=' + $keywordinput + '&result=error';
  334 + } else {
  335 + $('#searchForm').submit();
  336 + return false;
  337 + }
  338 + }
  339 +};
  340 +/**
  341 + * banner和地址的映射
  342 + * @type {Object}
  343 + */
  344 +window.bannerMap = {
  345 + listboys: '4f78b0f418fc42314d8b6e791cfb7fa8',
  346 + listgirls: '00c1f025a51b6b597dc37925951ea27d',
  347 + listkids: 'b02df11184727701ade1b6de9737d08c',
  348 + listlifestyle: 'fd35c52dced0c880976ba858346d1fc5',
  349 + searchboys: '9fb8986ea700cc27a8057361c3924394',
  350 + searchgirls: 'e3e207a1443ca60c8037fe52a5560c18',
  351 + searchkids: '620fc77f479da8feaeb06f2324e5d0bb',
  352 + searchlifestyle: 'a3c93301c6ffaf3ed0f36a4a451be36d',
  353 + uniquebrandboys: '2ebb0810c0d1a67e5229149c9c3aba7d',
  354 + uniquebrandgirls: '99e23385f4ba4b65f406b7e2968ac821',
  355 + uniquebrandkids: 'a74ebc9b17840c91b9ea46568111fe6b',
  356 + uniquebrandlifestyle: '0e8c81ead53f56302baa4d0ad967f527',
  357 + brandsboys: '77b352db07129c76a9d532acad149f9f',
  358 + brandsgirls: 'bf047f16e52ebc38be5ce9c7623831e6',
  359 + brandskids: 'e3ae1ce9b5e13c6d271ef3eccb831652',
  360 + brandslifestyle: 'e4ac8029c30f65d7f1af030980d140fe',
  361 + newboys: '869d3c5f3b450fb52101d00a61ce87cb',
  362 + newgirls: 'd953b6dfdac02483d1dcce8d96055954',
  363 + newkids: '0874cb6d75df8e0e78f2d475e53ecc08',
  364 + newlifestyle: '43e8fc8e178115c262bbce2bd0012db7',
  365 + saleboys: 'c846e3165c994769b4201d8c32f3ae9b',
  366 + salegirls: '52b1d389edcbc62d65de71b80c4d6ad0',
  367 + salekids: 'ad8b1703c761ba00973868ab5199cc27',
  368 + salelifestyle: '7acc64905c70ac91846f43fb2cec4bbd',
  369 + homeboys: 'b0856a771ef1b59ab1234c74688fa42d',
  370 + homegirls: '2bd61fa12e4933211518f70fe5ce3c48',
  371 + homekids: '895c59e8c64b40399c9533509507320c',
  372 + homelifestyle: '2e037d4e25d2767352ca3e0a4627f7bd',
  373 + indexboys: '0c911d3000f52e8ca7cffb74f5864c29',
  374 + indexgirls: 'b645b8980c423ab30485e0a9d08c2ef7',
  375 + indexkids: '17f6d5d5d454d2c507bc5fcbc90f7756',
  376 + indexlifestyle: '735cd393e841762af8793c346abbbc36'
  377 +};
  378 +/**
  379 + * cookie集合
  380 + * @type {Object}
  381 + */
  382 +window.cookieMap = {};
  383 +
  384 +function actionExeCookieMap() {
  385 + var cookies = document.cookie;
  386 + var cookiearr = cookies.split(';');
  387 + var i;
  388 + var temparr;
  389 + var key;
  390 +
  391 + for (i = 0; i < cookiearr.length; i++) {
  392 + temparr = cookiearr[i].split('=');
  393 + key = temparr[0].replace(/\s/g, '');
  394 + window.cookieMap[key] = temparr[1];
  395 + }
  396 +}
  397 +
  398 +
  399 +/**
  400 + * 获得banner & 异常通知
  401 + * @return {[type]} [description]
  402 + */
  403 +function actionGetBannerAndNotice() {
  404 + var INDEXKIDS = 'indexkids',
  405 + INDEXLIFESTYLE = 'indexlifestyle',
  406 + INDEXBOYS = 'indexboys',
  407 + INDEXWOMAN = 'indexgirls',
  408 + UNIQUEBRAND = 'uniquebrand';
  409 + var url = window.location.href;
  410 + var host = window.location.host;
  411 + var code = '';
  412 + var firstarea;
  413 +
  414 + if (url.indexOf('search') !== -1) {
  415 + code = window.bannerMap['search' + window.cookieMap._Channel];
  416 + }
  417 + if (url.indexOf('list') !== -1) {
  418 + code = window.bannerMap['list' + window.cookieMap._Channel];
  419 + }
  420 + if (url.indexOf('brands') !== -1) {
  421 + code = window.bannerMap['brands' + window.cookieMap._Channel];
  422 + }
  423 + if (url.indexOf('new') !== -1) {
  424 + code = window.bannerMap['new' + window.cookieMap._Channel];
  425 + }
  426 + if (url.indexOf('sale') !== -1) {
  427 + code = window.bannerMap['sale' + window.cookieMap._Channel];
  428 + }
  429 + if (url.indexOf('home') !== -1) {
  430 + code = window.bannerMap['home' + window.cookieMap._Channel];
  431 + }
  432 + if (url.indexOf('kids') !== -1) {
  433 + code = window.bannerMap[INDEXKIDS];
  434 + }
  435 + if (url.indexOf('woman') !== -1) {
  436 + code = window.bannerMap[INDEXWOMAN];
  437 + }
  438 + if (url.indexOf('lifestyle') !== -1) {
  439 + code = window.bannerMap[INDEXLIFESTYLE];
  440 + }
  441 + if (url.indexOf('www.yohobuy.com') !== -1 && window.location.pathname === '/') {
  442 + code = window.bannerMap[INDEXBOYS];
  443 + }
  444 + firstarea = host.split('.')[0];
  445 + if (firstarea !== 'list' && firstarea !== 'search' && firstarea !== 'www' &&
  446 + firstarea !== 'new' && firstarea !== 'item' && firstarea !== 'guang') {
  447 + code = window.bannerMap[UNIQUEBRAND + window.cookieMap._Channel];
  448 + }
  449 +
  450 + getBannerData(code); //获得banner信息
  451 + getNoticeData(code); //获得公告信息
  452 +
  453 +}
  454 +
  455 +function brandSwitch(index) {
  456 + $('.hot-brands').find('ul').stop().animate({
  457 + opacity: 0,
  458 + 'z-index': 1
  459 + }, 200).eq(index).animate({
  460 + opacity: 1,
  461 + 'z-index': 2
  462 + }, 200);
  463 +}
  464 +/**
  465 + * 品牌左右切换
  466 + * @return {[type]} [description]
  467 + */
  468 +function actionBrandChange() {
  469 + var activeIndex = 0,
  470 + swiperLen;
  471 +
  472 + if ($('.hot-brands').size() > 0) {
  473 + swiperLen = $('.hot-brands').find('ul').size();
  474 + $('.hot-brands').find('ul').eq(0).css({
  475 + opacity: 1,
  476 + 'z-index': 2
  477 + });
  478 + $('.brands-control').on('click', '.next', function() {
  479 + if (activeIndex === swiperLen - 1) {
  480 + activeIndex = 0;
  481 + } else {
  482 + activeIndex++;
  483 + }
  484 + brandSwitch(activeIndex);
  485 + });
  486 + $('.brands-control').on('click', '.prev', function() {
  487 + if (activeIndex === 0) {
  488 + activeIndex = swiperLen - 1;
  489 + } else {
  490 + activeIndex--;
  491 + }
  492 + brandSwitch(activeIndex);
  493 + });
  494 +
  495 +
  496 + }
  497 +}
  498 +/**
  499 + * 初始化函数
  500 + * @return {[type]} [description]
  501 + */
  502 +exports.init = function() {
  503 + actionExeCookieMap();
  504 + actionYoHoGroup();
  505 + actionTopTagToggle();
  506 + actionTopLogoAnimate();
  507 + actionGetBannerAndNotice();
  508 + actionBrandChange();
  509 + actionAddKeyWords();
  510 +};
@@ -5,13 +5,14 @@ @@ -5,13 +5,14 @@
5 */ 5 */
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 - Handlebars = require('yoho.handlebars'); 8 + Handlebars = require('yoho.handlebars'),
  9 + lazyload = require('yoho.lazyload');
9 10
10 require('../common/linkage-slider'); 11 require('../common/linkage-slider');
11 require('../common/slider2'); 12 require('../common/slider2');
12 require('../common/new-arrivls'); 13 require('../common/new-arrivls');
13 14
14 - 15 +lazyload($('img.lazy'));
15 $('.slide-container').linkageSlider(); 16 $('.slide-container').linkageSlider();
16 $('.img-brand').slider2(); 17 $('.img-brand').slider2();
17 18
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 font-weight: normal; 8 font-weight: normal;
9 font-style: normal; 9 font-style: normal;
10 } 10 }
11 -.footer-page { 11 +.yoho-footer {
12 font-size: 12px; 12 font-size: 12px;
13 /*----文字颜色----*/ 13 /*----文字颜色----*/
14 .red{ 14 .red{
@@ -377,7 +377,7 @@ @@ -377,7 +377,7 @@
377 } 377 }
378 } 378 }
379 @media (max-width:1310px){ 379 @media (max-width:1310px){
380 - .footer-page{ 380 + .yoho-footer{
381 .return-top{ 381 .return-top{
382 left: 100%; 382 left: 100%;
383 right: 20px; 383 right: 20px;
@@ -388,7 +388,7 @@ @@ -388,7 +388,7 @@
388 } 388 }
389 389
390 @media (min-width:1310px){ 390 @media (min-width:1310px){
391 - .footer-page{ 391 + .yoho-footer{
392 .return-top{ 392 .return-top{
393 left: 50%; 393 left: 50%;
394 margin-left: 595px; 394 margin-left: 595px;
@@ -396,7 +396,7 @@ @@ -396,7 +396,7 @@
396 } 396 }
397 } 397 }
398 @media (max-width:1180px){ 398 @media (max-width:1180px){
399 - .footer-page { 399 + .yoho-footer {
400 .screen{ 400 .screen{
401 width: 990px; 401 width: 990px;
402 margin-left: auto; 402 margin-left: auto;
@@ -476,7 +476,7 @@ @@ -476,7 +476,7 @@
476 } 476 }
477 } 477 }
478 @media (min-width:1180px){ 478 @media (min-width:1180px){
479 - .footer-page{ 479 + .yoho-footer{
480 .screen{ 480 .screen{
481 width: 1150px; 481 width: 1150px;
482 margin-left: auto; 482 margin-left: auto;
1 -.header-page { 1 +.yoho-header {
2 .header-topwrapper { 2 .header-topwrapper {
3 width: 100%; 3 width: 100%;
4 background-color: #f4f4f4; 4 background-color: #f4f4f4;
@@ -118,6 +118,8 @@ @@ -118,6 +118,8 @@
118 .new-report { 118 .new-report {
119 img { 119 img {
120 display: block; 120 display: block;
  121 + width: 100%;
  122 + height: 100%;
121 } 123 }
122 .report-list { 124 .report-list {
123 float: left; 125 float: left;
@@ -133,6 +135,7 @@ @@ -133,6 +135,7 @@
133 width: 282px; 135 width: 282px;
134 height: 504px; 136 height: 504px;
135 } 137 }
  138 +
136 } 139 }
137 } 140 }
138 141
@@ -58,7 +58,6 @@ class BoysController extends AbstractAction @@ -58,7 +58,6 @@ class BoysController extends AbstractAction
58 'link'=>'' 58 'link'=>''
59 ) 59 )
60 ) 60 )
61 -  
62 ) 61 )
63 ) 62 )
64 ), 63 ),
@@ -79,7 +78,6 @@ class BoysController extends AbstractAction @@ -79,7 +78,6 @@ class BoysController extends AbstractAction
79 'link'=>'' 78 'link'=>''
80 ) 79 )
81 ) 80 )
82 -  
83 ) 81 )
84 ) 82 )
85 ) 83 )
@@ -109,7 +107,6 @@ class BoysController extends AbstractAction @@ -109,7 +107,6 @@ class BoysController extends AbstractAction
109 'link'=>'' 107 'link'=>''
110 ) 108 )
111 ) 109 )
112 -  
113 ) 110 )
114 ) 111 )
115 ), 112 ),
@@ -130,7 +127,6 @@ class BoysController extends AbstractAction @@ -130,7 +127,6 @@ class BoysController extends AbstractAction
130 'link'=>'' 127 'link'=>''
131 ) 128 )
132 ) 129 )
133 -  
134 ) 130 )
135 ) 131 )
136 ), 132 ),
@@ -151,7 +147,6 @@ class BoysController extends AbstractAction @@ -151,7 +147,6 @@ class BoysController extends AbstractAction
151 'link'=>'' 147 'link'=>''
152 ) 148 )
153 ) 149 )
154 -  
155 ) 150 )
156 ) 151 )
157 ) 152 )
@@ -174,15 +169,18 @@ class BoysController extends AbstractAction @@ -174,15 +169,18 @@ class BoysController extends AbstractAction
174 'name' =>'我的收藏', 169 'name' =>'我的收藏',
175 'link' =>'', 170 'link' =>'',
176 'num' => '1' 171 'num' => '1'
177 - ),array( 172 + ),
  173 + array(
178 'name' =>'我的优惠券', 174 'name' =>'我的优惠券',
179 'link' =>'', 175 'link' =>'',
180 'num' => '2' 176 'num' => '2'
181 - ),array( 177 + ),
  178 + array(
182 'name' =>'我的YOHO币', 179 'name' =>'我的YOHO币',
183 'link' =>'', 180 'link' =>'',
184 'num' => '1' 181 'num' => '1'
185 - ),array( 182 + ),
  183 + array(
186 'name' =>'我的退货换货', 184 'name' =>'我的退货换货',
187 'link' =>'', 185 'link' =>'',
188 'num' => '1' 186 'num' => '1'
@@ -266,6 +264,8 @@ class BoysController extends AbstractAction @@ -266,6 +264,8 @@ class BoysController extends AbstractAction
266 'headerdata' => $headerdata, 264 'headerdata' => $headerdata,
267 'boysHomePage' => true, 265 'boysHomePage' => true,
268 'boy' => array( 266 'boy' => array(
  267 + array(
  268 + 'slide' => array(
269 'bigSlide' => array( 269 'bigSlide' => array(
270 array( 270 array(
271 'href' => '/?gender=1,3', 271 'href' => '/?gender=1,3',
@@ -285,7 +285,10 @@ class BoysController extends AbstractAction @@ -285,7 +285,10 @@ class BoysController extends AbstractAction
285 'href' => 'http://sale.yohobuy.com/?specialsale_id=13&gender=1,3', 285 'href' => 'http://sale.yohobuy.com/?specialsale_id=13&gender=1,3',
286 'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/27/09/015b6a29ee526edeaacd13f4a7c81475f0.jpg?imageMogr2/thumbnail/138x54/extent/138x54/background/d2hpdGU=/position/center/quality/90' 286 'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/27/09/015b6a29ee526edeaacd13f4a7c81475f0.jpg?imageMogr2/thumbnail/138x54/extent/138x54/background/d2hpdGU=/position/center/quality/90'
287 ) 287 )
  288 + )
  289 + )
288 ), 290 ),
  291 + array(
289 'newReport' => array( 292 'newReport' => array(
290 'name' => '最新速报 NEW!', 293 'name' => '最新速报 NEW!',
291 'list' => array( 294 'list' => array(
@@ -322,7 +325,9 @@ class BoysController extends AbstractAction @@ -322,7 +325,9 @@ class BoysController extends AbstractAction
322 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/27/03/0140fd98fd1c15c206d198d458e1c8e96f.jpg?imageView/1/w/377/h/504' 325 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/27/03/0140fd98fd1c15c206d198d458e1c8e96f.jpg?imageView/1/w/377/h/504'
323 ) 326 )
324 ) 327 )
  328 + )
325 ), 329 ),
  330 + array(
326 'preferenceBrand' => array( 331 'preferenceBrand' => array(
327 'name' => '优选品牌 BRAND', 332 'name' => '优选品牌 BRAND',
328 'imgBrand' => array( 333 'imgBrand' => array(
@@ -363,7 +368,9 @@ class BoysController extends AbstractAction @@ -363,7 +368,9 @@ class BoysController extends AbstractAction
363 'img' => 'http://img10.static.yhbimg.com/goodsimg/2015/01/30/05/01524c049077911258735906dafd6a4b45.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90' 368 'img' => 'http://img10.static.yhbimg.com/goodsimg/2015/01/30/05/01524c049077911258735906dafd6a4b45.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90'
364 ) 369 )
365 ) 370 )
  371 + )
366 ), 372 ),
  373 + array(
367 'singlehot'=>array( 374 'singlehot'=>array(
368 'name' => '单品 HOT', 375 'name' => '单品 HOT',
369 'imgHot' => array( 376 'imgHot' => array(
@@ -408,9 +415,16 @@ class BoysController extends AbstractAction @@ -408,9 +415,16 @@ class BoysController extends AbstractAction
408 'img' => 'http://img10.static.yhbimg.com/goodsimg/2015/01/30/05/01524c049077911258735906dafd6a4b45.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90' 415 'img' => 'http://img10.static.yhbimg.com/goodsimg/2015/01/30/05/01524c049077911258735906dafd6a4b45.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90'
409 ) 416 )
410 ) 417 )
  418 + )
411 ), 419 ),
412 - 'adbanner'=>array('href' => '','img'=>'' ),  
413 - 'recommend'=>array($tpldata,$tpldata,$tpldata), 420 + array('adbanner'=>array('href' => '','img'=>'' )),
  421 + array(
  422 + 'recommend'=>$tpldata
  423 + ),
  424 + array(
  425 + 'recommend'=>$tpldata
  426 + ),
  427 + array(
414 'newArrivls' => array( 428 'newArrivls' => array(
415 'name' => '最新上架 NEW ARRIVALS', 429 'name' => '最新上架 NEW ARRIVALS',
416 'navs' => array( 430 'navs' => array(
@@ -422,6 +436,7 @@ class BoysController extends AbstractAction @@ -422,6 +436,7 @@ class BoysController extends AbstractAction
422 ) 436 )
423 ) 437 )
424 ) 438 )
  439 + )
425 ); 440 );
426 $this->_view->display('index', $data); 441 $this->_view->display('index', $data);
427 } 442 }