TaoLer/view/index/user/message.html

68 lines
2.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-28 21:48:35 +08:00
<div id="LAY_minemsg" style="margin-top: 10px;"></div>
<!--div id="LAY_minemsg1" style="margin-top: 10px;">
2020-01-01 13:17:19 +08:00
<ul class="mine-msg">
2020-03-28 21:48:35 +08:00
{volist name="msg" id="vo"}
<li data-id="{$vo.id}">
2020-01-01 13:17:19 +08:00
<blockquote class="layui-elem-quote">
2020-03-28 21:48:35 +08:00
<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>
2020-01-01 13:17:19 +08:00
</blockquote>
2020-03-28 21:48:35 +08:00
<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>
2020-01-01 13:17:19 +08:00
</li>
2020-03-28 21:48:35 +08:00
{/volist}
2020-01-01 13:17:19 +08:00
<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>
2020-03-28 21:48:35 +08:00
</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
//
$('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();
});
}
}
});
});
2020-01-01 13:17:19 +08:00
</script>
{/block}