//查询售电文章是否过期 $.getJSON('http://www.sgcio.com/index.php?m=content&c=index&a=get_sell&catid=2&id=79812&modelid=1&'+Math.random()+'&callback=?', function(data){ //alert(data.fettle); if(data.timearr==2){ $('#fettle').html('已失效'); }else { if(data.fettle==1){ $('#fettle').html('热销中'); }else if(data.fettle==2){ $('#fettle').html('已售完'); }else if(data.fettle==3){ $('#fettle').html('已失效'); }else{ $('#fettle').html(''); } } }) //查询购电文章是否过期 $.getJSON('http://www.sgcio.com/index.php?m=content&c=index&a=get_buy&catid=2&id=79812&modelid=1&'+Math.random()+'&callback=?', function(data){ //alert(data.fettle); if(data.timearr==2){ $('#fettle_buy').html('已失效'); }else { if(data.fettle==1){ $('#fettle_buy').html('求购中'); }else if(data.fettle==2){ $('#fettle_buy').html('已购买'); }else if(data.fettle==3){ $('#fettle_buy').html('已失效'); }else{ $('#fettle_buy').html(''); } } }) //收藏 function digg() { $.getJSON('http://m.sgcio.com/index.php?m=digg&c=index&a=post&id=2-79812-1&typeid=1&'+Math.random()+'&callback=?', function(data){ if(data.status==1) { if(data.isup==1){ //layer.msg('收藏成功'); layer.open({content: '收藏成功',skin: 'msg',time: 2}); $('.btn_digg').addClass('cur'); $('.btn_digg').attr('data-islike','true'); $('.article-like .text').html('已收藏'); }else{ //layer.msg('取消收藏'); layer.open({content: '取消收藏',skin: 'msg',time: 2}); $('.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="http://m.sgcio.com/index.php?m=member&c=wap&a=login&forward=http%3A%2F%2Fwww.sgcio.com%2Fnews%2Fzh%2F79812.html&siteid=1"; }); } }) } $.getJSON('http://m.sgcio.com/index.php?m=digg&c=index&a=get&id=2-79812-1&typeid=1&'+Math.random()+'&callback=?', function(data){ var userid = ''; 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('http://m.sgcio.com/index.php?m=digg&c=index&a=post&id=2-79812-1&typeid=2&'+Math.random()+'&callback=?', function(data){ if(data.status==1) { if(data.isup==1){ //layer.msg('赞一个'); layer.open({content: '赞一个',skin: 'msg',time: 2}); $('.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('取消赞'); layer.open({content: '取消赞',skin: 'msg',time: 2}); $('.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="http://m.sgcio.com/index.php?m=member&c=wap&a=login&forward=http%3A%2F%2Fwww.sgcio.com%2Fnews%2Fzh%2F79812.html&siteid=1"; }); } }) } //支持 function support(id, commentid) { $.getJSON('http://www.sgcio.com/index.php?m=comment&c=index&a=support&format=jsonp&commentid='+commentid+'&id='+id+'&callback=?', function(data){ if(data.status == 1) { layer.msg('顶一下'); $('#support_'+id).html(parseInt($('#support_'+id).html())+1); $('#cdigg_'+commentid+'_'+id).addClass('digged'); } else { layer.msg(data.msg); } }); } $.getJSON('http://m.sgcio.com/index.php?m=digg&c=index&a=get&id=2-79812-1&typeid=2&'+Math.random()+'&callback=?', function(data){ var userid = ''; 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('个赞'); } } })