68 lines
2.2 KiB
HTML
68 lines
2.2 KiB
HTML
{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>
|
|
<div id="LAY_minemsg" style="margin-top: 10px;"></div>
|
|
<!--div id="LAY_minemsg1" style="margin-top: 10px;">
|
|
<ul class="mine-msg">
|
|
{volist name="msg" id="vo"}
|
|
<li data-id="{$vo.id}">
|
|
<blockquote class="layui-elem-quote">
|
|
<a href="/index/jump?name={$vo.name}" target="_blank"><cite>{$vo.name}</cite></a>回答了您的求解<a target="_blank" name="title" id-data="{$vo.id}" href="{$vo.link}"><cite>{$vo.title}</cite></a>
|
|
</blockquote>
|
|
<p><span>{$vo.create_time|date='Y-m-d H:i'}</span><a href="javascript:;" class="layui-btn layui-btn-small layui-btn-danger fly-delete">删除</a></p>
|
|
</li>
|
|
{/volist}
|
|
<li data-id="123">
|
|
<blockquote class="layui-elem-quote">
|
|
系统消息:欢迎使用 layui
|
|
</blockquote>
|
|
<p><span>1小时前</span><a href="javascript:;" class="layui-btn layui-btn-small layui-btn-danger fly-delete">删除</a></p>
|
|
</li>
|
|
</ul>
|
|
</div-->
|
|
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script>
|
|
layui.cache.page = 'user';
|
|
layui.cache.user = {
|
|
username: '{$user.name??'游客'}'
|
|
,uid: {$user.id ? $user.id : -1}
|
|
,avatar: '{$user.name? $user['user_img']:'/static/res/images/avatar/00.jpg'}'
|
|
,experience: 83
|
|
,sex: '{if condition="$user['sex'] eq 0"}男{else/}女{/if}'
|
|
};
|
|
layui.config({
|
|
version: "3.0.0"
|
|
,base: '/static/res/mods/'
|
|
}).extend({
|
|
fly: 'index'
|
|
}).use('fly');
|
|
//
|
|
$('a[name=title]').on('click','a', function(){
|
|
var id = $(this).attr('id-data');
|
|
console.log('11111');
|
|
$.ajax({
|
|
type:"post",
|
|
url:"{:url('message/read')}",
|
|
data:{"id":id},
|
|
daType:"json",
|
|
success:function (data){
|
|
if (data.status == 0) {
|
|
layer.msg(data.msg,{
|
|
icon:6,
|
|
time:2000
|
|
}, function(){
|
|
location.reload();
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
</script>
|
|
{/block}
|