jack 8 years ago
parent
commit
897a037d4f
2 changed files with 39 additions and 27 deletions
  1. 5 13
      app/html/professorArticle.html
  2. 34 14
      app/js/articleShow.js

+ 5 - 13
app/html/professorArticle.html

9
		<link href="../css/iconfont.css" rel="stylesheet" />
9
		<link href="../css/iconfont.css" rel="stylesheet" />
10
		<link href="../css/app.css" rel="stylesheet" />
10
		<link href="../css/app.css" rel="stylesheet" />
11
		<style>
11
		<style>
12
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;background: #FFFFFF;}
12
			/*html,body{height: 100%;margin:0;padding:0px;overflow: hidden;background: #FFFFFF;}*/
13
			.mui-content{height:100%;overflow: auto;background: #FFFFFF;}
13
			.mui-content{height:100%;overflow: auto;background: #FFFFFF;}
14
		</style>
14
		</style>
15
	</head>
15
	</head>
32
				<div class="mui-col-xs-8">
32
				<div class="mui-col-xs-8">
33
					<div class="inputShow"><span>说点什么吧…</span></div>
33
					<div class="inputShow"><span>说点什么吧…</span></div>
34
				</div>
34
				</div>
35
				<div class="mui-col-xs-1">
35
				<div class="mui-col-xs-1" id="listenClick">
36
					<span class="mui-icon iconfontnew icon-liuyan"><em class="mui-badge"></em></span>
36
					<span class="mui-icon iconfontnew icon-liuyan"><em class="mui-badge"></em></span>
37
				</div>
37
				</div>
38
				<div class="mui-col-xs-2">
38
				<div class="mui-col-xs-2">
56
										<p class="h3Font" id="oTime"></p>
56
										<p class="h3Font" id="oTime"></p>
57
									</div>
57
									</div>
58
					            </div>
58
					            </div>
59
					            <span class="mui-icon attenSpan" id="attBtn">关注</span>
59
					            <span class="mui-icon attenSpan" id="attBtn" style="display:block;">关注</span>
60
					        </li>
60
					        </li>
61
					    </ul>
61
					    </ul>
62
		    		</div>
62
		    		</div>
91
					</div>
91
					</div>
92
					<!--留言-->
92
					<!--留言-->
93
					<div class="madiaBlock mui-scroll">
93
					<div class="madiaBlock mui-scroll">
94
						<div class="madiaTit" id="title">留言</div>
94
						<div class="madiaTit" id="olisten">留言</div>
95
						<ul class="mui-table-view mui-table-view-chevron commentBlock noactiveTab">
95
						<ul class="mui-table-view mui-table-view-chevron commentBlock noactiveTab">
96
					       
96
					       
97
					   </ul>
97
					   </ul>
123
		<script type="text/javascript"> 
123
		<script type="text/javascript"> 
124
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
124
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
125
		    iosheader();
125
		    iosheader();
126
		    mui(".artfoot").on("tap",".inputShow",function(){
127
		    	document.getElementById("textInput").style.display="block";
128
		    	document.getElementById("operCol").style.display="none";
129
		    	document.getElementById("textInputThis").focus();
130
		    })
131
		    mui("body").on("tap",".mui-content",function(){
126
		    mui("body").on("tap",".mui-content",function(){
132
		    	document.getElementById("textInput").style.display="none";
127
		    	document.getElementById("textInput").style.display="none";
133
		    	document.getElementById("operCol").style.display="block";
128
		    	document.getElementById("operCol").style.display="block";
156
		    	this.style.display="none";
151
		    	this.style.display="none";
157
		    	shareBlock.style.display="none";
152
		    	shareBlock.style.display="none";
158
		    })
153
		    })
159
		    liuyanbut.addEventListener("click",function(){
160
		    	var heighttop = document.getElementById("offmsg").offsetTop;
161
		    	document.documentElement.scrollTop = document.body.scrollTop =heighttop; 
162
		    })
154
		   
163
		</script>
155
		</script>
164
		<script type="text/javascript" src="../js/articleShow.js"></script>
156
		<script type="text/javascript" src="../js/articleShow.js"></script>
165
	</body>
157
	</body>

+ 34 - 14
app/js/articleShow.js

33
			timeout: 10000, //超时时间设置为10秒;
33
			timeout: 10000, //超时时间设置为10秒;
34
			traditional: true,
34
			traditional: true,
35
			success: function(data) {
35
			success: function(data) {
36
				console.log(JSON.stringify(data))
36
				if(data.success) {
37
				if(data.success) {
37
					if(af == 1) {
38
					if(af == 1) {
38
						document.getElementsByClassName('commentBlock')[0].innerHTML = ""
39
						document.getElementsByClassName('commentBlock')[0].innerHTML = ""
66
						}
67
						}
67
						var li = document.createElement("li");
68
						var li = document.createElement("li");
68
						li.className = "mui-table-view-cell";
69
						li.className = "mui-table-view-cell";
69
						li.setAttribute("data-id", data.data[i].professor.id)
70
						li.innerHTML = '<div class="flexCenter mui-clearfix">' +
70
						li.innerHTML = '<div class="flexCenter mui-clearfix">' +
71
							'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
71
							'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')" data-id="'+data.data[i].professor.id+'"></div>' +
72
							'<div class="madiaInfo">' +
72
							'<div class="madiaInfo">' +
73
							'<p><span class="h1Font">' + data.data[i].professor.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>' +
73
							'<p><span class="h1Font" data-id="'+data.data[i].professor.id+'">' + data.data[i].professor.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>' +
74
							'</div>' +
74
							'</div>' +
75
							'</div>' +
75
							'</div>' +
76
							'<div class="madiaInfo">' +
76
							'<div class="madiaInfo">' +
83
						document.getElementsByClassName("commentBlock")[0].appendChild(li);
83
						document.getElementsByClassName("commentBlock")[0].appendChild(li);
84
					}
84
					}
85

85

86
				}else{
87
					mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
86
				}
88
				}
87
			},
89
			},
88
			error: function(xhr, type, errorThrown) {
90
			error: function(xhr, type, errorThrown) {
488
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/ralateRes", {
490
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/ralateRes", {
489
		"articleId": oArticleModule.articleId
491
		"articleId": oArticleModule.articleId
490
	}, "get", oArticleModule.correlationResource);
492
	}, "get", oArticleModule.correlationResource);
491
	mui('#expertList,.commentBlock').on('tap', 'li', function() {
493
	mui('#expertList').on('tap', 'li', function() {
494
		var id = this.getAttribute("data-id");
495
		plus.nativeUI.showWaiting(); //显示原生等待框
496
		plus.webview.create("../html/proinforbrow.html", 'proinforbrow.html', {}, {
497
			proid: id
498
		});
499
	})
500
	/*留言*/
501
	mui('.commentBlock').on('tap', '.useHead,.h1Font', function() {
492
		var id = this.getAttribute("data-id");
502
		var id = this.getAttribute("data-id");
493
		plus.nativeUI.showWaiting(); //显示原生等待框
503
		plus.nativeUI.showWaiting(); //显示原生等待框
494
		plus.webview.create("../html/proinforbrow.html", 'proinforbrow.html', {}, {
504
		plus.webview.create("../html/proinforbrow.html", 'proinforbrow.html', {}, {
499
	mui('#resourceList').on('tap', 'li', function() {
509
	mui('#resourceList').on('tap', 'li', function() {
500
		var resouId = this.getAttribute("data-id");
510
		var resouId = this.getAttribute("data-id");
501
		plus.nativeUI.showWaiting();
511
		plus.nativeUI.showWaiting();
502
		plus.webview.create("../html/resinforbrow.html", 'resinforbrow.html', {}, {
512
		plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
503
			resourceId: resouId
513
			resourceId: resouId
504
		});
514
		});
505
	})
515
	})
702
			}
712
			}
703
		});
713
		});
704
	})
714
	})
705

715
		mui(".artfoot").on("tap",".inputShow",function(){
716
			if(!plus.storage.getItem('userid')) {
717
				oCurren.login();
718
				return;
719
			}
720
		    	document.getElementById("textInput").style.display="block";
721
		    	document.getElementById("operCol").style.display="none";
722
		    	document.getElementById("textInputThis").focus();
723
		    })
724
		
725
		
706
	/*微信及微信朋友圈分享专家*/
726
	/*微信及微信朋友圈分享专家*/
707
	var auths, shares;
727
	var auths, shares;
708
	plus.oauth.getServices(function(services) {
728
	plus.oauth.getServices(function(services) {
756
			var share = buildShareService("sinaweibo");
776
			var share = buildShareService("sinaweibo");
757
			if(share) {
777
			if(share) {
758
				shareMessage(share, "sinaweibo", {
778
				shareMessage(share, "sinaweibo", {
759
					content: document.getElementById("articleContent").innerText.substring(0, 70),
760
					title: document.getElementById("articleName").innerHTML,
761
					href: baseUrl + "/ekexiu/shareArticalinfor.html?articleId=" + oArticleModule.articleId,
762
					thumbs: [baseUrl + "/data/article/" + stt + oArticleModule.articleId + "_s.jpg"]
779
					href: "http://www.ekexiu.com",
780
					content: "88",
781
					thumbs: ["http://www.ekexiu.com/images/logo180.png"]
763
				});
782
				});
764
			}
783
			}
765
		}
784
		}
796
			plus.nativeUI.closeWaiting();
815
			plus.nativeUI.closeWaiting();
797
			shareAddIntegral(3);
816
			shareAddIntegral(3);
798
		}, function(e) {
817
		}, function(e) {
818
			console.log(JSON.stringify(e))
799
			plus.nativeUI.closeWaiting();
819
			plus.nativeUI.closeWaiting();
800
			if(e.code == -2) {
820
			if(e.code == -2) {
801
				plus.nativeUI.toast('已取消分享', {
821
				plus.nativeUI.toast('已取消分享', {
804
			}
824
			}
805
		});
825
		});
806
	}
826
	}
807
	/*定位*/
808
	document.querySelector(".icon-liuyan").onclick = function() {
809
		window.location.href = "#title";
810
	}
827
	document.getElementById("listenClick").addEventListener("tap",function(){
828
				mui.scrollTo(document.getElementById("olisten").offsetTop,1000);
829
				
830
			})
811
});
831
});