123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- 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/financialIndex.css';
- import {
- industryObject,
- getIndustryCategory
- } from './DicIndustryList';
- (function(){
- $("#demandList_patent").on('click', 'li', function () {
- var theId = $(this).attr('val');
- var thetype=$(this).attr('typ');
- window.open(globalConfig.context + '/portal/technologyTrading/achievementDetail?id=' + theId+'&type='+thetype );
- });
- var theKeyword,Province;
- var thePageNo = 1,
- thePageLength = 1,
- pageSize = 6;
- //用JS导入行业下拉列表的数据
- var list_html="";
- for(var i=0;i<industryObject.length;i++){
- list_html+="<p value='"+industryObject[i].value+"'>"+industryObject[i].label+"</li>";
- }
-
-
- $(".list_city").html(list_html);
- //行业下拉选择
- $('.list_city').hide();
- $('.more_city .inp').click(function(){
- $('.list_city').slideToggle(500)
- });
- //鼠标移出则下拉框消失
- $('.more_city').mouseleave(function(){
- $('.list_city').hide();
- });
- //点击下拉框中的p
- $('.list_city p').click(function() {
- $(".allproduct_top form input").val("");
- $(".pagination_box").css("display","block");
- var ptxt = $(this).text();
- var pval = $(this).attr('value');
- $('.more_city .inp').text(ptxt);
- $('.more_city .inp').attr('value', pval);
- $('.list_city').hide();
- $('.more_city .inp').addClass('thon');
- $('.place_city ul li').removeClass('thon');
- $('.policy ol li').eq(0).addClass('active_of').siblings().removeClass('active_of');
- var p_val = $(this).attr('value');
- if(p_val=="null"){
- p_val=''
- }
- $.ajax({
- method: "get",
- dataType: "json",
- url: globalConfig.context + "/portal/search/achievementList",
- data: {
- fieldA:p_val,
- dataCategory:2,
- pageNo:1,
- pageSize:8
- },
- success: function (data) {
-
- if(data.data.totalCount==0){
- $(".pagination_box").css("display","none");
- $("#demandList_patent").html("<div class='list_none'></div>");
- }else{
- manage(data.data,ptxt);
- page_ol(data.data.totalCount);
- $(".pageNext").attr("all_length",Math.ceil(data.data.totalCount/8));
- }
- }
- })
- });
- //项目和资金的tab切换
- $(".fund").click(function(){
- $(this).addClass("active");
- $(".project").removeClass("active");
- $("#finance_tab_one").css("display","block");
- $("#finance_tab_two").css("display","none");
- });
- //项目和资金的tab切换
- $(".project").click(function(){
- $(".pagination_box").css("display","block");
- $(this).addClass("active");
- $(".fund").removeClass("active");
- $("#finance_tab_two").css("display","block");
- $("#finance_tab_one").css("display","none");
- $.ajax({
- method: "get",
- dataType: "json",
- url: globalConfig.context + "/portal/search/achievementList",
- data: {
- fieldA:464,
- dataCategory:2,
- pageNo:1,
- pageSize:8
- },
- success: function (data) {
- if(data.data.totalCount==0){
- $(".pagination_box").css("display","none");
- $("#demandList_patent").html("<div class='list_none'></div>");
- }else{
- manage(data.data,"教育休闲");
- page(data.data.totalCount);
- $(".pageNext").attr("all_length",Math.ceil(data.data.totalCount/8));
- }
- }
- })
- });
- function manage(data,ptxt){
- var demand_html="";
- for(var i=0;i<data.list.length;i++){
- var hangye=data.list[i].fieldAs;
- var price=data.list[i].transferPrice?data.list[i].transferPrice:"面议";
- var people=data.list[i].ownerName?data.list[i].ownerName:"保密";
- var 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>"+price+"</span></p>" +
- "<p>所属行业:<span>"+hangye+"</span></p>" +
- "<p>所有人:<span>"+people+"</span></p>" +
- "<p>项目简介:<b>"+sketch+"..."+"</b></p>" +
- "<a href='#'>会谈</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>项目名:<span>"+data.list[i].name+"</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].technicalPictureUrl+"' alt=''/>" +
- "<div class='details_text'>" +
- "<p>融资金额:<span>"+price+"</span></p>" +
- "<p>所属行业:<span>"+hangye+"</span></p>" +
- "<p>所有人:<span>"+people+"</span></p>" +
- "<p>项目简介:<b>"+sketch+"..."+"</b></p>" +
- "<a href='#'>会谈</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>项目名:<span>"+data.list[i].name+"</span></p>" +
- "</div></li>"
- }
- }
- $("#demandList_patent").html(demand_html);
- }
- function manage_search(data,ptxt){
- var demand_html="";
- for(var i=0;i<data.list.length;i++){
- var hangye=data.list[i].fieldAs;
- var price=data.list[i].transferPrice?data.list[i].transferPrice:"面议";
- var people=data.list[i].ownerName?data.list[i].ownerName:"保密";
- var 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>"+price+"</span></p>" +
- "<p>所属行业:<span>"+ptxt+"</span></p>" +
- "<p>所有人:<span>"+people+"</span></p>" +
- "<p>项目简介:<b>"+sketch+"..."+"</b></p>" +
- "<a href='#'>会谈</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>项目名:<span>"+data.list[i].name+"</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].technicalPictureUrl+"' alt=''/>" +
- "<div class='details_text'>" +
- "<p>融资金额:<span>"+price+"</span></p>" +
- "<p>所属行业:<span>"+hangye+"</span></p>" +
- "<p>所有人:<span>"+people+"</span></p>" +
- "<p>项目简介:<b>"+sketch+"..."+"</b></p>" +
- "<a href='#'>会谈</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>项目名:<span>"+data.list[i].name+"</span></p>" +
- "</div></li>"
- }
- }
- $("#demandList_patent").html(demand_html);
- }
- function page(data){
- thePageNo=$(".pagination li.active").children()[0].text;
- var date=Math.ceil(data/8);
- $('.totalCount').html("共 "+ date +" 页 " + data + " 条数据");
- 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(''));
- }
- function page_ol(data){
- thePageNo=1;
- var date=Math.ceil(data/8);
- $('.totalCount').html("共 "+ date +" 页 " + data + " 条数据");
- 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();
- var texton=$(".allproduct_top form input").val();
- thePageNo=$(".pagination li.active").children()[0].text;
- if(texton){
- if (this.className === 'pagePre') {
- if (thePageNo > 1) {
- thePageNo = 1;
- loadDate_search(thePageNo);
- }
- } else if (this.className === 'pageNext') {
- thePageLength=$(".pageNext").attr("all_length");
- if (parseInt(thePageNo) <parseInt(thePageLength)) {
- thePageNo = thePageLength;
- loadDate_search(thePageNo);
- }
- } else {
- var nextPageNo = $(this).children()[0].text;
- if (thePageNo != nextPageNo) {
- $(this).siblings("li").removeClass("active");
- $(this).addClass("active");
- thePageNo = nextPageNo;
- loadDate_search(thePageNo);
- }
- }
- }else{
- if (this.className === 'pagePre') {
- if (thePageNo > 1) {
- thePageNo = 1;
- loadDate(thePageNo);
- }
- } else if (this.className === 'pageNext') {
- thePageLength=$(".pageNext").attr("all_length");
- if (parseInt(thePageNo) <parseInt(thePageLength)) {
- thePageNo = thePageLength;
- loadDate(thePageNo);
- }else{
-
- }
- } else {
- var nextPageNo = $(this).children()[0].text;
- if (thePageNo != nextPageNo) {
- $(this).siblings("li").removeClass("active");
- $(this).addClass("active");
- thePageNo = nextPageNo;
- loadDate(thePageNo);
- }
- }
- }
- });
- //右侧内容的分页功能,点击一次发送一个ajax的请求,只请求6组数据
- function loadDate(pageNo) {
- var left_val=$(".place_city .thon").attr("value");
- if(left_val=='null'){
- left_val=''
- };
- $.ajax({
- method: "get",
- dataType: "json",
- url: globalConfig.context + "/portal/search/achievementList",
- data: {
- fieldA:left_val,
- dataCategory:2,
- pageNo:pageNo,
- pageSize:8
- },
- success: function (data) {
- if (data.data.totalCount == 0) {
- $("#demandList_patent").html("<div class='list_none'></div>");
- } else {
- manage(data.data);
- var data=data.data.totalCount;
- var date=Math.ceil(data/8);
- $(".pageNext").attr("all_length",date);
- $('.totalCount').html("共 "+ date +" 页 " + data + " 条数据");
- 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 loadDate_search(pageNo) {
- var left_val=$(".place_city .thon").attr("value");
- var ptxt= $(".allproduct_top form input").val();
- $.ajax({
- method: "get",
- dataType: "json",
- url: globalConfig.context + "/portal/search/achievementList",
- data: {
- keyword:ptxt,
- dataCategory:2,
- pageNo:pageNo,
- pageSize:8
- },
- success: function (data) {
- if (data.data.totalCount == 0) {
- $("#demandList_patent").html("<div class='list_none'></div>");
- } else {
- manage_search(data.data,ptxt);
- var data=data.data.totalCount;
- var date=Math.ceil(data/8);
- $(".pageNext").attr("all_length",date);
- $('.totalCount').html("共 "+ date +" 页 " + data + " 条数据");
- 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(''));
- }
- }
- })
- }
- $('.place_city ul li').click(function() {
- $(".allproduct_top form input").val("");
- $(".pagination_box").css("display","block");
- $(this).addClass('thon').siblings().removeClass('thon');
- $('.policy ol li').eq(0).addClass('active_of').siblings().removeClass('active_of');
- $('.more_city .inp').removeClass('thon');
- $('.more_city .inp').text('更多行业 +');
- var left_val=$(".place_city .thon").attr("value");
- $.ajax({
- method: "get",
- dataType: "json",
- url: globalConfig.context + "/portal/search/achievementList",
- data: {
- fieldA:left_val,
- dataCategory:2,
- pageNo:1,
- pageSize:8
- },
- success: function (data) {
- if(data.data.totalCount==0){
- $(".pagination_box").css("display","none");
- $("#demandList_patent").html("<div class='list_none'></div>");
- }else{
- manage(data.data,"教育休闲");
- page_ol(data.data.totalCount);
- $(".pageNext").attr("all_length",Math.ceil(data.data.totalCount/8));
- }
- }
- })
- });
- $(".allproduct_top form img").click(function(){
- search();
- });
- function search(){
- var ptxt= $(".allproduct_top form input").val();
- $.ajax({
- method: "get",
- dataType: "json",
- url: globalConfig.context + "/portal/search/achievementList",
- data: {
- keyword:ptxt,
- dataCategory:2,
- pageNo:1,
- pageSize:8
- },
- 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_search(data.data,ptxt);
- page_ol(data.data.totalCount);
- $(".pageNext").attr("all_length",Math.ceil(data.data.totalCount/8));
- }
- }
- })
- }
- })();
|