Authored by hf

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

... ... @@ -319,10 +319,26 @@ function JsonPCallBack(data) {
if (+data.code === 200) {
if (typeof data.data === 'object') {
topbanner = '<a target="_blank" href="' + data.data.url + '" class="page-top-banner"' +
'style="height:50px;border:none;background-image:url(' + window.unescape(data.data.src) + ');' +
'background-position: center;display:block;background-color:#ff5409;">&nbsp;</a>';
$('body').prepend(topbanner);
if(data.data.url !== ''){
topbanner = '<a target="_blank" href="' + data.data.url + '" class="page-top-banner"' +
'style="height:36px;border:none;background-image:url(' + window.unescape(data.data.src) + ');' +
'background-position: center;display:block;background-size:contain">&nbsp;</a>';
}else{
topbanner = '<div class="noticewrapper">' +
'<div class="noticecontainer">' +
'<h1 class="noticetitle">关于系统升级的公告</h1>' +
'<div class="noticecontent">' +
'<p class="tips">尊敬的顾客:</p>' +
'<p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p>' +
'<p class="detail">' +
'系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常' +
'</p>' +
'<p class="detail">使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p>' +
'</div>' +
'</div>' +
'</div>';
}
$('body').prepend(topbanner);
}
}
}
... ...
... ... @@ -2,6 +2,8 @@
use Action\WebAction;
use Product\BrandsModel;
use LibModels\Web\Product\SearchData;
use Plugin\Helpers;
/**
* 品牌首页
... ... @@ -33,8 +35,7 @@ class BrandsController extends WebAction
/**
* 品牌接口数据
*
* @param
* string id 获取品牌ID
* @param string brandId 获取品牌ID
* @return json
*/
public function brandinfoAction()
... ...
... ... @@ -8,6 +8,8 @@ use LibModels\Web\Product\BrandData;
use Index\HomeModel;
use Product\SearchModel;
use WebPlugin\Helpers;
use Plugin\Images;
use LibModels\Web\Product\SearchData;
/**
* 品牌首页模板数据模型
... ... @@ -46,11 +48,7 @@ class BrandsModel
return $data;
}
/**
* 品牌介绍页
* @param array $customCondition
... ... @@ -62,43 +60,39 @@ class BrandsModel
$urlList = array();
//组合搜索品牌url
$urlList['brand'] = HelperSearch::getBrandUrl($customOptions);
//批量调接口
$result = Yohobuy::getMulti($urlList, array(), true);
if (isset($result['brand'])) {
$banner = HelperSearch::getBannerFormat($result['brand'], $customOptions['brandBanner']);
}
return array(
'brandBanner' => $banner,
'brandAbout' => $customOptions['brandAbout']
);
}
//根据品牌域名处理相关品牌参数
public static function getBrandByDomain($domain, $fields)
{
{
$brandInfo = BrandData::getBrandLogoByDomain($domain, $fields);
$result = array();
if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) {
$result['brandId'] = isset($brandInfo['data']['id']) ? $brandInfo['data']['id'] : '';
$result['node'] = isset($brandInfo['data']['static_content_code']) ? $brandInfo['data']['static_content_code'] : false;
$result['brandBanner'] = isset($brandInfo['data']['brand_banner']) ? $brandInfo['data']['brand_banner']: '';
$result['brandBanner'] = isset($brandInfo['data']['brand_banner']) ? $brandInfo['data']['brand_banner'] : '';
$result['brandNameEn'] = isset($brandInfo['data']['brand_name_en']) ? $brandInfo['data']['brand_name_en'] : '';
$result['brandNameCn'] = isset($brandInfo['data']['brand_name_cn']) ? $brandInfo['data']['brand_name_cn'] : '';
$result['brandAbout'] = isset($brandInfo['data']['brand_intro']) ? $brandInfo['data']['brand_intro'] : '';
} else {
}
else {
return false;
}
return $result;
}
//获取品牌系列数据
public static function getAdNav($brandId, $status = 1)
{
... ... @@ -141,14 +135,13 @@ class BrandsModel
//组合用户浏览记录url
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
//批量调接口
$result = Yohobuy::getMulti($urlList, array(), true);
//组织模板数据格式
$data = HelperSearch::getList($result, $searchCondition['options']);
return $data;
}
... ... @@ -206,9 +199,9 @@ class BrandsModel
$brandList[$lk] = $listTmp;
}
//将brandList里的0-9 排序到最后
$numBrand['0~9']=$brandList['0~9'];
unset($brandList['0~9']);
$brandList+=$numBrand;
$numBrand['0~9'] = $brandList['0~9'];
unset($brandList['0~9']);
$brandList+=$numBrand;
}
return array(
'brandTop' => $brandTop,
... ... @@ -219,30 +212,48 @@ class BrandsModel
/*
* 获取单个广告浮窗内容
*/
public static function getBrandInfo($brandId, $uid)
{
$data = array();
$imgs = array();
//获取品牌简介
$res = BrandData::getBrandIntro($brandId, $uid);
$condition = array(
'viewNum'=>3,
''
);
\LibModels\Web\Product\SearchData::searchElasticByCondition($condition);
if (isset($res['data']) && $res['data']) {
$icoUrlTmp = explode("?", $res['data']['brand_ico']) ;
//获取品牌下的产品信息
$proInfo = self::getProductByBrand($brandId);
$proInfoTmp = $proInfo['data']['product_list'];
if (isset($proInfoTmp) && $proInfoTmp) {
foreach ($proInfoTmp as $v) {
$imgs[] = array(
'src' => Images::getImageUrl($v['default_images'], 80, 100, 3, 'goodsimg')
);
}
}
//整合
$data = array(
'key' => $res['data']['brand_id'],
'icon' => $icoUrlTmp[0],
'title' => $res['data']['brand_name'],
'content' =>$res['data']['brand_intro'],
'icon' => Helpers::getImageUrl($res['data']['brand_ico'], 80, 50, 3),
'title' => $res['data']['brand_name'],
'content' => $res['data']['brand_intro'],
'subtitle' => 'FEATURED ITEMS',
'imgs' => array(),
'imgs' => $imgs
);
}
return $data;
}
/*
* 根据brandId获取产品信息
*/
public static function getProductByBrand($brandId, $num = 3)
{
$condition['viewNum'] = $num;
$condition['brand'] = $brandId;
return searchData::searchElasticByCondition($condition);
}
/*
* 获取品牌一览资源位&channelType
*/
... ...