sns_friend.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. $(function(){
  2. //加关注
  3. $("[nc_type='followbtn']").live('click',function(){
  4. var data_str = $(this).attr('data-param');
  5. eval( "data_str = "+data_str);
  6. $.getJSON('index.php?act=member_snsfriend&op=addfollow&mid='+data_str.mid, function(data){
  7. if(data){
  8. var obj = $('#recordone_'+data_str.mid);
  9. obj.find('[nc_type="signmodule"]').children().hide();
  10. if(data.state == 2){
  11. obj.find('[nc_type=\"mutualsign\"]').show();
  12. }else{
  13. obj.find('[nc_type=\"followsign\"]').show();
  14. }
  15. showSucc('关注成功');
  16. }else{
  17. showError('关注失败');
  18. }
  19. });
  20. return false;
  21. });
  22. //取消关注
  23. $("[nc_type='cancelbtn']").live('click',function(){
  24. var data_str = $(this).attr('data-param');
  25. eval( "data_str = "+data_str);
  26. $.getJSON('index.php?act=member_snsfriend&op=delfollow&mid='+data_str.mid, function(data){
  27. if(data){
  28. $('#recordone_'+data_str.mid).hide();
  29. showSucc('取消成功');
  30. }else{
  31. showError('取消失败');
  32. }
  33. });
  34. return false;
  35. });
  36. // 批量关注
  37. $('*[nctype="batchFollow"]').live('click', function(){
  38. eval("data_str = "+$(this).attr('data-param'));
  39. ajax_get_confirm('','index.php?act=member_snsfriend&op=batch_addfollow&ids='+data_str.ids);
  40. });
  41. });