浏览代码

发现问答

luyanan 7 年之前
父节点
当前提交
3ef66cdee0
共有 7 个文件被更改,包括 167 次插入84 次删除
  1. 3 3
      css/common.css
  2. 10 3
      css/genindex.css
  3. 二进制
      images/default-q&a.jpg
  4. 12 10
      inform.html
  5. 27 26
      js/discover.js
  6. 97 39
      js/qa-show.js
  7. 18 3
      qa-show.html

+ 3 - 3
css/common.css

94
/*------------------------------------------------------------------------------------*/
94
/*------------------------------------------------------------------------------------*/
95
/*点击加载更多*/
95
/*点击加载更多*/
96
.js-load-more{/*display: none;*/position:relative;outline:0;border:1px solid #fff;background: #fff;height: 40px;border-radius: 5px;width:100%;margin:10px auto;cursor: pointer;}
96
.js-load-more{/*display: none;*/position:relative;outline:0;border:1px solid #fff;background: #fff;height: 40px;border-radius: 5px;width:100%;margin:10px auto;cursor: pointer;}
97
.js-load-more:before{position:absolute;content:"点击加载更多";top:0;left:45%;font-size: 16px;line-height: 40px;}
97
.js-load-more:before{position:absolute;content:"点击加载更多";top:0;left:45%;font-size: 15px;line-height: 40px;}
98
.js-load-more.active{border-color:#ff9900;color:#ff9900;} 
98
.js-load-more.active{border-color:#ff9900;color:#ff9900;} 
99
.js-load-more.active:before{content:"加载中...";}
99
.js-load-more.active:before{content:"加载中...";}
100
/*分页*/
100
/*分页*/
197
header .headnavbtn{margin:14px 6px;}
197
header .headnavbtn{margin:14px 6px;}
198
header .headnavbtn a{color:#666;font-size:15px;}
198
header .headnavbtn a{color:#666;font-size:15px;}
199
header .headnavbtn li{float:left;margin:0 6px;}
199
header .headnavbtn li{float:left;margin:0 6px;}
200
header .headnavbtn li.mymessage{padding:0 20px;cursor: pointer;}
200
header .headnavbtn li.mymessage{padding-right:20px;cursor: pointer;}
201
header .headnavbtn li.mymessage>a{position:relative;}
201
header .headnavbtn li.mymessage>a{position:relative;}
202
header .headnavbtn li.mymessage>a>.badge{position:relative;right:8px;top:-10px;background:#FF0000;}
202
header .headnavbtn li.mymessage>a>.badge{position:absolute;right:-12px;top:-10px;background:#FF0000;}
203
header .headnavbtn .teyaologin{padding:4px 20px;border-radius:6px;margin-right:16px;}
203
header .headnavbtn .teyaologin{padding:4px 20px;border-radius:6px;margin-right:16px;}
204
header .navbtn{width: 18px;height:20px;cursor: pointer; padding:10px 18px;background-position:center;background-repeat:no-repeat;}
204
header .navbtn{width: 18px;height:20px;cursor: pointer; padding:10px 18px;background-position:center;background-repeat:no-repeat;}
205
header .navnews{background-image: url(../images/nav_button_news_nor.png);background-size:contain;}
205
header .navnews{background-image: url(../images/nav_button_news_nor.png);background-size:contain;}

+ 10 - 3
css/genindex.css

182
.table-drop>li{position:relative;color: #333;border-bottom:1px solid #ddd;}
182
.table-drop>li{position:relative;color: #333;border-bottom:1px solid #ddd;}
183
.table-drop>li:last-child{border: none;}
183
.table-drop>li:last-child{border: none;}
184
/*列表*/
184
/*列表*/
185
.table-body {position: relative;min-height: 200px;background: #fff;margin-top:20px;margin-bottom: -20px;padding-bottom: 20px;}
185
.table-body {position: relative;min-height: 200px;/*background: #fff;*/margin-top:20px;margin-bottom: -20px;padding-bottom: 20px;}
186
.table-body .table-item-list{display: none;}
186
.table-body .table-item-list{display: none;}
187
.table-body .table-item-list:first-child{display: block;}
187
.table-body .table-item-list:first-child{display: block;}
188
.table-body ul.listitemdiv{background: #fff;}
188
.columTag{position: absolute;background: rgba(0,0,0,.6);color:#fff;padding:4px 10px;bottom:6px;left: 6px;font-size: 13px;}
189
.columTag{position: absolute;background: rgba(0,0,0,.6);color:#fff;padding:4px 10px;bottom:6px;left: 6px;font-size: 13px;}
189
/*.table-item{position: relative;min-height:500px;}
190
/*.table-item{position: relative;min-height:500px;}
190
.table-item>li{position:relative;padding:25px 20px;}
191
.table-item>li{position:relative;padding:25px 20px;}
270
ul.listitemdiv.listmorediv .patenthead{background-image: url(../images/default-patent.jpg);}
271
ul.listitemdiv.listmorediv .patenthead{background-image: url(../images/default-patent.jpg);}
271
ul.listitemdiv.listmorediv .companyhead{background:#fff;border:none}
272
ul.listitemdiv.listmorediv .companyhead{background:#fff;border:none}
272
ul.listitemdiv.listmorediv .companyhead .boxBlock{width: 164px;height: 110px;}
273
ul.listitemdiv.listmorediv .companyhead .boxBlock{width: 164px;height: 110px;}
274
.qa-Head{background-image: url(../images/default-q&a.jpg);}
273
/*--------------新版文章--------------*/
275
/*--------------新版文章--------------*/
274
/*文章发布*/
276
/*文章发布*/
275
.conBlock .leftconBox{width:820px;padding:30px;position: relative;}
277
.conBlock .leftconBox{width:820px;padding:30px;position: relative;}
335
	        -webkit-align-items: center;
337
	        -webkit-align-items: center;
336
	                align-items: center;}
338
	                align-items: center;}
337
/*.form-item .flexCenter{min-height: 60px;}*/
339
/*.form-item .flexCenter{min-height: 60px;}*/
340
.madiaInfo{width:100%;padding-left:0;}
338
.form-drop{position:relative;top:-1px;border:1px solid #E5E5E5;border-top:none;width: 100%;z-index: 0;}
341
.form-drop{position:relative;top:-1px;border:1px solid #E5E5E5;border-top:none;width: 100%;z-index: 0;}
339
.form-item input.frmcontype{position: relative;z-index: 2;}
342
.form-item input.frmcontype{position: relative;z-index: 2;}
340
.form-item .frmaddG{display:none;width: auto;position: absolute;right: 0;top: 0;background:#ff9900;color: #fff;border: none;padding: 6px 25px;z-index: 6;}
343
.form-item .frmaddG{display:none;width: auto;position: absolute;right: 0;top: 0;background:#ff9900;color: #fff;border: none;padding: 6px 25px;z-index: 6;}
890
.qa-owner .owner-head{position:absolute;top:50%;background-position: center;background-size: cover;}
893
.qa-owner .owner-head{position:absolute;top:50%;background-position: center;background-size: cover;}
891
.qa-owner .owner-head.useHead{width:32px;height:32px;margin-top:-16px;background-image: url(../images/default-photo.jpg);border-radius: 50%;}
894
.qa-owner .owner-head.useHead{width:32px;height:32px;margin-top:-16px;background-image: url(../images/default-photo.jpg);border-radius: 50%;}
892
.qa-owner .owner-info{padding-left:38px;}
895
.qa-owner .owner-info{padding-left:38px;}
893
.owner-name{float: left;font-size:16px;}
896
.owner-name{float: left;font-size:16px;color: #333;}
894
.owner-tit{font-size:14px;margin-left:10px;float: left;max-width:90%;color:#888888}
897
.owner-tit{font-size:14px;margin-left:10px;float: left;max-width:90%;color:#888888}
895
.qa-con{font-size:15px;line-height: 22px;color:#333;text-align: justify;}
898
.qa-con{font-size:15px;line-height: 22px;color:#333;text-align: justify;}
896
.showspan{overflow: hidden;margin-top:10px;}
899
.showspan{overflow: hidden;margin-top:10px;}
922
.list-hold-count>ul>li>span{position: relative;top:5px;display:inline-block;font-size:14px;line-height:24px;padding:0 10px;border:1px solid #e5e5e5}
925
.list-hold-count>ul>li>span{position: relative;top:5px;display:inline-block;font-size:14px;line-height:24px;padding:0 10px;border:1px solid #e5e5e5}
923
.list-hold-count>ul>li.active>span{background: #ff9900;color:#fff;border-color: #ff9900}
926
.list-hold-count>ul>li.active>span{background: #ff9900;color:#fff;border-color: #ff9900}
924
927
925
.list-hold{}
928
.list-hold>ul>li{padding:10px 20px;background: #FFFFFF;}
926
.list-hold-list>ul>li{padding:10px 20px;background: #FFFFFF;margin-bottom: 10px;}
929
.list-hold-list>ul>li{padding:10px 20px;background: #FFFFFF;margin-bottom: 10px;}
930
.split-line{position:relative;margin:15px 0;height:20px;color:#888;}
931
.split-line:after{content:"其他答案";background:#f4f6f8;position: absolute;padding:0 20px;top:0;left:50%;margin-left:-48px;}
932
.split-line:before{content:"";background:#E5E5E5;height: 1px;position: absolute;left:0;right:0;top:10px;}
933
.qa-question{width:100%;font-size: 16px;line-height: 28px;color: #333;}
927
.list-hold .qa-owner{min-height: 50px;margin:6px 0 10px;position: relative;}
934
.list-hold .qa-owner{min-height: 50px;margin:6px 0 10px;position: relative;}
928
.list-hold .qa-owner .goSpan{position: absolute;right: 0; top:50%;margin-top:-17px;}
935
.list-hold .qa-owner .goSpan{position: absolute;right: 0; top:50%;margin-top:-17px;}
929
.list-hold .qa-owner .goSpan>span{margin: 0px;width: 100px;}
936
.list-hold .qa-owner .goSpan>span{margin: 0px;width: 100px;}

二进制
images/default-q&a.jpg


+ 12 - 10
inform.html

26
			}
26
			}
27
			
27
			
28
			.coninfotit {
28
			.coninfotit {
29
				padding:10px 20px;
29
				font-size: 18px;
30
				font-size: 18px;
30
				color: #666;
31
				color: #666;
31
				padding-bottom: 10px;
32
				background-color: #fff;
32
				background-color: #fff;
33
			}
33
			}
34
			
34
			
41
			}
41
			}
42
		</style>
42
		</style>
43
		<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
43
		<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
44

45
	</head>
44
	</head>
46

45

47
	<body>
46
	<body>
54
					<div class="leftconBox leftconBoxbg floatL">
53
					<div class="leftconBox leftconBoxbg floatL">
55
						<div class="list-main scroll-view">
54
						<div class="list-main scroll-view">
56
							<section class="list-hold">
55
							<section class="list-hold">
57
								<div class="list-hold-list">
58
									<div class="coninfotit">全部通知</div>
59
									<ul class="myAllneeds partLine" id="curAnswers">
60
										
61
									</ul>
62
									<!--加载更多按钮-->
63
									<div class="js-load-more displayNone"></div>
64
								</div>
56
								<div class="coninfotit">全部通知</div>
57
								<ul class="myAllneeds partLine" id="curAnswers">
58
									
59
								</ul>
60
								<!--加载更多按钮-->
61
								<div class="js-load-more displayNone"></div>
65
							</section>
62
							</section>
66
						</div>
63
						</div>
67
					</div>
64
					</div>
86
		<script type="text/javascript" src="js/quickLogin.js"></script>
83
		<script type="text/javascript" src="js/quickLogin.js"></script>
87
		<script type="text/javascript" src="js/informLeaveW.js"></script>
84
		<script type="text/javascript" src="js/informLeaveW.js"></script>
88
		<script type="text/javascript" src="js/inform.js"></script>
85
		<script type="text/javascript" src="js/inform.js"></script>
86
		<script type="text/javascript">
87
			$(function() {
88
				addscript("ad_inform_right");
89
			})
90
		</script>
89
	</body>
91
	</body>
90

92

91
</html>
93
</html>

+ 27 - 26
js/discover.js

235
				"ex":exculdeId2s,
235
				"ex":exculdeId2s,
236
            },
236
            },
237
            "beforeSend": function() {
237
            "beforeSend": function() {
238
                // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
239
                $("#table-item-0").parent().find(".js-load-more").attr("disabled",true);
238
                $("#table-item-0").parent().find(".js-load-more").attr("disabled",true);
240
                $("#table-item-0").parent().find(".js-load-more").addClass("active");
239
                $("#table-item-0").parent().find(".js-load-more").addClass("active");
241
            },
240
            },
251
                        fTime = dataStr[dataStr.length - 1].tm;
250
                        fTime = dataStr[dataStr.length - 1].tm;
252
                        fId = dataStr[dataStr.length - 1].id;
251
                        fId = dataStr[dataStr.length - 1].id;
253
                    }
252
                    }
254
                    // $("#table-item-"+idItem).html("");
255
                    var strNo='<div class="nodatabox"><div class="nodata"><div class="picbox picNull"></div>'
253
                    var strNo='<div class="nodatabox"><div class="nodata"><div class="picbox picNull"></div>'
256
                    strNo+='<div class="txtbox"><p class="noContip">该栏目暂时没有任何动态</p></div></div></div>'
254
                    strNo+='<div class="txtbox"><p class="noContip">该栏目暂时没有任何动态</p></div></div></div>'
257
                    if(dataStr.length>0){
255
                    if(dataStr.length>0){
280
                        $("#table-item-0").parent().find(".js-load-more").unbind("click");
278
                        $("#table-item-0").parent().find(".js-load-more").unbind("click");
281
                        $("#table-item-0").parent().find(".js-load-more").hide();
279
                        $("#table-item-0").parent().find(".js-load-more").hide();
282
                    }
280
                    }
283
                    $(".loading").remove();
284
                }
281
                }
285
            },
282
            },
286
            "error":function(){
283
            "error":function(){
301
				"rows":rows
298
				"rows":rows
302
			},
299
			},
303
			"beforeSend": function() {
300
			"beforeSend": function() {
304
				// $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
305
                $("#table-item-3").parent().find(".js-load-more").attr("disabled",true);
301
                $("#table-item-3").parent().find(".js-load-more").attr("disabled",true);
306
                $("#table-item-3").parent().find(".js-load-more").addClass("active");
302
                $("#table-item-3").parent().find(".js-load-more").addClass("active");
307
			},
303
			},
337
                        $("#table-item-3").parent().find(".js-load-more").unbind("click");
333
                        $("#table-item-3").parent().find(".js-load-more").unbind("click");
338
                        $("#table-item-3").parent().find(".js-load-more").hide();
334
                        $("#table-item-3").parent().find(".js-load-more").hide();
339
                    }
335
                    }
340
                    $(".loading").remove();
341
				}
336
				}
342
			},
337
			},
343
			"error":function(){
338
			"error":function(){
454
            baImg = "/data/question"+ subs[0];
449
            baImg = "/data/question"+ subs[0];
455
        }
450
        }
456
        var hd = "";
451
        var hd = "";
457
        if (dataStr.replyCount > 0) {
458
            hd = '<span>' + dataStr.replyCount + '回答</span>'
452
        if (dataStr.num > 0) {
453
            hd = '<span>回答 ' + dataStr.num + '</span>'
459
        }
454
        }
460
        var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.id+'" class="flexCenter urlgo">'+
461
        	'<div class="flexCenter OflexCenter mui-clearfix">' +
462
            '<div class="madiaHead qa-Head" style="background-image:url(' + baImg + ')"></div>' +
463
            '<div class="madiaInfo OmadiaInfo">' +
464
            '<p class="mui-ellipsis-2 h1Font">' + dataStr.title + '</p>' +
465
            '<p class="show-item mui-ellipsis h2Font"><span class="column columnOther">问答</span>' + hd + '<span class="attendCount"></span></p>' +
466
            '</div></div></a>'
455
        var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.id+'">'
456
        	strAdd += '<div class="lefthead qa-Head" style="background-image:url('+ baImg +')"><span class="columTag">问答</span></div>';
457
			strAdd += '<div class="centercon centercon2"><p class="h1font ellipsisSty-2">'+ dataStr.title +'</p>';
458
			strAdd += '<div class="h2font showInfo clearfix">'
459
			strAdd += '<span class="time">'+commenTime(dataStr.tm)+'</span><span class="qaPageview"></span>'+hd+'<span class="attendCount"></span>'
460
            strAdd += '</div></div></a>'
467

461

468
		var $str = $(strAdd);
462
		var $str = $(strAdd);
469
		listLi.append($str);
463
		listLi.append($str);
464
		questioninfo(dataStr.id, $str);
470
		attendCount(dataStr.id, $str);
465
		attendCount(dataStr.id, $str);
471
	}
466
	}
472

467

473
	function otherQa(dataStr,listLi){
468
	function otherQa(dataStr,listLi){
474
        var strAdd = '<li class="mui-table-view-cell">' +
475
            '<div class="madiaInfo" style="padding-left:0">' +
476
            '<p class="h1Font ellipsisSty qa-question"></p>' +
469
        var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.qid+'&topid='+dataStr.id+'">'+
470
            '<div class="madiaInfo">' +
471
            '<div class="ellipsisSty qa-question"></div>' +
477
            '<div class="flexCenter qa-owner">' +
472
            '<div class="flexCenter qa-owner">' +
478
            '</div>' +
473
            '</div>' +
479
            '<p class="qa-con ellipsisSty-3">' + dataStr.cnt +'</p>' +
474
            '<p class="qa-con ellipsisSty-3">' + (dataStr.cnt).replace(/\n/g,"<br />") +'</p>' +
480
            '<div class="showspan">' +
475
            '<div class="showspan">' +
481
            '<span>5月8日 18:00</span>' +
476
            '<span>'+commenTime(dataStr.createTime)+'</span>' +
482
            '<span class="agree"></span>' +
477
            '<span class="agree"></span>' +
483
            '<span class="leaveMsgCount"></span>' +
478
            '<span class="leaveMsgCount"></span>' +
484
            '</div>' +
479
            '</div>' +
485
            '</div>' +
486
            '</li>';
480
            '</div></a>';
487
		var $str = $(strAdd);
481
		var $str = $(strAdd);
488
		listLi.append($str);
482
		listLi.append($str);
489
        if(dataStr.agree > 0) {
483
        if(dataStr.agree > 0) {
490
            $str.find(".agree").html(dataStr.agree + "赞	");
484
            $str.find(".agree").html("赞	" + dataStr.agree);
491
        }
485
        }
492
		questioninfo(dataStr.qid, $str);
486
		questioninfo(dataStr.qid, $str);
493
        proinfo(dataStr.uid, $str);
487
        proinfo(dataStr.uid, $str);
506
			"success": function(data) {
500
			"success": function(data) {
507
				if(data.success) {
501
				if(data.success) {
508
					if(data.data > 0) {
502
					if(data.data > 0) {
509
						$str.find(".leaveMsgCount").html(data.data + "留言");
503
						$str.find(".leaveMsgCount").html("留言 " + data.data);
510
					}
504
					}
511
				}
505
				}
512
			},
506
			},
527
			"success": function(data) {
521
			"success": function(data) {
528
				if(data.success) {
522
				if(data.success) {
529
					if(data.data > 0) {
523
					if(data.data > 0) {
530
						$str.find(".attendCount").html(data.data + "关注");
524
						$str.find(".attendCount").html("关注 " + data.data);
531
					}
525
					}
532
				}
526
				}
533
			},
527
			},
535
			}
529
			}
536
		});
530
		});
537
	}
531
	}
532
	
538
	//查文章留言数
533
	//查文章留言数
539
	function commentnum(articleId, $itemlist) {
534
	function commentnum(articleId, $itemlist) {
540
		$.ajax({
535
		$.ajax({
592
		            }
587
		            }
593
		            var str = '<div class="owner-head useHead" style="background-image:url(' + baImg + ')"></div>' +
588
		            var str = '<div class="owner-head useHead" style="background-image:url(' + baImg + ')"></div>' +
594
		                '<div class="owner-info">' +
589
		                '<div class="owner-info">' +
595
		                '<div class="owner-name"><span class="h1Font">' + dataStr.name + '</span><em class="authicon ' + userType.sty + '" title="' + userType.title + '"></em></div>' +
596
		                '<div class="owner-tit mui-ellipsis h2Font">' + os + '</div>' +
590
		                '<div class="owner-name">' + dataStr.name + '<em class="authicon ' + userType.sty + '" title="' + userType.title + '"></em></div>' +
591
		                '<div class="owner-tit ellipsisSty">' + os + '</div>' +
597
		                '</div>'
592
		                '</div>'
598
		            $str.find(".qa-owner").html(str)
593
		            $str.find(".qa-owner").html(str)
599
				}
594
				}
613
			"success": function(data) {
608
			"success": function(data) {
614
				if(data.success) {
609
				if(data.success) {
615
					$str.find(".qa-question").html(data.data.title);
610
					$str.find(".qa-question").html(data.data.title);
611
					if(data.data.pageViews>0){
612
						$str.find(".qaPageview").html("阅读量 "+data.data.pageViews);
613
					}else{
614
						$str.find(".qaPageview").hide()
615
					}
616
					
616
				}
617
				}
617
			},
618
			},
618
			"error": function() {
619
			"error": function() {

+ 97 - 39
js/qa-show.js

2
	loginStatus();//判断个人是否登录
2
	loginStatus();//判断个人是否登录
3
	var userid = $.cookie("userid"),
3
	var userid = $.cookie("userid"),
4
		username = $.cookie("userName")
4
		username = $.cookie("userName")
5
	var questionId = GetQueryString("id");
5
	var questionId = GetQueryString("id"),
6
	    topAnswerId = GetQueryString("topid");
6
	var hurl = window.location.host,
7
	var hurl = window.location.host,
7
		weibourl = window.location.href
8
		weibourl = window.location.href
8
		weibopic = "http://" + hurl + "/images/logo180.png",
9
		weibopic = "http://" + hurl + "/images/logo180.png",
24
			count: "",
25
			count: "",
25
			pid: ""
26
			pid: ""
26
		}
27
		}
27
		
28
	var dataT={
29
			id: "",
30
			score:""
31
		}
28
	var oAjax = function(url, dataS, otype, oFun,beforeFun,completeFun) {
32
	var oAjax = function(url, dataS, otype, oFun,beforeFun,completeFun) {
29
			$.ajax({
33
			$.ajax({
30
				url:url,
34
				url:url,
228
	        	$("#curAnswers").parent().find(".js-load-more").removeClass("active");
232
	        	$("#curAnswers").parent().find(".js-load-more").removeClass("active");
229
			})
233
			})
230
		},
234
		},
235
		answerTop=function(answerId){
236
			oAjax('/ajax/question/answer', {
237
				"id": answerId
238
			}, "get", function(res) {
239
				var $da = res.data
240
				var liStr = document.createElement("li");
241
				document.getElementById("topAnshow").appendChild(liStr);
242
				answerModule($da, liStr);
243
			})
244
		},
245
		answerThisShow=function(){
246
			var typeurl = "/ajax/question/answer/qes/byScore",
247
				dataStr={
248
					"qid": questionId,
249
					"score": dataT.score,
250
					"id": dataT.id,
251
					"rows": rows
252
				}
253
			oAjax(typeurl,dataStr, "get", function(res){
254
				console.log(res)
255
				var $info = res.data;
256
				if($info.length > 0) {
257
					if($info.length>1){
258
						$(".otherAn").removeClass("displayNone")
259
					}
260
					dataT.score = $info[$info.length - 1].score;
261
					dataT.id = $info[$info.length - 1].id;
262
					for(var i = 0; i < $info.length; i++) {
263
						if($info[i].id==topAnswerId){
264
							
265
						}else{
266
							var liStr = document.createElement("li");
267
							document.getElementById("otherAnshow").appendChild(liStr);
268
							answerModule($info[i], liStr);
269
						}
270
					}
271
				}
272
                $("#otherAnshow").parent().find(".js-load-more").on("click",function(){
273
				 	answerThisShow()
274
				})
275
				if ($info.length < rows) {
276
                    $("#otherAnshow").parent().find(".js-load-more").unbind("click");
277
                    $("#otherAnshow").parent().find(".js-load-more").hide();
278
                }
279
				
280
			},function(){
281
				$("#otherAnshow").parent().find(".js-load-more").attr("disabled",true);
282
	       		$("#otherAnshow").parent().find(".js-load-more").addClass("active");
283
			},function(){
284
				$("#otherAnshow").parent().find(".js-load-more").removeAttr("disabled");
285
	        	$("#otherAnshow").parent().find(".js-load-more").removeClass("active");
286
			})
287
		},
231
		insertAfter = function (newStr, targetE) {
288
		insertAfter = function (newStr, targetE) {
232
            var parent = document.getElementById(targetE).parentNode;
289
            var parent = document.getElementById(targetE).parentNode;
233
            var kong = document.createElement("div");
290
            var kong = document.createElement("div");
257
			}
314
			}
258
			liStr.className="list-qa"
315
			liStr.className="list-qa"
259
			liStr.setAttribute("data-id", dataStr.id);
316
			liStr.setAttribute("data-id", dataStr.id);
260
			var operatStr='<div class="list_hander clearfix">'+
317
			var operatStr='<div class="list_hander clearfix" data-type="2">'+
261
					'<div class="holdSpan floatL">'+
318
					'<div class="holdSpan floatL">'+
262
	                	'<div class="zan"><em class="hold-icon icon-zan"></em><span class="agreeCount"></span></div>'+
319
	                	'<div class="zan"><em class="hold-icon icon-zan"></em><span class="agreeCount"></span></div>'+
263
						'<div class="cai"><em class="hold-icon icon-cai"></em></div>'+
320
						'<div class="cai"><em class="hold-icon icon-cai"></em></div>'+
351
					objN.html("");
408
					objN.html("");
352
					$.MsgBox.Alert("提示", tip);
409
					$.MsgBox.Alert("提示", tip);
353
					$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
410
					$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
354
					document.getElementById("curAnswers").innerHTML = "";
355
					$("#curAnswers").parent().find(".js-load-more").unbind("click");
356
					$("#curAnswers").parent().find(".js-load-more").show();
357
					dataO = {time: "",id: "",score:""}
358
					answerList()
359
					getConmain()
411
					window.location.reload();
360
				})
412
				})
361
				
413
				
362
			})
414
			})
483
				var objTex=$(this).parents(".list-qa").find(".qa-con").html().replace(/<br\s*\/?\s*>/ig, '\n');
535
				var objTex=$(this).parents(".list-qa").find(".qa-con").html().replace(/<br\s*\/?\s*>/ig, '\n');
484
				goAnswerFn(objStr,anid,objTex,1)
536
				goAnswerFn(objStr,anid,objTex,1)
485
			})
537
			})
486
			//举报
487
			$str.find(".tip-offs").on("click",".jubao",function(){
488
				
538
			//举报
539
			$str.find(".tip-offs").on("click",".jubao",function(){
540
				$("#correctBlock").fadeIn();
541
				$(".correctSubmit").attr("data-type","answer")
542
				$(".correctSubmit").attr("data-tyId",anid)
489
			})
543
			})
490
			//微信分享
544
			//微信分享
491
			$str.find('.shareWeixin').on("mouseenter",function(){
545
			$str.find('.shareWeixin').on("mouseenter",function(){
693
		}
747
		}
694
		
748
		
695
		
749
		
750
		
696
	pageViews();		
751
	pageViews();		
697
	getConmain();
752
	getConmain();
698
	waitingA();
753
	waitingA();
699
	answerList();
754
	if(topAnswerId){
755
		$(".show-list-allAn").addClass("displayNone")
756
		$(".show-list-thisAn").removeClass("displayNone")
757
		answerTop(topAnswerId)
758
		answerThisShow();
759
	}else{
760
		$(".show-list-allAn").removeClass("displayNone")
761
		$(".show-list-thisAn").addClass("displayNone")
762
		answerList();
763
	}
764
700
	if(userid && userid != null && userid != "null") {
765
	if(userid && userid != null && userid != "null") {
701
		anExist(); //判断是否回答过该问题
766
		anExist(); //判断是否回答过该问题
702
		ifcollectionAbout(questionId, $("#attention"), 8);
767
		ifcollectionAbout(questionId, $("#attention"), 8);
798
		$("#requestA").parent().find(".js-load-more").unbind("click");
863
		$("#requestA").parent().find(".js-load-more").unbind("click");
799
		$("#requestA").parent().find(".js-load-more").show();
864
		$("#requestA").parent().find(".js-load-more").show();
800
	});
865
	});
801
		
802
	
803
	//纠错反馈
866
	$("#jubao").on("click",function(){
867
		$("#correctBlock").fadeIn();
868
		$(".correctSubmit").attr("data-type","question")
869
		$(".correctSubmit").attr("data-tyId",questionId)
870
	})
804
	$(".correctSubmit").on("click",function(){
871
	$(".correctSubmit").on("click",function(){
805
		var cntCon=$(this).siblings(".correctCon").val();
806
		var cntUser="";
872
		var type=$(this).attr("data-type"),
873
			tyId=$(this).attr("data-tyId")
874
		if(type=="answer"){
875
			tyurl='/ajax/feedback/error/answer'
876
		}else if(type=="question"){
877
			tyurl='/ajax/feedback/error/question'
878
		}
879
		var cntUser=""
880
		var cntCon=$(".correctCon").val();
807
		if(userid && userid != null && userid != "null") {
881
		if(userid && userid != null && userid != "null") {
808
			cntUser = userid;
882
			cntUser = userid;
809
		}
883
		}
810
		if(cntCon.length>500){
884
		if(cntCon.length>500){
811
			$.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
885
			$.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
812
			return;
886
			return;
813
		}else{
814
			$.ajax({
815
				"url": "/ajax/feedback/error/professor",
816
				"type": "POST",
817
				"dataType": "json",
818
				"async": true,
819
				"data": {
820
					"id": questionId,
821
					"cnt":cntCon,
822
					"user":cntUser
823
				},
824
				"success": function(data) {
825
					if(data.success) {
826
						backSuccessed();
827
					}
828
				},
829
				"error": function() {
830
					$.MsgBox.Alert('提示', '链接服务器超时')
831
				}
832
			});
833
		}
887
		}
888
		oAjax(tyurl,{
889
			"id": tyId,
890
			"cnt":cntCon,
891
			"user":cntUser
892
		}, "post", backSuccessed)
834
	})
893
	})
835
	
836
})
894
})
837
895

+ 18 - 3
qa-show.html

34
								<!--<li><span class="imgspan" style="background-image: url(images/banner/banner0307.png);"></span></li>
34
								<!--<li><span class="imgspan" style="background-image: url(images/banner/banner0307.png);"></span></li>
35
								-->
35
								-->
36
							</ul>
36
							</ul>
37
							<div class="list_hander clearfix">
37
							<div class="list_hander clearfix" data-type="1">
38
								<div class="goSpan floatL">
38
								<div class="goSpan floatL">
39
				                	<span class="go-answer">我来回答</span>
39
				                	<span class="go-answer">我来回答</span>
40
									<span class="invite-answer">邀请回答</span>
40
									<span class="invite-answer">邀请回答</span>
58
				            		</ul>
58
				            		</ul>
59
				            	</div>
59
				            	</div>
60
				            	<div class="operateBlock tip-offs floatR">
60
				            	<div class="operateBlock tip-offs floatR">
61
				            		<span>举报</span>
61
				            		<span id="jubao">举报</span>
62
				            	</div>
62
				            	</div>
63
							</div>
63
							</div>
64
						</div>
64
						</div>
91
							<button class="js-load-more"></button>
91
							<button class="js-load-more"></button>
92
						</div>
92
						</div>
93
					</section>
93
					</section>
94
					<section class="list-main-group">
94
					<section class="list-main-group show-list-allAn">
95
						<div class="listbg">
95
						<div class="listbg">
96
							<div class="list-hold-count">
96
							<div class="list-hold-count">
97
								<span><em id="replyCount"></em>个回答</span>
97
								<span><em id="replyCount"></em>个回答</span>
156
							</div>
156
							</div>
157
						</div>
157
						</div>
158
					</section>
158
					</section>
159
					<section class="list-main-group show-list-thisAn">
160
						<div class="list-hold">
161
							<div class="list-hold-list zhidingAn">
162
								<ul class="myAllneeds partLine" id="topAnshow"></ul>
163
							</div>
164
							<div class="otherAn displayNone">
165
								<div class="split-line"></div>
166
								<div class="list-hold-list">
167
									<ul class="myAllneeds partLine" id="otherAnshow"></ul>
168
									<!--加载更多按钮-->
169
		    						<button class="js-load-more"></button>
170
								</div>
171
							</div>
172
						</div>
173
					</section>
159
				</div>
174
				</div>
160
			</div>
175
			</div>
161
			<div class="rightconBox floatR">
176
			<div class="rightconBox floatR">