Authored by uedxwg

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

Showing 85 changed files with 1156 additions and 624 deletions
WAP
\ No newline at end of file
PC
\ No newline at end of file
Mobile
\ No newline at end of file
... ...
... ... @@ -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);
}
... ...
... ... @@ -18,6 +18,9 @@ class CacheConfig
const KEY_ACTION_GIRLS_INDEX = 'key_action_girls_index'; // 女生首页
const KEY_ACTION_KIDS_INDEX = 'key_action_kids_index'; // 潮童首页
const KEY_ACTION_LIFESTYLE_INDEX = 'key_action_lifestyle_index'; // 创意生活首页
const KEY_ACTION_BOYS_BOTTOM_BANNER = 'key_action_boys_bottom_banner'; // 男生首页底部banner
const KEY_ACTION_GRILS_BOTTOM_BANNER = 'key_action_girls_bottom_banner';// 女生首页底部banner
const KEY_ACTION_GUANG_PLUSSTAR_INDEX = 'key_action_guang_plusstar_index'; // 国际优选
const KEY_ACTION_GUANG_PLUSSTAR_LIST = 'key_action_guang_plusstar_list'; // 明星原创
... ...
... ... @@ -82,6 +82,7 @@ class NewsaleData
*/
public static function selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit = null, $limit = 60, $page = 1, $order = 's_t_desc')
{
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
... ...
... ... @@ -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';
/**
* 模糊搜索提供的关键词
... ...
... ... @@ -9,7 +9,6 @@ use Plugin\Helpers;
*/
class FloorProcess
{
private static $guangUrl = 'http://guang.m.yohobuy.com';
/**
* 频道参数
*
... ... @@ -131,6 +130,7 @@ class FloorProcess
/**
* 女生品类
* 推荐(1T-12F)
*/
private static function recommend_content_three($data, $type)
{
... ... @@ -138,7 +138,7 @@ class FloorProcess
$build = array();
if (!empty($data['big_image'][0])) {
$build['img'] = Helpers::getImageUrl($data['big_image'][0]['src'], 640, 198);
$build['img'] = Helpers::getImageUrl($data['big_image'][0]['src'], 640, 200);
$build['url'] = Helpers::getFilterUrl($data['big_image'][0]['url']);
$result['hotCategory']['banner'] = $build;
}
... ... @@ -150,7 +150,7 @@ class FloorProcess
$build['textCn'] = $one['title'];
$result['hotCategory']['list'][] = $build;
}
if (isset($data['title']['more_url'])) {
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
... ... @@ -180,8 +180,8 @@ class FloorProcess
$data['is_show_name'] = $data['title']['is_show'];
$data['name'] = $data['title']['title'];
unset($data['title']);
if (isset($data['title']['more_url'])) {
if (isset($data['title']['more_url'])) {
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
... ... @@ -206,6 +206,7 @@ class FloorProcess
foreach ($data['list'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
isset(self::$channel[$type]) && $one['url'] .= '?gender='.self::$channel[$type];
}
$one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
unset($one['src']);
... ... @@ -226,12 +227,12 @@ class FloorProcess
{
$result = array();
foreach($data as $key=>&$value){
if($key == 'title'){
$value['more_url'] = Helpers::url('', array('id' => 2, 'gender' => self::$channel[$type]), 'guang');
foreach ($data as $key => &$value) {
if ($key == 'title') {
$value['more_url'] = Helpers::url('', array('id' => 3, 'gender' => self::$channel[$type]), 'guang');
}
if($key == 'article'){
foreach($value as &$one){
if ($key == 'article') {
foreach ($value as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
}
... ... @@ -239,8 +240,8 @@ class FloorProcess
unset($one['src']);
}
}
if($key == 'recommend_collocation'){
foreach($value as &$one){
if ($key == 'recommend_collocation') {
foreach ($value as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
}
... ... @@ -264,11 +265,11 @@ class FloorProcess
{
$result = array();
foreach($data as $key=>&$value){
if($key == 'title'){
$value['more_url'] = Helpers::url('', array('id' => 1, 'gender' => self::$channel[$type]), 'guang');
foreach ($data as $key => &$value) {
if ($key == 'title') {
$value['more_url'] = Helpers::url('', array('id' => 4, 'gender' => self::$channel[$type]), 'guang');
}
if($key == 'list'){
if ($key == 'list') {
foreach ($value as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
... ... @@ -300,7 +301,7 @@ class FloorProcess
$one['img'] = Helpers::getImageUrl($one['src'], 640, 403);
unset($one['src']);
}
$data['banner']['list'] = $data['big_image'];
$result['big_image']['list'] = $data['big_image'];
foreach ($data['list'] as $kk => &$one) {
if ($kk == 0) {
... ... @@ -315,8 +316,8 @@ class FloorProcess
unset($one['src']);
}
if (isset($data['title']['more_url'])) {
if (isset($data['title']['more_url'])) {
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
... ... @@ -337,7 +338,6 @@ class FloorProcess
{
$result = array();
$data['banner'] = array();
foreach ($data['big_image'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
... ... @@ -355,8 +355,8 @@ class FloorProcess
$one['img'] = Helpers::getImageUrl($one['src'], 191, 191);
unset($one['src']);
}
if (isset($data['title']['more_url'])) {
if (isset($data['title']['more_url'])) {
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
$result['creativeLife'] = $data;
... ...
... ... @@ -82,6 +82,9 @@ class ListProcess
$filters['classify'][] = $build;
}
// 按照指定字段进行排序筛选数据
self::sortArrByField($filters['classify'], 'sort_col');
return $filters;
}
... ... @@ -91,6 +94,7 @@ class ListProcess
$result = array(
'title' => '品牌',
'name' => '所有品牌',
'sort_col' => 1,
'dataType' => 'brand',
'subs' => array(
array(
... ... @@ -120,6 +124,7 @@ class ListProcess
$result = array(
'title' => '颜色',
'name' => '所有颜色',
'sort_col' => 3,
'dataType' => 'color',
'subs' => array(
array(
... ... @@ -146,6 +151,7 @@ class ListProcess
$result = array(
'title' => '折扣',
'name' => '所有商品',
'sort_col' => 6,
'dataType' => 'discount',
'subs' => array(
array(
... ... @@ -172,6 +178,7 @@ class ListProcess
$result = array(
'title' => '性别',
'name' => '所有性别',
'sort_col' => 0,
'dataType' => 'gender',
'subs' => array(
array(
... ... @@ -180,12 +187,12 @@ class ListProcess
'name' => '所有性别'
),
array(
'dataId' => 'boys',
'name' => '男'
'dataId' => '1,3',
'name' => 'BOYS'
),
array(
'dataId' => 'girls',
'name' => '女'
'dataId' => '2,3',
'name' => 'GIRLS'
),
)
);
... ... @@ -198,6 +205,7 @@ class ListProcess
$result = array(
'title' => '品类',
'name' => '所有品类',
'sort_col' => 2,
'dataType' => 'sort',
'subs' => array(
array(
... ... @@ -237,6 +245,7 @@ class ListProcess
$result = array(
'title' => '价格',
'name' => '所有价格',
'sort_col' => 5,
'dataType' => 'price',
'subs' => array(
array(
... ... @@ -263,6 +272,7 @@ class ListProcess
$result = array(
'title' => '尺码',
'name' => '所有尺码',
'sort_col' => 4,
'dataType' => 'size',
'subs' => array(
array(
... ...
... ... @@ -117,6 +117,32 @@ class Helpers
}
/**
* 根据排序类型和类型值获得正确的排序参数
* @param integer $order 类型值
* @param string $type 排序类型
* @return string 转换之后的排序参数
*/
public static function transOrder($order, $type)
{
$result = '';
switch ($type) {
case 'price':
$result = ($order == 0) ? 's_p_desc' : 's_p_asc';
break;
case 'discount':
$result = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
break;
case 'newest':
default:
$result = ($order == 0) ? 's_t_desc' : 's_t_asc';
break;
}
return $result;
}
/**
* 格式化商品信息
*
* @param array $productData 需要格式化的商品数据
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Fri Oct 23 16:38:57 2015
Created by FontForge 20120731 at Fri Oct 30 10:27:45 2015
By Ads
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Fri Oct 23 16:38:57 2015
bbox="-0.75 -224 3943 812.871"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E628"
unicode-range="U+0078-E62D"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -152,5 +152,19 @@ d="M866.5 663.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t13
<glyph glyph-name="uniE628" unicode="&#xe628;"
d="M505 776q77 0 148.5 -23.5t129 -67t101 -101.5t67.5 -129.5t24 -147.5q0 -64 -17 -125t-47.5 -112t-74 -94.5t-94.5 -74t-112 -47.5t-125 -17q-95 0 -182 37.5t-150 100.5t-100 150t-37 182t37 182t100 150t150 100t182 37zM505 -104q112 0 206.5 55t149.5 149.5
t55 206.5q0 37 -6.5 73.5t-19.5 69.5t-30.5 64t-40.5 57.5t-49.5 49.5t-57.5 40.5t-64 30t-69.5 19t-73.5 6.5q-111 0 -205.5 -55t-149.5 -149.5t-55 -206t55 -206t149.5 -149.5t205.5 -55zM528 138v-59h-58v59h58zM470 564h58v-349h-58v349z" />
<glyph glyph-name="uniE629" unicode="&#xe629;"
d="M442 274h-84v-76h-230v76h-81q-20 0 -33.5 -12.5t-13.5 -31.5v-395q0 -20 13.5 -33.5t33.5 -13.5h395q19 0 31.5 13.5t12.5 33.5v395q0 13 -5.5 23t-15.5 15.5t-23 5.5zM977 812h-81v-77h-230v77h-84q-10 0 -18 -3.5t-14 -10t-9 -15t-3 -18.5v-395q0 -13 5.5 -23
t15.5 -15.5t23 -5.5h395q20 0 33.5 12.5t13.5 31.5v395q0 20 -13.5 33.5t-33.5 13.5zM977 274h-81v-76h-230v76h-84q-13 0 -23 -5.5t-15.5 -15.5t-5.5 -23v-395q0 -13 5.5 -23.5t15.5 -17t23 -6.5h395q20 0 33.5 13.5t13.5 33.5v395q0 19 -13.5 31.5t-33.5 12.5z" />
<glyph glyph-name="uniE62A" unicode="&#xe62a;"
d="M497 806l-451 -386q-6 -6 -11 -13t-7 -15t-2 -17v-500q0 -32 22.5 -54.5t53.5 -22.5h256v333h308v-333h256q31 0 53.5 22.5t22.5 54.5v500q0 27 -20 45l-451 386q-15 13 -30 0z" />
<glyph glyph-name="uniE62B" unicode="&#xe62b;"
d="M761 539q0 -104 -73 -177t-177 -73q-51 0 -97 19.5t-79.5 53t-53.5 80t-20 97.5q0 104 73.5 177t177 73t176.5 -73t73 -177zM888 -164q11 22 9 48q-3 43 -15 83.5t-32 76t-46.5 66.5t-59.5 55t-69.5 42t-78.5 27t-85 9q-100 0 -186.5 -47.5t-139.5 -130t-60 -181.5
q-1 -26 10 -48q5 -12 16 -18.5t24 -6.5h673q12 0 23 6.5t17 18.5z" />
<glyph glyph-name="uniE62C" unicode="&#xe62c;" horiz-adv-x="1048"
d="M832 -127q0 -23 -11.5 -42.5t-31 -31t-43 -11.5t-43 11.5t-31 31t-11.5 42.5q0 36 25 61t60.5 25t60.5 -25t25 -61zM533 -126.5q0 -35.5 -25 -60.5t-60 -25t-60 25t-25 60.5t25 60.5t60 25t60 -25t25 -60.5zM277 620l-35 159q-3 14 -15 23.5t-27 9.5h-147
q-22 0 -37.5 -15.5t-15.5 -37.5t15.5 -38t37.5 -16h54l157 -627q3 -12 9.5 -22.5t16 -17.5t21 -11t23.5 -4h527q16 0 30.5 7t25 19.5t14.5 28.5l113 452q9 34 -13 62t-57 28h-697z" />
<glyph glyph-name="uniE62D" unicode="&#xe62d;"
d="M442 274h-84v-76h-230v76h-81q-20 0 -33.5 -12.5t-13.5 -31.5v-395q0 -20 13.5 -33.5t33.5 -13.5h395q19 0 31.5 13.5t12.5 33.5v395q0 13 -5.5 23t-15.5 15.5t-23 5.5zM977 812h-81v-77h-230v77h-84q-10 0 -18 -3.5t-14 -10t-9 -15t-3 -18.5v-395q0 -13 5.5 -23
t15.5 -15.5t23 -5.5h395q20 0 33.5 12.5t13.5 31.5v395q0 20 -13.5 33.5t-33.5 13.5zM977 274h-81v-76h-230v76h-84q-13 0 -23 -5.5t-15.5 -15.5t-5.5 -23v-395q0 -13 5.5 -23.5t15.5 -17t23 -6.5h395q20 0 33.5 13.5t13.5 33.5v395q0 19 -13.5 31.5t-33.5 12.5z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -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,7 @@ $nav.delegate('.guang-nav-item', 'tap', function() {
return;
}
index = $this.index();
$this.addClass('focus');
... ... @@ -75,12 +76,14 @@ $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');
//当未加载数据时去请求数据
if (state[curType].page === 0) {
loadMore($content, state[curType]);
}
//重置当前Tab的load-more
if (state[curType].end) {
$loading.addClass('hide');
... ... @@ -93,6 +96,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;
}
});
}
... ...
... ... @@ -188,7 +188,7 @@ function tsAnimate() {
window.setTimeout(tsAnimate, 3000);
} else {
if (start % 360 === 0) {
window.setTimeout(tsAnimate, 3 * 60 * 1000);
window.setTimeout(tsAnimate, 60 * 1000);
} else {
requestFrame(function () {
tsAnimate();
... ... @@ -197,5 +197,4 @@ function tsAnimate() {
}
}
tsAnimate();
setTimeout(tsAnimate, 3000);
... ...
... ... @@ -10,18 +10,20 @@ var $input = $('#search-input input');
var $clear = $('#search-input .clear-input');
var $form = $('#search-form');
var $history = $('.history');
$('#clear-history').bind('tap', function() {
$.ajax({
type: 'POST',
url: '/search/clearHistory',
success: function(data) {
if (data.code === 200) {
$history.html(''); //clear search history items
}
}
});
var $clearHistory = $('#clear-history');
var writeSearch = require('./write-search');
var ranToken = writeSearch.getRanToken();
$clearHistory.bind('tap', function() {
localStorage.removeItem('historys');
$history.html('');
});
$input.bind('input', function() {
... ... @@ -34,4 +36,33 @@ $input.bind('input', function() {
$clear.bind('tap', function() {
$input.val('').trigger('input');
});
\ No newline at end of file
});
//初始化历史搜索的内容
(function() {
var html = '',
history,
historys, i;
if (localStorage) {
historys = localStorage.getItem('historys');
if (historys && historys.length > 0) {
historys = historys.split(ranToken);
for (i = 0; i < historys.length; i++) {
history = historys[i];
if (history === '') {
continue;
}
html += '<li><a href="/?query=' + history + '">' + history + '</li>';
}
$history.html(html);
$clearHistory.removeClass('hide');
}
}
}());
writeSearch.bindWirteLocal($form);
\ No newline at end of file
... ...
/**
* 将搜索结果存localStorage
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/29
*/
var ranToken = ' ??++ ';
//获取分隔符
function getRanToken() {
return ranToken;
}
//绑定提交前的存local操作
function bindWirteLocal($form) {
$form.on('submit', function() {
var query = this.query.value,
historys;
if (localStorage) {
historys = localStorage.getItem('historys');
historys = historys ? historys : '';
if (historys.indexOf(ranToken + query + ranToken) > -1) {
return;
}
if (historys === '') {
query = ranToken + query;
}
historys += query + ranToken;
localStorage.setItem('historys', historys);
}
});
}
exports.getRanToken = getRanToken;
exports.bindWirteLocal = bindWirteLocal;
\ No newline at end of file
... ...
... ... @@ -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();
});
... ...
... ... @@ -10,17 +10,14 @@ var $page = $('.yoho-page');
var $loading;
/**
* 初始化loading mask
* @param $container loading容器, position:relative
*/
function initLoadingMask() {
//初始化
(function() {
var html = '<div class="loading-mask hide"><div class="loading"></div></div>';
$page.append(html);
$loading = $page.children('.loading-mask');
}
}());
//显示loading
function showLoadingMask() {
... ... @@ -32,6 +29,5 @@ function hideLoadingMask() {
$loading.addClass('hide');
}
exports.initLoadingMask = initLoadingMask;
exports.showLoadingMask = showLoadingMask;
exports.hideLoadingMask = hideLoadingMask;
\ No newline at end of file
... ...
... ... @@ -13,6 +13,8 @@ var $brandHeader = $('#brand-header'),
var filter = require('../plugin/filter');
var writeSearch = require('../index/write-search');
var tip = require('../plugin/tip');
var loading = require('../plugin/loading');
... ... @@ -209,7 +211,8 @@ function search(opt) {
lazyLoad($('.lazy'));
filter.registerCbFn(search);
loading.initLoadingMask();
writeSearch.bindWirteLocal($('#search-form'));
//导航栏点击逻辑说明:
//1.点击非active项时切换active状态
... ...
... ... @@ -10,6 +10,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)),
... ... @@ -164,6 +165,7 @@ function search(opt) {
});
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
... ... @@ -205,6 +207,7 @@ function search(opt) {
nav.page = page;
searching = false;
loading.hideLoadingMask();
}
});
... ... @@ -213,6 +216,7 @@ function search(opt) {
lazyLoad($('.lazy'));
filter.registerCbFn(search);
// loading.initLoadingMask();
//导航栏点击逻辑说明:
//1.点击非active项时切换active状态
... ... @@ -318,4 +322,7 @@ $(window).scroll(function() {
search();
}
}
});
\ No newline at end of file
});
//初始请求最新第一页数据
search();
... ...
... ... @@ -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,
... ... @@ -332,4 +337,7 @@ $(window).scroll(function() {
search();
}
}
});
\ No newline at end of file
});
//初始请求最新第一页数据
search();
... ...
.loading-mask {
position: absolute;
background: rgba(0,0,0,.3);
background: rgba(0,0,0,.1);
top: 0;
bottom: 0;
right: 0;
... ...
... ... @@ -24,6 +24,10 @@ $clothes: sprite-map("guang/clothes/*.png");
}
.guang-detail-page {
#wrapper {
background: #f0f0f0;
}
#wrapper.ios {
position: absolute;
top: 0;
... ...
... ... @@ -73,6 +73,7 @@
.info-list-container {
overflow-x: hidden;
background: #f0f0f0;
}
.info-list.hide {
... ...
... ... @@ -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
... ...
... ... @@ -29,8 +29,8 @@
}
} */
.home-header {
height: 88rem / $pxConvertRem;
line-height: 88rem / $pxConvertRem;
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
@include background-image(linear-gradient(#323232, #414141));
position: relative;
.iconfont {
... ...
.hot-brands {
background: #fff;
border-bottom: 1px solid #e0e0e0;
a {
... ... @@ -15,6 +14,7 @@
border-right: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
overflow: hidden;
background: #fff;
.brand-logo {
display: table-cell;
... ... @@ -54,7 +54,8 @@
width: 317rem / $pxConvertRem;
height: 174rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
background: #fff;
a {
display: block;
width: 100%;
... ... @@ -69,29 +70,28 @@
.brands-swiper {
background: #fff;
width: 100%;
height: 180rem / $pxConvertRem;
margin-bottom: 28rem / $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 +104,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
... ...
... ... @@ -30,11 +30,11 @@
.nav-icon, .nav-img {
position: absolute;
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
width: 48rem / $pxConvertRem;
height: 48rem / $pxConvertRem;
top: 50%;
margin-top: -30rem / $pxConvertRem;
left: 24rem / $pxConvertRem;
margin-top: -24rem / $pxConvertRem;
left: 30rem / $pxConvertRem;
}
.enter-subnav {
... ...
... ... @@ -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", "good", "filter", "loading", "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";
... ...
... ... @@ -88,15 +88,38 @@
background-color: #000000;
.index-channel-list {
padding-top: 50%;
width: 100%;
position: absolute;
top: 0;
padding-top: 50%;
width: 100%;
position: absolute;
top: -230rem / $pxConvertRem;
.homestyle {
.list-item {
display: block;
position: relative;
margin: 0 auto 50rem / $pxConvertRem;
width: 444rem / $pxConvertRem;
height: 110rem / $pxConvertRem;
text-align: center;
font-size: 30rem / $pxConvertRem;
line-height: 110rem / $pxConvertRem;
color: #fff;
background: #000;
border: 5rem / $pxConvertRem solid #fff;
font-weight: bold;
}
.lighter {
font-weight: lighter;
}
.right-icon {
position: absolute;
right: 10rem / $pxConvertRem;
top: 0;
font-weight: bold;
}
.homestyle {
margin-bottom: 50rem / $pxConvertRem;
width: 287.3rem / $pxConvertRem;
}
}
}
}
}
... ...
.footer-tab {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 100rem / $pxConvertRem;
padding-top: 20rem / $pxConvertRem;
box-sizing: border-box;
background: #fff;
border-top: 1px solid #b0b0b0;
z-index: 3;
.tab-item {
float: left;
width: 20%;
text-align: center;
color: #b0b0b0;
&.current {
color: #5e4b3c;
}
}
.tab-icon {
font-size: 40rem / $pxConvertRem;
line-height: 1;
}
.tab-name {
margin-top: 10rem / $pxConvertRem;
font-size: 20rem / $pxConvertRem;
line-height: 1;
}
}
\ No newline at end of file
... ...
... ... @@ -4,8 +4,8 @@
color: #fff;
width: 100%;
overflow: hidden;
height: 88rem / $pxConvertRem;
line-height: 88rem / $pxConvertRem;
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
&.boys {
@include background-image(linear-gradient(#323232, #414141));
... ...
... ... @@ -3,7 +3,7 @@
.swiper-container {
width: 100%;
height: 240rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
img {
height: 100%;
... ... @@ -23,7 +23,7 @@
.banner-top-single{
width: 100%;
height: 240rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
img {
display: block;
height: 100%;
... ...
{{> layout/header}}
<div class="brand-page yoho-page">
<div class="newbrand-search">
<div class="search-box clearfix">
<a href="/index/search/index" >
<input type="text" class="search-input" placeholder="查找品牌">
<i class="search-icon iconfont">&#xe60f;</i>
</a>
</div>
</div>
<div class="newbrand-search">
<div class="search-box clearfix">
<a href="{{searchUrl}}" >
<input type="text" class="search-input" placeholder="查找品牌">
<i class="search-icon iconfont">&#xe60f;</i>
</a>
</div>
</div>
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
{{# hotBrand}}
<div class="hot-brand">
{{# hotBrand}}
<div class="hot-brand">
<ul class="hot-brand-list clearfix">
{{# list}}
<li>
... ... @@ -28,59 +26,60 @@
</li>
{{/ list}}
</ul>
</div>
{{/ hotBrand}}
</div>
{{/ hotBrand}}
{{# brandList}}
<div class="brand-list bar-{{@index}}">
<div class="title-bar">
<h2 style="position: static;">{{title}}</h2>
</div>
{{# list}}
<p>
<a href="{{url}}">{{name}}
{{# isHot}}
<i class="icon-hot">Hot</i>
{{/ isHot}}
{{# isNew}}
<i class="icon-new">New</i>
{{/ isNew}}
</a>
</p>
{{/ list}}
</div>
{{/ brandList}}
{{# brandList}}
<div class="brand-list bar-{{@index}}">
<div class="title-bar">
<h2 style="position: static;">{{title}}</h2>
</div>
{{# list}}
<p>
<a href="{{url}}">{{name}}
{{# isHot}}
<i class="icon-hot">Hot</i>
{{/ isHot}}
{{# isNew}}
<i class="icon-new">New</i>
{{/ isNew}}
</a>
</p>
{{/ list}}
</div>
{{/ brandList}}
<div id="right-bar" class="right-bar">
<div id="right-bar" class="right-bar">
<div class="con" id="con">
<b>#</b>
<b>A</b>
<b>B</b>
<b>C</b>
<b>D</b>
<b>E</b>
<b>F</b>
<b>G</b>
<b>H</b>
<b>I</b>
<b>J</b>
<b>K</b>
<b>L</b>
<b>M</b>
<b>N</b>
<b>O</b>
<b>P</b>
<b>Q</b>
<b>R</b>
<b>S</b>
<b>T</b>
<b>U</b>
<b>V</b>
<b>W</b>
<b>X</b>
<b>Y</b>
<b>Z</b>
<b>#</b>
<b>A</b>
<b>B</b>
<b>C</b>
<b>D</b>
<b>E</b>
<b>F</b>
<b>G</b>
<b>H</b>
<b>I</b>
<b>J</b>
<b>K</b>
<b>L</b>
<b>M</b>
<b>N</b>
<b>O</b>
<b>P</b>
<b>Q</b>
<b>R</b>
<b>S</b>
<b>T</b>
<b>U</b>
<b>V</b>
<b>W</b>
<b>X</b>
<b>Y</b>
<b>Z</b>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
{{> layout/download_app}}
... ...
... ... @@ -40,4 +40,5 @@
</div>
{{/ category}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
... ... @@ -15,5 +15,5 @@
<div class="overlay"></div>
</div>
{{> home/side_nav}}
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
{{> layout/footer_tab}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -10,5 +10,5 @@
<div class="overlay"></div>
</div>
{{> home/side_nav}}
{{> layout/footer_tab}}
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
{{>layout/header}}
{{> layout/header}}
<div class="index-page yoho-page">
<div class="index-container">
<div class="index-header clearfix">
<div class="iconfont index-logo">&#xe60e;</div>
<form action="http://search.m.yohobuy.com" class="index-search">
<a href="javascript:void(0);" class="no-search">取消</a>
<div class="search-box">
<input type="text" name="query" placeholder="搜索">
<span class="iconfont clear-text">&#xe623;</span>
<span class="iconfont search-icon">&#xe60f;</span>
</div>
</form>
</div>
<div class="index-channel">
<img class="img" src="{{background}}" alt="">
<div class="index-channel-list">
<a href="/boys"><img class="homestyle" src="http://img10.static.yhbimg.com/adpic/2015/09/28/18/01bdbd27952eb5f780ac23641e70fd6e12.png"></a>
<a href="/girls"><img class="homestyle" src="http://img13.static.yhbimg.com/adpic/2015/09/28/18/025a4056cad1c2b6704a5d7c83066a2d25.png"></a>
</div>
</div>
</div>
<div class="index-container">
<div class="index-header clearfix">
<div class="iconfont index-logo">&#xe60e;</div>
<form action="{{searchUrl}}" class="index-search">
<a href="javascript:void(0);" class="no-search">取消</a>
<div class="search-box">
<input type="hidden" name="from" value="search">
<input type="text" name="query" placeholder="搜索">
<span class="iconfont clear-text">&#xe623;</span>
<span class="iconfont search-icon">&#xe60f;</span>
</div>
</form>
</div>
<div class="index-channel">
<img class="img" src="{{background}}" alt="">
<div class="index-channel-list">
<a href="/boys" class="list-item">男生 <span class="lighter">BOYS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/girls" class="list-item">女生 <span class="lighter">GIRLS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/kids" class="list-item">潮童 <span class="lighter">KIDS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/lifestyle" class="list-item">创意生活 <span class="lighter">LIFESTYLE</span> <span class="iconfont right-icon">&#xe614;</span></a>
</div>
</div>
</div>
</div>
{{>layout/footer}}
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
... ... @@ -21,5 +21,5 @@
<div class="overlay"></div>
</div>
{{> home/side_nav}}
{{> layout/footer_tab}}
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
... ... @@ -19,5 +19,5 @@
<div class="overlay"></div>
</div>
{{> home/side_nav}}
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
{{> layout/footer_tab}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<div class="search-page yoho-page">
{{# search}}
<div id="search-input" class="search-input">
<form action="/product/list/index" method="get">
<form id="search-form" action={{url}} method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" placeholder="搜索商品" name="query">
<i class="clear-input iconfont hide">&#xe626;</i>
... ... @@ -10,7 +10,7 @@
</form>
</div>
<div class="search-items">
<div class="hot-search">
<div class="hot-search hide">
<h3>热门搜索</h3>
<ul class="hot clearfix">
{{# hot}}
... ... @@ -22,15 +22,9 @@
</div>
<div class="history-search">
<h3>历史搜索</h3>
<ul class="history clearfix">
{{# history}}
<li>
<a href={{url}}>{{name}}</a>
</li>
{{/ history}}
</ul>
<ul class="history clearfix"></ul>
</div>
<button id="clear-history" class="clear-history">清空搜索历史</button>
<button id="clear-history" class="clear-history hide">清空搜索历史</button>
</div>
{{/ search}}
</div>
... ...
... ... @@ -2,4 +2,5 @@
<div class="good-list-page yoho-page">
{{> product/list}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
{{> filter}}
\ No newline at end of file
... ...
... ... @@ -83,4 +83,5 @@
{{/if}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
... ... @@ -94,4 +94,5 @@
{{/if}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="good-list-page yoho-page">
{{# goodList}}
{{# search}}
<div id="search-input" class="search-input">
<form action="/product/list/index" method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" value={{default}} name="query">
<i class="clear-input iconfont hide">&#xe61a;</i>
<button id="search" class="search" type="submit">搜索</button>
</form>
</div>
{{/ search}}
{{# brandWay}}
<div class="brand-way">
<a href={{url}}>
<img class="brand-thumb" src={{thumb}}>
<span>{{name}}</span>
<span class="entry">
进入品牌
<i class="iconfont">&#xe614;</i>
</span>
</a>
</div>
{{/ brandWay}}
{{# brandHome}}
<div id="brand-header" class="brand-header" data-id={{id}}>
<img class="lazy" data-original={{banner}}>
<a class="btn-intro" href="javascript:void(0);">
品牌介绍
</a>
<a class="btn-col" href="javascript:void(0);">
<span class="iconfont">&#xe622;</span>
收藏
</a>
</div>
<div id="intro-box" class="brand-intro-box hide">
<div id="brand-intro" class="brand-intro">
<h2>品牌介绍</h2>
<div class="con">
{{{intro}}}
</div>
<p class="fo">
<span></span>
100%品牌授权正品
</p>
<span class="iconfont close-intro">&#xe623;</span>
</div>
</div>
{{/ brandHome}}
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
最新
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
价格
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
折扣
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
筛选
<span class="iconfont">&#xe613;</span>
</a>
</li>
</ul>
<div id="goods-container" class="goods-container">
<div class="new-goods container">
{{# new}}
{{> good}}
{{/ new}}
</div>
<div class="price-goods container hide"></div>
<div class="discount-goods container hide"></div>
{{> filter}}
</div>
{{#if brand}}
<input id="brand" type="hidden" value={{brand}}>
{{/if}}
{{#if gender}}
<input id="gender" type="hidden" value={{gender}}>
{{/if}}
{{#if sort}}
<input id="sort" type="hidden" value={{sort}}>
{{/if}}
{{#if color}}
<input id="color" type="hidden" value={{color}}>
{{/if}}
{{#if size}}
<input id="size" type="hidden" value={{size}}>
{{/if}}
{{#if price}}
<input id="price" type="hidden" value={{price}}>
{{/if}}
{{#if discount}}
<input id="discount" type="hidden" value={{discount}}>
{{/if}}
{{/ goodList}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{# new}}
{{> good}}
{{/ new}}
\ No newline at end of file
{{# 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
... ...
{{> layout/page_footer}}
{{> layout/download_app}}
{{#if rlsEnv}}
<script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script>
... ...
{{# showFooterTab}}
<div class="footer-tab">
<div class="tab-item {{#if grilsHomePage}}current{{/if}}{{#if boysHomePage}}current{{/if}}{{#if kidsHomePage}}current{{/if}}{{#if lifestyleHomePage}}current{{/if}}">
<p class="iconfont tab-icon">&#xe62a;</p>
<p class="tab-name">首页</p>
</div>
<div class="tab-item {{#if categoryPage}}current{{/if}}">
<p class="iconfont tab-icon">&#xe62d;</p>
<p class="tab-name">分类</p>
</div>
<div class="tab-item {{#if guangHome}}current{{/if}}">
<p class="iconfont tab-icon">&#xe611;</p>
<p class="tab-name">逛</p>
</div>
<div class="tab-item {{#if shoppingCartPage}}current{{/if}}">
<p class="iconfont tab-icon">&#xe62c;</p>
<p class="tab-name">购物车</p>
</div>
<div class="tab-item {{#if minePage}}current{{/if}}">
<p class="iconfont tab-icon">&#xe62b;</p>
<p class="tab-name">我的</p>
</div>
</div>
{{/ showFooterTab}}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>{{title}}YOHO!有货</title>
<title>{{title}}Yoho!Buy有货</title>
<meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
<meta name="description" content="{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
... ...
... ... @@ -122,6 +122,7 @@
{{#if newArrivalPage}}
<script>
seajs.use('js/product/newsale/newarrival');
seajs.use('js/index/footer');
</script>
{{/if}}
... ... @@ -129,6 +130,7 @@
{{#if discountPage}}
<script>
seajs.use('js/product/newsale/discount');
seajs.use('js/index/footer');
</script>
{{/if}}
... ... @@ -136,6 +138,7 @@
{{#if goodListPage}}
<script>
seajs.use('js/product/list');
seajs.use('js/index/footer');
</script>
{{/if}}
... ... @@ -150,6 +153,7 @@
{{#if categoryPage}}
<script>
seajs.use('js/category/index');
seajs.use('js/index/footer');
</script>
{{/if}}
... ... @@ -157,6 +161,7 @@
{{#if brandPage}}
<script>
seajs.use('js/category/brand');
seajs.use('js/index/footer');
</script>
{{/if}}
... ... @@ -164,6 +169,7 @@
{{#if searchPage}}
<script>
seajs.use('js/index/search');
seajs.use('js/index/footer');
</script>
{{/if}}
... ...
{{# goodList}}
{{# search}}
<div id="search-input" class="search-input">
<form action={{url}} method="get">
<form id="search-form" action={{url}} method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" value={{default}} name="query">
<i class="clear-input iconfont hide">&#xe61a;</i>
... ...
<?php
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 男生首页
... ... @@ -26,11 +27,39 @@ class BoysController extends AbstractAction
// 渲染模板并输出
$this->_view->display('index', array(
'boysHomePage' => true,
'showDownloadApp'=>true,
'showFooterTab'=>true,
'maybeLike' => true,
'content' => Index\HomeModel::getBoysFloor()
'content' => Index\HomeModel::getBoysFloor(),
'pageFooter' => true,
));
}
/**
* 异步获取男首底部banner数据
* @return string 底部Banner数据
*/
public function bottomBannerAction()
{
do
{
if(!$this->isAjax())
{
break;
}
$channel = Helpers::getChannelByCookie();
$bottomBanner = Index\HomeModel::getBottomBanner($channel);
if($bottomBanner)
{
$this->echoJson($bottomBanner);
}
}
while(false);
echo ' ';
}
}
... ...
<?php
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 女生首页
... ... @@ -26,10 +27,38 @@ class GirlsController extends AbstractAction
// 渲染模板并输出
$this->_view->display('index', array(
'grilsHomePage' => true,
'showDownloadApp'=>true,
'showFooterTab'=>true,
'maybeLike' => true,
'content' => Index\HomeModel::getGirlsFloor()
'content' => Index\HomeModel::getGirlsFloor(),
'pageFooter' => true,
));
}
/**
* 异步获取女首底部banner数据
* @return string 底部Banner数据
*/
public function bottomBannerAction()
{
do
{
if(!$this->isAjax())
{
break;
}
$channel = Helpers::getChannelByCookie();
$bottomBanner = Index\HomeModel::getBottomBanner($channel);
if($bottomBanner)
{
$this->echoJson($bottomBanner);
}
}
while(false);
echo ' ';
}
}
... ...
<?php
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 频道选择
... ... @@ -20,7 +21,9 @@ class IndexController extends AbstractAction
$this->_view->display('index', array(
'background' => Index\HomeModel::getBgImage(),
'channelPage' => true,
'showDownloadApp'=>true
'showDownloadApp'=>true,
'searchUrl' => Helpers::url('', null, 'search'),
'pageFooter' => true,
));
}
... ...
... ... @@ -26,9 +26,10 @@ class KidsController extends AbstractAction
// 渲染模板并输出
$this->_view->display('index', array(
'kidsHomePage' => true,
'showDownloadApp'=>true,
'showFooterTab'=>true,
'maybeLike' => true,
'content' => Index\HomeModel::getKidsFloor()
'content' => Index\HomeModel::getKidsFloor(),
'pageFooter' => true,
));
}
... ...
... ... @@ -26,9 +26,10 @@ class LifestyleController extends AbstractAction
// 渲染模板并输出
$this->_view->display('index', array(
'lifestyleHomePage' => true,
'showDownloadApp'=>true,
'showFooterTab'=>true,
'maybeLike' => true,
'content' => Index\HomeModel::getLifestyleFloor()
'content' => Index\HomeModel::getLifestyleFloor(),
'pageFooter' => true,
));
}
... ...
... ... @@ -16,40 +16,10 @@ class SearchController extends AbstractAction
*/
public function indexAction()
{
$data = array(
array(
'hot' => array(
array(
'name' => '夹克',
'url' => 'm.yohobuy.com'
),
array(
'name' => '休闲运动鞋',
'url' => 'm.yohobuy.com'
),
array(
'name' => 'Into the Rainbow',
'url' => 'm.yohobuy.com'
)
),
'history' => array(
array(
'name' => 'what',
'url' => 'm.yohobuy.com'
),
array(
'name' => 'the',
'url' => 'm.yohobuy.com'
),
array(
'name' => 'fuck',
'url' => 'm.yohobuy.com'
)
)
)
);
$this->_view->html('search');
$this->_view->display('index', array(
'search' => $data,
'search' => array('url' => Helpers::url('', null, 'search')),
'showDownloadApp' => true,
'searchPage' => true,
'pageFooter' => true
));
... ... @@ -73,8 +43,8 @@ class SearchController extends AbstractAction
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$query = isset($condition['query']) ? strtolower(trim($condition['query'])) : null;
$query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
unset($condition['discount']);
... ... @@ -120,16 +90,15 @@ class SearchController extends AbstractAction
// 跳转到品牌商品列表页
if ($domain !== null) {
$url = Helpers::url('', array(
'from' => 'search',
'query' => $query,
'gender' => $condition['gender']
), $domain);
$url = Helpers::url('', array(
'from' => 'search',
'query' => $query,
'gender' => $condition['gender']
), $domain);
$this->go($url);
}
}
/* 判断是不是品类, 是品类加导航标题(不显示搜索框) */
if ($haveQuery) {
$classNames = Category\ClassModel::getClassNames();
... ... @@ -178,25 +147,25 @@ class SearchController extends AbstractAction
$data['goodList'] = $condition;
$data['query'] = $query;
// 查询数据
if (!isset($condition['query'])) {
$data['goodList'] += Product\ListModel::getClassData($condition);
} else {
$listData = SearchData::searchByCondition($condition);
// 处理返回的数据
if (!empty($listData['data']['brand'])) {
$brandData = $listData['data']['brand'];
$data['brandWay'] = array(
'url' => 'http://' . $brandData['brand_domain'] . SUB_DOMAIN,
'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
'name' => $brandData['brand_name']
);
// 设置品牌默认值
$data['goodList']['brand'] = $brandData['id'];
$data['goodList'] += ListProcess::getListData($listData['data']);
}
$listData = array();
}
// // 查询数据
// if (!isset($condition['query'])) {
// $data['goodList'] += Product\ListModel::getClassData($condition);
// } else {
// $listData = SearchData::searchByCondition($condition);
// // 处理返回的数据
// if (!empty($listData['data']['brand'])) {
// $brandData = $listData['data']['brand'];
// $data['brandWay'] = array(
// 'url' => 'http://' . $brandData['brand_domain'] . SUB_DOMAIN,
// 'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
// 'name' => $brandData['brand_name']
// );
// // 设置品牌默认值
// $data['goodList']['brand'] = $brandData['id'];
// $data['goodList'] += ListProcess::getListData($listData['data']);
// }
// $listData = array();
// }
$this->_view->display('list', $data);
}
... ...
... ... @@ -55,6 +55,10 @@ class BrandModel
// 模板中的使用JS标识
$result['brandPage'] = true;
// 是否显示app下载浮层标识
$result['showDownloadApp'] = true;
// 搜索链接地址
$result['searchUrl'] = Helpers::url('/search.html', null, 'search');
/* 顶部的轮翻广告列表 */
if (!empty($brand['brandTop'][0]['data'])) {
... ...
... ... @@ -38,25 +38,16 @@ class ClassModel
}
do {
$num = 1;
$data = ClassData::getClassesData();
if (!isset($data['code']) || $data['code'] !== 200) {
break;
}
if (!isset($data['data'])) {
if (empty($data['data'])) {
break;
}
$oneClass = array();
$item = array();
foreach ($data['data'] as $k => $v) {
$oneClass = array('name' => $k, 'ca' => array());
if ($num === 1) {
$oneClass['focus'] = true;
}
$oneClass = array('name' => ucfirst($k), 'ca' => array());
foreach ($v as $val) {
$item = array();
$item['name'] = $val['category_name'];
... ... @@ -69,14 +60,12 @@ class ClassModel
'sort' => $value['relation_parameter']['sort'],
'sort_name' => $value['category_name']
), 'list');
$item['sub'][] = $subitem;
}
$oneClass['ca'][] = $item;
}
$num++;
$result[] = $oneClass;
}
... ...
... ... @@ -91,7 +91,94 @@ 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;
}
}
// 只有当$type=0时才有广告参数返回, 所以需要再调一次!!
else {
$temp = ListData::article('1,3', 0, 0, '', $page);
if (!empty($temp['data']['list']['adlist'])) {
foreach ($temp['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;
}
}
$temp = array();
}
// 内容列表
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;
}
... ...
... ... @@ -45,6 +45,11 @@ class HomeModel
/* COOKIE标识访问的是创意生活频道 */
const COOKIE_NAME_LIFESTYLE = 'lifestyle';
/* COOKIE标识访问的是男生频道底部Banner */
const COOKIE_NAME_BOYS_BOTTOM_BANNER = '8c48745a39373d621bf5fd80edf59b5e';
/* COOKIE标识访问的是女生频道频道底部Banner */
const COOKIE_NAME_GIRLS_BOTTOM_BANNER = 'c63939b2ad458e9cb51147940c1da2e5';
/**
* 选择频道
*
... ... @@ -112,6 +117,56 @@ class HomeModel
}
/**
* 获取男生,女生底部banner
*
* @return string | false
*/
public static function getBottomBanner($channel)
{
$result = false;
if($channel == 2) {
$resource = self::COOKIE_NAME_GIRLS_BOTTOM_BANNER;
$cache = CacheConfig::KEY_ACTION_GRILS_BOTTOM_BANNER;
} else {
$resource = self::COOKIE_NAME_BOYS_BOTTOM_BANNER;
$cache = CacheConfig::KEY_ACTION_BOYS_BOTTOM_BANNER;
}
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($cache, 'master');
if (!empty($result)) {
return $result;
}
}
// 调用接口获取数据
$banner = IndexData::getBannerStart($resource);
if (isset($banner['code']) && $banner['code'] == 200) {
// 构建数据
$data = array();
foreach ($banner['data'] as $val) {
$data['list'][] = $val;
}
$result = FloorProcess::getContent($data, $channel);
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($cache, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($cache, $result);
}
}
return $result;
}
/**
* 获取男生首页的楼层数据
*
* @return array | false
... ... @@ -168,7 +223,7 @@ class HomeModel
// 调用接口获取楼层数据, 并封装成模板渲染需要的数据格式
$channelData = IndexData::getResourceData('2,3', self::CODE_FLOOR_GIRLS);
if (isset($channelData['code']) && $channelData['code'] == 200) {
$result = FloorProcess::getContent($channelData['data']);
$result = FloorProcess::getContent($channelData['data'], 2);
}
if (USE_CACHE) {
... ...
... ... @@ -48,7 +48,7 @@ class SideModel
$result[$key]['textEn'] = $value['sort_name_en'];
$result[$key]['styleClass'] = strtolower($value['sort_name_en']);
$result[$key]['url'] = Helpers::getFilterUrl($value['sort_url']);
$result[$key]['img'] = Helpers::getImageUrl($value['sort_ico'], 60, 60);
$result[$key]['img'] = Helpers::getImageUrl($value['sort_ico'], 60, 60, 1);
}
}
... ...
... ... @@ -5,6 +5,7 @@ namespace Product;
use Configs\CacheConfig;
use LibModels\Wap\Product\NewsaleData;
use Plugin\DataProcess\NewSaleProcess;
use Plugin\DataProcess\ListProcess;
use Plugin\Helpers;
use Plugin\Cache;
... ... @@ -213,10 +214,28 @@ class NewsaleModel
if (isset($data['code']) && $data['code'] === 200) {
foreach ($data['data']['product_list'] as $val) {
$result['goods'][] = Helpers::formatProduct($val);
$result['goods'][] = Helpers::formatProduct($val, true, false, false);
}
}
return $result;
}
/**
* 获取筛选数据
* @param array $data 接口返回的数据
* @return array 处理之后的数据
*/
public static function filterData($data)
{
$result = array();
/* 格式化筛选数据 */
if (isset($data['code']) && $data['code'] == 200 && isset($data['data']['filter'])) {
$result['filter'] = ListProcess::getFilterData($data['data']['filter']);
}
return $result;
}
}
... ...
<?php
use Action\AbstractAction;
use Category\ClassModel;
use Plugin\Helpers;
/**
* 品类
... ... @@ -9,21 +10,24 @@ class ClassController extends AbstractAction
{
public function indexAction()
{
$channel = Helpers::getChannelByCookie();
$classes = ClassModel::getClassData();
// 根据频道设置默认的焦点
if (!empty($classes)) {
$classes[$channel - 1]['focus'] = true;
}
$this->setTitle('商品分类');
$this->setNavHeader('商品分类');
$data = array(
'categoryPage' => true,
'pageHeader' => array (
'navBack' => true,
'navHome' => '/',
'navTitle' => '商品分类'
),
'showDownloadApp' => true,
'category' => array(
'class' => $classes
'class' => $classes,
'searchUrl' => Helpers::url('/search.html', null, 'search'),
)
);
$this->setTitle('商品分类');
$this->_view->display('index', $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;
... ...
... ... @@ -3,6 +3,7 @@
use Action\AbstractAction;
use LibModels\Wap\Passport\BackData;
use LibModels\Wap\Passport\RegData;
use Plugin\Helpers;
/**
* 频道选择
... ... @@ -31,9 +32,21 @@ class BackController extends AbstractAction
*/
public function sendemailAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '邮箱格式不正确,请重新输入', 'data' => '');
do
{
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
break;
}
$email = $this->post('email', '');
// 判断邮箱是否有效
if(!Helpers::verifyEmail($email))
{
break;
}
// 发送邮箱验证码
$result = BackData::sendCodeToEmail($email);
... ... @@ -42,8 +55,10 @@ class BackController extends AbstractAction
$result['data'] = '/passport/back/success?email='.$email;
}
$this->echoJson($result);
}
while (false);
$this->echoJson($result);
}
/**
... ... @@ -51,15 +66,28 @@ class BackController extends AbstractAction
*/
public function resendemailAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '重发邮件失败');
do
{
if(!$this->isAjax())
{
break;
}
$email = $this->get('email', '');
// 发送邮箱验证码
$result = BackData::sendCodeToEmail($email);
$return = BackData::sendCodeToEmail($email);
if(!empty($return))
{
$result = $return;
}
$this->echoJson($result);
}
while(false);
$this->echoJson($result);
}
public function successAction()
... ... @@ -72,7 +100,7 @@ class BackController extends AbstractAction
$domain_name = 'http://' . (($domain == 'gmail.com') ? 'mail.google.com' : 'mail.' . $domain);
$data = array(
'backUrl' => 'emailback.html',
'backUrl' => '/emailback.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backEmailSuccess' => true,
... ... @@ -133,20 +161,34 @@ class BackController extends AbstractAction
*/
public function sendcodeAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '手机号码格式不正确,请重新输入', 'data' => '');
do
{
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
break;
}
$phoneNum = $this->post('phoneNum', '');
$areaCode = $this->post('areaCode', 86);
if(!Helpers::verifyMobile($phoneNum))
{
break;
}
// 发送手机验证码
$result = BackData::sendCodeToMobile($phoneNum, $areaCode);
if($result['code'] === 200)
$return = BackData::sendCodeToMobile($phoneNum, $areaCode);
if($return && $return['code'] === 200)
{
$result = $return;
$result['data'] = '/passport/back/mobilecode?phoneNum='.$phoneNum.'&areaCode='.$areaCode;
}
$this->echoJson($result);
}
while (false);
$this->echoJson($result);
}
/**
... ...
... ... @@ -51,13 +51,14 @@ class IndexController extends AbstractAction
$this->setTitle($name);
$this->setNavHeader($name, true, SITE_MAIN);
$goodList = Product\ListModel::getClassData($condition);
if (!empty($condition) && !empty($goodList)) {
$goodList = array_merge($goodList, $condition);
}
// $goodList = Product\ListModel::getClassData($condition);
// if (!empty($condition) && !empty($goodList)) {
// $goodList = array_merge($goodList, $condition);
// }
$this->_view->display('index', array(
'goodListPage' => true,
'goodList' => $goodList,
'showDownloadApp' => true,
'goodList' => $condition,
));
}
... ... @@ -85,7 +86,7 @@ class IndexController extends AbstractAction
if (!isset($brandIds[0])) {
$this->error();
}
// 当前的登录用户UID
$uid = $this->getUid();
// 存标题信息
... ... @@ -107,22 +108,24 @@ 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']);
}
$data['goodListPage'] = true;
$data['showDownloadApp'] = true;
// 从搜索页过来的,显示搜索框, 和进入品牌引导信息
if ($from === 'search') {
$data['goodList'] = Product\ListModel::getBrandData($condition, $title);
$data['goodList'] = array();
$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);
$data['goodList'] = Product\ListModel::getBrandData($condition, $title);
$data['goodList'] = array();
}
$data['goodList'] += $condition;
... ...
... ... @@ -26,12 +26,9 @@ class NewsaleController extends AbstractAction
$data = array();
$data['newArrivalPage'] = true;
$data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel);
$goodsList = \Product\NewsaleModel::getNewProducts($channel, 60);
if (!empty($goodsList)) {
$data += $goodsList;
}
// 设置一些筛选的默认参数
$data += array(
'showDownloadApp'=>true,
'brand' => '0',
'sort' => '0',
'gender' => Helpers::getGenderByCookie(),
... ... @@ -59,12 +56,9 @@ class NewsaleController extends AbstractAction
$data = array();
$data['discountPage'] = true;
$data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel);
$goodsList = \Product\NewsaleModel::getSaleProducts($channel, 60);
if (!empty($goodsList)) {
$data += $goodsList;
}
// 设置一些筛选的默认参数
$data += array(
'showDownloadApp'=>true,
'brand' => '0',
'sort' => '0',
'gender' => Helpers::getGenderByCookie(),
... ... @@ -84,7 +78,7 @@ class NewsaleController extends AbstractAction
public function selectNewSaleAction()
{
if ($this->isAjax()) {
$gender = $this->get('gender', 'boys');
$gender = $this->get('gender', null);
$brand = $this->get('brand', null);
$sort = $this->get('sort', null);
$color = $this->get('color', null);
... ... @@ -95,30 +89,10 @@ class NewsaleController extends AbstractAction
$limit = $this->get('limit', 60);
$page = $this->get('page', 1);
// 转换性别
if ($gender === 'boys') {
$gender = '1,3';
} elseif ($gender === 'girls') {
$gender = '2,3';
} else {
$gender = '1,2,3';
}
// 转换排序方式
$order = $this->get('order', null);
$orderVal = $this->get('order', null);
$type = $this->get('type', '');
switch ($type) {
case 'price':
$order = ($order == 0) ? 's_p_desc' : 's_p_asc';
break;
case 'discount':
$order = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
break;
case 'newest':
default:
$order = ($order == 0) ? 's_t_desc' : 's_t_asc';
break;
}
$order = Helpers::transOrder($orderVal, $type);
// 转换频道
$channel = Helpers::getChannelByCookie();
... ... @@ -138,4 +112,45 @@ class NewsaleController extends AbstractAction
}
}
/**
* Ajax方式查询筛选数据
*
* @return array 筛选数据
*/
public function filterAction()
{
if ($this->isAjax()) {
$gender = $this->get('gender', null);
$brand = $this->get('brand', null);
$sort = $this->get('sort', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('discount', null);
$dayLimit = $this->get('dayLimit', null);
$limit = $this->get('limit', 60);
$page = $this->get('page', 1);
// 转换排序方式
$orderVal = $this->get('order', null);
$type = $this->get('type', '');
$order = Helpers::transOrder($orderVal, $type);
$channel = Helpers::getChannelByCookie();
$data = NewsaleData::selectNewSaleProducts(
$gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order
);
$result = \Product\NewsaleModel::filterData($data);
if (empty($result)) {
echo ' ';
} else {
$this->_view->display('filter', $result);
}
} else {
echo ' ';
}
}
}
... ...
... ... @@ -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);
... ...
... ... @@ -13,11 +13,11 @@ routes.error.route.controller = Error
routes.error.route.action = Index
; 搜索页
routes.reg.type = "rewrite"
routes.reg.match = "/search.html"
routes.reg.route.module = Index
routes.reg.route.controller = Search
routes.reg.route.action = Index
routes.search.type = "rewrite"
routes.search.match = "/search.html"
routes.search.route.module = Index
routes.search.route.controller = Search
routes.search.route.action = Index
; 注册页
routes.reg.type = "rewrite"
... ...
... ... @@ -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');
... ...