123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 |
- import '../css/bootstrap.less';
- import 'bootstrap/dist/js/bootstrap.js';
- import '../css/public.css';
- import '../css/main_banner.css';
- import './public.js';
- import './main_banner.js';
- import '../css/technologyTrading.css';
- import {
- industryObject,
- getIndustryCategory
- } from './DicIndustryList';
- (function(){
- var theKeyword,Province;
- var thePageNo = 1,
- thePageLength = 1,
- pageSize = 6;
- //技术交易问题的点击出答案
- $(".technolo_right .technolo_text>div>a").click(function(e){
- e.preventDefault();
- var alength=$(this).parent().index();
- $(".answer").css({"display":"block"});
- $(".answer>p").eq(alength).fadeIn();
- });
- //技术交易政策的点击跳转政策详情页面
- $(".technolo_center .technolo_text").on('click', 'div', function () {
- var theId = $(this).attr('val');
- window.open(globalConfig.context + '/portal/news/newsDetail?id=' + theId );
- });
- //技术交易成功案例的点击跳转成果详情页面
- $(".technolo_left .technolo_text").on('click', 'div', function () {
- var theId = $(this).attr('val');
- var thetype=$(this).attr('typ');
- window.open(globalConfig.context + '/portal/technologyTrading/achievementDetail?id=' + theId+'&type='+thetype );
- });
- //技术交易问题的答案删除
- $(".answer").click(function(e){
- if(e.target.className=="answer"){
- $(".answer").css({"display":"none"});
- $(".answer>p").fadeOut();
- }
- });
- //技术交易问题的点击出答案
- $(".answer>p>span").click(function(e){
- $(".answer").css({"display":"none"});
- $(".answer>p").fadeOut();
- });
- //点击搜索开始调用接口并跳转
- $(".searchs>button").click(function(e){
- //localStorage.clear();
- var key=$("#search_on>input").val()?$("#search_on>input").val():"null";
- var typ=$("#selt>option:selected").attr("val");
- if(typ==2){
- window.open(globalConfig.context + '/portal/technologyTrading/demand.html');
- localStorage.setItem("keyWord",key);
- localStorage.setItem("pageType",typ);
- }else{
- window.open(globalConfig.context + '/portal/technologyTrading/achievement.html');
- localStorage.setItem("keyWord",key);
- localStorage.setItem("pageType",typ);
- }
- });
- $("#demandList_patent").on('click', 'li', function () {
- var ol_index= $(".title_details ol>li.act").index();
- var theId = $(this).attr('val');
- var thetype=$(this).attr('typ');
- if(ol_index==2){
- window.open(globalConfig.context + '/portal/technologyTrading/demandDetail?id=' + theId+'&type='+thetype );
- }
- else{
- window.open(globalConfig.context + '/portal/technologyTrading/achievementDetail?id=' + theId+'&type='+thetype );
- }
- });
- //处理data数据函数提取
- function manage(data){
- var demand_html="";
- for(var i=0;i<data.list.length;i++){
- var catalog,price,sketch;
- catalog=data.list[i].industryCatalog?data.list[i].industryCatalog:"所有行业";
- price=data.list[i].price?data.list[i].price:"价格面议";
- sketch=data.list[i].sketch?data.list[i].sketch.substring(0,18):"暂未简介";
- if(!data.list[i].pictureUrl){
- demand_html+="<li val='"+data.list[i].id+"' typ='"+data.list[i].ownerType+"'>" +
- "<div class='imgnull'></div>" +
- "<div class='details_text'>" +
- "<p>行业:<span>"+catalog+"</span></p>" +
- "<p>价格:<span>"+price+"</span></p>" +
- "<p>简介:<span>"+sketch+"..."+"</span></p>" +
- "<a href='#'>了解详情</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>专利名:<span>"+data.list[i].name+"</span></p>" +
- //"<p>所有人:<span>"+(data.list[i].personName?data.list[i].personName:"佚名")+"</span></p>" +
- "</div></li>"
- }else{
- demand_html+="<li val='"+data.list[i].id+"' typ='"+data.list[i].ownerType+"'>" +
- "<img src='"+globalConfig.avatarUploadHost+data.list[i].pictureUrl+"' alt=''/>" +
- "<div class='details_text'>" +
- "<p>行业:<span>"+catalog+"</span></p>" +
- "<p>价格:<span>"+price+"</span></p>" +
- "<p>简介:<span>"+sketch+"..."+"</span></p>" +
- "<a href='#'>了解详情</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>专利名:<span>"+data.list[i].name+"</span></p>" +
- // "<p>所有人:<span>"+(data.list[i].personName?data.list[i].personName:"佚名")+"</span></p>" +
- "</div></li>"
- }
- }
- $("#demandList_patent").html(demand_html);
- }
- //当数据传回来之后,
- function page(data){
- var date=Math.ceil(data/6);
- $('.totalCount').html("共 "+ date +" 页 ");
- var pageArr = [],
- firstNo = 1,
- endNo = 5;
- if (thePageNo > 3) {
- firstNo = thePageNo - 2;
- endNo = Math.min((Number(thePageNo) + 2), date);
- } else {
- endNo = Math.min(date, 5);
- };
- for (let i = firstNo; i <= endNo; i++) {
- if (i == thePageNo) {
- pageArr.push(
- '<li class="pageNumber active"><a href="#" value=' + i + ' >' + i + '</a></li>'
- );
- } else {
- pageArr.push(
- '<li class="pageNumber"><a href="#" value=' + i + ' >' + i + '</a></li>'
- );
- }
- };
- $('.pageNumber').remove();
- $('.pagePre').after(pageArr.join(''));
- }
- var ul_html="";
- for(var i=0;i<industryObject.length;i++){
- ul_html+="<li value='"+industryObject[i].value+"'><a href='javascript:;'>"+industryObject[i].label+"</a></li>";
- }
- $(".industry_ul").html(ul_html);
- $(".industry_ul li:first").addClass("action_li");
- var left_val=$(".industry_ul li.action_li").attr("value");
- $.ajax({
- method: "post",
- dataType: "json",
- url: globalConfig.context + "/portal/search/boutiqueSearchList",
- data: {
- boutiqueType:0,
- industryCatalog:"",
- pageNo:1,
- pageSize:6
- },
- success: function (data) {
- if(data.data.totalCount==0){
- $(".pagination_box").css("display","none");
- $("#demandList_patent").html("<div class='list_none'></div>");
- }else{
- $(".pagination_box").css("display","block");
- manage(data.data);
- page(data.data.totalCount);
- $(".pageNext").attr("all_length",Math.ceil(data.data.totalCount/6));
- }
- }
- })
- })();
- (function(){
- var theKeyword,Province;
- var thePageNo = 1,
- thePageLength = 1,
- pageSize = 6;
- //处理data数据函数提取
- function manage(data){
- var chagename="";
- var caseindex=$(".title_details ol li.act").index();
- switch (caseindex){
- case 0:chagename="专利名";break;
- case 1:chagename="技术名";break;
- case 2:chagename="需求名";break;
- }
- var demand_html="";
- for(var i=0;i<data.list.length;i++){
- var catalog,price,sketch;
- catalog=data.list[i].industryCatalog?data.list[i].industryCatalog:"所有行业";
- price=data.list[i].price?data.list[i].price:"价格面议";
- sketch=data.list[i].sketch?data.list[i].sketch.substring(0,18):"暂无简介";
- if(!data.list[i].pictureUrl){
- demand_html+="<li val='"+data.list[i].id+"' typ='"+data.list[i].ownerType+"'>" +
- "<div class='imgnull'></div>" +
- "<div class='details_text'>" +
- "<p>行业:<span>"+catalog+"</span></p>" +
- "<p>价格:<span>"+price+"</span></p>" +
- "<p>简介:<span>"+sketch+"..."+"</span></p>" +
- "<a href='#'>了解详情</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>"+chagename+":<span>"+data.list[i].name+"</span></p>" +
- // "<p>所有人:<span>"+(data.list[i].personName?data.list[i].personName:"佚名")+"</span></p>" +
- "</div></li>"
- }else{
- demand_html+="<li val='"+data.list[i].id+"' typ='"+data.list[i].ownerType+"'>" +
- "<img src='"+globalConfig.avatarUploadHost+data.list[i].pictureUrl+"' alt=''/>" +
- "<div class='details_text'>" +
- "<p>行业:<span>"+catalog+"</span></p>" +
- "<p>价格:<span>"+price+"</span></p>" +
- "<p>简介:<span>"+sketch+"..."+"</span></p>" +
- "<a href='#'>了解详情</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>专利名:<span>"+data.list[i].name+"</span></p>" +
- // "<p>所有人:<span>"+(data.list[i].personName?data.list[i].personName:"佚名")+"</span></p>" +
- "</div></li>"
- }
- }
- $("#demandList_patent").html(demand_html);
- }
- $(".title_details ol li").click(function(){
- $(".paging_box span:first").addClass("action_span").siblings().removeClass("action_span");
- $(this).addClass("act").siblings().removeClass("act");
- var left_val=$(".industry_ul li.action_li").attr("value");
- var right_val = $(this).attr("value");
- if(left_val=="null"){
- left_val="";
- }
- $.ajax({
- method: "post",
- dataType: "json",
- url: globalConfig.context + "/portal/search/boutiqueSearchList",
- data: {
- boutiqueType:right_val,
- industryCatalog:left_val,
- pageNo:1,
- pageSize:6
- },
- success: function (data) {
- if(data.data.totalCount==0){
- $("#demandList_patent").html("<div class='list_none'></div>");
- }else{
- thePageNo=1;
- manage(data.data);
- page_ol(data.data.totalCount);
- $(".pageNext").attr("all_length",Math.ceil(data.data.totalCount/6));
- }
- }
- })
- });
- $(".industry_ul li").click(function() {
- $(".paging_box span:first").addClass("action_span").siblings().removeClass("action_span");
- $(".title_details ol li").eq(0).addClass("act").siblings().removeClass("act");
- $(this).addClass("action_li").siblings().removeClass("action_li");
- var left_val = $(this).attr("value");
- var right_val = $(".title_details ol li").eq(0).attr("value");
- if(left_val=="null"){
- left_val="";
- }
- console.log(left_val)
- $.ajax({
- method: "post",
- dataType: "json",
- url: globalConfig.context + "/portal/search/boutiqueSearchList",
- data: {
- boutiqueType:right_val,
- industryCatalog:left_val,
- pageNo:1,
- pageSize:6
- },
- success: function (data) {
- if(data.data.totalCount==0){
- $(".pagination_box").css("display","none");
- $("#demandList_patent").html("<div class='list_none'>.</div>");
- }else{
- $(".pagination_box").css("display","block");
- manage(data.data);
- page(data.data.totalCount);
- $(".pageNext").attr("all_length",Math.ceil(data.data.totalCount/6));
- }
- }
- })
- });
- //右侧内容的分页功能,点击一次发送一个ajax的请求,只请求6组数据
- function loadDate(pageNo) {
- var left_val = $(".industry_ul li.action_li").attr("value");
- var right_val = $(".title_details ol li.act").attr("value");
- if(left_val=="null"){
- left_val="";
- }
- $.ajax({
- method: "post",
- dataType: "json",
- url: globalConfig.context + "/portal/search/boutiqueSearchList",
- data: {
- boutiqueType: right_val,
- industryCatalog: left_val,
- pageNo: pageNo,
- pageSize: 6
- },
- success: function (data) {
- if (data.data.totalCount == 0) {
- // $(".pagination_box").css("display", "none");
- $("#demandList_patent").html("<div class='list_none'></div>");
- } else {
- //$(".pagination_box").css("display", "block");
- manage(data.data);
- var data=data.data.totalCount;
- var date=Math.ceil(data/6);
- $(".pageNext").attr("all_length",date);
- $('.totalCount').html("共 "+ date +" 页 ");
- var pageArr = [],
- firstNo = 1,
- endNo = 5;
- if (thePageNo > 3) {
- firstNo = thePageNo - 2;
- endNo = Math.min((Number(thePageNo) + 2), date);
- } else {
- endNo = Math.min(date, 5);
- };
- $('.pageNumber').remove();
- for (let i = firstNo; i <= endNo; i++) {
- if (i == thePageNo) {
- pageArr.push(
- '<li class="pageNumber active"><a href="#" value=' + i + ' >' + i + '</a></li>'
- );
- } else {
- pageArr.push(
- '<li class="pageNumber"><a href="#" value=' + i + ' >' + i + '</a></li>'
- );
- }
- };
- $('.pagePre').after(pageArr.join(''));
- }
- }
- });
- }
- //当数据传回来之后,
- function page(data){
- thePageNo=$(".pagination li.active").children()[0].text;
- var date=Math.ceil(data/6);
- $('.totalCount').html("共 "+ date +" 页 ");
- var pageArr = [],
- firstNo = 1,
- endNo = 5;
- if (thePageNo > 3) {
- firstNo = thePageNo - 2;
- endNo = Math.min((Number(thePageNo) + 2), date);
- } else {
- endNo = Math.min(date, 5);
- }
- $('.pageNumber').remove();
- for (let i = firstNo; i <= endNo; i++) {
- if (i == thePageNo) {
- pageArr.push(
- '<li class="pageNumber active"><a href="#" value=' + i + ' >' + i + '</a></li>'
- );
- } else {
- pageArr.push(
- '<li class="pageNumber"><a href="#" value=' + i + ' >' + i + '</a></li>'
- );
- }
- }
- $('.pagePre').after(pageArr.join(''));
- }
- function page_ol(data){
- var date=Math.ceil(data/6);
- $('.totalCount').html("共 "+ date +" 页 ");
- var pageArr = [],
- firstNo = 1,
- endNo = 5;
- if (thePageNo > 3) {
- firstNo = thePageNo - 2;
- endNo = Math.min((Number(thePageNo) + 2), date);
- } else {
- endNo = Math.min(date, 5);
- }
- $('.pageNumber').remove();
- for (let i = firstNo; i <= endNo; i++) {
- if (i == thePageNo) {
- pageArr.push(
- '<li class="pageNumber active"><a href="#" value=' + i + ' >' + i + '</a></li>'
- );
- } else {
- pageArr.push(
- '<li class="pageNumber"><a href="#" value=' + i + ' >' + i + '</a></li>'
- );
- }
- }
- $('.pagePre').after(pageArr.join(''));
- }
- $('.pagination').on('click', 'li', function (e) {
- e.preventDefault();
- thePageNo=$(".pagination li.active").children()[0].text;
- if (this.className === 'pagePre') {
- if (thePageNo > 1) {
- thePageNo = 1;
- loadDate(thePageNo);
- }
- } else if (this.className === 'pageNext') {
- thePageLength=$(".pageNext").attr("all_length");
- if (thePageNo < thePageLength) {
- thePageNo = thePageLength;
- loadDate(thePageNo);
- }
- } else {
- var nextPageNo = $(this).children()[0].text;
- if (thePageNo != nextPageNo) {
- $(this).siblings("li").removeClass("active");
- $(this).addClass("active");
- thePageNo = nextPageNo;
- loadDate(thePageNo);
- }
- }
- });
- })();
|