123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- import '../../css/news/appCognizance.css';
- $(function(){
- var metas='';
- metas +='<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">'+
- '<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />'+
- '<meta http-equiv="Pragma" content="no-cache" />'+
- '<meta http-equiv="Expires" content="0" />' ;
- $('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.length;i++){
- describeList.push([
- "<p>"+desArr[i]+"</p>",
- ].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.length;i++){
- dataList.push([
- "<p>"+dataArr[i]+"</p>",
- ].join(','));
- };
- }
-
- //规格
- if(theData[1].length){
- for (var i=0;i<theData[1].length;i++){
- specificationList.push([
- "<div>"+theData[1][i]+"</div>",
- ].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.length;i++){
- promiseLsit.push([
- "<p>"+proArr[i]+"</p>",
- ].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();
- })
|