|
@@ -5,3 +5,339 @@ import '../../css/main_banner.css';
|
|
|
import '../../js/public.js';
|
|
|
import '../../js/main_banner.js';
|
|
|
import '../../css/technologyTrading/demand.css';
|
|
|
+import '../../css/technologyTrading/achievement.css';
|
|
|
+import {
|
|
|
+ provinceList
|
|
|
+ } from '../../js/NewDicProvinceList';
|
|
|
+import {
|
|
|
+ industryObject,
|
|
|
+ getIndustryCategory
|
|
|
+} from '../DicIndustryList';
|
|
|
+
|
|
|
+$(function(){
|
|
|
+// //排序下拉选择
|
|
|
+// $('.head-left ul li p').click(function(){
|
|
|
+// $(this).siblings().slideToggle(300);
|
|
|
+// })
|
|
|
+// $('.head-left ul li').mouseleave(function(){
|
|
|
+// $(this).find('.time_select').slideUp(300);
|
|
|
+// })
|
|
|
+// $('.time_select ul li').click(function(){
|
|
|
+// var txt=$(this).text();
|
|
|
+// $(this).parents('.time_select').siblings('p').find('span').text(txt);
|
|
|
+// $('.time_select').hide();
|
|
|
+// });
|
|
|
+// //搜索城市下拉
|
|
|
+// var addlength=provinceList.length;
|
|
|
+// var soption='';
|
|
|
+// for(var i=0;i<addlength;i++){
|
|
|
+// soption+="<option value='"+provinceList[i].id+"'>"+provinceList[i].name+"</option>";
|
|
|
+// };
|
|
|
+// $('#selt').html(soption);
|
|
|
+// //全部结果查询
|
|
|
+// $('.achievement_header ul li img').click(function(){
|
|
|
+// $(this).parent().hide()
|
|
|
+// });
|
|
|
+// $('.text_replace').hide();
|
|
|
+// // 搜索功能关联关键字
|
|
|
+// $('.searchs button').click(function(e){
|
|
|
+// e.preventDefault();
|
|
|
+// var search_txt=$('#search_on input').val();
|
|
|
+// $('.text_replace span').text(search_txt);
|
|
|
+// if(search_txt==''){
|
|
|
+// $('.text_replace').hide();
|
|
|
+// }else{
|
|
|
+// $('.text_replace').show();
|
|
|
+// }
|
|
|
+// })
|
|
|
+// //点击行业分类
|
|
|
+// $('#technologyModeList li').click(function(){
|
|
|
+// $('.achievement_header ul li').eq(1).show();
|
|
|
+// $(this).addClass('active').siblings().removeClass('active');
|
|
|
+// var txt_tech=$(this).find('span').text();
|
|
|
+// $('.achievement_header ul li').eq(1).find('p').text(txt_tech);
|
|
|
+// })
|
|
|
+ //数据处理
|
|
|
+ var theKeyword, theMode, theFieldA, theFieldB,dataCategory,category,timeSort,priceSort;
|
|
|
+ var thePageNo = 1,
|
|
|
+ thePageLength = 1,
|
|
|
+ pageSize = 12;
|
|
|
+ var categoryObj = {
|
|
|
+ "0": "技术购买型需求",
|
|
|
+ "1": "技术设备类需求",
|
|
|
+ "2": "技术方案型需求",
|
|
|
+ "3": "技术攻关型需求",
|
|
|
+ "4": "技术咨询型需求",
|
|
|
+ "5": "技术人才型需求",
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ function loadDate(pageNo) {
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ //url: globalConfig.context + "/portal/search/demandList",
|
|
|
+ data: {
|
|
|
+ pageNo: pageNo || 1,
|
|
|
+ pageSize: pageSize,
|
|
|
+ keyword: theKeyword,
|
|
|
+ sign: 0,
|
|
|
+ demandType: theMode != 999 ? theMode : undefined,
|
|
|
+ industryCategoryA: theFieldA != 999 ? theFieldA : undefined,
|
|
|
+ industryCategoryB: theFieldB != 999 ? theFieldB : undefined,
|
|
|
+ timeSort:timeSort,
|
|
|
+ priceSort:priceSort,
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ var theArr = [];
|
|
|
+ if (data.data && data.data.list) {
|
|
|
+ for (let i = 0; i < data.data.list.length; i++) {
|
|
|
+ let thisdata = data.data.list[i];
|
|
|
+ var star='';
|
|
|
+ for(var n=0;n<thisdata.maturity;n++){
|
|
|
+ star+='<li></li>'
|
|
|
+ }
|
|
|
+ theArr.push([
|
|
|
+ '<li>', //图片地址
|
|
|
+ '<img src="' + globalConfig.avatarHost + '/upload' + thisdata.personPortraitUrl + '" alt="行业" />',
|
|
|
+ '<div class="list_text">',
|
|
|
+ '<p>行业<span>' + getIndustryCategory(thisdata.industryCategoryA, thisdata.industryCategoryB) + '</span></p>',
|
|
|
+ '<p>名称<span title=' + thisdata.name + '>' + thisdata.name + '</span></p>',
|
|
|
+ '<p>类型<span>' + thisdata.demandType ? categoryObj[thisdata.demandType] : '' + '</span></p>',
|
|
|
+ '<p class="money">预算<span>'+ (thisdata.budgetCost ? (thisdata.budgetCost + '万元') : '价格面议') + '</span></p>',
|
|
|
+ '<a href="#">了解详情</a>',
|
|
|
+ '</div>',
|
|
|
+ '<div class="star">',
|
|
|
+ '<p>成熟度</p>',
|
|
|
+ '<ol>'+star+'</ol>',
|
|
|
+ '</div>',
|
|
|
+ '<input type="hidden" class="demandId" value="' + thisdata.id + '">',
|
|
|
+ '<input type="hidden" class="demandType" value="' + thisdata.dataCategory + '">',
|
|
|
+ '</li>',
|
|
|
+ ].join(''));
|
|
|
+ };
|
|
|
+ };
|
|
|
+ $('#demandList').empty();
|
|
|
+ $('#demandList').append(theArr.join(''));
|
|
|
+
|
|
|
+ $('.totalCount').html("共" + data.data.totalCount + "条数据");
|
|
|
+ thePageLength = data.data.totalCount ? Math.ceil(data.data.totalCount / pageSize) : 1;
|
|
|
+ var pageArr = [],
|
|
|
+ firstNo = 1,
|
|
|
+ endNo = 5;
|
|
|
+ if (thePageNo > 3) {
|
|
|
+ firstNo = thePageNo - 2;
|
|
|
+ endNo = Math.min((Number(thePageNo) + 2), thePageLength);
|
|
|
+ } else {
|
|
|
+ endNo = Math.min(thePageLength, 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(''));
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (window.location.search) {
|
|
|
+ let theUrl = window.location.search
|
|
|
+ theKeyword = theUrl.substring(1, theUrl.length);
|
|
|
+ theKeyword = decodeURIComponent(theKeyword);
|
|
|
+ $('#search_on input').val(theKeyword);
|
|
|
+ };
|
|
|
+ loadDate();
|
|
|
+ var industryListArr = [],
|
|
|
+ industryChildrenArr = [];
|
|
|
+ industryListArr.push(['<li value="999" class="active">',
|
|
|
+ '<span>',
|
|
|
+ '不限',
|
|
|
+ '</span>',
|
|
|
+ '</li>',
|
|
|
+ ].join(''));
|
|
|
+ industryObject.map(function (item) {
|
|
|
+ industryListArr.push(['<li value="' + item.value + '">',
|
|
|
+ '<span>',
|
|
|
+ item.label,
|
|
|
+ '</span>',
|
|
|
+ '</li>',
|
|
|
+ ].join(''));
|
|
|
+ });
|
|
|
+ if (industryListArr && industryListArr.length) {
|
|
|
+ $('#industryList').append(industryListArr.join(''));
|
|
|
+ };
|
|
|
+ $('#industryList li').click(function () {
|
|
|
+ var theValue = this.value;
|
|
|
+ $(this).siblings("li").removeClass("active");
|
|
|
+ $(this).addClass("active");
|
|
|
+ industryChildrenArr = [];
|
|
|
+ industryChildrenArr.push(['<li value="999" class="active">',
|
|
|
+ '<span>',
|
|
|
+ '不限',
|
|
|
+ '</span>',
|
|
|
+ '</li>',
|
|
|
+ ].join(''));
|
|
|
+ if (theValue !== 999) {
|
|
|
+ $('#industryChildrenBox').css("display", "block");
|
|
|
+ industryObject.map(function (item) {
|
|
|
+ if (item.value == theValue) {
|
|
|
+ item.children.map(function (child) {
|
|
|
+ industryChildrenArr.push(['<li value="' + child.value + '">',
|
|
|
+ '<span>',
|
|
|
+ child.label,
|
|
|
+ '</span>',
|
|
|
+ '</li>',
|
|
|
+ ].join(''));
|
|
|
+ });
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $('#industryChildrenBox').css("display", "none");
|
|
|
+ };
|
|
|
+ if (industryChildrenArr && industryChildrenArr.length) {
|
|
|
+ $('#industryChildrenList').empty();
|
|
|
+ $('#industryChildrenList').append(industryChildrenArr.join(''));
|
|
|
+ };
|
|
|
+ theFieldA = this.value;
|
|
|
+ theFieldB = '999';
|
|
|
+ loadDate();
|
|
|
+ });
|
|
|
+ $('#industryChildrenList').on('click', 'li', function () {
|
|
|
+ $(this).siblings("li").removeClass("active");
|
|
|
+ $(this).addClass("active");
|
|
|
+ theFieldB = this.value;
|
|
|
+ loadDate();
|
|
|
+ });
|
|
|
+ $('#technologyModeList').on('click', 'li', function () {
|
|
|
+ $(this).siblings("li").removeClass("active");
|
|
|
+ $(this).addClass("active");
|
|
|
+ theMode = this.value;
|
|
|
+ loadDate();
|
|
|
+ });
|
|
|
+ $('#btt_search').click(function () {
|
|
|
+ theKeyword = $('#search_on input').val();
|
|
|
+ loadDate();
|
|
|
+ });
|
|
|
+ $('.pagination').on('click', 'li', function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+ if (this.className === 'pagePre') {
|
|
|
+ if (thePageNo > 1) {
|
|
|
+ thePageNo = 1;
|
|
|
+ loadDate(thePageNo);
|
|
|
+ }
|
|
|
+ } else if (this.className === 'pageNext') {
|
|
|
+ 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);
|
|
|
+ };
|
|
|
+ };
|
|
|
+ });
|
|
|
+ $('main_introduce').on('click', 'li', function () {
|
|
|
+ var theId = $(this).children(".demandId")[0].value;
|
|
|
+ var theType = $(this).children(".demandType")[0].value;
|
|
|
+ window.open(globalConfig.context + '/portal/detail/demandDetail.html?id=' + theId + '&type=' + theType);
|
|
|
+ })
|
|
|
+ $('#industryList li').click(function(){
|
|
|
+ var text_ind=$(this).find('span').text();
|
|
|
+ $('.achievement_header ul li').eq(0).show()
|
|
|
+ $('.achievement_header ul li').eq(0).find('p').text(text_ind);
|
|
|
+ })
|
|
|
+
|
|
|
+ //搜索城市下拉
|
|
|
+ var addlength=provinceList.length;
|
|
|
+ var soption='';
|
|
|
+ for(var i=0;i<addlength;i++){
|
|
|
+ soption+="<option value='"+provinceList[i].id+"'>"+provinceList[i].name+"</option>";
|
|
|
+ };
|
|
|
+ $('#selt').html(soption);
|
|
|
+ //全部结果查询
|
|
|
+ $('.achievement_header ul li img').click(function(){
|
|
|
+ $(this).parent().hide();
|
|
|
+ var lilen=$('.achievement_header ul li').css('display');
|
|
|
+ if(lilen=='none'){
|
|
|
+ $('#search_on input').val('');
|
|
|
+ $('.searchs button').click();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.text_replace').hide()
|
|
|
+ // 搜索功能关联关键字
|
|
|
+ $('.searchs button').click(function(e){
|
|
|
+ e.preventDefault();
|
|
|
+ var search_txt=$('#search_on input').val();
|
|
|
+ $('.text_replace span').text(search_txt);
|
|
|
+ if(search_txt==''){
|
|
|
+ $('.text_replace').hide()
|
|
|
+ }else{
|
|
|
+ $('.text_replace').show()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //点击技术类型
|
|
|
+ $('#technologyModeList li').click(function(){
|
|
|
+ $('.achievement_header ul li').eq(1).show()
|
|
|
+ $(this).addClass('active').siblings().removeClass('active')
|
|
|
+ var txt_tech=$(this).find('span').text();
|
|
|
+ $('.achievement_header ul li').eq(1).find('p').text(txt_tech);
|
|
|
+ })
|
|
|
+ //点击搜索下面的字段快捷搜索
|
|
|
+ $('.head_right ol li').click(function () {
|
|
|
+ theKeyword = $(this).text();
|
|
|
+ $('#technologyModeList li').eq(0).addClass('active').siblings().removeClass('active');
|
|
|
+ $('#transferModeList li').eq(0).addClass('active').siblings().removeClass('active');
|
|
|
+ $('.achievement_header ul li').eq(0).show().siblings().hide();
|
|
|
+ $('.achievement_header ul li').eq(0).find('p').text(theKeyword);
|
|
|
+ $('#search_on input').val(theKeyword);
|
|
|
+ loadDate();
|
|
|
+ });
|
|
|
+ //点击行业分类
|
|
|
+ $('#industryList li').click(function(){
|
|
|
+ $('.achievement_header ul li').eq(0).show();
|
|
|
+ var text_ind=$(this).find('span').text();
|
|
|
+ $('.achievement_header ul li').eq(0).find('p').text(text_ind);
|
|
|
+ })
|
|
|
+ //排序下拉选择
|
|
|
+ $('.head-left ul li p').click(function(){
|
|
|
+ $(this).siblings().slideToggle(300);
|
|
|
+ })
|
|
|
+ $('.head-left ul li').mouseleave(function(){
|
|
|
+ $(this).find('.time_select').slideUp(300);
|
|
|
+ })
|
|
|
+ $('.time_select ul li').click(function(){
|
|
|
+ var txt=$(this).text();
|
|
|
+ $(this).parents('.time_select').siblings('p').find('span').text(txt);
|
|
|
+ $('.time_select').hide();
|
|
|
+ });
|
|
|
+ $('.timeSelect li').click(function(){
|
|
|
+ var timeTxt=$(this).attr('value');
|
|
|
+ alert(timeTxt)
|
|
|
+ $('head-left ul li:first-child').removeClass('active')
|
|
|
+ timeSort=timeTxt;
|
|
|
+ loadDate();
|
|
|
+ })
|
|
|
+ $('.priceSeclct li').click(function(){
|
|
|
+ var timeTxt=$(this).attr('value');
|
|
|
+ alert(timeTxt)
|
|
|
+ $('head-left ul li:first-child').removeClass('active')
|
|
|
+ priceSort=timeTxt;
|
|
|
+ loadDate();
|
|
|
+ })
|
|
|
+ $('#industryList li:first-child').click(function(){
|
|
|
+ theFieldA = $(this).attr('value');
|
|
|
+ theFieldB = '999';
|
|
|
+ loadDate();
|
|
|
+ })
|
|
|
+})
|