|
@@ -14,109 +14,80 @@ import 'laypage/lib/laypage.js';
|
|
|
|
|
|
"use strict";
|
|
|
$(function() {
|
|
|
- //获取时间轴;
|
|
|
- //数据获取;
|
|
|
var thePageNo = 1,
|
|
|
thePageLength = 1,
|
|
|
- pageSize =10;
|
|
|
- loadData();
|
|
|
+ dataList={},
|
|
|
+ pageSize =12;
|
|
|
+ init();
|
|
|
+ function init(){
|
|
|
+ loadDate();
|
|
|
+ pages();
|
|
|
+ onSelect();
|
|
|
+ inpFun();
|
|
|
+ $('.onSelect .preFirst').css('display','none')
|
|
|
+ $('.onSelect .next').css('display','none')
|
|
|
+ };
|
|
|
function loadDate(pageNo) {
|
|
|
+ console.log(dataList)
|
|
|
$.ajax({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
- url: globalConfig.context + "/portal/search/achievementList",
|
|
|
+ //url: globalConfig.context + "/portal/search/achievementList",
|
|
|
+ url:"https://www.apiopen.top/satinApi",
|
|
|
data: {
|
|
|
+ //page:1
|
|
|
pageNo: pageNo || 1,
|
|
|
- pageSize: 10,
|
|
|
- boutiqueFlag :-1,
|
|
|
- keyword: theKeyword,
|
|
|
- transferMode: theMode != 999 ? theMode : undefined,
|
|
|
- fieldA: theFieldA != 999 ? theFieldA : undefined,
|
|
|
- fieldB: theFieldB != 999 ? theFieldB : undefined,
|
|
|
- dataCategory:dataCategory != 999 ? dataCategory : undefined,
|
|
|
- category:category != 999 ? category : undefined,
|
|
|
- dateSort:dateSort,
|
|
|
- lowerPrice:lowerPrice,
|
|
|
- upperPrice:upperPrice,
|
|
|
- internationalFlag:internationalFlag != 999 ? internationalFlag : undefined,
|
|
|
+ pageSize: 12,
|
|
|
+ // keyword: theKeyword,
|
|
|
+ fieldA: dataList.industryVal, //行业
|
|
|
+ fieldB: dataList.productionVal //类型
|
|
|
},
|
|
|
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];
|
|
|
- let isJingpin="";
|
|
|
- if(thisdata.boutique==1){
|
|
|
- isJingpin="jingpin";
|
|
|
- }else{
|
|
|
- isJingpin="jingpin1";
|
|
|
- }
|
|
|
- if(thisdata.technicalPictureUrl==null){
|
|
|
- thisdata.technicalPictureUrl=''
|
|
|
- }
|
|
|
- var imgUrl=thisdata.technicalPictureUrl!=''?globalConfig.avatarHost + '/upload' +thisdata.technicalPictureUrl:globalConfig.avatarHost+ "/upload/default/zhuanliimg_null.png";
|
|
|
- var star='';
|
|
|
- for(var n=0;n<thisdata.maturity;n++){
|
|
|
- star+='<li></li>';
|
|
|
- }
|
|
|
- var percentage='';
|
|
|
- if(thisdata.maturityS=='正在研发'){
|
|
|
- percentage=20
|
|
|
- }
|
|
|
- if(thisdata.maturityS=='已有样品'){
|
|
|
- percentage=40
|
|
|
- }
|
|
|
- if(thisdata.maturityS=='通过小试'){
|
|
|
- percentage=60
|
|
|
- }
|
|
|
- if(thisdata.maturityS=='通过中试'){
|
|
|
- percentage=80
|
|
|
- }
|
|
|
- if(thisdata.maturityS=='可以量产'){
|
|
|
- percentage=100
|
|
|
- }
|
|
|
- theArr.push([
|
|
|
- '<li val="'+thisdata.id+'" typ="'+thisdata.ownerType+'" class="list"><span class="'+isJingpin+'"></span><div>'+(thisdata.name?thisdata.name:"未知名称")+'</div>',
|
|
|
- '<ol><li>类型:<span>' + (thisdata.category ? categoryObj[thisdata.category] : '') + '</span></li>',
|
|
|
- '<li>行业:<span>' + (thisdata.fieldA?getIndustryCategory(thisdata.fieldA, thisdata.fieldB):"未知行业") + '</span></li>',
|
|
|
- '<li>交易方式:<span>' + (thisdata.transferMode ? transferModeObj[thisdata.transferMode] : "当面交易") + '</span></li>',
|
|
|
- '<li>成熟度:<span>'+(thisdata.maturityS?thisdata.maturityS:"通过小试")+'</span></li>',
|
|
|
- //'<li val="'+thisdata.id+'" typ="'+thisdata.ownerType+'">技术方:<span>'+(thisdata.ownerName?thisdata.ownerName:"佚名")+'</span>',
|
|
|
- // '<div class="progressBar">',
|
|
|
- // '<p class="bjtxt"></p>',
|
|
|
- // '<span class="percentagePic" style="width:'+percentage+'px"></span>',
|
|
|
- // '<span class="percentage">'+percentage+'%</span>',
|
|
|
- // '<p class="txt"></p>',
|
|
|
- // '</div>',
|
|
|
- '</li>',
|
|
|
- '<li class="consultation"><a href="javascript:;">我要咨询</a></li>',
|
|
|
- '</ol>',
|
|
|
- '<input type="hidden" class="achievementId" value="' + thisdata.id + '">',
|
|
|
- '<input type="hidden" class="achievementType" value="' + thisdata.dataCategory + '">',
|
|
|
- '</li>' ,
|
|
|
- ].join(''));
|
|
|
+ console.log(data)
|
|
|
+ var theArrs = [];
|
|
|
+ data.data.totalCount=400;
|
|
|
+ if (data.data&&data.data.length) {
|
|
|
+ for (let i = 0; i < 12; i++) {
|
|
|
+ let thisdata = data.data[i];
|
|
|
+ theArrs.push(`
|
|
|
+ <li>
|
|
|
+ <div class="img">
|
|
|
+ <img src="${thisdata.cdn_img}" alt="">
|
|
|
+ <span></span>
|
|
|
+ </div>
|
|
|
+ <div class="txtIntroduce">
|
|
|
+ <div class="txts">
|
|
|
+ <h5>高压电极加热技术哈...</h5>
|
|
|
+ <p><span>实用技术</span><span>联合生产</span><span class="hotImg"></span></p>
|
|
|
+ </div>
|
|
|
+ <div class="hr"></div>
|
|
|
+ <div class="btnTxt">
|
|
|
+ <span class="float-left">环保</span>
|
|
|
+ <span class="float-left">医疗</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>`
|
|
|
+ );
|
|
|
};
|
|
|
};
|
|
|
- $('.achievementList ul').empty();
|
|
|
- $('.achievementList ul').append(theArr.join(''));
|
|
|
+ $('.achievementHot .hotList').empty();
|
|
|
+ $('.achievementHot .hotList').append(theArrs.join(''));
|
|
|
|
|
|
//页面里面的详情链接
|
|
|
- $(".achievementList ul li .consultation").siblings().on('click', function () {
|
|
|
+ $(".achievementHot .hotList li").on('click', function () {
|
|
|
var theId = $(this).parents('.list').attr('val');
|
|
|
var thetype=$(this).parents('.list').attr('typ');
|
|
|
window.open(globalConfig.context + '/portal/technologyTrading/achievementDetail?id=' + theId+'&type='+thetype );
|
|
|
});
|
|
|
- $(".achievementList ul li div").on("click",function(){
|
|
|
- $(this).siblings("ol").children("li:first").click();
|
|
|
- });
|
|
|
- $(".achievementList ul li ol .consultation").click(function(){
|
|
|
- $('#lxkf').click()
|
|
|
- })
|
|
|
-
|
|
|
- if(data.data.list.length===0){
|
|
|
- $('.achievementList ul').html("<div class='list_none'></div>") ;
|
|
|
- };
|
|
|
+ $('.pagination_box').css('display','block');
|
|
|
+ $('.inp').css('display','block');
|
|
|
+ if(data.data.length===0){
|
|
|
+ $('.achievementHot .hotList').html("<div class='list_none'></div>") ;
|
|
|
+ $('.pagination_box').css('display','none')
|
|
|
+ $('.inp').css('display','none');
|
|
|
+ };
|
|
|
thePageLength = data.data.totalCount ? Math.ceil(data.data.totalCount / pageSize) : 1;
|
|
|
+ $('.totalCount').html(`共${data.data.totalCount}条数据 ${thePageLength}页`)
|
|
|
var pageArr = [],
|
|
|
firstNo = 1,
|
|
|
endNo = 5;
|
|
@@ -143,26 +114,60 @@ $(function() {
|
|
|
});
|
|
|
}
|
|
|
//f分页
|
|
|
- $('.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;
|
|
|
+ function pages(){
|
|
|
+ $('.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);
|
|
|
+ };
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //输入跳转
|
|
|
+ function inpFun(){
|
|
|
+ $('.inp .btn').on('click',function(){
|
|
|
+ let val = $(this).siblings().val();
|
|
|
+ if(!isNaN(val)&&val<thePageLength&&val>0){
|
|
|
+ thePageNo=val;
|
|
|
loadDate(thePageNo);
|
|
|
}
|
|
|
- } else {
|
|
|
- var nextPageNo = $(this).children()[0].text;
|
|
|
- if (thePageNo != nextPageNo) {
|
|
|
- $(this).siblings("li").removeClass("active");
|
|
|
- $(this).addClass("active");
|
|
|
- thePageNo = nextPageNo;
|
|
|
- loadDate(thePageNo);
|
|
|
- };
|
|
|
- };
|
|
|
- });
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //已选类型
|
|
|
+ function onSelect(){
|
|
|
+ $('.industryList ul li').on('click',function(){
|
|
|
+ dataList.industryVal = $(this).attr('value');
|
|
|
+ let txt = $(this).text();
|
|
|
+ $('.onSelect .preFirst').css('display','block').html(`
|
|
|
+ <span>${txt}</span>
|
|
|
+ <span class="typeClose">x</span>
|
|
|
+ `)
|
|
|
+ loadDate();
|
|
|
+ }) ;
|
|
|
+ $('.productionType ol li').on('click',function(){
|
|
|
+ dataList.productionVal = $(this).attr('value');
|
|
|
+ let txt = $(this).text();
|
|
|
+ $('.onSelect .next').css('display','block').html(`
|
|
|
+ <span>${txt}</span>
|
|
|
+ <span class="typeClose">x</span>
|
|
|
+ `)
|
|
|
+ loadDate();
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|