Authored by xuqi

del & col

@@ -55,9 +55,36 @@ $('.cart-goods').delegate('.checkbox', 'touchstart', function() { @@ -55,9 +55,36 @@ $('.cart-goods').delegate('.checkbox', 'touchstart', function() {
55 } 55 }
56 } 56 }
57 }); 57 });
58 -}).delegate('.icon-del', 'touchstart', function() { 58 +}).delegate('.icon-del', 'touchstart', function(e) {
  59 + e.stopPropagation();
  60 +
59 $(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide'); 61 $(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide');
60 62
61 $(document).bind('touchstart', docTouchEvt); 63 $(document).bind('touchstart', docTouchEvt);
  64 +}).delegate('.opt-panel', 'touchstart', function() {
  65 + var $this = $(this),
  66 + id = $this.closest('.shopping-cart-good').data('id');
  67 +
  68 + if ($this.closest('.put-in-favorite')) {
  69 +
  70 + //移入收藏夹
  71 + $.ajax({
  72 + type: 'POST',
  73 + url: '/shoppingCart/col',
  74 + data: {
  75 + id: id
  76 + }
  77 + });
  78 + } else {
  79 +
  80 + //删除
  81 + $.ajax({
  82 + type: 'POST',
  83 + url: '/shoppingCart/del',
  84 + data: {
  85 + id: id
  86 + }
  87 + });
  88 + }
62 }); 89 });
63 90