Authored by Rock Zhang

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

@@ -39,7 +39,7 @@ class BrandData @@ -39,7 +39,7 @@ class BrandData
39 $param['client_secret'] = Sign::getSign($param); 39 $param['client_secret'] = Sign::getSign($param);
40 40
41 $cache = empty($uid) ? 3600 : false; 41 $cache = empty($uid) ? 3600 : false;
42 - 42 +
43 return Yohobuy::get(Yohobuy::API_URL, $param, $cache); // 有缓存1小时 43 return Yohobuy::get(Yohobuy::API_URL, $param, $cache); // 有缓存1小时
44 } 44 }
45 45
@@ -55,7 +55,7 @@ class BrandData @@ -55,7 +55,7 @@ class BrandData
55 $param['brand_id'] = $brandId; 55 $param['brand_id'] = $brandId;
56 $param['method'] = 'app.brand.banner'; 56 $param['method'] = 'app.brand.banner';
57 $param['client_secret'] = Sign::getSign($param); 57 $param['client_secret'] = Sign::getSign($param);
58 - 58 +
59 return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 有缓存1小时 59 return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 有缓存1小时
60 } 60 }
61 61
@@ -66,10 +66,10 @@ class BrandData @@ -66,10 +66,10 @@ class BrandData
66 * @return array 66 * @return array
67 */ 67 */
68 public static function getBrandLogo($brandId) 68 public static function getBrandLogo($brandId)
69 - {  
70 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_LOGO, 'getBrandByids', array($brandId )); 69 + {
  70 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_LOGO, 'getBrandByids', array($brandId));
71 } 71 }
72 - 72 +
73 /** 73 /**
74 * 通过域名获取品牌LOGO信息 74 * 通过域名获取品牌LOGO信息
75 * 75 *
@@ -78,9 +78,9 @@ class BrandData @@ -78,9 +78,9 @@ class BrandData
78 */ 78 */
79 public static function getBrandLogoByDomain($domain) 79 public static function getBrandLogoByDomain($domain)
80 { 80 {
81 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_LOGO, 'getBrandByDomain', array($domain )); 81 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_LOGO, 'getBrandByDomain', array($domain));
82 } 82 }
83 - 83 +
84 /** 84 /**
85 * 通过品牌id获取品牌Folder 85 * 通过品牌id获取品牌Folder
86 * 86 *
@@ -88,19 +88,49 @@ class BrandData @@ -88,19 +88,49 @@ class BrandData
88 * @param int $status 状态 88 * @param int $status 状态
89 * @return array 89 * @return array
90 */ 90 */
91 - public static function getFolderByBrand($brand_id,$status = 1) 91 + public static function getFolderByBrand($brand_id, $status = 1)
92 { 92 {
93 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_FOLDER, 'getFolderByBrand', array($brand_id,$status )); 93 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_FOLDER, 'getFolderByBrand', array($brand_id, $status));
94 } 94 }
95 - 95 +
96 /** 96 /**
97 * 根据节点和运行模式选择静态内容 97 * 根据节点和运行模式选择静态内容
98 * @param $node 20141219-100447 98 * @param $node 20141219-100447
99 * @param string $mode 99 * @param string $mode
100 * @return mixed 100 * @return mixed
101 */ 101 */
102 - public static function getByNodeContent($node, $mode='release') 102 + public static function getByNodeContent($node, $mode = 'release')
103 { 103 {
104 return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_NODECONTENT, 'getByNodeContent', array($node, $mode)); 104 return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_NODECONTENT, 'getByNodeContent', array($node, $mode));
105 } 105 }
  106 +
  107 + /*
  108 + * 品牌一览资源位banner
  109 + * @param string $contentCode 获取广告资源需要的位置码
  110 + * @param int $channel 频道标识 1:男,2:女,3:潮童,4:创意生活
  111 + * @return array(
  112 + * "brandTop": "顶部的轮翻广告及热门品牌数据",
  113 + * "brandList": "按字母'A-Z'分组的品牌列表数据"
  114 + * )
  115 + */
  116 +
  117 + public static function getTopBanner($contentCode,$channel)
  118 + {
  119 + /* 顶部的轮翻广告及热门品牌数据 */
  120 + $param = Yohobuy::param();
  121 + $param['content_code'] = $contentCode;
  122 + $param['client_secret'] = Sign::getSign($param);
  123 + $urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param);
  124 +
  125 + /* 按字母"A-Z"分组的品牌列表数据 */
  126 + $param = Yohobuy::param();
  127 + $param['method'] = 'app.brand.brandlist';
  128 + $param['yh_channel'] = $channel;
  129 + $param['client_secret'] = Sign::getSign($param);
  130 + $urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
  131 +
  132 + return Yohobuy::getMulti($urlList, array(), 3600); // 有缓存1小时
  133 + }
  134 +
  135 +
106 } 136 }
@@ -1316,15 +1316,13 @@ class HelperSearch @@ -1316,15 +1316,13 @@ class HelperSearch
1316 */ 1316 */
1317 public static function getBannerFormat($banner, $brand) 1317 public static function getBannerFormat($banner, $brand)
1318 { 1318 {
1319 -  
1320 // 根据品牌Id获取品牌banner图 1319 // 根据品牌Id获取品牌banner图
1321 if (isset($banner['banner'])) { 1320 if (isset($banner['banner'])) {
1322 $bannerImg = Helpers::getImageUrl($banner['banner'], '', 150); 1321 $bannerImg = Helpers::getImageUrl($banner['banner'], '', 150);
1323 } 1322 }
1324 1323
1325 $is_favorite = false; 1324 $is_favorite = false;
1326 - $shopName = false;  
1327 - if(isset($brand)){ 1325 + if(isset($brand['is_favorite'])){
1328 // 获取是否收藏 1326 // 获取是否收藏
1329 if ($brand['is_favorite'] == 'Y') { 1327 if ($brand['is_favorite'] == 'Y') {
1330 $is_favorite = true; 1328 $is_favorite = true;
@@ -31,7 +31,11 @@ var _hmt = _hmt || []; @@ -31,7 +31,11 @@ var _hmt = _hmt || [];
31 s.parentNode.insertBefore(hm, s); 31 s.parentNode.insertBefore(hm, s);
32 })(); 32 })();
33 } 33 }
34 - window.addEventListener('load', async_load, false); 34 + if (window.addEventListener) {
  35 + window.addEventListener('load', async_load, false);
  36 + } else if (window.attachEvent) {
  37 + window.attachEvent('onload', async_load);
  38 + }
35 })(); 39 })();
36 </script> 40 </script>
37 <script> 41 <script>
@@ -48,4 +52,4 @@ var _hmt = _hmt || []; @@ -48,4 +52,4 @@ var _hmt = _hmt || [];
48 var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h); 52 var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h);
49 }(document); 53 }(document);
50 </script> 54 </script>
51 -<script src="http://static.yohobuy.com/js/v3/o_code.js?v=20150420" async="async"></script>  
  55 +<script src="http://static.yohobuy.com/js/v3/o_code.js?v=20150420" async="async"></script>
  1 +<!-- Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs -->
  2 +<!DOCTYPE html>
  3 +<html>
  4 +<head>
  5 + <meta charset="utf-8" />
  6 + <title>Respond JS Proxy</title>
  7 +</head>
  8 +<body>
  9 + <script>
  10 + (function () {
  11 + var domain, css, query, getQueryString, ajax, xmlHttp;
  12 +
  13 + /*
  14 + http://stackoverflow.com/questions/4963673/get-url-array-variables-in-javascript-jquery/4963817#4963817
  15 + */
  16 + getQueryString = function() {
  17 + var ret = {}, parts, i, p;
  18 +
  19 + parts = (document.location.toString().split("?")[1]).split("&");
  20 +
  21 + for (i = 0; i < parts.length; i++) {
  22 +
  23 + p = parts[i].split("=");
  24 + // so strings will be correctly parsed:
  25 + p[1] = decodeURIComponent(p[1].replace(/\+/g, " "));
  26 +
  27 + if (p[0].search(/\[\]/) >= 0) { // then it"s an array
  28 + p[0] = p[0].replace("[]", "");
  29 +
  30 + if (typeof ret[p[0]] != "object") {
  31 + ret[p[0]] = [];
  32 + }
  33 + ret[p[0]].push(p[1]);
  34 + } else {
  35 + ret[p[0]] = p[1];
  36 + }
  37 + }
  38 + return ret;
  39 + };
  40 +
  41 + ajax = function( url, callback ) {
  42 + var req = xmlHttp();
  43 + if (!req){
  44 + return;
  45 + }
  46 + req.open( "GET", url, true );
  47 + req.onreadystatechange = function () {
  48 + if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
  49 + return;
  50 + }
  51 + callback( req.responseText );
  52 + };
  53 + if ( req.readyState == 4 ){
  54 + return;
  55 + }
  56 + req.send();
  57 + };
  58 +
  59 + //define ajax obj
  60 + xmlHttp = (function() {
  61 + var xmlhttpmethod = false,
  62 + attempts = [
  63 + function(){ return new XMLHttpRequest(); },
  64 + function(){ return new ActiveXObject("Microsoft.XMLHTTP"); },
  65 + function(){ return new ActiveXObject("MSXML2.XMLHTTP.3.0"); }
  66 + ],
  67 + al = attempts.length;
  68 +
  69 + while( al-- ){
  70 + try {
  71 + xmlhttpmethod = attempts[ al ]();
  72 + }
  73 + catch(e) {
  74 + continue;
  75 + }
  76 + break;
  77 + }
  78 + return function(){
  79 + return xmlhttpmethod;
  80 + };
  81 + })();
  82 +
  83 + query = getQueryString();
  84 + css = query["css"];
  85 + domain = query["url"];
  86 +
  87 + if (css && domain) {
  88 + ajax(css, function (response) {
  89 + window.name = response;
  90 + window.location.href = domain;
  91 + });
  92 + }
  93 + }());
  94 + </script>
  95 +</body>
  96 +</html>
  1 +/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
  2 + * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
  3 + * */
  4 +
  5 +!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
  1 +/*! Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
  2 +(function(win, doc, undefined){
  3 + var docElem = doc.documentElement,
  4 + proxyURL = doc.getElementById("respond-proxy").href,
  5 + redirectURL = (doc.getElementById("respond-redirect") || location).href,
  6 + baseElem = doc.getElementsByTagName("base")[0],
  7 + urls = [],
  8 + refNode;
  9 +
  10 + function encode(url){
  11 + return win.encodeURIComponent(url);
  12 + }
  13 +
  14 + function fakejax( url, callback ){
  15 +
  16 + var iframe,
  17 + AXO;
  18 +
  19 + // All hail Google http://j.mp/iKMI19
  20 + // Behold, an iframe proxy without annoying clicky noises.
  21 + if ( "ActiveXObject" in win ) {
  22 + AXO = new ActiveXObject( "htmlfile" );
  23 + AXO.open();
  24 + AXO.write( '<iframe id="x"></iframe>' );
  25 + AXO.close();
  26 + iframe = AXO.getElementById( "x" );
  27 + } else {
  28 + iframe = doc.createElement( "iframe" );
  29 + iframe.style.cssText = "position:absolute;top:-99em";
  30 + docElem.insertBefore(iframe, docElem.firstElementChild || docElem.firstChild );
  31 + }
  32 +
  33 + iframe.src = checkBaseURL(proxyURL) + "?url=" + encode(redirectURL) + "&css=" + encode(checkBaseURL(url));
  34 +
  35 + function checkFrameName() {
  36 + var cssText;
  37 +
  38 + try {
  39 + cssText = iframe.contentWindow.name;
  40 + }
  41 + catch (e) { }
  42 +
  43 + if (cssText) {
  44 + // We've got what we need. Stop the iframe from loading further content.
  45 + iframe.src = "about:blank";
  46 + iframe.parentNode.removeChild(iframe);
  47 + iframe = null;
  48 +
  49 +
  50 + // Per http://j.mp/kn9EPh, not taking any chances. Flushing the ActiveXObject
  51 + if (AXO) {
  52 + AXO = null;
  53 +
  54 + if (win.CollectGarbage) {
  55 + win.CollectGarbage();
  56 + }
  57 + }
  58 +
  59 + callback(cssText);
  60 + }
  61 + else{
  62 + win.setTimeout(checkFrameName, 100);
  63 + }
  64 + }
  65 +
  66 + win.setTimeout(checkFrameName, 500);
  67 + }
  68 +
  69 + // http://stackoverflow.com/a/472729
  70 + function checkBaseURL(href) {
  71 + var el = document.createElement('div'),
  72 + escapedURL = href.split('&').join('&amp;').
  73 + split('<').join('&lt;').
  74 + split('"').join('&quot;');
  75 +
  76 + el.innerHTML = '<a href="' + escapedURL + '">x</a>';
  77 + return el.firstChild.href;
  78 + }
  79 +
  80 + function checkRedirectURL() {
  81 + // IE6 & IE7 don't build out absolute urls in <link /> attributes.
  82 + // So respond.proxy.gif remains relative instead of http://example.com/respond.proxy.gif.
  83 + // This trickery resolves that issue.
  84 + if (~ !redirectURL.indexOf(location.host)) {
  85 +
  86 + var fakeLink = doc.createElement("div");
  87 +
  88 + fakeLink.innerHTML = '<a href="' + redirectURL + '"></a>';
  89 + docElem.insertBefore(fakeLink, docElem.firstElementChild || docElem.firstChild );
  90 +
  91 + // Grab the parsed URL from that dummy object
  92 + redirectURL = fakeLink.firstChild.href;
  93 +
  94 + // Clean up
  95 + fakeLink.parentNode.removeChild(fakeLink);
  96 + fakeLink = null;
  97 + }
  98 + }
  99 +
  100 + function buildUrls(){
  101 + var links = doc.getElementsByTagName( "link" );
  102 +
  103 + for( var i = 0, linkl = links.length; i < linkl; i++ ){
  104 +
  105 + var thislink = links[i],
  106 + href = links[i].href,
  107 + extreg = (/^([a-zA-Z:]*\/\/(www\.)?)/).test( href ),
  108 + ext = (baseElem && !extreg) || extreg;
  109 +
  110 + //make sure it's an external stylesheet
  111 + if( thislink.rel.indexOf( "stylesheet" ) >= 0 && ext ){
  112 + (function( link ){
  113 + fakejax( href, function( css ){
  114 + link.styleSheet.rawCssText = css;
  115 + respond.update();
  116 + } );
  117 + })( thislink );
  118 + }
  119 + }
  120 +
  121 +
  122 + }
  123 +
  124 + if( !respond.mediaQueriesSupported ){
  125 + checkRedirectURL();
  126 + buildUrls();
  127 + }
  128 +
  129 +})( window, document );
@@ -162,7 +162,7 @@ $('.logo-brand').logoBrand({ @@ -162,7 +162,7 @@ $('.logo-brand').logoBrand({
162 $.ajax({ 162 $.ajax({
163 type: 'GET', 163 type: 'GET',
164 dataType: 'json', 164 dataType: 'json',
165 - url: '/product/index/hotrank/getdata', 165 + url: '/product/index/getdata',
166 data: param, 166 data: param,
167 success: function(res) { 167 success: function(res) {
168 var data; 168 var data;
@@ -289,6 +289,7 @@ @@ -289,6 +289,7 @@
289 289
290 .senior { 290 .senior {
291 padding-bottom: 6px; 291 padding-bottom: 6px;
  292 + padding-right: 0;
292 293
293 .attr-content { 294 .attr-content {
294 position: relative; 295 position: relative;
@@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract @@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
71 $controller = 'Index'; 71 $controller = 'Index';
72 $action = 'Index'; 72 $action = 'Index';
73 // 二级域名 73 // 二级域名
74 - if (2 === $level) { 74 + if (3 === $level) {
75 $subDomain = strval($hostParts[0]); 75 $subDomain = strval($hostParts[0]);
76 switch (strtolower($subDomain)) { 76 switch (strtolower($subDomain)) {
77 case 'www': // 主站 77 case 'www': // 主站
1 <?php 1 <?php
2 -use Action\AbstractAction; 2 +
  3 +use Action\WebAction;
  4 +use Product\BrandsModel;
3 5
4 /** 6 /**
5 * 品牌首页 7 * 品牌首页
6 */ 8 */
7 -class BrandsController extends AbstractAction 9 +class BrandsController extends WebAction
8 { 10 {
9 11
10 public function brandsAction() 12 public function brandsAction()
11 { 13 {
12 - $headerdata = array(  
13 - 'gobytype' => 'gobuyboys',  
14 - 'searchcate' => 'searchcateboys',  
15 - 'navbars' => array(  
16 - array(  
17 - 'name_cn' => '男生',  
18 - 'name_en' => 'BOYS',  
19 - 'link' => '',  
20 - 'classname' => 'boys',  
21 - 'index_main' => 0,  
22 - 'subnav' => array(  
23 - array(  
24 - 'name' => '男首1',  
25 - 'link' => '',  
26 - 'index_sub' => 0,  
27 - 'thirdnav' => array(  
28 - array(  
29 - 'title' => '上装',  
30 - 'branditems' => array(  
31 - array(  
32 - 'brandname' => '背心',  
33 - 'link' => ''  
34 - ),  
35 - array(  
36 - 'brandname' => 'T恤',  
37 - 'link' => ''  
38 - )  
39 - )  
40 - )  
41 -  
42 - )  
43 - ),  
44 - array(  
45 - 'name' => '男首2',  
46 - 'link' => '',  
47 - 'index_sub' => 1,  
48 - 'thirdnav' => array(  
49 - array(  
50 - 'title' => '上装',  
51 - 'branditems' => array(  
52 - array(  
53 - 'brandname' => '背心',  
54 - 'link' => ''  
55 - ),  
56 - array(  
57 - 'brandname' => 'T恤',  
58 - 'link' => ''  
59 - )  
60 - )  
61 - )  
62 - )  
63 - ),  
64 - array(  
65 - 'name' => '男首3',  
66 - 'link' => '',  
67 - 'index_sub' => 2,  
68 - 'thirdnav' => array(  
69 - array(  
70 - 'title' => '上装',  
71 - 'branditems' => array(  
72 - array(  
73 - 'brandname' => '背心',  
74 - 'link' => ''  
75 - ),  
76 - array(  
77 - 'brandname' => 'T恤',  
78 - 'link' => ''  
79 - )  
80 - )  
81 - )  
82 - )  
83 - )  
84 - )  
85 - ),  
86 - array(  
87 - 'name_cn' => '女生',  
88 - 'name_en' => 'GIRLS',  
89 - 'link' => 'http=>//www.baidu.com',  
90 - 'classname' => '',  
91 - 'index_main' => 0,  
92 - 'subnav' => array(  
93 - array(  
94 - 'name' => '女生1',  
95 - 'link' => '',  
96 - 'index_sub' => 0,  
97 - 'thirdnav' => array(  
98 - array(  
99 - 'title' => '上装',  
100 - 'branditems' => array(  
101 - array(  
102 - 'brandname' => '背心',  
103 - 'link' => ''  
104 - ),  
105 - array(  
106 - 'brandname' => 'T恤',  
107 - 'link' => ''  
108 - )  
109 - )  
110 - )  
111 - )  
112 - ),  
113 - array(  
114 - 'name' => '女生2',  
115 - 'link' => '',  
116 - 'index_sub' => 1,  
117 - 'thirdnav' => array(  
118 - array(  
119 - 'title' => '上装',  
120 - 'branditems' => array(  
121 - array(  
122 - 'brandname' => '背心',  
123 - 'link' => ''  
124 - ),  
125 - array(  
126 - 'brandname' => 'T恤',  
127 - 'link' => ''  
128 - )  
129 - )  
130 - )  
131 - )  
132 - ),  
133 - array(  
134 - 'name' => '女生3',  
135 - 'link' => '',  
136 - 'index_sub' => 2,  
137 - 'thirdnav' => array(  
138 - array(  
139 - 'title' => '上装',  
140 - 'branditems' => array(  
141 - array(  
142 - 'brandname' => '背心',  
143 - 'link' => ''  
144 - ),  
145 - array(  
146 - 'brandname' => 'T恤',  
147 - 'link' => ''  
148 - )  
149 - )  
150 - )  
151 - )  
152 - )  
153 - )  
154 - )  
155 - ),  
156 - 'myyoho' => array(  
157 - 'email' => 'hhh@126.com',  
158 - 'viptype' => '普通会员',  
159 - 'currentscore' => 495,  
160 - 'totalscore' => 600,  
161 - 'cardtype' => '银卡',  
162 - 'infolist' => array(  
163 - array(  
164 - 'name' => '待处理的订单',  
165 - 'link' => '',  
166 - 'num' => '0'  
167 - ),  
168 - array(  
169 - 'name' => '我的收藏',  
170 - 'link' => '',  
171 - 'num' => '1'  
172 - ),  
173 - array(  
174 - 'name' => '我的优惠券',  
175 - 'link' => '',  
176 - 'num' => '2'  
177 - ),  
178 - array(  
179 - 'name' => '我的YOHO币',  
180 - 'link' => '',  
181 - 'num' => '1'  
182 - ),  
183 - array(  
184 - 'name' => '我的退货换货',  
185 - 'link' => '',  
186 - 'num' => '1'  
187 - )  
188 - ),  
189 - 'updlink' => ''  
190 - ),  
191 - 'gobuy' => array(  
192 - 'gobuynum' => 3  
193 - ),  
194 - 'breadcrumbnav' => array(  
195 - array(  
196 - 'notend' => array(  
197 - 'link' => 'http=>//www.baidu.com',  
198 - 'name' => 'BOYS首页'  
199 - )  
200 - ),  
201 - array(  
202 - 'notend' => array(  
203 - 'link' => 'http=>//www.baidu.com',  
204 - 'name' => '上衣'  
205 - )  
206 - ),  
207 - array(  
208 - 'isend' => array(  
209 - 'link' => 'http=>//www.baidu.com',  
210 - 'name' => '衬衫'  
211 - )  
212 - )  
213 - )  
214 - );  
215 -  
216 - $imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';  
217 - $item = array(  
218 - 'name' => 'cc',  
219 - 'key' => '1000011'  
220 - );  
221 - $item0 = array(  
222 - 'name' => 'cc',  
223 - 'hot' => 'hot',  
224 - 'key' => '1000012'  
225 - );  
226 -  
227 - $item1 = array(  
228 - 'name' => '所有品牌',  
229 - 'src' => $imgsrc,  
230 - 'url' => ''  
231 - );  
232 - $item2 = array(  
233 - 'name' => '所有品牌',  
234 - 'src' => $imgsrc,  
235 - 'url' => '',  
236 - 'items' => array(  
237 - $item1,  
238 - $item1,  
239 - $item1,  
240 - $item1,  
241 - $item1,  
242 - $item1,  
243 - $item1,  
244 - $item1,  
245 - $item1,  
246 - $item1  
247 - )  
248 - );  
249 - 14 + //品牌一览头部
  15 + $channel = $this->getCookie("_Channel") ? $this->getCookie("_Channel") : 'boys';
  16 + $this->setWebNavHeader($channel);
  17 +
  18 + //banner-list
  19 + $res = BrandsModel::getBrandView($channel);
  20 +
  21 + //数据整合
250 $data = array( 22 $data = array(
251 'brandsHomePage' => true, 23 'brandsHomePage' => true,
252 - 'headerdata' => $headerdata,  
253 'brands' => array( 24 'brands' => array(
254 - 'category' => array(  
255 - 'A' => array(  
256 - $item,  
257 - $item,  
258 - $item,  
259 - $item,  
260 - $item,  
261 - $item,  
262 - $item,  
263 - $item,  
264 - $item  
265 - ),  
266 - 'B' => array(  
267 - $item,  
268 - $item,  
269 - $item0,  
270 - $item,  
271 - $item,  
272 - $item,  
273 - $item,  
274 - $item,  
275 - $item  
276 - ),  
277 - 'C' => array(  
278 - $item,  
279 - $item,  
280 - $item,  
281 - $item,  
282 - $item,  
283 - $item,  
284 - $item,  
285 - $item,  
286 - $item  
287 - ),  
288 - 'D' => array(  
289 - $item,  
290 - $item,  
291 - $item,  
292 - $item,  
293 - $item,  
294 - $item,  
295 - $item,  
296 - $item,  
297 - $item,  
298 - $item,  
299 - $item0,  
300 - $item,  
301 - $item,  
302 - $item,  
303 - $item,  
304 - $item,  
305 - $item,  
306 - $item,  
307 - $item,  
308 - $item,  
309 - $item,  
310 - $item,  
311 - $item,  
312 - $item,  
313 - $item  
314 - ),  
315 - 'E' => array(  
316 - $item,  
317 - $item,  
318 - $item0,  
319 - $item,  
320 - $item,  
321 - $item,  
322 - $item,  
323 - $item,  
324 - $item  
325 - ),  
326 - 'F' => array(  
327 - $item0,  
328 - $item,  
329 - $item,  
330 - $item0,  
331 - $item0,  
332 - $item,  
333 - $item0,  
334 - $item,  
335 - $item  
336 - ),  
337 - 'G' => array(  
338 - $item,  
339 - $item,  
340 - $item,  
341 - $item,  
342 - $item,  
343 - $item0,  
344 - $item,  
345 - $item,  
346 - $item  
347 - ),  
348 - 'H' => array(  
349 - $item,  
350 - $item,  
351 - $item,  
352 - $item,  
353 - $item,  
354 - $item,  
355 - $item0,  
356 - $item,  
357 - $item  
358 - ),  
359 - 'I' => array(  
360 - $item,  
361 - $item,  
362 - $item0,  
363 - $item0,  
364 - $item0,  
365 - $item0,  
366 - $item,  
367 - $item,  
368 - $item  
369 - ),  
370 - 'J' => array(  
371 - $item,  
372 - $item,  
373 - $item,  
374 - $item,  
375 - $item0,  
376 - $item,  
377 - $item,  
378 - $item,  
379 - $item  
380 - ),  
381 - 'K' => array(  
382 - $item,  
383 - $item,  
384 - $item,  
385 - $item,  
386 - $item,  
387 - $item,  
388 - $item,  
389 - $item,  
390 - $item  
391 - ),  
392 - 'L' => array(  
393 - $item,  
394 - $item0,  
395 - $item,  
396 - $item,  
397 - $item,  
398 - $item,  
399 - $item,  
400 - $item,  
401 - $item  
402 - ),  
403 - 'M' => array(  
404 - $item,  
405 - $item0,  
406 - $item,  
407 - $item,  
408 - $item,  
409 - $item,  
410 - $item,  
411 - $item,  
412 - $item  
413 - ),  
414 - 'N' => array(  
415 - $item,  
416 - $item0,  
417 - $item0,  
418 - $item0,  
419 - $item,  
420 - $item,  
421 - $item,  
422 - $item,  
423 - $item  
424 - )  
425 - ),  
426 - 'tabs' => array(  
427 - $item2,  
428 - $item2,  
429 - $item2,  
430 - $item2,  
431 - $item2  
432 - ) 25 + 'category' => $res['brandList'],
  26 + 'tabs' => $res['brandTop']
433 ) 27 )
434 ); 28 );
435 -  
436 $this->_view->display('brands', $data); 29 $this->_view->display('brands', $data);
437 } 30 }
438 31
@@ -446,39 +39,26 @@ class BrandsController extends AbstractAction @@ -446,39 +39,26 @@ class BrandsController extends AbstractAction
446 public function brandinfoAction() 39 public function brandinfoAction()
447 { 40 {
448 $result = array(); 41 $result = array();
449 - 42 +
450 do { 43 do {
451 /* 判断是不是AJAX请求 */ 44 /* 判断是不是AJAX请求 */
452 - if (! $this->isAjax()) { 45 + if (!$this->isAjax()) {
453 break; 46 break;
454 } 47 }
  48 + $brandId = $this->get('brandId',0);
  49 + $uid=$this->getUid(false);
  50 + $brandId=144;
  51 + BrandsModel::getBrandInfo($brandId, $uid);
  52 +
  53 +
455 54
456 - $imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';  
457 - $data = array(  
458 - 'key' => '1000011',  
459 - 'icon' => $imgsrc,  
460 - 'title' => '优显led触控台灯',  
461 - 'content' => '优显led触控台灯优显led触控台灯优显led触控台灯优显led触控台灯',  
462 - 'subtitle' => 'AAAAAA',  
463 - 'imgs' => array(  
464 - array(  
465 - 'src' => $imgsrc  
466 - ),  
467 - array(  
468 - 'src' => $imgsrc  
469 - ),  
470 - array(  
471 - 'src' => $imgsrc  
472 - )  
473 - )  
474 - ) // 提示  
475 -;  
476 $result = array( 55 $result = array(
477 'code' => 200, 56 'code' => 200,
478 'brand' => $data 57 'brand' => $data
479 ); 58 );
480 - } while (false);  
481 - 59 + }
  60 + while (false);
  61 +
482 $this->echoJson($result); 62 $this->echoJson($result);
483 } 63 }
484 64
@@ -516,7 +96,6 @@ class BrandsController extends AbstractAction @@ -516,7 +96,6 @@ class BrandsController extends AbstractAction
516 ) 96 )
517 ) 97 )
518 ) 98 )
519 -  
520 ) 99 )
521 ), 100 ),
522 array( 101 array(
@@ -700,7 +279,7 @@ class BrandsController extends AbstractAction @@ -700,7 +279,7 @@ class BrandsController extends AbstractAction
700 'src' => $imgsrc, 279 'src' => $imgsrc,
701 'name' => '优显led触控台灯' 280 'name' => '优显led触控台灯'
702 ); 281 );
703 - 282 +
704 $data = array( 283 $data = array(
705 'brandsHomePage' => true, 284 'brandsHomePage' => true,
706 'headerdata' => $headerdata, 285 'headerdata' => $headerdata,
@@ -982,7 +561,6 @@ class BrandsController extends AbstractAction @@ -982,7 +561,6 @@ class BrandsController extends AbstractAction
982 ) 561 )
983 ) 562 )
984 ) 563 )
985 -  
986 ) 564 )
987 ), 565 ),
988 array( 566 array(
@@ -1157,7 +735,7 @@ class BrandsController extends AbstractAction @@ -1157,7 +735,7 @@ class BrandsController extends AbstractAction
1157 ) 735 )
1158 ); 736 );
1159 $imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg'; 737 $imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
1160 - 738 +
1161 $item1 = array( 739 $item1 = array(
1162 'name' => '所有品牌', 740 'name' => '所有品牌',
1163 'src' => $imgsrc, 741 'src' => $imgsrc,
@@ -1170,7 +748,7 @@ class BrandsController extends AbstractAction @@ -1170,7 +748,7 @@ class BrandsController extends AbstractAction
1170 'name' => 'Millefed', 748 'name' => 'Millefed',
1171 'desc' => ' I.T于2006年冬季在香港推出最新品牌创始 人Shawn Stussy将滑板服、工作服、旧校 服的设计加入到 ' 749 'desc' => ' I.T于2006年冬季在香港推出最新品牌创始 人Shawn Stussy将滑板服、工作服、旧校 服的设计加入到 '
1172 ); 750 );
1173 - 751 +
1174 $data = array( 752 $data = array(
1175 'brandsHomePage' => true, 753 'brandsHomePage' => true,
1176 'headerdata' => $headerdata, 754 'headerdata' => $headerdata,
@@ -1196,4 +774,5 @@ class BrandsController extends AbstractAction @@ -1196,4 +774,5 @@ class BrandsController extends AbstractAction
1196 ); 774 );
1197 $this->_view->display('list', $data); 775 $this->_view->display('list', $data);
1198 } 776 }
1199 -}  
  777 +
  778 +}
@@ -5,6 +5,7 @@ namespace Product; @@ -5,6 +5,7 @@ namespace Product;
5 use Api\Yohobuy; 5 use Api\Yohobuy;
6 use Plugin\HelperSearch; 6 use Plugin\HelperSearch;
7 use LibModels\Web\Product\BrandData; 7 use LibModels\Web\Product\BrandData;
  8 +use Index\HomeModel;
8 use Product\SearchModel; 9 use Product\SearchModel;
9 10
10 /** 11 /**
@@ -12,35 +13,41 @@ use Product\SearchModel; @@ -12,35 +13,41 @@ use Product\SearchModel;
12 * 13 *
13 * @author Administrator 14 * @author Administrator
14 */ 15 */
15 -class BrandsModel 16 +class BrandsModel
16 { 17 {
  18 +
  19 + //品牌一览资源位CODE码
  20 + const BOYS_BRAND_CODE = '8b16b7baf9a66fbe553a6caa97d2ce2a';
  21 + const GIRLS_BRAND_CODE = 'c95ae9e40f0add10549b819f821ad626';
  22 + const KIDS_BRAND_CODE = '84b7926282fdef92f1039bdcf77c18ba';
  23 + const LIFESTYLE_BRAND_CODE = 'c575c6bfdfa4125fae7d24bbec7119c8';
  24 +
17 /** 25 /**
18 * 搜索品牌数据 26 * 搜索品牌数据
19 * @param $condition array 搜索数据的条件 27 * @param $condition array 搜索数据的条件
20 * @param $options array 28 * @param $options array
21 * @return array 29 * @return array
22 */ 30 */
23 - public static function getBrandSearchData($condition, $options) 31 + public static function getBrandSearchData($condition, $options)
24 { 32 {
25 // 并行调用品牌相关接口并封装数据 33 // 并行调用品牌相关接口并封装数据
26 $data = self::getBrandData($condition, $options); 34 $data = self::getBrandData($condition, $options);
27 - 35 +
28 //获取品牌系列数据 36 //获取品牌系列数据
29 $adNav = self::getAdNav($options['brandId']); 37 $adNav = self::getAdNav($options['brandId']);
30 $data['leftContent'][] = array('picLink' => $adNav); 38 $data['leftContent'][] = array('picLink' => $adNav);
31 - 39 +
32 //获取静态内容(eg:20141219-100447) 40 //获取静态内容(eg:20141219-100447)
33 - if($options['node']){ 41 + if ($options['node']) {
34 $nodeContent = HelperSearch::formatNodeContent($options['node']); 42 $nodeContent = HelperSearch::formatNodeContent($options['node']);
35 $data['leftContent'][]['picLink']['list'] = $nodeContent; 43 $data['leftContent'][]['picLink']['list'] = $nodeContent;
36 } 44 }
37 - 45 +
38 return $data; 46 return $data;
39 } 47 }
40 -  
41 48
42 //获取品牌系列数据 49 //获取品牌系列数据
43 - public static function getAdNav($brandId, $status = 1) 50 + public static function getAdNav($brandId, $status = 1)
44 { 51 {
45 //调用接口获得数据 52 //调用接口获得数据
46 $advNav = BrandData::getFolderByBrand($brandId, $status); 53 $advNav = BrandData::getFolderByBrand($brandId, $status);
@@ -52,7 +59,7 @@ class BrandsModel @@ -52,7 +59,7 @@ class BrandsModel
52 } 59 }
53 $result['picTitle'] = '经典系列'; 60 $result['picTitle'] = '经典系列';
54 } 61 }
55 - 62 +
56 return $result; 63 return $result;
57 } 64 }
58 65
@@ -65,32 +72,151 @@ class BrandsModel @@ -65,32 +72,151 @@ class BrandsModel
65 public static function getBrandData($customCondition = array(), $customOptions = array()) 72 public static function getBrandData($customCondition = array(), $customOptions = array())
66 { 73 {
67 $urlList = array(); 74 $urlList = array();
68 - 75 +
69 //获取$condition和$option 筛选条件和排序条件 76 //获取$condition和$option 筛选条件和排序条件
70 $searchCondition = SearchModel::searchCondition($customCondition, $customOptions); 77 $searchCondition = SearchModel::searchCondition($customCondition, $customOptions);
71 - 78 +
72 // 组合搜索商品url 79 // 组合搜索商品url
73 $urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']); 80 $urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
74 - 81 +
75 // 组合搜索分类url 82 // 组合搜索分类url
76 $urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']); 83 $urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
77 - 84 +
78 //组合搜索品牌url 85 //组合搜索品牌url
79 $urlList['brand'] = HelperSearch::getBrandUrl($customOptions); 86 $urlList['brand'] = HelperSearch::getBrandUrl($customOptions);
80 - 87 +
81 //组合获取品牌banner url 88 //组合获取品牌banner url
82 $urlList['banner'] = HelperSearch::getBannerUrl($customOptions); 89 $urlList['banner'] = HelperSearch::getBannerUrl($customOptions);
83 - 90 +
84 //组合用户浏览记录url 91 //组合用户浏览记录url
85 //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']); 92 //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
86 -  
87 //批量调接口 93 //批量调接口
88 $result = Yohobuy::getMulti($urlList, array(), true); 94 $result = Yohobuy::getMulti($urlList, array(), true);
89 - 95 +
90 //组织模板数据格式 96 //组织模板数据格式
91 $data = HelperSearch::getList($result, $searchCondition['options']); 97 $data = HelperSearch::getList($result, $searchCondition['options']);
92 -  
93 - 98 +
  99 +
94 return $data; 100 return $data;
95 } 101 }
  102 +
  103 + /*
  104 + * 获取品牌一览页面,品牌top & 列表
  105 + */
  106 +
  107 + public static function getBrandView($channel)
  108 + {
  109 + $switchParams = self::switchBrandParams($channel);
  110 + $brandTop = array();
  111 + /*
  112 + * $item1 = array(
  113 + 'name' => '所有品牌',
  114 + 'src' => $imgsrc,
  115 + 'url' => ''
  116 + );
  117 + */
  118 + $brandAds = array();
  119 + $brandList = array();
  120 + $res = BrandData::getTopBanner($switchParams['brandCode'], $switchParams['channelType']);
  121 + if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) {
  122 + foreach ($res['brandTop'][0]['data'] as $tk => $tv) {
  123 + $imgUrl = explode("?", $tv['src']);
  124 + $topTmp = array(
  125 + 'name' => $tv['title'],
  126 + 'src' => $imgUrl[0],
  127 + 'url' => $tv['url'],
  128 + 'items' => array()
  129 + );
  130 + $brandTop[$tk] = $topTmp;
  131 + }
  132 + }
  133 + if (isset($res['brandList']['brands']) && $res['brandList']['brands']) {
  134 + foreach ($res['brandList']['brands'] as $lk => $lv) {
  135 + if (isset($lv) && $lv) {
  136 + $listTmp = array();
  137 + foreach ($lv as $ltk => $ltv) {
  138 + $listTmp[$ltk] = array(
  139 + 'name' => $ltv['brand_name'],
  140 + 'key' => $ltv['id']
  141 + );
  142 + if ($ltv['is_hot'] == 'Y') {
  143 + $listTmp[$ltk] += array('hot' => 'hot');
  144 + }
  145 + }
  146 + }
  147 + $brandList[$lk] = $listTmp;
  148 + }
  149 + }
  150 + return array(
  151 + 'brandTop' => $brandTop,
  152 + 'brandList' => $brandList
  153 + );
  154 + }
  155 +
  156 + /*
  157 + * 获取单个广告浮窗内容
  158 + */
  159 + public static function getBrandInfo($brandId, $uid)
  160 + {
  161 + $imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
  162 + $data = array(
  163 + 'key' => '1000011',
  164 + 'icon' => $imgsrc,
  165 + 'title' => '优显led触控台灯',
  166 + 'content' => '优显led触控台灯优显led触控台灯优显led触控台灯优显led触控台灯',
  167 + 'subtitle' => 'AAAAAA',
  168 + 'imgs' => array(
  169 + array(
  170 + 'src' => $imgsrc
  171 + ),
  172 + array(
  173 + 'src' => $imgsrc
  174 + ),
  175 + array(
  176 + 'src' => $imgsrc
  177 + )
  178 + )
  179 + );
  180 + $res = BrandData::getBrandIntro($brandId, $uid);
  181 +//if(isset($res['data']) && $res['data']){
  182 +// $data['key']=$brandId;
  183 +// $data['icon']=
  184 +//}
  185 + var_dump($res);
  186 + die();
  187 +
  188 + }
  189 +
  190 + /*
  191 + * 获取品牌一览资源位&channelType
  192 + */
  193 +
  194 + public static function switchBrandParams($channelStr = 'boys')
  195 + {
  196 + $res = array('channelType' => 1, 'brandCode' => self::BOYS_BRAND_CODE);
  197 + switch ($channelStr) {
  198 + case HomeModel::COOKIE_NAME_BOYS:
  199 + $res['channelType'] = 1;
  200 + $res['brandCode'] = self::BOYS_BRAND_CODE;
  201 + break;
  202 + case HomeModel::COOKIE_NAME_GIRLS:
  203 + $res['channelType'] = 2;
  204 + $res['brandCode'] = self::GIRLS_BRAND_CODE;
  205 + break;
  206 + case HomeModel::COOKIE_NAME_KIDS:
  207 + $res['channelType'] = 3;
  208 + $res['brandCode'] = self::KIDS_BRAND_CODE;
  209 + break;
  210 + case HomeModel::COOKIE_NAME_LIFESTYLE:
  211 + $res['channelType'] = 4;
  212 + $res['brandCode'] = self::LIFESTYLE_BRAND_CODE;
  213 + break;
  214 + default:
  215 + $res['channelType'] = 1;
  216 + $res['brandCode'] = self::BOYS_BRAND_CODE;
  217 + break;
  218 + }
  219 + return $res;
  220 + }
  221 +
96 } 222 }
  1 +<?php
  2 +
  3 +namespace Product;
  4 +
  5 +use Plugin\HelperSearch;
  6 +use Product\SearchModel;
  7 +use Api\Yohobuy;
  8 +
  9 +/**
  10 + * list Index页模板数据模型
  11 + *
  12 + */
  13 +class IndexModel
  14 +{
  15 + const URI_INDEX_TBANNER = '/shops/service/v1/searchbanner';
  16 +
  17 + public static function getIndexData($customCondition, $customOptions)
  18 + {
  19 + $urlList = array();
  20 + $searchCondition = SearchModel::searchCondition($customCondition, $customOptions);
  21 +
  22 + // 组合搜索商品url
  23 + $urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
  24 +
  25 + // 组合搜索分类url
  26 + $urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
  27 +
  28 + //用户浏览记录
  29 + //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
  30 +
  31 + //批量调接口获取数据
  32 + $result = Yohobuy::getMulti($urlList, array(), true);
  33 +
  34 + //调用接口获取list-index banner数据
  35 + $msort = isset($searchCondition['condition']['msort']) ? $searchCondition['condition']['msort'] : false;
  36 + $misort = isset($searchCondition['condition']['misort']) ? $searchCondition['condition']['misort'] : false;
  37 + $gender = $searchCondition['condition']['gender'] == '2,3' ? 2 : 1;
  38 + if ($msort && $misort) {
  39 + $bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array(10,$msort,$misort,$gender,0,0,0,0,0));
  40 + }
  41 +
  42 + // 组织模板数据
  43 + $data = HelperSearch::getList($result, $searchCondition['options']);
  44 +
  45 + return $data;
  46 + }
  47 +
  48 +}
@@ -43,7 +43,6 @@ class SaleModel @@ -43,7 +43,6 @@ class SaleModel
43 } 43 }
44 $special = $specialInfo['data']; 44 $special = $specialInfo['data'];
45 } 45 }
46 -  
47 //Sale首页 banner数据 46 //Sale首页 banner数据
48 $data['saleBanner']['bannerHeight'] = $special['banner'][0]['height']; 47 $data['saleBanner']['bannerHeight'] = $special['banner'][0]['height'];
49 $data['saleBanner']['img'] = $special['banner'][0]['img']; 48 $data['saleBanner']['img'] = $special['banner'][0]['img'];
@@ -51,8 +50,10 @@ class SaleModel @@ -51,8 +50,10 @@ class SaleModel
51 $data['saleTitle']['count'] = $data['totalCount']; 50 $data['saleTitle']['count'] = $data['totalCount'];
52 51
53 //获取广告位数据 52 //获取广告位数据
54 - $nodeContent = HelperSearch::formatNodeContent($special['left_ad_code']);  
55 - $data['leftContent'][]['picLink']['list'] = $nodeContent; 53 + if (isset($special['left_ad_code'])) {
  54 + $nodeContent = HelperSearch::formatNodeContent($special['left_ad_code']);
  55 + $data['leftContent'][]['picLink']['list'] = $nodeContent;
  56 + }
56 57
57 return $data; 58 return $data;
58 } 59 }
1 <?php 1 <?php
2 2
3 -use Action\AbstractAction; 3 +use Action\WebAction;
4 use LibModels\Web\Passport\LoginData; 4 use LibModels\Web\Passport\LoginData;
5 use Plugin\Helpers; 5 use Plugin\Helpers;
6 use Plugin\Partner\Factory; 6 use Plugin\Partner\Factory;
7 7
8 -class AutosignController extends AbstractAction 8 +class AutosignController extends WebAction
9 { 9 {
10 10
11 /** 11 /**
1 <?php 1 <?php
2 2
3 -use Action\AbstractAction; 3 +use Action\WebAction;
4 use LibModels\Web\Passport\RegData; 4 use LibModels\Web\Passport\RegData;
5 use LibModels\Wap\Passport\BindData; 5 use LibModels\Wap\Passport\BindData;
6 use Passport\PassportModel as PassportModel; 6 use Passport\PassportModel as PassportModel;
7 use Plugin\Helpers; 7 use Plugin\Helpers;
8 8
9 -class AutouserinfoController extends AbstractAction 9 +class AutouserinfoController extends WebAction
10 { 10 {
11 11
12 /** 12 /**
@@ -63,7 +63,6 @@ class BackController extends WebAction { @@ -63,7 +63,6 @@ class BackController extends WebAction {
63 } else if (Helpers::verifyMobile($phoneNum)) { // 验证手机号 63 } else if (Helpers::verifyMobile($phoneNum)) { // 验证手机号
64 $mobile = $phoneNum; 64 $mobile = $phoneNum;
65 $data = BackData::sendCodeToMobile($mobile, $area); 65 $data = BackData::sendCodeToMobile($mobile, $area);
66 -  
67 if ($data['code'] == 200) { 66 if ($data['code'] == 200) {
68 $this->setSession ('mobile', $mobile ); 67 $this->setSession ('mobile', $mobile );
69 $this->setSession ('area', $area ); 68 $this->setSession ('area', $area );
@@ -141,7 +140,7 @@ class BackController extends WebAction { @@ -141,7 +140,7 @@ class BackController extends WebAction {
141 } 140 }
142 } 141 }
143 // 跳转错误页面 142 // 跳转错误页面
144 - // $this->redirect('/error/index'); 143 + $this->redirect('/error/index');
145 } 144 }
146 145
147 /** 146 /**
@@ -5,7 +5,17 @@ class ListController extends WebAction @@ -5,7 +5,17 @@ class ListController extends WebAction
5 { 5 {
6 public function indexAction() 6 public function indexAction()
7 { 7 {
  8 + $condition = array();
  9 + $options = array();
  10 + $indexData = Product\IndexModel::getIndexData($condition, $options);
8 11
  12 + $data = array(
  13 + //初始化js
  14 + 'productListPage' => true,
  15 + 'list' => $indexData
  16 + );
  17 + $this->setWebNavHeader();
  18 + $this->_view->display('list', $data);
9 } 19 }
10 20
11 /** 21 /**