demandOrder.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/demandOrder.css';
  8. (function(){
  9. $(".order_button div").click(function(){
  10. var theId = $("#id_").attr('val');
  11. $.ajax({
  12. method: "post",
  13. dataType: "json",
  14. url: globalConfig.context + "/api/user/portal/order/orderDemand",
  15. data: {
  16. demandId:theId
  17. },
  18. success: function (data) {
  19. if (data.error && data.error.length) {
  20. $('#msg').val(data.error[0].message);
  21. msg();
  22. }else if(data.error==""){
  23. window.open(globalConfig.context+ '/user/account/index.html#techList');
  24. }else{
  25. return;
  26. }
  27. }
  28. });
  29. })
  30. //��ʾ��������
  31. function msg(){
  32. var lit=$('#msg').val();
  33. if(lit!==''){
  34. $('.smg').fadeIn(500)
  35. }
  36. setTimeout(function(){
  37. $('.smg').fadeOut(500)
  38. $('#msg').val('')
  39. },2000)
  40. }
  41. $(".main_introduce ul").on("click","li",function(){
  42. var theId = $(this).children("div").children("p.demandId").html();
  43. var thetype=$(this).children("div").children("p.demandTyp").html();
  44. window.open(globalConfig.context + '/portal/technologyTrading/demandDetail?id=' + theId+'&type='+thetype );
  45. })
  46. })();