点赞样式

//初始化点赞
var $praise_id = '<?php echo $praise; ?>';
$(function () {
    if ($praise_id){
        $(".bor:eq(0)").css({
            border: "1px solid #06c1ae",
            "border-radius": "5px",
            "color": "#06c1ae"
        }).html("已点赞");
    }
});
$(".bor:eq(0)").click(function() {
    var text = $(this).text();
    if (text == '点赞'){
        $.post("{pigcms{:U('voluntPraise')}",{member_id:$("input[name='id']").val()},function (result) {
            if (result.status == 300){
                alert(result.message);
                window.location.href = "{pigcms{:U('Login/index')}";
            }else{
                $(".bor:eq(0)").css({
                    border: "1px solid #06c1ae",
                    "border-radius": "5px",
                    "color": "#06c1ae"
                }).html("已点赞");
            }
        },'json')
    }

});
posted @ 2020-07-08 14:18  王玉岩  阅读(267)  评论(0编辑  收藏  举报