|
@@ -45,6 +45,7 @@ import {
|
|
|
|
|
|
//点击下拉框中的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');
|
|
@@ -154,7 +155,43 @@ import {
|
|
|
}
|
|
|
$("#demandList_patent").html(demand_html);
|
|
|
}
|
|
|
-
|
|
|
+ function manage_search(data,ptxt){
|
|
|
+ var demand_html="";
|
|
|
+ for(var i=0;i<data.list.length;i++){
|
|
|
+ var hangye=$(".place_city .thon").html();
|
|
|
+ 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);
|
|
@@ -211,25 +248,49 @@ import {
|
|
|
}
|
|
|
$('.pagination').on('click', 'li', function (e) {
|
|
|
e.preventDefault();
|
|
|
+ var texton=$(".allproduct_top form input").val();
|
|
|
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);
|
|
|
+ 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 (thePageNo < 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 {
|
|
|
- var nextPageNo = $(this).children()[0].text;
|
|
|
- if (thePageNo != nextPageNo) {
|
|
|
- $(this).siblings("li").removeClass("active");
|
|
|
- $(this).addClass("active");
|
|
|
- thePageNo = nextPageNo;
|
|
|
- loadDate(thePageNo);
|
|
|
+ }else{
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -281,9 +342,58 @@ import {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- $('.place_city ul li').click(function() {
|
|
|
+ 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')
|
|
|
+ $(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('更多行业 +');
|
|
@@ -309,7 +419,35 @@ import {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- })
|
|
|
+ });
|
|
|
+ $(".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));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
})();
|
|
|
|
|
|
|