This commit is contained in:
taoser 2023-05-05 12:01:49 +08:00
parent 149d89e9db
commit 06b783c1e7
12 changed files with 320 additions and 291 deletions

View File

@ -43,7 +43,46 @@ class Forum extends AdminController
public function list()
{
$list = $this->model->getList(input('limit'),input('page'));
$data = Request::only(['id','name','title','sec']);
$where = [];
if (!empty($data['sec'])) {
switch ($data['sec']) {
case '1':
$where[] = ['status', '=', 1];
break;
case '2':
$where[] = ['is_top', '=', 1];
break;
case '3':
$where[] = ['is_hot', '=', 1];
break;
case '4':
$where[] = ['is_reply', '=', 1];
break;
case '5':
$where[] = ['status', '=', -1];
break;
case '6':
$where[] = ['status', '=', 0];
break;
}
}
unset($data['sec']);
if(!empty($data['id'])){
$where[] = ['id', '=', $data['id']];
}
if(!empty($data['name'])){
$userId = Db::name('user')->where('name',$data['name'])->value('id');
$where[] = ['user_id', '=', $userId];
}
if(!empty($data['title'])){
$where[] = ['title', 'like', $data['title'].'%'];
}
$list = $this->model->getList($where, input('limit'), input('page'));
$res = [];
if($list['total']){
foreach($list['data'] as $v) {

View File

@ -381,7 +381,7 @@ class Article extends Model
}
// 获取所有帖子内容
public function getList($limit,$page)
public function getList(array $where, int $limit, int $page)
{
return $this::field('id,user_id,cate_id,title,content,is_top,is_hot,is_reply,status,update_time')->with([
'user' => function($query){
@ -390,7 +390,9 @@ class Article extends Model
'cate' => function($query){
$query->field('id,ename');
}
])->paginate([
])->where($where)
->order('create_time', 'desc')
->paginate([
'list_rows' => $limit,
'page' => $page
])->toArray();

View File

@ -16,7 +16,7 @@ return [
// 应用名,此项不可更改
'appname' => 'TaoLer',
// 版本配置
'version' => '2.2.7',
'version' => '2.2.8',
// 加盐
'salt' => 'taoler',
// 数据库备份目录

View File

@ -70,71 +70,70 @@ layui.define(["table", "form",'toast','common'], function (exports) {
// });
var api = {
userinfo: {
get: function () {
var userinfo = localStorage.getItem("taoleradmin_userinfo");
return userinfo ? JSON.parse(userinfo) : null;
},
set: function (data) {
if (data) {
localStorage.setItem("taoleradmin_userinfo", JSON.stringify(data));
} else {
localStorage.removeItem("taoleradmin_userinfo");
}
userinfo: {
get: function () {
var userinfo = localStorage.getItem("taoleradmin_userinfo");
return userinfo ? JSON.parse(userinfo) : null;
},
set: function (data) {
if (data) {
localStorage.setItem("taoleradmin_userinfo", JSON.stringify(data));
} else {
localStorage.removeItem("taoleradmin_userinfo");
}
}
}
}
}
//监听工具条
table.on("tool(addons-list)", function (obj) {
var data = obj.data;
var event = obj.event;
var url = $(this).data('url')
var data = obj.data;
var event = obj.event;
var url = $(this).data('url')
// 安装
var install = function (data,url,userLoginUrl,userIsPayUrl){
// 安装
var install = function (data,url,userLoginUrl,userIsPayUrl){
var userinfo = api.userinfo.get(); // 检测权限
if(userinfo) {
layer.confirm("确认安装吗?", "vcenter",function(index){
$.post(url, { name: data.name, version: data.version, uid: userinfo.uid, token: userinfo.token }, function (res) {
// 需要支付
if (res.code === -2) {
layer.close(index);
layer.open({
type: 2,
area: [common.isModile()?'100%':'800px', common.isModile()?'100%':'600px'],
fixed: false, //不固定
maxmin: true,
content: 'pay.html'+ "?id=" + data.id+ "&name=" + data.name + "&version=" + data.version + "&uid=" + userinfo.uid + "&price=" + data.price,
success: function (layero, index){
// 订单轮询
var intervalPay = setInterval(function() {
$.post(userIsPayUrl,{name:data.name, userinfo:userinfo},function (res){
if(res.code === 0) {
layer.close(index);
clearInterval(intervalPay);
install(data,url,userLoginUrl,userIsPayUrl);
}
layer.confirm("确认安装吗?", "vcenter",function(index){
layer.close(index);
let loading = layer.load();
$.post(url, { name: data.name, version: data.version, uid: userinfo.uid, token: userinfo.token }, function (res) {
layer.close(loading);
// 需要支付
if (res.code === -2) {
layer.open({
type: 2,
area: [common.isModile()?'100%':'800px', common.isModile()?'100%':'600px'],
fixed: false, //不固定
maxmin: true,
content: 'pay.html'+ "?id=" + data.id+ "&name=" + data.name + "&version=" + data.version + "&uid=" + userinfo.uid + "&price=" + data.price,
success: function (layero, index){
// 订单轮询
var intervalPay = setInterval(function() {
$.post(userIsPayUrl,{name:data.name, userinfo:userinfo},function (res){
if(res.code === 0) {
layer.close(index);
clearInterval(intervalPay);
install(data,url,userLoginUrl,userIsPayUrl);
}
});
},3000);
}
});
},3000);
}
// 安装成功
if (res.code === 0) {
toast.success({title:"安装成功",message:res.msg,position: 'topRight'});
}
// 安装失败
if (res.code === -1) {
toast.error({title:"安装失败",message:res.msg,position: 'topRight'});
}
// 重载
table.reloadData("addons-list",{},'deep');
});
}
// 安装成功
if (res.code === 0) {
layer.close(index);
toast.success({title:"安装成功",message:res.msg,position: 'topRight'});
}
// 安装失败
if (res.code === -1) {
layer.close(index);
toast.error({title:"安装失败",message:res.msg,position: 'topRight'});
}
// 重载
table.reloadData("addons-list",{},'deep');
});
});
} else {
// 未登录时
layer.confirm('你当前还未登录TaoLer社区账号,请登录后操作!', {
@ -189,15 +188,15 @@ layui.define(["table", "form",'toast','common'], function (exports) {
}
}
//安装插件
if (event === "install" || event === "upgrade") {
//安装插件
if (event === "install" || event === "upgrade") {
var userLoginUrl = $(this).data('userlogin');
var userIsPayUrl = $(this).data('ispay');
install(data,url,userLoginUrl,userIsPayUrl);
}
// 卸载插件
if (event === "uninstall") {
// 卸载插件
if (event === "uninstall") {
layer.confirm("是否卸载?", "vcenter",function(index) {
$.post(url, { name: data.name }, function (res) {
if (res.code === 0) {
@ -212,8 +211,8 @@ layui.define(["table", "form",'toast','common'], function (exports) {
});
}
// 配置插件
if (event === "config") {
// 配置插件
if (event === "config") {
$.post(url,{name:data.name},function (res){
// 无配置项拦截
if (res.code === -1) {

View File

@ -3,7 +3,7 @@
'name' => 'taoser/taoler',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'dcfb9c2a8181fb002fee01a04843002e53a68e20',
'reference' => 'f3d0aa0ea3473bafd7ce92799552709c43f3f02d',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -358,7 +358,7 @@
'taoser/taoler' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'dcfb9c2a8181fb002fee01a04843002e53a68e20',
'reference' => 'f3d0aa0ea3473bafd7ce92799552709c43f3f02d',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2023-03-20 11:45:35
// This file is automatically generated at:2023-03-28 11:40:31
declare (strict_types = 1);
return array (
0 => 'taoser\\addons\\Service',

View File

@ -2,9 +2,9 @@
declare(strict_types=1);
use think\facade\Event;
use think\facade\App;
use think\facade\Route;
use taoser\addons\Service;
use think\facade\App;
use think\facade\Config;
use think\facade\Cache;
use think\helper\{
@ -24,8 +24,11 @@ define('DS', DIRECTORY_SEPARATOR);
spl_autoload_register(function ($class) {
$class = ltrim($class, '\\');
$dir = App::getRootPath();
// $app = new think\App();
// $dir = $app->getRootPath();
// $dir = App::getRootPath();
$dir = app()->getRootPath();
// halt($dir);
$namespace = 'addons';
if (strpos($class, $namespace) === 0) {

View File

@ -14,176 +14,176 @@
{block name="link"} {/block}
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
{block name="content"}
<div class="layui-container">
<div class="layui-row layui-col-space15">
<div class="layui-col-md9 content detail">
<div class="fly-panel detail-box">
{//标题}
<div class="title layui-clear"><h1 style="color:{$article.title_color ?? '#333'};">{$article.title}</h1></div>
<div class="detail_qrcode layui-hide-xs" onclick="PhoneDown();" id="mobile"></div>
<div class="layui-container">
<div class="layui-row layui-col-space15">
<div class="layui-col-md9 content detail">
<div class="fly-panel detail-box">
{//标题}
<div class="title layui-clear"><h1 style="color:{$article.title_color ?? '#333'};">{$article.title}</h1></div>
<div class="detail_qrcode layui-hide-xs" onclick="PhoneDown();" id="mobile"></div>
{//图标}
<div class="user-questions">
<a class="user-avatar" href="{$Request.domain}{:url('user/home',['id'=>$article.user.id])}">
<img src="{$Request.domain}{$article.user.user_img}" alt="{$article.user.name}" />
<cite>{$article.user.nickname ?: $article.user.name} / </cite>
</a>
<span class="user-post-time" data="{$article.create_time}" style="padding-top: 5px"></span>
/ <i class="iconfont" title="{:lang('reply')}">&#xe60c;</i> {$article.comments_count} / <i class="iconfont" title="浏览">&#xe60b;</i> {$pv}
{if ($article.jie == 0) }
<span class="layui-btn layui-btn-xs" style="background-color: #ff5722">{:lang('no finished')}</span>
{else /}
<span class="layui-btn layui-btn-xs" style="background-color: #009688">{:lang('finished')}</span>
{//图标}
<div class="user-questions">
<a class="user-avatar" href="{$Request.domain}{:url('user/home',['id'=>$article.user.id])}">
<img src="{$Request.domain}{$article.user.user_img}" alt="{$article.user.name}" />
<cite>{$article.user.nickname ?: $article.user.name} / </cite>
</a>
<span class="user-post-time" data="{$article.create_time}" style="padding-top: 5px"></span>
/ <i class="iconfont" title="{:lang('reply')}">&#xe60c;</i> {$article.comments_count} / <i class="iconfont" title="浏览">&#xe60b;</i> {$pv}
{if ($article.jie == 0) }
<span class="layui-btn layui-btn-xs" style="background-color: #ff5722">{:lang('no finished')}</span>
{else /}
<span class="layui-btn layui-btn-xs" style="background-color: #009688">{:lang('finished')}</span>
{/if}
<span id="LAY_jieAdmin" data-id="{$article['id']}"></span>
</div>
<hr class="layui-border-green" />
{//问题内容}
<div style="margin-top: 15px; font-size: 18px; font-weight: bold; color: rgb(130, 125, 125)">问题描述:</div>
<hr />
{:hook('taoplayerdiv')}
<div class="detail-body photos" id="content">{$article.content|raw}</div>
{if (($article.upzip !== '') || session('?user_name'))}
<div class="">
{notempty name="$article.upzip"}
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
{/notempty}
</div>
{/if}
<span id="LAY_jieAdmin" data-id="{$article['id']}"></span>
{notempty name="tags"}
<div style="margin-top: 15px">标签
{volist name="tags" id="vo" }
<a href="{$vo.url}"><span class="layui-btn layui-btn-xs layui-btn-normal layui-btn-radius">{$vo.name}</span></a>
{/volist}
</div>
{/notempty}
<div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125)">
<p style="line-height:200%;">{$sysInfo.state|raw}</p>
</div>
<div style="margin-top: 20px">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div>
</div>
<hr class="layui-border-green" />
{//评论内容}
<div class="fly-panel detail-box" id="flyReply">
<span style="font-size: 18px">评论 {$article.comments_count}</span>
<ul class="jieda" id="jieda">
{volist name="comments['data']" id="vo" empty= ""}
<li data-id="{$vo.id}" class="jieda-daan">
<a name="item-1111111111"></a>
<div class="detail-about detail-about-reply">
<a class="fly-avatar" href="{$Request.domain}{:url('user/home',['id'=>$vo.user.id])}">
<img src="{$Request.domain}{$vo.user.user_img}" alt=" " />{if($vo.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if}
</a>
<div class="fly-detail-user">
<a href="{$Request.domain}{:url('user/home',['id'=>$vo.user.id])}" class="fly-link">
<cite>{$vo.user.nickname ?: $vo.user.name}</cite>
</a>
{if condition="$article.user.id eq $vo.user.id"}<span>({:lang('poster')})</span>{/if}
</div>
<div class="detail-hits"><span class="post-time" data="{$vo.create_time}"></span>{:hook('ipShow', $vo.user.city)}</div>
{if $vo.cai == 1}<i class="iconfont icon-caina" title="最佳答案"></i>{/if}
</div>
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
{//问题内容}
<div style="margin-top: 15px; font-size: 18px; font-weight: bold; color: rgb(130, 125, 125)">问题描述:</div>
<hr />
{:hook('taoplayerdiv')}
<div class="detail-body photos" id="content">{$article.content|raw}</div>
{if (($article.upzip !== '') || session('?user_name'))}
<div class="">
{notempty name="$article.upzip"}
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
{/notempty}
<div class="jieda-reply">
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan"><i class="iconfont icon-zan"></i><em>{$vo.zan}</em></span>
<span type="reply" id="user-reply"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论 编辑/删除/采纳/权限}
<div class="jieda-admin">
{if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit">{:lang('edit')}</span>
<span type="del">{:lang('delete')}</span>
{/if} {if ($vo.cai == 0) && ((session('user_id') == $article.user_id) OR ($user.auth ?? '')) && ($article.jie == 0)/}
<span class="jieda-accept" type="accept">{:lang('accept')}</span>
{/if}
</div>
</div>
<div style="margin: 5px 0px;">
<hr style="border:1px dotted red;height:1px;width:90%" />
<div>{$vo.user.sign|raw}</div>
</div>
</li>
{/volist}
</ul>
<div style="text-align: center" id="pages"></div>
</div>
{//评论区}
{if session('?user_id') AND ( config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 1 )}
<div class="layui-form layui-form-pane">
<div class="layui-form-item layui-form-text">
<a name="comment"></a>
<div class="layui-input-block">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor" style="height: 150px"></textarea>
</div>
</div>
<div class="layui-form-item que-comments">
<input type="hidden" name="article_id" value="{$article.id}" />
<input type="hidden" name="user_id" value="{:session('user_id')}" />
<button class="layui-btn layui-btn-danger" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button>
</div>
</div>
{/if}
{notempty name="tags"}
<div style="margin-top: 15px">标签
{volist name="tags" id="vo" }
<a href="{$vo.url}"><span class="layui-btn layui-btn-xs layui-btn-normal layui-btn-radius">{$vo.name}</span></a>
{/volist}
</div>
{/notempty}
<div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125)">
<p style="line-height:200%;">{$sysInfo.state|raw}</p>
</div>
<div style="margin-top: 20px">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div>
</div>
{//评论内容}
<div class="fly-panel detail-box" id="flyReply">
<span style="font-size: 18px">评论 {$article.comments_count}</span>
<ul class="jieda" id="jieda">
{volist name="comments['data']" id="vo" empty= ""}
<li data-id="{$vo.id}" class="jieda-daan">
<a name="item-1111111111"></a>
<div class="detail-about detail-about-reply">
<a class="fly-avatar" href="{$Request.domain}{:url('user/home',['id'=>$vo.user.id])}">
<img src="{$Request.domain}{$vo.user.user_img}" alt=" " />{if($vo.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if}
{// 右栏}
<div class="layui-col-md3">
<div class="fly-panel">
<div class="fly-panel-main wenda-user">
<div class="user-img">
<a href="{$Request.domain}{:url('user/home',['id'=>$article.user.id])}">
<img class="" src="{$Request.domain}{$article.user.user_img}" alt="{$article.user.name}" />
{if($article.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if}
</a>
<div class="fly-detail-user">
<a href="{$Request.domain}{:url('user/home',['id'=>$vo.user.id])}" class="fly-link">
<cite>{$vo.user.nickname ?: $vo.user.name}</cite>
</a>
{if condition="$article.user.id eq $vo.user.id"}<span>({:lang('poster')})</span>{/if}
</div>
<div class="detail-hits"><span class="post-time" data="{$vo.create_time}"></span>{:hook('ipShow',$vo.user.city)}</div>
{if $vo.cai == 1}<i class="iconfont icon-caina" title="最佳答案"></i>{/if}
</div>
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
<div class="jieda-reply">
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan"><i class="iconfont icon-zan"></i><em>{$vo.zan}</em></span>
<span type="reply" id="user-reply"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论 编辑/删除/采纳/权限}
<div class="jieda-admin">
{if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit">{:lang('edit')}</span>
<span type="del">{:lang('delete')}</span>
{/if} {if ($vo.cai == 0) && ((session('user_id') == $article.user_id) OR ($user.auth ?? '')) && ($article.jie == 0)/}
<span class="jieda-accept" type="accept">{:lang('accept')}</span>
{/if}
</div>
<div class="questions">
<span class="layui-badge layui-bg-green">回答 {$article.user.comments_count}</span> <span class="layui-badge layui-bg-green">提问 {$article.user.article_count}</span>
<span class="layui-badge layui-bg-green">+ 关注</span>
</div>
<div style="margin: 5px 0px;">
<hr style="border:1px dotted red;height:1px;width:90%" />
<div>{$vo.user.sign|raw}</div>
</div>
</li>
</div>
</div>
{if showSlider(7)}
<div class="fly-panel">
<div class="fly-panel-title">{:lang('sponsor')}<span style="padding: 0 3px">-</span>
<a href="" class="fly-link fly-joinad">{:lang('i want to join')}</a>
</div>
<div class="fly-panel-main">
{volist name="ad_comm" id="vo"}
<a href="{$vo.slid_href}" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color:{$vo.slid_color};">{$vo.slid_name}</a>
{/volist}
</div>
</div>
{/if}
<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}
</ul>
<div style="text-align: center" id="pages"></div>
</div>
{//评论区}
{if session('?user_id') AND ( config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 1 )}
<div class="layui-form layui-form-pane">
<div class="layui-form-item layui-form-text">
<a name="comment"></a>
<div class="layui-input-block">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor" style="height: 150px"></textarea>
</div>
</div>
<div class="layui-form-item que-comments">
<input type="hidden" name="article_id" value="{$article.id}" />
<input type="hidden" name="user_id" value="{:session('user_id')}" />
<button class="layui-btn layui-btn-danger" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button>
</div>
</div>
{/if}
</div>
{// 右栏}
<div class="layui-col-md3">
<div class="fly-panel">
<div class="fly-panel-main wenda-user">
<div class="user-img">
<a href="{$Request.domain}{:url('user/home',['id'=>$article.user.id])}">
<img class="" src="{$Request.domain}{$article.user.user_img}" alt="{$article.user.name}" />
{if($article.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if}
</a>
</div>
<div class="questions">
<span class="layui-badge layui-bg-green">回答 {$article.user.comments_count}</span> <span class="layui-badge layui-bg-green">提问 {$article.user.article_count}</span>
<span class="layui-badge layui-bg-green">+ 关注</span>
</div>
</div>
</div>
{if showSlider(7)}
<div class="fly-panel">
<div class="fly-panel-title">{:lang('sponsor')}<span style="padding: 0 3px">-</span>
<a href="" class="fly-link fly-joinad">{:lang('i want to join')}</a>
</div>
<div class="fly-panel-main">
{volist name="ad_comm" id="vo"}
<a href="{$vo.slid_href}" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color:{$vo.slid_color};">{$vo.slid_name}</a>
</dl>
{if showSlider(4)}
<div class="fly-panel" style="padding: 5px 0; text-align: center">
{volist name="ad_art" id="vo"}
<a href="{$vo.slid_href}" target="_blank"><img src="{$Request.domain}/{$vo.slid_img}" style="max-width: 100%" /></a>
{/volist}
</div>
{/if}
</div>
{/if}
<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>
{if showSlider(4)}
<div class="fly-panel" style="padding: 5px 0; text-align: center">
{volist name="ad_art" id="vo"}
<a href="{$vo.slid_href}" target="_blank"><img src="{$Request.domain}/{$vo.slid_img}" style="max-width: 100%" /></a>
{/volist}
</div>
{/if}
{//crud管理模块}
{include file="/public/crud" /}
</div>
{//crud管理模块}
{include file="/public/crud" /}
</div>
<!--底部栏-->
<div class="site-tree-mobile-detail-bottom layui-hide-md">
<div id="LAY_jieAdmin1" data-id="{$article['id']}"></div>
</div>
</div>
{include file="public/menu" /}
{/block}
{block name="script"}
@ -322,7 +322,7 @@
//首次不执行
if (!first) {
$.post("{:url('article/detail')}", { id: id, page: page }, function () {
location.href = url + '?page=' + page;
location.href = url + '?page=' + page + '#flyReply';
});
}
},
@ -347,9 +347,8 @@
{//图片点击放大}
{include file="/public/images-click" /}
{:hook('markdownhook')}
{include file="/public/qr-read" /}
{volist name="push_js" id="vo"} {$vo.jscode|raw} {/volist}
{/block}

View File

@ -284,7 +284,7 @@
{//crud管理模块}
{include file="/public/crud" /}
</main>
{include file="public/menu" /}
{/block}
{block name="script"}
@ -413,27 +413,27 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
}
return false;
});
//执行一个laypage实例
laypage.render({
elem: 'pages' //注意,这里的 test1 是 ID不用加 # 号
,count: "{$article.comments_count}" //数据总数,从服务端得到
,limit: 10
,curr : {$page}
//获取起始页
,jump: function(obj, first){
//首次不执行
if(!first){
// 评论分页
laypage.render({
elem: "pages", //注意,这里的 test1 是 ID不用加 # 号
count: "{$article.comments_count}", //数据总数,从服务端得到
limit: 10,
curr: "{$page}",
//获取起始页
jump: function (obj, first) {
var page = obj.curr;
var url = "{:url('article/detail',['id'=>$article.id])}";
var limit = obj.limit;
var url = "{:url('article_detail',['id' => $article.id ,'ename' =>$article['cate']['ename']])}";
var id = "{$article.id}";
$.post("{:url('article/detail')}",{"id":id,"page":page},function(){
window.location.href = url + '?page=' + page + '#flyReply';
});
}
}
});
//首次不执行
if (!first) {
$.post("{:url('article/detail')}", { id: id, page: page }, function () {
location.href = url + '?page=' + page + '#flyReply';
});
}
},
});
//下载
$('#zip-download').click(function (){
@ -453,12 +453,6 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
{:hook('taoplyr')}
{:hook('markdownhook')}
{include file="/public/qr-read" /}
{volist name="push_js" id="vo"}
{$vo.jscode|raw}
{/volist}
{/block}

View File

@ -62,7 +62,7 @@
<div id="LAY_jieAdmin1" data-id="{$article['id']}"></div>
</div>
</div>
{include file="public/menu" /}
{/block}
{block name="script"}
@ -172,27 +172,27 @@
}
return false;
});
//执行一个laypage实例
laypage.render({
elem: 'pages' //注意,这里的 test1 是 ID不用加 # 号
,count: "{$article.comments_count}" //数据总数,从服务端得到
,limit: 10
,curr : {$page}
// 评论分页
laypage.render({
elem: "pages", //注意,这里的 test1 是 ID不用加 # 号
count: "{$article.comments_count}", //数据总数,从服务端得到
limit: 10,
curr: "{$page}",
//获取起始页
,jump: function(obj, first){
jump: function (obj, first) {
var page = obj.curr;
var limit = obj.limit;
var url = "{:url('article_detail',['id' => $article.id ,'ename' =>$article['cate']['ename']])}";
var id = "{$article.id}";
//首次不执行
if(!first){
var page = obj.curr;
var url = "{:url('article/detail',['id'=>$article.id])}";
var id = "{$article.id}";
$.post("{:url('article/detail')}",{"id":id,"page":page},function(){
window.location.href = url + '?page=' + page + '#flyReply';
if (!first) {
$.post("{:url('article/detail')}", { id: id, page: page }, function () {
location.href = url + '?page=' + page + '#flyReply';
});
}
}
});
},
});
//下载
$('#zip-download').click(function (){
@ -213,10 +213,5 @@
{//图片点击放大}
{include file="/public/images-click" /}
{:hook('markdownhook')}
{volist name="push_js" id="vo"}
{$vo.jscode|raw}
{/volist}
{/block}

View File

@ -200,7 +200,7 @@
<div id="LAY_jieAdmin1" data-id="{$article['id']}"></div>
</div>
</div>
{include file="public/menu" /}
{/block}
{block name="script"}
@ -323,27 +323,27 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
}
return false;
});
//执行一个laypage实例
laypage.render({
elem: 'pages' //注意,这里的 test1 是 ID不用加 # 号
,count: "{$article.comments_count}" //数据总数,从服务端得到
,limit: 10
,curr : {$page}
// 评论分页
laypage.render({
elem: "pages", //注意,这里的 test1 是 ID不用加 # 号
count: "{$article.comments_count}", //数据总数,从服务端得到
limit: 10,
curr: "{$page}",
//获取起始页
,jump: function(obj, first){
jump: function (obj, first) {
var page = obj.curr;
var limit = obj.limit;
var url = "{:url('article_detail',['id' => $article.id ,'ename' =>$article['cate']['ename']])}";
var id = "{$article.id}";
//首次不执行
if(!first){
var page = obj.curr;
var url = "{:url('article/detail',['id'=>$article.id])}";
var id = "{$article.id}";
$.post("{:url('article/detail')}",{"id":id,"page":page},function(){
window.location.href = url + '?page=' + page + '#flyReply';
if (!first) {
$.post("{:url('article/detail')}", { id: id, page: page }, function () {
location.href = url + '?page=' + page + '#flyReply';
});
}
}
});
},
});
//下载
$('#zip-download').click(function (){
@ -364,11 +364,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
{//图片点击放大}
{include file="/public/images-click" /}
{:hook('markdownhook')}
{include file="/public/qr-read" /}
{volist name="push_js" id="vo"}
{$vo.jscode|raw}
{/volist}
{/block}

View File

@ -47,6 +47,8 @@
</div>
{//右栏}
<div class="layui-col-md4">
{:hook('live')}
{:hook('kankan')}
{:hook('signhook', ['id'=>1])}
<!--首页图片广告-->