浏览代码

论文专利

luyanan 7 年之前
父节点
当前提交
e808c20bfb
共有 4 个文件被更改,包括 802 次插入23 次删除
  1. 15 23
      app/html/paperShow.html
  2. 144 0
      app/html/patentShow.html
  3. 319 0
      app/js/paperShow.js
  4. 324 0
      app/js/patentShow.js

+ 15 - 23
app/html/paperShow.html

@ -19,13 +19,13 @@
19 19
		<div class="maskBlack" id="maskBlack"></div>
20 20
		<header class="mui-bar mui-bar-nav toptitbox">
21 21
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
22
			<h1 class="mui-title toptit" id="resourceTit"></h1>
22
			<h1 class="mui-title toptit" id="paperTit"></h1>
23 23
			<a class="mui-icon iconfont icon-moreandroid mui-pull-right button topmore" id="BtnMore"></a>
24 24
		</header>
25 25
		<nav class="mui-bar mui-bar-tab footbox">
26 26
			<div class="mui-row artfoot">
27 27
				<div class="mui-col-xs-9">
28
					<div class="consultdiv">更多功能即将开放</div>
28
					<div class="consultdiv notopen">更多功能即将开放</div>
29 29
				</div>
30 30
				<div class="mui-col-xs-2" id="collectBtn">
31 31
					<span class="mui-icon iconfontnew icon-shoucang" id="ifCollect"></span><!--已收藏 icon-yishoucang-->
@ -37,51 +37,43 @@
37 37
		</nav>
38 38
		<div class="mui-content">
39 39
		    <div class="showDetail">
40
	    		<div class="h1Font hWeight" id="resourceName">论文名称</div>
40
	    		<div class="h1Font hWeight" id="paperName"></div>
41 41
		    	<!--内容区-->
42 42
				<div class="showMain showMainP">
43 43
					<ul>
44 44
						<li>
45
							<div class="showTit">期刊:<span class="showCon" id="paperJournal">gfsdddddddddg</span></div>
45
							<div class="showTit">期刊:<span class="showCon" id="paperJournal"></span></div>
46 46
						</li>
47 47
						<li>
48
							<div class="showTit">期卷:<span class="showCon" id="paperVolume">cvxbdger</span></div>
48
							<div class="showTit">期卷:<span class="showCon" id="paperVolume"></span></div>
49 49
						</li>
50 50
						<li>
51 51
							<div class="showTit">摘要:</div>
52 52
							<div class="showCon" id="paperAbstract">
53
								梵蒂冈沙发革热台个人塌方人生观是大法官梵蒂冈沙发革热台个人塌方人生观是大法官梵蒂冈沙发革热台个人塌方人生观是大法官
53
								
54 54
							</div>
55 55
						</li>
56 56
					</ul>
57 57
				</div>
58 58
	    		<!--标签模块-->
59 59
				<ul class="tagList">
60
					<li>
61
						<span class="h2Font">标签一</span>
62
					</li>
60
					<!--<li>
61
						<span class="h2Font">标签一</span>
62
					</li>-->
63 63
				</ul>
64 64
				<div class="madiaBlock">
65 65
					<div class="madiaTit">作者</div>
66
					<ul class="mui-table-view">
67
				        <li class="mui-table-view-cell">
66
					<ul class="mui-table-view" id="aboutAuthors">
67
				        <!--<li class="mui-table-view-cell">
68 68
				            <div class="flexCenter mui-clearfix">
69 69
				                <div class="madiaHead useHead"></div>
70 70
								<div class="madiaInfo">
71 71
									<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
72
									<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
72
									<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
73 73
								</div>
74 74
				            </div>
75
				        </li>
76
				        <li class="mui-table-view-cell">
77
				            <div class="flexCenter mui-clearfix">
78
				                <div class="madiaHead useHead"></div>
79
								<div class="madiaInfo">
80
									<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
81
									<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
82
								</div>
83
				            </div>
84
				        </li>
75
				        </li>-->
76
				        
85 77
				    </ul>
86 78
				</div>
87 79
		    </div>
@ -109,7 +101,7 @@
109 101
		<script src="../js/public/mui.zoom.js" type="text/javascript" charset="utf-8"></script>
110 102
		<script src="../js/public/mui.previewimage.js" type="text/javascript" charset="utf-8"></script>
111 103
		<script src="../js/public/base.js"></script>
112
		<script src="../js/resourceShow.js"></script>
104
		<script src="../js/paperShow.js"></script>
113 105
		<script type="text/javascript"> 
114 106
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
115 107
		    iosheader();

+ 144 - 0
app/html/patentShow.html

@ -0,0 +1,144 @@
1
<!DOCTYPE html>
2
<html>
3
4
	<head>
5
		<meta charset="UTF-8">
6
		<title>论文浏览-科袖</title>
7
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8
		<link href="../css/mui.min.css" rel="stylesheet" />
9
		<link href="../css/previewImage.css" rel="stylesheet" type="text/css" />
10
		<link href="../css/iconfont.css" rel="stylesheet" />
11
		<link href="../css/app.css" rel="stylesheet" />
12
		<style>
13
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;background: #FFFFFF;}
14
			.mui-content{height:100%;overflow: auto;background: #FFFFFF;}
15
		</style>
16
	</head>
17
18
	<body>
19
		<div class="maskBlack" id="maskBlack"></div>
20
		<header class="mui-bar mui-bar-nav toptitbox">
21
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
22
			<h1 class="mui-title toptit" id="patentTit"></h1>
23
			<a class="mui-icon iconfont icon-moreandroid mui-pull-right button topmore" id="BtnMore"></a>
24
		</header>
25
		<nav class="mui-bar mui-bar-tab footbox">
26
			<div class="mui-row artfoot">
27
				<div class="mui-col-xs-9">
28
					<div class="consultdiv notopen">更多功能即将开放</div>
29
				</div>
30
				<div class="mui-col-xs-2" id="collectBtn">
31
					<span class="mui-icon iconfontnew icon-shoucang" id="ifCollect"></span><!--已收藏 icon-yishoucang-->
32
				</div>
33
				<div class="mui-col-xs-1" id="shareOut">
34
					<span class="mui-icon iconfontnew icon-fenxiang"></span>
35
				</div>
36
			</div>
37
		</nav>
38
		<div class="mui-content">
39
		    <div class="showDetail">
40
	    		<div class="h1Font hWeight" id="patentName"></div>
41
		    	<!--内容区-->
42
				<div class="showMain showMainP">
43
					<ul>
44
						<li>
45
							<div class="showTit">专利号:<span class="showCon" id="Znum1"></span></div>
46
						</li>
47
						<li>
48
							<div class="showTit">公开日:<span class="showCon" id="Znum2"></span></div>
49
						</li>
50
						<li>
51
							<div class="showTit">申请日:<span class="showCon" id="Znum3"></span></div>
52
						</li>
53
						<li>
54
							<div class="showTit">申请号:<span class="showCon" id="Znum4"></span></div>
55
						</li>
56
						<li>
57
							<div class="showTit">申请人:<span class="showCon" id="Znum5"></span></div>
58
						</li>
59
						<li>
60
							<div class="showTit">摘要:</div>
61
							<div class="showCon" id="patentAbstract">
62
								
63
							</div>
64
						</li>
65
					</ul>
66
				</div>
67
	    		<!--标签模块-->
68
				<ul class="tagList">
69
					<!--<li>
70
						<span class="h2Font">标签一</span>
71
					</li>-->
72
				</ul>
73
				<div class="madiaBlock">
74
					<div class="madiaTit">发明人</div>
75
					<ul class="mui-table-view" id="aboutAuthors">
76
				        <!--<li class="mui-table-view-cell">
77
				            <div class="flexCenter mui-clearfix">
78
				                <div class="madiaHead useHead"></div>
79
								<div class="madiaInfo">
80
									<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
81
									<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
82
								</div>
83
				            </div>
84
				        </li>-->
85
				        
86
				    </ul>
87
				</div>
88
		    </div>
89
		</div>
90
		
91
		<div class="shareBlock" id="shareBlock">
92
			<h2 class="shareTit"><span>分享到</span></h2>
93
			<ul class="mui-table-view noactiveTab">
94
				<li class="mui-table-view-cell">
95
					<em class="wayicon wechaticon"></em>
96
					<span>微信好友</span>
97
				</li>
98
				<li class="mui-table-view-cell">
99
					<em class="wayicon friendstericon"></em>
100
					<span>微信朋友圈</span>
101
				</li>
102
				<li class="mui-table-view-cell">
103
					<em class="wayicon sinaicon"></em>
104
					<span>新浪微博</span>
105
				</li>
106
			</ul>
107
			<button type="button" class="mui-btn mui-btn-block" id="cancelShare">取消</button>
108
		</div>
109
		<script src="../js/public/mui.min.js"></script>
110
		<script src="../js/public/mui.zoom.js" type="text/javascript" charset="utf-8"></script>
111
		<script src="../js/public/mui.previewimage.js" type="text/javascript" charset="utf-8"></script>
112
		<script src="../js/public/base.js"></script>
113
		<script src="../js/patentShow.js"></script>
114
		<script type="text/javascript"> 
115
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
116
		    iosheader();
117
		    
118
		    var BtnMore=document.getElementById("BtnMore");
119
		    var shareOut=document.getElementById("shareOut");
120
		    var cancelShare=document.getElementById("cancelShare");
121
		    var maskBlack=document.getElementById("maskBlack");
122
		    var shareBlock=document.getElementById("shareBlock");
123
		    
124
		    
125
		    BtnMore.addEventListener("tap",function(){
126
		    	maskBlack.style.display="block";
127
		    	shareBlock.style.display="block";
128
		    })
129
		    shareOut.addEventListener("tap",function(){
130
		    	maskBlack.style.display="block";
131
		    	shareBlock.style.display="block";
132
		    })
133
		    cancelShare.addEventListener("tap",function(){
134
		    	maskBlack.style.display="none";
135
		    	shareBlock.style.display="none";
136
		    })
137
		    maskBlack.addEventListener("tap",function(){
138
		    	this.style.display="none";
139
		    	shareBlock.style.display="none";
140
		    })
141
		</script>
142
	</body>
143
144
</html>

+ 319 - 0
app/js/paperShow.js

@ -0,0 +1,319 @@
1
var ocollectBtn = document.getElementById("collectBtn"); //收藏按钮
2

3
var paperId;
4
mui.plusReady(function() {
5
	var userid = plus.storage.getItem('userid');
6
	var self = plus.webview.currentWebview();
7
	paperId = self.paperId;
8
	//paperId="FF6EFFA4D7474CC7B808D9BC08E88E79";
9
	getRecourceMe();/*获取资源信息*/
10
	//关键词标签点击进去搜索
11
	mui(".tagList").on("tap","li",function(){
12
		var tagText = this.getElementsByTagName("span")[0].innerText;
13
		 plus.nativeUI.showWaiting();
14
		var web = plus.webview.create("../html/searchListNew.html", "../html/searchListNew.html", {}, {
15
			key: tagText,
16
			qiFlag: 5
17
		}); 
18
	})
19
	//点击收藏按钮
20
	ifcollectionAbout(paperId,5);
21
	ocollectBtn.addEventListener('tap', function() {
22
		if(userid && userid != null && userid != "null") {
23
			if(document.getElementById("ifCollect").className=='mui-icon iconfontnew icon-yishoucang'){
24
				cancelCollectionAbout(paperId,5)
25
			} else {
26
				collectionAbout(paperId,5);
27
			}
28
		}else{
29
			isLogin();
30
		}
31
	});
32
	
33
	
34
	mui.ajax(baseUrl + '/ajax/ppaper/incPageViews',{
35
			"type": "POST",
36
			"dataType": "json",
37
			"data": {
38
				"id": paperId
39
			},
40
			"success": function(data) {
41
				if(data.success) {}
42
			},
43
			"error": function() {
44
				
45
			}
46
		});
47
	function getRecourceMe() {
48
		mui.plusReady(function() {
49
			mui.ajax(baseUrl + '/ajax/ppaper/qo', {
50
				data: {
51
					"id": paperId
52
				},
53
				dataType: 'json', //服务器返回json格式数据
54
				type: 'get', //HTTP请求类型
55
				timeout: 10000, //超时时间设置为10秒;
56
				success: function(data) {
57
					if(data.success) {
58
						console.log(JSON.stringify(data))
59
						paperHtml(data.data);
60
						getPaperAuthors(data.data.id)
61
						
62
						plus.nativeUI.closeWaiting();
63
						plus.webview.currentWebview().show("slide-in-right", 150);
64
					}
65
				},
66
				error: function(xhr, type, errorThrown) {
67
					plus.nativeUI.toast("服务器链接超时", toastStyle);
68
				}
69
			});
70
		})
71
	}
72
	function paperHtml($da) {
73
		document.getElementById("paperTit").innerHTML = $da.name;
74
		document.getElementById("paperName").innerHTML = $da.name; //名字
75
		document.getElementById("paperAbstract").innerHTML = $da.summary; //摘要内容
76
		if(!$da.cn4periodical){
77
			$da.cn4periodical=""
78
		}
79
		if(!$da.en4periodical){
80
			$da.en4periodical=""
81
		}
82
		if(!$da.cn4periodical && !$da.en4periodical){
83
			document.getElementById("paperJournal").parentNode.parentNode.style.display="none";
84
		}else{
85
			document.getElementById("paperJournal").innerHTML = $da.cn4periodical + $da.en4periodical;
86
		}
87
88
		if(!$da.pubDay){
89
			document.getElementById("paperVolume").parentNode.parentNode.style.display="none";
90
		}else{
91
			document.getElementById("paperVolume").innerHTML = $da.pubDay;
92
		}
93
		if($da.keywords != undefined && $da.keywords.length != 0 ){
94
			var subs = new Array();
95
			if($da.keywords.indexOf(',')){
96
				subs = $da.keywords.split(',');
97
			}else{
98
				subs[0] = $da.keywords;
99
			}
100
			var pstr=""
101
			if(subs.length>0){
102
				for (var i = 0; i < subs.length; i++) 
103
				{
104
					pstr+='<li><span class="h2Font">'+ subs[i] +'</span></li>'
105
				};
106
				document.getElementsByClassName(".tagList")[0].innerHTML= pstr;
107
			}else{
108
				document.getElementsByClassName(".tagList")[0].style.display="none";
109
			}
110
		}		
111
	}
112
	/*获取论文作者信息*/
113
	function getPaperAuthors(stritrm) {
114
		mui.ajax(baseUrl +"/ajax/ppaper/authors",{
115
			"type": "GET",
116
			"success": function(data) {
117
				if(data.success) {
118
					if(data.data.length>0){
119
						for(var i=0;i<data.data.length;i++){
120
							var authTy="",authTit="",baseInfo="",imgbg="../images/default-photo.jpg";
121
							if(data.data[i].professorId.substring(0, 1) != "#"){
122
								mui.ajax(baseUrl +"/ajax/professor/editBaseInfo/" + data.data[i].professorId,{
123
									type:"get",
124
									async:true,
125
									success:function($proData){
126
										console.log(JSON.stringify($proData))
127
										if($proData.success){
128
											var showPro = $proData.data;
129
											if(showPro.hasHeadImage == 1) {
130
												imgbg = "/images/head/" + showPro.id + "_l.jpg";
131
											} else {
132
												imgbg = "../images/default-photo.jpg";
133
											}
134
											//认证
135
											var oSty = autho(showPro.authType,showPro.orgAuth,showPro.authStatus);
136
											authTy = oSty.sty;
137
											authTit = oSty.title;
138
											
139
											var title = showPro.title || "";
140
											var orgName = showPro.orgName || "";
141
											var office = showPro.office || "";
142
											if(orgName!=""){
143
												if(title != "") {
144
													baseInfo = title + "," + orgName;
145
												}else{
146
													if(office!=""){
147
														baseInfo = office  + "," + orgName;	
148
													}else{
149
														baseInfo = orgName;	
150
													}
151
												}
152
											}else{
153
												if(title != "") {
154
													baseInfo = title;
155
												}else{
156
													if(office!=""){
157
														baseInfo = office;	
158
													}else{
159
														baseInfo = "";	
160
													}
161
												}
162
											}
163
											var liItem = document.createElement("li");
164
											liItem.setAttribute("data-id",showPro.id);
165
											liItem.className = "mui-table-view-cell"
166
											var oString = '<div class="flexCenter mui-clearfix">'
167
											oString += '<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
168
											oString += '<div class="madiaInfo"><p><span class="h1Font">'+ showPro.name +'</span><em class="authicon '+ authTy +'" title="'+ authTit +'"></em></p>'
169
											oString += '<p class="mui-ellipsis h2Font">'+ baseInfo +'</p>'
170
											oString += '</div></div>'
171
											liItem.innerHTML = oString;
172
											document.getElementById("aboutAuthors").appendChild(liItem);
173
										}
174
									}
175
								})
176
							}else{
177
								var liItem = document.createElement("li");
178
								liItem.setAttribute("data-id",data.data[i].professorId);
179
								liItem.className = "mui-table-view-cell"
180
								var oString = '<div class="flexCenter mui-clearfix">'
181
								oString += '<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
182
								oString += '<div class="madiaInfo"><p><span class="h1Font">'+ data.data[i].name  +'</span></p>'
183
								oString += '</div></div>'
184
								liItem.innerHTML = oString;
185
								document.getElementById("aboutAuthors").appendChild(liItem);
186
							}
187
							
188
						}
189
					}
190
				}
191
			},
192
			"data": {
193
				"id": stritrm
194
			},
195
			dataType: "json",
196
			'error': function(xhr, type, errorThrown) {
197
					plus.nativeUI.toast("服务器链接超时", toastStyle);
198
				}
199
		});
200
	}
201
	
202
	//判断是否登录,登录才可咨询,关注,收藏
203
	function isLogin() {
204
		var userid = plus.storage.getItem('userid');
205
         if(userid==null || userid=='null'|userid == undefined |userid == 'undefined'){
206
			mui.openWindow({
207
				url: '../html/login.html',
208
				id: 'login.html'
209
			})
210
		}
211
	};
212
	
213
   /*微信及微信朋友圈分享专家*/
214
	var auths, shares;
215
	plus.oauth.getServices(function(services) {
216
		auths = {};
217
		for(var i in services) {
218
			var t = services[i];
219
			auths[t.id] = t;
220
221
		}
222
	}, function(e) {
223
		alert("获取登录服务列表失败:" + e.message + " - " + e.code);
224
	});
225
	plus.share.getServices(function(services) {
226
227
		shares = {};
228
		for(var i in services) {
229
230
			var t = services[i];
231
232
			shares[t.id] = t;
233
234
		}
235
	}, function(e) {
236
		alert("获取分享服务列表失败:" + e.message + " - " + e.code);
237
	});
238
	mui("#shareBlock").on("tap", "li", function() {
239
		document.getElementById("shareBlock").style.display = "none";
240
		document.getElementById("maskBlack").style.display = "none";
241
		var oFen = this.getElementsByTagName("span")[0].innerHTML;
242
243
		var oUrl=baseUrl + "/images/logo180.png";
244
		
245
		if(oFen == "微信好友") {
246
			var share = buildShareService("weixin");
247
			if(share) {
248
				shareMessage(share, "WXSceneSession", {
249
					content: document.getElementById("paperAbstract").innerHTML.substring(0,20),
250
					title: document.getElementById("paperName").innerHTML,
251
					href: baseUrl + "/e/l.html?id=" + paperId ,
252
					thumbs: [oUrl]
253
				});
254
			}
255
		} else if(oFen == "微信朋友圈") {
256
			var share = buildShareService("weixin");
257
			if(share) {
258
				shareMessage(share, "WXSceneTimeline", {
259
					content: document.getElementById("paperAbstract").innerHTML.substring(0,20),
260
					title: document.getElementById("paperName").innerHTML,
261
					href: baseUrl + "/e/l.html?id=" + paperId ,
262
					thumbs: [oUrl]
263
				});
264
			}
265
		} else if(oFen == "新浪微博") {
266
			var share = buildShareService("sinaweibo");
267
			if(share) {
268
				shareMessage(share, "sinaweibo", {
269
					content: document.getElementById("paperName").innerHTML+ baseUrl + "/e/l.html?id=" + paperId ,
270
				});
271
			}
272
		}
273
274
	})
275
276
	function buildShareService(ttt) {
277
		var share = shares[ttt];
278
		if(share) {
279
			if(share.authenticated) {
280
				console.log("---已授权---");
281
			} else {
282
				console.log("---未授权---");
283
				share.authorize(function() {
284
					console.log('授权成功...')
285
				}, function(e) {
286
					alert("认证授权失败:" + e.code + " - " + e.message);
287
					return null;
288
				});
289
			}
290
			return share;
291
		} else {
292
			alert("没有获取微信分享服务");
293
			return null;
294
		}
295
296
	}
297
298
	function shareMessage(share, ex, msg) {
299
		msg.extra = {
300
			scene: ex
301
		};
302
		share.send(msg, function() {
303
			plus.nativeUI.closeWaiting();
304
			if(plus.storage.getItem('userid')) {
305
				shareAddIntegral(2);
306
			}
307
		}, function(e) {
308
			plus.nativeUI.closeWaiting();
309
			if(e.code == -2) {
310
				plus.nativeUI.toast('已取消分享', {
311
					verticalAlign: 'center'
312
				});
313
			}
314
		});
315
	}
316
317
	/*图像预览*/
318
	mui.previewImage();
319
});

+ 324 - 0
app/js/patentShow.js

@ -0,0 +1,324 @@
1
var ocollectBtn = document.getElementById("collectBtn"); //收藏按钮
2

3
var patentId;
4
mui.plusReady(function() {
5
	var userid = plus.storage.getItem('userid');
6
	var self = plus.webview.currentWebview();
7
	patentId = self.patentId;
8
	//patentId="FE95F18DDCFA4E64BF62C014D67E95FB";
9
	getRecourceMe();/*获取资源信息*/
10
	//关键词标签点击进去搜索
11
	mui(".tagList").on("tap","li",function(){
12
		var tagText = this.getElementsByTagName("span")[0].innerText;
13
		 plus.nativeUI.showWaiting();
14
		var web = plus.webview.create("../html/searchListNew.html", "../html/searchListNew.html", {}, {
15
			key: tagText,
16
			qiFlag: 4
17
		}); 
18
	})
19
	//点击收藏按钮
20
	ifcollectionAbout(patentId,4);
21
	ocollectBtn.addEventListener('tap', function() {
22
		if(userid && userid != null && userid != "null") {
23
			if(document.getElementById("ifCollect").className=='mui-icon iconfontnew icon-yishoucang'){
24
				cancelCollectionAbout(patentId,4)
25
			} else {
26
				collectionAbout(patentId,4);
27
			}
28
		}else{
29
			isLogin();
30
		}
31
	});
32
	
33
	
34
	mui.ajax(baseUrl + '/ajax/ppatent/incPageViews',{
35
			"type": "POST",
36
			"dataType": "json",
37
			"data": {
38
				"id": patentId
39
			},
40
			"success": function(data) {
41
				if(data.success) {}
42
			},
43
			"error": function() {
44
				
45
			}
46
		});
47
	function getRecourceMe() {
48
		mui.plusReady(function() {
49
			mui.ajax(baseUrl + '/ajax/ppatent/qo', {
50
				data: {
51
					"id": patentId
52
				},
53
				dataType: 'json', //服务器返回json格式数据
54
				type: 'get', //HTTP请求类型
55
				timeout: 10000, //超时时间设置为10秒;
56
				success: function(data) {
57
					if(data.success) {
58
						console.log(JSON.stringify(data))
59
						patentHtml(data.data);
60
						getpatentAuthors(data.data.id)
61
						
62
						plus.nativeUI.closeWaiting();
63
						plus.webview.currentWebview().show("slide-in-right", 150);
64
					}
65
				},
66
				error: function(xhr, type, errorThrown) {
67
					plus.nativeUI.toast("服务器链接超时", toastStyle);
68
				}
69
			});
70
		})
71
	}
72
	function patentHtml($da) {
73
		document.getElementById("patentTit").innerHTML = $da.name;
74
		document.getElementById("patentName").innerHTML = $da.name; //名字
75
		document.getElementById("patentAbstract").innerHTML = $da.summary; //摘要内容
76
		document.getElementById("Znum1").innerHTML = $da.code;//专利号
77
		if($da.pubDay){
78
			document.getElementById("Znum2").innerHTML = TimeTr($da.pubDay);
79
		}else{
80
			document.getElementById("Znum2").parentNode.parentNode.style.display="none";
81
		}
82
		if($da.reqCode){
83
			document.getElementById("Znum4").innerHTML = $da.reqCode;
84
		}else{
85
			document.getElementById("Znum4").parentNode.parentNode.style.display="none";
86
		}
87
		if($da.reqDay){
88
			document.getElementById("Znum3").innerHTML =  TimeTr($da.reqDay);
89
		}else{
90
			document.getElementById("Znum3").parentNode.parentNode.style.display="none";
91
		}
92
		if($da.reqDay){
93
			document.getElementById("Znum5").innerHTML = $da.reqPerson;
94
		}else{
95
			document.getElementById("Znum5").parentNode.parentNode.style.display="none";
96
		}
97
		
98
		if($da.keywords != undefined && $da.keywords.length != 0 ){
99
			var subs = new Array();
100
			if($da.keywords.indexOf(',')){
101
				subs = $da.keywords.split(',');
102
			}else{
103
				subs[0] = $da.keywords;
104
			}
105
			var pstr=""
106
			if(subs.length>0){
107
				for (var i = 0; i < subs.length; i++) 
108
				{
109
					pstr+='<li><span class="h2Font">'+ subs[i] +'</span></li>'
110
				};
111
				document.getElementsByClassName(".tagList")[0].innerHTML= pstr;
112
			}else{
113
				document.getElementsByClassName(".tagList")[0].style.display="none";
114
			}
115
		}		
116
	}
117
	/*获取论文作者信息*/
118
	function getpatentAuthors(stritrm) {
119
		mui.ajax(baseUrl +"/ajax/ppatent/authors",{
120
			"type": "GET",
121
			"success": function(data) {
122
				if(data.success) {
123
					if(data.data.length>0){
124
						for(var i=0;i<data.data.length;i++){
125
							var authTy="",authTit="",baseInfo="",imgbg="../images/default-photo.jpg";
126
							if(data.data[i].professorId.substring(0, 1) != "#"){
127
								$.ajax(baseUrl +"/ajax/professor/editBaseInfo/" + data.data[i].professorId,{
128
									type:"get",
129
									async:true,
130
									success:function($proData){
131
										console.log(JSON.stringify($proData))
132
										if($proData.success){
133
											var showPro = $proData.data;
134
											if(showPro.hasHeadImage == 1) {
135
												imgbg = "/images/head/" + showPro.id + "_l.jpg";
136
											} else {
137
												imgbg = "../images/default-photo.jpg";
138
											}
139
											//认证
140
											var oSty = autho(showPro.authType,showPro.orgAuth,showPro.authStatus);
141
											authTy = oSty.sty;
142
											authTit = oSty.title;
143
											
144
											var title = showPro.title || "";
145
											var orgName = showPro.orgName || "";
146
											var office = showPro.office || "";
147
											if(orgName!=""){
148
												if(title != "") {
149
													baseInfo = title + "," + orgName;
150
												}else{
151
													if(office!=""){
152
														baseInfo = office  + "," + orgName;	
153
													}else{
154
														baseInfo = orgName;	
155
													}
156
												}
157
											}else{
158
												if(title != "") {
159
													baseInfo = title;
160
												}else{
161
													if(office!=""){
162
														baseInfo = office;	
163
													}else{
164
														baseInfo = "";	
165
													}
166
												}
167
											}
168
											var liItem = document.createElement("li");
169
											liItem.setAttribute("data-id",showPro.id);
170
											liItem.className = "mui-table-view-cell"
171
											var oString = '<div class="flexCenter mui-clearfix">'
172
											oString += '<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
173
											oString += '<div class="madiaInfo"><p><span class="h1Font">'+ showPro.name +'</span><em class="authicon '+ authTy +'" title="'+ authTit +'"></em></p>'
174
											oString += '<p class="mui-ellipsis h2Font">'+ baseInfo +'</p>'
175
											oString += '</div></div>'
176
											liItem.innerHTML = oString;
177
											document.getElementById("aboutAuthors").appendChild(liItem);
178
										}
179
									}
180
								})
181
							}else{
182
								var liItem = document.createElement("li");
183
								liItem.setAttribute("data-id",data.data[i].professorId);
184
								liItem.className = "mui-table-view-cell"
185
								var oString = '<div class="flexCenter mui-clearfix">'
186
								oString += '<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
187
								oString += '<div class="madiaInfo"><p><span class="h1Font">'+ data.data[i].name  +'</span></p>'
188
								oString += '</div></div>'
189
								liItem.innerHTML = oString;
190
								document.getElementById("aboutAuthors").appendChild(liItem);
191
							}
192
							
193
						}
194
					}
195
				}
196
			},
197
			"data": {
198
				"id": stritrm
199
			},
200
			dataType: "json",
201
			'error': function(xhr, type, errorThrown) {
202
					plus.nativeUI.toast("服务器链接超时", toastStyle);
203
				}
204
		});
205
	}
206
	
207
	//判断是否登录,登录才可咨询,关注,收藏
208
	function isLogin() {
209
		var userid = plus.storage.getItem('userid');
210
         if(userid==null || userid=='null'|userid == undefined |userid == 'undefined'){
211
			mui.openWindow({
212
				url: '../html/login.html',
213
				id: 'login.html'
214
			})
215
		}
216
	};
217
	
218
   /*微信及微信朋友圈分享专家*/
219
	var auths, shares;
220
	plus.oauth.getServices(function(services) {
221
		auths = {};
222
		for(var i in services) {
223
			var t = services[i];
224
			auths[t.id] = t;
225
226
		}
227
	}, function(e) {
228
		alert("获取登录服务列表失败:" + e.message + " - " + e.code);
229
	});
230
	plus.share.getServices(function(services) {
231
232
		shares = {};
233
		for(var i in services) {
234
235
			var t = services[i];
236
237
			shares[t.id] = t;
238
239
		}
240
	}, function(e) {
241
		alert("获取分享服务列表失败:" + e.message + " - " + e.code);
242
	});
243
	mui("#shareBlock").on("tap", "li", function() {
244
		document.getElementById("shareBlock").style.display = "none";
245
		document.getElementById("maskBlack").style.display = "none";
246
		var oFen = this.getElementsByTagName("span")[0].innerHTML;
247
248
		var oUrl=baseUrl + "/images/logo180.png";
249
		
250
		if(oFen == "微信好友") {
251
			var share = buildShareService("weixin");
252
			if(share) {
253
				shareMessage(share, "WXSceneSession", {
254
					content: document.getElementById("patentAbstract").innerHTML.substring(0,20),
255
					title: document.getElementById("patentName").innerHTML,
256
					href: baseUrl + "/e/z.html?id=" + patentId ,
257
					thumbs: [oUrl]
258
				});
259
			}
260
		} else if(oFen == "微信朋友圈") {
261
			var share = buildShareService("weixin");
262
			if(share) {
263
				shareMessage(share, "WXSceneTimeline", {
264
					content: document.getElementById("patentAbstract").innerHTML.substring(0,20),
265
					title: document.getElementById("patentName").innerHTML,
266
					href: baseUrl + "/e/z.html?id=" + patentId ,
267
					thumbs: [oUrl]
268
				});
269
			}
270
		} else if(oFen == "新浪微博") {
271
			var share = buildShareService("sinaweibo");
272
			if(share) {
273
				shareMessage(share, "sinaweibo", {
274
					content: document.getElementById("patentName").innerHTML+ baseUrl + "/e/z.html?id=" + patentId ,
275
				});
276
			}
277
		}
278
279
	})
280
281
	function buildShareService(ttt) {
282
		var share = shares[ttt];
283
		if(share) {
284
			if(share.authenticated) {
285
				console.log("---已授权---");
286
			} else {
287
				console.log("---未授权---");
288
				share.authorize(function() {
289
					console.log('授权成功...')
290
				}, function(e) {
291
					alert("认证授权失败:" + e.code + " - " + e.message);
292
					return null;
293
				});
294
			}
295
			return share;
296
		} else {
297
			alert("没有获取微信分享服务");
298
			return null;
299
		}
300
301
	}
302
303
	function shareMessage(share, ex, msg) {
304
		msg.extra = {
305
			scene: ex
306
		};
307
		share.send(msg, function() {
308
			plus.nativeUI.closeWaiting();
309
			if(plus.storage.getItem('userid')) {
310
				shareAddIntegral(2);
311
			}
312
		}, function(e) {
313
			plus.nativeUI.closeWaiting();
314
			if(e.code == -2) {
315
				plus.nativeUI.toast('已取消分享', {
316
					verticalAlign: 'center'
317
				});
318
			}
319
		});
320
	}
321
322
	/*图像预览*/
323
	mui.previewImage();
324
});