|
@@ -23,10 +23,10 @@ var $navLi = $('#fav-tab > li'), |
|
@@ -23,10 +23,10 @@ var $navLi = $('#fav-tab > li'), |
23
|
$favProductList = $('.fav-product-list'),
|
23
|
$favProductList = $('.fav-product-list'),
|
24
|
$favBrandList = $('.fav-brand-swiper-wrapper'),
|
24
|
$favBrandList = $('.fav-brand-swiper-wrapper'),
|
25
|
pageId = 1,
|
25
|
pageId = 1,
|
26
|
- brandPageId = 1, //收藏品牌的当前页数
|
26
|
+ brandPageId = 1, // 收藏品牌的当前页数
|
27
|
lockId = true,
|
27
|
lockId = true,
|
28
|
- brandLockId = true, //收藏品牌是否可下拉加载更多
|
|
|
29
|
- brandTab = false; //当前是否停留在收藏品牌页
|
28
|
+ brandLockId = true, // 收藏品牌是否可下拉加载更多
|
|
|
29
|
+ brandTab = false; // 当前是否停留在收藏品牌页
|
30
|
|
30
|
|
31
|
require('../common');
|
31
|
require('../common');
|
32
|
|
32
|
|
|
@@ -38,7 +38,7 @@ function showFavTab(index) { |
|
@@ -38,7 +38,7 @@ function showFavTab(index) { |
38
|
$favContainer.eq(index).addClass('show');
|
38
|
$favContainer.eq(index).addClass('show');
|
39
|
}
|
39
|
}
|
40
|
|
40
|
|
41
|
-//初始化swiper
|
41
|
+// 初始化swiper
|
42
|
function initSwiper(data) {
|
42
|
function initSwiper(data) {
|
43
|
var i,
|
43
|
var i,
|
44
|
idStrReg = /container-(\d+)['"]{1}/gi,
|
44
|
idStrReg = /container-(\d+)['"]{1}/gi,
|
|
@@ -47,10 +47,10 @@ function initSwiper(data) { |
|
@@ -47,10 +47,10 @@ function initSwiper(data) { |
47
|
idArrLen = idArr.length,
|
47
|
idArrLen = idArr.length,
|
48
|
containerId;
|
48
|
containerId;
|
49
|
|
49
|
|
50
|
- //$swiperList = $('.swiper-container');
|
50
|
+ // $swiperList = $('.swiper-container');
|
51
|
for (i = 0; i < idArrLen; i++) {
|
51
|
for (i = 0; i < idArrLen; i++) {
|
52
|
|
52
|
|
53
|
- /*id = $swiperList.eq(i).attr('data-id');
|
53
|
+ /* id = $swiperList.eq(i).attr('data-id');
|
54
|
|
54
|
|
55
|
if (!!swiperObj[id]) {
|
55
|
if (!!swiperObj[id]) {
|
56
|
swiperObj[id].destroy(true, true);
|
56
|
swiperObj[id].destroy(true, true);
|
|
@@ -97,13 +97,13 @@ function loadData($parent, url, page) { |
|
@@ -97,13 +97,13 @@ function loadData($parent, url, page) { |
97
|
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
|
97
|
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
|
98
|
window.rePosFooter();
|
98
|
window.rePosFooter();
|
99
|
} else if (data.more === true) {
|
99
|
} else if (data.more === true) {
|
100
|
- console.log(0)
|
100
|
+ console.log(0);
|
101
|
|
101
|
|
102
|
- //处理data等于end时如果loadingMask存在且没有hide样式的情况
|
102
|
+ // 处理data等于end时如果loadingMask存在且没有hide样式的情况
|
103
|
if ($loadingMask && !$loadingMask.hasClass('hide')) {
|
103
|
if ($loadingMask && !$loadingMask.hasClass('hide')) {
|
104
|
$loadingMask.addClass('hide');
|
104
|
$loadingMask.addClass('hide');
|
105
|
|
105
|
|
106
|
- //$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
|
106
|
+ // $parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
|
107
|
}
|
107
|
}
|
108
|
|
108
|
|
109
|
$parent.closest('.fav-type').find('.fav-load-background')
|
109
|
$parent.closest('.fav-type').find('.fav-load-background')
|
|
@@ -115,14 +115,14 @@ function loadData($parent, url, page) { |
|
@@ -115,14 +115,14 @@ function loadData($parent, url, page) { |
115
|
} else if (data.length > 10) {
|
115
|
} else if (data.length > 10) {
|
116
|
$parent.append(data);
|
116
|
$parent.append(data);
|
117
|
|
117
|
|
118
|
- //如果有数据loadingMask会被remove掉
|
118
|
+ // 如果有数据loadingMask会被remove掉
|
119
|
$loadingMask.remove();
|
119
|
$loadingMask.remove();
|
120
|
if (url === 'favBrand') {
|
120
|
if (url === 'favBrand') {
|
121
|
- initSwiper(data);//如果是收藏品牌需要初始化swiper
|
121
|
+ initSwiper(data);// 如果是收藏品牌需要初始化swiper
|
122
|
|
122
|
|
123
|
- brandLockId = false;//请求成功后解锁品牌收藏page++
|
123
|
+ brandLockId = false;// 请求成功后解锁品牌收藏page++
|
124
|
} else {
|
124
|
} else {
|
125
|
- lockId = false;//请求成功后解锁商品收藏page++
|
125
|
+ lockId = false;// 请求成功后解锁商品收藏page++
|
126
|
}
|
126
|
}
|
127
|
}
|
127
|
}
|
128
|
window.rePosFooter();
|
128
|
window.rePosFooter();
|
|
@@ -172,7 +172,7 @@ favTabHammer.on('tap', function(e) { |
|
@@ -172,7 +172,7 @@ favTabHammer.on('tap', function(e) { |
172
|
|
172
|
|
173
|
});
|
173
|
});
|
174
|
|
174
|
|
175
|
-//删除收藏的商品
|
175
|
+// 删除收藏的商品
|
176
|
favContentHammer = new Hammer(document.getElementById('fav-content'));
|
176
|
favContentHammer = new Hammer(document.getElementById('fav-content'));
|
177
|
|
177
|
|
178
|
favContentHammer.on('tap', function(e) {
|
178
|
favContentHammer.on('tap', function(e) {
|
|
@@ -221,7 +221,7 @@ favContentHammer.on('tap', function(e) { |
|
@@ -221,7 +221,7 @@ favContentHammer.on('tap', function(e) { |
221
|
}
|
221
|
}
|
222
|
}).fail(function() {
|
222
|
}).fail(function() {
|
223
|
|
223
|
|
224
|
- //TODO
|
224
|
+ // TODO
|
225
|
|
225
|
|
226
|
diaLog.showDialog({
|
226
|
diaLog.showDialog({
|
227
|
autoHide: true,
|
227
|
autoHide: true,
|
|
@@ -233,7 +233,7 @@ favContentHammer.on('tap', function(e) { |
|
@@ -233,7 +233,7 @@ favContentHammer.on('tap', function(e) { |
233
|
|
233
|
|
234
|
function scrollHandler() {
|
234
|
function scrollHandler() {
|
235
|
|
235
|
|
236
|
- //距离底部未1/4列表高度+底部高度的时候加载更多
|
236
|
+ // 距离底部未1/4列表高度+底部高度的时候加载更多
|
237
|
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $favBrandList.height() - footerH) {
|
237
|
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $favBrandList.height() - footerH) {
|
238
|
if (brandTab) {
|
238
|
if (brandTab) {
|
239
|
$brandLoadMore.filter('.hide').removeClass('hide');
|
239
|
$brandLoadMore.filter('.hide').removeClass('hide');
|
|
@@ -255,7 +255,7 @@ function scrollHandler() { |
|
@@ -255,7 +255,7 @@ function scrollHandler() { |
255
|
}
|
255
|
}
|
256
|
}
|
256
|
}
|
257
|
|
257
|
|
258
|
-//srcoll to load more
|
258
|
+// srcoll to load more
|
259
|
$(window).scroll(scrollHandler);
|
259
|
$(window).scroll(scrollHandler);
|
260
|
|
260
|
|
261
|
$(document).on('touchend', '.swiper-header', function() {
|
261
|
$(document).on('touchend', '.swiper-header', function() {
|