appCognizance.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import '../../css/news/appCognizance.css';
  2. $(function(){
  3. var colorArr=['#e22e2e','#2542ef','#10d4f1','#f9750b','#0bf964'];
  4. //获取id
  5. var https=window.location.href;
  6. var indexs = https.indexOf('=');
  7. var ids=https.substr(indexs+1,https.length);
  8. //数据获取
  9. function DataList(){
  10. $.ajax({
  11. type:"get",
  12. dataType:'json',
  13. url: globalConfig.context + "/portal/Service/ProjectDetail",
  14. //url: "http://192.168.1.100:8080/portal/Service/ProjectDetail",
  15. data:{
  16. id:ids
  17. },
  18. success:function(data){
  19. var theData=data.data;
  20. var describeList=[]; //需求描述
  21. var dataList=[]; //所需资料
  22. var specificationList=[]; //服务规格
  23. var promiseLsit=[];
  24. if(data.data.length){
  25. console.log(theData[0])
  26. describeList.push([
  27. "<div><p>"+theData[0].introduce+"</p></div>",
  28. ].join(','));
  29. dataList.push([
  30. "<div><p>"+theData[0].valueEffect+"</p></div>",
  31. ].join(','));
  32. for (var i=0;i<theData[1].length;i++){
  33. specificationList.push([
  34. "<div>"+theData[1][i]+"</div>",
  35. ].join(','));
  36. };
  37. promiseLsit.push([
  38. "<div><p>"+theData[0].clientSize+"</p></div>",
  39. ].join(','));
  40. $('#describe').html(describeList);
  41. $('#data').html(dataList);
  42. $('.specifications').html(specificationList);
  43. $('#promise').html(promiseLsit);
  44. //规格添加颜色
  45. for(var i=0;i<$('.specifications div').length;i++){
  46. if(i>colorArr.length){
  47. i=0
  48. };
  49. $('.specifications div').eq(i).css({color:colorArr[i]})
  50. }
  51. }
  52. }
  53. });
  54. };
  55. DataList();
  56. })