achievementOrder.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/achievementOrder.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/orderAchievement",
  15. data: {
  16. achievementId:theId
  17. },
  18. success: function (data) {
  19. if (data.error && data.error.length) {
  20. msg(data.error[0].message);
  21. }else if(data.error==""){
  22. window.open(globalConfig.context+ '/user/account/index.html#techList');
  23. }else{
  24. return;
  25. }
  26. }
  27. });
  28. })
  29. //��ʾ��������
  30. //提示框渐隐函数
  31. function msg(txt) {
  32. if($('.smg').hasClass('active')){
  33. return ;
  34. }
  35. $('.smg').addClass('active');
  36. var lit = $('#msg').val(txt);
  37. setTimeout(function () {
  38. $('.smg').removeClass('active')
  39. $('#msg').val('');
  40. }, 2000)
  41. }
  42. $(".main_introduce ul").on("click","li",function(){
  43. var theId = $(this).children("div").children("p.likeId").html();
  44. var thetype=$(this).children("div").children("p.likeType").html();
  45. window.open(globalConfig.context + '/portal/technologyTrading/achievementDetail?id=' + theId+'&type='+thetype );
  46. });
  47. })();