Browse Source

论文浏览修改导入

luyanan 7 years ago
parent
commit
d1f20b99ca
5 changed files with 122 additions and 86 deletions
  1. 7 4
      css/genindex.css
  2. 0 1
      js/paperImport.js
  3. 27 22
      js/paperModify.js
  4. 78 38
      js/paperShow.js
  5. 10 21
      paperShow.html

+ 7 - 4
css/genindex.css

@ -246,7 +246,7 @@ ul.artAbout .uploadFile .uploadblock .upBackbtn{position:absolute;bottom:30px;le
246 246
.conBlock .aboutTit{font-size:16px;line-height:40px;color:#666666;margin-top:18px;}
247 247
/*ul.artAbout .editBlock{height:320px;border:1px solid #E5E5E5;}*/
248 248
ul.artAbout #filePicker{position:absolute;left:50%; bottom:25px; margin-left:-52px;opacity:0; z-index:88;}
249
ul.artAbout .frmadd{width:auto;position:absolute;right:0;top:0;background: #ff9900;color:#fff;border:none;padding:6px 25px;}
249
ul.artAbout .frmadd{width:auto;position:absolute;right:0;top:0;background: #ff9900;color:#fff;border:none;padding:6px 25px; z-index:4;}
250 250
251 251
.conItem ul.operateBlock{overflow: hidden;margin-top:-30px;}
252 252
.conItem ul.operateBlock>li{font-size:15px; color:#666666;float:left;width:33.333%;margin-top:30px;text-align: center;cursor: pointer;}
@ -712,9 +712,12 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
712 712
.showMainP .showTit{font-size: 14px;color: #333;padding-left: 12px;}
713 713
.showMainP .showCon{font-size: 14px;color: #666;}
714 714
.aboutPa .form-result{margin:-6px -20px 0 0;}
715
.aboutPa .form-result>ul>li{float:left;width: 47%;border:1px solid #E5E5E5;padding:20px;margin:20px 20px 0 0;min-height:auto;height: 76px;}
715
.aboutPa .form-result>ul>li{float:left;width: 47%;border:1px solid #E5E5E5;background:#FFFFFF;padding:20px;margin:20px 20px 0 0;min-height:auto;height: 76px;z-index:4;}
716 716
.aboutPa ul>li .goSpan{position: absolute; right: 20px;top: 50%;margin-top: -11px;cursor: pointer;}
717 717
.aboutPa ul>li .goSpan span{width: 54px;padding: 0;line-height: 26px;font-size: 14px;margin:0}
718 718
.aboutPa ul>li .shareCode{left:-8px}
719
.aboutPa ul>li.lastBtn{line-height:34px;text-align: center;cursor: pointer;}
720
.aboutPa .form-result>ul>li:hover{background: none;}
719
.aboutPa ul>li.lastBtn{position:absolute;right:7px;bottom:20px;line-height:34px;text-align: center;cursor: pointer;}
720
.aboutPa ul>li.pointThis{cursor: pointer;}
721
.aboutPa .form-result>ul>li:hover{background:#FFFFFF;}
722
.aboutPa .form-result ul.authorBox{position:relative;height:212px;overflow: hidden;}
723
.aboutPa .form-result ul.authorBox.removeHe{height:auto;}

+ 0 - 1
js/paperImport.js

@ -5,7 +5,6 @@ $(document).ready(function(){
5 5
	valUser();
6 6
	var userid = $.cookie("userid");
7 7
	var userName = $.cookie("userName");
8
	var userName = '赵海燕';
9 8
	var paperId;
10 9
	
11 10
	/*资源列表查询*/

+ 27 - 22
js/paperModify.js

@ -60,22 +60,23 @@ $(document).ready(function() {
60 60
									type:"get",
61 61
									url:"/ajax/professor/editBaseInfo/" + data.data[i].professorId,
62 62
									async:true,
63
									success:function(data){
64
										console.log(data)
65
										if(data.success){
66
											if(data.hasHeadImage == 1) {
67
												imgbg = "/images/head/" + data.id + "_l.jpg";
63
									success:function($proData){
64
										console.log($proData)
65
										if($proData.success){
66
											var showPro = $proData.data;
67
											if(showPro.hasHeadImage == 1) {
68
												imgbg = "/images/head/" + showPro.id + "_l.jpg";
68 69
											} else {
69 70
												imgbg = "../images/default-photo.jpg";
70 71
											}
71 72
											//认证
72
											var oSty = autho(data.authType,data.orgAuth,data.authStatus);
73
											var oSty = autho(showPro.authType,showPro.orgAuth,showPro.authStatus);
73 74
											authTy = oSty.sty;
74 75
											authTit = oSty.title;
75 76
											
76
											var title = data.title || "";
77
											var orgName = data.orgName || "";
78
											var office = data.office || "";
77
											var title = showPro.title || "";
78
											var orgName = showPro.orgName || "";
79
											var office = showPro.office || "";
79 80
											if(orgName!=""){
80 81
												if(title != "") {
81 82
													baseInfo = title + "," + orgName;
@ -97,24 +98,28 @@ $(document).ready(function() {
97 98
													}
98 99
												}
99 100
											}
101
											var str="";
102
											str +='<li class="flexCenter" data-id="'+ showPro.id +'">'
103
											str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
104
											str +='<div class="madiaInfo">'
105
											str +='<p class="ellipsisSty"><span class="h1Font">'+ showPro.name +'</span><em class="authiconNew '+ authTy +'" title="'+ authTit +'"></em></p>'
106
											str +='<p class="h2Font ellipsisSty">'+ baseInfo +'</p>'
107
											str +='</div></li>';
108
											var $str=$(str);
109
											$("#aboutAuthors").append($str);
100 110
										}
101 111
									}
102 112
								})
103 113
							}else{
104
								authTy = ""
105
								authTit = ""
106
								baseInfo=""
114
								var str="";
115
								str +='<li class="flexCenter" data-id="'+ data.data[i].professorId +'">'
116
								str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
117
								str +='<div class="madiaInfo">'
118
								str +='<p class="ellipsisSty"><span class="h1Font">'+ data.data[i].name +'</span></p>'
119
								str +='</div></li>';
120
								var $str=$(str);
121
								$("#aboutAuthors").append($str);
107 122
							}
108
							var str="";
109
							str +='<li class="flexCenter">'
110
							str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
111
							str +='<div class="madiaInfo">'
112
							str +='<p class="ellipsisSty"><span class="h1Font">'+ data.data[i].name +'</span><em class="authiconNew '+ authTy +'" title="'+ authTit +'"></em></p>'
113
							str +='<p class="h2Font ellipsisSty">'+ baseInfo +'</p>'
114
							str +='</div></li>';
115
							var $str =$(str);
116
							$("#aboutAuthors").append($str);
117
					
118 123
						}
119 124
						
120 125
					}

+ 78 - 38
js/paperShow.js

@ -3,19 +3,18 @@ $(document).ready(function() {
3 3
	var userid = $.cookie("userid");
4 4
	var paperId = GetQueryString("paperId");
5 5

6
	ifcollectionAbout(paperId, 2)
6
	ifcollectionAbout(paperId, 5)
7 7
	getPaperMe();
8
	pageViewsVal();
8 9
	
9 10
	
10 11
	//点击收藏按钮
11
	$("#attention").on('click', function() {
12
	$("#collectBtn").on('click', function() {
12 13
		if(userid && userid != null && userid != "null") {
13
			if($(this).find("em").is('.icon-collected')){
14
				alert(111)
15
				cancelCollectionAbout(paperId, 2)
14
			if($(this).is('.icon-collected')){
15
				cancelCollectionAbout(paperId, 5)
16 16
			} else {
17
				alert(222)
18
				collectionAbout(paperId, 2);
17
				collectionAbout(paperId, 5);
19 18
			}
20 19
		}else{
21 20
			$.MsgBox.Alert("提示", "请先登录再进行收藏");
@ -40,7 +39,23 @@ $(document).ready(function() {
40 39
		location.href = "searchNew.html?searchContent=" + tagText + "&tagflag=6";
41 40
	})
42 41
	
43
	/*获取资源信息*/
42
	//点击进入个人详情页面
43
	$("#aboutAuthors").on("click","li:not('.lastBtn')",function(){
44
		var oDataId = $(this).attr("data-id");
45
		if(oDataId.substring(0,1)!="#"){
46
			location.href="userInforShow.html?professorId="+oDataId;
47
		}else{
48
			location.href="javascrip:;";
49
		}
50
	})
51
	$("#aboutAuthors").on("click","li.lastBtn",function(){
52
		$("#aboutAuthors").addClass('removeHe');
53
		$(this).hide();
54
	})
55
	
56
	
57
	
58
	/*获取论文信息*/
44 59
	function getPaperMe() {
45 60
		$.ajax({
46 61
			"url": "/ajax/ppaper/qo",
@ -72,29 +87,32 @@ $(document).ready(function() {
72 87
				console.log(data);
73 88
				if(data.success) {
74 89
					if(data.data.length>0){
90
						$("#aboutAuthors .lastBtn span").text(data.data.length);
75 91
						for(var i=0;i<data.data.length;i++){
76
							var authTy="",authTit="",baseInfo="",imgbg="../images/default-photo.jpg";
92
							var authTy="",authTit="",baseInfo="",ifPoint="",imgbg="../images/default-photo.jpg";
77 93
							if(data.data[i].professorId.substring(0, 1) != "#"){
78 94
								$.ajax({
79 95
									type:"get",
80 96
									url:"/ajax/professor/editBaseInfo/" + data.data[i].professorId,
81 97
									async:true,
82
									success:function(data){
83
										console.log(data)
84
										if(data.success){
85
											if(data.hasHeadImage == 1) {
86
												imgbg = "/images/head/" + data.id + "_l.jpg";
98
									success:function($proData){
99
										console.log($proData)
100
										if($proData.success){
101
											var showPro = $proData.data;
102
											if(showPro.hasHeadImage == 1) {
103
												imgbg = "/images/head/" + showPro.id + "_l.jpg";
87 104
											} else {
88 105
												imgbg = "../images/default-photo.jpg";
89 106
											}
107
											ifPoint = "pointThis";
90 108
											//认证
91
											var oSty = autho(data.authType,data.orgAuth,data.authStatus);
109
											var oSty = autho(showPro.authType,showPro.orgAuth,showPro.authStatus);
92 110
											authTy = oSty.sty;
93 111
											authTit = oSty.title;
94 112
											
95
											var title = data.title || "";
96
											var orgName = data.orgName || "";
97
											var office = data.office || "";
113
											var title = showPro.title || "";
114
											var orgName = showPro.orgName || "";
115
											var office = showPro.office || "";
98 116
											if(orgName!=""){
99 117
												if(title != "") {
100 118
													baseInfo = title + "," + orgName;
@ -116,27 +134,33 @@ $(document).ready(function() {
116 134
													}
117 135
												}
118 136
											}
137
											var str="";
138
											str +='<li class="flexCenter '+ ifPoint +'" data-id="'+ showPro.id +'">'
139
											str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
140
											str +='<div class="madiaInfo">'
141
											str +='<p class="ellipsisSty"><span class="h1Font">'+ showPro.name +'</span><em class="authiconNew '+ authTy +'" title="'+ authTit +'"></em></p>'
142
											str +='<p class="h2Font ellipsisSty">'+ baseInfo +'</p>'
143
											str +='</div></li>';
144
											var $str=$(str);
145
											$("#aboutAuthors .lastBtn").before($str);
119 146
										}
120 147
									}
121 148
								})
122 149
							}else{
123
								authTy = ""
124
								authTit = ""
125
								baseInfo=""
150
								var str="";
151
								str +='<li class="flexCenter" data-id="'+ data.data[i].professorId +'">'
152
								str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
153
								str +='<div class="madiaInfo">'
154
								str +='<p class="ellipsisSty"><span class="h1Font">'+ data.data[i].name +'</span></p>'
155
								str +='</div></li>';
156
								var $str=$(str);
157
								$("#aboutAuthors .lastBtn").before($str);
158
							}
159
							
160
							if(data.data.length<4){
161
								$("#aboutAuthors").addClass('removeHe');
162
								$(".lastBtn").hide();
126 163
							}
127
							var str="";
128
							str +='<li class="flexCenter">'
129
							str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
130
							str +='<div class="madiaInfo">'
131
							str +='<p class="ellipsisSty"><span class="h1Font">'+ data.data[i].name +'</span><em class="authiconNew '+ authTy +'" title="'+ authTit +'"></em></p>'
132
							str +='<p class="h2Font ellipsisSty">'+ baseInfo +'</p>'
133
							str +='</div></li>';
134
							var $str=$(str)
135
							$("#aboutAuthors").append($str);
136
						}
137
						if(data.data.length>4){
138
							var lastStr='<li class="lastBtn"><div>查看全部作者(<span>'+ data.data.length +'</span>)</div></li>';
139
							$("#aboutAuthors").insertBefore(lastStr,$("#aboutAuthors li").eq(data.data.length-1).nextSibling)
140 164
						}
141 165
					}
142 166
				}
@ -150,7 +174,7 @@ $(document).ready(function() {
150 174
			}
151 175
		});
152 176
	}
153
	/*处理资源html代码*/
177
	/*处理论文html代码*/
154 178
	function paperHtml($da) {
155 179
		$("#paperName").text($da.name); //名字
156 180
		$("#pageView").text($da.pageViews); //浏览量
@ -188,11 +212,27 @@ $(document).ready(function() {
188 212
				$(".tagList").hide();
189 213
			}
190 214
		}		
191
		var weibopic = "http://www.ekexiu.com/images/default-resource.jpg"
215
		var weibopic = "http://" + window.location.host + "/images/default-resource.jpg"
192 216
		var weibotitle = $da.name;
193 217
		var weibourl = window.location.href;
194 218
		$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+encodeURIComponent(weibotitle)+"&url="+encodeURIComponent(weibourl)+"&pic="+encodeURIComponent(weibopic)+"&content=utf-8"+"&ralateUid=6242830109&searchPic=false&style=simple");
195 219
	}
196
	
197

220
	//浏览量
221
	function pageViewsVal() {
222
		$.ajax({
223
			"url": "/ajax/ppaper/incPageViews",
224
			"type": "POST",
225
			"dataType": "json",
226
			"data": {
227
				"id": paperId
228
			},
229
			"success": function(data) {
230
				console.log(data);
231
				if(data.success) {}
232
			},
233
			"error": function() {
234
				$.MsgBox.Alert('提示', '链接服务器超时')
235
			}
236
		});
237
	}
198 238
})

+ 10 - 21
paperShow.html

@ -26,7 +26,7 @@
26 26
					<div class="operateBlock bottomShow" style="margin-top:10px;">
27 27
                		<ul class="clearfix">
28 28
                			<li><span>阅读量</span> <span id="pageView">1000</span></li>
29
                			<li id="attention"><span>收藏</span> <em class="operateicon operateicon2 icon-collect"></em></li>
29
                			<li><span>收藏</span> <em class="operateicon operateicon2 icon-collect" id="collectBtn"></em></li>
30 30
							<li>
31 31
								<span>分享到</span>
32 32
								<a href="" id="weibo" target="_blank"><em class="operateicon operateicon2 icon-sina"></em></a>
@ -65,7 +65,7 @@
65 65
					<div class="form-item aboutPa">
66 66
						<div class="aboutTit">作者</div>
67 67
						<div class="form-result">
68
							<ul class="clearfix" id="aboutAuthors">
68
							<ul class="authorBox clearfix" id="aboutAuthors">
69 69
								<!--<li class="flexCenter">
70 70
									<div class="madiaHead useHead" id="userimg"></div>
71 71
									<div class="madiaInfo">
@ -84,10 +84,10 @@
84 84
											</div>
85 85
										</span>
86 86
									</div>
87
								</li>
88
								<li class="lastBtn">
89
									<div>查看全部作者(<span>6</span>)</div>
90 87
								</li>-->
88
								<li class="lastBtn">
89
									<div>查看全部作者(<span></span>)</div>
90
								</li>
91 91
							</ul>
92 92
						</div>
93 93
					</div>
@ -115,8 +115,8 @@
115 115

116 116
	//分享关注按钮
117 117
	$('.shareWeixin').hover(function(){$(this).find('.shareCode').stop(true,false).fadeToggle();});
118
	$('.goSpan').hover(function(){$(this).find('.shareCode').stop(true,false).fadeToggle();});
119
	
118
//	$('.goSpan').hover(function(){$(this).find('.shareCode').stop(true,false).fadeToggle();});
119

120 120
	//微信分享
121 121
	var qrcode = new QRCode(document.getElementById("qrcode"), {
122 122
		width : 100,
@ -124,23 +124,12 @@
124 124
	});
125 125
	function makeCode(){
126 126
		var hurl = window.location.host;
127
		var resourceId =  GetQueryString("resourceId");
128
		var elurl = "http://" + hurl + "/e/r.html?id=" + resourceId ; 
127
		var paperId =  GetQueryString("paperId");
128
		var elurl = "http://" + hurl + "/e/r.html?id=" + paperId ; 
129 129
		qrcode.makeCode(elurl);
130 130
	}
131 131
	makeCode();
132
	//用户头像
133
//	var qrcodeUser = new QRCode(document.getElementById("qrcodeUser"), {
134
//		width : 100,
135
//		height : 100
136
//	});
137
//	function makeCodeUser(){
138
//		var hurl = window.location.host;
139
//		var professorId =  GetQueryString("professorId");
140
//		var elurl = "http://" + hurl + "/e/p.html?id=" + professorId ; 
141
//		qrcodeUser.makeCodeUser(elurl);
142
//	}
143
//	makeCodeUser();
132

144 133
	
145 134
</script>
146 135
</body>