liting2017 7 years ago
parent
commit
00a926eb2a
1 changed files with 47 additions and 44 deletions
  1. 47 44
      src/js/news/appCognizance.js

+ 47 - 44
src/js/news/appCognizance.js

@@ -7,53 +7,56 @@ $(function(){
 	var indexs = https.indexOf('id=');
 	var ids=https.substr(indexs+3,https.length);
 	//数据获取
+	
 	function DataList(){
-		$.ajax({
-			type:"get",
-			dataType:'json',
-			url: globalConfig.context + "/portal/Service/ProjectDetail",
-			data:{
-				id:ids
-			},
-			success:function(data){
-				var theData=data.data;
-				var describeList=[];         //需求描述
-				var dataList=[];             //所需资料
-				var specificationList=[];    //服务规格
-				var promiseLsit=[];
-				if(data.data.length){
-					describeList.push([
-						"<div><p>"+theData[0].introduce!='null'?theData[0].introduce:''+"</p></div>",
-					  ].join(','));
-					dataList.push([
-						"<div><p>"+theData[0].valueEffect!='null'?theData[0].valueEffect:''+"</p></div>",
-					  ].join(','));
-					if(theData[1].length){
-						for (var i=0;i<theData[1].length;i++){
-						  	specificationList.push([
-								"<div>"+theData[1][i]+"</div>",
-						  	].join(','));
-						};	
-					}else{
-						specificationList=[];
-					}
-					promiseLsit.push([
-						"<div><p>"+theData[0].clientSize!='null'?theData[0].clientSize:''+"</p></div>",
-					  ].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]})
+		if(ids){
+			$.ajax({
+				type:"get",
+				dataType:'json',
+				url: globalConfig.context + "/portal/Service/ProjectDetail",
+				data:{
+					id:ids
+				},
+				success:function(data){
+					var theData=data.data;
+					var describeList=[];         //需求描述
+					var dataList=[];             //所需资料
+					var specificationList=[];    //服务规格
+					var promiseLsit=[];
+					if(data.data.length){
+						describeList.push([
+							"<div><p>"+theData[0].introduce!='null'?theData[0].introduce:''+"</p></div>",
+						  ].join(','));
+						dataList.push([
+							"<div><p>"+theData[0].valueEffect!='null'?theData[0].valueEffect:''+"</p></div>",
+						  ].join(','));
+						if(theData[1].length){
+							for (var i=0;i<theData[1].length;i++){
+							  	specificationList.push([
+									"<div>"+theData[1][i]+"</div>",
+							  	].join(','));
+							};	
+						}else{
+							specificationList=[];
+						}
+						promiseLsit.push([
+							"<div><p>"+theData[0].clientSize!='null'?theData[0].clientSize:''+"</p></div>",
+						  ].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();	
 })