message send

This commit is contained in:
toogee 2020-03-28 21:48:35 +08:00
parent a2bf02e7c8
commit f49a8f2394
7 changed files with 64 additions and 31 deletions

View File

@ -20,15 +20,21 @@ return [
// 应用映射(自动多应用模式有效)
'app_map' => [],
// 域名绑定(自动多应用模式有效)
'domain_bind' => [],
'domain_bind' => [
//'www' => 'index'
],
// 禁止URL访问的应用列表自动多应用模式有效
'deny_app_list' => [],
// 异常页面的模板文件
'exception_tmpl' => '../view/404.html',
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',
// 错误显示信息,非调试模式有效
'error_message' => '页面错误!请稍后再试~',
// 显示错误信息
'show_error_msg' => false,
//404
'http_exception_template' => [
404 => \think\facade\App::getAppPath() .'view/404.html'
]
];

View File

@ -402,9 +402,9 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util'], function(
var msg = $('<a class="fly-nav-msg" href="javascript:;">'+ res.count +'</a>');
elemUser.append(msg);
msg.on('click', function(){
fly.json('/message/read', {}, function(res){
fly.json('/index/message/read', {}, function(res){
if(res.status === 0){
location.href = '/user/message';
location.href = '/index/user/message';
}
});
});

View File

@ -26,10 +26,11 @@ layui.define(['laypage', 'fly', 'element', 'flow'], function(exports){
/*
//我的相关数据
var elemUC = $('#LAY_uc'), elemUCM = $('#LAY_ucm');
gather.minelog = {};
/*
gather.mine = function(index, type, url){
var tpl = [
//求解
@ -136,14 +137,14 @@ layui.define(['laypage', 'fly', 'element', 'flow'], function(exports){
page();
}
};
*/
if(elemUC[0]){
layui.each(dom.mine.children(), function(index, item){
var othis = $(item)
gather.mine(index, othis.data('type'), othis.data('url'));
});
}
*/
//显示当前tab
if(location.hash){
element.tabChange('user', location.hash.replace(/^#/, ''));
@ -307,7 +308,7 @@ layui.define(['laypage', 'fly', 'element', 'flow'], function(exports){
<ul class="mine-msg">\
{{# for(var i = 0; i < len; i++){ }}\
<li data-id="{{d.rows[i].id}}">\
<blockquote class="layui-elem-quote">{{ d.rows[i].content}}</blockquote>\
<blockquote class="layui-elem-quote"><a href="/index/jump?name={{ d.rows[i].name}}" target="_blank"><cite>{{ d.rows[i].name}}</cite></a><a target="_blank" name="title" id-data="{{ d.rows[i].id}}" href="{{ d.rows[i].link}}"><cite>{{ d.rows[i].content}}</cite></a></blockquote>\
<p><span>{{d.rows[i].time}}</span><a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-danger fly-delete"></a></p>\
</li>\
{{# } }}\
@ -320,15 +321,16 @@ layui.define(['laypage', 'fly', 'element', 'flow'], function(exports){
}
/*
fly.json('/message/find/', {}, function(res){
fly.json('/index/message/find/', {}, function(res){
var html = laytpl(tpl).render(res);
dom.minemsg.html(html);
if(res.rows.length > 0){
delAll.removeClass('layui-hide');
}
} else {
delAll.addClass('layui-hide');
}
});
*/
//阅读后删除
dom.minemsg.on('click', '.mine-msg li .fly-delete', function(){
@ -348,7 +350,7 @@ layui.define(['laypage', 'fly', 'element', 'flow'], function(exports){
var othis = $(this);
layer.confirm('确定清空吗?', function(index){
fly.json('/index/message/remove/', {
all: true
id: true
}, function(res){
if(res.status === 0){
layer.close(index);

View File

@ -143,7 +143,7 @@
{if condition="$article.is_reply == 1"}
<div class="layui-form layui-form-pane">
<form action="post" method="post" >
<form >
<div class="layui-form-item layui-form-text">
<a name="comment"></a>
<div class="layui-input-block">
@ -153,7 +153,7 @@
<div class="layui-form-item">
<input type="hidden" name="article_id" value="{$article.id}">
<input type="hidden" name="user_id" value="{:session('user_id')}">
<button type="button" class="layui-btn" lay-submit id="recomment">提交回复</button>
<button type="button" class="layui-btn" lay-filter="*" lay-submit id="recomment">提交回复</button>
</div>
</form>
</div>
@ -257,7 +257,7 @@ $(function() {
layui.cache.page = 'jie';
layui.cache.user = {
username: '{$user.name??'游客'}'
,uid: {$user.id ? 168*$user.id : -1}
,uid: {$user.id ? $user.id : -1}
,avatar: '{if condition="$user['user_img'] neq ''"}{$user['user_img']}{else /}/static/res/images/avatar/00.jpg{/if}'
,experience: 83
,sex: '{if condition="$user['sex'] eq 0"}男{else/}女{/if}'

View File

@ -11,7 +11,7 @@
<a href="case/case.html"><i class="iconfont icon-iconmingxinganli"></i>案例</a>
</li>
<li class="layui-nav-item">
<a href="/" target="_blank"><i class="iconfont icon-ui"></i>框架</a>
<a href="{:url('doc/timeline')}" target="_blank"><i class="iconfont icon-ui"></i>框架</a>
</li>
</ul>
@ -34,7 +34,7 @@
<dd><a href="{:url('user/index')}"><i class="layui-icon">&#xe612;</i>用户中心</a></dd>
<dd><a href="{:url('user/set')}"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
<hr>
<!--dd><a href="{:url('user/message')}"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd-->
<dd><a href="{:url('user/message')}"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
<dd><a href="{:url('user/home',['id'=>session('user_id')])}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
<hr style="margin: 5px 0;">
<dd><a data-url="{:url('user/logout')}" location-url="{:url('index/index')}" href="javascript:void(0)" class="logi_logout" style="text-align: center;">退出</a></dd>

View File

@ -17,12 +17,12 @@
我的帖子
</a>
</li>
<!--li class="layui-nav-item {if($Request.action=='message')}layui-this{/if}">
<li class="layui-nav-item {if($Request.action=='message')}layui-this{/if}">
<a href="{:url('index/user/message')}">
<i class="layui-icon">&#xe611;</i>
我的消息
</a>
</li-->
</li>
<li class="layui-nav-item " >
<a href="{:url('user/home',['id'=>session('user_id')])}">

View File

@ -3,15 +3,17 @@
{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 class="fly-none">您暂时没有最新消息</div>-->
<div id="LAY_minemsg" style="margin-top: 10px;"></div>
<!--div id="LAY_minemsg1" style="margin-top: 10px;">
<ul class="mine-msg">
<li data-id="123">
{volist name="msg" id="vo"}
<li data-id="{$vo.id}">
<blockquote class="layui-elem-quote">
<a href="/jump?username=Absolutely" target="_blank"><cite>Absolutely</cite></a>回答了您的求解<a target="_blank" href="/jie/8153.html/page/0/#item-1489505778669"><cite>layui后台框架</cite></a>
<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>1小时前</span><a href="javascript:;" class="layui-btn layui-btn-small layui-btn-danger fly-delete">删除</a></p>
<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
@ -19,18 +21,19 @@
<p><span>1小时前</span><a href="javascript:;" class="layui-btn layui-btn-small layui-btn-danger fly-delete">删除</a></p>
</li>
</ul>
</div>
</div-->
</div>
{/block}
{block name="script"}
<script>
layui.cache.page = '';
layui.cache.page = 'user';
layui.cache.user = {
username: '游客'
,uid: -1
,avatar: '/static/res/images/avatar/00.jpg'
username: '{$user.name??'游客'}'
,uid: {$user.id ? $user.id : -1}
,avatar: '{$user.name? $user['user_img']:'/static/res/images/avatar/00.jpg'}'
,experience: 83
,sex: '男'
,sex: '{if condition="$user['sex'] eq 0"}{else/}女{/if}'
};
layui.config({
version: "3.0.0"
@ -38,5 +41,27 @@
}).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}