|
@@ -395,7 +395,6 @@ $('#me-checkall').click(function() { |
|
@@ -395,7 +395,6 @@ $('#me-checkall').click(function() { |
395
|
// 删除收藏
|
395
|
// 删除收藏
|
396
|
$('.del-favorite').click(function(e) {
|
396
|
$('.del-favorite').click(function(e) {
|
397
|
var id = $(this).closest('.fav-row').data('id'),
|
397
|
var id = $(this).closest('.fav-row').data('id'),
|
398
|
- shopid = $(this).closest('.fav-row').data('shopid'),
|
|
|
399
|
brandorshoptype = $(this).closest('.fav-row').data('brandorshoptype');
|
398
|
brandorshoptype = $(this).closest('.fav-row').data('brandorshoptype');
|
400
|
|
399
|
|
401
|
e.preventDefault();
|
400
|
e.preventDefault();
|
|
@@ -405,9 +404,7 @@ $('.del-favorite').click(function(e) { |
|
@@ -405,9 +404,7 @@ $('.del-favorite').click(function(e) { |
405
|
url: '/home/favorite/cancel',
|
404
|
url: '/home/favorite/cancel',
|
406
|
data: {
|
405
|
data: {
|
407
|
id: id,
|
406
|
id: id,
|
408
|
- shopid: shopid,
|
|
|
409
|
- brandorshoptype: brandorshoptype,
|
|
|
410
|
- type: favType
|
407
|
+ type: brandorshoptype || favType
|
411
|
}
|
408
|
}
|
412
|
}).then(function(data) {
|
409
|
}).then(function(data) {
|
413
|
if (data.code === 200) {
|
410
|
if (data.code === 200) {
|
|
@@ -420,6 +417,7 @@ $('.del-favorite').click(function(e) { |
|
@@ -420,6 +417,7 @@ $('.del-favorite').click(function(e) { |
420
|
$('#me-del-checked').click(function() {
|
417
|
$('#me-del-checked').click(function() {
|
421
|
var ids = [],
|
418
|
var ids = [],
|
422
|
name = '商品';
|
419
|
name = '商品';
|
|
|
420
|
+ var group = {};
|
423
|
|
421
|
|
424
|
if (favType === 'brand') {
|
422
|
if (favType === 'brand') {
|
425
|
name = '品牌';
|
423
|
name = '品牌';
|
|
@@ -429,7 +427,17 @@ $('#me-del-checked').click(function() { |
|
@@ -429,7 +427,17 @@ $('#me-del-checked').click(function() { |
429
|
|
427
|
|
430
|
if (confirm('您确定要删除您收藏的' + name + '吗?')) {
|
428
|
if (confirm('您确定要删除您收藏的' + name + '吗?')) {
|
431
|
$('.checkbox input[type="checkbox"]:checked').each(function() {
|
429
|
$('.checkbox input[type="checkbox"]:checked').each(function() {
|
432
|
- ids.push($(this).closest('.fav-row').data('id'));
|
430
|
+ var $favRow = $(this).closest('.fav-row'),
|
|
|
431
|
+ rdata = $favRow.data();
|
|
|
432
|
+
|
|
|
433
|
+ ids.push(rdata.id);
|
|
|
434
|
+
|
|
|
435
|
+ if (rdata.brandorshoptype) {
|
|
|
436
|
+ if (!group[rdata.brandorshoptype]) {
|
|
|
437
|
+ group[rdata.brandorshoptype] = [];
|
|
|
438
|
+ }
|
|
|
439
|
+ group[rdata.brandorshoptype].push(rdata.id);
|
|
|
440
|
+ }
|
433
|
});
|
441
|
});
|
434
|
|
442
|
|
435
|
if (ids.length === 0) {
|
443
|
if (ids.length === 0) {
|
|
@@ -442,6 +450,10 @@ $('#me-del-checked').click(function() { |
|
@@ -442,6 +450,10 @@ $('#me-del-checked').click(function() { |
442
|
url: '/home/favorite/cancel',
|
450
|
url: '/home/favorite/cancel',
|
443
|
data: {
|
451
|
data: {
|
444
|
id: ids.join(','),
|
452
|
id: ids.join(','),
|
|
|
453
|
+ group: {
|
|
|
454
|
+ bid: group.brand ? group.brand.join(',') : '',
|
|
|
455
|
+ sid: group.shop ? group.shop.join(',') : ''
|
|
|
456
|
+ },
|
445
|
type: favType
|
457
|
type: favType
|
446
|
}
|
458
|
}
|
447
|
}).then(function() {
|
459
|
}).then(function() {
|