var ue = UE.getEditor('txtContent', { toolbars: [ [ 'undo', 'redo', 'bold', 'indent', 'italic', 'underline', 'strikethrough', 'subscript', 'fontborder', 'superscript', 'formatmatch', 'blockquote', 'pasteplain', 'horizontal', 'removeformat', 'unlink', 'cleardoc', 'fontsize', 'paragraph', 'simpleupload', 'link', 'justifyleft', 'justifyright', 'justifycenter', 'justifyjustify', 'forecolor', 'backcolor', 'imagecenter', 'wordimage', 'lineheight', 'edittip ', 'customstyle'] ], wordCount: false, zIndex: 2000 }); ue.ready(function () { ue.addListener('blur', function (editor) { ue.sync() }); }); $(function () { $(".header .nav .nav-li").eq(8).addClass("ac"); }); $.Search(); //保存普通提问 var posting = false; var myQuiz = $('#myQuiz'); function Save() { $('textarea').text(ue.getContent()); if (!posting && myQuiz.valid()) { posting = true; var json = myQuiz.find('input,textarea').serialize(); $.post('Ask', json, function (res) { if (res > 0) { layer.msg('保存成功', function () { location.reload(); }); } else { layer.msg('保存失败,请稍后重试!'); posting = false; } }); } } var replyid = 0; //显示付费提问窗口 function ShowAsk(obj) { obj = $(obj); var json = JSON.parse(obj.attr('data-json')); replyid = json.id; $('#money').text(json.money); myQuiz.modal('show'); } function SavePayAsk() { $('textarea').text(ue.getContent()); if (!posting && myQuiz.valid()) { posting = true; var json = myQuiz.find('input,textarea,select').serialize(); json +='&questioner='+replyid; $.post('PayAsk', json, function (res) { if (res > 0) { layer.msg('保存成功,即将跳转到支付页面...', function () { location.href = 'PayPage?id='+res; }); } else { layer.msg('保存失败,请稍后重试!'); posting = false; } }); } }