Browse Source

服务添加浏览量

luyanan 7 years ago
parent
commit
18676e38b2
4 changed files with 41 additions and 132 deletions
  1. 31 49
      js/sevriceShow.js
  2. 7 78
      js/userInforShow.js
  3. 0 1
      sevricePreview.html
  4. 3 4
      sevriceShow.html

+ 31 - 49
js/sevriceShow.js

@ -33,6 +33,7 @@ $(document).ready(function() {
33 33
		});
34 34
	}
35 35
	ifcollectionAbout(sevriceId, $("#attention").find("em"), 2)
36
	pageViewLog(sevriceId,10)
36 37
	var professorId = "";
37 38
	getRecourceMe();
38 39
	relatedArticles();
@ -117,7 +118,9 @@ $(document).ready(function() {
117 118
		}else{
118 119
			$("#application").parent().hide();
119 120
		}
120
		
121
		if($da.pageViews>0){
122
			$("#pageView").html($da.pageViews)
123
		}
121 124
		if($da.category == 1) {
122 125
			ajaxRequist("/ajax/professor/baseInfo/" + $da.owner, {}, "get", function(data) {
123 126
				$da.editProfessor = data.data;
@ -195,39 +198,36 @@ $(document).ready(function() {
195 198
		}
196 199
		var weibotitle = $da.name;
197 200
		var weibourl = window.location.href;
198
		//return;
199 201
		if($da.images) {
200
			
202
			if($da.images.split(",").length) {
203
				var weibopic = "http://" + window.location.host + "/data/ware" + $da.images.split(",")[0];
204
				$("#firstFigure").attr({
205
					"src": "/data/ware" + $da.images.split(",")[0],
206
					"rel": "/data/ware" + $da.images.split(",")[0]
207
				}).parent().attr("href", "/data/ware" + $da.images.split(",")[0]);
208
				var arr = "";
209
				for(var i = 0; i < $da.images.split(",").length; i++) {
210
					if($da.images.split(",")[i] == $da.images.split(",")[0]) {
211
						var oString = '<li class="tb-selected">' +
212
							'<div class="tb-pic tb-s66">' +
213
							'<a href="javascript:void(0);">' +
214
							'<img src="/data/ware' + $da.images.split(",")[i] + '"/>' +
215
							'</a>' +
216
							'</div>' +
217
							'</li>'
218
					} else {
219
						var oString = '<li >' +
220
							'<div class="tb-pic tb-s66">' +
221
							'<a href="javascript:void(0);">' +
222
							'<img src="/data/ware' + $da.images.split(",")[i] + '"/>' +
223
							'</a>' +
224
							'</div>' +
225
							'</li>'
226
					}
201 227
		
202
		if($da.images.split(",").length) {
203
			var weibopic = "http://" + window.location.host + "/data/ware" + $da.images.split(",")[0];
204
			$("#firstFigure").attr({
205
				"src": "/data/ware" + $da.images.split(",")[0],
206
				"rel": "/data/ware" + $da.images.split(",")[0]
207
			}).parent().attr("href", "/data/ware" + $da.images.split(",")[0]);
208
			var arr = "";
209
			for(var i = 0; i < $da.images.split(",").length; i++) {
210
				if($da.images.split(",")[i] == $da.images.split(",")[0]) {
211
					var oString = '<li class="tb-selected">' +
212
						'<div class="tb-pic tb-s66">' +
213
						'<a href="javascript:void(0);">' +
214
						'<img src="/data/ware' + $da.images.split(",")[i] + '"/>' +
215
						'</a>' +
216
						'</div>' +
217
						'</li>'
218
				} else {
219
					var oString = '<li >' +
220
						'<div class="tb-pic tb-s66">' +
221
						'<a href="javascript:void(0);">' +
222
						'<img src="/data/ware' + $da.images.split(",")[i] + '"/>' +
223
						'</a>' +
224
						'</div>' +
225
						'</li>'
228
					arr += oString;
226 229
				}
227

228
				arr += oString;
229
			}
230
			$("#thumblist").html(arr);
230
				$("#thumblist").html(arr);
231 231
			}
232 232
		} else {
233 233
			var weibopic = "http://" + window.location.host + "../images/default-service.jpg";
@ -556,24 +556,6 @@ $(document).ready(function() {
556 556
		}
557 557
	})
558 558

559
	//服务浏览量
560
	function pageViewsVal() {
561
		$.ajax({
562
			"url": "/ajax/ware/incPageViews",
563
			"type": "POST",
564
			"dataType": "json",
565
			"data": {
566
				"id": sevriceId
567
			},
568
			"success": function(data) {
569
				if(data.success) {}
570
			},
571
			"error": function() {
572
				$.MsgBox.Alert('提示', '链接服务器超时')
573
			}
574
		});
575
	}
576
	pageViewsVal();
577 559
	selUse();
578 560

579 561
	function selUse() {

+ 7 - 78
js/userInforShow.js

@ -6,77 +6,6 @@ $(function() {
6 6
	 	location.href="http://" + window.location.host + "/e/p.html?id="+professorId;
7 7
	}
8 8
	var oArray=[];
9
	var watchType=1;
10
	
11
	var pageSize=10
12
	var QTime,QId,ATime,AId,WTime,WId,rows= 10;
13
	
14
	if(professorId) {
15
		
16
		
17
		$("#collectArtTab").on('click',function(){
18
			
19
		})
20
		
21
//		$(".navconBox").on("click","li",function(){
22
//			$(this).addClass("liNow").siblings().removeClass("liNow");
23
//			$(".leftconBox .leftconItem").eq($(".navconBox li").index(this)).show().siblings().hide();
24
//		})
25
//		$(".navconBox>.mainNavUl").on("click","li:not('.rightbtn')",function(){
26
//			$(".moreNav").hide();
27
//		})
28
29
30
31
//		$(".navconBox>.mainNavUl").on("click","li.wenda",function(){//问答
32
//          if(userid === professorId) {
33
//              $(".wendaNav").show();
34
//          }else{
35
//              $("#item6user .coninfobox").eq(0).addClass("displayNone").siblings().removeClass("displayNone");
36
//          }
37
//		})
38
		
39
		
40
//		$(".navconBox>.mainNavUl").on("click","li.rightbtn",function(){//更多
41
//			$(".moreBu").show();
42
//			$(".wendaNav").hide();
43
//		})
44
//		$(".wendaUl").on("click","li",function(){//获取关注对象类型标志
45
//			console.log($(".wendaUl li").index(this))
46
//			$("#item6user>.coninfobox").eq($(".wendaUl li").index(this)).show().siblings().hide();
47
//			
48
//		})
49
//		$(".moreBuUl").on("click","li:not('.rightbtn')",function(){//获取关注对象类型标志
50
//          $("#item8user").find(".js-load-more").unbind();
51
//          $("#item8user").find(".js-load-more").remove();
52
//          $("#item8user").find("ul").each(function () {
53
//              $(this).html("");
54
//          });
55
//			watchType=$(this).attr("data-num");
56
//			console.log($(".moreBuUl li:not('.rightbtn')").index(this))
57
//			$("#item8user>.coninfobox").eq($(".moreBuUl li:not('.rightbtn')").index(this)).show().siblings().hide();
58
//          WTime = "";WId = "";
59
//			if(watchType==0){
60
//				attentMy()
61
//			}else if(watchType == 9) {
62
//              getMyWatchA(userid,true)
63
//          }else if(watchType == 8) {
64
//              getMyWatchQ(userid, true);
65
//          }else{
66
//
67
//				collAttent(1,true);
68
//			}
69
//		})
70
//		$(".navconBox .moreBu>.moreBuUl").on("click","li.rightbtn",function(){
71
//			$(this).find(".table-drop").show();
72
//		})
73
//		$(".table-drop").on("click","li",function(){
74
//			$(".navconBox .moreBu>.moreBuUl>.rightbtn").find("span").html($(this).text());
75
//			$(".table-drop").fadeOut(1000);
76
//		})
77
//		
78
		}
79
	
80 9
	function subjectShow(data) {
81 10
		if(data != undefined && data.length != 0) {
82 11
			var subs=strToAry(data)
@ -274,6 +203,12 @@ $(function() {
274 203
		return ret;
275 204
	}
276 205
	function openAttend(){//打开收藏与关注
206
		$(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
207
		$(".navconBox .moreBu").show();
208
		$(".wendaNav").hide();
209
		$("#item8user").show().siblings().hide();
210
		$(".moreBuUl li.attentType").eq(0).addClass("liNow").siblings().removeClass("liNow");
211
		$("#item8drop1").show().siblings().hide();
277 212
		watchO={
278 213
			watchTime:"",
279 214
			watchObjId:"",
@ -282,12 +217,6 @@ $(function() {
282 217
		$("#"+pa).find("ul").html("")
283 218
		$("#"+pa).find(".js-load-more").show();
284 219
		collectSorts(1,true);
285
		$(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
286
		$(".navconBox .moreBu").show();
287
		$(".wendaNav").hide();
288
		$("#item8user").show().siblings().hide();
289
		$(".moreBuUl li.attentType").eq(0).addClass("liNow").siblings().removeClass("liNow");
290
		$("#item8drop1").show().siblings().hide();
291 220
	}
292 221
	function researchAlert(cap){
293 222
		$.ajax({
@ -322,7 +251,7 @@ $(function() {
322 251
		});
323 252
	}
324 253
325
	var rows = 2,
254
	var rows = 20,
326 255
		dataO = {
327 256
			artPublishTime:"",
328 257
			artShareId:"",

+ 0 - 1
sevricePreview.html

@ -8,7 +8,6 @@
8 8
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.png" media="screen" />
9 9
<link href="css/bootstrap.min.css" rel="stylesheet">
10 10
<link type="text/css" href="css/common.css" rel="stylesheet">
11
<link type="text/css" href="css/popup.css" rel="stylesheet">
12 11
<link type="text/css" href="css/genindex.css" rel="stylesheet">
13 12
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
14 13
<script type="text/javascript" src="js/jquery.imagezoom.min.js"></script>

+ 3 - 4
sevriceShow.html

@ -8,7 +8,6 @@
8 8
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.png" media="screen" />
9 9
<link href="css/bootstrap.min.css" rel="stylesheet">
10 10
<link type="text/css" href="css/common.css" rel="stylesheet">
11
<link type="text/css" href="css/popup.css" rel="stylesheet">
12 11
<link type="text/css" href="css/genindex.css" rel="stylesheet">
13 12
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
14 13
<script type="text/javascript" src="js/jquery.imagezoom.min.js"></script>
@ -41,6 +40,7 @@
41 40
		                	<div class="h2Font">服务内容:<span id="application"></span></div>
42 41
		                	<div class="operateBlock resShareUl">
43 42
		                		<ul>
43
		                			<li><span>浏览量 </span><span id="pageView"></span></li>
44 44
		                			<li id="attention"><span>收藏</span> <em class="operateicon operateicon2 icon-collect"></em></li>
45 45
									<li>
46 46
										<span>分享到</span>
@ -179,7 +179,6 @@
179 179
<script type="text/javascript" src="js/jquery.page.js"></script>
180 180
<script type="text/javascript" src="js/public/baseUtil.js"></script>
181 181
<script type="text/javascript" src="js/public/genCom.js"></script> 
182
<!--<script type="text/javascript" src="js/popup.js"></script>-->
183 182
<script type="text/javascript" src="js/sevriceShow.js"></script>
184 183
<script type="text/javascript" src="js/quickLogin.js"></script>
185 184
<script type="text/javascript">
@ -190,8 +189,8 @@
190 189
	});
191 190
	function makeCode(){
192 191
		var hurl = window.location.host;
193
		var resourceId =  GetQueryString("resourceId");
194
		var elurl = "http://" + hurl + "/e/r.html?id=" + resourceId ; 
192
		var sevriceId =  GetQueryString("sevriceId");
193
		var elurl = "http://" + hurl + "/e/s.html?id=" + sevriceId ; 
195 194
		qrcode.makeCode(elurl);
196 195
	}
197 196
	makeCode();