Authored by zhangxiaoru

店铺首页

6.86 KB | W: | H:

3.47 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

3.47 KB | W: | H:

6.86 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -681,10 +681,10 @@ function collectClick() { @@ -681,10 +681,10 @@ function collectClick() {
681 $('#collect').on('touchstart', function() { 681 $('#collect').on('touchstart', function() {
682 if ($('#collect').hasClass('alreadyCollect')) { 682 if ($('#collect').hasClass('alreadyCollect')) {
683 cancelShop(); 683 cancelShop();
684 - $('#collect').attr('class', 'notCollect'); 684 +
685 }else{ 685 }else{
686 collectShop(); 686 collectShop();
687 - $('#collect').attr('class', 'alreadyCollect'); 687 +
688 } 688 }
689 }); 689 });
690 }; 690 };
@@ -695,14 +695,21 @@ function postCollect(info) { @@ -695,14 +695,21 @@ function postCollect(info) {
695 return; 695 return;
696 } 696 }
697 searching = true; 697 searching = true;
698 - console.log(info.url) 698 +
699 $.ajax({ 699 $.ajax({
700 method: 'post', 700 method: 'post',
701 url: info.url, 701 url: info.url,
702 data: info.data, 702 data: info.data,
703 703
704 success: function(data) { 704 success: function(data) {
705 - 705 + if (data.code===200){
  706 + if ($('#collect').hasClass('alreadyCollect')) {
  707 + $('#collect').attr('class', 'notCollect');
  708 + }else{
  709 + $('#collect').attr('class', 'alreadyCollect');
  710 + }
  711 + }
  712 +
706 setTimeout(function () { 713 setTimeout(function () {
707 myScroll.refresh(); 714 myScroll.refresh();
708 scH = $('#scroller').outerHeight(); 715 scH = $('#scroller').outerHeight();