Commit 98083ba177c04ff4b740bf8437f805bc30271aa6
1 parent
9011d217
【留言板】手机端留言列表 界面实现
Showing
3 changed files
with
63 additions
and
7 deletions
trunk/www/apidocassets/css/mess_front.css
trunk/www/mess_front/input.PHP
trunk/www/mess_front/list.php
1 | +<?php | |
2 | + | |
3 | +$page = isset($_GET['page']) ? $_GET['page'] : 0; | |
4 | +$prePage = ($page - 1)<0 ? 0 : ($page - 1); | |
5 | +$nextPage = $page + 1; | |
6 | + | |
7 | +$mess_res = file_get_contents("http://lys.com/wx5019b9c455ea9c81/Message/Api/Message/MessList/getList/?page={$page}"); | |
8 | +if ($mess_res) { | |
9 | + $mess_list = json_decode($mess_res,true)['result']; | |
10 | +} | |
11 | + | |
12 | +?> | |
1 | 13 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
2 | 14 | "http://www.w3.org/TR/html4/loose.dtd"> |
3 | 15 | <html> |
... | ... | @@ -5,15 +17,60 @@ |
5 | 17 | <title>留言列表</title> |
6 | 18 | <meta charset="utf-8"> |
7 | 19 | <link type="text/css" rel="stylesheet" href="../apidocassets/css/mess_front.css" > |
20 | + <style type="text/css"> | |
21 | + .list table{ | |
22 | + width:100%; | |
23 | + border-collapse: collapse; | |
24 | + } | |
25 | + .list tr th,td{ | |
26 | + font-size: 14px; | |
27 | + font-weight: normal; | |
28 | + border: 1px solid; | |
29 | + } | |
30 | + </style> | |
8 | 31 | </head> |
9 | 32 | <body> |
10 | 33 | |
11 | - <div class="con"> | |
34 | + <div class="con list"> | |
12 | 35 | <table> |
13 | - | |
36 | + <caption><h3>留言列表</h3></caption> | |
37 | + <tr> | |
38 | + <th>标题</th> | |
39 | + <th>内容</th> | |
40 | + <!-- <th>留言者</th>--> | |
41 | + <th>留言时间</th> | |
42 | + </tr> | |
43 | + <?php | |
44 | + foreach ( $mess_list as $item=>$value) { | |
45 | + ?> | |
46 | + <tr> | |
47 | + <td><label> | |
48 | + <?php echo $value['m_title'] ?> | |
49 | + </label></td> | |
50 | + <td><label> | |
51 | + <?php echo $value['m_content']; ?> | |
52 | + </label></td> | |
53 | + <td> | |
54 | + <?php echo $value['ins_date']; ?> | |
55 | + </td> | |
56 | + </tr> | |
57 | + <?php | |
58 | + } | |
59 | + ?> | |
60 | + <tr> | |
61 | + <td colspan="3"> | |
62 | + <label> | |
63 | + <a href="input.php" target="_blank">在线留言</a> | |
64 | + </label> | |
65 | + <span style="width: 300px; display: inline-block;"></span> | |
66 | + <label> | |
67 | + <a href="?page=<?php echo $prePage; ?>">上一页</a> | |
68 | + <a href="?page=<?php echo $nextPage; ?>" >下一页</a> | |
69 | + </label> | |
70 | + </td> | |
71 | + </tr> | |
14 | 72 | </table> |
15 | - | |
16 | - <h6><a href="input.php" target="_blank">在线留言</a></h6> | |
17 | 73 | </div> |
74 | + | |
18 | 75 | </body> |
19 | 76 | </html> |
20 | 77 | \ No newline at end of file | ... | ... |