TaoLer/view/taoler/index/user/message.html

58 lines
1.7 KiB
HTML
Raw Normal View History

2021-12-15 15:46:04 +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>
<div id="LAY_minemsg" style="margin-top: 10px"></div>
</div>
{/block} {block name="script"}
2020-01-01 13:17:19 +08:00
<script>
2021-12-15 15:46:04 +08:00
var messageFind = "{:url('index/Message/find')}",
messageRemove = "{:url('index/Message/remove')}",
userNameJump = "{:url('index/Index/jump')}";
//点开标题改变帖子已读状态
$("#LAY_minemsg").on("click", ".art-title", function () {
var id = $(this).attr("id-data");
var othis = $(this);
$.ajax({
type: "post",
url: "{:url('message/read')}",
data: { id: id },
daType: "json",
success: function (res) {
if (res.status == 0) {
othis.next().html("已读");
//location.reload();
//othis.append('<span class="float:right">已读</span>');
}
},
});
});
2020-03-28 21:48:35 +08:00
2021-12-15 15:46:04 +08:00
//读消息
$("#LAY_minemsg").on("click", ".sys-title", function () {
var id = $(this).attr("id-data");
var othis = $(this);
$.ajax({
type: "post",
url: "{:url('message/read')}",
data: { id: id },
daType: "json",
success: function (res) {
if (res.status == 0) {
layer.open({
type: 1,
skin: "layui-layer-rim", //加上边框
area: ["400px", "350px"], //宽高
content:
'<div class="layui-form" style="padding: 10px 20px 0 20px;"> ' + res.content + "</div>",
}),
othis.next().html("已读");
}
},
});
});
2020-01-01 13:17:19 +08:00
</script>
{/block}