...
|
...
|
@@ -10,7 +10,14 @@ var $ = require('jquery'), |
|
|
var commentsNum,consultsNum;
|
|
|
|
|
|
var consultFooterEle = document.getElementById('consult-content-footer'),
|
|
|
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle);
|
|
|
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
|
|
|
|
|
|
navtabEle = document.getElementById('nav-tab'),
|
|
|
navtabHammer = navtabEle && new Hammer(navtabEle),
|
|
|
|
|
|
gotoConsultEle = document.getElementById('goto-consult'),
|
|
|
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle);
|
|
|
|
|
|
|
|
|
|
|
|
(function() {
|
...
|
...
|
@@ -36,29 +43,38 @@ var consultFooterEle = document.getElementById('consult-content-footer'), |
|
|
|
|
|
})();
|
|
|
|
|
|
$('#nav-tab li').on('touchend', function() {
|
|
|
var index = $(this).index();
|
|
|
if (navtabHammer) {
|
|
|
navtabHammer.on('tap', function(e) {
|
|
|
var $this = $(e.target).closest('li');
|
|
|
var index = $this.index();
|
|
|
|
|
|
if ($(this).hasClass('comment-nav') && 0 === commentsNum) {
|
|
|
tip.show('暂无商品评价');
|
|
|
} else {
|
|
|
if (!$(this).hasClass('focus')) {
|
|
|
if ($this.hasClass('comment-nav') && 0 === commentsNum) {
|
|
|
tip.show('暂无商品评价');
|
|
|
} else {
|
|
|
if (!$this.hasClass('focus')) {
|
|
|
|
|
|
$('#nav-tab li').each(function() {
|
|
|
$(this).removeClass('focus');
|
|
|
});
|
|
|
$('#feedback-content .content').each(function() {
|
|
|
$(this).addClass('hide');
|
|
|
});
|
|
|
$('#nav-tab li').each(function() {
|
|
|
$(this).removeClass('focus');
|
|
|
});
|
|
|
$('#feedback-content .content').each(function() {
|
|
|
$(this).addClass('hide');
|
|
|
});
|
|
|
|
|
|
$(this).addClass('focus');
|
|
|
$('#feedback-content .content:eq(' + index + ')').removeClass('hide');
|
|
|
$this.addClass('focus');
|
|
|
$('#feedback-content .content:eq(' + index + ')').removeClass('hide');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (consultFooterHammer) {
|
|
|
consultFooterHammer.on('tap', function() {
|
|
|
location.href = $(consultFooterEle).find('a').attr('href');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (gotoConsultHammer) {
|
|
|
gotoConsultHammer.on('tap', function() {
|
|
|
location.href = $(gotoConsultEle).find('a').attr('href');
|
|
|
});
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|