Authored by 王水玲

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuywap-node into develop

... ... @@ -29,7 +29,7 @@ exports.index = (req, res) => {
vipLevel: vipLevel,
ua: req.get('user-agent') || ''
}).then((result) => {
res.render('detail', {
res.render('detail/detail', {
result: result,
module: 'product',
page: 'detail',
... ... @@ -48,7 +48,7 @@ exports.intro = (req, res) => {
intro({
productskn: req.params.productskn
}).then((result) => {
res.render('intro', {
res.render('detail/intro', {
result: result
});
});
... ...
... ... @@ -102,10 +102,10 @@
{{# feedbacks}}
<div class="feedback-list ">
{{#if commentsNum}}
{{> product/feedback-tab}}
{{> product/detail/feedback-tab}}
{{else}}
{{#if consultsNum}}
{{> product/feedback-tab}}
{{> product/detail/feedback-tab}}
{{else}}
<div class="nodata tap-hightlight" id="goto-consult">
<span>暂无商品评价和咨询</span>
... ... @@ -127,7 +127,7 @@
{{/ enterStore}}
<div id="productDesc"> </div>
{{> product/recommend-for-you}}
{{> product/detail/recommend-for-you}}
{{> cart/chose-panel}}
{{#cartInfo}}
... ...
{{> product/recommend-content}}
\ No newline at end of file
... ...
{{result}}
\ No newline at end of file
<div class="title">为您优选新品</div>
<div id="swiper-recommend" class="swiper-container">
<div class="swiper-wrapper swiper-wrapper-recommend">
{{#recommendList}}
<a class="swiper-slide" href="{{url}}">
<img class="swiper-lazy img-box" data-src="{{thumb}}">
<div class="sale-name">
{{name}}
</div>
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}">{{salePrice}}</span>
{{#price}}<span class="old-price">{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</a>
{{/recommendList}}
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -6,11 +6,11 @@
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
Hammer = require('yoho-hammer'),
lazyLoad = require('yoho-jquery-lazyload'),
commonJS = require('../common');
lazyLoad = require('yoho-jquery-lazyload');
var goodsSwiper,
$discountFolder = $('.goodsDiscount .discount-folder'),
// commonJS = require('../common');
var $discountFolder = $('.goodsDiscount .discount-folder'),
$discountArrow = $('.goodsDiscount .first-item span');
var goodsDiscountEl = document.getElementById('goodsDiscount'),
... ... @@ -40,7 +40,7 @@ function showFooter() {
showFooter();
require('./like');
require('./detail/like');
lazyLoad($('img.lazy'));
... ... @@ -49,7 +49,7 @@ if ($('#goodsDiscount h1').length < 1) {
}
// 顶部swiper
goodsSwiper = new Swiper('.banner-swiper', {
new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
paginationClickable: true,
... ... @@ -59,7 +59,6 @@ goodsSwiper = new Swiper('.banner-swiper', {
spaceBetween: 3
});
// 初始化goods-discount
if ($discountFolder.children().length === 0) {
$discountFolder.css('display', 'none');
... ... @@ -113,18 +112,18 @@ $('#limit-sale').on('touchend', function(e) {
}, undefined, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
e.stopPropagation();
if ($(e.target).hasClass('dialog-wrapper')) {
$('.dialog-wrapper').off('touchstart').on('touchstart', function(para) {
para.stopPropagation();
if ($(para.target).hasClass('dialog-wrapper')) {
dialog.hideDialog();
}
});
}
});
require('./desc');
require('./comments-consults');
require('../recommend-for-you-product-desc');
require('./detail/desc');
require('./detail/comments-consults');
require('./detail/recommend-for-you-product-desc');
// 购物车商品数量
$.ajax({
... ...
... ... @@ -4,7 +4,7 @@
* @date: 2015/11/18
*/
var $ = require('yoho-jquery'),
tip = require('../plugin/tip'),
tip = require('../../plugin/tip'),
Hammer = require('yoho-hammer');
var commentsNum, consultsNum;
... ... @@ -32,23 +32,23 @@ var navtabEle = document.getElementById('nav-tab'),
$('#feedback-content .content').each(function() {
$(this).addClass('hide');
});
if (0 !== commentsNum) {
if (commentsNum !== 0) {
$('#nav-tab .comment-nav').addClass('focus');
$('#feedback-content .comment-content').removeClass('hide');
} else if (0 !== consultsNum) {
} else if (consultsNum !== 0) {
$('#nav-tab .consult-nav').addClass('focus');
$('#feedback-content .consult-content').removeClass('hide');
}
})();
}());
if (navtabHammer) {
navtabHammer.on('tap', function(e) {
var $this = $(e.target).closest('li');
var index = $this.index();
if ($this.hasClass('comment-nav') && 0 === commentsNum) {
if ($this.hasClass('comment-nav') && commentsNum === 0) {
tip.show('暂无商品评价');
} else {
if (!$this.hasClass('focus')) {
... ...
... ... @@ -6,8 +6,8 @@
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload'),
Swiper = require('yoho-swiper'),
loading = require('../plugin/loading'),
tip = require('../plugin/tip');
loading = require('../../plugin/loading'),
tip = require('../../plugin/tip');
var introUrl = $('#introUrl').val(),
winH = $(window).height(),
... ... @@ -15,10 +15,6 @@ var introUrl = $('#introUrl').val(),
searching = false,
end = false;
var sizeSwiper,
refSwiper;
// 判断是否要显示向左滑动提示
function hiddenTips($ele) {
var offsetContainer,
... ... @@ -52,7 +48,7 @@ function hiddenTips($ele) {
function wrapElements(selector, count) {
var elArr = null;
$(selector).each(function(idx, el) {
$(selector).each(function(idx) {
elArr = $(selector).slice(idx, idx + count);
if (elArr.length === count && idx % count === 0) {
... ... @@ -85,12 +81,12 @@ function search() {
lazyLoad($productDesc.find('img.lazy'));
// 尺码信息左右滑动
sizeSwiper = new Swiper('#size-swiper-container', {
new Swiper('#size-swiper-container', {
slidesPerView: 'auto'
});
// 模特试穿左右滑动
refSwiper = new Swiper('#reference-swiper-container', {
new Swiper('#reference-swiper-container', {
slidesPerView: 'auto'
});
... ...
... ... @@ -6,7 +6,7 @@
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer'),
tip = require('../plugin/tip');
tip = require('../../plugin/tip');
var goodsConsultsEle = $('#goods-consults')[0],
goodsConsultsHammer = goodsConsultsEle && new Hammer(goodsConsultsEle);
... ... @@ -32,7 +32,7 @@
productId = queryStr.split('&')[0].split('=')[1];
total = queryStr.split('&')[1] ? queryStr.split('&')[1].split('=')[1] : undefined;
})();
}());
if (goodsConsultsHammer) {
... ... @@ -67,7 +67,7 @@
} else if (data.code === 401) {
location.href = data.data;// 未登录跳转登录页
}
}).fail(function(data) {
}).fail(function() {
tip.show('网络断开连接了~');
});
... ...
... ... @@ -6,8 +6,8 @@
var $ = require('yoho-jquery'),
tip = require('../plugin/tip'),
chosePanel = require('../cart/chose-panel');
tip = require('../../plugin/tip'),
chosePanel = require('../../cart/chose-panel');
var productId = $('#productId').val();
... ... @@ -39,9 +39,9 @@ $('#likeBtn').on('touchstart', function() {
if (data.code === 200) {
$this.toggleClass('liked');
if ('cancel' === opt) {
if (opt === 'cancel') {
tip.show('取消收藏成功');
} else if ('ok' === opt) {
} else if (opt === 'ok') {
tip.show('收藏成功');
}
} else if (data.code === 400) {
... ...
... ... @@ -8,8 +8,7 @@
var Swiper = require('yoho-swiper'),
$ = require('yoho-jquery');
var recommendSwiper,
$recommendForYou = $('.recommend-for-you'),
var $recommendForYou = $('.recommend-for-you'),
preferenceUrl = $('#preferenceUrl').val(),
winH = $(window).height(),
end = false,
... ... @@ -30,7 +29,7 @@ function request() {
} else {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
... ...