...
|
...
|
@@ -30,7 +30,9 @@ $.get('/common/goodinfo', function(data) { |
|
|
Mustache.parse(tpl);
|
|
|
});
|
|
|
|
|
|
var gender = $('.mobile-wrap').hasClass('boys-wrap') ? 'index' : 'girl';
|
|
|
var isLogin = 'Y'; //TODO:是否登录,后台提供,区分走Ajax还是页面跳转
|
|
|
|
|
|
//商品收藏
|
|
|
$('.goods-list').delegate('.good-islike', 'touchstart', function(e) {
|
|
|
var $cur, $good, id, url;
|
...
|
...
|
@@ -43,16 +45,17 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) { |
|
|
id = $good.data('id');
|
|
|
|
|
|
if ($cur.hasClass('good-like')) {
|
|
|
url = '/goods/cancelprise';
|
|
|
url = '/' + gender + '/cancelprise';
|
|
|
} else {
|
|
|
url = '/goods/prise';
|
|
|
url = '/' + gender + '/prise';
|
|
|
}
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: url,
|
|
|
data: {
|
|
|
product_skn: id
|
|
|
id: id
|
|
|
}
|
|
|
}).then(function(data) {
|
|
|
if (data.code === 200) {
|
...
|
...
|
@@ -67,8 +70,7 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) { |
|
|
|
|
|
//srcoll to load more
|
|
|
$(window).scroll(function() {
|
|
|
var num,
|
|
|
ajaxUrl;
|
|
|
var num;
|
|
|
if (end || loading) {
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -79,14 +81,9 @@ $(window).scroll(function() { |
|
|
|
|
|
loading = true;
|
|
|
num = $goodList.children('.good-info').length;
|
|
|
if ($('.mobile-wrap').hasClass('boys-wrap')) {
|
|
|
ajaxUrl = '/index/getmore';
|
|
|
} else {
|
|
|
ajaxUrl = '/girl/getmore';
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: ajaxUrl,
|
|
|
url: '/' + gender + '/getmore',
|
|
|
data: {
|
|
|
page: page + 1
|
|
|
}
|
...
|
...
|
|