commentReply.html
5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!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;'>  <img src='" + headIco + "' width='60px;' height='60px;'></span>    ";
html += "<span style='font-size: 15px;'>  <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>