新增插件管理插件系统
This commit is contained in:
parent
d9bd397475
commit
59db926938
@ -270,7 +270,7 @@ abstract class BaseController
|
||||
if(count($images)) {
|
||||
foreach($images as $image){
|
||||
//1.带http地址的图片,2.非本站的网络图片 3.非带有?号等参数的图片
|
||||
if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) == false) && (stripos($image, '?') == false)) {
|
||||
if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) === false) && (stripos($image, '?') == false)) {
|
||||
// 如果图片中没有带参数或者加密可下载
|
||||
//下载远程图片(可下载)
|
||||
$newImageUrl = $this->downloadImage($image);
|
||||
|
@ -44,11 +44,16 @@ class User extends AdminController
|
||||
'page' => input('page')
|
||||
]);
|
||||
$count = $user->total();
|
||||
$res = [];
|
||||
$data = [];
|
||||
if($count){
|
||||
$res = ['code'=>0,'msg'=>'ok','count'=>$count];
|
||||
$vipList = [];
|
||||
$vipRule = Db::name('user_viprule')->field('id,vip,nick')->select();
|
||||
foreach($vipRule as $v) {
|
||||
$vipList[] = ['id' => $v['id'], 'vip' => $v['vip'], 'title' => $v['nick']];
|
||||
}
|
||||
|
||||
foreach($user as $k => $v){
|
||||
$data = [
|
||||
$data[] = [
|
||||
'id' => $v['id'],
|
||||
'username' => $v['name'],
|
||||
'nick' => $v['nickname'],
|
||||
@ -58,21 +63,26 @@ class User extends AdminController
|
||||
'sex' => $v['sex'],
|
||||
'ip' => $v['last_login_ip'],
|
||||
'city' => $v['city'],
|
||||
'logintime' => date("Y-m-d H:i",$v['last_login_time']),
|
||||
'jointime' => date("Y-m-d",$v['create_time']),
|
||||
'point' => $v['point'],
|
||||
'logintime' => date("Y-m-d H:i:s",$v['last_login_time']),
|
||||
'jointime' => date("Y-m-d H:i",$v['create_time']),
|
||||
'check' => $v['status'],
|
||||
'auth' => $v['auth']
|
||||
'auth' => $v['auth'],
|
||||
'vip' => $vipList[$v['vip']]['title']
|
||||
];
|
||||
$res['data'][] = $data;
|
||||
}
|
||||
} else {
|
||||
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
||||
|
||||
return json(['code'=>0,'msg'=>'ok','count'=>$count, 'data' => $data, 'viplist' => $vipList]);
|
||||
}
|
||||
return json($res);
|
||||
return json(['code'=>-1,'msg'=>'没有查询结果!']);
|
||||
}
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
protected function getUserVipNick($vip) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
//添加用户
|
||||
public function add()
|
||||
@ -204,7 +214,7 @@ class User extends AdminController
|
||||
return true;
|
||||
}
|
||||
|
||||
//登录用过户中心
|
||||
//登录用户中心
|
||||
public function goUserHome() {
|
||||
$id = (int)input('id');
|
||||
$user_home_url = $this->getUserHome($id);
|
||||
@ -212,4 +222,31 @@ class User extends AdminController
|
||||
return redirect($user_home_url);
|
||||
}
|
||||
|
||||
// 编辑用户积分
|
||||
public function editPoint()
|
||||
{
|
||||
if(Request::isAjax()) {
|
||||
$param = Request::param(['id','point']);
|
||||
|
||||
$res = Db::name('user')->where('id',(int)$param['id'])->update(['point' => (int)$param['point']]);
|
||||
if($res > 0) {
|
||||
return json(['code' => 0, 'msg' => '修改成功']);
|
||||
}
|
||||
return json(['code' => -1, 'msg' => '修改失败']);
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑用户会员等级
|
||||
public function editVipLevel()
|
||||
{
|
||||
if(Request::isAjax()) {
|
||||
$param = Request::param(['id','vip']);
|
||||
$vipRule = Db::name('user_viprule')->field('vip,nick')->where('nick', $param['vip'])->find();
|
||||
$res = Db::name('user')->where('id',(int)$param['id'])->update(['vip' => (int)$vipRule['vip']]);
|
||||
if($res > 0) {
|
||||
return json(['code' => 0, 'msg' => '修改成功']);
|
||||
}
|
||||
return json(['code' => -1, 'msg' => '修改失败']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,22 +29,30 @@ class Vip extends AdminController
|
||||
{
|
||||
$keys = UserViprule::select();
|
||||
$count = $keys->count();
|
||||
$res = [];
|
||||
$data = [];
|
||||
if($count){
|
||||
$res = ['code'=>0,'msg'=>'','count'=>$count];
|
||||
foreach($keys as $k=>$v){
|
||||
$res['data'][] = ['id'=>$v['id'],'score'=>$v['score'],'nick'=>$v['nick'],'vip'=>$v['vip'],'ctime'=>$v['create_time']];
|
||||
$data[] = [
|
||||
'id'=>$v['id'],
|
||||
'vip'=>$v['vip'],
|
||||
'score'=>$v['score'],
|
||||
'nick'=>$v['nick'],
|
||||
'postnum'=>$v['postnum'],
|
||||
'postpoint'=>$v['postpoint'],
|
||||
'refreshnum'=>$v['refreshnum'],
|
||||
'refreshpoint'=>$v['refreshpoint'],
|
||||
'ctime'=>$v['create_time']
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$res = ['code'=>-1,'msg'=>'还没有任何vip等级设置!'];
|
||||
return json(['code'=>0,'msg'=>'ok','count'=>$count, 'data' => $data]);
|
||||
}
|
||||
return json($res);
|
||||
return json(['code'=>-1,'msg'=>'还没有任何vip等级设置!']);
|
||||
}
|
||||
|
||||
//添加VIP积分规则
|
||||
public function add()
|
||||
{
|
||||
$data = Request::only(['score','vip','nick']);
|
||||
$data = Request::only(['score','vip','nick','postnum','refreshnum']);
|
||||
$vip = UserViprule::where('vip',$data['vip'])->find();
|
||||
if($vip){
|
||||
$res = ['code'=>-1,'msg'=>'vip等级不能重复设置'];
|
||||
|
@ -63,6 +63,7 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="user-table" lay-filter="user-table"></table>
|
||||
@ -80,10 +81,15 @@
|
||||
</button>
|
||||
</script>
|
||||
<script type="text/html" id="imgTpl">
|
||||
<img src= {{=d.avatar}} style="width: 30px; height: 30px;" />
|
||||
<img src= {{=d.avatar}} style="width: 100px; height: 100px; border-radius: 6px;" />
|
||||
</script>
|
||||
<script type="text/html" id="adminTpl">
|
||||
<a href="{:url('user.user/goUserHome')}?id={{ d.id }}" target="_blank">{{- d.username }}</a>
|
||||
<script type="text/html" id="userInfoTpl">
|
||||
<ul>
|
||||
<li>ID: {{d.id}} 用户名:<a href="{:url('user.user/goUserHome')}?id={{ d.id }}" target="_blank">{{- d.username }}</a></li>
|
||||
<li>性别:{{#if (d.sex == 0) { }} <span>男</span> {{# }else if(d.sex == 1){ }} <span>女</span> {{# } }} 昵称:{{d.nickname}}</li>
|
||||
<li>电话:{{d.phone}}</li>
|
||||
<li>邮箱:{{d.email}}</li>
|
||||
</ul>
|
||||
</script>
|
||||
<script type="text/html" id="user-bar">
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
|
||||
@ -101,27 +107,25 @@
|
||||
{if condition="checkRuleButton('user.user/auth')"}<input type="checkbox" name="auth" lay-skin="primary" lay-filter="auth" {{# if(d.auth ==1){ }}checked value="0"{{# } else { }}value="1"{{# } }} id="{{d.id}}" >{else}<button class="layui-btn layui-btn-xs layui-btn-disabled">无权限</button>{/if}
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="user-sex">
|
||||
{{#if (d.sex == 0) { }}
|
||||
<span>男</span>
|
||||
{{# }else if(d.sex == 1){ }}
|
||||
<span>女</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="user-login">
|
||||
{{#if (d.login == 0) { }}
|
||||
<span>在线</span>
|
||||
{{# }else if(d.sex == 1){ }}
|
||||
<span>离线</span>
|
||||
{{# } }}
|
||||
<script type="text/html" id="userLoginTpl">
|
||||
<url>
|
||||
<li>ip:{{d.ip}}</li>
|
||||
<li>归属地:{{d.city}}</li>
|
||||
<li>{{d.logintime}}</li>
|
||||
</url>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="user-createTime">
|
||||
{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd')}}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="TPL-dropdpwn-vip">
|
||||
<button class="layui-btn layui-btn-primary dropdpwn-demo">
|
||||
<span>{{= d.vip}}</span>
|
||||
<i class="layui-icon layui-icon-down layui-font-12"></i>
|
||||
</button>
|
||||
</script>
|
||||
|
||||
<script src="/static/component/layui/layui.js"></script>
|
||||
<script src="/static/component/pear/pear.js"></script>
|
||||
<script>
|
||||
@ -130,6 +134,7 @@
|
||||
let form = layui.form;
|
||||
let $ = layui.jquery;
|
||||
let common = layui.common;
|
||||
var dropdown = layui.dropdown;
|
||||
|
||||
let MODULE_PATH = "operate/";
|
||||
|
||||
@ -137,62 +142,39 @@
|
||||
[ {
|
||||
type: 'checkbox'
|
||||
},
|
||||
{
|
||||
title: 'id',
|
||||
field: 'id',
|
||||
align: 'center',
|
||||
width: 60
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
field: 'avatar',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
width: 150,
|
||||
templet: '#imgTpl'
|
||||
},
|
||||
{
|
||||
title: '用户',
|
||||
field: 'username',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
templet: '#adminTpl'
|
||||
minWidth: 200,
|
||||
templet: '#userInfoTpl'
|
||||
},
|
||||
{
|
||||
title: '昵称',
|
||||
field: 'nick',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
field: 'sex',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
templet: '#user-sex'
|
||||
},
|
||||
{
|
||||
title: '电话',
|
||||
field: 'phone',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
field: 'email',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: 'IP',
|
||||
title: '登录',
|
||||
field: 'ip',
|
||||
align: 'center'
|
||||
minWidth: 180,
|
||||
templet: '#userLoginTpl'
|
||||
},
|
||||
{
|
||||
title: '城市',
|
||||
field: 'city',
|
||||
align: 'center'
|
||||
title: '积分/金币',
|
||||
field: 'point',
|
||||
align: 'center',
|
||||
edit: 'text'
|
||||
},
|
||||
{
|
||||
title: '登录时间',
|
||||
field: 'logintime',
|
||||
align: 'center'
|
||||
title: '会员等级/L',
|
||||
field: 'vip',
|
||||
align: 'center',
|
||||
width:180,
|
||||
unresize: true,
|
||||
align: 'center',
|
||||
templet: '#TPL-dropdpwn-vip'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
@ -201,12 +183,6 @@
|
||||
width: 95,
|
||||
templet: '#user-enable'
|
||||
},
|
||||
{
|
||||
title: '登录',
|
||||
field: 'login',
|
||||
align: 'center',
|
||||
templet: '#user-login'
|
||||
},
|
||||
{
|
||||
title: '超级管理',
|
||||
field: 'auth',
|
||||
@ -234,12 +210,54 @@
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
toolbar: '#user-toolbar',
|
||||
lineStyle: 'height: 160px;', // 定义表格的多行样式
|
||||
defaultToolbar: [{
|
||||
title: '刷新',
|
||||
layEvent: 'refresh',
|
||||
icon: 'layui-icon-refresh',
|
||||
}, 'filter', 'print', 'exports'],
|
||||
limit: 10
|
||||
limit: 10,
|
||||
done: function(res, curr, count){
|
||||
var options = this;
|
||||
|
||||
// 获取当前行数据
|
||||
table.getRowData = function(elem){
|
||||
var index = $(elem).closest('tr').data('index');
|
||||
return table.cache[options.id][index] || {};
|
||||
};
|
||||
|
||||
// dropdown 方式的下拉选择
|
||||
dropdown.render({
|
||||
elem: '.dropdpwn-demo',
|
||||
// trigger: 'hover',
|
||||
// 此处的 data 值,可根据 done 返回的 res 遍历来赋值
|
||||
data: res.viplist,
|
||||
click: function(obj){
|
||||
var data = table.getRowData(this.elem); // 获取当前行数据(如 id 等字段,以作为数据修改的索引)
|
||||
|
||||
this.elem.find('span').html(obj.title);
|
||||
// 更新数据中对应的字段
|
||||
data.vip = obj.title;
|
||||
console.log(data)
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:url('user.user/editVipLevel')}",
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(res.code === 0) {
|
||||
layer.msg(res.msg, {icon: 1});
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
})
|
||||
// 显示 - 仅用于演示
|
||||
//layer.msg('选中值: '+ obj.title +'<br>当前行数据:'+ JSON.stringify(data));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
table.on('tool(user-table)', function(obj) {
|
||||
@ -260,6 +278,44 @@
|
||||
}
|
||||
});
|
||||
|
||||
// 单元格编辑后的事件
|
||||
table.on('edit(user-table)', function(obj){
|
||||
//var field = obj.field; // 得到修改的字段
|
||||
var value = obj.value // 得到修改后的值
|
||||
//var oldValue = obj.oldValue // 得到修改前的值 -- v2.8.0 新增
|
||||
var data = obj.data // 得到所在行所有键值
|
||||
//var col = obj.getCol(); // 得到当前列的表头配置属性 -- v2.8.0 新增
|
||||
|
||||
// 值的校验
|
||||
if(value.replace(/\s/g, '') === ''){
|
||||
layer.tips('值不能为空', this, {tips: 1});
|
||||
return obj.reedit(); // 重新编辑 -- v2.8.0 新增
|
||||
}
|
||||
// 只能为数值型
|
||||
if(isNaN(value)) {
|
||||
layer.tips('只能为数值', this, {tips: 1});
|
||||
return obj.reedit();
|
||||
}
|
||||
|
||||
// 编辑后续操作,如提交更新请求,以完成真实的数据更新
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:url('user.user/editPoint')}",
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(res.code === 0) {
|
||||
layer.msg(res.msg, {icon: 1});
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
})
|
||||
// …
|
||||
});
|
||||
|
||||
|
||||
form.on('submit(user-query)', function(data) {
|
||||
table.reload('user-table', {
|
||||
where: data.field
|
||||
|
@ -13,11 +13,11 @@
|
||||
<input type="text" name="id" class="layui-input" value="{$vip.id}">
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">Vip级别</label>
|
||||
<label class="layui-form-label">会员等级</label>
|
||||
<div class="layui-input-inline" >
|
||||
<select name="vip">
|
||||
{volist name="level" id="vo"}
|
||||
<option {if condition="$vip.vip eq $vo"} selected {/if} value="{$vo}">{if condition="$vo eq 0"}普通{else /}VIP{$vo}{/if}</option>
|
||||
<option {if condition="$vip.vip eq $vo"} selected {/if} value="{$vo}">{if condition="$vo eq 0"}普通{else /}L{$vo}{/if}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
@ -29,15 +29,33 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">认证</label>
|
||||
<label class="layui-form-label">认证昵称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="nick" lay-verify="required" placeholder="等级昵称" autocomplete="off" class="layui-input" value="{$vip.nick}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">权限</label>
|
||||
<label class="layui-form-label">免费发帖/日</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="rules" lay-verify="" placeholder="请选择" autocomplete="off" class="layui-input" value="{$vip.rules}">
|
||||
<input type="text" name="postnum" lay-verify="number" placeholder="10" autocomplete="off" class="layui-input" value="{$vip.postnum}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">免费刷新/日</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="refreshnum" lay-verify="number" placeholder="10" autocomplete="off" class="layui-input" value="{$vip.refreshnum}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">发贴扣积分</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="postpoint" lay-verify="number" placeholder="10" autocomplete="off" class="layui-input" value="{$vip.postpoint}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">刷贴扣积分</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="refreshpoint" lay-verify="number" placeholder="10" autocomplete="off" class="layui-input" value="{$vip.refreshpoint}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -77,9 +95,8 @@
|
||||
icon: 1,
|
||||
time: 1000
|
||||
}, function() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window
|
||||
.name)); //关闭当前页
|
||||
parent.layui.table.reload("vip-table");
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页
|
||||
parent.layui.table.reload("vip-rule");
|
||||
});
|
||||
} else {
|
||||
layer.msg(result.msg, {
|
||||
|
@ -12,16 +12,10 @@
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="server-tabs-brief">
|
||||
<ul class="layui-tab-title">
|
||||
{if hook('signstatushook') == 1}
|
||||
<li class="layui-this" lay-id="score">签到规则</li>
|
||||
{/if}
|
||||
<li lay-id="vip" class="{if hook('signstatushook') == 0} layui-this {/if}">用户等级</li>
|
||||
<li lay-id="vip" class="layui-this">用户等级</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
|
||||
{:hook('signadminhook')}
|
||||
|
||||
<div class="layui-tab-item {if hook('signstatushook') == 0}layui-show{/if}">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class="layui-tab-content" style="padding: 20px 0;">
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item">
|
||||
@ -30,19 +24,32 @@
|
||||
<div class="layui-input-inline" style="width: 120px;">
|
||||
<select name="vip">
|
||||
<option value="0">普通</option>
|
||||
<option value="1">VIP1</option>
|
||||
<option value="2">VIP2</option>
|
||||
<option value="3">VIP3</option>
|
||||
<option value="4">VIP4</option>
|
||||
<option value="5">VIP5</option>
|
||||
<option value="1">L1</option>
|
||||
<option value="2">L2</option>
|
||||
<option value="3">L3</option>
|
||||
<option value="4">L4</option>
|
||||
<option value="5">L5</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="tel" name="score" lay-verify="required" placeholder="积分区间:0-99" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="score" lay-verify="required" placeholder="积分区间:0-99" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="tel" name="nick" lay-verify="required" placeholder="认证名称" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="nick" lay-verify="required" placeholder="认证名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="postnum" lay-verify="required|number" placeholder="免费发帖日限额" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="refreshnum" lay-verify="required|number" placeholder="免费刷新日限额" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="postpoint" lay-verify="required|number" placeholder="发帖扣积分" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="refreshpoint" lay-verify="required|number" placeholder="刷贴扣积分" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="submit" class="pear-btn pear-btn-primary" lay-submit lay-filter="vip-rule-submit" id="vip-rule-submit" value="立即提交">
|
||||
@ -50,6 +57,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<table id="vip-rule" lay-filter="vip-rule"></table>
|
||||
<script type="text/html" id="vip-rule-bar">
|
||||
@ -59,6 +67,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{:hook('signadminhook')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -75,6 +85,9 @@
|
||||
|
||||
let VIP_RULE = "{:url('user.vip/list')}";
|
||||
|
||||
// 渲染 tab 组件
|
||||
element.render('tab', 'server-tabs-brief');
|
||||
|
||||
//Vip规则
|
||||
table.render({
|
||||
elem: '#vip-rule',
|
||||
@ -84,7 +97,10 @@
|
||||
{field: 'vip',title: '等级'},
|
||||
{field: 'score',title: '积分'},
|
||||
{field: 'nick',title: '认证'},
|
||||
{field: 'rules',title: '权限'},
|
||||
{field: 'postnum',title: '免费发帖/日'},
|
||||
{field: 'refreshnum',title: '免费刷新/日'},
|
||||
{field: 'postpoint',title: '发帖扣积分'},
|
||||
{field: 'refreshpoint',title: '刷新扣积分'},
|
||||
{field: 'ctime',title: '时间'},
|
||||
{title: '操作', width: 150, align:'center', toolbar: '#vip-rule-bar'}
|
||||
|
||||
@ -111,9 +127,9 @@
|
||||
url:"{:url('user.vip/add')}",
|
||||
data:field,
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{
|
||||
success:function (res){
|
||||
if (res.code == 0) {
|
||||
layer.msg(res.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}, function(){
|
||||
@ -122,7 +138,7 @@
|
||||
} else {
|
||||
layer.open({
|
||||
title:'添加失败',
|
||||
content:data.msg,
|
||||
content:res.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
@ -139,7 +155,7 @@
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['450px', '400px'],
|
||||
area: ['450px', '580px'],
|
||||
content: 'edit.html?id=' + obj.data.id
|
||||
});
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ class BaseController extends BaseCtrl
|
||||
$user = Cache::get('user'.$id);
|
||||
if(!$user){
|
||||
//1.查询用户
|
||||
$user = Db::name('user')->field('id,name,nickname,user_img,sex,area_id,auth,city,email,active,sign,point,vip,create_time')->find($id);
|
||||
$user = Db::name('user')->field('id,name,nickname,user_img,sex,area_id,auth,city,phone,email,active,sign,point,vip,create_time')->find($id);
|
||||
Cache::tag('user')->set('user'.$id,$user,600);
|
||||
}
|
||||
return $user;
|
||||
|
@ -97,7 +97,7 @@ class Comment extends Model
|
||||
$res['data'][] = $u;
|
||||
}
|
||||
} else {
|
||||
$res = ['status' => 0, 'msg' =>'no reply'];
|
||||
$res = ['status' => -1, 'msg' =>'no reply'];
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class UserViprule extends Model
|
||||
//获取等级名
|
||||
public function getVipAttr($value)
|
||||
{
|
||||
$vip = [0=>'普通',1=>'VIP1',2=>'VIP2',3=>'VIP3',4=>'VIP4',5=>'VIP5'];
|
||||
$vip = [0=>'普通',1=>'L1',2=>'L2',3=>'L3',4=>'L4',5=>'L5'];
|
||||
return $vip[$value];
|
||||
}
|
||||
|
||||
|
@ -229,6 +229,7 @@ class Article extends BaseController
|
||||
if (Request::isAjax()) {
|
||||
// 检验发帖是否开放
|
||||
if(config('taoler.config.is_post') == 0 ) return json(['code'=>-1,'msg'=>'抱歉,系统维护中,暂时禁止发帖!']);
|
||||
|
||||
// 数据
|
||||
$data = Request::only(['cate_id', 'title', 'title_color','read_type','art_pass', 'content', 'upzip', 'keywords', 'description', 'captcha']);
|
||||
$data['user_id'] = $this->uid;
|
||||
@ -252,7 +253,7 @@ class Article extends BaseController
|
||||
$iva= $this->hasIva($data['content']);
|
||||
$data = array_merge($data,$iva);
|
||||
|
||||
// 处理内容
|
||||
// 处理图片内容
|
||||
$data['content'] = $this->downUrlPicsReaplace($data['content']);
|
||||
// 把中文,转换为英文,并去空格->转为数组->去掉空数组->再转化为带,号的字符串
|
||||
$data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace(',',',',$data['keywords'])))));
|
||||
@ -260,8 +261,31 @@ class Article extends BaseController
|
||||
// 获取分类ename,appname
|
||||
$cateName = Db::name('cate')->field('ename,appname')->find($data['cate_id']);
|
||||
|
||||
// vip每天可免费发帖数
|
||||
$user = Db::name('user')->field('id,vip,point')->find($this->uid);
|
||||
$postRule = Db::name('user_viprule')->field('postnum,postpoint')->where('vip', $user['vip'])->find();
|
||||
// 检测刷新帖子剩余量
|
||||
$postLog = Db::name('user_article_log')->field('id,user_postnum')->where(['user_id' => $this->uid])->whereDay('create_time')->find();
|
||||
if(is_null($postLog)) {
|
||||
Db::name('user_article_log')->save(['user_id' => $this->uid, 'create_time' => time()]);
|
||||
$postLog = Db::name('user_article_log')->field('id,user_postnum')->where(['user_id' => $this->uid])->whereDay('create_time')->find();
|
||||
}
|
||||
$cannum = $postRule['postnum'] - $postLog['user_postnum']; // 可用免费额
|
||||
if($cannum <= 0) {
|
||||
//额度已用完需要扣积分
|
||||
$canpoint = 1 * $postRule['postpoint'];
|
||||
$point = $user['point'] - $canpoint;
|
||||
if($point < 0) { // 1.积分不足
|
||||
return json(['code' => -1, 'msg' => "免额已使用,本次需{$canpoint}积分,请充值!"]);
|
||||
}
|
||||
// 2.扣除积分
|
||||
Db::name('user')->where('id', $this->uid)->update(['point' => $point]);
|
||||
}
|
||||
|
||||
$result = $this->model->add($data);
|
||||
if ($result['code'] == 1) {
|
||||
// 记录每天发帖量
|
||||
Db::name('user_article_log')->where('id', $postLog['id'])->inc('user_postnum')->update();
|
||||
// 获取到的最新ID
|
||||
$aid = $result['data']['id'];
|
||||
//写入taglist表
|
||||
@ -277,13 +301,14 @@ class Article extends BaseController
|
||||
// 清除文章tag缓存
|
||||
Cache::tag('tagArtDetail')->clear();
|
||||
// 发提醒邮件
|
||||
if(Config::get('taoler.config.email_notice')) hook('mailtohook',[$this->showUser(1)['email'],'发帖审核通知','Hi亲爱的管理员:</br>用户'.$this->showUser($this->uid)['name'].'刚刚发表了 <b>'.$data['title'].'</b> 新的帖子,请尽快处理。']);
|
||||
hook('mailtohook',[$this->showUser(1)['email'],'发帖审核通知','Hi亲爱的管理员:</br>用户'.$this->showUser($this->uid)['name'].'刚刚发表了 <b>'.$data['title'].'</b> 新的帖子,请尽快处理。']);
|
||||
|
||||
$link = $this->getRouteUrl((int) $aid, $cateName['ename']);
|
||||
$url = $result['data']['status'] ? $link : (string)url('index/');
|
||||
|
||||
hook('SeoBaiduPush', ['link'=>$link]); // 推送给百度收录接口
|
||||
hook('callme_add', ['article_id' => (int) $aid]); // 添加文章的联系方式
|
||||
|
||||
$url = $result['data']['status'] ? $link : (string)url('index/');
|
||||
return Msgres::success($result['msg'], $url);
|
||||
}
|
||||
return Msgres::error('add_error');
|
||||
|
@ -40,7 +40,6 @@ class Index extends BaseController
|
||||
$vs = [
|
||||
'artTop' => $artTop,
|
||||
'artList' => $artList,
|
||||
'artHot' => $artHot,
|
||||
'type' => $types,
|
||||
'jspage' => '',
|
||||
];
|
||||
@ -49,13 +48,6 @@ class Index extends BaseController
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//回帖榜
|
||||
public function reply()
|
||||
{
|
||||
$comment = new \app\common\model\Comment();
|
||||
return $comment->reply(20);
|
||||
}
|
||||
|
||||
public function jump()
|
||||
{
|
||||
$username = Request::param('username');
|
||||
|
@ -33,7 +33,7 @@ class User extends BaseController
|
||||
public function artList()
|
||||
{
|
||||
$param = Request::only(['page','limit']);
|
||||
$myArticle = Article::field('id,cate_id,title,status,pv,create_time')
|
||||
$myArticle = Article::field('id,cate_id,title,status,pv,create_time,update_time')
|
||||
->withCount(['comments'])
|
||||
->where(['user_id'=>$this->uid])
|
||||
->order('update_time','desc')
|
||||
@ -52,16 +52,17 @@ class User extends BaseController
|
||||
'url' => $this->getRouteUrl($v['id'], $v->cate->ename, $v->cate->appname),
|
||||
'status' => $v['status'] ? '正常':'待审',
|
||||
'ctime' => $v['create_time'],
|
||||
'datas' => $v['pv'].'阅/'.$v['comments_count'].'答'
|
||||
'utime' => $v['update_time'],
|
||||
'pv' => $v['pv'],
|
||||
'datas' => $v['comments_count'].'答'
|
||||
];
|
||||
}
|
||||
|
||||
} else {
|
||||
return json(['code'=>-1,'msg'=>'无数据']);
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
|
||||
return json(['code'=>-1,'msg'=>'无数据']);
|
||||
}
|
||||
|
||||
// 收藏list
|
||||
public function collList()
|
||||
{
|
||||
@ -100,6 +101,78 @@ class User extends BaseController
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
// 编辑pv
|
||||
public function edtiPv()
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$param = Request::param(['id','pv']);
|
||||
$res = Db::name('article')->save(['id' => $param['id'], 'pv' => $param['pv']]);
|
||||
if($res) {
|
||||
return json(['code' => 0, 'msg' => '修改成功!']);
|
||||
}
|
||||
}
|
||||
return json(['code' => -1, 'msg' => '修改失败!']);
|
||||
}
|
||||
|
||||
// 刷新
|
||||
public function updateTime()
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$param = Request::param(['data']);
|
||||
if(count($param) == 0) return json(['code' => -1, 'msg' => '未选中任何数据!']);
|
||||
$idArr = [];
|
||||
foreach($param['data'] as $v) {
|
||||
$idArr[] = $v['id'];
|
||||
}
|
||||
$count = count($idArr);
|
||||
|
||||
// vip每天可刷新数
|
||||
$user = Db::name('user')->field('id,vip,point')->find($this->uid);
|
||||
$refreshRule = Db::name('user_viprule')->field('refreshnum,refreshpoint')->where('vip', $user['vip'])->find();
|
||||
// 检测刷新帖子剩余量
|
||||
$refreshLog = Db::name('user_article_log')->field('id,user_refreshnum')->where(['user_id' => $this->uid])->whereDay('create_time')->find();
|
||||
if(is_null($refreshLog)) {// 新增
|
||||
Db::name('user_article_log')->save(['user_id' => $this->uid, 'create_time' => time()]);
|
||||
$refreshLog = Db::name('user_article_log')->field('id,user_refreshnum')->where(['user_id' => $this->uid])->whereDay('create_time')->find();
|
||||
}
|
||||
$cannum = $refreshRule['refreshnum'] - $refreshLog['user_refreshnum']; // 可用免费数
|
||||
// 刷帖先扣积分
|
||||
if($cannum <= 0) { // a.免费额已用完 后面需要积分
|
||||
$canpoint = $count * $refreshRule['refreshpoint'];
|
||||
$point = $user['point'] - $canpoint;
|
||||
if($point < 0) {
|
||||
// 1.积分不足
|
||||
return json(['code' => -1, 'msg' => "免额已使用,本次需{$canpoint}积分,请充值!"]);
|
||||
} else {
|
||||
// 2.扣除积分
|
||||
Db::name('user')->where('id', $this->uid)->update(['point' => $point]);
|
||||
}
|
||||
} else { // b.未超限 有剩余条数
|
||||
if($count > $cannum) { // 本次刷新数量大于剩余免费数量,需要支付积分
|
||||
$canpoint = ($count - $cannum) * $refreshRule['refreshpoint'];
|
||||
$point = $user['point'] - $canpoint;
|
||||
if($point < 0) {
|
||||
// 1.积分不足
|
||||
return json(['code' => -1, 'msg' => "免额已使用,本次需{$canpoint}积分,额度不足请充值!"]);
|
||||
} else {
|
||||
// 2.扣除积分
|
||||
Db::name('user')->where('id', $this->uid)->update(['point' => $point]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新数据
|
||||
$res = Db::name('article')->where('id', 'in', $idArr)->update(['update_time' => time()]);
|
||||
if($res > 0) {
|
||||
// 记录刷帖日志
|
||||
Db::name('user_article_log')->where('id', $refreshLog['id'])->inc('user_refreshnum', $count)->update();
|
||||
|
||||
return json(['code' => 0, 'msg' => '刷新成功!']);
|
||||
}
|
||||
}
|
||||
return json(['code' => -1, 'msg' => '刷新失败!']);
|
||||
}
|
||||
|
||||
//取消文章收藏
|
||||
public function colltDel()
|
||||
{
|
||||
@ -119,7 +192,7 @@ class User extends BaseController
|
||||
public function set()
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$data = Request::only(['email','nickname','sex','city','area_id','sign']);
|
||||
$data = Request::only(['email','phone','nickname','sex','city','area_id','sign']);
|
||||
$data['user_id'] = $this->uid;
|
||||
// 过滤
|
||||
$sign = strtolower($data['sign']);
|
||||
@ -283,10 +356,10 @@ class User extends BaseController
|
||||
if($result == 1) {
|
||||
Session::clear();
|
||||
Cookie::delete('auth');
|
||||
return $this->success('密码修改成功 请登录', (string) url('login/index'));
|
||||
} else {
|
||||
return json(['code'=>-1,'msg' =>$result]);
|
||||
return json(['code' => 1, 'msg' => '密码修改成功', 'data' => ['url' => (string) url('login/index')]]);
|
||||
}
|
||||
|
||||
return json(['code' => -1,'msg' =>$result]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,8 @@ Route::group(function () {
|
||||
Route::get('user/message$', 'user/message');
|
||||
Route::get('user/post', 'user/post');
|
||||
Route::get('user/article','user/artList');
|
||||
Route::post('user/editpv','user/editPv');
|
||||
Route::post('user/updatetime','user/updateTime');
|
||||
Route::get('user/coll','user/collList');
|
||||
Route::get('user/colldel','user/collDel');
|
||||
Route::get('user/setpass','user/setPass');
|
||||
|
10
composer.lock
generated
10
composer.lock
generated
@ -859,16 +859,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
"version": "v1.3.1",
|
||||
"version": "v1.3.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/serializable-closure.git",
|
||||
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902"
|
||||
"reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902",
|
||||
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/076fe2cf128bd54b4341cdc6d49b95b34e101e4c",
|
||||
"reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -915,7 +915,7 @@
|
||||
"issues": "https://github.com/laravel/serializable-closure/issues",
|
||||
"source": "https://github.com/laravel/serializable-closure"
|
||||
},
|
||||
"time": "2023-07-14T13:56:28+00:00"
|
||||
"time": "2023-10-17T13:38:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem",
|
||||
|
@ -16,7 +16,7 @@ return [
|
||||
// 应用名,此项不可更改
|
||||
'appname' => 'TaoLer',
|
||||
// 版本配置
|
||||
'version' => '2.4.0',
|
||||
'version' => '2.5.0',
|
||||
// 加盐
|
||||
'salt' => 'taoler',
|
||||
// 数据库备份目录
|
||||
|
@ -172,6 +172,15 @@ body,
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.pear-admin.banner-layout .layui-header .layui-logo {
|
||||
display: none;
|
||||
}
|
||||
.pear-admin.banner-layout .layui-header .layui-layout-left {
|
||||
left: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
/** 收缩布局 */
|
||||
.pear-mini .layui-side .layui-logo .title {
|
||||
display: none;
|
||||
@ -465,7 +474,13 @@ body,
|
||||
-webkit-transition: all .3s;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 450px) {
|
||||
.pearone-color .layui-form-item .layui-input-inline {
|
||||
float: left !important;
|
||||
width: 190px !important;
|
||||
margin: 0 10px 0 0!important;
|
||||
}
|
||||
}
|
||||
.select-color {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
function(exports) {
|
||||
"use strict";
|
||||
|
||||
var $ = layui.jquery,
|
||||
const $ = layui.jquery,
|
||||
form = layui.form,
|
||||
element = layui.element,
|
||||
yaml = layui.yaml,
|
||||
@ -14,18 +14,19 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
message = layui.message,
|
||||
fullscreen = layui.fullscreen;
|
||||
|
||||
var bodyFrame;
|
||||
var sideMenu;
|
||||
var bodyTab;
|
||||
var config;
|
||||
var logout = function() {};
|
||||
var msgInstance;
|
||||
var body = $('body');
|
||||
let bodyFrame;
|
||||
let sideMenu;
|
||||
let bodyTab;
|
||||
let config;
|
||||
let logout = function () {
|
||||
};
|
||||
let msgInstance;
|
||||
const body = $('body');
|
||||
|
||||
var pearAdmin = new function() {
|
||||
const pearAdmin = new function () {
|
||||
|
||||
var configType = 'yml';
|
||||
var configPath = 'pear.config.yml';
|
||||
let configType = 'yml';
|
||||
let configPath = 'pear.config.yml';
|
||||
|
||||
this.setConfigPath = function (path) {
|
||||
configPath = path;
|
||||
@ -47,7 +48,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
if (configType === "yml") {
|
||||
return yaml.load(configPath);
|
||||
} else {
|
||||
var data;
|
||||
let data;
|
||||
$.ajax({
|
||||
url: configPath,
|
||||
type: 'get',
|
||||
@ -62,7 +63,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
this.messageRender = function (option) {
|
||||
var option = {
|
||||
option = {
|
||||
elem: '.message',
|
||||
url: option.header.message,
|
||||
height: '250px'
|
||||
@ -83,7 +84,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
height: '100%',
|
||||
method: param.menu.method,
|
||||
control: isControl(param) === 'true' || isControl(param) === true ? 'control' : false, // control
|
||||
controlWidth: param.menu.controlWidth,
|
||||
defaultMenu: 0,
|
||||
accordion: param.menu.accordion,
|
||||
url: param.menu.data,
|
||||
@ -181,14 +181,14 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
if (option.theme.allowCustom === false) {
|
||||
$(".setting").remove();
|
||||
}
|
||||
var colorId = localStorage.getItem("theme-color");
|
||||
var currentColor = getColorById(colorId);
|
||||
const colorId = localStorage.getItem("theme-color");
|
||||
const currentColor = getColorById(colorId);
|
||||
localStorage.setItem("theme-color", currentColor.id);
|
||||
localStorage.setItem("theme-color-color", currentColor.color);
|
||||
localStorage.setItem("theme-color-second", currentColor.second);
|
||||
pearTheme.changeTheme(window, isAutoHead(config));
|
||||
|
||||
var menu = localStorage.getItem("theme-menu");
|
||||
let menu = localStorage.getItem("theme-menu");
|
||||
if (menu === null) {
|
||||
menu = option.theme.defaultMenu;
|
||||
} else {
|
||||
@ -197,7 +197,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}
|
||||
|
||||
var header = localStorage.getItem("theme-header");
|
||||
let header = localStorage.getItem("theme-header");
|
||||
if (header === null) {
|
||||
header = option.theme.defaultHeader;
|
||||
} else {
|
||||
@ -206,7 +206,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}
|
||||
|
||||
var banner = localStorage.getItem("theme-banner");
|
||||
let banner = localStorage.getItem("theme-banner");
|
||||
if (banner === null) {
|
||||
banner = option.theme.banner;
|
||||
} else {
|
||||
@ -215,7 +215,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}
|
||||
|
||||
var autoHead = localStorage.getItem("auto-head");
|
||||
let autoHead = localStorage.getItem("auto-head");
|
||||
if (autoHead === null) {
|
||||
autoHead = option.other.autoHead;
|
||||
} else {
|
||||
@ -224,7 +224,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}
|
||||
|
||||
var muiltTab = localStorage.getItem("muilt-tab");
|
||||
let muiltTab = localStorage.getItem("muilt-tab");
|
||||
if (muiltTab === null) {
|
||||
muiltTab = option.tab.enable;
|
||||
} else {
|
||||
@ -233,7 +233,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}
|
||||
|
||||
var control = localStorage.getItem("control");
|
||||
let control = localStorage.getItem("control");
|
||||
if (control === null) {
|
||||
control = option.menu.control;
|
||||
} else {
|
||||
@ -242,7 +242,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}
|
||||
|
||||
var footer = localStorage.getItem("footer");
|
||||
let footer = localStorage.getItem("footer");
|
||||
if (footer === null) {
|
||||
footer = option.other.footer;
|
||||
} else {
|
||||
@ -265,8 +265,8 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
this.footer = function (footer) {
|
||||
var bodyDOM = $(".pear-admin .layui-body");
|
||||
var footerDOM = $(".pear-admin .layui-footer");
|
||||
const bodyDOM = $(".pear-admin .layui-body");
|
||||
const footerDOM = $(".pear-admin .layui-footer");
|
||||
if (footer === true || footer === "true") {
|
||||
footerDOM.removeClass("close");
|
||||
bodyDOM.css("bottom", footerDOM.outerHeight());
|
||||
@ -277,7 +277,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
this.bannerSkin = function (theme) {
|
||||
var pearAdmin = $(".pear-admin");
|
||||
const pearAdmin = $(".pear-admin");
|
||||
pearAdmin.removeClass("banner-layout");
|
||||
if (theme === true || theme === "true") {
|
||||
pearAdmin.addClass("banner-layout");
|
||||
@ -293,14 +293,14 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
this.menuSkin = function (theme) {
|
||||
var pearAdmin = $(".pear-admin .layui-side");
|
||||
const pearAdmin = $(".pear-admin .layui-side");
|
||||
pearAdmin.removeClass("light-theme");
|
||||
pearAdmin.removeClass("dark-theme");
|
||||
pearAdmin.addClass(theme);
|
||||
}
|
||||
|
||||
this.headerSkin = function (theme) {
|
||||
var pearAdmin = $(".pear-admin .layui-header");
|
||||
const pearAdmin = $(".pear-admin .layui-header");
|
||||
pearAdmin.removeClass("light-theme");
|
||||
pearAdmin.removeClass("dark-theme");
|
||||
pearAdmin.addClass(theme);
|
||||
@ -325,7 +325,8 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
this.refresh = function (id) {
|
||||
$("iframe[id='"+ id +"']").attr('src', $("iframe[id='"+ id +"']").attr('src'));
|
||||
const iframe = $("iframe[id='" + id + "']");
|
||||
iframe.attr('src', iframe.attr('src'));
|
||||
}
|
||||
|
||||
this.addTab = function (id, title, url) {
|
||||
@ -337,8 +338,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
icon: null,
|
||||
close: true
|
||||
}, 400);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,8 +346,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
pearTab.delTabByElem('content', id, function (currentId) {
|
||||
sideMenu.selectItem(currentId);
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -357,8 +354,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
pearTab.delCurrentTabByElem('content', function (id) {
|
||||
sideMenu.selectItem(id);
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -367,8 +362,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
pearTab.delOtherTabByElem('content', function (id) {
|
||||
sideMenu.selectItem(id);
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -377,8 +370,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
pearTab.delAllTabByElem('content', function (id) {
|
||||
sideMenu.selectItem(id);
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -387,9 +378,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
this.changeIframe = function (id, title, url) {
|
||||
if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) {
|
||||
return;
|
||||
} else {
|
||||
if (isMuiltTab(config) !== "true" && isMuiltTab(config) !== true) {
|
||||
sideMenu.selectItem(id);
|
||||
bodyFrame.changePage(url, true);
|
||||
}
|
||||
@ -417,7 +406,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
};
|
||||
|
||||
function refresh() {
|
||||
var refreshA = $(".refresh a");
|
||||
const refreshA = $(".refresh a");
|
||||
refreshA.removeClass("layui-icon-refresh-1");
|
||||
refreshA.addClass("layui-anim");
|
||||
refreshA.addClass("layui-anim-rotate");
|
||||
@ -436,9 +425,9 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
|
||||
function collapse() {
|
||||
sideMenu.collapse();
|
||||
var admin = $(".pear-admin");
|
||||
var left = $(".layui-icon-spread-left")
|
||||
var right = $(".layui-icon-shrink-right")
|
||||
const admin = $(".pear-admin");
|
||||
const left = $(".layui-icon-spread-left");
|
||||
const right = $(".layui-icon-shrink-right");
|
||||
if (admin.is(".pear-mini")) {
|
||||
left.addClass("layui-icon-shrink-right")
|
||||
left.removeClass("layui-icon-spread-left")
|
||||
@ -464,9 +453,9 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
|
||||
body.on("click", ".menuSearch", function () {
|
||||
// 过滤菜单
|
||||
var filterHandle = function (filterData, val) {
|
||||
const filterHandle = function (filterData, val) {
|
||||
if (!val) return [];
|
||||
var filteredMenus = [];
|
||||
const filteredMenus = [];
|
||||
filterData = $.extend(true, {}, filterData);
|
||||
$.each(filterData, function (index, item) {
|
||||
if (item.children && item.children.length) {
|
||||
@ -483,20 +472,20 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
})
|
||||
return filteredMenus;
|
||||
}
|
||||
};
|
||||
|
||||
// 树转路径
|
||||
var tiledHandle = function (data) {
|
||||
var tiledMenus = [];
|
||||
var treeTiled = function (data, content) {
|
||||
var path = "";
|
||||
var separator = " / ";
|
||||
const tiledHandle = function (data) {
|
||||
const tiledMenus = [];
|
||||
const treeTiled = function (data, content) {
|
||||
let path = "";
|
||||
const separator = " / ";
|
||||
// 上级路径
|
||||
if (!content) content = "";
|
||||
$.each(data, function (index, item) {
|
||||
if (item.children && item.children.length) {
|
||||
path += content + item.title + separator;
|
||||
var childPath = treeTiled(item.children, path);
|
||||
const childPath = treeTiled(item.children, path);
|
||||
path += childPath;
|
||||
if (!childPath) path = ""; // 重置路径
|
||||
} else {
|
||||
@ -510,11 +499,11 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
treeTiled(data);
|
||||
|
||||
return tiledMenus;
|
||||
}
|
||||
};
|
||||
|
||||
// 创建搜索列表
|
||||
var createList = function (data) {
|
||||
var _listHtml = '';
|
||||
const createList = function (data) {
|
||||
let _listHtml = '';
|
||||
$.each(data, function (index, item) {
|
||||
_listHtml += '<li smenu-id="' + item.info.id + '" smenu-icon="' + item.info.icon + '" smenu-url="' + item.info.href + '" smenu-title="' + item.info.title + '" smenu-type="' + item.info.type + '">';
|
||||
_listHtml += ' <span><i style="margin-right:10px" class=" ' + item.info.icon + '"></i>' + item.path + '</span>';
|
||||
@ -522,9 +511,9 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
_listHtml += '</li>'
|
||||
})
|
||||
return _listHtml;
|
||||
}
|
||||
};
|
||||
|
||||
var _html = [
|
||||
const _html = [
|
||||
'<div class="menu-search-content">',
|
||||
' <div class="layui-form menu-search-input-wrapper">',
|
||||
' <div class=" layui-input-wrap layui-input-wrap-prefix">',
|
||||
@ -551,43 +540,43 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
move: false,
|
||||
content: _html,
|
||||
success: function(layero,layeridx){
|
||||
var $layer = layero;
|
||||
var $content = $(layero).children('.layui-layer-content');
|
||||
var $input = $(".menu-search-input-wrapper input");
|
||||
var $noData = $(".menu-search-no-data");
|
||||
var $list = $(".menu-search-list");
|
||||
var menuData = sideMenu.option.data;
|
||||
const $layer = layero;
|
||||
const $content = $(layero).children('.layui-layer-content');
|
||||
const $input = $(".menu-search-input-wrapper input");
|
||||
const $noData = $(".menu-search-no-data");
|
||||
const $list = $(".menu-search-list");
|
||||
const menuData = sideMenu.option.data;
|
||||
|
||||
|
||||
$layer.css("border-radius", "6px");
|
||||
$input.off("focus").focus();
|
||||
// 搜索菜单
|
||||
$input.off("input").on("input", debounce(function(){
|
||||
var keywords = $input.val().trim();
|
||||
var filteredMenus = filterHandle(menuData, keywords);
|
||||
const keywords = $input.val().trim();
|
||||
const filteredMenus = filterHandle(menuData, keywords);
|
||||
|
||||
if(filteredMenus.length){
|
||||
var tiledMenus = tiledHandle(filteredMenus);
|
||||
var listHtml = createList(tiledMenus);
|
||||
const tiledMenus = tiledHandle(filteredMenus);
|
||||
const listHtml = createList(tiledMenus);
|
||||
$noData.css("display", "none");
|
||||
$list.html("").append(listHtml).children(":first").addClass("this")
|
||||
}else{
|
||||
$list.html("");
|
||||
$noData.css("display", "flex");
|
||||
}
|
||||
var currentHeight = $(".menu-search-content").outerHeight()
|
||||
const currentHeight = $(".menu-search-content").outerHeight();
|
||||
$layer.css("height", currentHeight);
|
||||
$content.css("height", currentHeight);
|
||||
}, 500)
|
||||
)
|
||||
// 搜索列表点击事件
|
||||
$list.off("click").on("click", "li", function () {
|
||||
var menuId = $(this).attr("smenu-id");
|
||||
var menuUrl = $(this).attr("smenu-url");
|
||||
var menuIcon = $(this).attr("smenu-icon");
|
||||
var menuTitle = $(this).attr("smenu-title");
|
||||
var menuType = $(this).attr("smenu-type");
|
||||
var openableWindow = menuType === "1" || menuType === 1;
|
||||
const menuId = $(this).attr("smenu-id");
|
||||
const menuUrl = $(this).attr("smenu-url");
|
||||
const menuIcon = $(this).attr("smenu-icon");
|
||||
const menuTitle = $(this).attr("smenu-title");
|
||||
const menuType = $(this).attr("smenu-type");
|
||||
const openableWindow = menuType === "1" || menuType === 1;
|
||||
|
||||
if(sideMenu.isCollapse){
|
||||
collapse();
|
||||
@ -611,13 +600,14 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
// 监听键盘事件
|
||||
// Enter:13 Spacebar:32 UpArrow:38 DownArrow:40 Esc:27
|
||||
$(document).off("keydown").keydown(function (e) {
|
||||
const $menuSearchList = $(".menu-search-list li.this");
|
||||
if (e.keyCode === 13 || e.keyCode === 32) {
|
||||
e.preventDefault();
|
||||
var menuId = $(".menu-search-list li.this").attr("smenu-id");
|
||||
var menuUrl = $(".menu-search-list li.this").attr("smenu-url");
|
||||
var menuTitle = $(".menu-search-list li.this").attr("smenu-title");
|
||||
var menuType = $(".menu-search-list li.this").attr("smenu-type");
|
||||
var openableWindow = menuType === "1" || menuType === 1;
|
||||
const menuId = $menuSearchList.attr("smenu-id");
|
||||
const menuUrl = $menuSearchList.attr("smenu-url");
|
||||
const menuTitle = $menuSearchList.attr("smenu-title");
|
||||
const menuType = $menuSearchList.attr("smenu-type");
|
||||
const openableWindow = menuType === "1" || menuType === 1;
|
||||
if (sideMenu.isCollapse) {
|
||||
collapse();
|
||||
}
|
||||
@ -630,8 +620,8 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
layer.close(layeridx);
|
||||
}else if(e.keyCode === 38){
|
||||
e.preventDefault();
|
||||
var prevEl = $(".menu-search-list li.this").prev();
|
||||
$(".menu-search-list li.this").removeClass("this");
|
||||
const prevEl = $menuSearchList.prev();
|
||||
$menuSearchList.removeClass("this");
|
||||
if(prevEl.length !== 0){
|
||||
prevEl.addClass("this");
|
||||
}else{
|
||||
@ -639,8 +629,8 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}else if(e.keyCode === 40){
|
||||
e.preventDefault();
|
||||
var nextEl = $(".menu-search-list li.this").next();
|
||||
$(".menu-search-list li.this").removeClass("this");
|
||||
const nextEl = $menuSearchList.next();
|
||||
$menuSearchList.removeClass("this");
|
||||
if(nextEl.length !== 0){
|
||||
nextEl.addClass("this");
|
||||
}else{
|
||||
@ -684,7 +674,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
|
||||
body.on("click", ".setting", function() {
|
||||
|
||||
var menuItem =
|
||||
let menuItem =
|
||||
'<li class="layui-this" data-select-bgcolor="dark-theme" >' +
|
||||
'<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 12px; background: white;"></span></div>' +
|
||||
@ -700,7 +690,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
var menuHtml =
|
||||
const menuHtml =
|
||||
'<div class="pearone-color">\n' +
|
||||
'<div class="color-title">菜单风格</div>\n' +
|
||||
'<div class="color-content">\n' +
|
||||
@ -708,7 +698,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
|
||||
var headItem =
|
||||
let headItem =
|
||||
'<li class="layui-this" data-select-header="light-theme" >' +
|
||||
'<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 12px; background: white;"></span></div>' +
|
||||
@ -724,7 +714,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
var headHtml =
|
||||
const headHtml =
|
||||
'<div class="pearone-color">\n' +
|
||||
'<div class="color-title">顶部风格</div>\n' +
|
||||
'<div class="color-content">\n' +
|
||||
@ -732,7 +722,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
|
||||
var moreItem =
|
||||
let moreItem =
|
||||
'<div class="layui-form-item"><div class="layui-input-inline"><input type="checkbox" name="control" lay-filter="control" lay-skin="switch" lay-text="开|关"></div><span class="set-text">菜单</span></div>';
|
||||
|
||||
moreItem +=
|
||||
@ -747,7 +737,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
moreItem +=
|
||||
'<div class="layui-form-item"><div class="layui-input-inline"><input type="checkbox" name="footer" lay-filter="footer" lay-skin="switch" lay-text="开|关"></div><span class="set-text">页脚</span></div>';
|
||||
|
||||
var moreHtml = '<br><div class="pearone-color">\n' +
|
||||
const moreHtml = '<br><div class="pearone-color">\n' +
|
||||
'<div class="color-title">更多设置</div>\n' +
|
||||
'<div class="color-content">\n' +
|
||||
'<form class="layui-form">\n' + moreItem + '</form>\n' +
|
||||
@ -770,9 +760,9 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
|
||||
form.render();
|
||||
|
||||
var color = localStorage.getItem("theme-color");
|
||||
var menu = localStorage.getItem("theme-menu");
|
||||
var header = localStorage.getItem("theme-header");
|
||||
const color = localStorage.getItem("theme-color");
|
||||
const menu = localStorage.getItem("theme-menu");
|
||||
const header = localStorage.getItem("theme-header");
|
||||
|
||||
if (color !== "null") {
|
||||
$(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok");
|
||||
@ -790,7 +780,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
$('#layui-layer-shade' + index).click(function() {
|
||||
var $layero = $('#layui-layer' + index);
|
||||
const $layero = $('#layui-layer' + index);
|
||||
$layero.animate({
|
||||
left: $layero.offset().left + $layero.width()
|
||||
}, 200, function() {
|
||||
@ -859,7 +849,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
});
|
||||
|
||||
body.on('click', '[data-select-bgcolor]', function() {
|
||||
var theme = $(this).attr('data-select-bgcolor');
|
||||
const theme = $(this).attr('data-select-bgcolor');
|
||||
$('[data-select-bgcolor]').removeClass("layui-this");
|
||||
$(this).addClass("layui-this");
|
||||
localStorage.setItem("theme-menu", theme);
|
||||
@ -867,7 +857,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
});
|
||||
|
||||
body.on('click', '[data-select-header]', function() {
|
||||
var theme = $(this).attr('data-select-header');
|
||||
const theme = $(this).attr('data-select-header');
|
||||
$('[data-select-header]').removeClass("layui-this");
|
||||
$(this).addClass("layui-this");
|
||||
localStorage.setItem("theme-header", theme);
|
||||
@ -877,8 +867,8 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
body.on('click', '.select-color-item', function() {
|
||||
$(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok");
|
||||
$(this).addClass("layui-icon").addClass("layui-icon-ok");
|
||||
var colorId = $(".select-color-item.layui-icon-ok").attr("color-id");
|
||||
var currentColor = getColorById(colorId);
|
||||
const colorId = $(".select-color-item.layui-icon-ok").attr("color-id");
|
||||
const currentColor = getColorById(colorId);
|
||||
localStorage.setItem("theme-color", currentColor.id);
|
||||
localStorage.setItem("theme-color-color", currentColor.color);
|
||||
localStorage.setItem("theme-color-second", currentColor.second);
|
||||
@ -892,14 +882,14 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
pearAdmin.bodyRender(param);
|
||||
pearAdmin.themeRender(param);
|
||||
pearAdmin.keepLoad(param);
|
||||
if (param.header.message != false) {
|
||||
if (param.header.message !== false) {
|
||||
pearAdmin.messageRender(param);
|
||||
}
|
||||
}
|
||||
|
||||
function getColorById(id) {
|
||||
var color;
|
||||
var flag = false;
|
||||
let color;
|
||||
let flag = false;
|
||||
$.each(config.colors, function(i, value) {
|
||||
if (value.id === id) {
|
||||
color = value;
|
||||
@ -917,7 +907,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
function buildColorHtml() {
|
||||
var colors = "";
|
||||
let colors = "";
|
||||
$.each(config.colors, function(i, value) {
|
||||
colors += "<span class='select-color-item' color-id='" + value.id + "' style='background-color:" + value.color +
|
||||
";'></span>";
|
||||
@ -981,9 +971,9 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
},50));
|
||||
|
||||
function debounce(fn, awaitTime) {
|
||||
var timerID = null
|
||||
let timerID = null;
|
||||
return function () {
|
||||
var arg = arguments[0]
|
||||
const arg = arguments[0];
|
||||
if (timerID) {
|
||||
clearTimeout(timerID)
|
||||
}
|
||||
|
@ -95,8 +95,12 @@ layui.define(['table', 'laypage','jquery', 'element'], function(exports) {
|
||||
html += "<div id='cardpage'></div>";
|
||||
}
|
||||
else {
|
||||
if (data.code != option.response.statusCode) {
|
||||
html = "<p>" + data.msg + "</p>";
|
||||
} else {
|
||||
html = "<p>没有数据</p>";
|
||||
}
|
||||
}
|
||||
$(option.elem).html(html);
|
||||
if (option.page) {
|
||||
laypage.render({
|
||||
@ -187,6 +191,9 @@ layui.define(['table', 'laypage','jquery', 'element'], function(exports) {
|
||||
data.msg = tempData[option.response.msgName];
|
||||
data.count = tempData[option.response.countName];
|
||||
var dataList = tempData[option.response.dataName];
|
||||
if(!dataList){
|
||||
return data;
|
||||
}
|
||||
data.data = [];
|
||||
for (var i = 0; i < dataList.length; i++) {
|
||||
var item = dataList[i];
|
||||
|
@ -20,7 +20,6 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
defaultOpen: opt.defaultOpen,
|
||||
defaultSelect: opt.defaultSelect,
|
||||
control: opt.control,
|
||||
controlWidth: opt.controlWidth ? opt.controlWidth : "auto",
|
||||
defaultMenu: opt.defaultMenu,
|
||||
accordion: opt.accordion,
|
||||
height: opt.height,
|
||||
@ -57,31 +56,6 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
// 处理高度
|
||||
$("#" + opt.elem).height(option.height)
|
||||
|
||||
setTimeout(function () {
|
||||
$("#" + opt.control + " .control").on("mousewheel DOMMouseScroll", function (event) {
|
||||
|
||||
var delta = (event.originalEvent.wheelDelta && (event.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie
|
||||
(event.originalEvent.detail && (event.originalEvent.detail > 0 ? -1 : 1)); // firefox
|
||||
|
||||
if (delta > 0) {
|
||||
for (var num = 1; num < 20; num++) {
|
||||
setTimeout(function () {
|
||||
if ($("#" + opt.control + " .control ul").css('left').replace("px", "") < 0) {
|
||||
$("#" + opt.control + " .control ul").css("left", "+=2px");
|
||||
}
|
||||
}, 10)
|
||||
}
|
||||
} else if (delta < 0) {
|
||||
if (((Number)($("#" + opt.control + " .control ul").css("left").replace("px", "")) + ($("#" + opt.control + " .control ul").width() - $("#" + opt.control + " .control").width())) > 0) {
|
||||
for (var num = 1; num < 20; num++) {
|
||||
setTimeout(function () {
|
||||
$("#" + opt.control + " .control ul").css("left", "-=2px");
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000)
|
||||
|
||||
return new pearMenu(option);
|
||||
}
|
||||
@ -322,7 +296,8 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
}
|
||||
|
||||
function createMenuAndControl(option) {
|
||||
var control = '<div style="width: ' + option.controlWidth + 'px;white-space: nowrap;overflow-x: scroll;overflow: hidden;" class="control"><ul class="layui-nav pear-nav-control pc layui-hide-xs" style="width: fit-content;">';
|
||||
var control = '<div class="control"><ul class="layui-nav pear-nav-control pc layui-hide-xs" style="width: fit-content;">';
|
||||
control+= '<li class="layui-nav-item tabdrop layui-hide" style="float:right !important;"><a href="javascript:;"><i class="layui-icon layui-icon-more layui-font-20"></i></a><dl class="layui-nav-child"></dl></li>';
|
||||
var controlPe = '<ul class="layui-nav pear-nav-control layui-hide-sm">';
|
||||
// 声 明 头 部
|
||||
var menu = '<div class="layui-side-scroll ' + option.theme + '">'
|
||||
@ -479,7 +454,6 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$(this).parent().addClass("layui-nav-itemed");
|
||||
ele.animate({
|
||||
height: "0px"
|
||||
}, 240, function () {
|
||||
@ -551,10 +525,57 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
rationalizeWidth = $headerControl.parent().innerWidth() - $headerControl.position().left;
|
||||
}
|
||||
|
||||
if (option.controlWidth && rationalizeWidth >= option.controlWidth) {
|
||||
rationalizeWidth = option.controlWidth;
|
||||
$("#" + option.control + " .control").css({"width": rationalizeWidth});
|
||||
|
||||
var navobj = $("#" + option.control+' ul.pear-nav-control.pc');
|
||||
var dropdown = $(".tabdrop", navobj);
|
||||
|
||||
var collection = 0;
|
||||
var maxwidth = rationalizeWidth - 60;
|
||||
|
||||
var liwidth = 0;
|
||||
//检查超过一行的标签页
|
||||
$('.tabdrop').find('dd').each(function(){
|
||||
var newLI = $('<li></li>').html($(this).html());
|
||||
newLI.addClass('layui-nav-item');
|
||||
newLI.attr('pear-href', $(this).attr('pear-href'));
|
||||
newLI.attr('pear-title', $(this).attr('pear-title'));
|
||||
newLI.attr('pear-id', $(this).attr('pear-id'));
|
||||
navobj.append(newLI);
|
||||
$(this).remove();
|
||||
|
||||
})
|
||||
var litabs = navobj.find('>li').not('.tabdrop');
|
||||
|
||||
var totalwidth = 0;
|
||||
litabs.each(function () {
|
||||
totalwidth += $(this).outerWidth(true);
|
||||
});
|
||||
|
||||
if (rationalizeWidth < totalwidth) {
|
||||
litabs.each(function () {
|
||||
liwidth += $(this).outerWidth(true);
|
||||
if (liwidth > maxwidth) {
|
||||
var newDD = $('<dd></dd>').html($(this).html());
|
||||
newDD.attr('pear-href', $(this).attr('pear-href'));
|
||||
newDD.attr('pear-title', $(this).attr('pear-title'));
|
||||
newDD.attr('pear-id', $(this).attr('pear-id'));
|
||||
dropdown.find('dl').append(newDD);
|
||||
collection++;
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
if (collection > 0) {
|
||||
dropdown.removeClass('layui-hide');
|
||||
if (dropdown.find('.active').length === 1) {
|
||||
dropdown.addClass('active');
|
||||
} else {
|
||||
dropdown.removeClass('active');
|
||||
}
|
||||
}
|
||||
}else {
|
||||
dropdown.addClass('layui-hide');
|
||||
}
|
||||
$("#" + option.control + " .control").css({ "width": rationalizeWidth, "transition": "width .15s" });
|
||||
}
|
||||
|
||||
function rationalizeHeaderControlWidthAuto(option){
|
||||
|
@ -7,7 +7,7 @@ window.rootPath = (function (src) {
|
||||
|
||||
layui.config({
|
||||
base: rootPath + "module/",
|
||||
version: "3.30.0"
|
||||
version: "3.40.0"
|
||||
}).extend({
|
||||
admin: "admin", // 框架布局组件
|
||||
common: "common", // 公共方法封装
|
||||
|
@ -160,7 +160,7 @@ pre{overflow-y: auto;
|
||||
|
||||
/* 头像 */
|
||||
.fly-avatar{position: absolute; left: 15px; top: 10px;}
|
||||
.fly-avatar img{display: block; width: 45px; height: 45px; margin: 0; border-radius: 100%;}
|
||||
.fly-avatar img{display: block; width: 45px; height: 45px; margin: 0; border-radius: 100%; object-fit: cover;}
|
||||
.fly-avatar i{position: absolute; left: 35px; top: 25px; }
|
||||
|
||||
/* 徽章 */
|
||||
@ -409,13 +409,6 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.fly-signin-main span{padding-left: 10px;}
|
||||
|
||||
/* 榜单 */
|
||||
.fly-rank{padding-bottom: 10px;}
|
||||
.fly-rank dl{position: relative; overflow: hidden; margin-left: 10px; text-align: center; font-size: 0;}
|
||||
.fly-rank dd{position: relative; width: 55px; height: 75px; margin: 10px 15px 5px 0; display:inline-block; *display:inline; *zoom:1; vertical-align:top; font-size:12px;}
|
||||
.fly-rank dd a img{width: 55px; height: 55px; border-radius: 10px;}
|
||||
.fly-rank dd a cite{ position:absolute; bottom: 20px; left: 0; width: 100%; height:20px; line-height:20px; text-align:center; background-color:rgba(0,0,0,.2); color:#fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
.fly-rank dd a:hover cite{display: block;}
|
||||
.fly-rank dd a i{position:absolute; bottom: 0; left: 0; width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal;}
|
||||
|
||||
/* 温馨通道 */
|
||||
.fly-list-quick{border: 1px solid #f2f2f2; border-bottom: none; border-right: 0;}
|
||||
@ -450,7 +443,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.detail .title>h1{float: left; font-size: 22px; line-height: 36px; padding-bottom:10px;}
|
||||
.detail-box .title span {float: right; padding-right: 5px;}
|
||||
.detail .fly-avatar{position: absolute; left: 15px; top: 10px;}
|
||||
.detail .fly-avatar img{display: block; width: 45px; height: 45px; margin: 0; border-radius: 100%;}
|
||||
.detail .fly-avatar img{display: block; width: 45px; height: 45px; margin: 0; border-radius: 100%; object-fit: cover;}
|
||||
.detail .fly-avatar .icon-renzheng{display: inline-block; width: 15px; height: 15px; line-height: 15px; top: 25px; left: 32px; background-color: #FFB800; color: #fff; border-radius: 50%; font-size: 14px;}
|
||||
|
||||
.fly-detail-info{position: relative; margin: 10px 0 15px;}
|
||||
@ -483,6 +476,32 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
border-radius:5px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 750px) {
|
||||
.detail-assist {
|
||||
right:calc(50% - 500px);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 970px) {
|
||||
.detail-assist {
|
||||
right:calc(50% - 530px);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1170px) {
|
||||
.detail-assist {
|
||||
right:calc(50% - 620px);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1330px) {
|
||||
.detail-assist {
|
||||
right:calc(50% - 720px);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.detail-assist .fly-admin-box{text-align: center;}
|
||||
.detail-assist span{height: 30px;width:30px; line-height:30px;}
|
||||
.detail-assist .layui-btn{border-radius: 0;}
|
||||
@ -498,13 +517,6 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.detail-body p{margin-bottom: .6rem;font-size: .9375rem;line-height: 1.875;color: var(--color-secondary);word-wrap: break-word;}
|
||||
|
||||
.detail-body img{max-width: 100%; cursor: pointer;}
|
||||
/*
|
||||
.detail-body table{margin: 10px 0 15px;}
|
||||
.detail-body table thead{background-color:#f2f2f2;}
|
||||
.detail-body table th,
|
||||
.detail-body table td{padding: 10px 20px; line-height: 22px; border: 1px solid #DFDFDF; font-size: 14px; font-weight: 400;}
|
||||
*/
|
||||
|
||||
.detail-body .layui-btn{margin: 0 10px 10px 0;}
|
||||
.detail-body .layui-btn a{color: #fff;}
|
||||
.detail-body ul>li{margin-top: 0;}
|
||||
@ -512,25 +524,15 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
|
||||
/*详情页-问答*/
|
||||
.user-questions{position:relative; margin: 5px 0 15px;}
|
||||
.user-questions .user-avatar img{width: 25px; height: 25px; margin-top: 10; border-radius: 100%;}
|
||||
|
||||
/*
|
||||
.detail-body-wenda{margin: 10px 0 5px; line-height: 26px; font-size: 16px; color: rgb(82, 80, 80); word-wrap: break-word;}
|
||||
.detail-body-wenda p{margin-bottom:15px;}
|
||||
.detail-body-wenda img{max-width: 100%; cursor: pointer;}
|
||||
.detail-body-wenda .layui-btn{margin: 0 10px 10px 0;}
|
||||
.detail-body-wenda .layui-btn a{color: #fff;}
|
||||
.detail-body-wenda ul>li{margin-top: 0;}
|
||||
.detail-body-wenda .layui-elem-quote{margin: 10px 0; font-size: 14px; line-height: 26px;}
|
||||
*/
|
||||
.user-questions .user-avatar img{width: 25px; height: 25px; border-radius: 100%;object-fit: cover;}
|
||||
|
||||
.layui-form-pane{position:relative; width:100%;}
|
||||
.que-comments{position:absolute; right:15px; bottom:15px;}
|
||||
|
||||
.wenda-user{height:200px; margin: 0,auto; text-align: center; pardding-top:20px;}
|
||||
.wenda-user .user-img{posation:relative; width:100%;}
|
||||
.wenda-user .user-img img{width:150px;height:150px; border-radius: 100%;}
|
||||
.wenda-user .user-img i{posation:absolute;right:20px;top:30px;width: 25px; height:25px; color:#fff; font-site:18px; border-radius: 100%;background-color:#FFB800;}
|
||||
.wenda-user{height:200px; margin: 0,auto; text-align: center; padding-top:20px;}
|
||||
.wenda-user .user-img{position:relative; width:100%;}
|
||||
.wenda-user .user-img img{width:150px; height:150px; border-radius: 100%; object-fit: cover;}
|
||||
.wenda-user .user-img i{position:absolute;right:20px;top:30px;width: 25px; height:25px; color:#fff; font-size:18px; border-radius: 100%;background-color:#FFB800;}
|
||||
.wenda-user .questions{height:30px;margin:20px 20px;}
|
||||
|
||||
/*详情页-文章post*/
|
||||
|
@ -699,26 +699,6 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
|
||||
//签到
|
||||
|
||||
//活跃榜
|
||||
var tplReply = ['{{# layui.each(d.data, function(index, item){ }}'
|
||||
,'<dd>'
|
||||
,'<a href="{{item.uid}}">'
|
||||
,'<img src="{{item.user.avatar}}">'
|
||||
,'<cite>{{item.user.username}}</cite>'
|
||||
,'<i>{{item["count"]}}' + replyNum + '</i>'
|
||||
,'</a>'
|
||||
,'</dd>'
|
||||
,'{{# }); }}'].join('')
|
||||
,elemReply = $('#LAY_replyRank');
|
||||
|
||||
var replyUrl = elemReply.attr('data-url');
|
||||
if(elemReply[0]){
|
||||
fly.json(replyUrl, {
|
||||
limit: 20
|
||||
}, function(res){
|
||||
var html = laytpl(tplReply).render(res);
|
||||
elemReply.find('dl').html(html);
|
||||
});
|
||||
};
|
||||
|
||||
//相册
|
||||
if($(window).width() > 750){
|
||||
|
@ -33,19 +33,54 @@ layui.define(['laypage', 'fly', 'element', 'flow', 'imgcom'], function(exports){
|
||||
var post = table.render({
|
||||
elem: '#art-post'
|
||||
,url: artListUrl
|
||||
,toolbar: '#toolbarPost'
|
||||
,title: ''
|
||||
,cols: [[
|
||||
{type: 'numbers', fixed: 'left'}
|
||||
{type: 'checkbox', fixed: 'left'},
|
||||
{type: 'numbers', fixed: 'left', title: '序号'}
|
||||
,{field: 'title', title: '标题',minWidth: 250 ,templet: '<div><a href="{{d.url}}" target="_blank">{{-d.title}}</a></div>'}
|
||||
,{field: 'pv', title:'浏览 <i class="layui-icon layui-icon-tips layui-font-14" lay-event="pv-tips" title="该字段开启了编辑功能" style="margin-left: 5px;"></i>', fieldTitle: 'pv', hide: 0, width:100, expandedMode: 'tips', edit: 'text'}
|
||||
,{field: 'status', title: '状态', width: 80}
|
||||
,{field: 'ctime', title: '时间', width: 120}
|
||||
,{field: 'datas', title: '数据', width: 120}
|
||||
,{field: 'ctime', title: '发布时间', width: 160}
|
||||
,{field: 'utime', title: '更新时间', width:160}
|
||||
,{field: 'datas', title: '数据', width: 80}
|
||||
,{title: '操作', width: 150, align: 'center', toolbar: '#artTool'}
|
||||
]]
|
||||
,text: '对不起,加载出现异常!'
|
||||
,page: true
|
||||
});
|
||||
|
||||
// 工具栏事件
|
||||
table.on('toolbar(art-post)', function(obj){
|
||||
var id = obj.config.id;
|
||||
var checkStatus = table.checkStatus(id);
|
||||
var othis = lay(this);
|
||||
switch(obj.event){
|
||||
case 'getCheckData':
|
||||
var data = checkStatus.data;
|
||||
// layer.alert(layui.util.escape(JSON.stringify(data)));
|
||||
$.post(updateTime,{"data":data},function(res){
|
||||
if(res.code === 0){
|
||||
layer.msg(res.msg,{icon:6,time:2000});
|
||||
table.reload('art-post')
|
||||
} else {
|
||||
layer.open({title:'刷新失败',content:res.msg,icon:5,adim:6})
|
||||
}
|
||||
}
|
||||
);
|
||||
break;
|
||||
case 'getData':
|
||||
var getData = table.getData(id);
|
||||
console.log(getData);
|
||||
layer.alert(layui.util.escape(JSON.stringify(getData)));
|
||||
break;
|
||||
case 'LAYTABLE_TIPS':
|
||||
layer.alert('自定义工具栏图标按钮');
|
||||
break;
|
||||
};
|
||||
return false
|
||||
});
|
||||
|
||||
//收藏list
|
||||
table.render({
|
||||
elem: '#coll-post'
|
||||
@ -63,6 +98,44 @@ layui.define(['laypage', 'fly', 'element', 'flow', 'imgcom'], function(exports){
|
||||
,page: true
|
||||
});
|
||||
|
||||
// 单元格编辑事件
|
||||
table.on('edit(art-post)', function(obj){
|
||||
var field = obj.field; // 得到字段
|
||||
var value = obj.value; // 得到修改后的值
|
||||
var data = obj.data; // 得到所在行所有键值
|
||||
|
||||
// 值的校验
|
||||
if(field === 'email'){
|
||||
if(!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(obj.value)){
|
||||
layer.tips('输入的邮箱格式不正确,请重新编辑', this, {tips: 1});
|
||||
return obj.reedit(); // 重新编辑 -- v2.8.0 新增
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑后续操作,如提交更新请求,以完成真实的数据更新
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: pvEdit,
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(res.code === 0) {
|
||||
layer.msg(res.msg, {icon: 1});
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
})
|
||||
// …
|
||||
|
||||
// 其他更新操作
|
||||
var update = {};
|
||||
update[field] = value;
|
||||
obj.update(update);
|
||||
});
|
||||
|
||||
|
||||
//监听行工具事件
|
||||
table.on('tool(art-post)', function(obj){
|
||||
var data = obj.data;
|
||||
|
12
vendor/composer/installed.json
vendored
12
vendor/composer/installed.json
vendored
@ -910,17 +910,17 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
"version": "v1.3.1",
|
||||
"version_normalized": "1.3.1.0",
|
||||
"version": "v1.3.2",
|
||||
"version_normalized": "1.3.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/serializable-closure.git",
|
||||
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902"
|
||||
"reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902",
|
||||
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/076fe2cf128bd54b4341cdc6d49b95b34e101e4c",
|
||||
"reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -932,7 +932,7 @@
|
||||
"phpstan/phpstan": "^1.8.2",
|
||||
"symfony/var-dumper": "^5.4.11"
|
||||
},
|
||||
"time": "2023-07-14T13:56:28+00:00",
|
||||
"time": "2023-10-17T13:38:16+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
10
vendor/composer/installed.php
vendored
10
vendor/composer/installed.php
vendored
@ -3,7 +3,7 @@
|
||||
'name' => 'taoser/taoler',
|
||||
'pretty_version' => '2.3.10.x-dev',
|
||||
'version' => '2.3.10.9999999-dev',
|
||||
'reference' => 'bb3b4af586dd839d0b6330e097914b95aeaf10b5',
|
||||
'reference' => '3115f271141016645a6dadee3b74f71758c868fb',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@ -128,9 +128,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'laravel/serializable-closure' => array(
|
||||
'pretty_version' => 'v1.3.1',
|
||||
'version' => '1.3.1.0',
|
||||
'reference' => 'e5a3057a5591e1cfe8183034b0203921abe2c902',
|
||||
'pretty_version' => 'v1.3.2',
|
||||
'version' => '1.3.2.0',
|
||||
'reference' => '076fe2cf128bd54b4341cdc6d49b95b34e101e4c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../laravel/serializable-closure',
|
||||
'aliases' => array(),
|
||||
@ -358,7 +358,7 @@
|
||||
'taoser/taoler' => array(
|
||||
'pretty_version' => '2.3.10.x-dev',
|
||||
'version' => '2.3.10.9999999-dev',
|
||||
'reference' => 'bb3b4af586dd839d0b6330e097914b95aeaf10b5',
|
||||
'reference' => '3115f271141016645a6dadee3b74f71758c868fb',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
@ -642,6 +642,11 @@ class ReflectionClosure extends ReflectionFunction
|
||||
break;
|
||||
case 'anonymous':
|
||||
switch ($token[0]) {
|
||||
case T_NAME_QUALIFIED:
|
||||
[$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]);
|
||||
$state = 'id_name';
|
||||
$lastState = 'anonymous';
|
||||
break 2;
|
||||
case T_NS_SEPARATOR:
|
||||
case T_STRING:
|
||||
$id_start = $token[1];
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2023-10-24 23:07:16
|
||||
// This file is automatically generated at:2023-11-02 18:31:51
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'taoser\\addons\\Service',
|
||||
|
7
vendor/taoser/think-addons/src/Addons.php
vendored
7
vendor/taoser/think-addons/src/Addons.php
vendored
@ -41,7 +41,7 @@ abstract class Addons
|
||||
$this->addon_info = "addon_{$this->name}_info";
|
||||
$this->view = clone View::engine('Think');
|
||||
$this->view->config([
|
||||
'view_path' => $this->addon_path . 'view' . DIRECTORY_SEPARATOR
|
||||
'view_path' => (php_uname('s') == 'Linux') ? $this->addon_path . 'view' . DIRECTORY_SEPARATOR : $this->addon_path . 'view'
|
||||
]);
|
||||
|
||||
// 控制器初始化
|
||||
@ -98,7 +98,12 @@ abstract class Addons
|
||||
*/
|
||||
protected function assign($name, $value = '')
|
||||
{
|
||||
|
||||
if (is_array($name)) {
|
||||
$this->view->assign($name);
|
||||
} else {
|
||||
$this->view->assign([$name => $value]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -101,7 +101,11 @@ class Controller extends BaseController
|
||||
*/
|
||||
protected function assign($name, $value = '')
|
||||
{
|
||||
if (is_array($name)) {
|
||||
$this->view->assign($name);
|
||||
} else {
|
||||
$this->view->assign([$name => $value]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
2
vendor/taoser/think-addons/src/helper.php
vendored
2
vendor/taoser/think-addons/src/helper.php
vendored
@ -309,7 +309,7 @@ if (!function_exists('get_addons_list')) {
|
||||
$info = get_addons_info($name);
|
||||
if (!isset($info['name']))
|
||||
continue;
|
||||
$info['url'] =isset($info['url']) && $info['url'] ?(string)addons_url($info['url']):'';
|
||||
//$info['url'] =isset($info['url']) && $info['url'] ?(string)addons_url($info['url']):'';
|
||||
$list[$name] = $info;
|
||||
}
|
||||
Cache::set('addonslist', $list);
|
||||
|
@ -66,18 +66,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<!--列表广告图片位-->
|
||||
{:hook('ads_cate_rimg')}
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_list')}
|
||||
|
||||
<dl class="fly-panel fly-list-one layui-hide-xs">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{$Request.domain}{$vo.url}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
{//热门标签}
|
||||
<div class="fly-panel layui-hide-xs">
|
||||
<div class="fly-panel-title">热门标签</div>
|
||||
@ -89,8 +80,6 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--列表广告赞助位-->
|
||||
{:hook('ads_cate_support')}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -221,21 +221,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--详情广告赞助位-->
|
||||
{:hook('ads_detail_support')}
|
||||
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{$Request.domain}{$vo.url}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
|
||||
<!--详情广告图片位-->
|
||||
{:hook('ads_detail_rimg')}
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_detail')}
|
||||
|
||||
</div>
|
||||
{//crud管理模块}
|
||||
@ -469,11 +456,8 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
{:hook('taoplayer')}
|
||||
|
||||
{:hook('taoplyr')}
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_detail_js')}
|
||||
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
|
@ -301,6 +301,9 @@
|
||||
<!--博客详情广告赞助位-->
|
||||
{:hook('ads_blog_detail_rimg')}
|
||||
|
||||
<!-- 联系方式 -->
|
||||
{:hook('callme_show', ['id' => $article.id, 'uid' => $article.user.id])}
|
||||
|
||||
{//热门文章}
|
||||
<dl class="function" id="rongkeji_remenwenzhang">
|
||||
<dt class="function_t">热门文章</dt>
|
||||
@ -582,10 +585,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
{:hook('taoplayer')}
|
||||
|
||||
{:hook('taoplyr')}
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_detail_js')}
|
||||
|
||||
{/block}
|
@ -23,6 +23,7 @@
|
||||
{if ($user.auth == 1)}
|
||||
<div id="CateId" class="xm-select-demo"></div>
|
||||
{else /}
|
||||
<input type="text" name="cate_id" class="layui-input layui-hide" disabled value="{$article.cate_id}">
|
||||
<input type="text" class="layui-input" disabled value="{$article.cate.catename}">
|
||||
{/if}
|
||||
</div>
|
||||
|
@ -68,20 +68,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<!--列表广告图片位-->
|
||||
{:hook('ads_cate_rimg')}
|
||||
|
||||
<dl class="fly-panel fly-list-one layui-hide-xs">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{$Request.domain}{$vo.url}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
<!--列表广告赞助位-->
|
||||
{:hook('ads_cate_support')}
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_list')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -75,11 +75,6 @@
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
{:hook('taoplayer')}
|
||||
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
collection = "{:url('collection/')}",
|
||||
@ -253,7 +248,8 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('taoplyr')}
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_detail_js')}
|
||||
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
|
@ -58,18 +58,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<!--列表广告图片位-->
|
||||
{:hook('ads_cate_rimg')}
|
||||
{//热门文章}
|
||||
<dl class="fly-panel fly-list-one layui-hide-xs">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{$Request.domain}{$vo.url}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_list')}
|
||||
|
||||
{//热门标签}
|
||||
<div class="fly-panel layui-hide-xs">
|
||||
<div class="fly-panel-title">热门标签</div>
|
||||
@ -81,8 +72,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--详情广告赞助位-->
|
||||
{:hook('ads_detail_support')}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,8 +25,10 @@
|
||||
{//图标}
|
||||
<div class="fly-detail-info">
|
||||
<span class="layui-badge layui-bg-green fly-detail-column">
|
||||
{if (cookie('think_lang') == 'en-us')} {article:cate name="ename" /}
|
||||
{else /} {article:cate name="name" /}
|
||||
{if (cookie('think_lang') == 'en-us')}
|
||||
{article:cate name="ename" /}
|
||||
{else /}
|
||||
{article:cate name="name" /}
|
||||
{/if}
|
||||
</span>
|
||||
{if ($article.is_top == 1)}<span class="layui-badge layui-bg-black">{:lang('top')}</span>{/if}
|
||||
@ -249,20 +251,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--详情广告赞助位-->
|
||||
{:hook('ads_detail_support')}
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{$Request.domain}{$vo.url}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
<!--详情广告图片位-->
|
||||
{:hook('ads_detail_rimg')}
|
||||
|
||||
<!-- 联系方式 -->
|
||||
{:hook('callme_show', ['id' => $article.id, 'uid' => $article.user.id])}
|
||||
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_detail')}
|
||||
|
||||
</div>
|
||||
|
||||
{//crud管理模块}
|
||||
{include file="/public/crud" /}
|
||||
</div>
|
||||
@ -270,12 +267,8 @@
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
|
||||
|
||||
|
||||
{:hook('taoplayer')}
|
||||
|
||||
<script>
|
||||
var collectionFind = "{:url('collection/find')}",
|
||||
collection = "{:url('collection/')}",
|
||||
@ -505,8 +498,9 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('taoplyr')}
|
||||
{:hook('taonyeditor')}
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_detail_js')}
|
||||
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
</form>
|
||||
<script src="/static/jquery-3.6.0.min.js"></script>
|
||||
<script src="/layui-1/layui.js"></script>
|
||||
<script src="/static/component/layui/layui.js"></script>
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
|
@ -104,37 +104,8 @@
|
||||
|
||||
{//右栏}
|
||||
<div class="layui-col-md4">
|
||||
<!--签到-->
|
||||
{:hook('signhook', ['id'=>1])}
|
||||
<!--排名-->
|
||||
{:hook('ranking')}
|
||||
<!--首页图片广告-->
|
||||
{:hook('ads_index_rimg')}
|
||||
<!--温馨通道-->
|
||||
{:hook('ads_index_fastlinks')}
|
||||
<!--广告赞助-->
|
||||
{:hook('ads_index_support')}
|
||||
<!--回帖榜-->
|
||||
<div class="fly-panel fly-rank fly-rank-reply layui-hide-xs" id="LAY_replyRank" data-url="{:url('user_reply')}">
|
||||
<h3 class="fly-panel-title">{:lang('reviewers list')}</h3>
|
||||
<dl>
|
||||
<i class="layui-icon fly-loading"></i>
|
||||
</dl>
|
||||
</div>
|
||||
<!--热帖榜-->
|
||||
<dl class="fly-panel fly-list-one layui-hide-xs">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{$Request.domain}{$vo.url}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
<!--首页图片广告-->
|
||||
{:hook('ads_index_rfimg')}
|
||||
<!--友情链接-->
|
||||
{:hook('ads_index_flink')}
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_index')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,6 +10,7 @@
|
||||
<a href="https://beian.miit.gov.cn/" target="blank">{$sysInfo.icp}</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{//websocket统计脚本}
|
||||
<div style="text-align:center;color:#999;font-size:14px;padding:0 0 10px;" id="online_count"></div>
|
||||
</div>
|
||||
@ -30,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{:hook('callme_foot', ['id' => $article.id ?? '', 'uid' => $article.user.id ?? ''])}
|
||||
{:hook('showLeftLayer')}
|
||||
<script>
|
||||
var $ = layui.jquery;
|
||||
|
@ -22,6 +22,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarPost">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-sm" lay-event="getCheckData">刷新选中行数据</button>
|
||||
<button class="layui-btn layui-btn-sm" id="dropdownButton">
|
||||
下拉按钮
|
||||
<i class="layui-icon layui-icon-down layui-font-12"></i>
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="artTool">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
@ -32,4 +42,8 @@
|
||||
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
var pvEdit = "{:url('user/edtipv')}"
|
||||
var updateTime = "{:url('user/updatetime')}"
|
||||
</script>
|
||||
{/block}
|
@ -17,6 +17,12 @@
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">如果您在邮箱已激活的情况下,变更了邮箱,需<a href="activate.html" style="font-size: 12px; color: #4f99cf;">重新验证邮箱</a>。</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">手机</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="L_phone" name="phone" autocomplete="off" value="{$user.phone}" class="layui-input" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="L_username" class="layui-form-label">昵称</label>
|
||||
<div class="layui-input-inline">
|
||||
@ -70,31 +76,31 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form layui-form-pane layui-tab-item">
|
||||
<form class="layui-form layui-form-pane layui-tab-item">
|
||||
<input type="hidden" name="user_id" value="{:session('user_id')}">
|
||||
<div class="layui-form-item">
|
||||
<label for="L_nowpass" class="layui-form-label">当前密码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="password" id="L_nowpass" name="nowpass" required lay-verify="required" autocomplete="off" class="layui-input">
|
||||
<input type="password" id="L_nowpass" name="nowpass" required lay-verify="required" autocomplete="off" class="layui-input" lay-affix="eye">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="L_pass" class="layui-form-label">新密码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="password" id="L_pass" name="password" required lay-verify="required" autocomplete="off" class="layui-input">
|
||||
<input type="password" id="L_pass" name="password" required lay-verify="required" autocomplete="off" class="layui-input" lay-affix="eye">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">6到16个字符</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="L_repass" class="layui-form-label">确认密码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="password" id="L_repass" name="repassword" required lay-verify="required" autocomplete="off" class="layui-input">
|
||||
<input type="password" id="L_repass" name="repassword" required lay-verify="required" autocomplete="off" class="layui-input" lay-affix="eye">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-filter="user-set-pass" lay-submit >确认修改</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="layui-form layui-form-pane layui-tab-item layui-hide">
|
||||
<ul class="app-bind">
|
||||
@ -114,6 +120,9 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{:hook('callme_set')}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@ -131,13 +140,13 @@
|
||||
url:"{:url('User/set')}",
|
||||
data:field,
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
if(data.code === 0){
|
||||
layer.msg(data.msg,{icon:6,tiye:2000},function(){
|
||||
success:function(res){
|
||||
if(res.code === 0){
|
||||
layer.msg(res.msg, {icon:6,tiye:2000}, function(){
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.open({title:"更新失败",content:data.msg,icon:5,anim:6});
|
||||
layer.open({title:"更新失败",content: res.msg, icon:5, anim:6});
|
||||
}}
|
||||
});
|
||||
return false;
|
||||
@ -151,13 +160,13 @@
|
||||
url:"{:url('User/setPass')}",
|
||||
data:field,
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
if(data.code === 1){
|
||||
layer.msg(data.msg,{icon:6,tiye:2000},function(){
|
||||
success:function(res){
|
||||
if(res.code === 1){
|
||||
layer.msg(res.msg,{icon:6, tiye:2000},function(){
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.open({title:"密码设置失败",content:data.msg,icon:5,anim:6});
|
||||
layer.open({title: res.msg, content: res.msg, icon:5, anim:6});
|
||||
}}
|
||||
});
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user