Authored by biao

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

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 Mon Nov 23 16:04:11 2015
Created by FontForge 20120731 at Sat Dec 5 16:26:44 2015
By Ads
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Mon Nov 23 16:04:11 2015
bbox="-0.75 -224 3943 833"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E63E"
unicode-range="U+0078-E63F"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -252,5 +252,10 @@ t-3.5 -16.5t-5.5 -16.5t-7.5 -15.5t-10 -15t-11.5 -14t-13 -12.5t-14.5 -11.5t-15.5
l-47 -98q-3 -6 -7 -11t-10 -8t-12.5 -4t-13 0.5t-12.5 5.5q-8 3 -13.5 9t-8 13.5t-1.5 16.5t5 16l47 99q23 42 62 64.5t83 16.5q45 -7 77 -39l141 -141q29 -28 38 -65t-4 -75q-17 -43 -34 -60l-72 -73q-5 -4 -9.5 -7t-9.5 -4t-11 -1zM602 87q-4 0 -9 1.5t-8 2.5t-9 4
q-77 58 -154 128q-76 77 -128 154q-9 12 -6 29.5t19 30.5q6 3 13 5t13.5 2t13 -2t11.5 -5.5t9 -8.5q15 -21 27 -36.5t27.5 -35t32 -37t32.5 -32.5q14 -12 21 -18.5t19.5 -17.5t20.5 -18t19.5 -17t20.5 -17.5t19.5 -15.5t20.5 -15q11 -7 16 -17t3 -21.5t-10 -21.5
q-6 -21 -34 -21z" />
<glyph glyph-name="uniE63F" unicode="&#xe63f;" horiz-adv-x="1025"
d="M512 -66q-10 0 -24.5 -0.5t-25 -1t-24 0t-24.5 1.5l-222 -146q0 227 5 243q-164 117 -192 282q-5 30 -5 60q0 122 68.5 223t186 158.5t257.5 57.5q104 0 199 -34t163.5 -92.5t109 -140t40.5 -172.5q0 -167 -126 -290q-124 -121 -312 -144q-37 -5 -74 -5zM512 763
q-91 0 -176.5 -31.5t-148.5 -83.5t-100.5 -124.5t-37.5 -150.5q0 -95 53 -179t142 -138v-170l146 97q16 -3 35.5 -4t49 0t37.5 1q41 0 81 6.5t77 18.5t72 29.5t65 39.5t56.5 47.5t47 55t35 61t22 66t7.5 69.5q0 104 -63.5 194.5t-170.5 143t-229 52.5zM768 300
q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM512 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM256 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5
t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -114,7 +114,7 @@ $page.on('touchstart', '.del-icon', function() {
});
setTimeout(function() {
window.history.go(0);
}, 1000);
}, 2500);
}
},
complete: function() {
... ...
... ... @@ -18,13 +18,14 @@ var introUrl = $('#introUrl').val(),
var sizeSwiper,
refSwiper;
require('../recommend-for-you.js');
//判断是否要显示向左滑动提示
function hiddenTips($ele) {
var offsetContainer,
offsetLastColumn;
if ($ele.length > 0) {
var offsetContainer = $ele[0].getBoundingClientRect().right;
var offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
offsetContainer = $ele[0].getBoundingClientRect().right;
offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
if (offsetLastColumn - offsetContainer < 0) {
... ...
... ... @@ -17,6 +17,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
require('./desc');
require('./comments-consults');
require('../recommend-for-you-product-desc');
//add extra marign-bottom for footer to show the yoho copyright
function showFooter() {
... ...
/**
* 商品详情 --滚动页面加载
* @author: Lynnic
* @date: 2015/11/25
*/
// var $ = require('jquery'),
// loading = require('../../plugin/loading'),
// tip = require('../../plugin/tip');
// var loadMoreUrl = $('#loadMoreUrl').val(),
// $commentsDiv = $('#goods-comments'),
// $consultsDiv = $('#goods-consults'),
// winH = $(window).height(),
// searching = false,
// end = false;
// var jsonObj;
// //插入评论列表底部
// function insertCommentsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="comment-item">';
// html += '<span class="user-name">' + json[i].userName + '</span>';
// html += '<span class="goods-spec">' + json[i].desc + '</span>';
// html += '<span class="goods-spec">' + json[i].content + '</span>';
// html += '<span class="goods-spec">' + json[i].time + '</span>';
// }
// $commentsDiv.append(html);
// }
// //插入咨询列表底部
// function insertConsultsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="consult-item"> ';
// html += '<div class="question"> ';
// html += '<span class="iconfont">&#xe639;</span> ';
// html += '<p> ';
// html += json[i].question + '<br> ';
// html += '<span class="time">' + json[i].time + '</span> ';
// html += '</p> ';
// html += '</div> ';
// html += '<div class="answer"> ';
// html += '<span class="iconfont">&#xe63c;</span> ';
// html += '<p>' + json[i].answer + '</p> ';
// html += '</div> ';
// html += '</div> ';
// }
// $consultsDiv.append(html);
// }
// function search() {
// if (searching || end) {
// return;
// }
// searching = true;
// loading.showLoadingMask();
// $.ajax({
// type: 'GET',
// url: loadMoreUrl,
// success: function(data) {
// if (data.length > 0) {
// jsonObj = JSON.parse(data);
// if ($commentsDiv.length > 0) {
// insertCommentsDiv(jsonObj);
// } else if ($consultsDiv.length > 0) {
// insertConsultsDiv(jsonObj);
// }
// }
// searching = false;
// end = true;
// loading.hideLoadingMask();
// },
// error: function() {
// tip.show('网络断开连接了~');
// searching = false;
// loading.hideLoadingMask();
// }
// });
// }
// function scrollHandler() {
// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
// search();
// }
// }
// //srcoll to load more
// $(window).scroll(function() {
// window.requestAnimationFrame(scrollHandler);
// });
\ No newline at end of file
... ... @@ -8,6 +8,6 @@ require('./newsale/newarrival');
require('./newsale/discount');
require('./list');
require('./detail/detail');
require('./detail/loadmore');
require('./detail/consultform');
require('./newsale/hot-rank');
... ...
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.lazyload'),
loading = require('../../plugin/loading');
var page = 1,
winH,
hotnav,
listTop,
navSwiper,
notab = 0,
... ... @@ -15,42 +13,6 @@ var page = 1,
hotrankNav,
noResult = '<p class="no-result">未找到相关搜索结果</p>';
// var renderRank = {
// errMsg: '<p class="no-result">未找到相关搜索结果</p>',
// navSelector: '.goods-nav',
// rankSelector: '#hotRank',
// navHTML: null,
// data: null,
// inited: 0,
// setData: function(data) {
// this.data = data;
// },
// showDataEmptyMsg: function() {
// $(this.rankSelector).append(this.errMsg);
// },
// isDataEmpty: function() {
// if (this.data.indexOf('>') === -1) {
// return true;
// } else {
// return false;
// }
// },
// appendData: function() {
// if (!this.inited) {
// this.inited = 1;
// }
// $(this.rankSelector).append(this.data);
// },
// render: function(data) {
// this.setData(data);
// if (!this.isDataEmpty()) {
// this.appendData();
// } else {
// this.showDataEmptyMsg();
// }
// }
// };
function hotrank(page, sort, tabId, notab) {
loading.showLoadingMask();
... ... @@ -64,27 +26,6 @@ function hotrank(page, sort, tabId, notab) {
notab: notab
},
success: function(data) {
// if (page === 1) {
// $('.no-result').remove();
// $('.rank-main').remove();
// }
// if (notab === 1) {
// if (data === ' ' && $('.rank-main').length < 1) {
// var hotrankNav = $('.goods-nav').prop("outerHTML");
// $('#hotRank').html(hotrankNav + noResult);
// } else {
// $('#hotRank').append(data);
// }
// } else {
// if (data === ' ') {
// $('#hotRank').html(noResult);
// } else {
// $('#hotRank').append(data);
// }
// }
if (data === ' ') {
if ($('.rank-main').length < 1 && $('.goods-nav').length < 1) {
$('#hotRank').html(noResult);
... ... @@ -100,11 +41,6 @@ function hotrank(page, sort, tabId, notab) {
$('.rank-main').remove();
$('#hotRank').append(data);
}
// renderRank.render(data);
lazyLoad($('img.lazy'));
$('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
winH = $(window).height();
... ... @@ -136,28 +72,35 @@ function scrollHandler() {
hotrank(page, sort, id, notab);
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
hotrank(page, sort, id, notab);
hotnav = new Hammer(document.getElementById('hotRank'));
hotnav.on('tap', function(e) {
$('#hotRank').on('touchend touchcancel', function(e) {
var ev = ev || window.event;
var target = ev.target || ev.srcElement;
if (target.nodeName.toLowerCase() === 'span') {
$('.s-goods-nav .nav-item').removeClass('active');
target.parentNode.className = 'active ' + target.parentNode.className;
id = target.getAttribute('data-id') ? target.getAttribute('data-id') : '';
sort = target.getAttribute('data-sort') ? target.getAttribute('data-sort') : '';
page = 1;
// notab = renderRank.inited;
notab = 1;
hotrank(page, sort, id, notab);
}
});
$('#hotRank').bind('contextmenu', function(e) {
return false;
});
$('#hotRank').on('touchstart', function(e) {
var ev = ev || window.event;
var target = ev.target || ev.srcElement;
if (target.nodeName.toLowerCase() === 'span') {
target.parentNode.className = 'active ' + target.parentNode.className;
}
}).on('touchend touchcancel', function() {
$('.s-goods-nav .nav-item').removeClass('active');
});
... ...
/**
* 为您优选
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/11/16
*/
var Swiper = require('yoho.iswiper'),
$ = require('jquery');
var recommendSwiper,
$recommendForYou = $('.recommend-for-you'),
preferenceUrl = $('#preferenceUrl').val();
if (preferenceUrl) {
$.get(preferenceUrl).then(function(html) {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
}
}).fail(function() {
$recommendForYou.hide();
});
}
... ...
... ... @@ -131,13 +131,14 @@
overflow: hidden;
li {
margin: 0 0 0 (50rem / $pxConvertRem);
margin: 0 (10rem / $pxConvertRem);
padding:0 (15rem / $pxConvertRem);
width: auto;
height: 95%;
height: 100%;
color: #999;
&.active{
color: #000;
border-bottom:2px solid #000;
background-color:#e0e0e0;
}
a {
padding: 0;
... ...
... ... @@ -12,7 +12,7 @@
{{# is_discount}}
<p class="good-tag sale-tag">SALE</p>
{{/ is_discount}}
{{# is_yohoood}}
{{# is_yohood}}
<div class="good-tag yohood-tag">新品节</div>
{{/ is_yohoood}}
{{# is_limited}}
... ... @@ -136,6 +136,9 @@
{{#if id}}
<input id="productId" type="hidden" value="{{id}}">
{{/if}}
{{#if preferenceUrl}}
<input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}">
{{/if}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@
<ul class="swiper-wrapper clearfix">
{{# tabs}}
{{# title}}
<li class="swiper-slide nav-item {{#if @first}} active{{/if}}">
<li class="swiper-slide nav-item">
<span data-sort="{{ params}}" data-id="{{ id}}" >{{ name}}</span>
</li>
{{/ title}}
... ...
... ... @@ -44,7 +44,7 @@
</div>
<div class="answer">
<span class="iconfont">&#xe63d;</span>
<span class="iconfont">&#xe63f;</span>
<p>{{answer}}</p>
</div>
{{/ consults}}
... ... @@ -56,7 +56,7 @@
</div>
{{else}}
<div class="consult-content-main content-main no-item">
<span class="iconfont">&#xe63d;</span>暂无咨询
<span class="iconfont">&#xe63f;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="{{link}}">
... ...
... ... @@ -46,7 +46,8 @@ class HomeController extends AbstractAction
$data = array(
'myIndexPage' => true,
'showDownloadApp' => true,
'pageFooter' => true
'pageFooter' => true,
'cartUrl' => Helpers::url('/cart/index/index', null),
);
$uid = $this->getUid(true);
if ($uid) {
... ...