commentReply.html 5.08 KB
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <script src="/pfcms/js/include.js"></script>
    <script src="/pfcms/js/ajaxfileupload.js"></script>
    <link rel="stylesheet" href="/pfcms/css/swiper.min.css">
    <script src="/pfcms/js/utils/swiper.min.js"></script>
</head>
<!--<div region="center" id="articleDetail" style="margin-left: 20px">-->
<body>
<script>
    function getUserInfo(){
        $.get(serverContextPath + "/grassArticle/getUserInfo?uid=" + $("#replyUid").textbox("getValue"), function (result) {
            if (result.code == 200) {
                if (result.data != null && result.data != '') {
                    var headIco = result.data.headIco.substring(0, result.data.headIco.indexOf("?"));
                    var html = '';
                    html += "<span style='font-size: 18px;'>&nbsp&nbsp<img src='" + headIco + "' width='60px;' height='60px;'></span>&nbsp&nbsp&nbsp&nbsp";
                    html += "<span style='font-size: 15px;'>&nbsp&nbsp<label>" + result.data.nickName + "</label></span>";
                    $("#userInfo").html(html);
                } else {
                    var html = '<span style="color:red;font-size: 15px;">获取用户信息失败,请检查uid输入是否正确</span>';
                    $("#userInfo").html(html);
                }
            }
            else {
                var html = '<span style="color:red;font-size: 15px;">获取用户信息失败,请稍后重试</span>';
                $("#userInfo").html(html);
            }
        });
    }

    function replyNow(){
        var articleId = paramObject.mkData.articleId;
        var commentId = paramObject.mkData.commentId;
        var replyUid = $("#replyUid").textbox("getValue");
        var content = $("#content").val();
        if (!replyUid || replyUid == '') {
            alert("请先选择马甲!");
            return ;
        }
        if (!content || content == '') {
            alert("请填写回复内容!");
            return ;
        }
        $.get(serverContextPath + "/grassArticleComment/addGrassArticleComment?destId=" + articleId +
            "&addType=" + 1 + "&uid=" + replyUid + "&content=" + content + "&commentId=" + commentId, function (data) {
            if (data.code != 200) {
                alert(data.message);
            } else {
                $.messager.show({
                    msg: "回复成功!",
                    height: 120
                });
                //刷新当前页面
                location.reload();
            }
        });
    }

    function closeNow(){
        location.reload();
    }

</script>
    <div  id="tt" class="easyui-layout" fit="true" style="margin:0">
        <form name="commentReplyForm" id="commentReplyForm" fit="true" method="post">
            <div style="margin-top: 20px;margin-left: 30px;" id="replyDiv">
                <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="replyTable">

                    <tr style="height: 10%">
                        <td style="width:100% ">
                            <div  style="float: left;width:50%;"    >
                                <span style="color:red">*</span><label style="font-size: 14px;">选择马甲</label>  <br>
                                <input id="replyUid" name="replyUid" style="width:30% "  class="easyui-textbox"/>
                                <a href="#" class="easyui-linkbutton" onclick="getUserInfo()" data-options="menu:'#mm1',iconCls:'icon-edit'">确定</a>
                                <br>
                            </div>
                            <div id="userInfo"  style="float: left;margin-left: 30px;">
                            </div>
                        </td>
                    </tr>

                    <tr style="height: 10%">
                        <td style="width:100%; word-wrap:break-word;" >
                            <span style="color:red">*</span><label style="font-size: 14px;">回复内容(必填项,内容不能为空)</label> <br>

                            <div style="width:45%; word-wrap:break-word;float: left;position: relative" >
                                <textarea rows="5" id="content" style="width:60%; white-space: pre-wrap;" name = "content" class="form-control" placeholder="不超过50字" required="" maxlength="50"></textarea>
                            </div>

                            <!--<div style="clear: both;"> <span id="content-count">0</span>/500</div>-->
                        </td>
                    </tr>
                    <tr style="height: 20%">
                        <td style="width:20% ">
                            <a href="#" class="easyui-linkbutton" onclick="replyNow()" data-options="menu:'#mm1',iconCls:'icon-edit'">立即回复</a>
                            <a href="#" class="easyui-linkbutton" onclick="closeNow()" data-options="menu:'#mm1',iconCls:'icon-cancel'">关闭</a>
                            <!--<input id="replyBtn" type="button" onclick="test()"/>-->
                        </td>

                    </tr>

                </table>
            </div>

        </form>

    </div>
</body>
</html>