var gtFailbackFrontInitial = function(result) {
var s = document.createElement('script');
s.id = 'gt_lib';
s.src = 'http://static.geetest.com/static/js/geetest.0.0.0.js';
s.charset = 'UTF-8';
s.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(s);
var loaded = false;
s.onload = s.onreadystatechange = function() {
if (!loaded && (!this.readyState|| this.readyState === 'loaded' || this.readyState === 'complete')) {
loadGeetest(result);
loaded = true;
}
};
}
var loadGeetest = function(config) {
//1. use geetest capthca
window.gt_captcha_obj = new window.Geetest({
gt : config.gt,
challenge : config.challenge,
product : 'float',
offline : !config.success
});
gt_captcha_obj.appendTo("#div_id_embed");
}
s = document.createElement('script');
s.src = 'http://api.geetest.com/get.php?callback=gtcallback';
$("#div_geetest_lib").append(s);
var gtcallback =( function() {
var status = 0, result, apiFail;
return function(r) {
status += 1;
if (r) {
result = r;
setTimeout(function() {
if (!window.Geetest) {
apiFail = true;
gtFailbackFrontInitial(result)
}
}, 1000)
}
else if(apiFail) {
return
}
if (status == 2) {
loadGeetest(result);
}
}
})()
/* $.ajax({
url : "jyyz/web/StartCaptchaServlet.php?rand="+Math.round(Math.random()*100),
type : "get",
dataType : 'JSON',
success : function(result) {
console.log(result);
gtcallback(result)
}
})*/
$.ajax({
url : "http://www.fpwap.com/eckf/jyyz/web/StartCaptchaServlet.php?rand="+Math.round(Math.random()*100),
type : "GET",
data:{},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonpjyz",
timeout: 10000,
success : function(result) {
console.log(result);
gtcallback(result)
}
})
var zhubq=0;
function ztcontentbq(){
//var atopp=$('#ztcontent').offset().top;
//var iHeightt=$('.comment-expression-popu2').height();
//$('.comment-expression-popu2').css({'top':atopp+10})
var comiconlist=showiconlist('bqone','2');
$('.firsticonlist').append(comiconlist);
$(".comment-expression-popu2").show();
$("#bqone li img").click(function () {
var kk = $(this).attr("title");
kk="[/表情"+kk+"]";
var newtextcontent=$("#ztcontent").val();
$("#ztcontent").val(newtextcontent+kk);
});
}
(function(){
//点击空白处关闭表情框;
$(document).bind("click",function(e){
var target = $(e.target);
if(target.closest(".comment-expression-popu2").length == 0 && target.closest(".dw-comment-expression-btn").length == 0 && target.closest(".comment-expression-popu").length == 0){
$(".comment-expression-popu2").hide();
$(".comment-expression-popu").hide();
}
})
var oStar=$('#star');
var aLi = $(".startlist li");
var oUl = $(".startlist");
var i = iScore = iStar = 0;
for (i = 1; i <= aLi.length; i++){
aLi[i - 1].index = i;
aLi[i - 1].onmouseover = function (){
fnPoint(this.index);
};
aLi[i - 1].onmouseout = function (){
fnPoint();
};
aLi[i - 1].onclick = function (){
iStar = this.index;
}
}
function fnPoint(iArg){
iScore = iArg || iStar;
for (i = 0; i < aLi.length; i++) aLi[i].className = i < iScore ? "on" : "";
}
})();
//进入自动加载吐槽;
jztc();
//进入刷新列表;
var dzlist=[];
var norep=0;
var tcallcount=0;
var morrep=[];
var repztpage=2;
//判断最新和热门
var biaojicomm=1;
var allpl=0;
//主评论赞和踩;
function zczancai(val,type,num){
$.ajax({
url:"http://www.fpwap.com/eckf/comments.php?type=8&rand="+Math.round(Math.random()*100),
type: 'GET',
data:{'id':val,'type':type},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonp",
timeout: 10000,
success: function(data){
if(data.status){
if(type==1){
$(".ztc"+val).html('('+(num+1)+')');//踩
$('.cainum'+val).animate({"opacity":"1",top:"-40px","right":"-10px"},function(){
$('.cainum'+val).css({"opacity":"0"})
})
}else{
$(".ztd"+val).html('('+(num+1)+')');//赞
$('.dingnum'+val).animate({"opacity":"1",top:"-40px","right":"-10px"},function(){
$('.dingnum'+val).css({"opacity":"0"})
})
}
}else{
//alert(data.info);
$('.ztd'+val).css({"color":"#ccc"})
}
}
});
}
//用户回复查看更多
function ctmorpl(val){
ztdjchange();
if(morrep[val]){
morrep[val]++;
}else{
morrep[val]=1;
}
$.ajax({
url:"http://www.fpwap.com/eckf/comments.php?type=9&rand="+Math.round(Math.random()*100),
type: 'GET',
data:{'id':val,'page':morrep[val]},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonp",
timeout: 10000,
success: function(data){
if(data.status){
if(morrep[val]==1){
$(".repnew"+val).empty();
}
var addreplist='';
if(data.data.count<5){
$("#showlook"+val).remove();
}
if(data.data.count>0){
$.each(data.data.list,function(k,repreplist){
addreplist+= '
'+
''+
'
'+repreplist.phone1+'对'+repreplist.phone2+'说
'+
'
'+repreplist.content+'('+repreplist.time+')
'+
'
'+
'
'
'
'+
''
});
}
$(".repnew"+val).append(addreplist);
}
}
})
}
function rmcomment(){
alert('热门评论');
}
//主评论加载更多;
function ztmore(val){
if(val){
norep=0;
ztdjchange();
repztpage=1;
biaojicomm=val;
$(".dw-comment-comment_list").empty(pllisthp);
}
//alert(repztpage);
var pllisthp='';
$.ajax({
url:"http://www.fpwap.com/eckf/comments.php?type=66&rand="+Math.round(Math.random()*100),
type: 'GET',
data:{'classid':classid,'contentid':contentid,'page':repztpage,'biaoji':biaojicomm},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonp",
timeout: 10000,
success: function(data){
if(data.status){
if(data.data.counta){
if(val){
$(".dw-comment-comment_list").empty(pllisthp);
}
$.each(data.data.lista,function(i,n){
pllisthp+=''
});
if(data.data.counta<10){
$("#morztpl").html("已经到底部了哦");
}
$(".dw-comment-comment_list").append(pllisthp);
}else{
$("#morztpl").html("已经到底部了哦");
//alert("没有值");
}
}else{
$(".tucBotL").append('还没人吐槽,来一发吧!');
}
}
});
repztpage++;
}
//进入自动加载;
function jztc(){//
var addtulist='';
var pllisthp='';
$.ajax({
url:"http://www.fpwap.com/eckf/comments.php?type=6&rand="+Math.round(Math.random()*100),
type: 'GET',
data:{'classid':classid,'contentid':contentid},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonp",
timeout: 10000,
success: function(data){
islogin=data.data.userhtml;
$('.user-info').append(islogin);
sessinid=data.sessinid;
//if(data.data.userlist.id){
// sessinid=data.data.userlist.id;
// }else{
// sessinid=0;
// }
if(data.status){
if(data.data.count){
tcallcount=data.data.count;
$.each(data.data.list,function(i,n){
if(i<4){
var colortc="newtca";
}else if(i>=4 && i<=8){
var colortc="newtcb";
}else if(i>8 && i<=12){
var colortc="newtcc";
}else{
var colortc="";
}
addtulist+=''+n.content+''
});
$(".tucaoTop").append(addtulist);
$(".tucBotL").append('已有'+data.data.count+'人吐槽/表赞');
}else{
$(".tucBotL").append('还没人吐槽,来一发吧!');
}
if(data.data.counta){
$.each(data.data.lista,function(i,n){
pllisthp+=''
});
$(".dw-comment-comment_list").prepend(pllisthp);
$("#allpl").html(data.data.numlist);
allpl=data.data.numlist;
}else{
$('#morztpl span').text('还没有评论,快来抢沙发吧!');
}
}
}
});
}
function zthf(val){
// window.gt_captcha_obj.onRefresh(function(){
// pass = true;
// })
if(norep==val){
return;
}
var comiconlist=showiconlist('bqtwo',' ');
var repcmm= ''+
''+
''
if(val<0){
$('#pccct'+val).append(repcmm);
$("#yzmz").replaceWith($("#yzmzt"));
$('#pccct'+norep).empty();
if(norep>0){
$('#zcomma'+norep).empty();}
}else{
$('#zcomma'+val).append(repcmm);
$("#yzmz").replaceWith($("#yzmzt"));
$('#zcomma'+norep).empty();
if(norep<0){
$('#pccct'+norep).empty();}
}
norep=val;
$("#bqtwo li img").click(function () {
var kk = $(this).attr("title");
kk="[/表情"+kk+"]";
var newtextcontent=$("#rephfone").val();
$("#rephfone").val(newtextcontent+kk);
});
}
function xianshibq(){
$(".comment-expression-popu").show();
}
//点击吐槽;
function djtc(val,val1){
val1++;
$.ajax({
url:"http://www.fpwap.com/eckf/comments.php?type=7&rand="+Math.round(Math.random()*100),
type: 'GET',
data:{'tcid':val},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonp",
timeout: 10000,
success: function(data){
tcallcount++;
$(".tucBotL").empty();
$(".tucBotL").append('已有'+tcallcount+'人吐槽/表赞');
$("#idtc"+val).attr('title','已有'+val1+'人赞同, 您已投票');
}
});
}
$('#tucaolist').click(function(){
var tuchaoone=$.trim($('#text2').val());
if(tuchaoone==null || tuchaoone==''){
alert('输入能为空哦!');
}else{
$.ajax({
url:"http://www.fpwap.com/eckf/comments.php?type=5&rand="+Math.round(Math.random()*100),
type: 'GET',
data:{'content':tuchaoone,'classid':classid,'contentid':contentid,'sessinid':sessinid},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonp",
timeout: 10000,
success: function(data){
if(data.status){
$(".tucaoTop").prepend(''+data.data+'');
$('#text2').val(' ');
tcallcount++;
$(".tucBotL").empty();
$(".tucBotL").append('已有'+tcallcount+'人吐槽/表赞');
}else{
alert(data.info);
}
}
});
}
});
function repuser(val){
var rephfone=$.trim($('#rephfone').val());
var repliston='';
var geetest_challenge=$(".geetest_challenge").val();
var geetest_validate=$(".geetest_validate").val();
var geetest_seccode=$(".geetest_seccode").val();
if(rephfone.replace(/^\s+|\s+$/g,"")==null || rephfone.replace(/^\s+|\s+$/g,"")==''){
$('#errortipsbot').text('输入内容不能为空!');
setTimeout(function(){
$('#errortipsbot').text(' ');
}, 1500);
}else{
$.ajax({
url:"http://www.fpwap.com/eckf/comments.php?type=4&rand="+Math.round(Math.random()*100),
type: 'GET',
data:{'id':val,'uid':sessinid,'content':rephfone,'geetest_challenge':geetest_challenge,'geetest_validate':geetest_validate,'geetest_seccode':geetest_seccode},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonp",
timeout: 10000,
success: function(data){
if(data.status){
window.gt_captcha_obj.refresh();
repliston= ' '+
''+
'
'+data.data.phone1+'对'+data.data.phone2+'说
'+
'
'+data.data.content+'('+data.data.time+')
'+
'
'+
'
'
'
'+
''
if($('.rep'+val).html()==''||$('.rep'+val).html()==null){
var addkj= ''+
'';
}
$('.rep'+val).append(addkj);
$(".repnew"+data.data.ztid).prepend(repliston);
$('#rephfone').val(' ');
}else{
$('#errortipsbot').text(data.info);
setTimeout(function(){
$('#errortipsbot').text(' ');
}, 1500);
}
}
});
}
}
$("#ztcontent").click(function(){
ztdjchange();
});
function ztdjchange(){
$("#ztyzm").append("");
$("#zztyzm").replaceWith($("#yzmzt"));
if(norep>0){
$('#zcomma'+norep).empty();}
if(norep<0){
$('#pccct'+norep).empty();}
norep=0;
}
$('#pinglunzt').click(function(){
var geetest_challenge=$(".geetest_challenge").val();
var geetest_validate=$(".geetest_validate").val();
var geetest_seccode=$(".geetest_seccode").val();
var content=$("#ztcontent").val();
if(content.replace(/^\s+|\s+$/g,"")==null || content.replace(/^\s+|\s+$/g,"")==''){
$('#errortips').text('输入内容不能为空!');
setTimeout(function(){
$('#errortips').text(' ');
}, 1500);
return;
}
$.ajax({
url:"http://www.fpwap.com/eckf/comments.php?type=3&rand="+Math.round(Math.random()*100),
type: 'GET',
data:{'content':content,'classid':classid,'contentid':contentid,'uid':sessinid,'geetest_challenge':geetest_challenge,'geetest_validate':geetest_validate,'geetest_seccode':geetest_seccode},
dataType: 'jsonp',
jsonp: "callbackparam",
jsonpCallback:"returnJsonp",
timeout: 10000,
success: function(data){
if(data.status){
window.gt_captcha_obj.refresh();
//alert(data.info);
$('#ztcontent').val(' ');
var userplone='
'+n.phone+'
'+ ''+n.content+'
'+ ''; $.each(n.replist,function(k,repreplist){ pllisthp+= '- '+
'
'+
' 回复 '+
''
' '+
' '
});
pllisthp+='
'+ ''+repreplist.phone1+'对'+repreplist.phone2+'说
'+ ''+repreplist.content+'('+repreplist.time+')
'+ '