Authored by 梁志锋

update files

... ... @@ -2,5 +2,6 @@ var yohobuy;
require('./js/passport/index');
require('./js/guang/index');
require('./js/homePage/index');
module.exports = yohobuy;
... ...
/**
* kids,lifestyle商品模块JS
* @author: liuyue(yue.liu@yoho.cn)
* @date: 2015/9/23
*/
/*
var $ = require('yoho.zepto'),
Mustache = require('yoho.mustache'),
lazyLoad = require('yoho.lazyload');
var tpl,
res,
$firstColumnNav = $('.column-nav').find('li').eq(0),
$goodList = $('.two-column-goods').find('.goods-list');
if ($('.two-column-goods').size() <= 0) {
return;
}
//read good-info template
$.get('/common/goodinfo', function (data) {
tpl = '{{# goods}}' + data + '{{/ goods}}';
Mustache.parse(tpl);
});
function goodsAjax(url) {
$.ajax({
type: 'GET',
url: url
}).then(function (data) {
if (data.code === 200) {
res = data.data;
$goodList.html(Mustache.render(tpl, {
goods: res.goods
}));
//lazyLoad
lazyLoad($goodList.children('.good-info').find('img.lazy'));
}
});
}
$firstColumnNav.addClass('current');
goodsAjax($('.column-nav').find('.current').data('url'));
$('.column-nav').on('click', 'li', function () {
$(this).addClass('current').siblings().removeClass('current');
goodsAjax($(this).data('url'));
});*/
\ No newline at end of file
... ...
/**
* 首页
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/12
*/
var $ = require('yoho.zepto'),
// Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.lazyload'),
bannerSwiper,
hotBrandsSwiper,
recommendSwiper,
trendTopicSwiper,
goodsSwiper;
var swiperClass;
var requestFrame,
thisFunc,
prefixList,
start = 0,
i,
supportCss3,
$logotrans = $('.home-header .logo'),
isen = true;
//lazyload
lazyLoad($('img.lazy'));
/*$('img:in-viewport').trigger('appear');
//点击首页汉堡menu图标,滑出侧栏导航
$('.nav-btn').on('click', function (event) {
if (!$(this).hasClass('menu-open')) {
$('.mobile-wrap').addClass('menu-open');
$('.overlay').addClass('show');
$('.side-nav').addClass('on');
//设置boy高宽,页面不能上下滑动
$('body').css({
height: $(window).height(),
width: '100%',
overflow: 'hidden'
});
}
event.stopPropagation();
});
//点击页面主体,收起侧栏导航及二级导航
$('.mobile-wrap').on('click', function () {
if ($(this).hasClass('menu-open')) {
$('.mobile-wrap').removeClass('menu-open');
$('.overlay').removeClass('show');
$('.sub-nav').removeClass('show');
$('.side-nav').removeClass('on');
$('body').css({
height: 'auto',
overflow: 'auto'
});
}
});
//点击一级导航,弹出二级导航
$('.side-nav').on('click', 'li', function () {
if ($(this).find('.sub-nav').size() > 0) {
$('.sub-nav').removeClass('show');
$(this).find('.sub-nav').addClass('show');
}
});
//返回一级导航,收起二级导航
$('.sub-nav').each(function () {
$(this).find('li').eq(0).on('click', function (e) {
$('.sub-nav').removeClass('show');
e.stopPropagation();
});
});
//二级导航样式控制
$('.sub-nav').on('mouseenter', 'li', function () {
if ($(this).index() !== 0) {
$(this).addClass('current').siblings().removeClass('current');
}
});
//头部banner轮播
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new Swiper('.banner-swiper', {
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.banner-top .pagination-inner'
});
}
//热门品牌滑动
// hotBrandsSwiper = new Swiper('.brands-swiper', {
// grabCursor: true,
// slidesPerView: 'auto',
// wrapperClass: 'brands-list',
// slideElement: 'li'
// });
//推荐搭配滑动
recommendSwiper = new Swiper('.recommend-swiper', {
grabCursor: true,
slidesPerView: 'auto',
wrapperClass: 'recommend-list',
slideElement: 'li'
});
//潮品话题轮播
if ($('.trend-topic-swiper').find('li').size() > 1) {
trendTopicSwiper = new Swiper('.trend-topic-swiper', {
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.trend-topic-content .pagination-inner'
});
}
//潮流上装/经典裤装等轮播
$('.category-swiper').each(function (i, index) {
swiperClass = 'category-swiper' + i;
$(this).addClass(swiperClass);
if ($('.' + swiperClass).find('.swiper-slide').size() > 1) {
goodsSwiper = new Swiper('.' + swiperClass, {
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.' + swiperClass + ' .pagination-inner'
});
}
});
//回到顶部
// $('.back-to-top').bind('touchstart', function (e) {
// e.preventDefault();
// $(window).scrollTop(0);
// });
//关闭头部下载浮层
$('.header-download').on('click', '.close-btn', function () {
$(this).parent().remove();
});
//logo动画
requestFrame = (function () {
prefixList = ['webkit', 'moz', 'ms'];
for (i = 0; i < prefixList.length; i++) {
thisFunc = prefixList[i] + 'RequestAnimationFrame';
if (window[thisFunc]) {
supportCss3 = true;
return function (callback) {
window[thisFunc](callback);
};
}
}
return function (callback) {
window.setTimeout(callback, 67);
};
})();
function tsAnimate() {
start = start + 10;
$logotrans.css({
'transform': 'rotateX(' + start + 'deg)',
'-webkit-transform': 'rotateX(' + start + 'deg)',
'-moz-transform': 'rotateX(' + start + 'deg)'
});
if (start / 90 % 2 === 1) {
if (isen) {
$logotrans.addClass('animate');
isen = false;
} else {
$logotrans.removeClass('animate');
isen = true;
}
}
if (start / 90 % 2 === 0 && start % 360 !== 0) {
window.setTimeout(tsAnimate, 3000);
} else {
if (start % 360 === 0) {
window.setTimeout(tsAnimate, 3 * 60 * 1000);
} else {
requestFrame(function () {
tsAnimate();
});
}
}
}
tsAnimate();
*/
\ No newline at end of file
... ...
/**
* 首页入口
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/12
*/
require('./home');
//require('./maybe-like');
//require('./column-goods');
\ No newline at end of file
... ...
/**
* “你可能喜欢”模块JS
* @author: xuqi(qi.xu@yoho.cn)
* @date: 2015/7/15
*/
/*var $ = require('yoho.jquery'),
Mustache = require('yoho.mustache'),
lazyLoad = require('yoho.lazyload');
var $maybeLike = $('.maybe-like:last');
var winH = $(window).height(),
loading = false,
end = false,
page = 1,
tpl,
num,
res,
type = '';
var $goodList = $maybeLike.children('.goods-list'),
mblTop; //页面内容固定,可以预先求出高度
var isLogin = 'Y'; //是否登录,后台提供,区分走Ajax还是页面跳转
if ($('.maybe-like').size() <= 0) {
return;
}
mblTop = $maybeLike.offset().top;
// 无可能喜欢模块时直接返回
if ($maybeLike.length === 0) {
return;
}
//read good-info template
$.get('/common/goodinfo', function (data) {
tpl = '{{# goods}}' + data + '{{/ goods}}';
Mustache.parse(tpl);
});
type = $('.mobile-wrap').hasClass('boys-wrap') ? 'index' : 'girl';
//商品收藏
$('.goods-list').delegate('.good-islike', 'touchstart', function (e) {
var $cur, $good, id, url;
if (isLogin === 'Y') {
e.preventDefault(); // 阻止链接跳转改AJAX
$cur = $(e.currentTarget);
$good = $cur.closest('.good-info');
id = $good.data('id');
if ($cur.hasClass('good-like')) {
url = '/' + type + '/cancelprise';
} else {
url = '/' + type + '/prise';
}
$.ajax({
type: 'GET',
url: url,
data: {
id: id
}
}).then(function (data) {
if (data.code === 200) {
$cur.toggleClass('good-like');
}
});
}
});
//srcoll to load more
$(window).scroll(function () {
if (end || loading) {
return;
}
if ($(window).scrollTop() + winH < mblTop + $maybeLike.height()) {
return;
}
loading = true;
num = $goodList.children('.good-info').length;
$.ajax({
type: 'GET',
url: '/' + type + '/getmore',
data: {
page: page + 1
}
}).then(function (data) {
if (data.code === 200) {
res = data.data;
if (res.end) {
end = res.end;
}
$goodList.append(Mustache.render(tpl, {
goods: res.goods
}));
//lazyLoad
lazyLoad($goodList.children('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
loading = false;
page++;
}
});
});*/
\ No newline at end of file
... ...
{{# data}}
{{> common/header}}
{{> common/header_banner}}
<!-- <div class="goods-container">
{{# ../goodsNav}}
{{> common/goods_nav}}
{{/ ../goodsNav}}
{{# discountSection}}
<div class="goods-group discount-detail">
<ul class="clearfix">
{{# list}}
{{> common/goods_item}}
{{/ list}}
</ul>
</div>
{{/ discountSection}}
</div> -->
{{# goodsNav}}
{{> common/goods_nav}}
{{/ goodsNav}}
{{> common/goods_container}}
{{/ data}}
\ No newline at end of file
... ...
{{> newsale/header}}
{{# discountSection}}
<div class="discount-section">
<ul class="clearfix">
{{# list}}
<li class="clearfix">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}" alt="">
<span class="title">{{title}}</span>
<span class="time {{rush}}">{{time}}</span>
</a>
</li>
{{/ list}}
</ul>
</div>
{{/ discountSection}}
\ No newline at end of file
... ...
{{# data}}
{{> common/header}}
<script type="text/javascript">
// 判断是否是微信浏览器
function isWeixin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
}
if (isWeixin()) {
document.getElementById('header').style.display = 'none';
}
</script>
{{> common/header_banner}}
{{> common/sgoods_nav}}
{{# rankList}}
<div class="rank-main">
<ul>
{{# list}}
<li>
<a class="clearfix" href="{{url}}">
<div class="item-img">
<img class="lazy" data-original="{{img}}">
</div>
<div class="item-content">
<i class="rank-icon top">{{rank}}</i>
<h2>{{title}}</h2>
<p>{{active}}</p>
<p>{{sPrice}}<span>{{price}}</span></p>
</div>
</a>
</li>
{{/ list}}
</ul>
</div>
{{/ rankList}}
{{/ data}}
\ No newline at end of file
... ...
{{> newsale/header_banner}}
{{> mewsale/list_nav}}
... ...
{{# data}}
{{> common/header}}
{{> common/header_banner}}
<!-- <div class="goods-container">
{{# ../goodsNav}}
{{> common/goods_nav}}
{{/ ../goodsNav}}
{{# onlyForMemberSection}}
<div class="goods-group only-for-member">
<ul class="clearfix">
{{# list}}
{{> common/goods_item}}
{{/ list}}
</ul>
</div>
{{/ onlyForMemberSection}}
</div> -->
{{# goodsNav}}
{{> common/goods_nav}}
{{/ goodsNav}}
{{> common/goods_container}}
{{/ data}}
\ No newline at end of file
... ...
{{# data}}
{{> common/header}}
{{> common/header_banner}}
<!-- <div class="goods-container">
{{# ../goodsNav}}
{{> common/goods_nav}}
{{/ ../goodsNav}}
{{# outletSection}}
<div class="goods-group outlets">
<ul class="clearfix">
{{# list}}
{{> common/goods_item}}
{{/ list}}
</ul>
</div>
{{/ outletSection}}
</div> -->
{{# goodsNav}}
{{> common/goods_nav}}
{{/ goodsNav}}
{{> common/goods_container}}
{{/ data}}
\ No newline at end of file
... ...
{{# data}}
{{> common/header}}
{{> common/header_banner}}
<!-- <div class="goods-container">
{{# ../goodsNav}}
{{> common/goods_nav}}
{{/ ../goodsNav}}
{{# reducedPriceSection}}
<div class="goods-group reduced-price">
<ul class="clearfix">
{{# list}}
{{> common/goods_item}}
{{/ list}}
</ul>
</div>
{{/ reducedPriceSection}}
</div> -->
{{# goodsNav}}
{{> common/goods_nav}}
{{/ goodsNav}}
{{> common/goods_container}}
{{/ data}}
\ No newline at end of file
... ...
{{> newsale/header}}
{{> newsale/header_banner}}
{{# saleSection}}
<div class="sale-section">
<ul class="clearfix">
{{# list}}
<li>
<a href="{{url}}">
<img src="{{img}}" alt="">
</a>
</li>
{{/ list}}
</ul>
</div>
{{/ saleSection}}
{{# latestSale}}
{{> newsale/floor_header}}
{{/ latestSale}}
{{# goodsNav}}
{{> newsale/goods_nav}}
{{/ goodsNav}}
{{> newsale/goods_container}}
... ...
{{# data}}
{{> newsale/header}}
{{> newsale/header_banner}}
<!-- <div class="goods-container">
{{# ../goodsNav}}
{{> common/goods_nav}}
{{/ ../goodsNav}}
{{# shortInSizeSection}}
<div class="goods-group short-in-size">
<ul class="clearfix">
{{# list}}
{{> common/goods_item}}
{{/ list}}
</ul>
</div>
{{/ shortInSizeSection}}
</div> -->
{{# goodsNav}}
{{> newsale/goods_nav}}
{{/ goodsNav}}
{{> newsale/goods_container}}
{{/ data}}
\ No newline at end of file
... ...
... ... @@ -17,4 +17,5 @@
</ul>
</div>
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -89,6 +89,12 @@
</script>
{{/if}}
<script>
seajs.use('js/homePage/index');
</script>
{{!-- 品类 --}}
{{#if categoryPage}}
<script>
... ...
<div class="floor-header">
<h2>{{name}}</h2>
</div>
\ No newline at end of file
... ...
<div class="good-info" data-id="{{id}}">
<div class="tag-container clearfix">
{{# tags}}
{{# isNew}}
<p class="good-tag new-tag">NEW</p>
{{/ isNew}}
{{# isReNew}}
<p class="good-tag renew-tag">再到着</p>
{{/ isReNew}}
{{# isSale}}
<p class="good-tag sale-tag">SALE</p>
{{/ isSale}}
{{# isYohood}}
<div class="good-tag yohood-tag"></div>
{{/ isYohood}}
{{# isLimit}}
<p class="good-tag limit-tag">限量商品</p>
{{/ isLimit}}
{{/ tags}}
</div>
<div class="good-detail-img">
<!-- <a class="good-islike {{# isLike}}good-like{{/ isLike}} iconfont" href="{{likeUrl}}">&#xe605;</a> -->
<a class="good-thumb" href="{{url}}">
<img class="lazy" data-original="{{thumb}}">
</a>
{{# isFew}}
<p class="few-tag">即将售罄</p>
{{/ isFew}}
</div>
<div class="good-detail-text">
<div class="name">
<a href="{{url}}">{{name}}</a>
</div>
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}
<span class="market-price">¥{{.}}</span>
{{/price}}
</div>
<div class="vip-tag">更优惠</div>
</div>
</div>
... ...
{{# goodsContainer}}
<div id="goods-content" class="goods-content {{# vipNoLogin}}vip-no-login{{/ vipNoLogin}} {{# vipLogin}}vip-card vip-{{.}}{{/ vipLogin}} clearfix">
{{> common/script_good_info}}
<div class="new-patterns-container hide">
{{# goods}}
{{> common/good_info}}
{{/ goods}}
</div>
<div class="sales-volume-container hide"></div>
<div class="price-container hide"></div>
<div class="cloth-container hide"></div>
<div class="pants-container hide"></div>
<div class="shose-container hide"></div>
<div class="other-container hide"></div>
<div id="screen-mask" class="screen-mask hide"></div>
<div id="screen-content" class="screen-content hide clearfix">
<ul class="classify">
<li class="gender c-item active">
性别:
<h1 id="show-gender" class="chosed default">BOYS</h1>
</li>
<li class="brand c-item">
品牌:
<h1 id="show-brand" class="chosed default">全部品牌</h1>
</li>
<li class="msort c-item">
品类:
<h1 id="show-msort" class="chosed default">全部品类</h1>
</li>
<li class="color c-item">
颜色:
<h1 id="show-color" class="chosed default">全部颜色</h1>
</li>
<li class="size c-item">
尺码:
<h1 id="show-size" class="chosed default">全部尺码</h1>
</li>
<li class="price c-item">
价格:
<h1 id="show-price" class="chosed default">全部价格</h1>
</li>
<li class="discount c-item">
折扣:
<h1 id="show-discount" class="chosed default">全部折扣</h1>
</li>
</ul>
<div class="sub-classify-container">
<ul id="sub-gender" class="sub-classify" data-type="gender"></ul>
<ul id="sub-brand" class="sub-classify hide" data-type="brand"></ul>
<ul id="sub-msort" class="sub-classify hide" data-type="msort"></ul>
<ul id="sub-color" class="sub-classify hide" data-type="color"></ul>
<ul id="sub-size" class="sub-classify hide" data-type="size"></ul>
<ul id="sub-price" class="sub-classify hide" data-type="price"></ul>
<ul id="sub-discount" class="sub-classify hide" data-type="discount"></ul>
</div>
</div>
</div>
{{/ goodsContainer}}
\ No newline at end of file
... ...
<div id="goods-content" class="goods-content clearfix" style="padding-left:10px;margin-top: 9px;">
<div class="new-patterns-container"></div>
<div class="sales-volume-container hide"></div>
<div class="price-container hide"></div>
<div id="screen-mask" class="screen-mask hide"></div>
<div id="screen-content" class="screen-content hide">
<ul class="classify">
<li class="gender c-item active">
性别:
<h1 id="show-gender" class="chosed">BOYS</h1>
</li>
<li class="brand c-item">
品牌:
<h1 id="show-brand" class="chosed default">全部品牌</h1>
</li>
<li class="msort c-item">
品类:
<h1 id="show-msort" class="chosed default">全部品类</h1>
</li>
<li class="color c-item">
颜色:
<h1 id="show-color" class="chosed default">全部颜色</h1>
</li>
<li class="size c-item">
尺码:
<h1 id="show-size" class="chosed default">全部尺码</h1>
</li>
<li class="price c-item">
价格:
<h1 id="show-price" class="chosed default">全部价格</h1>
</li>
<li class="discount c-item">
折扣:
<h1 id="show-discount" class="chosed default">全部折扣</h1>
</li>
</ul>
<div class="sub-classify-container">
<ul id="sub-gender" class="sub-classify" data-type="gender"></ul>
<ul id="sub-brand" class="sub-classify hide" data-type="brand"></ul>
<ul id="sub-msort" class="sub-classify hide" data-type="msort"></ul>
<ul id="sub-color" class="sub-classify hide" data-type="color"></ul>
<ul id="sub-size" class="sub-classify hide" data-type="size"></ul>
<ul id="sub-price" class="sub-classify hide" data-type="price"></ul>
<ul id="sub-discount" class="sub-classify hide" data-type="discount"></ul>
</div>
</div>
</div>
\ No newline at end of file
... ...
<li class="goods-item">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}" alt="">
<div class="goods-title">{{title}}</div>
<div class="price">
<i class="vip-card hide"></i>
<span class="sale-price {{^price}}no-price{{/price}}">{{# salePrice}}¥{{/ salePrice}}{{salePrice}}</span>
{{#price}}
<span class="market-price">¥{{.}}</span>
{{/price}}
</div>
<div class="vip-cheap hide">
<i class="icon vip-icon"></i> 更优惠
</div>
</a>
</li>
\ No newline at end of file
... ...
<ul id="goods-nav" class="goods-nav">
{{# all}}
<li class="nav-item all-nav focus">
<span>全部</span>
</li>
{{/ all}}
{{# newPatterns}}
<li class="nav-item new-patterns-nav focus">
<span>最新</span>
</li>
{{/ newPatterns}}
{{# price}}
<li class="nav-item price-nav">
<span>价格</span>
<span class="sort">
<i class="up iconfont">&#xe615;</i>
<i class="down iconfont cur">&#xe616;</i>
</span>
</li>
{{/ price}}
{{# salesCount}}
<li class="nav-item sales-count-nav">
<span>销量</span>
</li>
{{/ salesCount}}
{{# salesVolume}}
<li class="nav-item sales-volume-nav">
<span>折扣</span>
<span class="sort">
<i class="up iconfont">&#xe615;</i>
<i class="down iconfont cur">&#xe616;</i>
</span>
</li>
{{/ salesVolume}}
{{# cloth}}
<li class="nav-item cloth-nav">
<span>上装</span>
</li>
{{/ cloth}}
{{# pants}}
<li class="nav-item pants-nav">
<span>下装</span>
</li>
{{/ pants}}
{{# shoes}}
<li class="nav-item shose-nav">
<span>鞋</span>
</li>
{{/ shoes}}
{{# other}}
<li class="nav-item other-nav">
<span>其他</span>
</li>
{{/ other}}
{{# screen}}
<li class="nav-item screen-nav">
<span>筛选</span>
<span class="sort">
<i class="iconfont">&#xe613;</i>
</span>
</li>
{{/ screen}}
</ul>
{{# sizeNav}}
<div id="size-nav" class="size-nav swiper-container">
<ul class="swiper-wrapper">
{{# list}}
<li class="size-nav-item swiper-slide" data-size="{{size}}">{{textCn}}</li>
{{/ list}}
</ul>
</div>
{{/ sizeNav}}
\ No newline at end of file
... ...
{{# header}}
<div id="header" class="header clearfix" {{# bgColor}}style="background:{{.}}"{{/ bgColor}}>
<a class="icon-back iconfont" href="javascript:history.go(-1)"></a>
{{title}}
<a class="icon-home iconfont" href="{{homeUrl}}"></a>
</div>
{{/ header}}
... ...
{{# headerBanner}}
<div class="header-banner swiper-container">
<div class="swiper-wrapper">
{{# list}}
<div class="swiper-slide">
<a href="{{url}}">
<img src="{{img}}">
{{# desc}}
<span class="desc">{{../desc}}</span>
{{/ desc}}
</a>
</div>
{{/ list}}
</div>
</div>
{{/ headerBanner}}
\ No newline at end of file
... ...
<script id="goods-tpl" type="x-tmpl-mustache">
<div class="good-info" data-id="\{{id}}">
<div class="tag-container clearfix">
\{{# tags}}
\{{# isNew}}
<p class="good-tag new-tag">NEW</p>
\{{/ isNew}}
\{{# isReNew}}
<p class="good-tag renew-tag">再到着</p>
\{{/ isReNew}}
\{{# isSale}}
<p class="good-tag sale-tag">SALE</p>
\{{/ isSale}}
\{{# isYohood}}
<div class="good-tag yohood-tag"></div>
\{{/ isYohood}}
\{{# isLimit}}
<p class="good-tag limit-tag">限量商品</p>
\{{/ isLimit}}
\{{/ tags}}
</div>
<div class="good-detail-img">
<a class="good-thumb" href="\{{url}}">
<img class="lazy" data-original="\{{thumb}}">
</a>
\{{# isFew}}
<p class="few-tag">即将售罄</p>
\{{/ isFew}}
</div>
<div class="good-detail-text">
<div class="name">
<a href="\{{url}}">\{{name}}</a>
</div>
<div class="price">
<span class="sale-price \{{^price}}no-price\{{/price}}">¥\{{salePrice}}</span>
\{{#price}}
<span class="market-price">¥\{{.}}</span>
\{{/price}}
</div>
</div>
</div>
</script>
\ No newline at end of file
... ...
{{# listNav}}
<div class="s-goods-nav goods-nav">
<ul class="swiper-wrapper clearfix">
{{# list}}
<li class="swiper-slide nav-item" data-sort="{{sort}}">
<span>{{textCn}}</span>
</li>
{{/ list}}
</ul>
</div>
{{/ listNav}}
... ...
... ... @@ -12,7 +12,6 @@ class LifestyleController extends AbstractAction
public function indexAction()
{
// 显示侧边栏
$this->setNavSide();
... ... @@ -24,16 +23,456 @@ class LifestyleController extends AbstractAction
$data = array();
// 频道数据
$channelData = IndexData::getUserChannelData(0, '1,3', '9aa25f5133f011ec96c2045eb15ae425');
$channelData = IndexData::getUserChannelData(0, '2,3', '201504091403002');
$channels = array();
if($channelData['code'] == 200)
{
$data['content'] = FloorProcess::getContent($channelData['data'], 4);
$data['content'] = FloorProcess::getContent($channelData['data'], 2);
}
/*// 也许喜欢
$maybeLikeData = RecomData::mayLike('2,3', 2, false);
$maybeLike = array();
if($maybeLikeData['code'] == 200)
{
$maybeLike = FloorProcess::maybeLike($maybeLikeData['data']['product_list']);
$num = count($data['content']);
$data['content'][] = array('maybeLike' =>$maybeLike);
}*/
$data = array(
'headerDownload' => array(
'img' => 'http://img11.static.yhbimg.com/adpic/2015/02/28/18/01d83bfad41c8fca8fd1ad334216d7d733.jpg?imageView/2/w/640/h/480',
'url' => 'http://www.baidu.com'
),
'homeHeader' => array(
'bgColor' => '#FF88AE',
'searchUrl' => ''
),
'sideNav' => array(
array(
'textCn' => '男生',
'textEn' => 'Boys',
'styleClass' => 'boys',
'url' => ''
),
array(
'textCn' => '女生',
'textEn' => 'GIRLS',
'styleClass' => 'girls',
'url' => ''
),
array(
'textCn' => '潮童',
'textEn' => 'KIDS',
'styleClass' => 'kids',
'url' => ''
),
array(
'textCn' => '创意生活',
'textEn' => 'LIFE STYLE',
'styleClass' => 'life',
'url' => ''
),
array(
'textCn' => '逛',
'textEn' => 'TRENDFINDER',
'styleClass' => 'guang',
'subNav' => array(
'list' => array(
array(
'textCn' => '逛',
'textEn' => 'TrendFinder',
'back' => true,
'bgColor' => '#fd307f'
),
array(
'textCn' => '查看全部',
'url' => ''
),
array(
'textCn' => '只看男生',
'textEn' => 'Boys',
'url' => ''
),
array(
'textCn' => '只看女生',
'textEn' => 'Girls',
'url' => '',
'isSelect' => true
)
)
)
)
),
'content' => array(
'bannerTop' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'
)
)
),
'iconsEnter' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '新品到着'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '全球优选'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '明星潮牌'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '全部品类'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '逛'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '搭配指南'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '潮品推荐'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '折扣精选'
)
)
),
'bannerCenter' => array(
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/24/16/02ee02f1dd11c9103f7cf7995eafdaa605.jpg',
'url' => ''
),
'hotCategory' => array(
'title' => array(
'name' => '热门品类'
),
'list' => array(
array(
'textCn' => '卫衣',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'T恤',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'hotBrands' => array(
'title' => array(
'name' => '热门品牌'
),
'list' => array(
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'trendColloaction' => array(
'title' => array(
'title' => '潮人 ▪ 搭配',
'more_name' => '...',
'more_url' => 'http://www.yohobuy.com?openby:yohobuy={"action":"go.guangchannel","params":{"id":3,"name":"\u6f6e\u4eba"}}'
),
'article' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
),
'recommend_collocation' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'trendTopics' => array(
'title' => array(
'title' => '潮品 ▪ 话题',
'more_name' => '...',
'more_url' => 'http://www.yohobuy.com?openby:yohobuy={"action":"go.guangchannel","params":{"id":3,"name":"\u6f6e\u4eba"}}'
),
'list' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'title' => '现代裁剪',
'time' => '2月13日 12:34'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'title' => '现代裁剪',
'time' => '2月13日 12:34'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'title' => '现代裁剪',
'time' => '2月13日 12:34'
)
)
),
'goodsCategory' => array(
'title' => array(
'title' => '潮流时装',
'more_name' => '...',
'more_url' => 'http://www.yohobuy.com?openby:yohobuy={"action":"go.guangchannel","params":{"id":3,"name":"\u6f6e\u4eba"}}'
),
'big_image' => array(
'list' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'list' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '手表'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '烛台'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '围巾'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '盘子'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '耳机'
)
)
),
'creativeLife' => array(
'title' => array(
'title' => '新入住品牌',
'more_name' => '...',
'more_url' => 'http://www.yohobuy.com?openby:yohobuy={"action":"go.guangchannel","params":{"id":3,"name":"\u6f6e\u4eba"}}'
),
'banner' => 'http://img10.static.yhbimg.com/yhb-img01/2015/07/09/18/0119ffceddb0819d36d74b408bd743b4a9.jpg?imageView/2/w/640/h/640',
'classify' => array(
array(
'url' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/04/10/05/029bef1041343ea2e31dc0423f2f176589.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => '手表'
), array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/goodsimg/2015/07/07/09/02271a775d17649860abec4387b4559e26.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => '烛台'
), array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/goodsimg/2015/05/19/07/02a269d20ed44803eee33e255fe88d7873.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => '围巾'
), array(
'url' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/06/01/07/02fe94083352435ce53b5d90812cc5bdbd.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => '盘子'
), array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/goodsimg/2015/07/08/07/028db8a2afbe4ecbf37bebc7e98e8e1e80.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => '耳机'
), array(
'url' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/04/22/02/02a1b688b6dafd786f391e0624aea1e93b.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => '生活'
)
)
),
'plusStar' => array(
array(
'name' => 'PLUS 全球优选',
'url' => '',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/07/13/15/014f7ba48071160053ac3b8f045b9fc264.jpg?imageView/2/w/640/h/640'
),
array(
'name' => 'PLUS 全球优选',
'url' => '',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/07/13/15/014f7ba48071160053ac3b8f045b9fc264.jpg?imageView/2/w/640/h/640'
)
),
'maybeLike' => array(
'goods' => array(
array(
'id' => 1,
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/03/02/07/01ebfb219e22770ffb0c2c3a2cbb2b4bef.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
), array(
'id' => 2,
'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/023d70c59e81ccbfb39404487aaf642da2.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'CLOTtee 撞色连帽外套',
'isLike' => false,
'price' => 488,
'salePrice' => 139,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
), array(
'id' => 3,
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/03/02/08/02e2d44125e95495e3152aa459fa6b9b0c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'HALFGIRL 插肩棒球服短裙套装',
'isLike' => true,
'price' => 478,
'salePrice' => 208,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
), array(
'id' => 4,
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/03/03/08/022f25fbe177ee12803c522f04fcce06d0.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => '黄伟文Wyman X yohood联名商品YYYOHOOD连帽卫衣',
'isLike' => false,
'salePrice' => 148,
'isSale' => false,
'isFew' => false,
'isNew' => true,
'url' => ''
)
)
),
'bannerBottom' => array(
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/24/16/02ee02f1dd11c9103f7cf7995eafdaa605.jpg',
'url' => ''
)
));
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('index', $data);
}
}
}
\ No newline at end of file
... ...