TaoLer/view/index/user/message.html

47 lines
1.2 KiB
HTML
Raw Normal View History

2020-01-01 13:17:19 +08:00
{extend name="public/user" /}
{block name="content"}
<div class="layui-tab layui-tab-brief" lay-filter="user" id="LAY_msg" style="margin-top: 15px;">
<button class="layui-btn layui-btn-danger" id="LAY_delallmsg">清空全部消息</button>
2020-03-29 19:57:18 +08:00
<div id="LAY_minemsg" style="margin-top: 10px;"></div>
2020-01-01 13:17:19 +08:00
</div>
{/block}
{block name="script"}
<script>
2020-03-28 21:48:35 +08:00
layui.cache.page = 'user';
2020-01-01 13:17:19 +08:00
layui.cache.user = {
2020-03-28 21:48:35 +08:00
username: '{$user.name??'游客'}'
,uid: {$user.id ? $user.id : -1}
,avatar: '{$user.name? $user['user_img']:'/static/res/images/avatar/00.jpg'}'
2020-01-01 13:17:19 +08:00
,experience: 83
2020-03-28 21:48:35 +08:00
,sex: '{if condition="$user['sex'] eq 0"}男{else/}女{/if}'
2020-01-01 13:17:19 +08:00
};
layui.config({
version: "3.0.0"
,base: '/static/res/mods/'
}).extend({
fly: 'index'
}).use('fly');
2020-03-28 21:48:35 +08:00
//
2020-03-29 19:57:18 +08:00
$('#LAY_minemsg').on('click','.art-title', function(){
2020-03-28 21:48:35 +08:00
var id = $(this).attr('id-data');
2020-03-29 19:57:18 +08:00
var othis = $(this);
console.log(othis);
2020-03-28 21:48:35 +08:00
$.ajax({
type:"post",
url:"{:url('message/read')}",
data:{"id":id},
daType:"json",
2020-03-29 19:57:18 +08:00
success:function (res){
if(res.status == 0){
location.reload();
//othis.append('<span class="float:right">已读</span>');
}
2020-03-28 21:48:35 +08:00
}
});
});
2020-01-01 13:17:19 +08:00
</script>
{/block}