Authored by 梁志锋

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

... ... @@ -42,4 +42,30 @@ class IndexData
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URL_OPERATIONS_RESOURCE_GET, $params);
}
/**
* 邮箱订阅
*
* @param string $email
* @param string $uid
* @return array
*/
public static function emailSubscriber($email, $uid = 0)
{
//TODO 走老接口
// 构建必传参数
$param = Yohobuy::param();
$param['page'] = 1;
$param['open_key'] = '12345';
$param['method'] = 'open.subscriber.subscriber';
$param['email'] = $email;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
unset($param['app_version']);
unset($param['client_type']);
unset($param['os_version']);
unset($param['screen_size']);
unset($param['v']);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -215,6 +215,7 @@
background-size:100% 100%;
position: relative;
top: .36rem;
margin-right: pxToRem(12px);
}
&.highlight {
background: #eee;
... ...
... ... @@ -6,9 +6,9 @@
<div class="sale-group-big clearfix">
{{#brandSale}}
{{#big}}
<a class="item pull-left {{#if @first}}first{{/if}} {{#if @last}}last{{/if}}" href="{{link}}">
<a class="item pull-left" href="{{link}}">
<div class="pic">
<img class="" src="{{img}}">
<img src="{{img}}">
<div class="time">{{time}}</div>
</div>
<div class="detail">
... ... @@ -24,6 +24,17 @@
</div>
</a>
{{/big}}
</div>
<div class="sale-group clearfix">
{{#normal}}
<a class="item pull-left" href="{{link}}">
<img class="pic" src="{{img}}">
<div class="detail">
<div class="title">{{title}}</div>
<div class="time">{{time}}</div>
</div>
</a>
{{/normal}}
{{/brandSale}}
</div>
... ...
... ... @@ -55,20 +55,13 @@
}
.brand-sale {
.sale-group-big {
.item {
width: 377px;
margin-right: 10px;
&.first,
&.last {
width: 376px;
}
width: 1150px + 8px;
&.last {
margin-right: 0;
}
.item {
width: 378px;
margin-right: 8px;
margin-bottom: 10px;
}
.pic {
... ... @@ -95,7 +88,7 @@
}
.brand {
margin: 24px 10px;
margin: 24px 10px 0;
}
.text {
... ... @@ -112,7 +105,36 @@
font-size: 40px;
}
}
}
.sale-group {
width: 1150px + 8px;
.item {
width: 185px;
margin-right: 8px;
margin-bottom: 10px;
}
.pic {
width: 100%;
display: block;
}
.detail {
padding: 14px 10px;
background: #f5f5f5;
text-align: center;
line-height: 20px;
}
.title {
font-size: 12px;
}
.time {
font-size: 14px;
}
}
}
}
... ...
... ... @@ -6,6 +6,7 @@ use Plugin\Cache;
use Configs\CacheConfig;
use Api\Yohobuy;
use Plugin\Images;
use Plugin\Helpers;
class CommonController extends WebAction
{
... ... @@ -118,4 +119,24 @@ class CommonController extends WebAction
}
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $banner);
}
/**
* 获取邮件订阅
*
* @return jsonp
*/
public function emailsubscriberAction()
{
$callback = $this->get('callback', '');
$email = $this->get('email', '');
$uid = intval($this->get('uid', '0'));
$data = array();
//验证邮件
if(Helpers::verifyEmail($email)) {
$data = IndexData::emailSubscriber($email, $uid);
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $data['data']);
} else {
return $this->helpJsonCallbackResult($callback, 403, '订阅失败', '');
}
}
}
\ No newline at end of file
... ...
... ... @@ -54,7 +54,7 @@ class Sale1Controller extends WebAction
'brandSale' => array(
'big' => array(
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
... ... @@ -62,7 +62,7 @@ class Sale1Controller extends WebAction
'discount' => '70%',
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
... ... @@ -70,7 +70,7 @@ class Sale1Controller extends WebAction
'discount' => '70%',
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
... ... @@ -78,7 +78,80 @@ class Sale1Controller extends WebAction
'discount' => '70%',
)
),
'normal' => array()
'normal' => array(
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
)
)
)
);
$this->setWebNavHeader();
... ...