demandDetail.js 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import '../../css/bootstrap.less';
  2. import 'bootstrap/dist/js/bootstrap.js';
  3. import '../../css/public.css';
  4. import '../../css/main_banner.css';
  5. import '../../js/public.js';
  6. import '../../js/main_banner.js';
  7. import '../../css/technologyTrading/demandDetail.css';
  8. (function(){
  9. var isIntereste=$("#isInterester").attr("isInterester");
  10. if(isIntereste==0){
  11. $(".loves>span:first-child").removeClass("box_love").addClass("bj_love");
  12. }else if(isIntereste==1){
  13. $(".loves>span:first-child").removeClass("bj_love").addClass("box_love");
  14. }
  15. $(".fine").on('click', 'div.pointer', function () {
  16. var theId = $(this).children("p.demandId").html();
  17. var thetype=$(this).children("p.demandTyp").html();
  18. window.open(globalConfig.context + '/portal/technologyTrading/demandDetail?id=' + theId+'&type='+thetype );
  19. });
  20. $(".main_introduce ul").on("click","li",function(){
  21. var theId = $(this).children("div").children("p.demandId").html();
  22. var thetype=$(this).children("div").children("p.demandTyp").html();
  23. window.open(globalConfig.context + '/portal/technologyTrading/demandDetail?id=' + theId+'&type='+thetype );
  24. })
  25. //点击感兴趣
  26. var t=0;
  27. $('.basic .loves').click(function(){
  28. var theId=$("#demand_id").attr("val");
  29. var islogin=$("#isLogin").attr("islogin");
  30. if(islogin=="true"){
  31. $(".head_login").click();
  32. }
  33. if($(this).find('span:first-child').hasClass('box_love')&&islogin=="false"){
  34. t=$('.dem_number').text();
  35. $('.dem_number').text(parseInt(t)+1);
  36. $(this).find('span:first-child').addClass('bj_love').removeClass('box_love');
  37. $.ajax({
  38. method: "post",
  39. dataType: "json",
  40. url: globalConfig.context + "/api/user/portal/demandInterest",
  41. data: {
  42. id:theId
  43. },
  44. success: function (data) {
  45. }
  46. });
  47. return false;
  48. }
  49. if($(this).find('span:first-child').hasClass('bj_love')&&islogin=="false"){
  50. t=$('.dem_number').text();
  51. $('.dem_number').text(parseInt(t)-1)
  52. $(this).find('span:first-child').addClass('box_love').removeClass('bj_love')
  53. $.ajax({
  54. method: "post",
  55. dataType: "json",
  56. url: globalConfig.context + "/api/user/portal/demandCancelInterest",
  57. data: {
  58. id:theId
  59. },
  60. success: function (data) {
  61. }
  62. });
  63. }
  64. })
  65. $("#purchase").click(function(){
  66. var isLogin=$("#isLogin").attr("islogin");
  67. var theId = $("#Id_").attr('val');
  68. var thetype=$("#ownerType_").attr('typ');
  69. if(isLogin=="false"){
  70. window.open(globalConfig.context + '/portal/technologyTrading/demandOrder?id=' + theId+'&type='+thetype );
  71. }else{
  72. $(".head_login").click();
  73. }
  74. });
  75. })();