818c2409 by 任超

style:样式

2 parents 8fe1f081 f8a538b7
...@@ -548,6 +548,5 @@ ...@@ -548,6 +548,5 @@
548 </body> 548 </body>
549 <script type="text/javascript" src="./staticJs/down.js"></script> 549 <script type="text/javascript" src="./staticJs/down.js"></script>
550 <script type="text/javascript" src="./staticJs/common.js"></script> 550 <script type="text/javascript" src="./staticJs/common.js"></script>
551 <script type="text/javascript" src="./staticJs/staticIndex.js"></script> 551 <script type="text/javascript" src="./staticJs/pageHome.js"></script>
552
553 </html> 552 </html>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -12,6 +12,8 @@ div.banner, div.c_one, div.c_two, div.c_three, div.c_four, div.c_five, div.foote ...@@ -12,6 +12,8 @@ div.banner, div.c_one, div.c_two, div.c_three, div.c_four, div.c_five, div.foote
12 text-align: center; 12 text-align: center;
13 } 13 }
14 14
15
16
15 div.banner { 17 div.banner {
16 height: 500px; 18 height: 500px;
17 position: relative; 19 position: relative;
...@@ -361,7 +363,7 @@ div.c_one .news .news-img { ...@@ -361,7 +363,7 @@ div.c_one .news .news-img {
361 margin-top: 20px; 363 margin-top: 20px;
362 float: left; 364 float: left;
363 width: 350px; 365 width: 350px;
364 height: 236px; 366 height: 237px;
365 } 367 }
366 div.c_one .news .news-img img { 368 div.c_one .news .news-img img {
367 height: 100%; 369 height: 100%;
...@@ -385,7 +387,7 @@ div.c_one ul li:not(:last-child) { ...@@ -385,7 +387,7 @@ div.c_one ul li:not(:last-child) {
385 border-bottom: 1px dashed #DEDEDE; 387 border-bottom: 1px dashed #DEDEDE;
386 } 388 }
387 389
388 div.c_one ul li a { 390 div.c_one #ulNews li a{
389 width: 100%; 391 width: 100%;
390 display: block; 392 display: block;
391 text-align: left; 393 text-align: left;
...@@ -405,6 +407,7 @@ div.c_one .news_item .icon { ...@@ -405,6 +407,7 @@ div.c_one .news_item .icon {
405 width: 16%; 407 width: 16%;
406 margin-top: 7.5px; 408 margin-top: 7.5px;
407 margin-right: 7px; 409 margin-right: 7px;
410 margin-left: -3px;
408 } 411 }
409 div.c_one ul li a:hover { 412 div.c_one ul li a:hover {
410 color: #0091FF; 413 color: #0091FF;
......
1 //设置当前页面导航栏背景色
1 function addTabs(id){ 2 function addTabs(id){
2 $('.layui-nav-item').removeClass('layui-this') 3 $('.layui-nav-item').removeClass('layui-this')
3 $(id).addClass('layui-this') 4 $(id).addClass('layui-this')
5 }
6
7 //设置ajax调取服务接口
8
9 function SetServicesPath(){
10 return "http://192.168.2.108"
11 }
12
13 //设置全局參數
14 var portal =
15 {
16 'api_url': "http://192.168.2.108:81/api", //属性名用引号括起来,属性间由逗号隔开
17 'name': 'myName'
18 };
19
20
21 function CutDate(times){
22 var timearr = times.replace(" ", ":").replace(/\:/g, "-").split("-");
23 var timestr = ""+timearr[0]+"/" + timearr[1] + "/" + timearr[2]
24 //var timestr = "" + timearr[1].split("")[1] + "月" + timearr[2] + "日\t" + timearr[3] + ":" + timearr[4] + ""
25 return timestr
4 } 26 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,7 +2,7 @@ layui.use('carousel', function () { ...@@ -2,7 +2,7 @@ layui.use('carousel', function () {
2 var carousel = layui.carousel; 2 var carousel = layui.carousel;
3 //建造实例 3 //建造实例
4 carousel.render({ 4 carousel.render({
5 elem: '#banner_swiper' 5 elem: '# '
6 , width: '100%' //设置容器宽度 6 , width: '100%' //设置容器宽度
7 , arrow: 'always' //始终显示箭头 7 , arrow: 'always' //始终显示箭头
8 , autoplay: true 8 , autoplay: true
...@@ -31,16 +31,31 @@ layui.use('util', function () { ...@@ -31,16 +31,31 @@ layui.use('util', function () {
31 31
32 //初始化方法 32 //初始化方法
33 $(function () { 33 $(function () {
34 // NewsData(); 34 NewsData();
35 addTabs('#index') 35 addTabs('#index')
36 }); 36 });
37 37
38 //加载新闻首页数据
38 function NewsData() { 39 function NewsData() {
39 var ulNews = $("#ulNews"); 40 var ulNews = $("#ulNews");
40 ulNews.empty(); 41 ulNews.empty();
41 var str = ''; 42 var str = '';
42 for (var i = 0; i < 6; i++) { 43 $.ajax({
43 str = '<li><a href="#" title="创新技术体系 引领事业发展"><i>最新</i>创新技术体系 引领事业发展<span>2020-06-19</span></a></li>'; 44 type: "get", //提交方式
44 ulNews.append(str); 45 url: portal.api_url + "/hlwj/Mh/getNewsHotArticleList",//路径
45 } 46 dataType: "json",
47 //数据,这里使用的是Json格式进行传输
48 success: function (result) {//返回数据根据结果进行相应的处理
49 if (result.code == 200 && result.data != null) {
50 for (var i = 0; i < result.data.length; i++) {
51 if (i == 6) return;
52 str = '<li><a href="#" title="' + result.data[i].headline + '">' + result.data[i].headline + '</a>';
53 str+='<span>' + CutDate(result.data[i].publishTime) + '</span></li>';
54 ulNews.append(str);
55 }
56
57 }
58 }
59 });
60
46 } 61 }
...\ No newline at end of file ...\ No newline at end of file
......