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