message.html
2.44 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
<link type="text/css" rel="stylesheet" href="{url:#css/ucenter.css}" />
<div class="container clearfix">
{widget:name=sub_navs action=ucsidebar sidebar=$sidebar act=$actionId}
<div class="content clearfix uc-content">
<h1 class="title"><span>我的消息:</span></h1>
<div class="tab">
<ul class="tab-head">
<li>未读消息<i></i></li>
<li>已读消息<i></i></li>
</ul>
<div class="tab-body" style="padding: 20px 10px;">
<div id="message-n" class="js-template">
<div class="page-content">
<div class="box mt10">
<h2><span>{title}</span> <span class="fr">{time}</span></h2>
<div class="p10">
{content}
<p class="tr"><a href="javascript:;" class="btn btn-main btn-mini" onclick="message_read('{id}')">标记已阅读</a></p>
</div>
</div>
</div>
<div class="page-nav"></div>
</div>
<div id="message-y" class="js-template">
<div class="page-content">
<div class="box mt10">
<h2><span>{title}</span> <span class="fr">{time}</span></h2>
<div class="p10">
{content}
<p class="tr"><a href="javascript:;" class="btn btn-default btn-mini" onclick="message_del('{id}')">删除</a></p>
</div>
</div>
</div>
<div class="page-nav"></div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function message_n(){
$("#message-n").Paging({
url:'{url:/ucenter/get_message}',
params:{status:'n'}
});
}
function message_y(){
$("#message-y").Paging({
url:'{url:/ucenter/get_message}',
params:{status:'y'}
});
}
message_n();
message_y();
function message_read(id){
$.post("{url:/ucenter/message_read}",{id:id},function(data){
if(data['status']=='success'){
message_n();
message_y();
}
},'json')
}
function message_del(id){
$.post("{url:/ucenter/message_del}",{id:id},function(data){
if(data['status']=='success'){
message_y();
}
},'json')
}
</script>