Browse Source

发现接口调整

luyanan 7 years ago
parent
commit
ee34e7e7b8
4 changed files with 55 additions and 37 deletions
  1. 12 6
      css/genindex.css
  2. 1 1
      css/share.css
  3. 1 1
      discover.html
  4. 41 29
      js/discover.js

+ 12 - 6
css/genindex.css

@ -389,9 +389,9 @@ ul.artAbout .frmadd{width:auto;position:absolute;right:0;top:0;background: #ff99
389 389
.showDetail .h2Font{font-size:14px;color:#999;}
390 390
.showDetail .readNum{margin-left: 20px;}
391 391
.showDetail .showBigOpen{width:100%;height:300px;margin:24px 0;background-position:center;background-size:cover;background-repeat:no-repeat;}
392
.showMain{font-size:16px;color:#333;line-height: 30px;}
392
.showMain{font-size:16px;color:#333;line-height:28px;}
393 393
.showMain img{max-width: 100%;}
394
.showMain p{margin-bottom:10px;text-align:justify}
394
.showMain p{margin-bottom:16px;text-align:justify}
395 395
ul.tagList{margin:20px 0 -10px;overflow: hidden;}
396 396
ul.tagList>li{float: left;margin-right:10px;margin-bottom:10px;padding:0 12px;color: #999;border: 1px solid #E5E5E5;border-radius: 20px;cursor: pointer;}
397 397
ul.tagList>li .h2Font{color:#666}
@ -674,14 +674,14 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
674 674
/*统计数据*/
675 675
.statisticsBox{}
676 676
.statisticsBox span{font-size: 20px;color:#333}
677
.statisticsBox p{font-size: 14px;color:#999}
678
.goarrow{font-size:16px;display:inline-block;color: #ff9900;margin:10px 0 0;padding:0 6px;position: relative;}
677
.statisticsBox p{font-size: 14px;color:#999;margin-bottom:10px;}
678
.goarrow{font-size:16px;display:inline-block;color: #ff9900;padding:0 6px;position: relative;}
679 679
.goarrow em{position:absolute;right:0;top:-15px;}
680 680
.goarrow em:before{border: solid transparent;border-left-color: #ff9900;border-width:8px;content: " ";position: absolute;left: 100%;top: 18px;}
681 681
.goarrow em:after{border: solid transparent;border-left-color:#fff;border-width:6px;content: " ";position: absolute;left: 100%;top: 20px;}
682 682
683 683
/*相关信息*/
684
.leftconItem{display: none;padding-bottom: 40px;}
684
.leftconItem{display: none;}
685 685
.leftconItem:first-child{display: block;}
686 686
.coninfobox{padding:30px 30px 0;background: #FFF;}
687 687
.coninfobox .coninfotit{position:relative;font-size: 18px;color:#666;margin-bottom:10px;}
@ -814,5 +814,11 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
814 814
.aboutPa .form-result ul.authorBox>li>a{max-width:80%;}
815 815
816 816
/*--------------新版需求相关--------------*/
817
.needinfobox.coninfobox{border-bottom:20px solid #F4F6F8;padding-bottom: 30px;}
817 818
.needList.form-item .madiaInfo{padding-left:0;}
818
.needList.form-item ul .h1Font{font-size: 18px;margin-bottom: 10px;}
819
.needList.form-item>ul .h1Font{font-size: 18px;margin-bottom: 10px;}
820
.needList.form-item>ul .h2Font{font-size: 14px;line-height:24px;margin: 10px 0;}
821
.needList.form-item>ul .h3Font{font-size: 14px;color:#999;}
822
.needList.form-item>ul>li{padding:10px 30px;margin:0 -30px;}
823
.needList.form-item>ul>li:hover{background: #EEEEEE;}
824
.needList.form-item ul .showli>li{margin: 6px 0;width:25%;padding-right:16px;float:left;text-overflow:ellipsis;white-space: nowrap;overflow: hidden;}

+ 1 - 1
css/share.css

@ -77,7 +77,7 @@ html,body {outline: 0;margin:0;padding:0px;background: #efeff4;-webkit-text-size
77 77
.showDetail .h3Font{font-size:13px;color:#999; line-height:24px;}
78 78
.showDetail .showMain{font-size:15px;color:#333;line-height:28px;}
79 79
.showDetail .showMain img{max-width: 100%;}
80
.showDetail .showMain p{margin-bottom:10px;font-size:15px;color:#333;text-align:justify}
80
.showDetail .showMain p{margin-bottom:16px;font-size:15px;color:#333;text-align:justify}
81 81
ul.tagList{padding:0;margin:18px 0 8px;overflow: hidden;}
82 82
ul.tagList>li{list-style:none;float: left;margin-right:10px;margin-bottom:10px;padding:4px 12px;color: #666;background:#EFEFEF;}
83 83
ul.tagList>li .h2Font{color: #666;}

+ 1 - 1
discover.html

@ -16,7 +16,7 @@
16 16
<header id="header">
17 17
	<script src="js/header.js"></script>
18 18
</header>
19
<div id="container">
19
<div id="container" style="margin-top:-20px;">
20 20
	<div class="containerCon">
21 21
		<div class="contentCon clearfix">
22 22
			<div class="leftconBox floatL" style="background: #f4f6f8;">

+ 41 - 29
js/discover.js

@ -3,11 +3,39 @@ $(function() {
3 3
	$(".headnav li").eq(1).addClass("navcurrent");
4 4
	loginStatus();//判断个人是否登录
5 5
	var userid = $.cookie("userid");
6
	importNews();
6
	var exculdeIds=[];
7
	var exculdeId2s=[];
8
	//轮播加载页面
9
	$.ajax({
10
		"url":"/data/inc/col_banner.html",
11
		"dataType":"html",
12
		"success":function(result){
13
			$(".slide-box").html(result);
14
			bannerRotate.bannerInit();// 轮播
15
			for(var i=0;i<5;i++){
16
				var dataId=$(".slide-item").eq(i).attr("data-id");
17
				exculdeIds.push(dataId);
18
				exculdeId2s.push(dataId);
19
			}
20
			$(".slide-list").on("click",".slide-item",function(){
21
				var columId=$(this).attr("data-col");
22
				$.ajax({
23
					"url":"/ajax/operation/statist/bannerClick",
24
					"type":"POST" ,
25
					"dataType":"json",
26
					"data":{"id":columId},
27
					"success" : function(data) {
28
						console.log(data)
29
					}
30
				})
31
			})
32
		}
33
	})
34
	importNews(exculdeIds);
7 35
	hotNews();
8 36
	var linkNum=0;//栏目类别导航
9 37
	if(linkNum==0){
10
		listShow(1,0,true);
38
		listShow(exculdeId2s,1,0,true);
11 39
	}
12 40
	$(document).bind("click",function(e){ 
13 41
		var target = $(e.target); 
@ -41,45 +69,26 @@ $(function() {
41 69
				$(".rightbtn").removeClass("table-tab-slide-active");
42 70
			}
43 71
			if(linkNum==0){
44
				listShow(1,0,true);
72
				listShow(exculdeId2s,1,0,true);
45 73
			}else{
46 74
				var thisNum=linkNum+2;
47
				listShow(1,thisNum,true);
75
				listShow(exculdeIds,1,thisNum,true);
48 76
			}
49 77
		}else{
50 78
			$(this).find(".table-drop").show();
51 79
		}
52 80
	})
53 81
	
54
	//轮播加载页面
55
	$.ajax({
56
		"url":"/data/inc/col_banner.html",
57
		"dataType":"html",
58
		"success":function(result){
59
			$(".slide-box").html(result);
60
			bannerRotate.bannerInit();// 轮播
61
			$(".slide-list").on("click",".slide-item",function(){
62
				var columId=$(this).attr("data-col");
63
				$.ajax({
64
					"url":"/ajax/operation/statist/bannerClick",
65
					"type":"POST" ,
66
					"dataType":"json",
67
					"data":{"id":columId},
68
					"success" : function(data) {
69
						console.log(data)
70
					}
71
				})
72
			})
73
		}
74
	
75
	})
76 82
	//重大新闻
77
	function importNews() {
83
	function importNews(obj) {
78 84
		$.ajax({
79 85
			"url" :"/ajax/article/find",
80 86
			"type" :  "GET" ,
81 87
			"dataType" : "json",
88
			"async":false,
82 89
			"data" :{
90
				"traditional": true,
91
				"exclude":obj,
83 92
				"col":9,//重大新闻
84 93
				"pageSize":5,
85 94
				"pageNo":1
@ -96,6 +105,7 @@ $(function() {
96 105
							var str='<a href="articalShow.html?articleId='+$data[i].articleId+'"><p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+$data[i].articleTitle+'</p>'+
97 106
								'<span class="smalltip">'+commenTime($data[i].publishTime)+'</span></a></li>'
98 107
							$(str).appendTo(listLi);
108
							exculdeId2s.push($data[i].articleId);
99 109
						}
100 110
					}
101 111
				}
@ -132,12 +142,14 @@ $(function() {
132 142
		});
133 143
	}
134 144
	//栏目列表
135
	function listShow(pageNo,colNum,isbind){
145
	function listShow(obj,pageNo,colNum,isbind){
136 146
		$.ajax({
137 147
			"url" :"/ajax/article/find",
138 148
			"type" :  "GET" ,
139 149
			"dataType" : "json",
150
			"traditional": true,
140 151
			"data" :{
152
				"exclude":obj,
141 153
				"col":colNum,
142 154
				"pageSize":10,
143 155
				"pageNo":pageNo
@ -178,7 +190,7 @@ $(function() {
178 190
							current: data.data.pageNo,
179 191
							backFn: function(p) {
180 192
								$("#table-item-"+idItem).html("");
181
								listShow(p,colNum,false);
193
								listShow(obj,p,colNum,false);
182 194
								document.body.scrollTop = document.documentElement.scrollTop = 0;
183 195
							}
184 196
						});