Authored by biao

update

... ... @@ -193,4 +193,4 @@ exports.set = function(c) {
});
};
require('./maybe-like');
\ No newline at end of file
require('./maybe-like')();
... ...
... ... @@ -4,40 +4,45 @@
* @date: 2015/10/12
*/
var $ = require('jquery'),
module.exports = function(specificGender) {
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../plugin/tip'),
loading = require('../plugin/loading'),
lazyLoad = require('yoho.lazyload');
var navHammer,
var navHammer,
winH = $(window).height(),
$goodList = $('#goods-list'),
searching = false,
page = 0,
gender = null,
kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
lifestyleType = $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false,
num,
url;
var $curNav,
//The kidsType can be specified by the parameter. Add by @ZhaoBiao
var kidsType = specificGender === 'kidsType' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
lifestyleType = specificGender === 'lifestyleType' ||
$('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false;
var $curNav,
index,
$navList = $('#maybe-like-nav');
//ajax url
if (kidsType) {
//ajax url
if (kidsType) {
url = '/product/recom/maylikekids';
} else if (lifestyleType) {
} else if (lifestyleType) {
url = '/product/recom/maylikelife';
} else {
gender = $('.mobile-wrap').hasClass('boys-wrap') ? '1,3' : '2,3',
} else {
gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
'1,3' : '2,3',
url = '/product/recom/maylike?gender=' + gender;
}
}
$curNav = $navList.children('.focus');
$curNav = $navList.children('.focus');
if (lifestyleType) {
if (lifestyleType) {
navHammer = new Hammer($navList[0]);
navHammer.on('tap', function(e) {
var $this = $(e.target).closest('li'),
... ... @@ -63,11 +68,11 @@ if (lifestyleType) {
$(document).trigger('scroll'); //Trigger lazyLoad
e.srcEvent.stopPropagation();
});
}
}
loading.init($('.maybe-like'));
loading.init($('.maybe-like'));
function search() {
function search() {
if (searching) {
return;
}
... ... @@ -131,19 +136,20 @@ function search() {
loading.hideLoadingMask();
}
});
}
}
$('.maybe-like p').on('touchstart', function(e) {
$('.maybe-like p').on('touchstart', function(e) {
search();
});
});
function scrollHandler() {
function scrollHandler() {
if ($(window).scrollTop() + winH >= $(document).height() - 200) {
search();
}
}
}
//srcoll to load more
$(window).scroll(function() {
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
\ No newline at end of file
});
};
... ...
/**
* 新有货币界面
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2015/12/30
*/
//var $ = require('jquery');
//
//function getGender () {
// // body...
//}
require('../home/maybe-like')();
... ...
... ... @@ -19,3 +19,4 @@ require('./logistic');
require('./pay');
require('./personal-details');
require('./currency');
require('./currency-new');
... ...
... ... @@ -334,3 +334,9 @@
seajs.use('js/me/currency');
</script>
{{/if}}
{{#if currencyPage}}
<script>
seajs.use('js/me/currency-new');
</script>
{{/if}}
... ...