Authored by hf

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

Showing 30 changed files with 510 additions and 477 deletions
... ... @@ -67,7 +67,7 @@ class BrandData
*/
public static function getBrandLogo($brandId)
{
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_LOGO, 'getBrandByids', array($brandId ));
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_LOGO, 'getBrandByids', array($brandId));
}
/**
... ... @@ -78,7 +78,7 @@ class BrandData
*/
public static function getBrandLogoByDomain($domain)
{
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_LOGO, 'getBrandByDomain', array($domain ));
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_LOGO, 'getBrandByDomain', array($domain));
}
/**
... ... @@ -88,9 +88,9 @@ class BrandData
* @param int $status 状态
* @return array
*/
public static function getFolderByBrand($brand_id,$status = 1)
public static function getFolderByBrand($brand_id, $status = 1)
{
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_FOLDER, 'getFolderByBrand', array($brand_id,$status ));
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_FOLDER, 'getFolderByBrand', array($brand_id, $status));
}
/**
... ... @@ -99,8 +99,38 @@ class BrandData
* @param string $mode
* @return mixed
*/
public static function getByNodeContent($node, $mode='release')
public static function getByNodeContent($node, $mode = 'release')
{
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_BRAND_NODECONTENT, 'getByNodeContent', array($node, $mode));
}
/*
* 品牌一览资源位banner
* @param string $contentCode 获取广告资源需要的位置码
* @param int $channel 频道标识 1:男,2:女,3:潮童,4:创意生活
* @return array(
* "brandTop": "顶部的轮翻广告及热门品牌数据",
* "brandList": "按字母'A-Z'分组的品牌列表数据"
* )
*/
public static function getTopBanner($contentCode,$channel)
{
/* 顶部的轮翻广告及热门品牌数据 */
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
$param['client_secret'] = Sign::getSign($param);
$urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param);
/* 按字母"A-Z"分组的品牌列表数据 */
$param = Yohobuy::param();
$param['method'] = 'app.brand.brandlist';
$param['yh_channel'] = $channel;
$param['client_secret'] = Sign::getSign($param);
$urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
return Yohobuy::getMulti($urlList, array(), 3600); // 有缓存1小时
}
}
... ...
... ... @@ -1316,15 +1316,13 @@ class HelperSearch
*/
public static function getBannerFormat($banner, $brand)
{
// 根据品牌Id获取品牌banner图
if (isset($banner['banner'])) {
$bannerImg = Helpers::getImageUrl($banner['banner'], '', 150);
}
$is_favorite = false;
$shopName = false;
if(isset($brand)){
if(isset($brand['is_favorite'])){
// 获取是否收藏
if ($brand['is_favorite'] == 'Y') {
$is_favorite = true;
... ...
... ... @@ -31,7 +31,11 @@ var _hmt = _hmt || [];
s.parentNode.insertBefore(hm, s);
})();
}
if (window.addEventListener) {
window.addEventListener('load', async_load, false);
} else if (window.attachEvent) {
window.attachEvent('onload', async_load);
}
})();
</script>
<script>
... ...
... ... @@ -108,20 +108,20 @@ function getShoppingKey() {
}
//YAS统计代码
(function(w, d, s, j, f) {
var a = d.createElement(s);
var m = d.getElementsByTagName(s)[0];
w.YohoAcquisitionObject = f;
w[f] = function() {
w[f].p = arguments;
};
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
//(function(w, d, s, j, f) {
// var a = d.createElement(s);
// var m = d.getElementsByTagName(s)[0];
//
// w.YohoAcquisitionObject = f;
//
// w[f] = function() {
// w[f].p = arguments;
// };
//
// a.async = 1;
// a.src = j;
// m.parentNode.insertBefore(a, m);
//})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
(function() {
var uid = getUid();
... ... @@ -2274,7 +2274,7 @@ $('.logo-brand').logoBrand({
$.ajax({
type: 'GET',
dataType: 'json',
url: '/hotrank/getdata',
url: '/product/index/getdata',
data: param,
success: function(res) {
var data;
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
<!-- Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Respond JS Proxy</title>
</head>
<body>
<script>
(function () {
var domain, css, query, getQueryString, ajax, xmlHttp;
/*
http://stackoverflow.com/questions/4963673/get-url-array-variables-in-javascript-jquery/4963817#4963817
*/
getQueryString = function() {
var ret = {}, parts, i, p;
parts = (document.location.toString().split("?")[1]).split("&");
for (i = 0; i < parts.length; i++) {
p = parts[i].split("=");
// so strings will be correctly parsed:
p[1] = decodeURIComponent(p[1].replace(/\+/g, " "));
if (p[0].search(/\[\]/) >= 0) { // then it"s an array
p[0] = p[0].replace("[]", "");
if (typeof ret[p[0]] != "object") {
ret[p[0]] = [];
}
ret[p[0]].push(p[1]);
} else {
ret[p[0]] = p[1];
}
}
return ret;
};
ajax = function( url, callback ) {
var req = xmlHttp();
if (!req){
return;
}
req.open( "GET", url, true );
req.onreadystatechange = function () {
if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
return;
}
callback( req.responseText );
};
if ( req.readyState == 4 ){
return;
}
req.send();
};
//define ajax obj
xmlHttp = (function() {
var xmlhttpmethod = false,
attempts = [
function(){ return new XMLHttpRequest(); },
function(){ return new ActiveXObject("Microsoft.XMLHTTP"); },
function(){ return new ActiveXObject("MSXML2.XMLHTTP.3.0"); }
],
al = attempts.length;
while( al-- ){
try {
xmlhttpmethod = attempts[ al ]();
}
catch(e) {
continue;
}
break;
}
return function(){
return xmlhttpmethod;
};
})();
query = getQueryString();
css = query["css"];
domain = query["url"];
if (css && domain) {
ajax(css, function (response) {
window.name = response;
window.location.href = domain;
});
}
}());
</script>
</body>
</html>
\ No newline at end of file
... ...
/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
* Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
* */
!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);
\ No newline at end of file
... ...
/*! Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
(function(win, doc, undefined){
var docElem = doc.documentElement,
proxyURL = doc.getElementById("respond-proxy").href,
redirectURL = (doc.getElementById("respond-redirect") || location).href,
baseElem = doc.getElementsByTagName("base")[0],
urls = [],
refNode;
function encode(url){
return win.encodeURIComponent(url);
}
function fakejax( url, callback ){
var iframe,
AXO;
// All hail Google http://j.mp/iKMI19
// Behold, an iframe proxy without annoying clicky noises.
if ( "ActiveXObject" in win ) {
AXO = new ActiveXObject( "htmlfile" );
AXO.open();
AXO.write( '<iframe id="x"></iframe>' );
AXO.close();
iframe = AXO.getElementById( "x" );
} else {
iframe = doc.createElement( "iframe" );
iframe.style.cssText = "position:absolute;top:-99em";
docElem.insertBefore(iframe, docElem.firstElementChild || docElem.firstChild );
}
iframe.src = checkBaseURL(proxyURL) + "?url=" + encode(redirectURL) + "&css=" + encode(checkBaseURL(url));
function checkFrameName() {
var cssText;
try {
cssText = iframe.contentWindow.name;
}
catch (e) { }
if (cssText) {
// We've got what we need. Stop the iframe from loading further content.
iframe.src = "about:blank";
iframe.parentNode.removeChild(iframe);
iframe = null;
// Per http://j.mp/kn9EPh, not taking any chances. Flushing the ActiveXObject
if (AXO) {
AXO = null;
if (win.CollectGarbage) {
win.CollectGarbage();
}
}
callback(cssText);
}
else{
win.setTimeout(checkFrameName, 100);
}
}
win.setTimeout(checkFrameName, 500);
}
// http://stackoverflow.com/a/472729
function checkBaseURL(href) {
var el = document.createElement('div'),
escapedURL = href.split('&').join('&amp;').
split('<').join('&lt;').
split('"').join('&quot;');
el.innerHTML = '<a href="' + escapedURL + '">x</a>';
return el.firstChild.href;
}
function checkRedirectURL() {
// IE6 & IE7 don't build out absolute urls in <link /> attributes.
// So respond.proxy.gif remains relative instead of http://example.com/respond.proxy.gif.
// This trickery resolves that issue.
if (~ !redirectURL.indexOf(location.host)) {
var fakeLink = doc.createElement("div");
fakeLink.innerHTML = '<a href="' + redirectURL + '"></a>';
docElem.insertBefore(fakeLink, docElem.firstElementChild || docElem.firstChild );
// Grab the parsed URL from that dummy object
redirectURL = fakeLink.firstChild.href;
// Clean up
fakeLink.parentNode.removeChild(fakeLink);
fakeLink = null;
}
}
function buildUrls(){
var links = doc.getElementsByTagName( "link" );
for( var i = 0, linkl = links.length; i < linkl; i++ ){
var thislink = links[i],
href = links[i].href,
extreg = (/^([a-zA-Z:]*\/\/(www\.)?)/).test( href ),
ext = (baseElem && !extreg) || extreg;
//make sure it's an external stylesheet
if( thislink.rel.indexOf( "stylesheet" ) >= 0 && ext ){
(function( link ){
fakejax( href, function( css ){
link.styleSheet.rawCssText = css;
respond.update();
} );
})( thislink );
}
}
}
if( !respond.mediaQueriesSupported ){
checkRedirectURL();
buildUrls();
}
})( window, document );
... ...
... ... @@ -289,6 +289,7 @@
.senior {
padding-bottom: 6px;
padding-right: 0;
.attr-content {
position: relative;
... ...
... ... @@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
$controller = 'Index';
$action = 'Index';
// 二级域名
if (2 === $level) {
if (3 === $level) {
$subDomain = strval($hostParts[0]);
switch (strtolower($subDomain)) {
case 'www': // 主站
... ...
<?php
use Action\AbstractAction;
use Action\WebAction;
use Product\BrandsModel;
/**
* 品牌首页
*/
class BrandsController extends AbstractAction
class BrandsController extends WebAction
{
public function brandsAction()
{
$headerdata = array(
'gobytype' => 'gobuyboys',
'searchcate' => 'searchcateboys',
'navbars' => array(
array(
'name_cn' => '男生',
'name_en' => 'BOYS',
'link' => '',
'classname' => 'boys',
'index_main' => 0,
'subnav' => array(
array(
'name' => '男首1',
'link' => '',
'index_sub' => 0,
'thirdnav' => array(
array(
'title' => '上装',
'branditems' => array(
array(
'brandname' => '背心',
'link' => ''
),
array(
'brandname' => 'T恤',
'link' => ''
)
)
)
)
),
array(
'name' => '男首2',
'link' => '',
'index_sub' => 1,
'thirdnav' => array(
array(
'title' => '上装',
'branditems' => array(
array(
'brandname' => '背心',
'link' => ''
),
array(
'brandname' => 'T恤',
'link' => ''
)
)
)
)
),
array(
'name' => '男首3',
'link' => '',
'index_sub' => 2,
'thirdnav' => array(
array(
'title' => '上装',
'branditems' => array(
array(
'brandname' => '背心',
'link' => ''
),
array(
'brandname' => 'T恤',
'link' => ''
)
)
)
)
)
)
),
array(
'name_cn' => '女生',
'name_en' => 'GIRLS',
'link' => 'http=>//www.baidu.com',
'classname' => '',
'index_main' => 0,
'subnav' => array(
array(
'name' => '女生1',
'link' => '',
'index_sub' => 0,
'thirdnav' => array(
array(
'title' => '上装',
'branditems' => array(
array(
'brandname' => '背心',
'link' => ''
),
array(
'brandname' => 'T恤',
'link' => ''
)
)
)
)
),
array(
'name' => '女生2',
'link' => '',
'index_sub' => 1,
'thirdnav' => array(
array(
'title' => '上装',
'branditems' => array(
array(
'brandname' => '背心',
'link' => ''
),
array(
'brandname' => 'T恤',
'link' => ''
)
)
)
)
),
array(
'name' => '女生3',
'link' => '',
'index_sub' => 2,
'thirdnav' => array(
array(
'title' => '上装',
'branditems' => array(
array(
'brandname' => '背心',
'link' => ''
),
array(
'brandname' => 'T恤',
'link' => ''
)
)
)
)
)
)
)
),
'myyoho' => array(
'email' => 'hhh@126.com',
'viptype' => '普通会员',
'currentscore' => 495,
'totalscore' => 600,
'cardtype' => '银卡',
'infolist' => array(
array(
'name' => '待处理的订单',
'link' => '',
'num' => '0'
),
array(
'name' => '我的收藏',
'link' => '',
'num' => '1'
),
array(
'name' => '我的优惠券',
'link' => '',
'num' => '2'
),
array(
'name' => '我的YOHO币',
'link' => '',
'num' => '1'
),
array(
'name' => '我的退货换货',
'link' => '',
'num' => '1'
)
),
'updlink' => ''
),
'gobuy' => array(
'gobuynum' => 3
),
'breadcrumbnav' => array(
array(
'notend' => array(
'link' => 'http=>//www.baidu.com',
'name' => 'BOYS首页'
)
),
array(
'notend' => array(
'link' => 'http=>//www.baidu.com',
'name' => '上衣'
)
),
array(
'isend' => array(
'link' => 'http=>//www.baidu.com',
'name' => '衬衫'
)
)
)
);
$imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
$item = array(
'name' => 'cc',
'key' => '1000011'
);
$item0 = array(
'name' => 'cc',
'hot' => 'hot',
'key' => '1000012'
);
//品牌一览头部
$channel = $this->getCookie("_Channel") ? $this->getCookie("_Channel") : 'boys';
$this->setWebNavHeader($channel);
$item1 = array(
'name' => '所有品牌',
'src' => $imgsrc,
'url' => ''
);
$item2 = array(
'name' => '所有品牌',
'src' => $imgsrc,
'url' => '',
'items' => array(
$item1,
$item1,
$item1,
$item1,
$item1,
$item1,
$item1,
$item1,
$item1,
$item1
)
);
//banner-list
$res = BrandsModel::getBrandView($channel);
//数据整合
$data = array(
'brandsHomePage' => true,
'headerdata' => $headerdata,
'brands' => array(
'category' => array(
'A' => array(
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item
),
'B' => array(
$item,
$item,
$item0,
$item,
$item,
$item,
$item,
$item,
$item
),
'C' => array(
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item
),
'D' => array(
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item0,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item
),
'E' => array(
$item,
$item,
$item0,
$item,
$item,
$item,
$item,
$item,
$item
),
'F' => array(
$item0,
$item,
$item,
$item0,
$item0,
$item,
$item0,
$item,
$item
),
'G' => array(
$item,
$item,
$item,
$item,
$item,
$item0,
$item,
$item,
$item
),
'H' => array(
$item,
$item,
$item,
$item,
$item,
$item,
$item0,
$item,
$item
),
'I' => array(
$item,
$item,
$item0,
$item0,
$item0,
$item0,
$item,
$item,
$item
),
'J' => array(
$item,
$item,
$item,
$item,
$item0,
$item,
$item,
$item,
$item
),
'K' => array(
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item,
$item
),
'L' => array(
$item,
$item0,
$item,
$item,
$item,
$item,
$item,
$item,
$item
),
'M' => array(
$item,
$item0,
$item,
$item,
$item,
$item,
$item,
$item,
$item
),
'N' => array(
$item,
$item0,
$item0,
$item0,
$item,
$item,
$item,
$item,
$item
)
),
'tabs' => array(
$item2,
$item2,
$item2,
$item2,
$item2
)
'category' => $res['brandList'],
'tabs' => $res['brandTop']
)
);
$this->_view->display('brands', $data);
}
... ... @@ -449,35 +42,22 @@ class BrandsController extends AbstractAction
do {
/* 判断是不是AJAX请求 */
if (! $this->isAjax()) {
if (!$this->isAjax()) {
break;
}
$brandId = $this->get('brandId',0);
$uid=$this->getUid(false);
$brandId=144;
BrandsModel::getBrandInfo($brandId, $uid);
$imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
$data = array(
'key' => '1000011',
'icon' => $imgsrc,
'title' => '优显led触控台灯',
'content' => '优显led触控台灯优显led触控台灯优显led触控台灯优显led触控台灯',
'subtitle' => 'AAAAAA',
'imgs' => array(
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
)
)
) // 提示
;
$result = array(
'code' => 200,
'brand' => $data
);
} while (false);
}
while (false);
$this->echoJson($result);
}
... ... @@ -516,7 +96,6 @@ class BrandsController extends AbstractAction
)
)
)
)
),
array(
... ... @@ -982,7 +561,6 @@ class BrandsController extends AbstractAction
)
)
)
)
),
array(
... ... @@ -1196,4 +774,5 @@ class BrandsController extends AbstractAction
);
$this->_view->display('list', $data);
}
}
... ...
... ... @@ -5,6 +5,7 @@ namespace Product;
use Api\Yohobuy;
use Plugin\HelperSearch;
use LibModels\Web\Product\BrandData;
use Index\HomeModel;
use Product\SearchModel;
/**
... ... @@ -14,6 +15,13 @@ use Product\SearchModel;
*/
class BrandsModel
{
//品牌一览资源位CODE码
const BOYS_BRAND_CODE = '8b16b7baf9a66fbe553a6caa97d2ce2a';
const GIRLS_BRAND_CODE = 'c95ae9e40f0add10549b819f821ad626';
const KIDS_BRAND_CODE = '84b7926282fdef92f1039bdcf77c18ba';
const LIFESTYLE_BRAND_CODE = 'c575c6bfdfa4125fae7d24bbec7119c8';
/**
* 搜索品牌数据
* @param $condition array 搜索数据的条件
... ... @@ -30,7 +38,7 @@ class BrandsModel
$data['leftContent'][] = array('picLink' => $adNav);
//获取静态内容(eg:20141219-100447)
if($options['node']){
if ($options['node']) {
$nodeContent = HelperSearch::formatNodeContent($options['node']);
$data['leftContent'][]['picLink']['list'] = $nodeContent;
}
... ... @@ -38,7 +46,6 @@ class BrandsModel
return $data;
}
//获取品牌系列数据
public static function getAdNav($brandId, $status = 1)
{
... ... @@ -83,7 +90,6 @@ class BrandsModel
//组合用户浏览记录url
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
//批量调接口
$result = Yohobuy::getMulti($urlList, array(), true);
... ... @@ -93,4 +99,124 @@ class BrandsModel
return $data;
}
/*
* 获取品牌一览页面,品牌top & 列表
*/
public static function getBrandView($channel)
{
$switchParams = self::switchBrandParams($channel);
$brandTop = array();
/*
* $item1 = array(
'name' => '所有品牌',
'src' => $imgsrc,
'url' => ''
);
*/
$brandAds = array();
$brandList = array();
$res = BrandData::getTopBanner($switchParams['brandCode'], $switchParams['channelType']);
if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) {
foreach ($res['brandTop'][0]['data'] as $tk => $tv) {
$imgUrl = explode("?", $tv['src']);
$topTmp = array(
'name' => $tv['title'],
'src' => $imgUrl[0],
'url' => $tv['url'],
'items' => array()
);
$brandTop[$tk] = $topTmp;
}
}
if (isset($res['brandList']['brands']) && $res['brandList']['brands']) {
foreach ($res['brandList']['brands'] as $lk => $lv) {
if (isset($lv) && $lv) {
$listTmp = array();
foreach ($lv as $ltk => $ltv) {
$listTmp[$ltk] = array(
'name' => $ltv['brand_name'],
'key' => $ltv['id']
);
if ($ltv['is_hot'] == 'Y') {
$listTmp[$ltk] += array('hot' => 'hot');
}
}
}
$brandList[$lk] = $listTmp;
}
}
return array(
'brandTop' => $brandTop,
'brandList' => $brandList
);
}
/*
* 获取单个广告浮窗内容
*/
public static function getBrandInfo($brandId, $uid)
{
$imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
$data = array(
'key' => '1000011',
'icon' => $imgsrc,
'title' => '优显led触控台灯',
'content' => '优显led触控台灯优显led触控台灯优显led触控台灯优显led触控台灯',
'subtitle' => 'AAAAAA',
'imgs' => array(
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
)
)
);
$res = BrandData::getBrandIntro($brandId, $uid);
//if(isset($res['data']) && $res['data']){
// $data['key']=$brandId;
// $data['icon']=
//}
var_dump($res);
die();
}
/*
* 获取品牌一览资源位&channelType
*/
public static function switchBrandParams($channelStr = 'boys')
{
$res = array('channelType' => 1, 'brandCode' => self::BOYS_BRAND_CODE);
switch ($channelStr) {
case HomeModel::COOKIE_NAME_BOYS:
$res['channelType'] = 1;
$res['brandCode'] = self::BOYS_BRAND_CODE;
break;
case HomeModel::COOKIE_NAME_GIRLS:
$res['channelType'] = 2;
$res['brandCode'] = self::GIRLS_BRAND_CODE;
break;
case HomeModel::COOKIE_NAME_KIDS:
$res['channelType'] = 3;
$res['brandCode'] = self::KIDS_BRAND_CODE;
break;
case HomeModel::COOKIE_NAME_LIFESTYLE:
$res['channelType'] = 4;
$res['brandCode'] = self::LIFESTYLE_BRAND_CODE;
break;
default:
$res['channelType'] = 1;
$res['brandCode'] = self::BOYS_BRAND_CODE;
break;
}
return $res;
}
}
... ...
<?php
namespace Product;
use Plugin\HelperSearch;
use Product\SearchModel;
use Api\Yohobuy;
/**
* list Index页模板数据模型
*
*/
class IndexModel
{
const URI_INDEX_TBANNER = '/shops/service/v1/searchbanner';
public static function getIndexData($customCondition, $customOptions)
{
$urlList = array();
$searchCondition = SearchModel::searchCondition($customCondition, $customOptions);
// 组合搜索商品url
$urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
//批量调接口获取数据
$result = Yohobuy::getMulti($urlList, array(), true);
//调用接口获取list-index banner数据
$msort = isset($searchCondition['condition']['msort']) ? $searchCondition['condition']['msort'] : false;
$misort = isset($searchCondition['condition']['misort']) ? $searchCondition['condition']['misort'] : false;
$gender = $searchCondition['condition']['gender'] == '2,3' ? 2 : 1;
if ($msort && $misort) {
$bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array(10,$msort,$misort,$gender,0,0,0,0,0));
}
// 组织模板数据
$data = HelperSearch::getList($result, $searchCondition['options']);
return $data;
}
}
... ...
... ... @@ -43,7 +43,6 @@ class SaleModel
}
$special = $specialInfo['data'];
}
//Sale首页 banner数据
$data['saleBanner']['bannerHeight'] = $special['banner'][0]['height'];
$data['saleBanner']['img'] = $special['banner'][0]['img'];
... ... @@ -51,8 +50,10 @@ class SaleModel
$data['saleTitle']['count'] = $data['totalCount'];
//获取广告位数据
if (isset($special['left_ad_code'])) {
$nodeContent = HelperSearch::formatNodeContent($special['left_ad_code']);
$data['leftContent'][]['picLink']['list'] = $nodeContent;
}
return $data;
}
... ...
<?php
use Action\AbstractAction;
use Action\WebAction;
use LibModels\Web\Passport\LoginData;
use Plugin\Helpers;
use Plugin\Partner\Factory;
class AutosignController extends AbstractAction
class AutosignController extends WebAction
{
/**
... ...
<?php
use Action\AbstractAction;
use Action\WebAction;
use LibModels\Web\Passport\RegData;
use LibModels\Wap\Passport\BindData;
use Passport\PassportModel as PassportModel;
use Plugin\Helpers;
class AutouserinfoController extends AbstractAction
class AutouserinfoController extends WebAction
{
/**
... ...
... ... @@ -63,7 +63,6 @@ class BackController extends WebAction {
} else if (Helpers::verifyMobile($phoneNum)) { // 验证手机号
$mobile = $phoneNum;
$data = BackData::sendCodeToMobile($mobile, $area);
if ($data['code'] == 200) {
$this->setSession ('mobile', $mobile );
$this->setSession ('area', $area );
... ... @@ -141,7 +140,7 @@ class BackController extends WebAction {
}
}
// 跳转错误页面
// $this->redirect('/error/index');
$this->redirect('/error/index');
}
/**
... ...
... ... @@ -5,7 +5,17 @@ class ListController extends WebAction
{
public function indexAction()
{
$condition = array();
$options = array();
$indexData = Product\IndexModel::getIndexData($condition, $options);
$data = array(
//初始化js
'productListPage' => true,
'list' => $indexData
);
$this->setWebNavHeader();
$this->_view->display('list', $data);
}
/**
... ...
; list列表(index)
routes.productindex.type = "rewrite"
routes.productindex.match = "/sale"
routes.productindex.route.module = Product
routes.productindex.route.controller = List
routes.productindex.route.action = index
; 折扣专区(SALE)
routes.productsale.type = "rewrite"
routes.productsale.match = "/sale"
... ...