thinkTank_er.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. (function(){
  2. $(".achieve_cont>a>div>span").click(function(){
  3. var biaozhi=$(this).attr("val");
  4. if(!biaozhi){
  5. var p_width=$(this).siblings("p").height();
  6. $(this).addClass("active").attr("val","yes").parent().animate({"height":p_width},500);
  7. }else if(biaozhi=="yes"){
  8. $(this).removeClass("active").attr("val","").parent().animate({"height":45},500);
  9. }
  10. });
  11. //点击感兴趣
  12. var t=0;
  13. $('.basic .loves').click(function(){
  14. var theId=$("#demand_id").attr("val");
  15. var islogin=$("#isLogin").attr("islogin");
  16. if(islogin=="true"){
  17. $(".head_login").click();
  18. }
  19. if($(this).find('span:first-child').hasClass('box_love')&&islogin=="false"){
  20. t=$('.dem_number').text();
  21. $('.dem_number').text(parseInt(t)+1);
  22. $(this).find('span:first-child').addClass('bj_love').removeClass('box_love');
  23. $.ajax({
  24. method: "post",
  25. dataType: "json",
  26. url: globalConfig.context + "/api/user/portal/demandInterest",
  27. data: {
  28. id:theId
  29. },
  30. success: function (data) {
  31. }
  32. });
  33. return false;
  34. }
  35. if($(this).find('span:first-child').hasClass('bj_love')&&islogin=="false"){
  36. t=$('.dem_number').text();
  37. $('.dem_number').text(parseInt(t)-1)
  38. $(this).find('span:first-child').addClass('box_love').removeClass('bj_love')
  39. $.ajax({
  40. method: "post",
  41. dataType: "json",
  42. url: globalConfig.context + "/api/user/portal/demandCancelInterest",
  43. data: {
  44. id:theId
  45. },
  46. success: function (data) {
  47. }
  48. });
  49. }
  50. })
  51. })()