金额 var price = 0; price = $("li[data-type=" + data_type + "]").attr("data-price"); $("#d_tool_p").text(price * $("#d_tool_num").val()); }); $("#d_tool_submit").click(function () { var tool_type = data_type; var tool_num = $("#d_tool_num").val(); var tool_mesg = $("#d_tool_note").val(); var tool_bid = $("#d_tool_bid").val(); $.ajax({ type: "POST", url: "/Tool/toolAdd", data: {tool_type: tool_type, num: tool_num, mesg: tool_mesg, bid: tool_bid}, dataType: "json", cache: false, success: function (msg) { if (msg['code'] == 1) { $.jBox.tip('打赏成功', 'success', { timeout: 1500, closed: function () { location.reload(); } }); } else if (msg['code'] == -1) { login_box(); } else if (msg['code'] == -2) { $.jBox.tip('酷读币不够', 'warning', { timeout: 1500 }); } else if (msg['code'] == -3) { $.jBox.tip('所选道具数量有误', 'warning', { timeout: 1500 }); } else { $.jBox.tip('打赏失败', 'warning', { timeout: 1500 }); } } }); }); }); */ //表情解析 $(document).ready(function () { $("[class*='emotion-msg']").each( function () { var content = $(this).text(); $(this).html(content).parseEmotion(); } ); }); $('.face').bind({ click: function (event) { if (!$('#sinaEmotion').is(':visible')) { $(this).sinaEmotion('#form_con'); event.stopPropagation(); } } }); //自动订阅 $(document).ready(function () { $(".autosubcheck").click(function () { var addsub = $(this); var bid = $(this).attr("subbid"); $.ajax({ url: "/book/autosubset.html", type: 'POST', dataType: 'json', data: {bid: bid}, success: function (data) { if (data == -1) { login_box(); } else if (data == 1) { if (addsub.hasClass("check_off")) { addsub.removeClass("check_off").addClass("check_on").attr("title", "点击关闭"); } else { addsub.removeClass("check_on").addClass("check_off").attr("title", "点击开启"); } } } }); }); });