Authored by 郭成尧

'gulpge'

... ... @@ -6095,7 +6095,7 @@ define("js/passport/bind/relate", ["jquery"], function(require, exports, module)
require("js/passport/code")(true, false, true);
});
define("js/product/entry", ["jquery","swiper","mlellipsis","lazyload","hammer","handlebars","source-map","iscroll-probe","index"], function(require, exports, module){
define("js/product/entry", ["jquery","swiper","mlellipsis","lazyload","iscroll-probe","hammer","handlebars","source-map","index"], function(require, exports, module){
/**
* 产品打包入口
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
... ... @@ -6111,7 +6111,7 @@ require("js/product/newsale/hot-rank");
require("js/product/product-category");
require("js/product/shop");
});
define("js/product/newsale/newarrival", ["jquery","swiper","mlellipsis","lazyload","hammer","index"], function(require, exports, module){
define("js/product/newsale/newarrival", ["jquery","swiper","mlellipsis","lazyload","iscroll-probe","hammer","index"], function(require, exports, module){
/**
* 新品到着
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
... ... @@ -6514,7 +6514,7 @@ $listNav.on('touchstart', 'li', function(e) {
});
});
define("js/plugin/filter", ["jquery","hammer"], function(require, exports, module){
define("js/plugin/filter", ["jquery","iscroll-probe","hammer"], function(require, exports, module){
/**
* 筛选JS
* 暴露三个接口:注册回调、显示filter、隐藏filter
... ... @@ -6523,6 +6523,7 @@ define("js/plugin/filter", ["jquery","hammer"], function(require, exports, modul
*/
var $ = require("jquery"),
IScroll = require("iscroll-probe")
Hammer = require("hammer");
var $filter;
... ... @@ -6578,6 +6579,7 @@ function classifyTapEvt($this) {
$this.siblings('.active').removeClass('active');
$this.addClass('active');
}
//子筛选项选中处理
... ... @@ -6650,8 +6652,7 @@ function initFilter(opt) {
filterHammer.on('tap', function(e) {
var $this = $(e.target),
$cur;
e.preventDefault();//防止透点
// e.preventDefault();//防止透点
if ($this.closest('.filter-body').length > 0) {
$cur = $this.closest('.sub-item');
... ... @@ -6678,6 +6679,41 @@ function initFilter(opt) {
}
}
});
if(opt.isScroll){
$("ul.sub-classify").each(function(){
$(this).wrap("<div class='sub-classify-farther' data-type='" + $(this).data("type") + "'></div>");
// $(this).removeClass("sub-classify");
var lastY=0,y=0;
var $slider=$(this);
$slider.on('touchstart', function(e) {
lastY = e.originalEvent.touches[0].pageY;
});
$slider.on('touchmove', function(e) {
var curY = e.originalEvent.touches[0].pageY;
var deltaY = curY - lastY;
var height = $(this)[0].scrollHeight;
var limit = height - $(this).parent().height();
y = y + deltaY;
if (y < limit * -1)
y = limit * -1;
if (y > 0)
y = 0;
var translate = 'translate3d(0,' + y + 'px,0)';
$(this).css({
'-moz-transform': translate,
'-ms-transform': translate,
'transform': translate,
'-webkit-transform': translate,
});
lastY = curY;
});
$slider.on('touchend', function(e) {});
});
}
}
... ... @@ -6754,7 +6790,7 @@ $.ajax({
});
});
define("js/product/newsale/discount", ["jquery","swiper","mlellipsis","lazyload","hammer","index"], function(require, exports, module){
define("js/product/newsale/discount", ["jquery","swiper","mlellipsis","lazyload","iscroll-probe","hammer","index"], function(require, exports, module){
/**
* 商品列表页
* @author: xuqi<qi.xu@yoho.cn>
... ... @@ -7148,7 +7184,7 @@ $listNav.on('touchstart', 'li', function(e) {
});
});
define("js/product/list", ["jquery","hammer","mlellipsis","lazyload"], function(require, exports, module){
define("js/product/list", ["jquery","hammer","mlellipsis","lazyload","iscroll-probe"], function(require, exports, module){
/**
* 商品列表页
* @author: xuqi<qi.xu@yoho.cn>
... ... @@ -9500,7 +9536,9 @@ var $subNav = $('.home-sub-nav'),
shopId = $('input[name="shop_id"]').val(),
appVersion = $('input[name="app_version"]').val(),
brand = $('input[name="brand"]').val(),
favId = $('input[name="favId"]').val();
favId = $('input[name="favId"]').val(),
shopIdForFilter = $('input[name="shopIdForFilter"]').val(), // tar add 160826
channel = $('input[name="channel"]').val(); // tar add 160826
var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
... ... @@ -9508,6 +9546,12 @@ var winH = $(window).height(),
//默认筛选条件
var defaultOpt = require("js/product/query-param");
var map = {
newest: "new-goods",
price: "price-goods",
discount: "discount-goods"
}
var $listNav = $('#list-nav'),
//导航数据信息
... ... @@ -9516,41 +9560,48 @@ var $listNav = $('#list-nav'),
order: 1,
reload: true,
page: 1,
end: false
end: false,
$co: $("#new-arrival")
},
hot: {
order: 1,
reload: true,
page: 1,
end: false
end: false,
$co: $("#popularity")
},
newest: {
order: 1,
reload: true,
page: 0,
end: false
end: false,
$co: $(".new-goods")
},
price: {
order: 1,
reload: true,
page: 0,
end: false
end: false,
$co: $(".price-goods")
},
discount: {
order: 1,
reload: true,
page: 0,
end: false
end: false,
$co: $(".discount-goods")
}
},
$pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中项
searching;
var viewType = 1,// 1-首页,2-上新,3-人气
var viewType = 1, // 1-首页,2-上新,3-人气
listCount = $('.category-list li').length,
listModValue = 4 - listCount % 4,
listIndex;
var isFirstLoad = true;
lazyLoad($('img.lazy'));
//焦点效果
... ... @@ -9596,10 +9647,43 @@ if ($('.category-list li').length >= 5) {
}
}
var ISPOSTING = false;
/**
* 获取url参数
*/
// function getQueryString(name) {
// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
// var r = window.location.search.substr(1).match(reg);
//
// if (r != null) {
// return window.unescape(r[2]);
// }
// return null;
// }
/**
* 获取url参数
* @returns {Array}
*/
function queryString() {
var vars = [],
hash,
i;
var hashes = window.location.search.slice(1).split('&');
for (i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
function getPageGoods(info) {
var nav,navType;
var nav, navType;
if (searching) {
if (ISPOSTING) {
return;
}
... ... @@ -9612,7 +9696,8 @@ function getPageGoods(info) {
return;
}
searching = true;
ISPOSTING = true;
$.ajax({
type: 'GET',
url: info.url,
... ... @@ -9625,22 +9710,12 @@ function getPageGoods(info) {
info.callBack(data);
},
error: function() {
alert('网络断开连接了~');
searching = false;
tip.show('网络断开连接了~');
ISPOSTING = false;
}
});
}
function getParam(req) {
if (brand) {
req.data.brand = brand;
}
if (shopId) {
req.data.shop_id = shopId;
}
}
function newData(callback) {
var req = {};
req.url = location.protocol + '//m.yohobuy.com/index/search/search';
... ... @@ -9650,23 +9725,30 @@ function newData(callback) {
page: navInfo.new.page,
tagNew: '1'
};
if (brand) {
req.data.brand = brand;
}
if (shopId) {
req.data.shop_id = shopId;
}
getParam(req);
req.callBack = function(data) {
$('#new-arrival').append(data);
$('#popularity').hide();
$('#new-arrival').show().append(data);
navInfo.new.page++;
myScroll.refresh();
lazyLoad($('#new-arrival .lazy'));
scH = $('#scroller').outerHeight();
searching = false;
ISPOSTING = false;
callback && $.isFunction(callback) && callback();
// myScroll.refresh();
};
getPageGoods(req);
}
function hotData(callback) {
var req = {};
req.url = location.protocol + '//m.yohobuy.com/index/search/search';
req.data = {
type: 'hot',
... ... @@ -9674,17 +9756,22 @@ function hotData(callback) {
page: navInfo.hot.page,
showTag: '1'
};
if (brand) {
req.data.brand = brand;
}
getParam(req);
if (shopId) {
req.data.shop_id = shopId;
}
req.callBack = function(data) {
$('#popularity').append(data);
$('#new-arrival').hide();
$('#popularity').show().append(data);
navInfo.hot.page++;
myScroll.refresh();
lazyLoad($('#popularity .lazy'));
scH = $('#scroller').outerHeight();
searching = false;
ISPOSTING = false;
callback && $.isFunction(callback) && callback();
// myScroll.refresh();
};
getPageGoods(req);
}
... ... @@ -9707,129 +9794,204 @@ $.jqtab = function(nav, posNav, main) {
var index = $(this).index(),
activeTab = $(this).attr('tab');
$nav1.removeClass('fixed-top');
// $nav1.removeClass('fixed-top');
tabChange($(nav + ' li'), index);
tabChange($(posNav + ' li'), index);
$(main).hide();
$('#' + activeTab).fadeIn();
if (activeTab === 'new-arrival') {
newData();
$(".first").hide();
newData(myScroll.refresh);
viewType = 2;
} else if (activeTab === 'popularity') {
hotData();
$(".first").hide();
hotData(myScroll.refresh);
viewType = 3;
} else if (activeTab === 'home-page') {
viewType = 1;
$("#new-arrival").add("#popularity").hide();
$(".first").show();
myScroll && myScroll.refresh();
scH = $('#scroller').outerHeight();
$nav1.removeClass('fixed-top');
$nav1.removeClass('absolute');
$nav2.removeClass('fixed-top');
$nav2.removeClass('absolute');
}
if (!$nav1.hasClass('hide')) {
myScroll.scrollTo(0, 0 - imgH);
}
$nav1.addClass('hide');
});
};
$.jqtab('#nav', '#pos-nav', '.main');
$('#wrapper').addClass('scroll-wrapper');
// lazyLoad($('img.lazy'));
//
//
myScroll = new IScroll('#wrapper', {
probeType: 3,
mouseWheel: true,
click: true
});
var nTop = $("#nav").offset().top;
var nHei = $("#nav").height();
var listNav = $("#navlist2").offset().top;
var nHS=0;
myScroll.on('scroll', function() {
var scrollCall,
sTop = -this.y;
// 范围
// if (sTop - nTop > 0)
{
if (viewType === 2 || viewType === 3) {
// if (sTop - nTop > 0) {
var y = sTop - nTop-1;
if(y<1){
y=1;
}
var translate = 'translate3d(0,' + y + 'px,0)';
$("#nav").css({
'-moz-transform': translate,
'-ms-transform': translate,
'transform': translate,
'-webkit-transform': translate,
'position': 'relative',
'z-index': 1000
});
// }
} else {
if (sTop - listNav > -50 && sTop - listNav < 0) {
if (sTop + winH * 2 > scH) {
switch (viewType) {
case 2:
scrollCall = function() {
$nav1.css({
transform: 'translate(0, ' + (-scH) + 'px)'
});
};
newData(scrollCall);
break;
case 3:
scrollCall = function() {
$nav1.css({
transform: 'translate(0, ' + (-scH) + 'px)'
});
};
hotData(scrollCall);
break;
} else if (sTop - listNav > 0) {
var y = sTop - listNav-1;
if(y<1){
y=1;
}
var translate = 'translate3d(0,' + y + 'px,0)';
$("#navlist2").css({
'-moz-transform': translate,
'-ms-transform': translate,
'transform': translate,
'-webkit-transform': translate,
'position': 'relative',
'z-index': 1001
});
} else {
var y = sTop - nTop-1;
if(y<1){
y=1;
}
var translate = 'translate3d(0,' + y + 'px,0)';
$("#nav").css({
'-moz-transform': translate,
'-ms-transform': translate,
'transform': translate,
'-webkit-transform': translate,
'position': 'relative',
'z-index': 1000
});
}
}
}
if (sTop < imgH) {
if (!$nav1.hasClass('hide')) {
$nav1.addClass('hide');
}
if (!$nav2.hasClass('hide')) {
$nav2.addClass('hide');
} //滑动距离不到导航1
} else if (sTop < imgH + nav1H + main1oH) {
if ($nav1.hasClass('hide')) {
$nav1.removeClass('hide');
}
if (!$nav2.hasClass('hide')) {
$nav2.addClass('hide');
}//滑动距离不到导航2
if (sTop < imgH + main1H) {
if (!$nav1.hasClass('fixed-top')) {
$nav1.addClass('fixed-top')
.removeClass('absolute')
.css({
transform: 'translate(0, ' + (-scH) + 'px)'
});
}
} else if (sTop < imgH + nav1H + main1H) {
if ($('#home-page').is(':hidden')) {
return false;
}
if (!$nav1.hasClass('absolute')) {
$nav1.addClass('absolute')
.removeClass('fixed-top');
}
$nav1.css({
transform: 'translate(0, ' + (imgH + main1H - sTop - scH) + 'px)'
});
}
} else {
if ($('#home-page').is(':hidden')) {
return false;
}
}
if (!$nav1.hasClass('hide')) {
$nav1.addClass('hide');
}
if ($nav2.hasClass('hide')) {
$nav2.removeClass('hide');
}
if (sTop < scH) {
if (!$nav2.hasClass('absolute')) {
$nav2.addClass('absolute')
.removeClass('fixed-top');
}
$nav2.css({
transform: 'translate(0, ' + (-scH) + 'px)'
});
}
if (sTop + winH > $('#scroller').height() - 0.25 * $goodsContainer.height() - 50) {
search({
type: 'shop_id',
id: shopId,
brand: brand,
url: location.protocol + '//m.yohobuy.com/index/search/search',
nextPage: true
});
}
// if (sTop + winH * 2 > scH) {
// switch (viewType) {
// case 2:
// scrollCall = function() {
// $nav1.css({
// transform: 'translate(0, ' + (-scH) + 'px)'
// });
// };
// newData(scrollCall);
// break;
// case 3:
// scrollCall = function() {
// $nav1.css({
// transform: 'translate(0, ' + (-scH) + 'px)'
// });
// };
// hotData(scrollCall);
// break;
// }
// }
// if (sTop < imgH) {
// if (!$nav1.hasClass('hide')) {
// $nav1.addClass('hide');
// }
// if (!$nav2.hasClass('hide')) {
// $nav2.addClass('hide');
// } //滑动距离不到导航1
// } else if (sTop < imgH + nav1H + main1oH) {
// if ($nav1.hasClass('hide')) {
// $nav1.removeClass('hide');
// }
// if (!$nav2.hasClass('hide')) {
// $nav2.addClass('hide');
// }//滑动距离不到导航2
// if (sTop < imgH + main1H) {
// if (!$nav1.hasClass('fixed-top')) {
// $nav1.addClass('fixed-top')
// .removeClass('absolute')
// .css({
// transform: 'translate(0, ' + (-scH) + 'px)'
// });
// }
// } else if (sTop < imgH + nav1H + main1H) {
// if ($('#home-page').is(':hidden')) {
// return false;
// }
// if (!$nav1.hasClass('absolute')) {
// $nav1.addClass('absolute')
// .removeClass('fixed-top');
// }
// $nav1.css({
// transform: 'translate(0, ' + (imgH + main1H - sTop - scH) + 'px)'
// });
// }
// } else {
// if ($('#home-page').is(':hidden')) {
// return false;
// }
// if (!$nav1.hasClass('hide')) {
// $nav1.addClass('hide');
// }
// if ($nav2.hasClass('hide')) {
// $nav2.removeClass('hide');
// }
// if (sTop < scH) {
// if (!$nav2.hasClass('absolute')) {
// $nav2.addClass('absolute')
// .removeClass('fixed-top');
// }
// $nav2.css({
// transform: 'translate(0, ' + (-scH) + 'px)'
// });
// }
// }
$('#scroller').trigger('scroll');
});
document.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
... ... @@ -9839,19 +10001,19 @@ document.addEventListener('touchmove', function(e) {
}*/
//window onload 后重新refresh iscroll
$(window).load(function() {
myScroll && myScroll.refresh();
imgH = $('#nav-top').outerHeight();
nav1H = $('#nav').outerHeight();
main1H = $('#nav-main').height();
main1oH = $('#nav-main').outerHeight();
nav2H = $('#list-nav').outerHeight();
main2oH = $('#goods-container').outerHeight();
setTimeout(function() {
scH = $('#scroller').outerHeight();
}, 1000);
});
// //window onload 后重新refresh iscroll
// $(window).load(function() {
// myScroll && myScroll.refresh();
// imgH = $('#nav-top').outerHeight();
// nav1H = $('#nav').outerHeight();
// main1H = $('#nav-main').height();
// main1oH = $('#nav-main').outerHeight();
// nav2H = $('#list-nav').outerHeight();
// main2oH = $('#goods-container').outerHeight();
// setTimeout(function() {
// scH = $('#scroller').outerHeight();
// }, 1000);
// });
function bindGoodThumbClick() {
$(document).trigger('rebindBpEvent');
... ... @@ -9861,10 +10023,12 @@ function search(opt) {
var setting = {},
ext,
att,
nav, navType,
nav,
page;
if (searching) {
var navType = opt.navType || 'newest';
if (ISPOSTING) {
return;
}
... ... @@ -9881,8 +10045,8 @@ function search(opt) {
}
}
$listNav.children('.active').removeClass('active');
$pre.addClass('active');
// $listNav.children('.active').removeClass('active');
// $pre.addClass('active');
if (opt.hasOwnProperty('id')) {
switch (opt.type) {
case 'shop_id':
... ... @@ -9936,13 +10100,7 @@ function search(opt) {
}
//导航类别
if ($pre.hasClass('new')) {
navType = 'newest';
} else if ($pre.hasClass('price')) {
navType = 'price';
} else if ($pre.hasClass('discount')) {
navType = 'discount';
}
nav = navInfo[navType];
page = nav.page + 1;
... ... @@ -9966,8 +10124,12 @@ function search(opt) {
setting.shop_id = shopId;
}
searching = true;
loading.showLoadingMask();
ISPOSTING = true;
if (!isFirstLoad) {
loading.showLoadingMask();
isFirstLoad = false;
}
$.ajax({
type: 'GET',
... ... @@ -9977,69 +10139,47 @@ function search(opt) {
var $container,
num;
switch (navType) {
case 'newest':
$container = $ngc;
break;
case 'price':
$container = $pgc;
break;
case 'discount':
$container = $dgc;
break;
}
if (data === ' ') {
nav.end = true;
if (nav.reload) {
$container.html(noResult);
nav.$co.html(noResult);
}
} else {
if (nav.reload) {
$container.html(data);
lazyLoad($container.find('.lazy'));
nav.$co.html(data);
lazyLoad(nav.$co.find('.lazy'));
} else {
num = $container.find('.good-info').length;
$container.append(data);
lazyLoad($container.find('.good-info:gt(' + (num - 1) + ') .lazy'));
num = nav.$co.find('.good-info').length;
nav.$co.append(data);
lazyLoad(nav.$co.find('.good-info:gt(' + (num - 1) + ') .lazy'));
}
}
nav.reload = false;
nav.page = page;
searching = false;
loading.hideLoadingMask();
ISPOSTING = false;
// loading.hideLoadingMask();
window.rePosFooter();
setTimeout(function() {
myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 1000);
myScroll && myScroll.refresh();
bindGoodThumbClick();
// $(window).trigger('scroll');
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
ISPOSTING = false;
loading.hideLoadingMask();
}
});
}
/**
* 获取url参数
*/
// function getQueryString(name) {
// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
// var r = window.location.search.substr(1).match(reg);
//
// if (r != null) {
// return window.unescape(r[2]);
// }
// return null;
// }
/**
* 获取url参数
... ... @@ -10059,37 +10199,48 @@ function queryString() {
return vars;
}
$.ajax({
function setFtle(){
$.ajax({
type: 'GET',
url: location.protocol + '//m.yohobuy.com/search/filter',
data: {
shop_id: queryString().shop_id,
brand: brand,
shop_id: shopIdForFilter ? shopIdForFilter : queryString().shop_id,
brand: brand ? brand : queryString().brand,
gender: queryString().gender,
channel: queryString().channel
channel: channel ? channel : queryString().channel
},
success: function(data) {
$goodsContainer.append(data);
$("#filter").html(data);
// $goodsContainer.append(data);
//初始化filter&注册filter回调
filter.initFilter({
fCbFn: search,
fCbFn: function(opt){
$listNav.find(".filter").removeClass("active");
search(opt);
myScroll && myScroll.enable();
},
hCbFn: function() {
//切换active状态到$pre上
$pre.addClass('active');
$pre.siblings('.filter').removeClass('active');
},
missStatus: true
missStatus: true,
isScroll: true
});
setTimeout(function() {
myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 1000);
}
});
}
setTimeout(function(){
setFtle();
},1000);
$listNav.bind('contextmenu', function(e) {
return false;
});
... ... @@ -10114,6 +10265,7 @@ $subNav.on('touchend touchcancel', function(e) {
//筛选面板切换状态
if ($this.hasClass('active')) {
filter.hideFilter();
myScroll && myScroll.enable();
//点击筛选钱的active项回复active
$pre.addClass('active');
... ... @@ -10125,6 +10277,16 @@ $subNav.on('touchend touchcancel', function(e) {
$this.addClass('active');
filter.showFilter();
myScroll && myScroll.disable();
$(".filter-body").height($(window).height());
$(".filter-body .sub-classify-farther").css("height", "100%");
// // $()
// new IScroll('.filter-body', {
// probeType: 3,
// mouseWheel: true,
// click: true
// });
}
} else {
if ($this.hasClass('new')) {
... ... @@ -10141,7 +10303,6 @@ $subNav.on('touchend touchcancel', function(e) {
nav = navInfo[navType];
if ($this.hasClass('active')) {
//最新无排序切换
if ($this.hasClass('new')) {
return;
... ... @@ -10156,50 +10317,23 @@ $subNav.on('touchend touchcancel', function(e) {
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; //切换排序
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
}
$(".container", "#goods-container").hide();
nav.$co.show();
}
} else {
$active = $subNav.find('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
// $pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
if ($active.hasClass('filter')) {
//若之前active项为筛选,则隐藏筛选面板
filter.hideFilter();
myScroll && myScroll.enable();
} else {
//切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
}
$(".container", "#goods-container").hide();
nav.$co.show();
}
$subNav.children().removeClass('active');
... ... @@ -10212,61 +10346,67 @@ $subNav.on('touchend touchcancel', function(e) {
id: shopId,
brand: brand,
url: location.protocol + '//m.yohobuy.com/index/search/search',
nextPage: false
nextPage: false,
navType: navType
});
}
}
e.stopPropagation();
return false;
});
function scrollHandler() {
// function scrollHandler() {
sTop = -myScroll.y;
// sTop = -myScroll.y;
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
myScroll && myScroll.refresh();
if (sTop + winH > $('#scroller').height() - 0.25 * $goodsContainer.height() - 50) {
if ($pre !== undefined) {
search({
type: 'shop_id',
id: shopId,
brand: brand,
url: location.protocol + '//m.yohobuy.com/index/search/search',
nextPage: true
});
}
}
}
// //当scroll到1/4$goodsContainer高度后继续请求下一页数据
// myScroll && myScroll.refresh();
// if (sTop + winH > $('#scroller').height() - 0.25 * $goodsContainer.height() - 50) {
// if ($pre !== undefined) {
// search({
// type: 'shop_id',
// id: shopId,
// brand: brand,
// url: location.protocol + '//m.yohobuy.com/index/search/search',
// nextPage: true
// });
// }
// }
// }
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
// //srcoll to load more
// $(window).scroll(function() {
// window.requestAnimationFrame(scrollHandler);
// });
//初始请求最新第一页数据
search({
type: 'shop_id',
id: shopId,
brand: brand,
url: location.protocol + '//m.yohobuy.com/index/search/search',
nextPage: false
});
// //初始请求最新第一页数据
// search({
// type: 'shop_id',
// id: shopId,
// brand: brand,
// url: location.protocol + '//m.yohobuy.com/index/search/search',
// nextPage: false
// });
// $listNav.on('touchstart', 'li', function(e) {
// $(this).addClass('bytouch');
// }).on('touchend touchcancel', function() {
// $listNav.find('li').removeClass('bytouch');
// // myScroll.refresh();
// });
// $nav2.on('touchstart', 'li', function(e) {
// $(this).addClass('bytouch');
// }).on('touchend touchcancel', function() {
// $nav2.find('li').removeClass('bytouch');
// // myScroll.refresh();
// });
$listNav.on('touchstart', 'li', function(e) {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$listNav.find('li').removeClass('bytouch');
myScroll.refresh();
});
$nav2.on('touchstart', 'li', function(e) {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$nav2.find('li').removeClass('bytouch');
myScroll.refresh();
});
//**************************************************底部收藏***********************************
//底部导航点击
function fotterClick(group) {
... ... @@ -10334,7 +10474,7 @@ function postCollect(info) {
searching = false;
},
error: function() {
alert('网络断开连接了~');
tip.show('网络断开连接了~');
searching = false;
}
});
... ... @@ -10369,6 +10509,7 @@ $('#collect').on('touchstart', function(e) {
collectShop();
}
});
});
define("js/me/entry", ["jquery","hammer","lazyload","swiper","handlebars","source-map","mlellipsis","index"], function(require, exports, module){
/**
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

8.82 KB | W: | H:

14.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin