import 'css/bootstrap.less'; import 'bootstrap/dist/js/bootstrap.js'; import 'css/newMenu/public.css'; import 'css/newMenu/header.css' import 'css/main_banner.css'; import 'js/public.js'; import 'js/main_banner.js'; import 'css/technologyTrading/achievementDetail.css'; import 'js/newMenu/publicComment'; (function(){ $(".small_img img").hover(function(e){ var smallsrc=$(this).attr("src"); $(".big_img img").attr("src",smallsrc); }) $(".fine").on('click', 'div.pointer', function () { var theId = $(this).children("p.demandId").html(); var thetype=$(this).children("p.demandTyp").html(); window.open(globalConfig.context + '/portal/technologyTrading/achievementDetail?id=' + theId+'&type='+thetype ); }); $(".main_introduce ul").on("click","li",function(){ var theId = $(this).children("div").children("p.likeId").html(); var thetype=$(this).children("div").children("p.likeType").html(); window.open(globalConfig.context + '/portal/technologyTrading/achievementDetail?id=' + theId+'&type='+thetype ); }); $(".detail_btn_").click(function(){ var isLogin=$("#isLogin").attr("islogin"); if(isLogin=="false"){ var theId = $("#Id_").attr('val'); var thetype=$("#ownerType_").attr('typ'); window.open(globalConfig.context + '/portal/technologyTrading/achievementOrder?id=' + theId+'&type='+thetype ); }else{ $(".head_login").click(); } }); //收藏 $('.collection p').eq(0).click(function () { window.location.hash='jump'; let heart = $('.heart'); if (heart.hasClass('active')) { collectionApi(0) //取消收藏 } else { collectionApi(1) //收藏 } }) let hash = window.location.search, hashArr =hash.split('&'), idArr = hashArr[0].split('='), ids =idArr[1]; function collectionApi(index) { let url = index?'/api/user/portal/achievementInterest':'/api/user/portal/achievementCancelInterest' $.ajax({ method: "post", dataType: "json", url: globalConfig.context + url, data: { id:ids }, success: function (data) { if (data.error && data.error.length) { $('#msg').val(data.error[0].message); msg(); }else{ if(!index){ $('.heart').removeClass('active'); }else{ $('.heart').addClass('active'); } $('#msg').val(index?'收藏成功,请至个人中心查看.':'撤销收藏'); msg(); } } }) } //点击感兴趣 var t=0; $('.basic .loves').click(function(){ var theId=$("#demand_id").attr("val"); var islogin=$("#isLogin").attr("islogin"); if(islogin=="true"){ $(".head_login").click(); } if($(this).find('span:first-child').hasClass('box_love')&&islogin=="false"){ t=$('.dem_number').text(); $('.dem_number').text(parseInt(t)+1); $(this).find('span:first-child').addClass('bj_love').removeClass('box_love'); $.ajax({ method: "post", dataType: "json", url: globalConfig.context + "/api/user/portal/achievementInterest", data: { id:theId }, success: function (data) { } }); return false; } if($(this).find('span:first-child').hasClass('bj_love')&&islogin=="false"){ t=$('.dem_number').text(); $('.dem_number').text(parseInt(t)-1) $(this).find('span:first-child').addClass('box_love').removeClass('bj_love') $.ajax({ method: "post", dataType: "json", url: globalConfig.context + "/api/user/portal/demandCancelInterest", data: { id:theId }, success: function (data) { } }); } }) $("#purchase").click(function(){ var isLogin=$("#isLogin").attr("islogin"); var theId = $("#Id_").attr('val'); var thetype=$("#ownerType_").attr('typ'); if(isLogin=="false"){ window.open(globalConfig.context + '/portal/technologyTrading/achievementOrder?id=' + theId+'&type='+thetype ); }else{ $(".head_login").click(); } }); //提示框渐隐函数 function msg() { if($('.smg').hasClass('active')){ return ; } $('.smg').addClass('active') setTimeout(function () { $('.smg').removeClass('active') $('#msg').val(''); }, 2000) } })();