/*user*/ $(function(){ $(".user-wrap").load("https://www.zidonghua.com.cn/index.php?m=member&c=index&a=mini&type=1&forward="+encodeURIComponent(location.href)+"&siteid=1"); }); //收藏 function digg() { $.getJSON('https://www.zidonghua.com.cn/index.php?m=digg&c=index&a=post&id=2-3535-1&typeid=1&'+Math.random()+'&callback=?', function(data){ if(data.status==1) { if(data.isup==1){ layer.msg('收藏成功'); $('.btn_digg').addClass('cur'); $('.btn_digg').attr('data-islike','true'); $('.article-like .text').html('已收藏'); }else{ layer.msg('取消收藏'); $('.btn_digg').removeClass('cur'); $('.btn_digg').attr('data-islike','false'); $('.article-like .text').html('我要收藏'); } }else { //alert(data.data); layer.msg(data.data,{ time: 2000 }, function(){ window.location.href="https://www.zidonghua.com.cn/index.php?m=member&c=index&a=login&forward=&siteid=1"; }); } }) } $.getJSON('https://www.zidonghua.com.cn/index.php?m=digg&c=index&a=get&id=2-3535-1&typeid=1&'+Math.random()+'&callback=?', function(data){ var userid = '0'; if(userid){ if(data.data!=0){ $('.btn_digg').addClass('cur'); $('.btn_digg').attr('data-islike','true'); $('.article-like .text').html('已收藏'); }else { $('.btn_digg').removeClass('cur'); $('.btn_digg').attr('data-islike','false'); $('.article-like .text').html('我要收藏'); } }else{ $('.btn_digg').removeClass('cur'); $('.btn_digg').attr('data-islike','false'); $('.article-like .text').html('我要收藏'); } }) //赞 function digg_up() { $.getJSON('https://www.zidonghua.com.cn/index.php?m=digg&c=index&a=post&id=2-3535-1&typeid=2&'+Math.random()+'&callback=?', function(data){ if(data.status==1) { if(data.isup==1){ layer.msg('赞一个'); $('.btn_digg_up').addClass('cur'); $('.btn_digg_up').attr('data-isup','true'); $('.article-up .text').children('em').html(data.data); $('.article-up .text').children('span').html('个赞'); }else{ layer.msg('取消赞'); $('.btn_digg_up').removeClass('cur'); $('.btn_digg_up').attr('data-isup','false'); $('.article-up .text').children('em').html(data.data); $('.article-up .text').children('span').html('个赞'); } }else { //alert(data.data); layer.msg(data.data,{ time: 2000 }, function(){ window.location.href="https://www.zidonghua.com.cn/index.php?m=member&c=index&a=login&forward=&siteid=1"; }); } }) } $.getJSON('https://www.zidonghua.com.cn/index.php?m=digg&c=index&a=get&id=2-3535-1&typeid=2&'+Math.random()+'&callback=?', function(data){ var userid = '0'; if(userid){ if(data.data!=0){ $('.btn_digg_up').addClass('cur'); $('.btn_digg_up').attr('data-isup','true'); $('.article-up .text').children('em').html(data.data); $('.article-up .text').children('span').html('个赞'); }else { $('.btn_digg_up').removeClass('cur'); $('.btn_digg_up').attr('data-isup','false'); $('.article-up .text').children('em').html(''); $('.article-up .text').children('span').html('点个赞吧'); } }else { $('.btn_digg_up').removeClass('cur'); $('.btn_digg_up').attr('data-isup','false'); if(data.data==0){ $('.article-up .text').children('em').html(''); $('.article-up .text').children('span').html('点个赞吧'); }else{ $('.article-up .text').children('em').html(data.data); $('.article-up .text').children('span').html('个赞'); } } }) //踩 function digg_down() { $.getJSON('https://www.zidonghua.com.cn/index.php?m=digg&c=index&a=post&id=2-3535-1&typeid=3&'+Math.random()+'&callback=?', function(data){ if(data.status==1) { if(data.isup==1){ layer.msg('踩了一下'); $('.btn_digg_down').addClass('cur'); $('.btn_digg_down').attr('data-isdown','true'); $('.article-down .text').children('em').html(data.data); $('.article-down .text').children('span').html('被踩'); $('.article-down .text').children('font').html('下'); }else{ layer.msg('取消踩'); $('.btn_digg_down').removeClass('cur'); $('.btn_digg_down').attr('data-isdown','false'); $('.article-down .text').children('em').html(data.data); $('.article-down .text').children('span').html('被踩'); $('.article-down .text').children('font').html('下'); } }else { //alert(data.data); layer.msg(data.data,{ time: 2000 }, function(){ window.location.href="https://www.zidonghua.com.cn/index.php?m=member&c=index&a=login&forward=&siteid=1"; }); } }) } $.getJSON('https://www.zidonghua.com.cn/index.php?m=digg&c=index&a=get&id=2-3535-1&typeid=3&'+Math.random()+'&callback=?', function(data){ var userid = '0'; if(userid){ if(data.data!=0){ $('.btn_digg_down').addClass('cur'); $('.btn_digg_down').attr('data-isdown','true'); $('.article-down .text').children('em').html(data.data); $('.article-down .text').children('span').html('被踩'); $('.article-down .text').children('font').html('下'); }else { $('.btn_digg_down').removeClass('cur'); $('.btn_digg_down').attr('data-isdown','false'); $('.article-down .text').children('em').html(''); $('.article-down .text').children('font').html(''); $('.article-down .text').children('span').html('踩一下'); } }else { $('.btn_digg_down').removeClass('cur'); $('.btn_digg_down').attr('data-isdown','false'); if(data.data==0){ $('.article-down .text').children('em').html(''); $('.article-down .text').children('font').html(''); $('.article-down .text').children('span').html('踩一下'); }else{ $('.article-down .text').children('em').html(data.data); $('.article-down .text').children('span').html('被踩'); $('.article-down .text').children('font').html('下'); } } })