liting2017 7 년 전
부모
커밋
4d43313e1b
1개의 변경된 파일48개의 추가작업 그리고 33개의 파일을 삭제
  1. 48 33
      src/js/news/appCognizance.js

+ 48 - 33
src/js/news/appCognizance.js

@@ -5,16 +5,23 @@ $(function(){
 	//获取id
 	var https=window.location.href;
 	var indexs = https.indexOf('id=');
-	var ids=parseInt(indexs)>0?https.substr(indexs+3,https.length):'';
+	//var ids=parseInt(indexs)>0?https.substr(indexs+3,https.length):'';
+	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(ids){
+		if(idtt){
 			$.ajax({
 				type:"get",
 				dataType:'json',
 				url: globalConfig.context + "/portal/Service/ProjectDetail",
 				data:{
-					id:ids
+					id:idtt
 				},
 				success:function(data){
 					var theData=data.data;
@@ -34,27 +41,33 @@ $(function(){
 						var dataArr=[];
 						var proArr=[];
 						//项目描述
-						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].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.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[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++){
@@ -66,16 +79,18 @@ $(function(){
 							specificationList=[];
 						}
 						//所需资料
-						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(','));
-						};
+						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);