Authored by ccbikai

merge code

... ... @@ -15,6 +15,7 @@ namespace Action;
use Yaf\Controller_Abstract;
use Yaf\Dispatcher;
use Plugin\Cache;
use Plugin\Helpers;
class AbstractAction extends Controller_Abstract
{
... ... @@ -327,6 +328,24 @@ class AbstractAction extends Controller_Abstract
if (!empty($homeUrl)) {
$header['navHome'] = $homeUrl;
}
// 根据COOKIE记录的频道进行导航定位
$channel = Helpers::getChannelByCookie();
switch ($channel) {
default:
case 1:
$header['boys'] = true;
break;
case 2:
$header['girls'] = true;
break;
case 3:
$header['kids'] = true;
break;
case 4:
$header['lifeStyle'] = true;
break;
}
$this->_view->assign('pageHeader', $header);
}
... ...
... ... @@ -67,14 +67,43 @@ class RecomData
*/
public static function mayLikeLifestyle($page = 1, $limit = 50)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.lifeStyle';
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = '4';
$param['client_secret'] = Sign::getSign($param);
// $param = Yohobuy::param();
// $param['method'] = 'app.search.lifeStyle';
// $param['page'] = $page;
// $param['limit'] = $limit;
// $param['yh_channel'] = '4';
// $param['client_secret'] = Sign::getSign($param);
//
// return Yohobuy::get(Yohobuy::API_URL, $param);
// 人气单品
$param = array(
array(
'stocknumber' => 1,
'status' => 1,
'order' => 's_n_desc',
'viewNum' => $limit,
'msort' => '10',
),
'N', false
);
$result['top'] = Yohobuy::yarClient(Yohobuy::SERVICE_URL . '/search/service/v1/product', 'search', $param, 3600); // 缓存1小时
return Yohobuy::get(Yohobuy::API_URL, $param);
// 新品到着
$param = array(
array('status' => 1, 'stocknumber' => 1, 'gender' => ''),
array(
array('misort' => 103, 'viewNum' => 10), //数码3c
array('misort' => 266, 'viewNum' => 10), //居家
array('misort' => 280, 'viewNum' => 10), //玩具娱乐
array('misort' => 101, 'viewNum' => 10), //办公文具
array('misort' => 259, 'viewNum' => 10), //美妆
),
false
);
$result['new'] = Yohobuy::yarClient(Yohobuy::SERVICE_URL . '/search/service/v1/product', 'searchBySortList', $param, 3600); // 缓存1小时
return $result;
}
}
... ...
... ... @@ -17,7 +17,19 @@ use Api\Sign;
class SearchData
{
/**
* 阿里云外网
*
* @var string
*/
protected static $_searchurl = 'http://101.200.31.165/yohosearch/search.json';
// /**
// * 阿里云内网
// *
// * @var string
// */
// protected static $_searchurl = 'http://100.98.132.63/yohosearch/search.json';
/**
* 模糊搜索提供的关键词
... ...
... ... @@ -11,6 +11,10 @@ var $ = require('yoho.zepto'),
var swiper,
$brandList = $('.brand-list');
var searchH = $('.newbrand-search').height(),
headerH = $('.yoho-header').height(),
brandSwipe = parseInt(searchH) + parseInt(headerH);
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
loop: true,
... ... @@ -27,10 +31,7 @@ $('.banner-top').css('padding-top', '90px');
if ($brandList.length > 0) {
$(window).scroll(function() {
var scrTop = $(window).scrollTop(),
searchH = $('.newbrand-search').height(),
headerH = $('.yoho-header').height(),
brandSwipe = parseInt(searchH) + parseInt(headerH);
var scrTop = $(window).scrollTop();
$('.brand-list').each(function() {
var offTop = $(this).offset().top - brandSwipe;
... ... @@ -47,3 +48,12 @@ if ($brandList.length > 0) {
});
});
}
$('#right-bar .con').find('b').unbind().on('tap', function() {
var index = $(this).index();
if ($('.bar-' + index).size() > 0) {
document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1);
}
});
... ...
... ... @@ -8,7 +8,6 @@ var $ = require('yoho.zepto'),
Swiper = require('yoho.iswiper');
var info = require('./info'),
setLazyLoadAndMellipsis = info.setLazyLoadAndMellipsis,
loadMore = info.loadMore;
var $loadMoreInfo = $('#load-more-info');
... ... @@ -45,10 +44,11 @@ info.initInfosEvt($infoList);
var gender = $('#gender').val();
$nav.children('.guang-nav-item').each(function() {
var type = $(this).data('type');
var type = $(this).data('type'),
focus = $(this).hasClass('focus');
state[type] = {
page: 1,
page: focus ? 1 : 0,
gender: gender,
type: type,
end: false
... ... @@ -65,6 +65,9 @@ $nav.delegate('.guang-nav-item', 'tap', function() {
return;
}
$curNav = $this;
curType = $this.data('type');
index = $this.index();
$this.addClass('focus');
... ... @@ -75,11 +78,7 @@ $nav.delegate('.guang-nav-item', 'tap', function() {
$content = $infos.eq(index);
$content.removeClass('hide');
//lazyload & mellipsis
setLazyLoadAndMellipsis($content.children('.guang-info'));
$curNav = $this;
curType = $this.data('type');
loadMore($content, state[curType]);
//重置当前Tab的load-more
if (state[curType].end) {
... ... @@ -93,6 +92,6 @@ $nav.delegate('.guang-nav-item', 'tap', function() {
$(document).scroll(function() {
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
loadMore($infos, state[curType]);
loadMore($infos.not('hide'), state[curType]);
}
});
\ No newline at end of file
... ...
... ... @@ -9,12 +9,13 @@ var $ = require('yoho.zepto'),
lazyLoad = require('yoho.zeptolazyload');
var tip = require('../plugin/tip');
var loading = require('../plugin/loading');
var $loadMoreInfo = $('#load-more-info');
var $loading = $(''),
$noMore = $('');
var loading = false;
var searching = false;
ellipsis.init();
... ... @@ -84,7 +85,7 @@ function initInfosEvt($container) {
* 资讯LoadMore
*/
function loadMore($container, opt) {
if (loading) {
if (searching) {
return;
}
... ... @@ -92,7 +93,13 @@ function loadMore($container, opt) {
return;
}
loading = true;
if (opt.page === 0) {
//显示loading
loading.showLoadingMask();
}
searching = true;
$.ajax({
type: 'GET',
url: ' /guang/index/page',
... ... @@ -100,7 +107,7 @@ function loadMore($container, opt) {
success: function(data) {
if (data === ' ') {
opt.end = true;
loading = false;
searching = false;
//
$loading.addClass('hide');
... ... @@ -112,13 +119,17 @@ function loadMore($container, opt) {
setLazyLoadAndMellipsis($container.find('.guang-info'));
if (opt.page === 0) {
loading.hideLoadingMask();
}
opt.page++;
loading = false;
searching = false;
},
error: function() {
tip.show('网络断开连接了~');
loading = false;
searching = false;
}
});
}
... ...
... ... @@ -7,7 +7,7 @@
var $ = require('yoho.zepto');
var $filter = $('.filter-mask, .filter-body');
var $filter = $('.filter-mask');
var $classify = $filter.find('.classify'),
$subClassify = $filter.find('.sub-classify');
... ... @@ -33,9 +33,11 @@ function registerCbFn(cb) {
$classify.children(':first-child').addClass('active'); //T:不在HTML中使用{{#if @first}}active{{/if}}来初始化active为避免sub设置高度时的闪烁
//classify switch
$classify.delegate('.classify-item', 'tap', function() {
$classify.delegate('.classify-item', 'tap', function(e) {
var $this = $(this);
e.stopPropagation();
if ($this.hasClass('active')) {
return;
}
... ... @@ -46,7 +48,7 @@ $classify.delegate('.classify-item', 'tap', function() {
});
//点击Mask隐藏筛选界面
$filter.filter('.filter-mask').tap(function() {
$filter.tap(function() {
hideFilter();
});
... ...
/**
* Loading mask
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/29
*/
var $ = require('yoho.zepto');
var $page = $('.yoho-page');
var $loading;
//初始化
(function() {
var html = '<div class="loading-mask hide"><div class="loading"></div></div>';
$page.append(html);
$loading = $page.children('.loading-mask');
}());
//显示loading
function showLoadingMask() {
$loading.removeClass('hide');
}
//隐藏loading
function hideLoadingMask() {
$loading.addClass('hide');
}
exports.showLoadingMask = showLoadingMask;
exports.hideLoadingMask = hideLoadingMask;
\ No newline at end of file
... ...
... ... @@ -14,6 +14,7 @@ var $brandHeader = $('#brand-header'),
var filter = require('../plugin/filter');
var tip = require('../plugin/tip');
var loading = require('../plugin/loading');
var $goodsContainer = $('#goods-container'),
$ngc = $goodsContainer.children('.new-goods'),
... ... @@ -72,6 +73,10 @@ function search(opt) {
nav, navType,
page;
if (searching) {
return;
}
if (opt) {
//筛选项变更则重置reload为true
... ... @@ -126,10 +131,6 @@ function search(opt) {
$.extend(defaultOpt, ext); //扩展筛选项
}
if (searching) {
return;
}
//导航类别
if ($pre.hasClass('new')) {
navType = 'newest';
... ... @@ -157,6 +158,7 @@ function search(opt) {
});
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
... ... @@ -198,6 +200,7 @@ function search(opt) {
nav.page = page;
searching = false;
loading.hideLoadingMask();
}
});
... ...
... ... @@ -11,6 +11,7 @@ var $ = require('yoho.zepto'),
var swiper;
var filter = require('../../plugin/filter');
var loading = require('../../plugin/loading');
var $goodsContainer = $('#goods-container'),
$ngc = $($goodsContainer.children().get(0)),
... ... @@ -165,6 +166,7 @@ function search(opt) {
});
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
... ... @@ -206,6 +208,7 @@ function search(opt) {
nav.page = page;
searching = false;
loading.hideLoadingMask();
}
});
... ... @@ -214,6 +217,7 @@ function search(opt) {
lazyLoad($('.lazy'));
filter.registerCbFn(search);
loading.initLoadingMask();
//导航栏点击逻辑说明:
//1.点击非active项时切换active状态
... ...
... ... @@ -11,6 +11,7 @@ var $ = require('yoho.zepto'),
var swiper;
var filter = require('../../plugin/filter');
var loading = require('../../plugin/loading');
var $goodsContainer = $('#goods-container'),
$ngc = $($goodsContainer.children().get(0)),
... ... @@ -192,6 +193,7 @@ function search(opt) {
});
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
... ... @@ -233,6 +235,7 @@ function search(opt) {
nav.page = page;
searching = false;
loading.hideLoadingMask();
}
});
... ... @@ -241,6 +244,7 @@ function search(opt) {
lazyLoad($('.lazy'));
filter.registerCbFn(search);
loading.initLoadingMask();
//导航栏点击逻辑说明:
//1.点击非active项时切换active状态
... ... @@ -248,6 +252,7 @@ filter.registerCbFn(search);
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav.delegate('li', 'tap', function() {
var $this = $(this),
nav,
... ...
.good-info {
display: inline-block;
width: 276rem / $pxConvertRem;
float: left;
width: 44%;
height: 486rem / $pxConvertRem;
margin: 28rem / $pxConvertRem (15rem / $pxConvertRem) 0;
margin: 28rem / $pxConvertRem 3% 0;
.tag-container {
... ...
.loading-mask {
position: absolute;
background: rgba(0,0,0,.1);
top: 0;
bottom: 0;
right: 0;
left: 0;
.loading {
position: absolute;
width: 100rem / $pxConvertRem;
height: 40rem / $pxConvertRem;
background: image-url('loading.gif') no-repeat;
background-size: 100% 100%;
top: 50%;
left: 50%;
margin-left: -50rem / $pxConvertRem;
margin-top: -20rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
... ... @@ -111,17 +111,18 @@
.right-bar {
width: 60rem / $pxConvertRem;
top: 240rem / $pxConvertRem !important;
overflow: hidden;
height: 75%;
top: 20%;
overflow: auto;
position: fixed;
right: 2rem / $pxConvertRem;
border-radius: 12rem / $pxConvertRem;
background: rgba(0,0,0,.8);
z-index: 2;
b {
height: 32rem / $pxConvertRem;
height: 36rem / $pxConvertRem;
line-height: 28rem / $pxConvertRem;
line-height: 36rem / $pxConvertRem;
text-align: center;
display: block;
color: #999999;
... ...
... ... @@ -27,13 +27,17 @@
}
.banner-swiper {
position: relative;
height: 309rem / $pxConvertRem;
overflow: hidden;
ul {
position: relative;
height: 100%;
height: 309rem / $pxConvertRem;
li {
float: left;
width: 100%;
height: 100%;
img {
width: 100%;
... ...
... ... @@ -3,10 +3,11 @@
.banner {
display: block;
height: 400rem / $pxConvertRem;
overflow: hidden;
img {
width: 100%;
height: 404rem / $pxConvertRem;
height: 100%;
}
}
... ... @@ -19,17 +20,13 @@
}
.classify-logo {
display: table-cell;;
width: 212rem / $pxConvertRem;
height: 140rem/ $pxConvertRem;
vertical-align: middle;
height: 192rem / $pxConvertRem;
img {
display: block;
max-width: 212rem / $pxConvertRem;
max-height: 140rem / $pxConvertRem;
vertical-align: middle;
margin: 0 auto;
width: 100%;
height: 100%;
}
}
... ...
... ... @@ -13,6 +13,7 @@
height: 174rem / $pxConvertRem;
border-right: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
overflow: hidden;
.brand-logo {
display: table-cell;
... ... @@ -37,6 +38,9 @@
text-decoration: none;
border-bottom: none;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
}
... ... @@ -44,4 +48,17 @@
.brand:nth-child(4n) {
border-right: none;
}
.more {
.brand-logo {
display: block;
text-align: center;
line-height: 150rem / $pxConvertRem;
.iconfont {
font-size: 48rem / $pxConvertRem;
color: #333;
}
}
}
}
\ No newline at end of file
... ...
.floor-header{
margin: 29rem / $pxConvertRem 30rem / $pxConvertRem 0;
.floor-header {
margin: (29rem / $pxConvertRem) (30rem / $pxConvertRem) 0;
background: #fff;
border: 1px solid #e0e0e0;
border-bottom: none;
... ... @@ -10,22 +10,23 @@
color: #b1b1b1;
}
.floor-header-more{
.floor-header-more {
position: relative;
height: 99rem / $pxConvertRem;
line-height: 99rem / $pxConvertRem;
margin: 29rem / $pxConvertRem 0 0;
margin: (29rem / $pxConvertRem) 0 0;
background: #fff;
border-top:1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
text-align: center;
font-size: 32rem / $pxConvertRem;
color: #444;
.more-btn{
.more-btn {
position: absolute;
right: 0.75rem;
right: 30rem / $pxConvertRem;
top: 0;
bottom: 0;
color: #b0b0b0;
font-size: 1.25rem;
font-size: 50rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
.category-swiper {
position: relative;
height: 403rem / $pxConvertRem;
height: 400rem / $pxConvertRem;
overflow: hidden;
ul {
li {
... ... @@ -37,17 +37,20 @@
}
}
.goods-category {
background: #fff;
}
.goods-category .category-list {
background: #f5f7f6;
height: 383rem / $pxConvertRem;
height: 382rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
overflow: hidden;
li {
float: left;
width: 191rem / $pxConvertRem;
height: 191rem / $pxConvertRem;
border-left: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
.first-show {
display: none;
}
... ... @@ -72,5 +75,17 @@
width: 253rem / $pxConvertRem;
height: 382rem / $pxConvertRem;
border-left: none;
.img-box {
height: 100%;
line-height: 100%;
}
.category-name {
line-height: 40rem / $pxConvertRem;
font-size: 22rem / $pxConvertRem;
}
}
li:nth-child(4), li:nth-child(5) {
border-top: 1px solid #e0e0e0;
}
}
\ No newline at end of file
... ...
.hot-brands {
background: #fff;
border-bottom: 1px solid #e0e0e0;
a {
... ... @@ -17,15 +16,14 @@
overflow: hidden;
.brand-logo {
display: table-cell;
width: 3.95rem;
width: 100%;
height: 128rem / $pxConvertRem;
line-height: 128rem / $pxConvertRem;
text-align: center;
font-size: 0;
vertical-align: middle;
img {
vertical-align: middle;
max-width: 100%;
max-height: 100%;
}
... ... @@ -69,29 +67,28 @@
.brands-swiper {
background: #fff;
width: 100%;
height: 180rem / $pxConvertRem;
height: 140rem / $pxConvertRem;
margin-bottom: 28rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
overflow: hidden;
.brands-list {
position: relative;
height: 180rem / $pxConvertRem;
height: 140rem / $pxConvertRem;
li {
float: left;
padding-left: 5%;
width: 21.875%;
height: 140rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
a {
position: relative;
display: table-cell;
display: block;
width: 100%;
height: 140rem / $pxConvertRem;
height: 100%;
line-height: 140rem / $pxConvertRem;
font-size: 0;
vertical-align: middle;
}
img {
... ... @@ -104,8 +101,7 @@
position: absolute;
left: 8rem / $pxConvertRem;
right: 8rem / $pxConvertRem;
bottom: -32rem / $pxConvertRem;
width: 100%;
bottom: 8rem / $pxConvertRem;
height: 28rem / $pxConvertRem;
line-height: 28rem / $pxConvertRem;
text-align: center;
... ...
.hot-category {
margin: (30rem / $pxConvertRem) 0 0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
.category-banner {
height: 198rem / $pxConvertRem;
img {
... ... @@ -11,26 +12,36 @@
}
.category-list {
background: #fff;
border-top: 1px solid #e0e0e0;
li {
float: left;
width: 158rem / $pxConvertRem;
height: 174rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
overflow: hidden;
.img-box {
width: 100%;
height: 100%;
line-height: 138rem / $pxConvertRem;
line-height: 174rem / $pxConvertRem;
text-align: center;
vertical-align: middle;
overflow: hidden;
font-size: 0;
img {
vertical-align: middle;
max-width: 100%;
max-height: 100%;
vertical-align: middle;
}
}
.category-title {
line-height: 22rem / $pxConvertRem;
color: #aaa;
font-size: 18rem / $pxConvertRem;
text-align: center;
}
}
}
}
\ No newline at end of file
... ...
.icons-wrapper {
box-sizing: border-box;
padding: 30rem / $pxConvertRem 0 16rem / $pxConvertRem;
background: #fff;
border-bottom: 1px solid #e0e0e0;
box-sizing: border-box;
padding: (30rem / $pxConvertRem) 0 (16rem / $pxConvertRem);
background: #fff;
border-bottom: 1px solid #e0e0e0;
}
.icons-item {
float: left;
margin-bottom: 10rem / $pxConvertRem;
width:25%;
height: 146rem / $pxConvertRem;
text-align:center;
}
float: left;
margin-bottom: 10rem / $pxConvertRem;
width: 25%;
height: 146rem / $pxConvertRem;
text-align: center;
}
.imagebar {
margin:0 auto;
display: flex;
display: -webkit-flex;
width: 98rem / $pxConvertRem;
height: 98rem / $pxConvertRem;
overflow: hidden;
align-items:center;
justify-content: center;
img {
max-width: 100%;
max-height: 100%;
}
display: block;
margin: 0 auto;
text-align: center;
width: 98rem / $pxConvertRem;
height: 98rem / $pxConvertRem;
line-height: 98rem / $pxConvertRem;
box-sizing: border-box;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
}
.linkbar {
display: block;
line-height:44rem / $pxConvertRem;
font-size:24rem / $pxConvertRem;
color: #444;
display: block;
line-height: 44rem / $pxConvertRem;
font-size: 24rem / $pxConvertRem;
color: #444;
&:visited, &:link, &:active, &:hover {
color: #444;
}
}
\ No newline at end of file
... ...
... ... @@ -6,15 +6,18 @@
position: relative;
width: 100%;
border-bottom: 1px solid #e0e0e0;
.swiper-pagination {
position: absolute;
left: 0;
right: 0;
bottom: 22rem / $pxConvertRem;
text-align: center;
.pagination-inner {
display: inline-block;
}
span {
float: left;
width: 16rem / $pxConvertRem;
... ... @@ -23,7 +26,8 @@
background: #efefef;
border-radius: 50%;
}
span.swiper-active-switch {
span.swiper-pagination-bullet-active {
background: #b0b0b0;
}
}
... ... @@ -32,35 +36,47 @@
.trend-topic-swiper {
height: 534rem / $pxConvertRem;
overflow: hidden;
ul {
position: relative;
li {
float: left;
height: 534rem / $pxConvertRem;
.img-box {
display: flex;
display: -webkit-flex;
margin: 0 auto;
width: 580rem / $pxConvertRem;
height: 360rem / $pxConvertRem;
margin: 0 (30rem / $pxConvertRem);
align-items: center;
justify-content: center;
line-height: 360rem / $pxConvertRem;
text-align: center;
img {
max-width: 100%;
max-height: 100%;
vertical-align: middle;
width: 100%;
height: 100%;
}
}
.item-content {
margin: (20rem / $pxConvertRem) (30rem / $pxConvertRem) 0;
.title {
line-height: 52rem / $pxConvertRem;
font-size: 30rem / $pxConvertRem;
color: #000;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.time {
margin: (16rem / $pxConvertRem) 0 0;
line-height: 24rem / $pxConvertRem;
color: #afafaf;
font-size: 18rem / $pxConvertRem;
.time-icon {
margin-right: 8rem / $pxConvertRem;
font-size: 14rem / $pxConvertRem;
... ...
... ... @@ -7,6 +7,7 @@
.trend-coll-header {
position: relative;
widows: 100%;
.trend-coll-title {
width: 100%;
height: 100rem / $pxConvertRem;
... ... @@ -15,6 +16,7 @@
font-size: 34rem / $pxConvertRem;
color: #747474;
}
.more {
position: absolute;
right: 24rem / $pxConvertRem;
... ... @@ -23,13 +25,15 @@
}
.trend-coll-content {
padding: 0 (15rem / $pxConvertRem);
padding: 0 0 0 (15rem / $pxConvertRem);
.lspan {
float: left;
margin: 0 (15rem / $pxConvertRem);
}
.rspan {
float: right;
float: left;
margin: 0 (15rem / $pxConvertRem);
}
}
... ... @@ -71,20 +75,23 @@
.recommend-list {
position: relative;
.recommend-item {
float: left;
padding-left: 30rem / $pxConvertRem;
width: 140rem / $pxConvertRem;
height: 140rem / $pxConvertRem;
a {
display: block;
height: 100%;
}
.recommend-list .recommend-item {
float: left;
padding-left: 5%;
width: 21.875%;
height: 140rem / $pxConvertRem;
a {
display: block;
width: 100%;
height: 100%;
img {
width: 100%;
height: 100%;
img {
width: 100%;
height: 100%;
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -92,5 +92,4 @@ a {
@include border-radius(10px);
}
@import "layout/header", "layout/footer", "layout/footer_tab", "good", "filter", "passport/index", "guang/index", "home/index", "category/index", "product/index", "index/index", "shopping-cart/index";
@import "layout/header", "layout/footer", "layout/footer_tab", "good", "filter", "loading", "passport/index", "guang/index", "home/index", "category/index", "product/index", "index/index", "shopping-cart/index";
... ...
... ... @@ -83,7 +83,6 @@
.goods-container {
position: relative;
min-height: 440px;
text-align: center;
}
}
... ...
... ... @@ -32,7 +32,7 @@
{{/ hotBrand}}
{{# brandList}}
<div class="brand-list">
<div class="brand-list bar-{{@index}}">
<div class="title-bar">
<h2 style="position: static;">{{title}}</h2>
</div>
... ...
{{# filter}}
<div class="filter-mask hide"></div>
<div class="filter-body hide">
<ul class="classify">
{{#each classify}}
<li class="classify-item">
<p class="shower{{#if default}} default{{/if}}">
<span class="title">{{title}}:</span>
{{name}}
</p>
<ul class="sub-classify" data-type={{dataType}}>
{{# subs}}
<li {{#if chosed}}class=chosed{{/if}} data-id={{dataId}}>
{{name}}
<i class="iconfont chosed-icon">&#xe617;</i>
</li>
{{/ subs}}
</ul>
</li>
{{/each}}
</ul>
<div class="filter-mask hide">
<div class="filter-body">
<ul class="classify">
{{#each classify}}
<li class="classify-item">
<p class="shower{{#if default}} default{{/if}}">
<span class="title">{{title}}:</span>
{{name}}
</p>
<ul class="sub-classify" data-type={{dataType}}>
{{# subs}}
<li {{#if chosed}}class=chosed{{/if}} data-id={{dataId}}>
{{name}}
<i class="iconfont chosed-icon">&#xe617;</i>
</li>
{{/ subs}}
</ul>
</li>
{{/each}}
</ul>
</div>
</div>
{{/ filter}}
\ No newline at end of file
... ...
... ... @@ -91,7 +91,82 @@ class IndexModel
$data['guang']['gender'] = $gender;
$category = array();
return $data;
}
/**
* 获取逛首页分类内容列表
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @param int channel APP客户端标识 1表示男,2:表示女,3:潮童,4:创意生活
* @param int type 分类ID 0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $page 分页第几页, 默认第1页
* @return array
*/
public static function getArticle($gender, $type, $uid, $udid, $page = 1)
{
// 逛首页的分类名称列表
$category = ListData::category();
$article = array();
switch ($gender) {
case '1,3': // 男
$article = ListData::article('1,3', $type, $uid, $udid, $page);
break;
case '2,3': // 女
$article = ListData::article('2,3', $type, $uid, $udid, $page);
break;
default: // 其它所有
$article = ListData::article('1,2,3', $type, $uid, $udid, $page);
break;
}
$data = array();
$build = array();
// 模板中使用JS的标识
$data['guangHome'] = true;
// 顶部的分类列表
if (!empty($category['data'])) {
foreach ($category['data'] as $value) {
$build = array();
$build['typeId'] = $value['id'];
$build['type'] = $value['name'];
$build['focus'] = ($value['id'] == $type);
$data['navs'][] = $build;
$data['guang']['infos'][] = array(
'show' => $build['focus'],
'info' => array(),
);
}
}
// 广告列表
if (!empty($article['data']['list']['adlist'])) {
foreach ($article['data']['list']['adlist'] as $value) {
$build = array();
$build['url'] = Helpers::getFilterUrl($value['url']);
$build['img'] = Helpers::getImageUrl($value['src'], 830, 327);
$data['guang']['swiper'][] = $build;
}
}
// 内容列表
if (!empty($article['data']['list']['artlist'])) {
$type = intval($type);
foreach ($article['data']['list']['artList'] as $value) {
$data['guang']['infos'][$type]['info'] = Helpers::formatArticle($value, true, false, true);
}
}
$category = array();
$article = array();
return $data;
}
... ...
... ... @@ -35,7 +35,7 @@ class IndexController extends AbstractAction
// $this->setNavSide('all');
// }
$this->_view->display('index', Guang\IndexModel::getArticleGroup($gender, $type, $uid, $udid));
$this->_view->display('index', Guang\IndexModel::getArticle($gender, $type, $uid, $udid));
}
/**
... ... @@ -175,7 +175,7 @@ class IndexController extends AbstractAction
/* 获取资讯文章列表 */
$uid = $this->getUid();
$udid = $this->getUdid();
$page = intval($page) + 1;
//$page = intval($page) + 1;
$article = ListData::article($gender, $sortId, $uid, $udid, $page, $tag, $authorId);
if (empty($article['data']['list']['artList'])) {
break;
... ...
... ... @@ -31,6 +31,11 @@ class InfoController extends AbstractAction
$this->error();
}
// WAP上设置头部导航
if (null === $this->get('openby:yohobuy', null)) {
$this->setNavHeader('逛', true, SITE_MAIN);
}
$data = array();
$data['guangDetail'] = true; // 模板中使用JS的标识
$data['guang']['id'] = $id;
... ...
... ... @@ -85,7 +85,7 @@ class IndexController extends AbstractAction
if (!isset($brandIds[0])) {
$this->error();
}
// 当前的登录用户UID
$uid = $this->getUid();
// 存标题信息
... ... @@ -107,6 +107,7 @@ class IndexController extends AbstractAction
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$condition['brand'] = $brandIds[0];
if (isset($condition['gender'])) {
$condition['gender'] = rawurldecode($condition['gender']);
}
... ... @@ -118,7 +119,7 @@ class IndexController extends AbstractAction
$data['goodList']['brandWay'] = false;
$data['goodList']['search']['default'] = $query;
$data['goodList']['search']['url'] = Helpers::url('', null, 'search');
}
}
// 品牌一览过来的展示品牌介绍和LOGO
else {
$data['brandHome'] = Product\ListModel::getBrandIntro($brandIds[0], $uid, $title);
... ...
... ... @@ -47,8 +47,8 @@ class RecomController extends AbstractAction
if (empty($recom['data']['product_list'])) {
break;
}
/* 判断是否已没有数据 */
/* 判断是否已没有数据 */
if (intval($page) > intval($recom['data']['page_total'])) {
break;
}
... ... @@ -59,7 +59,6 @@ class RecomController extends AbstractAction
$data['goods'][] = Helpers::formatProduct($value, true);
}
$this->_view->display('maylike', $data);
} while (false);
echo ' ';
... ... @@ -120,32 +119,65 @@ class RecomController extends AbstractAction
if (!$this->isAjax()) {
break;
}
/* 创意生活只有一页数据 */
$page = $this->get('page', 1);
if (intval($page) > 1) {
break;
}
/* 取可能喜欢的数据 */
$recom = RecomData::mayLikeLifestyle();
if (empty($recom['data']['product_list'])) {
/* 构建人气单品数据 */
if (empty($recom['top']['data']['product_list'])) {
break;
}
/* 构建模板需要的商品数据 */
$data = array();
$build = array();
$build['show'] = true;
foreach ($recom['top']['data']['product_list'] as $value) {
$build['goods'][] = Helpers::formatProduct($value, true, false, false);
}
$data['goodsContainer'][] = $build;
/* 构建新品到着数据 */
if (empty($recom['new']['data']['product_list'])) {
break;
}
$build = array();
if (!empty($recom['data']['product_list']['top'])) {
$build = array();
$build['show'] = true;
foreach ($recom['data']['product_list']['top'] as $value) {
$build['goods'][] = Helpers::formatProduct($value, true);
}
$data['goodsContainer'][] = $build;
}
if (!empty($recom['data']['product_list']['new'])) {
$build = array();
foreach ($recom['data']['product_list']['new'] as $value) {
$build['show'] = false;
$build['goods'][] = Helpers::formatProduct($value, true);
}
$data['goodsContainer'][] = $build;
$build['show'] = true;
foreach ($recom['new']['data']['product_list'] as $value) {
$build['goods'][] = Helpers::formatProduct($value, true, false, false);
}
$data['goodsContainer'][] = $build;
// if (empty($recom['data']['product_list'])) {
// break;
// }
//
// /* 构建模板需要的商品数据 */
// $data = array();
// $build = array();
// if (!empty($recom['data']['product_list']['top'])) {
// $build = array();
// $build['show'] = true;
// foreach ($recom['data']['product_list']['top'] as $value) {
// $build['goods'][] = Helpers::formatProduct($value, true);
// }
// $data['goodsContainer'][] = $build;
// }
// if (!empty($recom['data']['product_list']['new'])) {
// $build = array();
// foreach ($recom['data']['product_list']['new'] as $value) {
// $build['show'] = false;
// $build['goods'][] = Helpers::formatProduct($value, true);
// }
// $data['goodsContainer'][] = $build;
// }
$this->_view->display('maylikelife', $data);
} while (false);
... ...
... ... @@ -5,7 +5,7 @@ define('SITE_MAIN', 'http://buy.test.yoho.cn'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.test.yoho.cn'); // COOKIE作用域
define('SUB_DOMAIN', '.test.yoho.cn'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('USE_CACHE', false); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'testing');
... ...