Authored by hf

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() {
... ...
... ... @@ -4,12 +4,17 @@
* @date: 2015/11/18
*/
var $ = require('jquery'),
tip = require('../../plugin/tip');
var commentsNum;
tip = require('../../plugin/tip'),
Hammer = require('yoho.hammer');
var commentsNum,consultsNum;
var consultFooterEle = document.getElementById('consult-content-footer'),
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle);
(function() {
var consultsNum = $('#nav-tab .consults-num').html() - 0;
consultsNum = $('#nav-tab .consults-num').html() - 0;
commentsNum = $('#nav-tab .comments-num').html() - 0;
... ... @@ -50,4 +55,10 @@ $('#nav-tab li').on('touchend', function() {
$('#feedback-content .content:eq(' + index + ')').removeClass('hide');
}
}
});
\ No newline at end of file
});
if (consultFooterHammer) {
consultFooterHammer.on('tap', function() {
location.href = $(consultFooterEle).find('a').attr('href');
});
}
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/20
*/
var $ = require('jquery'),
var $ = require('jquery'),
Swiper = require('yoho.iswiper'),
Hammer = require('yoho.hammer'),
lazyLoad = require('yoho.lazyload');
... ... @@ -15,6 +15,8 @@ var goodsSwiper,
var goodsDiscountEl = document.getElementById('goodsDiscount'),
goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
var $cart = $('.cart-bar');
require('./desc');
require('./comments-consults');
require('../recommend-for-you-product-desc');
... ... @@ -69,5 +71,15 @@ if (goodsDiscountHammer) {
});
}
//购物车商品数量
$.ajax({
type: 'GET',
url: '/cart/index/count',
success: function(data) {
if (data.code === 200) {
$cart.find('.num-tag').html(data.data.cart_goods_count).removeClass('hide');
}
}
});
require('./like');
... ...
... ... @@ -9,69 +9,76 @@ var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../../plugin/tip');
var likeHammer = new Hammer(document.getElementById('likeBtn')),
addToCartHammer = new Hammer(document.getElementById('addtoCart')),
var likeEle = document.getElementById('likeBtn'),
likeHammer = likeEle && new Hammer(likeEle);
var addToCartEle = document.getElementById('addtoCart'),
addToCartHammer = addToCartEle && new Hammer(addToCartEle),
productId = $('#productId').val();
likeHammer.on('tap', function(e) {
var opt,
favorite;
if (likeHammer) {
likeHammer.on('tap', function(e) {
var opt,
favorite;
var $this = $(e.target);
var $this = $(e.target);
if ($this.hasClass('liked')) {
opt = 'cancel';
favorite = 0;
} else {
opt = 'ok';
favorite = 1;
}
$.ajax({
type: 'POST',
url: '/product/opt/favoriteProduct',
data: {
id: productId,
opt: opt
},
success: function(data) {
if (data.code === 200) {
$this.toggleClass('liked');
if ($this.hasClass('liked')) {
opt = 'cancel';
favorite = 0;
} else {
opt = 'ok';
favorite = 1;
}
$.ajax({
type: 'POST',
url: '/product/opt/favoriteProduct',
data: {
id: productId,
opt: opt
},
success: function(data) {
if (data.code === 200) {
$this.toggleClass('liked');
if ('cancel' === opt) {
tip.show('取消收藏成功');
} else if ('ok' === opt) {
tip.show('收藏成功');
if ('cancel' === opt) {
tip.show('取消收藏成功');
} else if ('ok' === opt) {
tip.show('收藏成功');
}
} else if (data.code === 400) {
location.href = data.data;//未登录跳转登录页
} else {
tip.show(data.message);
}
} else if (data.code === 400) {
location.href = data.data;//未登录跳转登录页
} else {
tip.show(data.message);
}
// 统计代码:用于统计用户加入或取消商品收藏的动作
if (window._yas) {
window._yas.sendCustomInfo({
pd: productId,
fa: favorite
});
// 统计代码:用于统计用户加入或取消商品收藏的动作
if (window._yas) {
window._yas.sendCustomInfo({
pd: productId,
fa: favorite
});
}
},
error: function() {
tip.show('网络断开连接了~');
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
});
}
});
if (addToCartHammer) {
addToCartHammer.on('tap', function(e) {
addToCartHammer.on('tap', function(e) {
// 统计代码:用于统计用户加入购物车的动作
if (window._yas) {
window._yas.sendCustomInfo({
pd: productId,
by: 1
});
}
});
}
// 统计代码:用于统计用户加入购物车的动作
if (window._yas) {
window._yas.sendCustomInfo({
pd: productId,
by: 1
});
}
});
... ...
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,14 +72,12 @@ 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;
... ... @@ -153,11 +87,21 @@ hotnav.on('tap', function(e) {
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 = 'bgActive ' + target.parentNode.className;
}
}).on('touchend touchcancel', function() {
$('.s-goods-nav .nav-item').removeClass('bgActive');
});
... ...
... ... @@ -264,11 +264,11 @@
height: pxToRem(200px);
line-height: pxToRem(200px);
color: #e0e0e0;
font-size: 20px;
font-size: 16px;
text-align: center;
span{
display: inline-block;
font-size: 20px;
font-size: 16px;
padding-right: 5px;
}
}
... ...
... ... @@ -31,21 +31,20 @@ $basicBtnC:#eb0313;
margin-bottom: pxToRem(20px);
font-size: pxToRem(24px);
line-height: pxToRem(36px);
display: flex;
flex-wrap: wrap;
&.table {
width: 100%;
.column {
box-sizing: border-box;
padding: pxToRem(20px) pxToRem(12px);
width: 50%;
border-bottom: 1px solid #fff;
border-right: 1px solid #fff;
//width: 50%;
border-bottom: pxToRem(4px) solid #fff;
border-right: pxToRem(4px) solid #fff;
font-size: pxToRem(24px);
background-color: $tableCellC;
float: left;
display: flex;
align-items: center;
flex-basis: 49.9%;
}
}
}
... ... @@ -97,10 +96,10 @@ $basicBtnC:#eb0313;
margin-left: .5px;
font-size: pxToRem(18px);
text-align: center;
line-height: pxToRem(24px);
position: relative;
vertical-align: middle;
padding:0 5px;
// line-height: 28px;
// position: relative;
// vertical-align: middle;
padding:1px 5px;
}
.new-tag {
background-color: #78dc7e;
... ... @@ -259,6 +258,11 @@ $basicBtnC:#eb0313;
width: 33.3%;
height: pxToRem(88px);
margin: 0;
&.current-level{
.vip-price{
color:#d0021b;
}
}
span {
vertical-align: middle;
display: inline-block;
... ... @@ -313,10 +317,6 @@ $basicBtnC:#eb0313;
display: none;
}
}
.goodsSubtitle,
.goodsDiscount {
text-indent: pxToRem(-14px);
}
.enter-store {
min-height: pxToRem(100px);
display: table;
... ... @@ -400,6 +400,9 @@ $basicBtnC:#eb0313;
border-radius: 50%;
color: #fff;
font-size: pxToRem(24px);
&.hide{
display: none;
}
}
}
// .recommend-for-you {
... ...
... ... @@ -131,13 +131,17 @@
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;
}
&.bgActive{
color: #000;
background-color:#e0e0e0;
}
a {
padding: 0;
... ...
... ... @@ -2,6 +2,12 @@
.goods-desc {
padding-bottom: pxToRem(20px);
padding-top: pxToRem(20px);
&.page-block{
.table{
display: flex;
flex-wrap: wrap;
}
}
.service {
width: pxToRem(494px);
height: pxToRem(28px);
... ... @@ -40,39 +46,34 @@
}
.detail {
.material-item{
position: relative;
min-height: pxToRem(136px);
margin: pxToRem(10px) 0;
text-align: center;
display: flex;
align-items: center;
@include flexbox((
display: flex,
align-items: center
));
// width: 100%;
// border-bottom:1px solid $borderC;
img {
//position:absolute;
//top:0;
//bottom:0;
//left:0;
//margin:auto;
//width: pxToRem(90px);
//height: auto;
//padding-right: pxToRem(20px);
margin: 0;
}
.material-image {
display: inline-block;
width: 23%;
@include flexbox((
display: flex,
flex-basis: 23%,
justify-content: center
));
}
.material-desc {
//padding-left:pxToRem(120px);
font-size: pxToRem(24px);
box-sizing: border-box;
text-align: left;
display: inline-block;
width: 75%;
padding-left: 2%;
height: auto;
line-height: pxToRem(40px);
line-height: pxToRem(38px);
color: #4b4b4b;
@include flexbox((
display: flex,
flex-basis: 76.9%
));
}
&:last-child{
border-bottom: none;
... ... @@ -146,7 +147,7 @@
width: pxToRem(70px);
margin-top: pxToRem(55px);
div{
height: pxToRem(55px);
height: pxToRem(55px);
.avatar {
display: inline-block;
width: pxToRem(40px);
... ...
... ... @@ -3,7 +3,7 @@
<div class="goto-consult">
<i class="iconfont consult-logo">&#xe639;</i>
<span>我要咨询</span>
<a href="/product/detail/consultform" class="iconfont enter-consult-page">&#xe604;</a>
<a href="{{link}}" class="iconfont enter-consult-page">&#xe604;</a>
</div>
{{# consults}}
<div class="goods-consults" id="goods-consults">
... ...
... ... @@ -12,9 +12,9 @@
{{# 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_yohood}}
{{# is_limited}}
<p class="good-tag limit-tag">限量商品</p>
{{/ is_limited}}
... ... @@ -54,10 +54,10 @@
{{# vipLevel}}
<ul class="vip-level clearfix">
{{# list}}
<li class="icons-item">
<span class="vip-img" style="background-size:contain;">
<li class="icons-item {{#if currentLevel}}current-level{{/if}}">
<span class="vip-img " style="background-size:contain;">
</span>
<span class="vip-price">{{text}}</span>
<span class="vip-price ">{{text}}</span>
</li>
{{/ list}}
</ul>
... ... @@ -117,16 +117,22 @@
{{> product/recommend-for-you}}
{{#cartInfo}}
<div class="cart-bar">
{{#if numInCart}}
<span class="num-tag">{{numInCart}}</span>
{{/if}}
<div class="cart-bar">
<span class="num-tag hide"></span>
<a href="{{cartUrl}}" class="num-incart iconfont">&#xe62c;</a>
{{#if goodsInstore}}
<a id="addtoCart" href="{{cartUrl}}" class="addto-cart">加入购物车</a>
{{else}}
<a href="javascript:;" id="addtoCart" class="sold-out">已售罄</a>
{{#if addToCartUrl}}
<a id="addtoCart" href="{{addToCartUrl}}" class="addto-cart">加入购物车</a>
{{/if}}
{{#if soldOut}}
<a href="javascript:;" class="sold-out">已售罄</a>
{{/if}}
{{#if notForSale}}
<a href="javascript:;" class="sold-out">非卖品</a>
{{/if}}
<a href="javascript:;" id="likeBtn" class="favorite iconfont {{#isCollect}}liked{{/isCollect}}">&#xe605;</a>
</div>
{{/cartInfo}}
... ...
... ... @@ -23,7 +23,7 @@
</div>
{{^}}
<div class="comment-content-main content-main no-item">
<span class="iconfont">&#xe63c;</span>暂无评论
<span class="iconfont">&#xe63d;</span>暂无评论
</div>
{{/if}}
<!-- <div class="comment-content-footer">
... ... @@ -44,19 +44,19 @@
</div>
<div class="answer">
<span class="iconfont">&#xe63d;</span>
<span class="iconfont">&#xe63f;</span>
<p>{{answer}}</p>
</div>
{{/ consults}}
</div>
<div class="consult-content-footer">
<div class="consult-content-footer" id="consult-content-footer">
<a href="{{link}}">
查看更多
<span class="iconfont">&#xe604;</span></a>
</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}}">
... ...