Authored by 梁志锋

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

... ... @@ -100,6 +100,18 @@ class AbstractAction extends Controller_Abstract
{
return $this->_request->getParam($key, $default);
}
/**
* 封装一下获取服务器的参数
*
* @param String $key
* @param mixed $default
* @return mixed
*/
protected function server($key, $default = null)
{
return $this->_request->getServer($key, $default);
}
/**
* 关闭模板自动渲染
... ...
<?php
namespace LibModels\Wap\Category;
use Api\Yohobuy;
... ... @@ -15,26 +16,28 @@ use Api\Sign;
*/
class FocusData
{
/**
* 获取关注数据
*
* @param integ $uid 用户ID
* @param string $gender 性别
* @param integer $limit 读取数目限制,默认为10
* @param integer $page 读取分页限制,默认为1
* @return array 关注数据
*/
/**
* 获取关注数据
*
* @param integ $uid 用户ID
* @param string $gender 性别
* @param integer $limit 读取数目限制,默认为10
* @param integer $page 读取分页限制,默认为1
* @return array 关注数据
*/
public static function getFocusData($uid, $gender, $limit = 10, $page = 1)
{
// 构建必传参数
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['gender'] = $gender;
$param['limit'] = $limit;
$param['page'] = $page;
// 构建必传参数
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['gender'] = $gender;
$param['limit'] = $limit;
$param['page'] = $page;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v1/attention/getlist', $param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'guang/api/v1/attention/getlist', $param);
}
}
... ...
... ... @@ -58,7 +58,7 @@ class PlusstarData
$build['client_secret'] = Sign::getSign($build);
$urlList['all'] = Yohobuy::httpBuildQuery($url, $build);
return Yohobuy::getMulti($urlList);
return Yohobuy::getMulti($urlList, array(), 1800); // 缓存30分钟
}
/**
... ... @@ -96,7 +96,7 @@ class PlusstarData
$original['client_secret'] = Sign::getSign($original);
$urlList['original'] = Yohobuy::httpBuildQuery($url, $original);
return Yohobuy::getMulti($urlList);
return Yohobuy::getMulti($urlList, array(), 1800); // 缓存30分钟
}
/**
... ...
... ... @@ -33,7 +33,7 @@ class BrandData
$param['type'] = 'brand';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param, true);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
... ... @@ -52,7 +52,7 @@ class BrandData
$param['type'] = 'brand';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param, true);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -33,7 +33,7 @@ class Helpers
$url = 'http://search' . SUB_DOMAIN;
break;
case 'index': // 默认
$url = '';
$url = SITE_MAIN;
break;
default: // 其它子域名
$url = 'http://' . $module . SUB_DOMAIN;
... ...
... ... @@ -8,7 +8,7 @@ var $searchBox = $('.search-box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo');
$searchBox.find('input').on('focus', function() {
function showBigSearch() {
$indexLogo.css({
width: 0
});
... ... @@ -19,7 +19,9 @@ $searchBox.find('input').on('focus', function() {
width: '15.5rem'
});
$('.clear-text, .no-search').show();
}).on('blur', function() {
}
function hideBigSearch() {
$indexLogo.css({
width: '5.4rem'
});
... ... @@ -30,12 +32,22 @@ $searchBox.find('input').on('focus', function() {
width: '9.6rem'
});
$('.clear-text, .no-search').hide();
}
$searchBox.find('input').on('focus', function() {
showBigSearch();
});
$searchBox.find('.clear-text').click(function() {
$searchBox.find('input').val('').trigger('focus');
$searchBox.find('.clear-text').on('touchend', function() {
$searchBox.find('input').val('');
});
$searchBox.find('.search-icon').click(function() {
$searchBox.find('.search-icon').on('touchend', function() {
$indexSearch.submit();
});
$('.no-search').on('touchend', function() {
$searchBox.find('input').val('');
hideBigSearch();
});
window.rePosFooter();
... ...
... ... @@ -108,7 +108,7 @@
padding: 0 20rem / $pxConvertRem;
a {
display: block;
padding-top: 10rem / $pxConvertRem;
// padding-top: 10rem / $pxConvertRem;
height: 76rem / $pxConvertRem;
line-height: 76rem / $pxConvertRem;
font-size: 28rem / $pxConvertRem;
... ... @@ -116,13 +116,14 @@
border-top: 1px solid #f9f9f9;
i {
display: inline-block;
margin-top: -4rem / $pxConvertRem;
margin-left: 24rem / $pxConvertRem;
width: 58rem / $pxConvertRem;
height: 38rem / $pxConvertRem;
text-align: center;
vertical-align: middle;
font-size: 18rem / $pxConvertRem;
line-height: 39rem / $pxConvertRem;
line-height: 38rem / $pxConvertRem;
color: #fff;
border-radius: 50rem / $pxConvertRem;;
}
... ...
... ... @@ -4,12 +4,12 @@
position: fixed;
top: 0;
bottom: 0;
// left: 0;
left: -540rem / $pxConvertRem;
right: 640rem / $pxConvertRem;
width: 540rem / $pxConvertRem;
z-index: -1;
overflow: hidden;
@include transition(right .3s);
@include transition(all .3s);
ul {
background: #f0f0f0;
... ... @@ -107,6 +107,7 @@
}
.side-nav.on {
left: 0;
right: 100rem / $pxConvertRem;
z-index: 3;
}
... ...
... ... @@ -45,6 +45,13 @@ a {
text-decoration: none;
outline: none;
color: #000;
&:link,
&:visted,
&:hover,
&:active {
color: #000;
}
}
*:focus {
... ...
... ... @@ -24,7 +24,8 @@
width: 384rem / $pxConvertRem;
height: 112rem / $pxConvertRem;
overflow: hidden;
transition: width 400ms;
z-index: 3;
@include transition(width .4s);
.search-box {
float: left;
position: relative;
... ... @@ -96,10 +97,10 @@
min-height: 800rem / $pxConvertRem;
.index-channel-list {
padding-top: 50%;
margin-top: -50%;
width: 100%;
position: absolute;
top: -180rem / $pxConvertRem;
top: 50%;
.list-item {
display: block;
... ... @@ -114,6 +115,9 @@
background: #000;
border: 4px solid #fff;
font-weight: bold;
&:last-child {
margin-bottom: 0;
}
}
.lighter {
font-weight: lighter;
... ...
... ... @@ -41,10 +41,6 @@
.search-items {
padding: 20px 10px;
a {
color: #000;
}
h3 {
font-size: 12px;
margin-bottom: 10px;
... ...
... ... @@ -160,7 +160,7 @@ class HomeModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($cache, $result);
Cache::set($cache, $result);
}
}
... ...
... ... @@ -59,7 +59,7 @@ class SideModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set(CacheConfig::KEY_COMMON_SIDE_NAV, $result, 3600); // 缓存1小时
Cache::set(CacheConfig::KEY_COMMON_SIDE_NAV, $result);
}
}
... ...
... ... @@ -57,7 +57,7 @@ class ListModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 600); // 缓存10分钟
Cache::set($key, $result, 1800); // 缓存30分钟
}
}
... ... @@ -140,7 +140,7 @@ class ListModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 600); // 缓存10分钟
Cache::set($key, $result, 1800); // 缓存30分钟
}
}
... ... @@ -186,7 +186,7 @@ class ListModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 10800); // 缓存3小时
Cache::set($key, $result); // 缓存1小时
}
}
... ...
... ... @@ -2,6 +2,7 @@
use Action\AbstractAction;
use LibModels\Wap\Product\BrandData;
use Plugin\Helpers;
/**
* 商品操作相关的控制器
... ... @@ -56,6 +57,11 @@ class OptController extends AbstractAction
}
while (false);
if (isset($result['code']) && $result['code'] == 412) {
$referer = $this->server('HTTP_REFERER', SITE_MAIN);
$result['data'] = Helpers::url('/signin.html', array('refer' => $referer));
}
$this->echoJson($result);
}
... ...