import '../../css/news/appCognizance.css'; $(function(){ var metas=''; metas +=''+ ''+ ''+ '' ; $('head').append(metas); var colorArr=['#e22e2e','#2542ef','#10d4f1','#f9750b','#0bf964']; //获取id var https=window.location.href; var indexs = https.indexOf('id='); window.onload=function(){ location.href = location.href + "tt=" + new Date().valueOf(); } var tt = https.indexOf('tt=')!=-1?https.indexOf('tt='):https.length; var idk=parseInt(indexs)>0?https.substr(indexs+3,tt):''; let idtt=idk.split('tt=')[0] ; console.log(idtt) //数据获取 function DataList(){ if(idtt){ $.ajax({ type:"get", dataType:'json', url: globalConfig.context + "/portal/Service/ProjectDetail", data:{ id:idtt }, success:function(data){ var theData=data.data; var describeList=[]; //需求描述 var dataList=[]; //所需资料 var specificationList=[]; //服务规格 var promiseLsit=[]; if(data.data&&data.data.length){ var urls; if(theData[0].maxLogo&&theData[0].maxLogo!=null){ urls=globalConfig.avatarHost+'/upload'+theData[0].maxLogo; $('#imgs').attr('src',urls) } var desArr=[]; var dataArr=[]; var proArr=[]; //项目描述 if(theData[0].introduce!=null){ if(theData[0].introduce.match(/\n/g)){ desArr=theData[0].introduce.split(/\n/g) }else{ desArr.push(theData[0].introduce) }; for (var i=0;i"+desArr[i]+"

", ].join(',')); }; } //项目价值 if(theData[0].valueEffect!=null){ if(theData[0].valueEffect.match(/\n/g)){ dataArr=theData[0].valueEffect.split(/\n/g) }else{ dataArr.push(theData[0].valueEffect) }; for (var i=0;i"+dataArr[i]+"

", ].join(',')); }; } //规格 if(theData[1].length){ for (var i=0;i"+theData[1][i]+"", ].join(',')); }; }else{ specificationList=[]; } //所需资料 if(theData[0].clientSize!=null){ if(theData[0].clientSize.match(/\n/g)){ proArr=theData[0].clientSize.split(/\n/g) }else{ proArr.push(theData[0].clientSize) }; for (var i=0;i"+proArr[i]+"

", ].join(',')); }; } $('#describe').html(describeList); $('#data').html(dataList); $('.specifications').html(specificationList); $('#promise').html(promiseLsit); //规格添加颜色 for(var i=0;i<$('.specifications div').length;i++){ if(i>colorArr.length){ i=0 }; $('.specifications div').eq(i).css({color:colorArr[i]}) } } } }); } }; DataList(); })