jack 7 gadi atpakaļ
vecāks
revīzija
700af9a2df
1 mainītis faili ar 35 papildinājumiem un 17 dzēšanām
  1. 35 17
      js/paperShow.js

+ 35 - 17
js/paperShow.js

326
		var weibotitle = $da.name;
326
		var weibotitle = $da.name;
327
		var weibourl = window.location.href;
327
		var weibourl = window.location.href;
328
		$("#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");
328
		$("#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");
329
		if(userid) {
330
			isAgree($da.articleAgree) //文章点赞
331
		} else {
332
			$(".thumbBtn").html("赞 <span>" + $da.articleAgree + "</span>");
333
		}
334
	}
329
	}
330
	isAgreeNum()
331
	function isAgreeNum() {
332
	var data = {"id": paperId}
333
	$.ajax({	.ajax({		
334
		url:"/ajax/ppaper/agreeCount",
335
		data:data,
336
		dataType: 'json', //数据格式类型
337
		type: 'get', //http请求类型
338
		timeout: 10000,
339
		async: true,
340
		success: function(data) {
341
			if(data.success){
342
				if(userid && userid != "null" && userid != null) {
343
					alert(1);
344
					isAgree(data.data) //文章点赞
345
				} else {
346
					alert(2)
347
					$(".thumbBtn").html("赞 <span>" + data.data + "</span>");
348
				}
349
			}
350
		},
351
		error: function() {
352
			$.MsgBox.Alert('提示',"服务器链接超时");
353
		}
354
	});
355
}
335
	/*判断论文是否被赞*/
356
	/*判断论文是否被赞*/
336
function isAgree(articleAgree) {
357
function isAgree(articleAgree) {
337
	var data = {"operateId": userid,"paperId": paperId}
358
	var data = {"id": userid,"uid": paperId}
338
	$.ajax({		
359
	$.ajax({		
339
		url:"/ajax/paper/isAgree",
360
		url:"/ajax/ppaper/agree",
340
		data:data,
361
		data:data,
341
		dataType: 'json', //数据格式类型
362
		dataType: 'json', //数据格式类型
342
		type: 'get', //http请求类型
363
		type: 'get', //http请求类型
343
		timeout: 10000,
364
		timeout: 10000,
344
		async: false,
365
		async: true,
345
		success: function(data) {
366
		success: function(data) {
346
			if(data.success){
367
			if(data.success){
347
				if(data.data!= null){
368
				if(data.data){
348
					$(".thumbBtn").html("已赞 <span>"+articleAgree+"</span>");
369
					$(".thumbBtn").html("已赞 <span>"+articleAgree+"</span>");
349
					$(".thumbBtn").addClass("thumbedBtn");
370
					$(".thumbBtn").addClass("thumbedBtn");
350
				}else{
371
				}else{
360
}
381
}
361
//论文点击点赞
382
//论文点击点赞
362
$('.thumbBlock').on("click",".thunbgo",function(){
383
$('.thumbBlock').on("click",".thunbgo",function(){
363
	alert(1);
364
	console.log(userid);
365
	if (userid) {
366
		alert(2)
384
	if (userid && userid != "null" && userid != null) {
367
		addAgree();
385
		addAgree();
368
	}else{
386
	}else{
369
		$.MsgBox.Alert('提示',"请先登录再进行点赞");
387
		$.MsgBox.Alert('提示',"请先登录再进行点赞");
383
})
401
})
384
/*点赞*/
402
/*点赞*/
385
function addAgree() {
403
function addAgree() {
386
	var data = {"operateId": userid,"paperId": paperId}
404
	var data = {"uid": userid,"id": paperId}
387
	$.ajax({		
405
	$.ajax({		
388
		url:"/ajax/paper/agree",
406
		url:"/ajax/ppaper/agree",
389
		data:data,
407
		data:data,
390
		dataType: 'json', //数据格式类型
408
		dataType: 'json', //数据格式类型
391
		type: 'POST', //http请求类型
409
		type: 'POST', //http请求类型
392
		timeout: 10000,
410
		timeout: 10000,
393
		async: false,
411
		async: true,
394
		success: function(data) {
412
		success: function(data) {
395
			if(data.success){
413
			if(data.success){
396
				var articleAgreeval = $(".thumbBtn span").text();
414
				var articleAgreeval = $(".thumbBtn span").text();
577
							$itemlist = $(itemlist);
595
							$itemlist = $(itemlist);
578
							$("#patentList").append($itemlist);
596
							$("#patentList").append($itemlist);
579
						}
597
						}
580
							
598
					}		
581
				}
599
				}
582
			},
600
			},
583
			"error":function(){
601
			"error":function(){