Commit ca6d006a11a257c70d57564eb0cddeef90e69981
1 parent
ccff7bdc
【留言板】审核管理 界面实现
Showing
3 changed files
with
109 additions
and
10 deletions
trunk/www/apidocassets/javascript/mess_admin.js
... | ... | @@ -2,8 +2,17 @@ |
2 | 2 | * Created by Dell on 2018/9/5. |
3 | 3 | */ |
4 | 4 | |
5 | -function jumpDel(mid){ | |
6 | - alert("确认删除该条留言?"); | |
5 | +/** | |
6 | + * 删除留言 ajax实现 | |
7 | + * @param mid:留言ID | |
8 | + * @returns {boolean} | |
9 | + */ | |
10 | +function jumpDel(mid) | |
11 | +{ | |
12 | + var delCon = confirm("确认删除该条留言?"); | |
13 | + if (delCon === false) { | |
14 | + return false; | |
15 | + } | |
7 | 16 | $.ajax({ |
8 | 17 | url:'http://lys.com/wx5019b9c455ea9c81/Message/Apicp/Message/MessDel/Del/?mid='+mid, |
9 | 18 | type:'post', |
... | ... | @@ -12,6 +21,10 @@ function jumpDel(mid){ |
12 | 21 | }, |
13 | 22 | dataType:'json', |
14 | 23 | success:function(data){ |
24 | + if (data['result'] == 1) { | |
25 | + alert("删除成功。"); | |
26 | + window.location.href = './list.php'; | |
27 | + } | |
15 | 28 | |
16 | 29 | }, |
17 | 30 | error:function(e){ |
... | ... | @@ -19,4 +32,39 @@ function jumpDel(mid){ |
19 | 32 | console.log("error:"+e); |
20 | 33 | } |
21 | 34 | }); |
22 | -} | |
23 | 35 | \ No newline at end of file |
36 | +} | |
37 | + | |
38 | +function jumdAudit(mid) | |
39 | +{ | |
40 | + | |
41 | + var status = 0; | |
42 | + | |
43 | + if ($('#audit_2').prop('checked') != false) { | |
44 | + var reason = $('#reason').val(); | |
45 | + if ( reason == '') { | |
46 | + alert('请填写驳回原因。'); | |
47 | + return false; | |
48 | + } | |
49 | + status = $('#audit_2').val(); | |
50 | + } | |
51 | + if ($('#audit_3').prop('checked') != false ) { | |
52 | + status = $('#audit_3').val(); | |
53 | + } | |
54 | + if(status === 0){ | |
55 | + alert('请选择是否通过审核。'); | |
56 | + return false; | |
57 | + } | |
58 | + | |
59 | + $.ajax({ | |
60 | + url:'', | |
61 | + type:'', | |
62 | + dataType:'', | |
63 | + data:{ | |
64 | + 'mid':mid, | |
65 | + 'status':status, | |
66 | + 'reason':reason | |
67 | + }, | |
68 | + success:function(data){}, | |
69 | + error:function(e){} | |
70 | + }); | |
71 | +} | ... | ... |
trunk/www/mess_admin/detail.php
... | ... | @@ -16,13 +16,22 @@ if ($mid !== null) { |
16 | 16 | $mess_detail = json_decode($mess_res,true)['result']; |
17 | 17 | } |
18 | 18 | } |
19 | + | |
20 | +$scenario = isset($_GET['scenario']) ? $_GET['scenario'] : 'detail'; | |
21 | +$cap = '留言详细内容'; | |
22 | +if ($scenario == 'detail') { | |
23 | + $title = '留言详细'; | |
24 | +}else if ($scenario == 'audit') { | |
25 | + $title = '留言审核'; | |
26 | +} | |
27 | + | |
19 | 28 | ?> |
20 | 29 | |
21 | 30 | <!doctype html> |
22 | 31 | <html lang="en"> |
23 | 32 | <head> |
24 | 33 | <meta charset="UTF-8"> |
25 | - <title>留言详细</title> | |
34 | + <title><?php echo $title; ?></title> | |
26 | 35 | <link href="../apidocassets/css/mess_front.css" type="text/css" rel="stylesheet" > |
27 | 36 | <script type="text/javascript" src="../apidocassets/javascript/jquery.min.js"></script> |
28 | 37 | <script type="text/javascript" src="../apidocassets/javascript/mess_admin.js"></script> |
... | ... | @@ -50,7 +59,7 @@ if ($mid !== null) { |
50 | 59 | |
51 | 60 | <div class="con"> |
52 | 61 | <table> |
53 | - <caption><h4>留言详细内容</h4></caption> | |
62 | + <caption><h4><?php echo $cap; ?></h4></caption> | |
54 | 63 | <tr></tr> |
55 | 64 | <tr> |
56 | 65 | <td><h5>用户信息</h5></td> |
... | ... | @@ -153,6 +162,17 @@ if ($mid !== null) { |
153 | 162 | </strong></label> |
154 | 163 | </td> |
155 | 164 | </tr> |
165 | + <?php | |
166 | + if ($mess_detail['m_status'] == 2) { | |
167 | + ?> | |
168 | + <tr> | |
169 | + <td> | |
170 | + | |
171 | + <label>未通过原因:</label> | |
172 | + <label><strong><?php echo $mess_detail['m_reason']; ?></strong></label> | |
173 | + </td> | |
174 | + </tr> | |
175 | + <?php } ?> | |
156 | 176 | <tr> |
157 | 177 | <td> |
158 | 178 | |
... | ... | @@ -161,11 +181,40 @@ if ($mid !== null) { |
161 | 181 | </td> |
162 | 182 | </tr> |
163 | 183 | <tr></tr> |
184 | + <?php | |
185 | + if ($scenario == 'audit' && $mess_detail['m_status'] == 1) { | |
186 | + ?> | |
187 | + <tr> | |
188 | + <td> | |
189 | + <h4> | |
190 | + <label>开始审核:</label> | |
191 | + | |
192 | + <input type="radio" name="audit" value="3" id="audit_3" onclick="javascript:$('#tr_rea').css('display','none');"> 通过 | |
193 | + | |
194 | + <input type="radio" name="audit" value="2" id="audit_2" onclick="javascript:$('#tr_rea').css('display','inherit');"> 不通过 | |
195 | + </h4> | |
196 | + </td> | |
197 | + </tr> | |
198 | + <tr id="tr_rea" style="display: none;" > | |
199 | + <td> | |
200 | + <h4> | |
201 | + <label>驳回原因:</label> | |
202 | + <textarea name="reason" style="resize: none;" cols="40" id="reason" ><?php echo $mess_detail['m_reason']; ?></textarea> | |
203 | + </h4> | |
204 | + </td> | |
205 | + </tr> | |
206 | + <?php } ?> | |
207 | + | |
208 | + <tr></tr> | |
164 | 209 | <tr> |
165 | 210 | <td> |
166 | - | |
167 | 211 | <button value="返回" onclick="javascript:history.back();">返回</button> |
168 | - <button value="删除" onclick="javascript:jumpDel(<?php echo $mess_detail['m_id']; ?>);">删除</button> | |
212 | + <?php if ($scenario == 'detail') { ?> | |
213 | + <button value="删除" onclick="javascript:jumpDel(<?php echo $mess_detail['m_id']; ?>);">删除</button> | |
214 | + <?php } ?> | |
215 | + <?php if ($scenario == 'audit') {?> | |
216 | + <button value="提交" onclick="javascript:jumdAudit(<?php echo $mess_detail['m_id']; ?>);">提交审核</button> | |
217 | + <?php } ?> | |
169 | 218 | </td> |
170 | 219 | </tr> |
171 | 220 | </table> | ... | ... |
trunk/www/mess_admin/list.php
... | ... | @@ -19,6 +19,8 @@ |
19 | 19 | <title>留言管理</title> |
20 | 20 | <meta charset="utf-8"> |
21 | 21 | <link type="text/css" rel="stylesheet" href="../apidocassets/css/mess_front.css" > |
22 | + <script type="text/javascript" src="../apidocassets/javascript/jquery.min.js"></script> | |
23 | + <script type="text/javascript" src="../apidocassets/javascript/mess_admin.js"></script> | |
22 | 24 | <style type="text/css"> |
23 | 25 | .list table{ |
24 | 26 | width:100%; |
... | ... | @@ -80,12 +82,12 @@ |
80 | 82 | <a href="detail.php?mid=<?php echo $value['m_id']; ?>">详细内容</a> |
81 | 83 | <?php |
82 | 84 | if ($value['m_status'] == 1) { |
83 | - echo "<a href=audit.php?mid={$value['m_id']}>审核</a> "; | |
85 | + echo "<a href=detail.php?mid={$value['m_id']}&scenario=audit>审核</a> "; | |
84 | 86 | } else if($value['m_status'] == 2) { |
85 | 87 | echo "<a href='##'>再次审核</a> "; |
86 | - echo "<a href=del.php?mid={$value['m_id']}>删除</a> "; | |
88 | + echo "<a onclick='javascript:jumpDel({$value['m_id']}); return false;'>删除</a> "; | |
87 | 89 | } else if($value['m_status'] == 3) { |
88 | - echo "<a href={$value['m_id']}>删除</a> "; | |
90 | + echo "<a onclick='javascript:jumpDel({$value['m_id']}); return false;'>删除</a> "; | |
89 | 91 | } |
90 | 92 | ?> |
91 | 93 | </td> | ... | ... |