Authored by 郭成尧

bottombar-click-handle

... ... @@ -97,7 +97,7 @@ function diXuanFuInit() {
let $bottomFixClickArea = $('#bottomFixClickArea');
let $bottomPerShow = $('.per-show');
let href = '//activity.yoho.cn/featurebottombar/';
let currentClickElem;
let lastClickElem;
let currentElemclickTimes = 0;
if (location.hostname === 'm.yohobuy.com') {
... ... @@ -114,17 +114,16 @@ function diXuanFuInit() {
$('#bottomClick' + pageId).on('click', () => {
$bottomPerShow.addClass('hide');
if ($bottomShow.hasClass('hide')) {
if (currentClickElem === pageId && currentElemclickTimes > 1) {
currentElemclickTimes = 0;
} else {
$bottomShow.removeClass('hide');
}
if (!lastClickElem) {
currentElemclickTimes++;
}
if (lastClickElem === pageId && currentElemclickTimes > 1) {
currentElemclickTimes = 0;
} else {
$bottomShow.addClass('hide');
$bottomShow.removeClass('hide');
}
currentClickElem = pageId;
lastClickElem = pageId;
currentElemclickTimes++;
});
});
... ...