Authored by Rock Zhang

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

Showing 45 changed files with 1526 additions and 309 deletions
... ... @@ -449,6 +449,7 @@
},
...
],
hideMore: true, //隐藏更多和多选
//索引:index为索引键值(字母转化为小写)
brandIndex: [
{
... ...
... ... @@ -46,7 +46,7 @@ class LoginData extends \LibModels\Wap\Passport\LoginData
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL2, $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -2,33 +2,33 @@
namespace LibModels\Web\Product;
use Api\Yohobuy;
use Api\Sign;
/**
* 热销排行
*
* */
*/
class HotrankData extends \LibModels\Wap\Product\SearchData
{
const URI_HOTRANK_RES = '/operations/service/v4/resource';
const URI_HOTRANK_TAG = '/operations/api/v5/resource/get';
{
const URI_HOTRANK_TAG = 'http://test.service.api.yohobuy.com/operations/service/v1/hotranktag';
/**
获取热销排行
* 分类标签
* 获取标签
* $client_type 客户端类型
* $channel 频道类型
*/
public static function getHotranktag($client_type = 'web',$channel = 0, $is_concurrent = true, $callback = '')
public static function getHotranktag($client_type = 'web',$channel = 0,$is_concurrent = true)
{
// 构建必传参数
$params = Yohobuy::param();
$params['client_type'] = 'web';
$params['channel'] =$channel ;
$params['is_concurrent'] = true;
$params['callback'] = $callback;
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_HOTRANK_TAG, $params);
$params = array('client_type'=>$client_type,'channel'=>$channel,'is_concurrent' => $is_concurrent);
return Yohobuy::yarClient(self::URI_HOTRANK_TAG, 'getTag',$params);
}
/**
* 通过ID获取标签信息
* $id 标签ID
*/
public static function getTagById($id,$is_concurrent = true)
{
$params['id'] = $id;
return Yohobuy::yarClient(self::URI_HOTRANK_TAG, 'getOneTag',$params);
}
}
\ No newline at end of file
... ...
... ... @@ -834,9 +834,8 @@ class Process
{
$result = array();
$temp = array();
if ($data[$key]['template_name'] == 'custom_brands')
if ($data[$key]['template_name'] == 'custom_brands' || $data[$key]['template_name'] == 'kids_brands')
{
// print_r($data[$key]);
$result = array(
'hotBrands' => array(
'name' => '',
... ... @@ -856,7 +855,6 @@ class Process
{
$width = 185;
$height = 86;
$type = 'lifestyle';
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 2);
$val['url'] = Helpers::transUrl($val['url'], $type);
$floor['logoBrand'][] = array(
... ... @@ -865,11 +863,8 @@ class Process
);
}
$floor['moreBrand'] = 'http://yohobuy.com/brands';
//$floor['moreBrand'] = 'http://yohobuy.com/brands?gender=1,3&openby:yohobuy={"action":"go.list","params":{"actiontype":0,"gender":"1,3"}}';
//print_r($floor);
$type_key = sprintf("%s_%s", $type, $key);
$cacheKey = sprintf("%s_%s", CacheConfig::KEY_INDEX_BRANDS_LIST_DATA, $type_key);
//print_r($cacheKey);
Cache::set($cacheKey, $floor, 7200);
$result['hotBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key;
//print_r($result['hotBrands']['brandUrl']);
... ...
... ... @@ -1157,7 +1157,6 @@ class HelperSearch
'activities_id_desc' => 'activities.activity_id:desc',
'activities_id_asc' => 'activities.activity_id:asc',
);
$param = array();
$param['status'] = 1; // 是否上架,1表示在架,2表示不在
$param['sales'] = 'Y'; // 只搜索销售的产品
... ... @@ -1182,7 +1181,6 @@ class HelperSearch
if (!empty($condition)) {
$param += $condition;
}
return Yohobuy::httpBuildQuery(self::getUrl(), $param);
}
... ... @@ -1218,8 +1216,8 @@ class HelperSearch
}
/**
* 并行调接口url获取(获取品牌数据)
*/
* 并行调接口url获取(获取品牌数据)
*/
public static function getBrandUrl($customOptions = array())
{
// 构建必传参数
... ... @@ -1312,8 +1310,8 @@ class HelperSearch
elseif ($type == 'shop') {
return 'http://101.200.31.165/yohosearch/shops.json';
}
return 'http://101.200.31.165/yohosearch/search.json';
// return 'http://192.168.10.64:8080/yohosearch/search-once.json';
// return 'http://101.200.31.165/yohosearch/search.json';
return 'http://192.168.10.64:8080/yohosearch/search-once.json';
}
}
... ...
... ... @@ -28,9 +28,6 @@ var $chosePanel = $('#chose-panel'),
$sizeRowList,
$curColorBlock,
$colorRowList,
$curSizeRow,
$curColorRow,
rowIndex,
cbFn,
$allChoseItems,
queryString,
... ... @@ -48,9 +45,6 @@ function init() {
$sizeRowList = $('.size-list ul');
$colorRowList = $('.color-list ul');
$leftNum = $('#left-num');
$curSizeRow = $sizeRowList.eq(0);
$curColorRow = $colorRowList.eq(0);
rowIndex = 0;
curColorIndex = 0;
curSizeIndex = 0;
}
... ... @@ -138,6 +132,40 @@ function displayGoodNum(curGoodNum) {
}
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
function changeSizeChosed(newSizeIndex) {
var sizes,
queryString,
i;
if (curColorIndex && $curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
sizes = $sizeRowList.eq(newSizeIndex).children();
for (i = 0; i < sizes.length; i++) {
if ($(sizes[i]).data('name') === $curSizeBlock.data('name')) {
$curSizeBlock = $(sizes[i]);
queryString = '#' + $curSizeBlock.data('name');
curColorIndex = $(queryString).data('index');
}
}
$curSizeBlock.addClass('chosed');
return $curSizeBlock.data('num');
}
return 0;
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
function changeColorChosed(newColorIndex) {
if (curSizeIndex && $curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
$curColorBlock = $($colorRowList.eq(newColorIndex).children().get(curSizeIndex - 1));
$curColorBlock.addClass('chosed');
return $curColorBlock.data('num');
}
return 0;
}
init();
$yohoPage.on('touchstart', '.chose-panel', function(e) {
... ... @@ -153,13 +181,9 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
$yohoPage.on('touchstart', '.color-list .block', function() {
var $this = $(this),
index,
curSizeBlock,
index = $this.index(),
curGoodNum;
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
// 当前颜色已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
... ... @@ -169,54 +193,31 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
hasChooseColor = false;
//当前尺码行隐藏
$sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
$sizeRowList.eq(curSizeIndex).addClass('hide');
//目标尺码行显示
$sizeRowList.eq(0).removeClass('hide').addClass('show');
$sizeRowList.eq(0).removeClass('hide');
curSizeIndex = 0;
//如果尺码已经是选择状态
if (curColorIndex) {
// 之前选中的尺码去掉勾选样式,新尺码块勾选
if ($curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
curSizeBlock = $sizeRowList.eq(0).children().get(curColorIndex - 1);
$curSizeBlock = $(curSizeBlock);
curGoodNum = $curSizeBlock.data('num');
$curSizeBlock.addClass('chosed');
}
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
changeSizeChosed(0);
// 当前颜色不是选中状态,选中时
} else {
hasChooseColor = true;
//如果尺码已经是选择状态
if (curColorIndex) {
// 之前选中的尺码去掉勾选样式,新尺码块勾选
if ($curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
//curSizeBlock = $sizeRowList.eq(curSizeIndex + 1).children().get(curColorIndex - 1);
curSizeBlock = $sizeRowList.eq(index + 1).children().get(curColorIndex - 1);
$curSizeBlock = $(curSizeBlock);
curGoodNum = $curSizeBlock.data('num');
$curSizeBlock.addClass('chosed');
}
// 尺码行当前行隐藏
$sizeRowList.eq(curSizeIndex).addClass('hide');
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
curGoodNum = changeSizeChosed(index + 1);
// 显示剩余数量
displayGoodNum(curGoodNum);
// 尺码行当前行隐藏
$sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
//尺码对应行显示
$sizeRowList.eq(index + 1).removeClass('hide').addClass('show');
$sizeRowList.eq(index + 1).removeClass('hide');
curSizeIndex = index + 1;
$curColorBlock = $this;
... ... @@ -225,7 +226,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
$imgsThumb.addClass('hide').eq(index).removeClass('hide');
}
// 当前颜色块 切换勾选样式
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
$this.toggleClass('chosed');
$('#good-num').val(1);
... ... @@ -234,12 +236,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
}).on('touchstart', '.size-list .block', function() {
var $this = $(this),
index,
curColorBlock,
curGoodNum;
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
// 当前尺码已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
... ... @@ -249,56 +247,40 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
hasChooseSize = false;
//当前颜色行隐藏
$colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
$colorRowList.eq(curColorIndex).addClass('hide');
//目标颜色行显示
$colorRowList.eq(0).removeClass('hide').addClass('show');
$colorRowList.eq(0).removeClass('hide');
curColorIndex = 0;
//如果颜色已经是选择状态
if (curSizeIndex) {
// 之前选中的颜色去掉勾选样式,新颜色块勾选
if ($curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
curColorBlock = $colorRowList.eq(0).children().get(curSizeIndex - 1);
$curColorBlock = $(curColorBlock);
curGoodNum = $curColorBlock.data('num');
$curColorBlock.addClass('chosed');
}
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
changeColorChosed(0);
// 当前尺码不是选中状态,选中时
} else {
hasChooseSize = true;
//如果颜色已经是选择状态
if (curSizeIndex) {
index = $('#' + $this.data('name')).data('index') - 1;
// 之前选中的颜色去掉勾选样式,新颜色块勾选
if ($curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1);
$curColorBlock = $(curColorBlock);
curGoodNum = $curColorBlock.data('num');
$curColorBlock.addClass('chosed');
}
}
// 颜色当前行隐藏
$colorRowList.eq(curColorIndex).addClass('hide');
//老的选中颜色去掉勾选,新的选中颜色加上勾选
curGoodNum = changeColorChosed(index + 1);
// 显示剩余数量
displayGoodNum(curGoodNum);
// 颜色当前行隐藏
$colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
//颜色对应行显示
$colorRowList.eq(index + 1).removeClass('hide').addClass('show');
$colorRowList.eq(index + 1).removeClass('hide');
curColorIndex = index + 1;
$curSizeBlock = $this;
}
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
$this.toggleClass('chosed');
$('#good-num').val(1);
... ... @@ -425,4 +407,4 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
});
exports.init = init;
exports.show = show;
exports.show = show;
\ No newline at end of file
... ...
... ... @@ -165,7 +165,7 @@ if ($('.brand-search-page').length) {
if ($keyword.val().length) {
$icon.css('color', '#000');
$(this).closest('.search-box').css('width', '11.25rem');
$searchAction.show();
$searchAction.show().find('.clear-text').show();
} else {
$icon.css('color', '#b2b2b2');
$(this).closest('.search-box').css('width', '12.5rem');
... ... @@ -177,7 +177,7 @@ if ($('.brand-search-page').length) {
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
$icon.css('color', '#000');
$keyword.closest('.search-box').css('width', '11.25rem');
$searchAction.show();
$searchAction.show().find('.clear-text').hide();
clearTextHammer = new Hammer($('.clear-text')[0]);
clearTextHammer.on('tap', function(e) {
... ...
... ... @@ -19,17 +19,10 @@
<div class="chose-items">
<div class="color-list block-list">
<span>颜色</span>
<!--<ul class="clearfix" data-type="color">
{{# colors}}
<li class="block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}zero-stock{{/unless}}" data-num="{{colorNum}}" data-id="{{id}}" data-numstr="{{sizeNumStr}}" data-skcid="{{skcId}}">
{{name}}
</li>
{{/ colors}}
</ul>-->
{{# colors}}
<ul class="size-row clearfix {{#unless @first}}hide{{/if}}">
<ul id="{{sizeName}}" data-index="{{@index}}" class="size-row clearfix {{#unless @first}}hide{{/if}}">
{{# color}}
<li class="block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}zero-stock{{/unless}}" data-num="{{colorNum}}" data-id="{{id}}" data-numstr="{{sizeNumStr}}" data-skcid="{{skcId}}">
<li class="block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}zero-stock{{/unless}}" data-num="{{colorNum}}">
{{name}}
</li>
{{/ color}}
... ... @@ -41,20 +34,12 @@
{{# sizes}}
<ul class="size-row clearfix {{#unless @first}}hide{{/if}}">
{{# size}}
<li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id="{{id}}" data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}">
<li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-num="{{sizeNum}}" data-name="{{name}}" data-skuid="{{skuId}}">
{{name}}
</li>
{{/ size}}
</ul>
{{/ sizes}}
<!--{{#if defaultSizes}}
<ul class="size-row clearfix default-size">
{{#each defaultSizes}}
<li class="block {{#if numZero}}zero-stock{{/if}}" data-numstr="{{numStr}}">{{name}}</li>
{{/each}}
</ul>
{{/if}}-->
</div>
<p>
<div class="num">
... ...
... ... @@ -2,9 +2,14 @@
<div class="new-sale-page product-page yoho-page">
{{# saleList}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
<div class="sale-list-banner" style="height: {{bannerHeight}}px;">
<ul style="height: {{bannerHeight}}px;">
{{# list}}
<li class="banner-img" style="background:url({{img}}) no-repeat top center;"></li>
{{/ list}}
</ul>
</div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{# saleTitle}}
<div class="header-title">
... ...
... ... @@ -144,7 +144,7 @@
{{!-- sale列表 --}}
{{#if saleListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
seajs.use(['js/product/list', 'js/product/product', 'js/product/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
... ...
... ... @@ -39,7 +39,7 @@
<span class="title">性别:</span>
<div class="attr-content clearfix">
{{#each channel}}
{{#each gender}}
<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">
{{name}}
</a>
... ... @@ -55,7 +55,7 @@
<div class="attr-content">
<ul class="sort-pre clearfix">
{{#each sort}}
<li>
<li data-id="{{id}}">
<span class="attr {{#if checked}}checked{{/if}}">
{{name}}
<div class="sort-up-icon"></div>
... ... @@ -92,14 +92,16 @@
{{/ default}}
</ul>
<div class="brand-opt">
<span id="brand-more" class="brand-more">
<em>更多</em>
<i class="iconfont">&#xe600;</i>
</span>
{{#unless hideMore}}
<div class="brand-opt">
<span id="brand-more" class="brand-more">
<em>更多</em>
<i class="iconfont">&#xe600;</i>
</span>
<span id="brand-multi" class="multi-select">多选 +</span>
</div>
<span id="brand-multi" class="multi-select">多选 +</span>
</div>
{{/unless}}
<div class="brand-panel hide">
<div class="panel-head clearfix">
... ... @@ -177,17 +179,15 @@
</div>
{{/if}}
{{#if size}}
<div class="size section">
<span class="title">尺码:</span>
<div class="size section hide">
<span class="title">尺码:</span>
<div class="attr-content clearfix">
{{# size}}
<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>
{{/ size}}
</div>
<div class="attr-content clearfix">
{{# size}}
<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>
{{/ size}}
</div>
{{/if}}
</div>
{{#if seniorChose}}
<div class="senior section">
... ...
... ... @@ -25,7 +25,7 @@
{{/ tags}}
</div>
<div class="good-detail-img">
<a class="good-thumb" href="{{url}}">
<a class="good-thumb" href="{{url}}" target="_blank">
<img class="lazy" data-original="{{thumb}}">
</a>
{{# isFew}}
... ... @@ -37,7 +37,7 @@
{{/if}}
</div>
<div class="good-detail-text">
<a href="{{url}}">{{name}}</a>
<a href="{{url}}" target="_blank">{{name}}</a>
<p class="price">
{{# marketPrice}}
<span class="market-price">¥{{.}}</span>
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -750,6 +750,73 @@ function actionTipPic() {
});
}
function closeCover(){
var $cover = $('#cover');
$cover.remove();
}
/**
* 首次进入有弹窗
* @return {[type]} [description]
*/
function actionCover() {
var gender = cookieMap._Gender;
setCookie('_Channel','boys',{path : '/',domain : '.yohobuy.com',expires : 7});
if(typeof gender == 'undefined' || gender == '' || gender == null){
$.get('http://www.yohobuy.com/index/guide', function(data){
var newMask = document.createElement("div");
newMask.id = 'cover';
newMask.innerHTML=data;
document.body.appendChild(newMask);
var window_height = $(window).height();
var self_height = $('.guide-box').height();
var container_top = window_height / 2 - self_height / 2;
var length=$('.guide-box .clear').find("li").length;
$('.guide-box').css({
width: (200 * length) + 'px',
top: container_top + 'px'
});
$('#cover').bind('click', function(event){
setCookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
setCookie('_Channel','boys',{path : '/',domain : '.yohobuy.com',expires : 7});
closeCover();
});
$('#cover .guide-box .close').bind('click', function(event){
getSource('弹窗','CLOSE','homepage_man');
setCookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
setCookie('_Channel','boys',{path : '/',domain : '.yohobuy.com',expires : 7});
analy('guide_close');
closeCover();
});
$('.boys img , .boys .go').bind('click', function(event){
getSource('弹窗','BOYS','homepage_man');
setCookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
setCookie('_Channel','boys',{path : '/',domain : '.yohobuy.com',expires : 7});
analy( 'guide_boys');
closeCover();
});
$('.girls img, .girls .go').bind('click', function(event){
getSource('弹窗','GIRLS','homepage_woman');
setCookie('_Gender','2,3',{path : '/',domain : '.yohobuy.com',expires : 90});
setCookie('_Channel','girls',{path : '/',domain : '.yohobuy.com',expires : 7});
analy( 'guide_girls');
});
$('.lifestyle img, .lifestyle .go').bind('click', function(event){
setCookie('_Channel','lifestyle',{path : '/',domain : '.yohobuy.com',expires : 7});
getSource('弹窗','LIEFSTYLE','homepage_lifestyle');
analy( 'guide_lifestyle');
});
//防止冒泡事件
$('#cover .guide-box').bind('click', function(event){
event.stopPropagation();
});
});
}
}
/**
* 查询跳转后保留关键字
* @return {[type]} [description]
... ... @@ -1200,7 +1267,7 @@ function actionExeTemplate() {
* @return {[type]} [description]
*/
function actionSearch() {
var searchDomain = 'http://search.yohobuy.com/product/search/suggest';
var searchDomain = 'http://search.yohobuy.com/api/suggest';
$('#query_key').search(searchDomain);
}
... ... @@ -1374,6 +1441,7 @@ function init() {
actionListenDelCarGoods(); //监听购物车删除
actionListenCartMore(); //
actionLoginInfo(); //获取登录信息
actionCover(); //初次登录弹框
}
init();
\ No newline at end of file
init();
... ...
... ... @@ -211,13 +211,17 @@ $account.on('keyup', function() {
//密码
$password.on('blur', function() {
validatePassword();
if ($capsLock.hasClass('hide')) {
return;
}
$capsLock.addClass('hide');
}).on('keypress', function(e) {
var code = e.which,
isShift = e.shiftKey || (code === 16) || false;
var code = e.which;
//CapsLock检测
if ((!isShift && (code >= 65 && code <= 90)) ||
(isShift && (code >= 97 && code <= 122))) {
if (code >= 65 && code <= 90) {
$capsLock.removeClass('hide');
return;
}
... ... @@ -276,7 +280,7 @@ $('#login-btn').on('click', function() {
if (data.data) {
//防止data.data为undefined时下行语句执行出错而导致脚本不能走到complete去处理authing
location.href = data.data.href;
location.href = data.data.session;
}
} else {
$passwordTip.removeClass('hide').children('em').text(data.message);
... ...
... ... @@ -417,6 +417,18 @@ function pwdFn($obj) {
// Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题
// ( ▼-▼ )注册页和信息完善页面接口不同
exports.init = function(page) {
$('#agree-terms').click(function() {
if ($(this).attr('notchecked')) {
console.log(1);
$(this).removeAttr('notchecked');
} else {
console.log(2);
$(this).attr('notchecked', 'true');
}
});
$registerPage.find('.va').keyup(function() {
var j,
... ... @@ -438,7 +450,7 @@ exports.init = function(page) {
}
if (statusLen === 4 && $('#agree-terms').is(':checked')) {
if (statusLen === 4 && !$('#agree-terms').attr('notchecked')) {
$registerBtn.removeClass('disable').removeAttr('disabled');
} else {
$registerBtn.addClass('disable').attr('disabled', 'true');
... ... @@ -515,18 +527,6 @@ exports.init = function(page) {
});
// 防止粘贴密码
/*$('#pwd, #repwd').keydown(function (event) {
console.log(event.ctrlKey);
console.log(isPwd);
console.log(event.keyCode);
if (event.ctrlKey && isPwd && event.keyCode === 86) {
$(this).val(pwdVal);
}
});*/
$pwd[0].onpaste = function() {
return false;
};
... ...
/*
* author: chenglong
*/
var Slide = require('../common/yohoui/YH.slide');
var $ = require('yoho.jquery');
var $contain = $('.sale-list-banner');
var $item = $contain.find('li');
var index = 0;
var pagationStr = '';
var pagationBoxStr = '';
var i;
var current = true;
var slide;
for (i = 0; i < $item.length; i++) {
if (i === 0) {
pagationStr += '<span class="active"></span>';
} else {
pagationStr += '<span></span>';
}
}
pagationBoxStr = '<div class="sale-list-pagation"><div>' + pagationStr + '</div></div>';
$contain.append($(pagationBoxStr));
slide = new Slide({
length: $item.length,
loop: true,
auto: true,
timeout: 2,
index: 0
});
slide.on('change', function(data) {
if (current) {
current = false;
} else {
return;
}
index++;
$('.sale-list-pagation').find('span').removeClass('active');
$item.eq(data.from).animate({
opacity: 0
}, 300);
$item.eq(data.to).css({
zIndex: index
}).animate({
opacity: 1
}, 300, function() {
current = true;
});
$('.sale-list-pagation').find('span').eq(data.to).addClass('active');
});
$contain.hover(function() {
if (current) {
slide.pause();
}
}, function() {
slide.resume();
});
$('.sale-list-pagation span').click(function() {
var index = $(this).index();
if (current) {
slide.go(index);
}
});
slide.init();
\ No newline at end of file
... ...
... ... @@ -4,7 +4,8 @@
* @date: 2015/12/4
*/
var $ = require('yoho.jquery');
var $ = require('yoho.jquery'),
Handlebars = require('yoho.handlebars');
var checkUnicode = {
unchecked: '&#xe613;',
... ... @@ -38,6 +39,13 @@ var $seniorSubWrap = $('.senior-sub-wrap'),
var seniorHoverTime, hoveredIndex;
// 尺寸 handlebars 模板
var sizeTmpl = '{{# size}}<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>{{/ size}}',
sizeCache = {}, // 缓存一下尺寸信息
$sizeWrap = $('.filter-box .size');
sizeTmpl = Handlebars.compile(sizeTmpl);
//清除checkbox选中状态
function clearChecked($checkbox) {
$checkbox.removeClass('checked').html(checkUnicode.unchecked);
... ... @@ -85,13 +93,45 @@ $('.filter-box').on('selectstart', '.attr, .brands-index span', function() {
//【分类】
$('.sort-pre').on('click', 'li', function() {
var $this = $(this),
index = $this.index();
index = $this.index(),
id = $this.data('id');
if ($this.hasClass('active')) {
// 选中时,再次点击取消选中
$this.removeClass('active');
$sortSub.children(':eq(' + index + ')').addClass('hide');
$sizeWrap.addClass('hide');
return;
}
$this.siblings('.active').removeClass('active');
$this.addClass('active');
$sortSub.children(':not(.hide)').addClass('hide');
$sortSub.children(':eq(' + index + ')').removeClass('hide');
if (sizeCache[id]) {
$sizeWrap.find('.attr-content').html(sizeCache[id]);
$sizeWrap.removeClass('hide');
} else {
$.ajax({
url: '/product/search/sortSize',
data: {
msort: id
}
}).then(function(res) {
if ($.type(res) === 'array' && res.length) {
sizeCache[id] = sizeTmpl({
size: res
});
$sizeWrap.find('.attr-content').html(sizeCache[id]);
$sizeWrap.removeClass('hide');
} else {
$sizeWrap.addClass('hide');
}
});
}
});
//【品牌】
... ... @@ -132,10 +172,17 @@ $brandMore.click(function() {
});
//【品牌】索引
$('.brands-index').on('click', 'span', function() {
$('.brands-index').on('mouseenter', 'span', function() {
var $this = $(this),
index = $this.data('index');
if ($this.hasClass('hover')) {
return;
}
$this.siblings('span.hover').removeClass('hover');
$this.addClass('hover');
if ($this.index() === 0) {
//全部
... ...
... ... @@ -35,7 +35,7 @@ $('.logo-brand').logoBrand({
'<div class="good-info">' +
'<div class="item-img">' +
'<a class="good-thumb" target="_blank" href="\{{url}}">' +
'<img class="lazy" data-original="\{{img}}">' +
'<img class="lazy" data-original="\{{thumb}}">' +
'</a>' +
'</div>' +
'<div class="good-detail-text">' +
... ... @@ -117,6 +117,10 @@ $('.logo-brand').logoBrand({
var nowIndex = $(this).index(),
sid = $(this).data('sid');
if ($(this).hasClass('current')) {
return;
}
//处理current样式
$(this).addClass('current').siblings().removeClass('current');
$('.floatlayer').find('li').removeClass('current').eq(nowIndex).addClass('current');
... ... @@ -135,7 +139,11 @@ $('.logo-brand').logoBrand({
$('.floatlayer').on('click', 'li', function() {
var nowIndex = $(this).index();
$('.hot-cate').find('li').trigger('click');
if ($(this).hasClass('current')) {
return;
}
$('.hot-cate').find('li').eq(nowIndex).trigger('click');
//处理current样式
$(this).addClass('current').siblings().removeClass('current');
... ...
... ... @@ -670,6 +670,11 @@
top: 22px;
left: 44.2%;
position: absolute;
.main-link {
display: block;
width: 100%;
height: 100%;
}
}
.search {
... ... @@ -1164,6 +1169,11 @@
}
.icon-logo {
left: 39.2%;
.main-link {
display: block;
width: 100%;
height: 100%;
}
}
.sub-nav-list {
width: 990px;
... ... @@ -1215,4 +1225,233 @@
}
}
}
#cover {
left: 0px;
top: 0px;
width: 100%;
height: 100%;
position: fixed;
z-index: 1001;
}
#cover .con {
background: rgba(0, 0, 0, 0.6) !important;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
position: absolute;
z-index: 1002;
opacity: 0.5;
-moz-opacity: 0.5;
}
#cover .tag_img_warpper {
margin: 0px auto;
width: 180px;
height: 168px;
}
#cover .tag_img_warpper img {
width: 100%;
height: 100%;
}
#cover .guide-box {
background: rgb(255, 255, 255);
margin: 0px auto;
height: 400px;
position: relative;
z-index: 1003;
}
#cover .guide-box .close {
top: -15px;
text-align: center;
right: -15px;
color: rgb(255, 255, 255);
line-height: 22px;
font-size: 24px;
position: absolute;
}
#cover .guide-box .close {
background: rgb(0, 0, 0);
border-radius: 50px;
border: currentColor;
border-image: none;
width: 28px;
height: 28px;
line-height: 25px;
display: block;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
}
#cover .guide-box ul li {
padding: 10px;
width: 200px;
height: 400px;
float: left;
box-sizing: border-box;
}
#cover .guide-box ul li.girls {
border-left-color: rgb(238, 238, 238);
border-left-width: 1px;
border-left-style: solid;
}
#cover .guide-box ul li.lifestyle {
border-left-color: rgb(238, 238, 238);
border-left-width: 1px;
border-left-style: solid;
}
#cover .guide-box ul li.kids {
border-left-color: rgb(238, 238, 238);
border-left-width: 1px;
border-left-style: solid;
}
#cover .guide-box ul li.boys .goods-num {
text-align: center;
color: rgb(187, 187, 187);
line-height: 12px;
font-size: 12px;
margin-top: 16px;
}
#cover .guide-box ul li.girls .goods-num {
text-align: center;
color: rgb(187, 187, 187);
line-height: 12px;
font-size: 12px;
margin-top: 16px;
}
#cover .guide-box ul li.kids .goods-num {
text-align: center;
color: rgb(187, 187, 187);
line-height: 12px;
font-size: 12px;
margin-top: 16px;
}
#cover .guide-box ul li.lifestyle .goods-num {
text-align: center;
color: rgb(187, 187, 187);
line-height: 12px;
font-size: 12px;
margin-top: 16px;
}
#cover .guide-box ul li a.go {
margin: 26px auto 0px;
width: 100%;
height: 18px;
text-align: center;
color: rgb(176, 176, 176);
line-height: 18px;
font-size: 18px;
font-style: italic;
font-weight: lighter;
display: block;
}
#cover .boys .block_cn {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 30px;
}
#cover .girls .block_cn {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 30px;
}
#cover .kids .block_cn {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 30px;
}
#cover .lifestyle .block_cn {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 30px;
}
#cover .boys .block_cn {
color: black;
}
#cover .boys .block_en {
color: black;
}
#cover .girls .block_cn {
color: rgb(255, 136, 174);
}
#cover .girls .block_en {
color: rgb(255, 136, 174);
}
#cover .kids .block_cn {
color: rgb(122, 217, 248);
}
#cover .kids .block_en {
color: rgb(122, 217, 248);
}
#cover .lifestyle .block_cn {
color: rgb(79, 64, 55) !important;
}
#cover .lifestyle .block_en {
color: rgb(79, 64, 55) !important;
}
#cover .boys .block_en {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 19px;
}
#cover .girls .block_en {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 19px;
}
#cover .kids .block_en {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 19px;
}
#cover .lifestyle .block_en {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 19px;
}
#cover .boys .block_line {
margin: 20px auto 0px;
width: 50px;
height: 0px;
border-bottom-color: rgb(204, 204, 204);
border-bottom-width: 1px;
border-bottom-style: solid;
}
#cover .girls .block_line {
margin: 20px auto 0px;
width: 50px;
height: 0px;
border-bottom-color: rgb(204, 204, 204);
border-bottom-width: 1px;
border-bottom-style: solid;
}
#cover .kids .block_line {
margin: 20px auto 0px;
width: 50px;
height: 0px;
border-bottom-color: rgb(204, 204, 204);
border-bottom-width: 1px;
border-bottom-style: solid;
}
#cover .lifestyle .block_line {
margin: 20px auto 0px;
width: 50px;
height: 0px;
border-bottom-color: rgb(204, 204, 204);
border-bottom-width: 1px;
border-bottom-style: solid;
}
... ...
$tip: sprite-map("passport/tip/*.png", $spacing: 10px);
@import "login", "register", "back", "welcome";
.passport-page {
width: 1150px;
margin-left: auto;
... ... @@ -207,4 +205,6 @@ $tip: sprite-map("passport/tip/*.png", $spacing: 10px);
margin: 0 auto;
margin-top: 50px;
}
}
\ No newline at end of file
}
@import "login", "register", "back", "welcome", "third";
\ No newline at end of file
... ...
... ... @@ -121,4 +121,17 @@ $third: sprite-map("passport/third/*.png");
background: sprite($third, renren) no-repeat;
}
}
.caps-lock {
position: absolute;
color: #666;
border: #ffe57d;
background: #fff6d2;
white-space: nowrap;
top: 8px;
left: 278px;
padding: 0 20px;
height: 27px;
line-height: 30px;
}
}
... ...
... ... @@ -46,6 +46,9 @@
width: 209px;
display: block;
float: left;
position: absolute;
top: 0;
right: 0;
}
&.captcha, &.msg-captcha{
... ...
.yohobindbtn {
display: block;
width:210px;
height: 45px;
line-height: 45px;
background-color: #f02200;
color: #fff;
font-size: 16px;
text-align: center;
}
.hide {
display: none;
}
.novisiable {
visibility: hidden;
}
.actlevel {
background-color: #f02200 !important;
color: white !important;
}
.mask {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.bindwrapper {
margin: 0 auto;
width: 980px;
min-height: 450px;
padding-top: 122px;
}
.welcomeword {
width: 100%;
text-align: center;
font-size: 22px;
line-height: 22px;
color: #545454;
margin-bottom: 15px;
.yoho {
color: #e12000;
}
}
.safeword {
width: 100%;
text-align: center;
font-size: 16px;
line-height: 16px;
color: #545454;
margin-bottom: 63px;
}
.yohobindrow {
width: 480px;
margin: 0 auto 22px;
height: 40px;
.name {
float: left;
text-align: right;
margin-right: 14px;
width: 96px;
}
.areatag {
height: 30px;
line-height: 30px;
}
.phonetag,
.setpwdtag {
height: 47px;
line-height: 47px;
}
.content {
float: left;
text-align: left;
margin-top: 0;
padding-left: 0;
}
&::after {
display: block;
content: '';
clear: both;
}
}
.sendnotify {
width: 260px;
text-align: left;
margin: 0 auto 18px;
}
.validaterow {
overflow: hidden;
margin: 0 auto 22px;
padding-left: 250px;
.name {
float: left;
text-align: right;
margin-right: 14px;
width: 96px;
}
.areatag {
height: 30px;
line-height: 30px;
}
.phonetag {
height: 47px;
line-height: 47px;
}
.content {
float: left;
text-align: left;
}
&::after {
display: block;
content: '';
clear: both;
}
.validatewrapper {
float: left;
height: 45px;
width: 133px;
text-align: center;
line-height: 45px;
background-color: #d8d8d8;
color: #000;
font-size: 13px;
.yohobindbtn{
width: 133px;
font-size: 13px;
}
margin-left: 18px;
}
}
.validatepicrow {
overflow: hidden;
margin: 0 auto 22px;
padding-left: 250px;
.name {
float: left;
text-align: right;
margin-right: 14px;
width: 96px;
}
.areatag {
height: 30px;
line-height: 30px;
}
.yohophonewrapper {
}
.phonetag {
height: 47px;
line-height: 47px;
}
.content {
float: left;
text-align: left;
}
&::after {
display: block;
content: '';
clear: both;
}
.validatewrapper {
float: left;
height: 45px;
text-align: center;
line-height: 45px;
color: #000;
font-size: 13px;
.yohobindbtn{
width: 133px;
font-size: 13px;
}
margin-left: 18px;
}
.change-captcha {
cursor: pointer;
color: #f02200;
text-decoration: underline;
}
}
.setpwdwrapper {
margin-bottom: 10px;
height: 45px;
}
.safelevel {
width: 291px;
height: 15px;
margin: 0 auto;
text-align: right;
font-size: 10px;
color: #000;
span {
width: 28px;
height: 15px;
line-height: 15px;
background-color: #e5e5e5;
font-size: 10px;
color: #000;
margin-right: 4px;
padding: 1px 8px;
}
}
.green .color {
background-color: #0f0;
color: #fff;
}
.yellow .color {
background-color: #ff0;
color: #fff;
}
.red .color {
background-color: #f00;
color: #fff;
}
.yohoselectarea {
position: relative;
box-sizing: border-box;
width: 131px;
height: 33px;
.optionshow {
width: 100%;
height: 100%;
padding-left: 16px;
border: 1px solid #d9d9d9;
.areaname {
display: block;
float: left;
width: 110px;
height: 100%;
line-height: 33px;
font-size: 13px;
color: #000;
}
.righttag {
display: block;
float: left;
width: 21px;
height: 100%;
line-height: 33px;
background-color: #d8d8d8;
background-image: url('../img/arrowbottom.png');
background-repeat: no-repeat;
background-position: center center;
}
}
.optionslist {
background-color: white;
position: absolute;
top: 35px;
left: 0;
width: 149px;
z-index: 2;
.optionitem {
height: 33px;
line-height: 33px;
padding-left: 16px;
font-size: 13px;
&:hover {
background-color: #dfdfdf;
}
}
}
}
.yohophonewrapper {
width: 271px;
height: 47px;
border: 1px solid #d9d9d9;
position: relative;
.areanum {
float: left;
height: 100%;
width: 63px;
line-height: 47px;
text-align: center;
color: #000;
background-color: #d8d8d8;
}
.phonenum {
outline: none;
box-sizing: border-box;
float: left;
height: 45px;
width: 205px;
line-height: 38px;
padding-left: 8px;
border: none;
color: #000;
}
}
.protoctolwrapper{
width: 350px;
margin: 38px auto 0;
padding-left: 85px;
overflow: hidden;
.choosewrapper {
float: left;
width: 13px;
height: 13px;
background-color: #4c4c4c;
background-image: none;
background-position: center center;
background-repeat: no-repeat;
margin-right: 14px;
}
.choosetag {
width: 100%;
height: 100%;
display: block;
opacity: 0;
filter: alpha(opacity=0);
}
span {
float: left;
}
.protoctol {
color: #f02200;
text-decoration: underline;
}
&::after {
display: block;
content: '';
clear: both;
}
}
.confirmwrapper {
overflow: hidden;
margin-top: 47px !important;
}
.btnwrapper{
width: 350px;
margin: 20px auto 0;
padding-left: 85px;
}
.thirdloginwrapper {
margin: 0 auto;
width: 1150px;
min-height: 450px;
padding-top: 160px;
.safeword {
margin-bottom: 30px;
}
.left {
box-sizing: border-box;
float: left;
width: 450px;
height: 318px;
border-right: 1px solid #e5e5e5;
}
.right {
box-sizing: border-box;
float: right;
width: 696px;
padding-top: 64px;
height: 318px;
}
.gobuy,
.completeprofile {
float: left;
display: inline-block;
width: 94px;
height: 94px;
line-height: 94px;
text-align: center;
border-radius: 50%;
background-color: #f02200;
color: white;
}
.gobuy {
margin-left: 228px;
margin-right: 80px;
}
}
.bindsuccesswrapper {
margin: 0 auto;
width: 1150px;
min-height: 450px;
padding-top: 160px;
.successwrapper {
width: 320px;
height: 29px;
margin: 0 auto 16px;
.successtag {
display: inline-block;
margin-right: 28px;
float: left;
width: 29px;
height: 29px;
background-image: url('../img/bindsuccess.png');
background-repeat: no-repeat;
}
.congratulation {
display: inline-block;
height: 29px;
line-height: 29px;
font-size: 22px;
}
}
.info {
text-align: center;
font-size: 16px;
margin-bottom: 48px;
}
.gobuynow {
margin: 0 auto;
}
}
.bindconfrimwrapper {
width: 900px;
height: 439px;
margin: 153px auto;
background-color: #fff;
box-sizing: border-box;
padding-top: 37px;
.topwrapper {
width: 281px;
height: 90px;
margin: 0 auto 32px;
.userphoto {
width: 90px;
height: 90px;
vertical-align: middle;
border-radius: 50%;
margin-right: 22px;
}
.username{
vertical-align: middle;
}
}
.usertaginfo {
text-align: center;
font-size: 16px;
color: #545454;
margin-bottom: 10px;
}
.usertagremind {
text-align: center;
font-size: 14px;
color: #000;
margin-bottom: 47px;
}
.otherphone{
margin: 0 auto 64px;
}
.logindirectly {
display: block;
text-align: center;
text-decoration: underline;
color: #f02200;
}
}
.yohobindbtn[disabled] {
background-color: #e5e5e5;
cursor: not-allowed;
}
.gobindwrapper {
width: 100%;
height: 45px;
margin-bottom: 70px;
&::after {
display: block;
content: '';
clear: both;
}
.myphone {
float: left;
margin-left: 20px;
width: 193px;
}
.logindirectly {
display: inline-block;
}
.validaterow {
overflow: hidden;
margin: 0 auto 22px;
padding-left: 222px;
float: left;
.name {
float: left;
text-align: right;
margin-right: 14px;
width: 96px;
}
.areatag {
height: 30px;
line-height: 30px;
}
.phonetag {
height: 47px;
line-height: 47px;
}
.content {
float: left;
text-align: left;
.validatacode {
outline: none;
box-sizing: border-box;
float: left;
height: 45px;
width: 113px;
line-height: 38px;
padding-left: 8px;
border: 1px solid #d9d9d9;
color: #000;
}
}
.validatewrapper {
float: left;
height: 45px;
width: 133px;
text-align: center;
line-height: 45px;
background-color: #d8d8d8;
color: #000;
font-size: 13px;
margin-left: 18px;
.yohobindbtn{
width: 133px;
font-size: 13px;
}
}
}
}
.gobindbottomwrapper {
width: 100%;
padding-left: 341px;
.logindirectly {
display: inline-block;
float: left;
margin-right: 36px;
text-decoration: underline;
color: #f02200;
}
}
.pwd-tips {
position: absolute;
top: -10px;
left: 285px;
width: 158px !important;
height: 70px;
padding-top: 7px;
font-size: 12px;
background: url(http://6.url.cn/zc/chs/img/pwd_sprite.png?v=10069) no-repeat;
}
.pwd-tips {
position: absolute;
top: -10px;
left: 285px;
width: 158px !important;
height: 70px;
padding-top: 7px;
font-size: 12px;
background: url(http://6.url.cn/zc/chs/img/pwd_sprite.png?v=10069) no-repeat
}
.pwd-tips div {
height: 22px;
line-height: 22px;
margin-left: 15px;
padding-left: 18px;
}
.pwd-tips .default {
background: url(http://6.url.cn/zc/chs/img/pwd_sprite.png?v=10069) 0 -215px no-repeat;
}
.pwd-tips .yes {
background: url(http://6.url.cn/zc/chs/img/pwd_sprite.png?v=10069) 0 -247px no-repeat;
}
.pwd-tips .no {
background: url(http://6.url.cn/zc/chs/img/pwd_sprite.png?v=10069) 0 -281px no-repeat;
}
.pwd-tips .red {
color: red !important;
}
.msg-tip {
position: absolute;
top: 17px;
left: 285px;
white-space: nowrap;
}
.msg-tip img {
height: 12px;
width: 12px;
}
.backdrop {
position: fixed;
background: #000;
width: 100%;
height: 100%;
left: 0 ;
top: 0 ;
bottom: 0;
right: 0;
opacity: .5;
filter: alpha(opacity=50);
}
\ No newline at end of file
... ...
... ... @@ -170,15 +170,19 @@
float: left;
line-height: 30px;
margin-right: 5px;
cursor: pointer;
span {
margin: 0 3px;
cursor: pointer;
-moz-user-select: none;
&:first-child {
margin-left: 10px;
}
&.hover {
color: #f00;
}
}
}
... ... @@ -314,12 +318,13 @@
.senior-sub {
box-sizing: border-box;
position: absolute;
padding: 15px 0;
left: 0;
right: 0;
padding: 15px 0 15px 91px;
left: -91px;
right: -1px;
top: 39px;
background: #fff;
border: 1px solid #eaeceb;
border: 1px solid #dfdfdf;
border-top-color: #eaeceb;
z-index: 2;
ul {
... ...
... ... @@ -185,9 +185,7 @@
color: #000;
.sale-price {
text-decoration: line-through;
margin: 0 10px 0 0;
color: #999;
}
}
}
... ...
.new-sale-page {
/*Modify by chenglong.wang at 2016/1/18
*sale列表页面轮播图
*/
.sale-list-banner {
width: 100%;
position: relative;
ul {
overflow: hidden;
width: 100%;
position: relative;
z-index: 1;
li {
width: 100%;
height: 100%;
display: block;
float: left;
position: absolute;
top: 0;
left: 0;
}
}
.sale-list-pagation {
z-index: 2;
position: absolute;
left: 0;
bottom: 50px;
width: 100%;
height: 20px;
text-align: center;
div {
display: inline-block;
}
span {
display: block;
width: 20px;
height: 20px;
background: image_url('product/default-normal.png');
float: left;
margin: 0 10px;
cursor: pointer;
&.active {
background: image_url('product/default-active.png');
}
}
}
}
.header-title {
position: relative;
width: 100%;
... ...
... ... @@ -339,35 +339,34 @@ class HomeModel
}
$data = IndexData::channelData();
if (!empty($data['data']['list'])) {
$build = array();
foreach ($data['data']['list'] as $value) {
$build = array();
switch (intval($value['channel_id'])) {
case 1:
$build['href'] = '/boys';
$build['href'] = Helpers::getFilterUrl($value['url']);
$build['title'] = '男生';
$build['entitle'] = 'BOYS';
break;
case 2:
$build['href'] = '/girls';
$build['href'] = Helpers::getFilterUrl($value['url']);
$build['title'] = '女生';
$build['entitle'] = 'GIRLS';
break;
case 3:
$build['href'] = '/kids';
$build['href'] = Helpers::getFilterUrl($value['url']);
$build['title'] = '潮童';
$build['entitle'] = 'KIDS';
break;
case 4:
$build['href'] = '/lifestyle';
$build['href'] = Helpers::getFilterUrl($value['url']);
$build['title'] = '创意生活';
$build['entitle'] = 'LIFESTYLE';
break;
case 5:
$result['showYohood'] = true;
$result['yohoodHref'] = 'http://yohood.cn';
$result['yohoodHref'] = Helpers::getFilterUrl($value['url']);
break;
default:
continue;
... ...
... ... @@ -238,6 +238,7 @@ class DetailModel
$colorArr['colorNum'] = isset($colorStorageGroup[ $colorArr['skcId'] ][$sizeName]) ? $colorStorageGroup[ $colorArr['skcId'] ][$sizeName] : 0;
$colorGroup[$i]['color'][] = $colorArr;
}
$colorGroup[$i]['sizeName'] = $sizeName;
++ $i;
}
... ... @@ -246,6 +247,7 @@ class DetailModel
foreach ($colorList as $value) {
// 各个尺码的颜色,每行显示一个颜色的对应尺码
$sizeGroup[$i]['size'] = $sizeList[ $value['skcId'] ];
$sizeGroup[$i]['colorId'] = $value['skcId'];
// 默认颜色
$colorGroup[0]['color'][] = $value;
... ...
... ... @@ -86,6 +86,7 @@ class Bootstrap extends Bootstrap_Abstract
case 'web':
break;
case 'search': // 搜索
$module = 'Product';
if($urlAction == '/index') {
$searchRequest = new Yaf\Request\Http('/product/search/index');
$dispatcher->setRequest($searchRequest);
... ...
... ... @@ -38,20 +38,14 @@ class BrandsController extends WebAction
*/
public function brandinfoAction()
{
$result = array();
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
$brandId = $this->get('brandId',0);
$uid=$this->getUid(false);
$brandId=144;
BrandsModel::getBrandInfo($brandId, $uid);
$brandId = $this->get('brandId', 0);
$uid = $this->getUid(false);
$data = BrandsModel::getBrandInfo($brandId, $uid);
$result = array(
'code' => 200,
'brand' => $data
... ... @@ -62,9 +56,10 @@ class BrandsController extends WebAction
$this->echoJson($result);
}
/**
* 品牌一览
/*
* 品牌list
*/
public function indexAction()
{
$headerdata = array(
... ...
... ... @@ -7,6 +7,7 @@ use Plugin\HelperSearch;
use LibModels\Web\Product\BrandData;
use Index\HomeModel;
use Product\SearchModel;
use Plugin\Helpers;
/**
* 品牌首页模板数据模型
... ... @@ -80,7 +81,7 @@ class BrandsModel
$urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['sortCondition']);
//组合搜索品牌url
$urlList['brand'] = HelperSearch::getBrandUrl($customOptions);
... ... @@ -108,32 +109,41 @@ class BrandsModel
{
$switchParams = self::switchBrandParams($channel);
$brandTop = array();
/*
* $item1 = array(
'name' => '所有品牌',
'src' => $imgsrc,
'url' => ''
);
*/
$brandAds = array();
$brandList = array();
$res = BrandData::getTopBanner($switchParams['brandCode'], $switchParams['channelType']);
//头部10个品牌图块
if (isset($res['brandTop'][1]['data']['list']) && $res['brandTop'][1]['data']['list']) {
foreach ($res['brandTop'][1]['data']['list'] as $tbk => $tbv) {
$imgUrlTmp = explode("?", $tbv['src']);
$urlTmp = explode("?", $tbv['url']);
$topBrandTmp = array(
'name' => $tbv['name'],
'src' => Helpers::getImageUrl($imgUrlTmp[0], 80, 50, 3),
'url' => str_replace('m.', '', $urlTmp[0]),
);
$brandAds[$tbk] = $topBrandTmp;
}
}
//头部品牌图块
if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) {
foreach ($res['brandTop'][0]['data'] as $tk => $tv) {
$imgUrl = explode("?", $tv['src']);
$imgUrlTmp = explode("?", $tv['src']);
$urlTmp = explode("?", $tv['url']);
$topTmp = array(
'name' => $tv['title'],
'src' => $imgUrl[0],
'url' => $tv['url'],
'items' => array()
'src' => $imgUrlTmp[0],
'url' => $urlTmp[0],
'items' => $brandAds
);
$brandTop[$tk] = $topTmp;
}
}
//品牌list
if (isset($res['brandList']['brands']) && $res['brandList']['brands']) {
foreach ($res['brandList']['brands'] as $lk => $lv) {
$listTmp = array();
if (isset($lv) && $lv) {
$listTmp = array();
foreach ($lv as $ltk => $ltv) {
$listTmp[$ltk] = array(
'name' => $ltv['brand_name'],
... ... @@ -158,33 +168,20 @@ class BrandsModel
*/
public static function getBrandInfo($brandId, $uid)
{
$imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
$data = array(
'key' => '1000011',
'icon' => $imgsrc,
'title' => '优显led触控台灯',
'content' => '优显led触控台灯优显led触控台灯优显led触控台灯优显led触控台灯',
'subtitle' => 'AAAAAA',
'imgs' => array(
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
)
)
);
$data = array();
$res = BrandData::getBrandIntro($brandId, $uid);
//if(isset($res['data']) && $res['data']){
// $data['key']=$brandId;
// $data['icon']=
//}
var_dump($res);
die();
if (isset($res['data']) && $res['data']) {
$icoUrlTmp = explode("?", $res['data']['brand_ico']) ;
$data = array(
'key' => $res['data']['brand_id'],
'icon' => $icoUrlTmp[0],
'title' => $res['data']['brand_name'],
'content' =>$res['data']['brand_intro'],
'subtitle' => 'FEATURED ITEMS',
'imgs' => array(),
);
}
return $data;
}
/*
... ...
... ... @@ -2,10 +2,9 @@
namespace product;
use Plugin\Images;
use Plugin\Helpers;
use Plugin\Cache;
use Configs\CacheConfig;
use LibModels\Web\Home\IndexData;
use Api\Yohobuy;
//use Plugin\Helpers;
//use LibModels\Web\Home\IndexData;
use \LibModels\Web\Product\HotrankData;
use \LibModels\Web\Product\SearchData;
... ... @@ -14,14 +13,14 @@ class HotrankModel {
/**
* 人气单品 一周热卖
*/
static public function getSearchData($condition, $options)
static public function getSearchData($param,$page,$ajax)
{
// 调用接口查询商品数据
$result = SearchData::searchElasticByCondition($condition);
$result = SearchData::searchElasticByCondition($param);
//print_r($result);
if(!empty($result)){
$res = self::getProductList($result);
$res = self::getProductList($result,$page,$ajax);
if(!empty($res['popular'])){
$data['popular'] = $res['popular'];
}
... ... @@ -37,18 +36,16 @@ class HotrankModel {
/**
* 获取分类标签
*/
static public function getHotranktag($classes)
static public function getHotranktag($client_type,$channel,$is_concurrent)
{
$list = SearchData::getClassesData($classes);
//print_r($list);
$list = \LibModels\Web\Product\HotrankData::getHotranktag($client_type,$channel,$is_concurrent);
$nav = array();
if(!empty($list['data']['sort'])){
foreach($list['data']['sort'] as $li=>$lt){
$nav[$li]['sid'] = $lt['sort_id'];
$nav[$li]['textCn'] = $lt['sort_name'];
if(!empty($list['data']['list'])){
foreach($list['data']['list'] as $li=>$lt){
$nav[$li]['sid'] = $lt['id'];
$nav[$li]['textCn'] = $lt['tag_name'];
}
}
//print_r($nav);
return $nav;
}
... ... @@ -56,8 +53,10 @@ class HotrankModel {
/**
* 人气单品 一周热卖 数据处理
*/
static public function getProductList($result)
static public function getProductList($result,$page,$ajax=0)
{
// 调用发起请求
Yohobuy::yarConcurrentLoop();
/*----product start---------*/
if(empty($result) || empty($result['data']) || empty($result['data']['product_list'])){
return;
... ... @@ -83,26 +82,35 @@ class HotrankModel {
$product_id = empty($val['product_id']) ? '' : $val['product_id'];
$re['url'] = 'http://item.yohobuy.com/product/pro_'.$product_id.'_'.$defaultGoodsId.'.html';
$re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['name'] = $val['product_name'];
if($key <= 9){
$re['rank'] = $key + 1;
if($key <= 5){
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
$popular['list'][] = $re;
}else{
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$popular['list'][] = $re;
}
}else{
$re['rank'] = '';
$re['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$hot[] = $re;
}
$re['name'] = $val['product_name'];
if($key <= 9 && $page == 1 && $ajax == 0){
$re['rank'] = $key + 1;
if($key <= 5){
$re['price'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['sPrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
$popular['list'][] = $re;
}else{
$re['price'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['sPrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$popular['list'][] = $re;
}
}else if ($ajax == 1){
$re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['rank'] = '';
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$hot[] = $re;
}else{
$re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['rank'] = '';
$re['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$hot[] = $re;
}
}
$popular['name'] = '人气单品';
$hotWeek = array(
'name'=>'一周热卖',
'list'=>$hot,
... ...
... ... @@ -18,12 +18,11 @@ class IndexModel
{
$urlList = array();
$searchCondition = SearchModel::searchCondition($customCondition, $customOptions);
// 组合搜索商品url
$urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['sortCondition']);
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
... ...
... ... @@ -20,7 +20,7 @@ class NewModel
// 组合搜索商品url
$urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['sortCondition']);
// 组合搜索最新上架url
$urlList['recent'] = HelperSearch::getRecentShelveUrl($searchCondition['condition']);
//用户浏览记录
... ...
... ... @@ -23,7 +23,7 @@ class SaleModel
$urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['sortCondition']);
//组合用户浏览记录url
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
... ...
... ... @@ -110,7 +110,7 @@ class SearchModel
);
//接收高级选项
foreach ($_GET as $key =>$val) {
if (strpos('parameter_',$key) !== false) {
if (strpos($key, 'parameter_') !== false) {
$condition[$key] = (int) $val;
}
}
... ... @@ -129,7 +129,6 @@ class SearchModel
$data['condition'] = $condition;
$data['sortCondition'] = $sortCondition;
$data['options'] = $options;
return $data;
}
... ... @@ -221,7 +220,7 @@ class SearchModel
$data .= '<li><a style="display: block;" href="http://search.yohobuy.com/?query='.$v['item'].'" class="clearfix clear search-item" title="'.$v['item'].'" act="http://search.yohobuy.com/?query='.$v['item'].'"><span class="searchvalue" >'.$v['item'].'</span><span class="valuenum">约'.$v['frequency'].'个商品</span></a></li>';
}
}
echo $data;
return $data;
}
/**
... ...
... ... @@ -112,6 +112,7 @@ class LoginController extends WebAction
/* 设置登录有效时间30分钟, 防机器刷 */
$expire = $this->getSession('_LOGIN_EXPIRE');
if (empty($expire) || $expire < time()) {
$data = array('code' => 400, 'message' => '页面停留时间过长,请刷新页面', 'data' => '');
break;
}
... ... @@ -135,13 +136,13 @@ class LoginController extends WebAction
}
$refer = $this->getCookie('refer');
if (empty($refer)) {
$refer = SITE_MAIN . '/?go=1';
if (empty($refer) || strstr($refer, 'signin.html') || strstr($refer, 'passport/login/index')) {
$refer = SITE_MAIN;
}
else {
$refer = rawurldecode($refer);
}
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid']);
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid'],$refer);
$data['data']['href'] = $refer;
$token = Helpers::makeToken($data['data']['uid']);
... ... @@ -230,5 +231,4 @@ class LoginController extends WebAction
}
return $str;
}
}
... ...
... ... @@ -2,12 +2,16 @@
use Action\WebAction;
use LibModels\Web\Product\BrandData;
use LibModels\Web\Product\HotrankData;
use \LibModels\Web\Product\HotrankData;
use product\HotrankModel;
use LibModels\Web\Home\IndexData;
class IndexController extends WebAction
{
public $channel;
public $gender;
public $road;//频道
public $code;
/**
* 品牌首页
*/
... ... @@ -53,7 +57,7 @@ class IndexController extends WebAction
}
public function hotrankAction() {
$this->setWebNavHeader(\Index\HomeModel::COOKIE_NAME_LIFESTYLE);
$data = array(
'hotrankPage' => true,
'hotrank' => array(
... ... @@ -261,30 +265,124 @@ class IndexController extends WebAction
)
)
);
$cookie = $this->getCookie('_Channel');
$cookie = 'lifestyle';
$this->channel = isset($cookie) ? $cookie : 'boys';
switch ($this->channel){
case 'boys' :
$this->gender = '1,3';
$this->road = 1;
$this->code = '80d772d8dff25300a2a2e4c97165330c';
break;
case 'girls' :
$this->gender = '2,3';
$this->road = 2;
$this->code = '8df64e505e94edb9881fd1e7efb702e9';
break;
case 'lifestyle' :
$this->gender = '';
$this->road = 4;
$this->code = 'd131aba83a84a6977eee3a7403a713de';
break;
case 'kids' :
$this->gender = '';
$this->road = 3;
$this->code = 'bd6a06a08f8ca9b0db762f78e0bc5b68';
break;
}
$this->setWebNavHeader(\Index\HomeModel::$this->channel);
$data = array( 'hotrankPage' => true,
'footerTop'=> true,
'hotrank' => array()
);
//焦点图 热门品牌
$focus = \Index\HomeModel::getChannelResource('lifestyle', 'd131aba83a84a6977eee3a7403a713de');
//print_r($focus);
$focus = \Index\HomeModel::getChannelResource($this->channel, $this->code);
$data['hotrank']['slide'] = $focus[0]['slide'];
$data['hotrank']['hotBrands'] = $focus[1]['hotBrands'];
//人气单品 一周热卖
$page = 1;
$param = array('order'=>'s_n_desc','viewNum'=>60,'page'=>1,'stocknumber'=>1,'status'=>1,'gender'=>'','attribute_not'=>2);
$publiclist = \product\HotrankModel::getSearchData($param,$page);
$page = $this->get('page',1);
$sort_id = $this->get('sid',0);
$viewNum = 60;
$param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'stocknumber'=>1,'status'=>1,'gender'=>$this->gender,'attribute_not'=>2);
if($sort_id != 0){
$param['sort'] = $sort_id;
}
if($this->road == 3){
$param['msort'] = 365;
}elseif($this->road == 4){
$param['msort'] = 10;
}else{
$param['not_maxSortId'] = '10,365';
}
$publiclist = \product\HotrankModel::getSearchData($param,$page,0);
$data['hotrank']['popular'] = $publiclist['popular'];
$data['hotrank']['hotWeek'] = $publiclist['hotWeek'];
//print_r($publiclist);
//分类标签
$classes = array('gender' => 2);
$nav = \product\HotrankModel::getHotranktag($classes);
$data['hotrank']['hotWeek']['nav'] = $nav;
//print_r($data);
$nav = \product\HotrankModel::getHotranktag('web',$this->road,true);
$data['hotrank']['hotWeek']['nav'] = $nav;
$this->_view->display('hotrank', $data);
}
/*
* 一周热卖加载更多
*/
public function getdataAction()
{
$page = $this->get('page',1);
//加载到100个以后停止
if($page > 2)
{
echo json_encode(array('code'=>201,'data'=>''));
exit;
}
$sid = $this->get('sid',1);
$sort = '';
//是否是默认标签
if($sid > 1)
{
//通过ID获取标签信息
$info = \LibModels\Web\Product\HotrankData::getTagById($sid, false);
if(!empty($info['data']))
{
$sort = $info['data']['category_id'];
}
}
$viewNum = 60;
//过滤掉赠品
$param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'sort'=>$sort,'stocknumber'=>1,'status'=>1,'gender'=>$this->gender,
'attribute_not'=>2);
if(empty($param['sort']))
{
if($this->road == 3)
{
$param['msort'] = 365;
}elseif($this->road == 4){
$param['msort'] = 10;
}else{
$param['not_maxSortId'] = '10,365';
}
}
$list = \product\HotrankModel::getSearchData($param, $page, 1);
$lister = $list['hotWeek']['list'];
$lister = array_values($lister);
if($sid == 1 && $page == 1)
{
$lister = array_slice($lister, 10, 50);
}else{
$lister = array_slice($lister, 0, 50);
}
$data = array(
'code'=>200,
'data'=>$lister,
);
echo json_encode($data);
exit;
}
}
?>
\ No newline at end of file
... ...
... ... @@ -49,10 +49,7 @@ class ListController extends WebAction
*/
public function saleAction()
{
//排序
$condition['order'] = 's_n_desc';
//打折
$condition['p_d'] = '0,0.9';
$condition = array();
$list = SearchModel::getListData($condition);
$data = array(
//初始化js
... ...
... ... @@ -166,7 +166,32 @@ class Sale1Controller extends WebAction
'saleList' => array(
'saleBanner' => array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
'list' => array(
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg?imageView/1/w/1150/h/450'
)
)
),
'saleTitle' => array(
'name' => '全部商品',
... ...
... ... @@ -21,11 +21,13 @@ class SearchController extends WebAction
*/
public function suggestAction()
{
$suggest = '';
$query = rawurldecode($this->get('query'));
if ($query) {
$param['query'] = $query;
SearchModel::getSuggest($param);
$suggest = SearchModel::getSuggest($param);
}
echo $suggest;
}
/**
... ... @@ -35,7 +37,6 @@ class SearchController extends WebAction
{
$condition['msort'] = $this->get('msort');
$size = SearchModel::getSortSize($condition);
print_r($size); exit;
$this->echoJson($size);
}
}
\ No newline at end of file
... ...