Authored by biao

fix pay center bug. code review by guanning

... ... @@ -182,17 +182,19 @@ class NewsaleData
* 获取热销排行榜商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* $param integer $channel 1表示男,2表示女,3表示潮童,4表示创意生活
* @param string|null $sort 品类ID查询参数
* @param integer|null $tab_id Tab的ID
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 新品到着商品数据
*/
public static function getTopProducts($gender, $sort = null, $tab_id = null, $limit = 50, $page = 1)
public static function getTopProducts($gender, $channel, $sort = null, $tab_id = null, $limit = 50, $page = 1)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.top';
$param['gender'] = $gender;
$param['yh_channel'] = $gender;
!empty($sort) && $param['sort'] = $sort;
!empty($tab_id) && $param['tab_id'] = $tab_id;
$param['page'] = $page;
... ...
... ... @@ -103,7 +103,7 @@ function hideWeChatPay() {
var $payApps = $('.app');
$payApps.each(function(idx, app) {
if ($(app).attr('id') === 'weixin') {
if ($(app).parent().attr('id') === 'weixin') {
$(app).parent().css('display', 'none');
return false;
}
... ...
... ... @@ -64,11 +64,21 @@ lazyLoad();
headerNavHammer = new Hammer(document.getElementById('yoho-header'));
headerNavHammer.on('tap', function(e) {
var suggestText = $('#suggest-textarea').val();
var suggestText = $('#suggest-textarea').val(),
textReg = /\S+/;
if ($(e.target).hasClass('nav-btn')) {
if (!textReg.test(suggestText)) {
diaLog.showDialog({
autoHide: true,
dialogText: '意见不能为空'
});
return;
}
$.ajax({
method: 'post',
url: '/home/savesuggest',
... ... @@ -85,10 +95,18 @@ headerNavHammer.on('tap', function(e) {
setTimeout(function() {
location.pathname = 'home/suggest';
}, 2000);
} else {
diaLog.showDialog({
autoHide: true,
dialogText: '提交失败~'
});
}
}).fail(function() {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
}
});
... ...
... ... @@ -36,7 +36,7 @@
> div {
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
background-image: url(http://localhost:8000/img/layout/pay-icon.png);
background-image: image-url("/img/layout/pay-icon.png");
background-size: 90%;
background-position-y: 8rem / $pxConvertRem;
background-position-x: center;
... ...
{{> layout/header}}
<div class="brand-page yoho-page">
{{# channel}}
<div class="newbrand-search">
<div class="search-box clearfix">
<a href="{{searchUrl}}" >
... ... @@ -40,4 +42,6 @@
{{/ list}}
</div>
{{/ brandList}}
{{/channel}}
{{> layout/footer}}
... ...
<div class="hot-brands">
{{^ brandPage}}
{{> home/floor_header}}
{{/ brandPage}}
<div class="brands-swiper">
<ul class="brands-list swiper-wrapper clearfix">
{{# list}}
... ...
... ... @@ -230,6 +230,7 @@ class NewsaleModel
* 筛选出来的热销排行榜商品数据处理
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* $param integer $channel 1表示男,2表示女,3表示潮童,4表示创意生活
* @param string|null $sort 品类ID查询参数
* @param integer|null $tab_id Tab的ID
* @param boolean $notab 时候返回顶部tab的数据,默认返回
... ... @@ -237,11 +238,11 @@ class NewsaleModel
* @param integer $page 分页第几页
* @return array 处理之后的数据
*/
public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page)
public static function selectTopData($gender, $channel, $sort, $tab_id, $notab, $limit, $page)
{
$result = array();
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
$data = NewsaleData::getTopProducts($gender, $channel, $sort, $tab_id, $limit, $page);
if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
$result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
... ...
... ... @@ -41,7 +41,10 @@ class BrandController extends AbstractAction
}
// 渲染模板
$this->_view->display('index', Category\BrandModel::getBrandByChannel($channel));
$this->_view->display('index', array(
'brandPage' => true,
'channel' => Category\BrandModel::getBrandByChannel($channel)
));
}
/**
... ...
... ... @@ -110,7 +110,8 @@ class NewsaleController extends AbstractAction
// 获取性别
$gender = Helpers::getGenderByCookie();
$result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page);
$channel = Helpers::getChannelByCookie();
$result = \Product\NewsaleModel::selectTopData($gender, $channel, $sort, $tab_id, $notab, $limit, $page);
}
if (empty($result)) {
echo ' ';
... ...