style.js 3.05 KB
$(
    function () {
        $(".rule-btn").click(
            function () {
                $("body").append("<div class='dia-bg'></div>");
                $(".dia-c").show();
            }
        );
        // $(".dia-c").click(
        //     function (){
        //         $(this).hide();
        //         $(".dia-bg").remove();
        //     }
        // );
        $(".dia-c .close-btn").live("click", function () {
            $(this).parents(".dia-c").hide();
            $(".dia-bg").remove();
        });
        $(".dia-c-2 .close-btn").live("click",function (){
            $(this).parents(".dia-c-2").remove();
            $(".dia-bg").remove();
        });
        $(".check-awa-btn").click(
            function () {
                $(".awa-list-c").toggle();
            }
        );
        $(".close-list-btn").click(
            function () {
                $(this).parents(".awa-list-c").hide();
            }
        );
        $(".awa-cover .close-btn").live("click", function () {
            $(".dia-bg").remove();
            $(".awa-cover").remove();
        });
        $(".dia-c .try-again").live("click", function () {
                $(this).parents(".dia-c").remove();
                $(".dia-bg").remove();
            }
        );
    }
);
function awaCover(prize) {
    var cHtml = '<div class="awa-cover">' +
        '<div class="awa-cover-main">' +
        '<p class="title-1">' + prize + '</p>' +
        '<p class="title-2">现金券可至【我的-我的资产】查看</p>' +
        '<img class="pic-1" src="images/coupon.gif" />' +
        '<a>' +
        '<img class="pic-2" src="images/awa-button.png" />' +
        '</a>' +
        '<img class="pic-3" src="images/go_word.png" />' +
        '</div>' +
        '<a class="close-btn">' +
        '<img src="images/close-btn.png" />' +
        '</a>' +
        '</div>' +
        '<div class="dia-bg"></div>'
    return cHtml;
}

function addPrize(uid, boxid) {
    var str;
    $.ajax({
        url: '/activity/brandDraw/addBrandActPrize?uid=' + uid + '&boxId=' + boxid,
        type: "get",
        contentType: "application/json",
        dataType: 'json',
        async:false, //为了简便,设置为同步操作
        success: function (data) {
            str=data;
        }
    });
    return str ;
}


function awaBrand(pic) {
    var cHtml = '<div class="dia-c-2" style="display:block;">' +
        '<a class="close-btn">' +
        '<img src="images/close-btn.png" />' +
        '</a>' +
        '<img class="try-again" src='+pic+' />' +
        '</div>' +
        '<div class="dia-bg"></div>'
    return cHtml;
}
function noAwa() {
    var cHtml = '<div class="dia-c-2" style="display:block;">' +
        '<a class="close-btn">' +
        '<img src="images/close-btn.png" />' +
        '</a>' +
        '<img class="try-again-2" src="images/coupon.gif" />' +
        '</div>' +
        '<div class="dia-bg"></div>'
    return cHtml;
}
function opened(thisBox,imgurl){
    $(".a-box-ul li:eq("+ thisBox +")").find("img").remove();
    $(".a-box-ul li:eq("+ thisBox +")").append("<img src="+imgurl+" />");
}