123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- 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(){
- //处理data数据函数提取
- function manage(data){
- var demand_html="";
- for(var i=0;i<data.list.length;i++){
- demand_html+="<li>" +
- "<img src='"+globalConfig.avatarUploadHost+data.list[i].pictureUrl+" alt=''/>" +
- "<div class='details_text'>" +
- "<p>行业<span>"+data.list[i].industryCatalog+"</span></p>" +
- "<p>价格<span>"+data.list[i].price+"</span></p>" +
- "<p>简介<b>"+data.list[i].sketch.substring(0,18)+"..."+"</b></p>" +
- "<a href='#'>了解详情</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>专利名<span>"+data.list[i].name+"</span></p>" +
- "<p>所有人<span>"+data.list[i].personName+"</span></p>" +
- "</div></li>"
- }
- $("#demandList_patent").html(demand_html);
- }
- //当数据传回来之后,
- function page(data){
- var data=Math.ceil(data/6);
- var paging_html="";
- for(var j=1;j<=data;j++){
- paging_html+="<span value="+j+">"+j+"</span>"
- }
- $(".paging_box").html(paging_html).width(data*34);
- $(".paging_box span:first").addClass("action_span").siblings().removeClass("action_span");
- $(".page_right").addClass("span_true").after("<span class='all_span one_all_span'>共"+data+"页</span>");
- }
- 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").val();
- $.ajax({
- method: "post",
- dataType: "json",
- url: globalConfig.context + "/portal/search/boutiqueSearchList",
- data: {
- boutiqueType:0,
- 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);
- }
- }
- })
- })();
- (function(){
- //处理data数据函数提取
- function manage(data){
- var demand_html="";
- for(var i=0;i<data.list.length;i++){
- demand_html+="<li>" +
- "<img src='"+globalConfig.avatarUploadHost+data.list[i].pictureUrl+" alt=''/>" +
- "<div class='details_text'>" +
- "<p>行业:<span>"+data.list[i].industryCatalog+"</span></p>" +
- "<p>价格:<span>"+data.list[i].price+"</span></p>" +
- "<p>简介:<b>"+data.list[i].sketch.substring(0,18)+"..."+"</b></p>" +
- "<a href='#'>了解详情</a>" +
- "</div>" +
- "<div class='details_fix'>" +
- "<p>专利名:<span>"+data.list[i].name+"</span></p>" +
- "<p>所有人:<span>"+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").val();
- var right_val = $(this).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);
- }
- }
- })
- });
- $(".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).val();
- var right_val = $(".title_details ol li").eq(0).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);
- }
- }
- })
- });
- //右侧内容的分页功能,点击一次发送一个ajax的请求,只请求6组数据
- $(".paging_box").on("click","span",function(e){
- var page_length=$(this).attr("value");
- var left_val=$(".industry_ul li.action_li").val();
- var right_val=$(".title_details ol li.act").val();
- var right_check=$(".title_details ol li.act").index();
- $.ajax({
- method: "post",
- dataType: "json",
- url: globalConfig.context + "/portal/search/boutiqueSearchList",
- data: {
- boutiqueType:right_val,
- industryCatalog:left_val,
- pageNo:page_length,
- 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);
- $(".paging_box span").eq(page_length-1).addClass("action_span").siblings().removeClass("action_span");
- }
- }
- });
- });
- //实现分页右侧点击按钮
- var isfirst=0;//判断12...是不是应该添加
- var page_click=0;//记录左右两侧的按钮点击的次数
- $(".page_right").click(function(){
- page_click++;
- var box_scrollleft=$(".pagination_box>div").scrollLeft();
- box_scrollleft+=102;
- $(".pagination_box>div").scrollLeft(box_scrollleft);
- $(".page_left").addClass("span_true");
- if(isfirst==0){
- $(".page_left").before("<span class='all_span two_all_span'>. . .</span><span class='second'>2</span><span class='first'>1</span>");
- isfirst=1;
- }
- if($(".pagination_box>div").scrollLeft()==($(".paging_box").width()-$(".pagination_box>div").width())){
- $(".page_right").removeClass("span_true");
- };
- });
- //实现分页左侧点击按钮
- $(".page_left").click(function(){
- page_click--;
- var box_scrollleft=$(".pagination_box>div").scrollLeft();
- box_scrollleft-=102;
- $(".pagination_box>div").scrollLeft(box_scrollleft);
- $(".page_right").addClass("span_true");
- if($(".pagination_box>div").scrollLeft()==0){
- $(".page_left").removeClass("span_true");
- $(".first").remove();
- $(".second").remove();
- $(".two_all_span").remove();
- isfirst=0;
- }
- });
- //新出来的1和2的点击效果
- $(".pagination_box").on("click",".first",function() {
- $(".paging_box").children().eq(0).click();
- $(".pagination_box>div").scrollLeft(0);
- $(".first").remove();
- $(".second").remove();
- $(".two_all_span").remove();
- $(".page_left").removeClass("span_true");
- isfirst = 0;
- });
- //新出来的1和2的点击效果
- $(".pagination_box").on("click",".second",function(){
- $(".paging_box").children().eq(1).click();
- $(".pagination_box>div").scrollLeft(0);
- $(".first").remove();
- $(".second").remove();
- $(".two_all_span").remove();
- $(".page_left").removeClass("span_true");
- isfirst=0;
- });
- //当数据传回来之后,
- function page(data){
- $(".one_all_span").remove();
- var data=Math.ceil(data/6);
- var paging_html="";
- for(var j=1;j<=data;j++){
- paging_html+="<span value="+j+">"+j+"</span>"
- }
- $(".paging_box").html(paging_html).width(data*34);
- $(".page_right").addClass("span_true").after("<span class='all_span one_all_span'>共"+data+"页</span>");
- }
- })();
|