Authored by 郝肖肖

潮流优选记录位置,新进来位置清除

... ... @@ -85,8 +85,7 @@ exports.resourcesGoodsList = (req, res, next) => {
let param = {};
param = {
productSkn: productSkn.split(','),
yh_channel: req.body.yh_channel
productSkn: productSkn.split(',')
};
plusstarModel.getProductBatch(param, {
... ...
... ... @@ -49,8 +49,7 @@ const getProductBatch = (param, options) => {
param.productSkn = _.isArray(param.productSkn) ? param.productSkn : [param.productSkn];
return api.get('', {
method: 'h5.product.batch',
productSkn: param.productSkn.join(','),
yh_channel: param.yh_channel
productSkn: param.productSkn.join(',')
}).then(result => {
let data = {};
... ...
... ... @@ -41,6 +41,11 @@ plusstar = {
width: 100 / $tabUlDom.find('li').length + '%'
});
$tabUlDom.find('li').each(function() {
// 重新进入滑动位置清除
window.setCookie($(this).data('code'), 0);
});
// 事情委托机制
$tabUlDom.bind('click', function(event) {
$liDom = $(event.target).closest('li');
... ... @@ -179,7 +184,8 @@ plusstar = {
tip.show('没有更多内容了');
return true;
}
//记录切换tab位置
// 记录切换tab位置
$(document).scrollTop(window.cookie(code) || 0);
that.resInit();
... ... @@ -234,8 +240,7 @@ plusstar = {
timeout: 5000,
data: {
productSkn: skn.join(','),
app_version: isApp,
yh_channel: that.ParentLiDom.index() + 1
app_version: isApp
},
dataType: 'html',
success: function(data) {
... ... @@ -276,10 +281,12 @@ plusstar = {
scrollFn = debounce(function() {
scrollTop = $(document).scrollTop();
//保留滑动位置,产品要求
// 保留滑动位置,产品要求
window.setCookie(plusstar.common.codeDefault, $(this).scrollTop());
// 当scroll到最后一列商品的高度后继续请求下一页数据
if (300 + scrollTop >= $(document).height() - windowHeight) {
if (400 + scrollTop >= $(document).height() - windowHeight) {
plusstar.goodsList();
}
... ...