Authored by hf

Merge branch 'develop' into test

Showing 65 changed files with 1171 additions and 606 deletions
... ... @@ -589,7 +589,7 @@
aliLoginUrl: '',
weiboLoginUrl: '',
qqLoginUrl: '',
interationalUrl: '',
internationalUrl: '',
phoneRetriveUrl: '',
emailRetriveUrl: ''
}
... ... @@ -736,7 +736,7 @@
thumb: '',
name: ''
},
brand: {
brandHome: {
id: 0,
banner: ''
intro: '...'
... ... @@ -749,6 +749,13 @@
],
filter: {
.. //筛选数据结构
}
},
brand: '',
gender: '',
msort: '',
color: '',
size: '',
price: '',
discount: ''
}
}
\ No newline at end of file
... ...
... ... @@ -232,10 +232,15 @@ class AbstractAction extends Controller_Abstract
protected function getUdid()
{
$udid = '';
$ip = $this->_request->getServer('REMOTE_ADDR');
if ($ip) {
$udid = ip2long($ip);
$realIP = $this->_request->getServer('HTTP_X_REAL_IP');
if ($realIP) {
$udid = md5($realIP);
} else {
$realIP = $this->_request->getServer('REMOTE_ADDR', '');
$udid = md5($realIP);
}
return $udid;
}
... ... @@ -354,70 +359,6 @@ class AbstractAction extends Controller_Abstract
protected function setNavSide($guangChoosed = 'all')
{
$this->_view->assign('sideNav', \Index\SideModel::getLeftNav($guangChoosed));
/*
$this->_view->assign('sideNav', array(
0 => array(
'textCn' => '男生',
'textEn' => 'BOYS',
'styleClass' => 'boys',
'url' => '/boys',
),
1 => array(
'textCn' => '女生',
'textEn' => 'GIRLS',
'styleClass' => 'girls',
'url' => '/girls',
),
2 => array(
'textCn' => '潮童',
'textEn' => 'KIDS',
'styleClass' => 'kids',
'url' => '/kids',
),
3 => array(
'textCn' => '创意生活',
'textEn' => 'LIFE STYLE',
'styleClass' => 'life',
'url' => '/lifestyle',
),
4 => array(
'textCn' => '逛',
'textEn' => 'TRENDFINDER',
'styleClass' => 'guang',
'subNav' => array(
'list' => array(
0 => array(
'textCn' => '逛',
'textEn' => 'TrendFinder',
'back' => true,
'isSelect' => false,
),
1 => array(
'textCn' => '查看全部',
'textEn' => '',
'back' => false,
'isSelect' => ($guangChoosed === 'all') ? true : false,
'url' => '/guang/list/index?gender=1,2,3'
),
2 => array(
'textCn' => '只看男生',
'textEn' => 'Boys',
'back' => false,
'isSelect' => ($guangChoosed === 'boys') ? true : false,
'url' => '/guang/list/index?gender=1,3'
),
3 => array(
'textCn' => '只看女生',
'textEn' => 'Girls',
'back' => false,
'isSelect' => ($guangChoosed === 'girls') ? true : false,
'url' => '/guang/list/index?gender=2,3',
),
)
)
),
));
*/
}
/**
... ... @@ -439,7 +380,7 @@ class AbstractAction extends Controller_Abstract
*/
protected function setHomeChannelHeader()
{
$header['searchUrl'] = '';
$header['searchUrl'] = '/search';
$this->_view->assign('homeHeader', $header);
}
... ...
... ... @@ -118,7 +118,7 @@ class Yohobuy
}
/* 开启缓存的情况 */
if ($cache) {
if ($cache && USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($url, 'master');
if (!empty($result)) {
... ... @@ -138,7 +138,7 @@ class Yohobuy
$data = array();
/* 开启缓存的情况 */
if ($cache) {
if ($cache && USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($url, 'slave');
... ... @@ -213,7 +213,7 @@ class Yohobuy
public static function getMulti($urlList = array(), $options = array(), $cache = false, $timeout = 3)
{
/* 开启缓存的情况 */
if ($cache) {
if ($cache && USE_CACHE) {
$key = md5(implode(',', array_values($urlList)));
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
... ... @@ -291,7 +291,7 @@ class Yohobuy
curl_multi_close($mh);
/* 开启缓存的情况 */
if ($cache) {
if ($cache && USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
... ... @@ -319,7 +319,7 @@ class Yohobuy
public static function yarClient($uri, $method, $parameters = array(), $cache = false, $timeout = 3000)
{
/* 开启缓存的情况 */
if ($cache) {
if ($cache && USE_CACHE) {
$key = self::httpBuildQuery($uri . $method, $parameters);
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
... ... @@ -340,7 +340,7 @@ class Yohobuy
}
/* 开启缓存的情况 */
if ($cache) {
if ($cache && USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
... ...
... ... @@ -7,6 +7,8 @@ namespace Configs;
*/
class CacheConfig
{
/* 公共的数据缓存 */
const KEY_COMMON_SIDE_NAV = 'key_common_side_nav'; // 公共的侧边栏
/* 控制器方法中的数据缓存 */
const KEY_ACTION_INDEX_INDEX = 'key_action_index_index'; // 频道选择
... ... @@ -15,6 +17,7 @@ class CacheConfig
const KEY_ACTION_KIDS_INDEX = 'key_action_kids_index'; // 潮童首页
const KEY_ACTION_LIFESTYLE_INDEX = 'key_action_lifestyle_index'; // 创意生活首页
const KEY_COMMON_SIDE_NAV = 'key_common_side_nav'; // 公共的侧边栏
const KEY_ACTION_PRODUCT_NEWSALE_INDEX = 'key_action_product_newsale_index'; // 新品到着
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT = 'key_action_product_newsale_discount'; // 折扣专区
}
... ...
... ... @@ -47,8 +47,11 @@ class ClassData
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public static function selectBrandDetail($gender, $brand, $sort, $color, $size, $price, $p_d, $channel = 1, $order = 's_t_desc', $limit = 60, $page = 1)
public static function selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d, $channel = 1, $order = 's_t_desc', $limit = 60, $page = 1)
{
// 构建必传参数
$param = Yohobuy::param();
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
... ... @@ -60,9 +63,7 @@ class ClassData
);
// 拉取筛选参数
$queriedParams = array_filter($selectItems, function($v) {return $v !== null;});
// 构建必传参数
$param = Yohobuy::param();
$param += $queriedParams;
$param['method'] = 'app.search.category';
$param['page'] = $page;
... ...
... ... @@ -33,7 +33,7 @@ class ListData
$param = Yohobuy::param();
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_CATEGORY, $param);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_CATEGORY, $param, 3600); // 有缓存1小时
}
/**
... ...
... ... @@ -26,8 +26,6 @@ class ListData
*/
public static function productInfoBySkns($skns)
{
//return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PRODUCT, 'getLessInfoByProductSkns', array());
// 调用搜索接口
$param = Yohobuy::param();
$param['method'] = 'app.search.li';
... ... @@ -36,7 +34,7 @@ class ListData
$param['order'] = 's_t_desc';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 有缓存1小时
}
/**
... ...
<?php
namespace LibModels\Wap\Product;
use Api\Yohobuy;
... ... @@ -16,180 +17,192 @@ use Api\Sign;
class NewsaleData
{
/**
* 获取新品到着,折扣专区焦点图数据
* @param string $contentCode 内容位置码
* @return array 新品到着焦点图有关数据
*/
public static function getNewsaleFocus($contentCode)
{
// 构建必传参数
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
/**
* 获取新品到着,折扣专区焦点图数据
* @param string $contentCode 内容位置码
* @return array 新品到着焦点图有关数据
*/
public static function getNewsaleFocus($contentCode)
{
// 构建必传参数
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL.'operations/api/v5/resource/get', $param);
}
/**
* 获取新品到着商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string $channel 1表示男, 2表示女
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 新品到着商品数据
*/
public static function getNewProducts($gender, $channel, $limit = 50, $page = 1)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.newProduct';
$param['gender'] = $gender;
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
// 构建url地址列表
$urlList = array();
$param['dayLimit'] = 1;
$param['client_secret'] = Sign::getSign($param);
$urlList['new'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
$param['dayLimit'] = 2;
unset($param['client_secret']);
$param['client_secret'] = Sign::getSign($param);
$urlList['week'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
$param['dayLimit'] = 3;
unset($param['client_secret']);
$param['client_secret'] = Sign::getSign($param);
$urlList['sale'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
//var_dump($urlList);exit;
return Yohobuy::getMulti($urlList);
}
/**
* 筛选新品到着、折扣专区商品
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类Id
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/get', $param);
}
/**
* 获取新品到着商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string $channel 1表示男, 2表示女
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 新品到着商品数据
*/
public static function getNewProducts($gender, $channel, $limit = 50, $page = 1)
{
// 构建url地址列表
$urlList = array();
$param = Yohobuy::param();
$param['method'] = 'app.search.newProduct';
$param['gender'] = $gender;
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
$build = $param;
$build['dayLimit'] = 1;
$build['client_secret'] = Sign::getSign($build);
$urlList['new'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $build);
$build = $param;
$build['dayLimit'] = 2;
$build['client_secret'] = Sign::getSign($build);
$urlList['week'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $build);
$build = $param;
$build['dayLimit'] = 3;
$build['client_secret'] = Sign::getSign($build);
$urlList['sale'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $build);
$build = array();
$param = array();
return Yohobuy::getMulti($urlList);
}
/**
* 筛选新品到着、折扣专区商品
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类Id
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @param integer $channel 表示频道号,1位男生,2为女生
* @param integer $dayLimit 限制读取多少天,默认为1天
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 根据指定条件筛选出来的商品
*/
public static function selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit = null, $limit = 50, $page = 1)
{
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
'sort' => $sort,
'color' => $color,
'size' => $size,
'price' => $price,
'p_d' => $p_d,
'dayLimit' => $dayLimit
);
// 拉取筛选参数
$queriedParams = array_filter($selectItems, function($v) {return $v !== null;});
$param = Yohobuy::param();
$param['method'] = 'app.search.newProduct';
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
$param = array_merge($param, $queriedParams);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取折扣专区商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string $channel 1表示男, 2表示女
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 折扣专区商品数据
*/
public static function getSaleProducts($gender, $channel, $limit = 60, $page = 1)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.sales';
$param['gender'] = $gender;
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
// 构建url地址列表
$urlList = array();
$param['p_d'] = '0.1,0.3';
$param['client_secret'] = Sign::getSign($param);
$urlList['1-3折'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
$param['p_d'] = '0.4,0.6';
unset($param['client_secret']);
$param['client_secret'] = Sign::getSign($param);
$urlList['4-6折'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
$param['p_d'] = '0.7,0.9';
unset($param['client_secret']);
$param['client_secret'] = Sign::getSign($param);
$urlList['7-9折'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
$param['p_d'] = '0.1,0.9';
unset($param['client_secret']);
$param['client_secret'] = Sign::getSign($param);
$urlList['ALL'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
return Yohobuy::getMulti($urlList);
}
/**
* 筛选折扣专区商品
*
* @param string gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer brand 品牌Id
* @param integer sort 品类Id
* @param integer color 颜色Id
* @param integer size 尺码Id
* @param string price 价格
* @param string $channel 1表示男, 2表示女
* @param integer $p_d 折扣
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 筛选出来的折扣专区商品
*/
public static function selectSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $limit = 50, $page = 1)
{
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
'sort' => $sort,
'color' => $color,
'size' => $size,
'price' => $price
);
// 拉取筛选参数
$queriedParams = array_filter($selectItems, function($v) {return $v !== null;});
$param = Yohobuy::param();
$param['method'] = 'app.search.sales';
$param['yh_channel'] = $channel;
$param['p_d'] = $p_d;
$param['page'] = $page;
$param['limit'] = $limit;
$param = array_merge($param, $queriedParams);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
* @param integer $dayLimit 限制读取多少天,默认为1天
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 根据指定条件筛选出来的商品
*/
public static function selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit = null, $limit = 50, $page = 1)
{
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
'sort' => $sort,
'color' => $color,
'size' => $size,
'price' => $price,
'p_d' => $p_d,
'dayLimit' => $dayLimit
);
// 拉取筛选参数
$queriedParams = array_filter($selectItems, function($v) {
return $v !== null;
});
$param = Yohobuy::param();
$param['method'] = 'app.search.newProduct';
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
$param = array_merge($param, $queriedParams);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取折扣专区商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string $channel 1表示男, 2表示女
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 折扣专区商品数据
*/
public static function getSaleProducts($gender, $channel, $limit = 60, $page = 1)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.sales';
$param['gender'] = $gender;
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
// 构建url地址列表
$urlList = array();
$param['p_d'] = '0.1,0.3';
$param['client_secret'] = Sign::getSign($param);
$urlList['1-3折'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
$param['p_d'] = '0.4,0.6';
unset($param['client_secret']);
$param['client_secret'] = Sign::getSign($param);
$urlList['4-6折'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
$param['p_d'] = '0.7,0.9';
unset($param['client_secret']);
$param['client_secret'] = Sign::getSign($param);
$urlList['7-9折'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
$param['p_d'] = '0.1,0.9';
unset($param['client_secret']);
$param['client_secret'] = Sign::getSign($param);
$urlList['ALL'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
return Yohobuy::getMulti($urlList);
}
/**
* 筛选折扣专区商品
*
* @param string gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer brand 品牌Id
* @param integer sort 品类Id
* @param integer color 颜色Id
* @param integer size 尺码Id
* @param string price 价格
* @param string $channel 1表示男, 2表示女
* @param integer $p_d 折扣
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 筛选出来的折扣专区商品
*/
public static function selectSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $limit = 50, $page = 1)
{
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
'sort' => $sort,
'color' => $color,
'size' => $size,
'price' => $price
);
// 拉取筛选参数
$queriedParams = array_filter($selectItems, function($v) {
return $v !== null;
});
$param = Yohobuy::param();
$param['method'] = 'app.search.sales';
$param['yh_channel'] = $channel;
$param['p_d'] = $p_d;
$param['page'] = $page;
$param['limit'] = $limit;
$param = array_merge($param, $queriedParams);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -63,6 +63,7 @@ class ListProcess
// 过滤条件数据
$filters = array('classify'=>array());
$num = 1;
foreach ($data as $key => $val) {
if(empty($val))
{
... ... @@ -72,6 +73,12 @@ class ListProcess
continue;
}
$build = self::$key($val);
if($num === 1)
{
$build['active'] = true;
}
$num++;
$filters['classify'][] = $build;
}
... ...
<?php
namespace Plugin\DataProcess;
use Plugin\Helpers;
/**
... ... @@ -12,29 +13,29 @@ class NewSaleProcess
/**
* 处理新品到着、折扣专区数据
*
* @param array $data 接口传回的数据
* @param array $products 接口传回的数据
* @return array 处理之后的数据
*/
public static function newSaleData($focus, $products)
public static function newSaleData($products)
{
$result = array(
'headerBanner' => self::bannerData($focus),
'goodsContainer' => array()
);
foreach($products as $single)
{
$result = array();
$noTab = true;
$productsLi = array();
$tabItem = array();
foreach ($products as $single) {
if (empty($single)) {
continue;
}
// 处理Tabs
$noTab = true;
if(isset($single['tabs']) && $noTab)
{
if (isset($single['tabs']) && $noTab) {
$result['tabs'] = array();
foreach ($single['tabs'] as $key => $one)
{
foreach ($single['tabs'] as $key => $one) {
$tabItem = array();
$tabItem['title'] = $one;
if($key === 1)
{
if ($key === 1) {
$tabItem['focus'] = true;
}
$result['tabs'][] = $tabItem;
... ... @@ -43,24 +44,21 @@ class NewSaleProcess
}
// 处理商品
$productsLi = array('goods'=>array());
if(isset($single['product_list']))
{
foreach ($single['product_list'] as $value)
{
$productsLi['goods'][] = Helpers::formatProduct($value);
$productsLi = array();
if (isset($single['product_list'])) {
foreach ($single['product_list'] as $value) {
$productsLi['goods'][] = Helpers::formatProduct($value, true, false);
}
}
// 对于第一个productsLi添加show字段
if(count($result['goodsContainer']) === 0)
{
if (!isset($result['goodsContainer'][0])) {
$productsLi['show'] = true;
}
$result['goodsContainer'][] = $productsLi;
}
return $result;
}
... ... @@ -72,9 +70,9 @@ class NewSaleProcess
*/
public static function selectData($data)
{
$result = array('goods'=>array());
if($data['code'] === 200)
{
$result = array('goods' => array());
if (isset($data['code']) && $data['code'] === 200) {
foreach ($data['data']['product_list'] as $val) {
$result['goods'][] = Helpers::formatProduct($val);
}
... ... @@ -83,27 +81,4 @@ class NewSaleProcess
return $result;
}
/**
* 处理页面顶部焦点图数据
*
* @param array $data 接口传回的焦点图数据
* @return array 处理之后的数据
*/
private static function bannerData($data)
{
$result = array('list'=>array());
foreach ($data as $single)
{
foreach ($single['data'] as $one)
{
$banner = array();
$banner['img'] = Helpers::getImageUrl($one['src'], 750, 364, 1);
$banner['url'] = $one['url'];
$result['list'][] = $banner;
}
}
return $result;
}
}
... ...
... ... @@ -20,7 +20,7 @@ class Helpers
{
return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode));
}
/**
* 获取过滤后的URL链接
*
... ... @@ -29,16 +29,23 @@ class Helpers
*/
public static function getFilterUrl($url)
{
return strstr($url, '&openby:yohobuy=', true);
$filter = strstr($url, 'openby:yohobuy=', true);
if ($filter) {
return rtrim(rtrim($filter, '?'), '&');
} else {
return $url;
}
}
/**
* 格式化商品信息
*
* @param array $productData 需要格式化的商品数据
* @param bool $showTag 控制是否显示标签
* @param bool $showNew 控制是否显示NEW图标
* @return array | false
*/
public static function formatProduct($productData, $showTags = true)
public static function formatProduct($productData, $showTags = true, $showNew = true)
{
// 商品信息有问题,则不显示
if (!isset($productData['product_skn'])) {
... ... @@ -62,7 +69,7 @@ class Helpers
if ($showTags) {
$result['tags'] = array();
$result['tags']['is_new'] = isset($productData['is_new']) && $productData['is_new'] === 'Y'; // 新品
$result['tags']['is_new'] = $showNew && isset($productData['is_new']) && $productData['is_new'] === 'Y'; // 新品
$result['tags']['is_discount'] = isset($productData['is_discount']) && $productData['is_discount'] === 'Y'; // 在售
$result['tags']['is_limited'] = isset($productData['is_limited']) && $productData['is_limited'] === 'Y'; // 限量
$result['tags']['is_yohood'] = isset($productData['is_yohood']) && $productData['is_yohood'] === 'Y'; // YOHOOD
... ... @@ -73,7 +80,7 @@ class Helpers
return $result;
}
/**
* 格式化资讯文章
*
... ... @@ -84,12 +91,12 @@ class Helpers
* @return array | false
*/
public static function formatArticle($articleData, $showTag = true, $share = false, $showAuthor = true)
{
{
// 资讯ID不存在,则不显示
if (!isset($articleData['id'])) {
return false;
}
$result = array();
$result['id'] = $articleData['id'];
$result['showTags'] = $showTag;
... ... @@ -106,12 +113,12 @@ class Helpers
// $result['collect'] = array();
// $result['collect']['isCollected'] = isset($articleData['isFavor']) && $articleData['isFavor'] === 'Y';
$result['share'] = $share;
// 判断是否显示作者信息
if ($showAuthor) {
$result['author'] = empty($articleData['author']) ? false : $articleData['author'];
}
// 模板中需要的标签标识
if ($showTag && isset($articleData['category_id'])) {
switch (strval($articleData['category_id'])) {
... ... @@ -137,6 +144,28 @@ class Helpers
}
/**
* 格式化广告焦点图数据
*
* @param array $bannerData 需要格式化的广告图数据
* @param int $width 图片的宽度
* @param int $height 图片的高度
* @param int $mode 使用的七牛模式
* @return array
*/
public static function formatBanner($bannerData, $width, $height, $mode = 2)
{
$result = array();
$result['img'] = self::getImageUrl($bannerData['src'], $width, $height, $mode);
if (isset($bannerData['url'])) {
$result['url'] = self::getFilterUrl($bannerData['url']);
}
$result['title'] = $bannerData['title'];
return $result;
}
/**
* 生成公开的TOKEN凭证
*
* @param string $string 字符串
... ... @@ -158,8 +187,7 @@ class Helpers
{
if ($token === self::makeToken($string)) {
return true;
}
else {
} else {
return false;
}
}
... ... @@ -291,7 +319,7 @@ class Helpers
* @param int $type
* @return array
*/
public static function getProductIcon($type)
public static function getProductIcon($type)
{
static $icons = array(
1 => 'cloth',
... ... @@ -306,8 +334,8 @@ class Helpers
308 => 'under'
);
$type = intval($type);
return isset($icons[$type]) ? $icons[$type] : '';
}
}
... ...
<?php
namespace Plugin\Partner\Alipay;
namespace Plugin\Partner\alipay;
use Plugin\Partner\Factory;
... ...
<?php
namespace Plugin\Partner\Qqconnect;
namespace Plugin\Partner\qqconnect;
use Plugin\Partner\Factory;
... ...
<?php
namespace Plugin\Partner\Sinaweibo;
namespace Plugin\Partner\sinaweibo;
use Plugin\Partner\Factory;
... ...
... ... @@ -9,7 +9,7 @@
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*(\.css|\.js|\.gif|\.png|\.jpg|\.jpeg|\.svg|\.woff|\.eot|\.ttf)$
RewriteRule ^/(.+)$ /index.php [L]
RewriteRule ^/(.+)$ /index-test.php [L]
<Directory />
LimitRequestBody 10485760
Options FollowSymLinks
... ... @@ -24,15 +24,15 @@
ServerAdmin root@localhost
CustomLog "/Data/logs/apache/access.guang.test.yoho.cn.log" combined
ErrorLog "/Data/logs/apache/error.guang.test.yoho.cn.log"
ServerName guang.test.yoho.cn
ServerName guang.buy.test.yoho.cn
DocumentRoot "/Data/code/git/yohobuy/yohobuy/m.yohobuy.com/public"
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*(\.css|\.js|\.gif|\.png|\.jpg|\.jpeg|\.svg|\.woff|\.eot|\.ttf)$
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule / /index.php?/guang/list/index&%1 [L]
RewriteRule ^/(.+)$ /index.php [L]
RewriteRule / /index.php/guang/list/index?%1 [L]
RewriteRule ^/(.+)$ /index-test.php [L]
<Directory />
LimitRequestBody 10485760
Options FollowSymLinks
... ...
server
{
listen 80;
server_name buy.test.yoho.cn guang.test.yoho.cn;
server_name buy.test.yoho.cn guang.buy.test.yoho.cn;
#access_log /Data/logs/access.buy.test.yoho.cn.log combined;
error_log /Data/logs/error.buy.test.yoho.cn.log warn;
... ...
This diff could not be displayed because it is too large.
2015/10/13 10:24:32 [error] 6884#3060: *63 CreateFile() "D:/yoho/yohobuy/static/img/close-icon.png" failed (2: The system cannot find the file specified), client: 172.16.6.248, server: 172.16.6.248, request: "GET /img/close-icon.png HTTP/1.1", host: "172.16.6.248:8088", referrer: "http://172.16.6.248:8088/css/index.css"
2015/10/13 10:24:32 [error] 6884#3060: *45 CreateFile() "D:/yoho/yohobuy/static/img/app-logo.png" failed (2: The system cannot find the file specified), client: 172.16.6.248, server: 172.16.6.248, request: "GET /img/app-logo.png HTTP/1.1", host: "172.16.6.248:8088", referrer: "http://172.16.6.248:8088/css/index.css"
2015/10/13 10:33:51 [error] 6884#3060: *67 CreateFile() "D:/yoho/yohobuy/static/img/app-logo.png" failed (2: The system cannot find the file specified), client: 172.16.6.248, server: 172.16.6.248, request: "GET /img/app-logo.png HTTP/1.1", host: "172.16.6.248:8088", referrer: "http://172.16.6.248:8088/css/index.css"
2015/10/13 10:33:51 [error] 6884#3060: *68 CreateFile() "D:/yoho/yohobuy/static/img/close-icon.png" failed (2: The system cannot find the file specified), client: 172.16.6.248, server: 172.16.6.248, request: "GET /img/close-icon.png HTTP/1.1", host: "172.16.6.248:8088", referrer: "http://172.16.6.248:8088/css/index.css"
2015/10/13 10:36:39 [error] 6884#3060: *67 CreateFile() "D:/yoho/yohobuy/static/img/app-logo.png" failed (2: The system cannot find the file specified), client: 172.16.6.248, server: 172.16.6.248, request: "GET /img/app-logo.png HTTP/1.1", host: "172.16.6.248:8088", referrer: "http://172.16.6.248:8088/css/index.css"
2015/10/13 10:36:39 [error] 6884#3060: *68 CreateFile() "D:/yoho/yohobuy/static/img/close-icon.png" failed (2: The system cannot find the file specified), client: 172.16.6.248, server: 172.16.6.248, request: "GET /img/close-icon.png HTTP/1.1", host: "172.16.6.248:8088", referrer: "http://172.16.6.248:8088/css/index.css"
2015/10/13 10:43:31 [error] 6884#3060: *78 CreateFile() "D:/yoho/yohobuy/static/img/app-logo.png" failed (2: The system cannot find the file specified), client: 172.16.6.248, server: 172.16.6.248, request: "GET /img/app-logo.png HTTP/1.1", host: "172.16.6.248:8088", referrer: "http://172.16.6.248:8088/css/index.css"
2015/10/13 10:43:31 [error] 6884#3060: *79 CreateFile() "D:/yoho/yohobuy/static/img/close-icon.png" failed (2: The system cannot find the file specified), client: 172.16.6.248, server: 172.16.6.248, request: "GET /img/close-icon.png HTTP/1.1", host: "172.16.6.248:8088", referrer: "http://172.16.6.248:8088/css/index.css"
2015/10/15 15:53:01 [error] 7228#4332: *420 CreateFile() "D:/yoho/yohobuy/static/favicon.ico" failed (2: The system cannot find the file specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /favicon.ico HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/img/passport/yoho-family.png"
2015/10/15 20:21:02 [error] 7228#4332: *599 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/boys.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/boys.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:02 [error] 7228#4332: *600 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/life.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/life.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:02 [error] 7228#4332: *601 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/guang.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/guang.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:02 [error] 7228#4332: *602 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/kids.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/kids.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:02 [error] 7228#4332: *603 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/girls.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/girls.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:22 [error] 7228#4332: *615 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/boys.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/boys.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:22 [error] 7228#4332: *616 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/girls.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/girls.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:22 [error] 7228#4332: *617 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/kids.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/kids.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:22 [error] 7228#4332: *618 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/life.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/life.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:22 [error] 7228#4332: *619 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/guang.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/guang.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:28 [error] 7228#4332: *632 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/boys.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/boys.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:28 [error] 7228#4332: *633 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/girls.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/girls.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:28 [error] 7228#4332: *634 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/kids.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/kids.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:28 [error] 7228#4332: *635 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/life.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/life.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:28 [error] 7228#4332: *636 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/guang.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/guang.png HTTP/1.1", host: "static.dev.yohobuy.com", referrer: "http://static.dev.yohobuy.com/css/index.css"
2015/10/15 20:21:37 [error] 7228#4332: *637 CreateFile() "D:/yoho/yohobuy/static/img/side-nav/life.png" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: static.dev.yohobuy.com, request: "GET /img/side-nav/life.png HTTP/1.1", host: "static.dev.yohobuy.com"
... ... @@ -26,3 +26,4 @@ dist
coverage
css/
.sass-cache/
script/nginx/logs/
\ No newline at end of file
... ...
... ... @@ -35,10 +35,6 @@ function setLazyLoadAndMellipsis($infos) {
$title = $this.find('.info-title'),
$text = $this.find('.info-text');
//减少重复调用
if ($title.attr('title') && $text.attr('title')) {
return;
}
$title[0].mlellipsis(2);
$text[0].mlellipsis(2);
});
... ...
... ... @@ -8,6 +8,7 @@ var $ = require('yoho.zepto'),
lazyLoad = require('yoho.zeptolazyload'),
bannerSwiper,
recommendSwiper,
hotBrandsSwiper,
trendTopicSwiper,
goodsSwiper;
... ... @@ -93,12 +94,12 @@ if ($('.banner-swiper').find('li').size() > 1) {
}
//热门品牌滑动
// hotBrandsSwiper = new Swiper('.brands-swiper', {
// grabCursor: true,
// slidesPerView: 'auto',
// wrapperClass: 'brands-list',
// slideElement: 'li'
// });
hotBrandsSwiper = new Swiper('.brands-swiper', {
grabCursor: true,
slidesPerView: 'auto',
wrapperClass: 'brands-list',
slideElement: 'li'
});
//推荐搭配滑动
recommendSwiper = new Swiper('.recommend-swiper', {
... ...
... ... @@ -11,7 +11,7 @@ require('./register/password');
//登录
require('./login/login');
require('./login/interational');
require('./login/international');
//密码找回
require('./back/mobile');
... ...
... ... @@ -7,13 +7,13 @@
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.zeptolazyload'),
goodsSwiper;
lazyLoad($('img.lazy'));
goodsSwiper = new Swiper('.banner-swiper', {
loop: true,
pagination: '.banner-top .pagination-inner',
slideElement: 'li',
slideElement: 'div',
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev'
});
\ No newline at end of file
... ...
... ... @@ -171,7 +171,7 @@ function search(opt) {
break;
}
if (data.data === ' ') {
if (data === ' ') {
nav.end = true;
if (nav.reload) {
... ... @@ -179,9 +179,9 @@ function search(opt) {
}
} else {
if (nav.reload) {
$container.html(data.data);
$container.html(data);
} else {
$container.append(data.data);
$container.append(data);
}
lazyLoad($container.find('.lazy'));
... ... @@ -208,6 +208,7 @@ filter.registerCbFn(search);
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav.delegate('li', 'touchstart', function() {
var $this = $(this),
nav,
navType,
$active;
... ... @@ -229,6 +230,17 @@ $listNav.delegate('li', 'touchstart', function() {
filter.showFilter();
}
} else {
if ($this.hasClass('new')) {
navType = 'newest';
} else if ($this.hasClass('price')) {
navType = 'price';
} else if ($this.hasClass('discount')) {
navType = 'discount';
}
nav = navInfo[navType];
if ($this.hasClass('active')) {
//最新无排序切换
... ... @@ -240,34 +252,44 @@ $listNav.delegate('li', 'touchstart', function() {
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
$pre = $this; //更新pre为当前项
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; //切换排序
}
} else {
$active = $this.siblings('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
if ($active.hasClass('filter')) {
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
//若之前active项为筛选,则隐藏筛选面板
filter.hideFilter();
} else {
$pre = $active;
//切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
}
}
$active.removeClass('active');
$this.addClass('active');
$pre = $active;
}
if ($this.hasClass('new')) {
navType = 'newest';
} else if ($this.hasClass('price')) {
navType = 'price';
} else if ($this.hasClass('discount')) {
navType = 'discount';
}
if (navInfo[navType].reload) {
if (nav.reload) {
search();
}
}
... ...
... ... @@ -13,9 +13,7 @@ var winH = $(window).height(),
$goodList = $('.goods-list'),
loading = false,
page = 0,
index = 0,
num;
index = 0;
var swiper;
... ... @@ -31,7 +29,6 @@ $('#newarrival-nav').delegate('li', 'touchstart', function() {
var $this = $(this),
$content;
if ($this.hasClass('focus')) {
return;
}
... ... @@ -57,7 +54,8 @@ $(window).scroll(function () {
return;
}
loading = true;
num = $goodList.children('.good-info').length;
//num = $goodList.children('.good-info').length;
$.ajax({
type: 'GET',
url: '/product/newsale/selectNewSale',
... ... @@ -67,9 +65,7 @@ $(window).scroll(function () {
},
success: function(data) {
if (data === ' ') {
//opt.end = true;
loading = false;
loading = true;
return;
}
... ...
... ... @@ -10,14 +10,29 @@ var $ = require('yoho.zepto'),
var chosePanel = require('./chose-panel');
function docTouchEvt(e) {
var $tar = $(e.target);
if ($tar.closest('.opt-panel').length === 0) {
$('.opt-panel:not(.hide)').addClass('hide');
//
$(document).unbind('touchstart', docTouchEvt);
}
}
// function unbindDocTouchEvt(e) {
// $(document).unbind('touchstart', docTouchEvt);
// }
ellipsis.init();
lazyLoad($('.lazy'));
$('.name')[0].mlellipsis(2);
//checkbox toggle status
$('.checkbox').bind('touchstart', function() {
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$('.cart-goods').delegate('.checkbox', 'touchstart', function() {
var $this = $(this);
if ($this.hasClass('icon-cb-checked')) {
... ... @@ -25,9 +40,7 @@ $('.checkbox').bind('touchstart', function() {
} else {
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
}
});
$('.icon-edit').bind('touchstart', function() {
}).delegate('.icon-edit', 'touchstart', function() {
var id = $(this).closest('.shopping-cart-good').data('id');
$.ajax({
... ... @@ -42,5 +55,9 @@ $('.icon-edit').bind('touchstart', function() {
}
}
});
}).delegate('.icon-del', 'touchstart', function() {
$(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide');
$(document).bind('touchstart', docTouchEvt);
});
... ...
... ... @@ -5,5 +5,6 @@
img {
display: block;
width: 100%;
height: 100%;
}
}
\ No newline at end of file
... ...
.h5-footer {
font-size: 12px;
background-color: #fff;
z-index: 100;
a {
color: #000;
}
.user-name {
text-decoration: underline;
}
.op-row {
position: relative;
padding: 0 30rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
}
.back-to-top {
position: absolute;
right: 20rem / $pxConvertRem;
}
.copyright {
height: 60rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
text-align: center;
color: #666;
border-top: 1px solid #ccc;
background-color: #eee;
}
}
\ No newline at end of file
... ... @@ -81,7 +81,8 @@
padding-left: 5%;
width: 21.875%;
height: 140rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
a {
position: relative;
display: block;
... ...
... ... @@ -21,8 +21,8 @@
align-items:center;
justify-content: center;
img {
max-width: 80%;
max-height: 80%;
max-width: 100%;
max-height: 100%;
}
}
.linkbar {
... ...
@import "header-download", "banner-top","banner-center","banner-bottom", "side-nav", "floor-header", "hot-brands", "fine-brands", "creative-life", "plus-star", "footer", "maybe-like",
@import "header-download", "banner-top","banner-center","banner-bottom", "side-nav", "floor-header", "hot-brands", "fine-brands", "creative-life", "plus-star", "maybe-like",
"icons-enter","trendsetter-collocation",
"trend-topics","goods-category","hot-brands", "hot-category", "home-header";
... ... @@ -34,6 +34,3 @@
.overlay.show {
display: block;
}
.login-tip{
display: none;
}
\ No newline at end of file
... ...
... ... @@ -74,7 +74,7 @@
}
}
.interational {
.international {
display: block;
width: 200px;
padding: 5px 10px;
... ...
.good-detail-page {
.banner-top {
height: 660rem / $pxConvertRem;
overflow: hidden;
position: relative;
.swiper-pagination {
position: absolute;
left: 0;
right: 0;
bottom: 20rem / $pxConvertRem;
bottom: 40rem / $pxConvertRem;
text-align: center;
.pagination-inner {
display: inline-block;
... ... @@ -21,26 +25,147 @@
span.swiper-active-switch {
opacity: 1;
}
.swiper-pagination-bullet-active {
background-color: #000000;
}
}
}
}
.good-banner-swiper {
height: 598rem / $pxConvertRem;
overflow: hidden;
ul {
position: relative;
height: 100%;
li {
float: left;
height: 100%;
img {
width: 448rem / $pxConvertRem;
height: 100%;
}
}
.banner-swiper {
height: 600rem / $pxConvertRem;
width: 448rem / $pxConvertRem;
margin: 30rem / $pxConvertRem 96rem / $pxConvertRem;
position: relative;
overflow: hidden;
ul {
position: relative;
height: 100%;
li {
float: left;
height: 100%;
}
}
}
}
.detailName {
font-size: 28rem / $pxConvertRem;
color: #222222;
padding-bottom: 6px;
text-align: center;
}
.detailTitle {
font-size: 36rem / $pxConvertRem;
text-align: center;
padding-bottom: 2px;
font-weight: bold;
}
.vipLevel {
color: #999999;
text-align: center;
padding-bottom: 15px;
}
.detailToBuy {
padding: 0 10px;
margin-bottom: 20px;
text-align: center;
overflow: hidden;
.AddFavorite {
background-color: #cccccc;
width: 110rem / $pxConvertRem;
height: 100rem / $pxConvertRem;
line-height: 100rem / $pxConvertRem;
font-size: 1.7em;
color: white;
margin-right: 20rem / $pxConvertRem;
overflow: hidden;
float: left !important;
}
.toBuyNow {
height: 50px;
line-height: 50px;
color: white;
display: block;
margin-left: 2.4em;
font-size: 1.84em;
overflow: hidden;
font-weight: bold;
background-color: #ed0010;
}
}
.discountNotice {
margin-bottom: 20px;
p {
height: 44px;
line-height: 44px;
padding: 0 10px;
margin-bottom: 1px;
font-size: 12px;
background-color: #eeeeee;
}
}
.detailToShop {
margin: 0 10px 20px;
padding: 10px;
height: 47px;
line-height: 47px;
overflow: hidden;
background-color: #eee;
.fz14 {
font-size: 1.2em;
float: right !important;
}
}
.detailSize {
padding: 0 10px;
margin-bottom: 20px;
h3 {
text-align: center;
font-size: 1.3em;
margin-bottom: 5px;
span {
font-size: 0.6em;
display: block;
text-transform: uppercase;
}
}
table {
background-color: white;
width: 100%;
}
td {
text-align: left;
padding: 0.4em 0.8em;
border: 1px solid white;
background-color: #eee;
font-size: 1em;
}
}
.detail-img {
padding: 0 10px;
margin-bottom: 10px;
}
}
... ...
... ... @@ -105,19 +105,38 @@
}
.opt-panel {
display: none;
position: absolute;
width: 220rem / $pxConvertRem;
height: 190rem / $pxConvertRem;
right: 0;
color: #fff;
> div {
float: left;
box-sizing: border-box;
width: 110rem / $pxConvertRem;
height: 100%;
text-align: center;
padding: 40rem / $pxConvertRem 20rem / $pxConvertRem 0;
font-size: 15px;
}
span {
display: block;
}
.put-in-favorite {
background: #bbb;
}
.del {
background: #999;
.iconfont {
margin-bottom: 20rem / $pxConvertRem;
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,10 @@
.icon-checkbox:before { content: "\e61c"; }
.icon-cb-checked:before { content: "\e61d"; }
.shopping-cart-page {
padding-bottom: 120rem / $pxConvertRem;
}
.cart-nav {
height: 30rem / $pxConvertRem;
color: #c6c6c6;
... ... @@ -96,6 +100,7 @@
padding: 20rem / $pxConvertRem;
height: 120rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
background: #fff;
.iconfont {
position: absolute;
... ...
... ... @@ -22,7 +22,7 @@
<a class="qq" href={{qqLoginUrl}}></a>
</div>
</div>
<a class="interational" href={{interationalUrl}}>Interational Customer</a>
<a class="international" href={{internationalUrl}}>International Customer</a>
<div class="login-tip">
<div class="info-icon"></div>
Yoho!Family账号可登录YOHO!有货
... ...
{{> layout/header}}
<div class="login-interational-page passport-page yoho-page">
<div class="login-international-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
{{> passport/country_list}}
... ...
... ... @@ -3,6 +3,122 @@
{{# bannerTop}}
{{> product/banner_swiper_arrow}}
{{/ bannerTop}}
<h2 class="detailName">CHUMS 男式纯色logo休闲长袖T恤</h2>
<h1 class="detailTitle">¥298.00</h1>
<div class="vipLevel"><span>银卡¥284.00</span>丨<span>金卡¥269.00</span>丨<span>白金¥263.00</span></div>
<div class="detailToBuy">
<a href="javascript:void(0);" class="AddFavorite" id="favorite" fav="0" name="collect" product="269003"><em class="icon-uni31"></em></a>
<a href="http://m.yohobuy.com/product/buy_269003_348031.html" name="buy" class="toBuyNow">立即购买</a>
</div>
<div class="discountNotice">
<p><span>打折</span>【深秋优品加持】折上满¥59975折</p>
<p><span>打折</span>【深秋优品加持】折上满¥39985折</p>
<p><span>加价购</span>【全场29元加价购】</p>
<p><span>加价购</span>【全场49元加价购】</p>
<p><span>加价购</span>【全场69元加价购】</p>
</div>
<div class="detailToShop">
<a href="http://chums.m.yohobuy.com" title="CHUMS">
<span class="fn-right fz14">进入店铺 <em class="icon-uni3E"></em></span>
<img class="lazy" src="http://img12.static.yhbimg.com/brandLogo/2015/08/14/11/022c089923cc22b3b068f862dcd3b9d454.jpg?imageView/1/w/47/h/47" data-original="http://img12.static.yhbimg.com/brandLogo/2015/08/14/11/022c089923cc22b3b068f862dcd3b9d454.jpg?imageView/1/w/47/h/47" alt="" width="47" style="display: inline-block;">
CHUMS </a>
</div>
<div class="detailSize detailGoodsInfo">
<h3>商品信息<span>product info</span></h3>
<table>
<tbody>
<tr>
<td>编号:51149815</td>
<td>颜色:白色</td>
</tr>
<tr> <td>领型:圆领</td>
<td>衣长:适中</td>
</tr><tr> <td>袖长:长袖</td>
<td>版型:正常</td>
</tr><tr> <td>厚度:中</td>
<td>经典款型:LOGOT恤</td>
</tr><tr> <td>袖型:正常</td>
<td>肩型:落肩</td>
</tr> <tr>
<td colspan="2">“CHUMS”这一品牌名称,是由Mike 先生好友的爱犬“Chumley”的名字演变而来,其中蕴含了Mike先生希望透过这一品牌,让顾客感受到生活的温馨与美好的心情。
中南美的渔夫们用西班牙语亲切地称这种鸟作蓝脚鲣鸟。由于其快乐、悠闲的风格与CHUMS品牌的理念完全一致,便采用它作为该品牌的吉祥物。
从当初的一根眼镜绳,经过30年的发展, CHUMS已经成为全球时尚市场上的主力军,并将产品线扩大到了包、帽子和服饰。
CHUMS的所有产品一直秉承 “舒适、乐趣、品质”的设计理念,并且融合都市时尚和户外技术装备的特点,所以在美国和欧洲收到了广大消费者的欢迎,特别是在日本更是家喻户晓。
</td>
</tr>
</tbody>
</table>
</div>
<div class="detailSize">
<h3>尺码信息<span>size info</span></h3>
<div id="size_info" class="overthrow">
<table>
<thead> <tr>
<th style="width:100px;">吊牌尺码</th><th style="width:100px;">后衣长</th><th style="width:100px;">前衣长</th><th style="width:100px;">袖长</th><th style="width:100px;">胸围</th><th style="width:100px;">肩宽</th> </tr>
</thead> <tbody> <tr>
<td>S</td><td>60</td><td>60</td><td>56</td><td>92</td><td>41</td> </tr>
<tr>
<td>M</td><td>63</td><td>63</td><td>57</td><td>96</td><td>43</td> </tr>
<tr>
<td>L</td><td>67</td><td>67</td><td>58</td><td>100</td><td>45</td> </tr>
<tr>
<td>XL</td><td>69</td><td>69</td><td>59</td><td>104</td><td>47</td> </tr>
</tbody>
</table>
</div><p class="scrollinfo">提示:左滑查看完整表格信息</p>
</div>
<div class="detail-img">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/31/11/028fa13126b19a838b9d642f96bf5976b2.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/31/11/028fa13126b19a838b9d642f96bf5976b2.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/31/11/0293b0e5966a9b190a349d0a5f13084c42.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/31/11/0293b0e5966a9b190a349d0a5f13084c42.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2015/07/31/11/014968ff8c6b6480edd9cbbd1e3a4c8a96.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2015/07/31/11/014968ff8c6b6480edd9cbbd1e3a4c8a96.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2015/07/31/11/019c0a096996a05125713f1cf2ff62b6f1.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2015/07/31/11/019c0a096996a05125713f1cf2ff62b6f1.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2015/07/31/11/0109068bd71afb7e40ac326803d145f93f.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2015/07/31/11/0109068bd71afb7e40ac326803d145f93f.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2014/01/28/17/01417067dcf7379d6a06768c62ee961c00.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2014/01/28/17/01417067dcf7379d6a06768c62ee961c00.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/06/11/0242daecfc6d31047b123da2a7861a0bb4.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/06/11/0242daecfc6d31047b123da2a7861a0bb4.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/06/11/0270b729a9aab25dfbcbabc9498a6e4bda.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/06/11/0270b729a9aab25dfbcbabc9498a6e4bda.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/06/11/026cff8c4e0a690afa9cb70e7ba11454c6.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/06/11/026cff8c4e0a690afa9cb70e7ba11454c6.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/31/11/023c68cbd9776ff83ba881f8314b366877.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/31/11/023c68cbd9776ff83ba881f8314b366877.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/31/11/02890fac8400e8d302c9d3caeca8634c18.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/31/11/02890fac8400e8d302c9d3caeca8634c18.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/31/11/0257faa55e04a9e44b8edff8f2e0a663b0.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/31/11/0257faa55e04a9e44b8edff8f2e0a663b0.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2014/01/28/17/01417067dcf7379d6a06768c62ee961c00.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2014/01/28/17/01417067dcf7379d6a06768c62ee961c00.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/06/11/02226e365addb260fb596ad2a552daac7e.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/06/11/02226e365addb260fb596ad2a552daac7e.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/06/11/02b7f43227b5ba4be339b85b47702260f0.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/06/11/02b7f43227b5ba4be339b85b47702260f0.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/06/11/025d5886aa4377677e044022145ab6ca3d.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/06/11/025d5886aa4377677e044022145ab6ca3d.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/06/11/029c6d31e9aaf104421e193ac7cdd64437.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/06/11/029c6d31e9aaf104421e193ac7cdd64437.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/31/11/02a8526a96a29f212711bf910054b40d6b.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/31/11/02a8526a96a29f212711bf910054b40d6b.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/31/11/02efd446f5735d19b4648beddf2a31fa60.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/31/11/02efd446f5735d19b4648beddf2a31fa60.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img02.static.yohobuy.com/product/2015/07/31/11/026eddbf3d6332ea641e91ce7515ebcc3a.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img02.static.yohobuy.com/product/2015/07/31/11/026eddbf3d6332ea641e91ce7515ebcc3a.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2014/01/28/17/01417067dcf7379d6a06768c62ee961c00.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2014/01/28/17/01417067dcf7379d6a06768c62ee961c00.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2015/07/06/11/01cd92a99779901ce39b9e4c05e72caa35.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2015/07/06/11/01cd92a99779901ce39b9e4c05e72caa35.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2015/07/06/11/01cf2362d0233a0c00539e3ad6c8548afe.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2015/07/06/11/01cf2362d0233a0c00539e3ad6c8548afe.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
<img class="lazy" src="http://img01.static.yohobuy.com/product/2015/07/06/11/01bacfb07355ff35a62ad1cfafb81eab75.jpg?imageMogr2/thumbnail/640x5000" data-original="http://img01.static.yohobuy.com/product/2015/07/06/11/01bacfb07355ff35a62ad1cfafb81eab75.jpg?imageMogr2/thumbnail/640x5000" alt="MACROPUS 绝对机能系列双肩包" style="display: block;">
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -23,7 +23,7 @@
</div>
{{/ brandWay}}
{{# brand}}
{{# brandHome}}
<div id="brand-header" class="brand-header" data-id={{id}}>
<img class="lazy" data-original={{banner}}>
<a class="btn-intro" href="javascript:void(0);">
... ... @@ -47,7 +47,7 @@
<span class="iconfont close-intro">&#xe623;</span>
</div>
</div>
{{/ brand}}
{{/ brandHome}}
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
... ... @@ -82,17 +82,44 @@
</li>
</ul>
<div id="goods-container" class="goods-container">
<div class="new-goods">
<div class="new-goods container">
{{# new}}
{{> good}}
{{/ new}}
</div>
<div class="price-goods hide"></div>
<div class="discount-goods hide"></div>
<div class="price-goods container hide"></div>
<div class="discount-goods container hide"></div>
{{> filter}}
</div>
{{#if brand}}
<input id="brand" type="hidden" value={{brand}}>
{{/if}}
{{#if gender}}
<input id="gender" type="hidden" value={{gender}}>
{{/if}}
{{#if msort}}
<input id="msort" type="hidden" value={{msort}}>
{{/if}}
{{#if color}}
<input id="color" type="hidden" value={{color}}>
{{/if}}
{{#if size}}
<input id="size" type="hidden" value={{size}}>
{{/if}}
{{#if price}}
<input id="price" type="hidden" value={{price}}>
{{/if}}
{{#if discount}}
<input id="discount" type="hidden" value={{discount}}>
{{/if}}
{{/ goodList}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{# new}}
{{> good}}
{{/ new}}
\ No newline at end of file
... ...
{{>layout/header}}
<div class="newarrival-page yoho-page">
{{# headerBanner}}
{{> home/banner_top}}
{{> product/banner_swipe_and_single}}
{{/ headerBanner}}
<ul id="newarrival-nav" class="newarrival-nav clearfix">
... ...
{{>layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> home/banner_top}}
{{> product/banner_swipe_and_single}}
{{/ headerBanner}}
<ul id="discount-nav" class="discount-nav clearfix">
... ...
{{# name}}
<div class="floor-header">
<h2>{{name}}</h2>
<h2>{{.}}</h2>
</div>
{{/ name}}
... ...
... ... @@ -49,10 +49,10 @@
seajs.use('js/passport/login/login');
</script>
{{/if}}
{{#if loginInterational}}
<script>
seajs.use('js/passport/login/interational');
</script>
{{#if loginInternational}}
<script>
seajs.use('js/passport/login/international');
</script>
{{/if}}
{{!-- 密码找回 --}}
{{#if backEmail}}
... ...
{{#if list}}
<div class="banner-top">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper">
{{# list}}
<li class="swiper-slide">
<a href="{{url}}">
<img src="{{img}}" alt="">
</a>
</li>
{{/ list}}
</ul>
</div>
<div class="swiper-pagination">
<div class="pagination-inner">
</div>
</div>
</div>
{{^}}
<a href={{url}}>
<img class="img" src={{img}}>
</a>
{{/if}}
\ No newline at end of file
... ...
<div class="banner-top">
<div class="good-banner-swiper swiper-container">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper">
{{# list}}
<li class="swiper-slide">
... ...
... ... @@ -47,13 +47,14 @@
</p>
</div>
</div>
<div class="opt-panel">
<div class="opt-panel hide">
<div class="put-in-favorite">
<span class="iconfont">&#xe622;</span>
移入收藏夹
<span>移入</span>
收藏夹
</div>
<div class="del">
<span class="iconfont">&#xe61a;</span>
<span class="iconfont">&#xe626;</span>
删除
</div>
</div>
... ...
... ... @@ -25,7 +25,6 @@ class BoysController extends AbstractAction
// 渲染模板并输出
$this->_view->display('index', array(
'searchUrl' => '/search',
'boysHomePage' => true,
'maybeLike' => true,
'content' => Index\HomeModel::getBoysFloor()
... ...
... ... @@ -25,7 +25,6 @@ class GirlsController extends AbstractAction
// 渲染模板并输出
$this->_view->display('index', array(
'searchUrl' => '/search',
'grilsHomePage' => true,
'maybeLike' => true,
'content' => Index\HomeModel::getGirlsFloor()
... ...
... ... @@ -25,7 +25,6 @@ class KidsController extends AbstractAction
// 渲染模板并输出
$this->_view->display('index', array(
'searchUrl' => '/search',
'kidsHomePage' => true,
'maybeLike' => true,
'content' => Index\HomeModel::getKidsFloor()
... ...
... ... @@ -25,7 +25,6 @@ class LifestyleController extends AbstractAction
// 渲染模板并输出
$this->_view->display('index', array(
'searchUrl' => '/search',
'lifestyleHomePage' => true,
'maybeLike' => true,
'content' => Index\HomeModel::getLifestyleFloor()
... ...
... ... @@ -20,7 +20,6 @@ use Configs\CacheConfig;
class HomeModel
{
/* 频道选择页取背景图片的位置码 */
const CODE_BG = '7ba9118028f9b22090b57341487567eb';
/* 男生楼层资源的位置码 */
... ... @@ -72,7 +71,7 @@ class HomeModel
*/
public static function setSwitchToCookie($cookie)
{
setcookie('_Channel', $cookie, time() + 86400 * 300, '/', '.' . SITE_DOMAIN);
setcookie('_Channel', $cookie, time() + 86400 * 300, '/', COOKIE_DOMAIN);
}
/**
... ...
<?php
namespace Product;
use Configs\CacheConfig;
use LibModels\Wap\Product\NewsaleData;
use Plugin\DataProcess\NewSaleProcess;
use Plugin\Helpers;
/**
* 新品到着相关的模板数据模型
*
* @name NewsaleModel
* @package models/Product
* @copyright yoho.inc
* @version 1.0 (2015-10-22 17:23:51)
* @author fei.hong <fei.hong@yoho.cn>
*/
class NewsaleModel
{
/* 获取新品到着顶部焦点图的位置码 */
const CODE_FOCUS_NEW = 'a7989369aa86681c678bc40f171b8f1d';
/* 获取折扣专区顶部焦点图的位置码 */
const CODE_FOCUS_SALE = 'e9c9be32d72e2906d404a72ee24cb523';
/**
* 获取新品到着的焦点图资源数据
*
* @return array
*/
public static function getNewFocus()
{
$result = array();
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, 'master');
if (!empty($result)) {
return $result;
}
}
// 调用接口获取数据并封装
$newsale = NewsaleData::getNewsaleFocus(self::CODE_FOCUS_NEW);
if (isset($newsale['code']) && isset($newsale['data'][0]['data'][0])) {
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, $result);
}
}
return $result;
}
/**
* 获取折扣专区的焦点图资源数据
*
* @return array
*/
public static function getSaleFocus()
{
$result = array();
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, 'master');
if (!empty($result)) {
return $result;
}
}
// 调用接口获取数据并封装
$newsale = NewsaleData::getNewsaleFocus(self::CODE_FOCUS_SALE);
if (isset($newsale['code']) && isset($newsale['data'][0]['data'][0])) {
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, $result);
}
}
return $result;
}
/**
* 获取新品到着的商品列表
*
* @param int $channel 1:男生,2:女生,3:潮童,4:创意生活
* @param int $limit 查询的限制数
* @return array
*/
public static function getNewProducts($channel, $limit)
{
$result = array();
$products = array();
/* 根据频道查询商品列表 */
switch (intval($channel)) {
case 1: // 男生
$products = NewsaleData::getNewProducts('1,3', 1, $limit);
break;
case 2: // 女生
$products = NewsaleData::getNewProducts('2,3', 2, $limit);
break;
case 3: // 潮童
$products = NewsaleData::getNewProducts('1,2,3', 3, $limit);
break;
case 4: // 创意生活
$products = NewsaleData::getNewProducts('1,2,3', 4, $limit);
break;
}
/* 格式化商品数据 */
if (!empty($products)) {
$result = NewSaleProcess::newSaleData($products);
}
return $result;
}
/**
* 获取折扣专区的商品列表
*
* @param int $channel 1:男生,2:女生,3:潮童,4:创意生活
* @param int $limit 查询的限制数
* @return array
*/
public static function getSaleProducts($channel, $limit)
{
$result = array();
$products = array();
/* 根据频道查询商品列表 */
switch (intval($channel)) {
case 1: // 男生
$products = NewsaleData::getSaleProducts('1,3', 1, $limit);
break;
case 2: // 女生
$products = NewsaleData::getSaleProducts('2,3', 2, $limit);
break;
case 3: // 潮童
$products = NewsaleData::getSaleProducts('1,2,3', 3, $limit);
break;
case 4: // 创意生活
$products = NewsaleData::getSaleProducts('1,2,3', 4, $limit);
break;
}
/* 格式化商品数据 */
if (!empty($products)) {
$result = NewSaleProcess::newSaleData($products);
}
return $result;
}
}
... ...
... ... @@ -77,15 +77,21 @@ class DetailController extends AbstractAction
}
// 通过SKN获取商品信息
$product = ListData::productInfoBySkns($skns);
foreach ($product['data']['product_list'] as $i => $goods) {
// 最多显示4个
if ($i > 3) {
break;
if (!empty($product['data']['product_list'])) {
foreach ($product['data']['product_list'] as $i => $goods) {
// 最多显示4个
if ($i > 3) {
break;
}
$good[] = Helpers::formatProduct($goods, false);
}
$good[] = Helpers::formatProduct($goods, false);
}
// 没有商品
if (!isset($i)) {
continue;
}
// 单个商品
if ($i === 0) {
elseif ($i === 0) {
$build['relatedReco'] = $good[0];
}
// 多个商品
... ... @@ -106,10 +112,12 @@ class DetailController extends AbstractAction
}
// 通过SKN获取商品信息
$product = ListData::productInfoBySkns($skns);
foreach ($product['data']['product_list'] as $i => $goods) {
$good['goods'][] = Helpers::formatProduct($goods, false);
if (!empty($product['data']['product_list'])) {
foreach ($product['data']['product_list'] as $i => $goods) {
$good['goods'][] = Helpers::formatProduct($goods, false);
}
$build['collocation'][] = $good;
}
$build['collocation'][] = $good;
}
}
... ...
... ... @@ -18,6 +18,7 @@ class ListController extends AbstractAction
public function indexAction()
{
$this->setTitle('逛');
$this->setNavHeader('逛', true, SITE_DOMAIN);
$category = ListData::category();
$articleGroup = array();
... ... @@ -58,6 +59,11 @@ class ListController extends AbstractAction
$data['guang']['swiper'] = array();
$data['guang']['infos'] = array();
foreach ($articleGroup as $id => $value) {
// 判断是否有内容
if (empty($value['list'])) {
continue;
}
// 轮番广告
if ($id == 0) {
$build = array();
... ... @@ -101,6 +107,9 @@ class ListController extends AbstractAction
$this->error();
}
$this->setTitle($tag);
$this->setNavHeader($tag, true, SITE_DOMAIN);
$data = array();
// 模板中使用JS的标识
$data['guangList'] = true;
... ... @@ -115,8 +124,6 @@ class ListController extends AbstractAction
// 分页需要的参数
$data['guang']['tag'] = $tag;
$this->setTitle($tag);
$this->_view->display('list', $data);
}
... ... @@ -126,8 +133,6 @@ class ListController extends AbstractAction
public function editorAction()
{
$id = $this->get('id');
$uid = $this->getUid();
$udid = $this->getUdid();
// 获取作者信息
$author = ListData::author($id);
... ... @@ -137,6 +142,10 @@ class ListController extends AbstractAction
}
$this->setTitle('编辑简介');
$this->setNavHeader('编辑简介', true, SITE_DOMAIN);
$uid = $this->getUid();
$udid = $this->getUdid();
$data = array();
// 模板中使用JS的标识
... ... @@ -185,7 +194,7 @@ class ListController extends AbstractAction
/* 判断参数是否有效 */
$tag = $this->get('tag');
$sortId = $this->get('type');
$sortId = $this->get('type', 0);
$page = $this->get('page');
$gender = $this->get('gender');
$authorId = $this->get('authorId');
... ... @@ -203,7 +212,7 @@ class ListController extends AbstractAction
/* 获取资讯文章列表 */
$uid = $this->getUid();
$udid = $this->getUdid();
$article = ListData::article($gender, 0, $uid, $udid, $page, $tag, $authorId);
$article = ListData::article($gender, $sortId, $uid, $udid, $page, $tag, $authorId);
if (empty($article['data']['list']['artList'])) {
break;
}
... ...
... ... @@ -122,8 +122,8 @@ class BackController extends AbstractAction
'countryCode' => '+86'
);
// 生成HTML (mobileback.html)
$this->_view->html('mobileback.html');
// 生成HTML (phoneback.html)
$this->_view->html('phoneback');
$this->_view->display('mobile', $data);
}
... ...
... ... @@ -28,7 +28,7 @@ class LoginController extends AbstractAction
'aliLoginUrl' => '/passport/login/alipay', // 支付宝快捷登录的URL链接
'weiboLoginUrl' => '/passport/login/sina', // 微博登录的URL链接
'qqLoginUrl' => '/passport/login/qq', // 腾讯QQ登录的URL链接
'interationalUrl' => '/login.html', // 国际号登录的URL链接
'internationalUrl' => '/login.html', // 国际号登录的URL链接
'phoneRetriveUrl' => '/passport/back/mobile', // 通过手机号找回密码的URL链接
'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接
);
... ... @@ -47,7 +47,7 @@ class LoginController extends AbstractAction
$this->setTitle('国际账号登录');
$data = array();
$data['loginInterational'] = true; // 模板中使用JS的标识
$data['loginInternational'] = true; // 模板中使用JS的标识
$data['backUrl'] = '/'; // 返回的URL链接
$data['headerText'] = '登录'; // 头部信息
$data['isPassportPage'] = true; // 模板中模块标识
... ...
... ... @@ -15,20 +15,25 @@ class DetailController extends AbstractAction
{
$data = array (
'goodDetail' => true,
'pageHeader' => array (
'navBack' => 'sss ',
'navHome' => 'sss ',
'navTitle' => '商品详情'
),
'bannerTop' => array (
'list' => array (
array (
'url' => '',
'img' => 'http://img10.static.yhbimg.com/adpic/2015/10/15/10/01c161398d3baec2868abe85e26ba1a71d.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/027c45cdc03e23c367ec0ff3d29b7c3f79.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/022e2ac6daa33fc3cb8a0f04025a35994f.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
)
array (
'url' => '',
'img' => 'http://img10.static.yhbimg.com/goodsimg/2015/10/12/04/0100ba0d8512c3af064873f5a1e3805e45.jpg?imageMogr2/thumbnail/450x600/extent/450x600/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img11.static.yhbimg.com/goodsimg/2015/10/12/03/01bf4cf4444035a1930d33a9d0f8bff4fa.jpg?imageMogr2/thumbnail/450x600/extent/450x600/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img11.static.yhbimg.com/goodsimg/2015/10/12/03/01d7ef2f624eeea15e80bb374607aea317.jpg?imageMogr2/thumbnail/450x600/extent/450x600/background/d2hpdGU=/position/center/quality/90'
)
)
)
);
... ...
... ... @@ -3,6 +3,7 @@
use Action\AbstractAction;
use LibModels\Wap\Product\SearchData;
use LibModels\Wap\Category\BrandData;
use LibModels\Wap\Category\ClassData;
use Plugin\DataProcess\ListProcess;
use Plugin\Helpers;
... ... @@ -11,33 +12,115 @@ use Plugin\Helpers;
*/
class ListController extends AbstractAction
{
/**
* 搜索列表页
*/
public function indexAction()
{
$data = array(
'goodListPage' => true,
'goodList' => array(
)
);
$query = $this->get('query', null);
$brand = $this->get('brand', null);
$gender = $this->get('gender', null);
$p_d = $this->get('p_d', null);
$misort = $this->get('misort', null);
$msort = $this->get('msort', null);
$data = array(
'pageHeader' => array(
'navBack' => true,
'navTitle' => '搜索',
'navHome' => '/'
),
'goodListPage' => true,
'goodList' => array()
);
// 如果存在搜索字符串就显示搜索栏
if(!is_null($query))
{
$data['search'] = array(
'default' => $query
);
}
// 查询数据
$listData = SearchData::searchLiDatas(null, $brand, $gender, $p_d, $misort, $msort);
$listData = SearchData::searchLiDatas($query, $brand, $gender, $p_d, $misort, $msort);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
// 如果存在品牌信息就显示品牌字段
if(isset($tmpData['brand']) && !empty($tmpData['brand']))
{
$brandData = $tmpData['brand'];
$data['brandWay'] = array(
'url' => '/product/list/brand?brand='.$brandData['id'],
'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
'name' => $brandData['brand_name']
);
}
$data['goodList'] = ListProcess::getListData($tmpData);
}
$this->_view->display('index', $data);
}
/**
* Ajax异步筛选请求
*/
public function searchAction()
{
if($this->isAjax())
{
$query = $this->get('query', null);
$brand = $this->get('brand', null);
$gender = $this->get('gender', null);
$p_d = $this->get('p_d', null);
$misort = $this->get('misort', null);
$msort = $this->get('msort', null);
$order = $this->get('order', null);
$type = $this->get('type', '');
switch ($type) {
case 'price':
$order = ($order == 0) ? 's_p_desc' : 's_p_asc';
break;
case 'discount':
$order = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
break;
case 'newest':
default:
$order = ($order == 0) ? 's_t_desc' : 's_t_asc';
break;
}
$data = array();
// 查询数据
$listData = SearchData::searchLiDatas($query, $brand, $gender, $p_d, $misort, $msort, $order);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
unset($tmpData['filter']);// 不要筛选条件的数据
$data = ListProcess::getListData($tmpData);
}
if(empty($data))
{
echo ' ';
}
else
{
$this->_view->display('list', $data);
}
}
}
/**
* 品牌商品列表页
*/
public function brandAction()
{
$brand = $this->get('brand', null);
... ... @@ -50,6 +133,7 @@ class ListController extends AbstractAction
$data = array(
'pageHeader' => array(
'navBack' => true,
'navHome' => '/'
),
'goodListPage' => true,
... ... @@ -88,5 +172,39 @@ class ListController extends AbstractAction
$this->_view->display('index', $data);
}
/**
* 品类商品列表页
*/
public function classAction()
{
$brand = $this->get('brand', null);
$gender = $this->get('gender', null);
$sort = $this->get('sort', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('p_d', null);
$data = array(
'pageHeader' => array(
'navBack' => true,
'navHome' => '/'
),
'goodListPage' => true,
'goodList' => array()
);
// 查询数据
$listData = ClassData::selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
$data['goodList'] = ListProcess::getListData($tmpData);
}
$this->_view->display('index', $data);
}
}
... ...
... ... @@ -10,33 +10,54 @@ use Plugin\DataProcess\NewSaleProcess;
class NewsaleController extends AbstractAction
{
/**
* 新品到着
*
* @param int channel 1:男生,2:女生,3:潮童,4:创意生活
*/
public function indexAction()
{
$this->setTitle('新品到着');
$this->setNavHeader('新品到着');
$data = array(
'newArrival' => true,
'pageHeader' => array(
'navBack' => true,
'navTitle' => '新品到着',
'navHome' => '/'
)
);
$channel = $this->get('channel', 1);
if (!is_numeric($channel)) {
$this->error();
}
// 新品到着顶部焦点图
$focusData = NewsaleData::getNewsaleFocus('a7989369aa86681c678bc40f171b8f1d');
// 处理返回的数据
$focus = array();
if (isset($focusData['code']) && $focusData['code'] == 200) {
$focus = $focusData['data'];
$data = array();
$data['newArrival'] = true;
$data['headerBanner'] = \Product\NewsaleModel::getNewFocus();
$goodsList = \Product\NewsaleModel::getNewProducts($channel, 20);
if (!empty($goodsList)) {
$data += $goodsList;
}
$this->_view->display('new', $data);
}
// 批量获取新品到着商品数据
$products = NewsaleData::getNewProducts('1,3', 1, 60);
// 添加商品数据
$data += NewSaleProcess::newSaleData($focus, $products);
/**
* 折扣专区
*
* @param int channel 1:男生,2:女生,3:潮童,4:创意生活
*/
public function discountAction()
{
$this->setTitle('折扣专区');
$this->setNavHeader('Sale');
$this->_view->display('new', $data);
$channel = $this->get('channel', 1);
if (!is_numeric($channel)) {
$this->error();
}
$data = array();
$data['discount'] = true;
$data['headerBanner'] = \Product\NewsaleModel::getNewFocus();
$goodsList = \Product\NewsaleModel::getSaleProducts($channel, 20);
if (!empty($goodsList)) {
$data += $goodsList;
}
$this->_view->display('sale', $data);
}
/**
... ... @@ -56,61 +77,19 @@ class NewsaleController extends AbstractAction
$p_d = $this->get('p_d', null);
$channel = $this->get('channel', '1');
$dayLimit = $this->get('dayLimit', '1');
$limit = $this->get('limit', 50);
$limit = $this->get('limit', 20);
$page = $this->get('page', 1);
$data = NewsaleData::selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page);
$data = NewsaleData::selectNewSaleProducts(
$gender, $brand, $sort, $color,
$size, $price, $p_d, $channel, $dayLimit, $limit, $page
);
$result = NewSaleProcess::selectData($data);
$this->_view->display('product', $result);
} else {
echo ' ';
}
}
/**
* 折扣专区
*/
public function discountAction()
{
$this->setTitle('折扣专区');
$data = array(
'discount' => true,
'pageHeader' => array(
'navBack' => true,
'navTitle' => 'SALE',
'navHome' => '/'
)
);
// 折扣专区顶部焦点图
$focusData = NewsaleData::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
// 处理返回的数据
$focus = array();
if (isset($focusData['code']) && $focusData['code'] == 200) {
$focus = $focusData['data'];
}
// 折扣专区商品数据
$products = NewsaleData::getSaleProducts('1,3', 1);
// 更新tabs
$tabs = array();
foreach (array_keys($products) as $key => $value) {
$tabItem = array();
$tabItem['title'] = $value;
if ($key === 0) {
$tabItem['focus'] = true;
}
$tabs[] = $tabItem;
}
$data['tabs'] = $tabs;
// 添加商品数据
$data += NewSaleProcess::newSaleData($focus, $products);
/* echo '<pre>';
print_r($data);exit; */
$this->_view->display('sale', $data);
}
}
... ...
... ... @@ -47,6 +47,11 @@ class RecomController extends AbstractAction
if (empty($recom['data']['product_list'])) {
break;
}
/* 判断是否已没有数据 */
if (intval($page) > intval($recom['data']['page_total'])) {
break;
}
/* 构建商品数据 */
$data = array();
... ... @@ -54,8 +59,8 @@ class RecomController extends AbstractAction
$data['goods'][] = Helpers::formatProduct($value, true);
}
$this->_view->display('maylike', $data);
}
while (false);
} while (false);
echo ' ';
}
... ... @@ -81,19 +86,24 @@ class RecomController extends AbstractAction
}
/* 取可能喜欢的数据 */
$recom = RecomData::mayLikeKids();
$recom = RecomData::mayLikeKids($page);
if (empty($recom['data']['product_list'])) {
break;
}
/* 判断是否已没有数据 */
if (intval($page) > intval($recom['data']['page_total'])) {
break;
}
/* 构建模板需要的商品数据 */
$data = array();
foreach ($recom['data']['product_list'] as $value) {
$data['goods'][] = Helpers::formatProduct($value, true);
}
$this->_view->display('maylike', $data);
}
while (false);
} while (false);
echo ' ';
}
... ... @@ -137,8 +147,8 @@ class RecomController extends AbstractAction
$data['goodsContainer'][] = $build;
}
$this->_view->display('maylikelife', $data);
}
while (false);
} while (false);
echo ' ';
}
... ... @@ -178,5 +188,4 @@ class RecomController extends AbstractAction
// $this->echoJson($data);
// }
// }
}
... ...
<?php
use Yaf\Application;
define('SITE_DOMAIN', 'm.dev.yohobuy.com'); // 网站主域名
define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名
define('SITE_MAIN', 'http://m.dev.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.m.dev.yohobuy.com'); // COOKIE作用域
define('USE_CACHE', false); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__));
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH)));
... ...
<?php
use Yaf\Application;
define('SITE_DOMAIN', 'buy.test.yoho.cn'); // 网站主域名
define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名
define('SITE_MAIN', 'http://buy.test.yoho.cn'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.test.yoho.cn'); // COOKIE作用域
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__));
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH)));
... ...
<?php
use Yaf\Application;
define('SITE_DOMAIN', 'wap.yohobuy.com'); // 网站主域名
define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名
define('SITE_MAIN', 'http://wap.m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.m.yohobuy.com'); // COOKIE作用域
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__));
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH)));
... ...