优化模板

This commit is contained in:
taoser 2024-04-01 10:20:25 +08:00
parent 59db926938
commit 38ac88505b
17 changed files with 1617 additions and 1883 deletions

View File

@ -81,11 +81,11 @@
</button> </button>
</script> </script>
<script type="text/html" id="imgTpl"> <script type="text/html" id="imgTpl">
<img src= {{=d.avatar}} style="width: 100px; height: 100px; border-radius: 6px;" /> <a href="{:url('user.user/goUserHome')}?id={{ d.id }}" target="_blank"><img src= {{=d.avatar}} style="width: 100px; height: 100px; border-radius: 6px;" /></a>
</script> </script>
<script type="text/html" id="userInfoTpl"> <script type="text/html" id="userInfoTpl">
<ul> <ul>
<li>ID: {{d.id}} 用户名:<a href="{:url('user.user/goUserHome')}?id={{ d.id }}" target="_blank">{{- d.username }}</a></li> <li>ID: {{d.id}} 用户名:{{d.username }}</li>
<li>性别:{{#if (d.sex == 0) { }} <span></span> {{# }else if(d.sex == 1){ }} <span></span> {{# } }} 昵称:{{d.nickname}}</li> <li>性别:{{#if (d.sex == 0) { }} <span></span> {{# }else if(d.sex == 1){ }} <span></span> {{# } }} 昵称:{{d.nickname}}</li>
<li>电话:{{d.phone}}</li> <li>电话:{{d.phone}}</li>
<li>邮箱:{{d.email}}</li> <li>邮箱:{{d.email}}</li>
@ -165,6 +165,7 @@
title: '积分/金币', title: '积分/金币',
field: 'point', field: 'point',
align: 'center', align: 'center',
width: 120,
edit: 'text' edit: 'text'
}, },
{ {

View File

@ -33,7 +33,7 @@ class Index extends BaseController
//置顶文章 //置顶文章
$artTop = Article::getArtTop(5); $artTop = Article::getArtTop(5);
//首页文章列表,显示10个 //首页文章列表,显示10个
$artList = Article::getArtList(15); $artList = Article::getArtList(10);
//热议文章 //热议文章
$artHot = Article::getArtHot(10); $artHot = Article::getArtHot(10);

View File

@ -213,7 +213,7 @@ INSERT INTO `tao_auth_rule` VALUES (64, 'user.user/edit', 'Edit user', 1, 1, 60,
INSERT INTO `tao_auth_rule` VALUES (65, 'user.user/delete', 'Delete user', 1, 1, 60, 2, '', 2, 54, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (65, 'user.user/delete', 'Delete user', 1, 1, 60, 2, '', 2, 54, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (66, 'user.user/check', 'Check user', 1, 1, 60, 2, '', 2, 55, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (66, 'user.user/check', 'Check user', 1, 1, 60, 2, '', 2, 55, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (67, 'user.user/auth', 'Superuser', 1, 1, 60, 2, '', 2, 56, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (67, 'user.user/auth', 'Superuser', 1, 1, 60, 2, '', 2, 56, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (68, 'user.vip/index', '用户vip', 1, 1, 2, 1, '', 1, 2, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (68, 'user.vip/index', '会员等级', 1, 1, 2, 1, '', 1, 2, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (69, 'user.vip/list', 'vip列表', 1, 1, 68, 2, '', 2, 50, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (69, 'user.vip/list', 'vip列表', 1, 1, 68, 2, '', 2, 50, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (70, 'user.vip/add', '添加vip', 1, 1, 68, 2, '', 2, 51, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (70, 'user.vip/add', '添加vip', 1, 1, 68, 2, '', 2, 51, '', 0, 0, 0);
INSERT INTO `tao_auth_rule` VALUES (71, 'user.vip/edit', '编辑vip', 1, 1, 68, 2, '', 2, 52, '', 0, 0, 0); INSERT INTO `tao_auth_rule` VALUES (71, 'user.vip/edit', '编辑vip', 1, 1, 68, 2, '', 2, 52, '', 0, 0, 0);
@ -606,6 +606,20 @@ INSERT INTO `tao_user_area` VALUES (2, '上海', '沪', 0, 0, 0);
INSERT INTO `tao_user_area` VALUES (3, '广州', '广', 0, 0, 0); INSERT INTO `tao_user_area` VALUES (3, '广州', '广', 0, 0, 0);
INSERT INTO `tao_user_area` VALUES (4, '深圳', '', 0, 0, 0); INSERT INTO `tao_user_area` VALUES (4, '深圳', '', 0, 0, 0);
-- ----------------------------
-- Table structure for tao_user_article_log
-- ----------------------------
DROP TABLE IF EXISTS `tao_user_article_log`;
CREATE TABLE `tao_user_article_log` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
`user_id` int NOT NULL COMMENT '用户ID',
`user_postnum` int NOT NULL DEFAULT 0 COMMENT '用户发帖数量',
`user_refreshnum` int NOT NULL DEFAULT 0 COMMENT '用户刷新数量',
`create_time` int NOT NULL DEFAULT 0 COMMENT '记录时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `uid`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户发文刷新日志记录' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for tao_user_sign -- Table structure for tao_user_sign
-- ---------------------------- -- ----------------------------
@ -649,10 +663,14 @@ INSERT INTO `tao_user_signrule` VALUES (4, 7, 10, 1677824262, 1677824262, 0);
DROP TABLE IF EXISTS `tao_user_viprule`; DROP TABLE IF EXISTS `tao_user_viprule`;
CREATE TABLE `tao_user_viprule` ( CREATE TABLE `tao_user_viprule` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '用户等级ID', `id` int NOT NULL AUTO_INCREMENT COMMENT '用户等级ID',
`score` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '积分区间',
`vip` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'vip等级', `vip` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'vip等级',
`score` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '积分区间',
`nick` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '认证昵称', `nick` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '认证昵称',
`rules` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '权限', `rules` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '权限',
`postnum` int NOT NULL DEFAULT 10 COMMENT '日发帖数量',
`postpoint` int NOT NULL DEFAULT 0 COMMENT '发文扣积分',
`refreshnum` int NOT NULL DEFAULT 10 COMMENT '日刷贴数量',
`refreshpoint` int NOT NULL DEFAULT 0 COMMENT '刷帖扣积分',
`create_time` int NOT NULL DEFAULT 0 COMMENT '创建时间', `create_time` int NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int NOT NULL DEFAULT 0 COMMENT '升级时间', `update_time` int NOT NULL DEFAULT 0 COMMENT '升级时间',
`delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间', `delete_time` int NOT NULL DEFAULT 0 COMMENT '删除时间',
@ -662,12 +680,12 @@ CREATE TABLE `tao_user_viprule` (
-- ---------------------------- -- ----------------------------
-- Records of tao_user_viprule -- Records of tao_user_viprule
-- ---------------------------- -- ----------------------------
INSERT INTO `tao_user_viprule` VALUES (1, '0-99', 0, '游民', '0', 1585476523, 1585544577, 0); INSERT INTO `tao_user_viprule` VALUES (1, 0, '0-99', '游民', '0', 2, 2, 10, 1, 1585476523, 1698763623, 0);
INSERT INTO `tao_user_viprule` VALUES (2, '100-299', 1, '富农', '1', 1585476551, 1677823895, 0); INSERT INTO `tao_user_viprule` VALUES (2, 1, '100-299', '富农', '1', 50, 0, 10, 0, 1585476551, 1698740135, 0);
INSERT INTO `tao_user_viprule` VALUES (3, '300-500', 2, '地主', '0', 1585545450, 1585546241, 0); INSERT INTO `tao_user_viprule` VALUES (3, 2, '300-500', '地主', '0', 100, 0, 0, 0, 1585545450, 1698733320, 0);
INSERT INTO `tao_user_viprule` VALUES (4, '501-699', 3, '土豪', '0', 1585545542, 1585569657, 0); INSERT INTO `tao_user_viprule` VALUES (4, 3, '501-699', '土豪', '0', 10, 0, 100, 0, 1585545542, 1698746583, 0);
INSERT INTO `tao_user_viprule` VALUES (5, '700-899', 4, '霸主', '0', 1677824242, 1677824242, 0); INSERT INTO `tao_user_viprule` VALUES (5, 4, '700-899', '霸主', '0', 10, 0, 0, 0, 1677824242, 1677824242, 0);
INSERT INTO `tao_user_viprule` VALUES (6, '900-1000', 5, '王爷', '0', 1677824859, 1677824859, 0); INSERT INTO `tao_user_viprule` VALUES (6, 5, '900-1000', '王爷', '0', 10, 0, 0, 0, 1677824859, 1677824859, 0);
-- ---------------------------- -- ----------------------------
-- Table structure for tao_user_zan -- Table structure for tao_user_zan

View File

@ -459,7 +459,6 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
.detail-about .icon-renzheng{display: inline-block; width: 15px; height: 15px; line-height: 15px; top: 25px; left: 35px; background-color: #FFB800; color: #fff; border-radius: 50%; font-size: 10px;} .detail-about .icon-renzheng{display: inline-block; width: 15px; height: 15px; line-height: 15px; top: 25px; left: 35px; background-color: #FFB800; color: #fff; border-radius: 50%; font-size: 10px;}
.fly-detail-user{white-space: nowrap; overflow: hidden;} .fly-detail-user{white-space: nowrap; overflow: hidden;}
.fly-detail-user a{padding-right: 10px; font-size: 14px;} .fly-detail-user a{padding-right: 10px; font-size: 14px;}
.fly-detail-user .guanzhu{position: absolute; right:10px; }
/*详情页管理工具条*/ /*详情页管理工具条*/
.detail-assist{ .detail-assist{

View File

@ -813,9 +813,9 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
} }
//加载编辑器 //加载编辑器
fly.layEditor({ // fly.layEditor({
elem: '.fly-editor' // elem: '.fly-editor'
}); // });
//手机设备的简单适配 用户中心底部左侧栏导航 //手机设备的简单适配 用户中心底部左侧栏导航
var treeMobile = $('.site-tree-mobile') var treeMobile = $('.site-tree-mobile')

View File

@ -57,7 +57,7 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<div class="layui-input-block"> <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 taonyeditor"></textarea> <textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea taonyeditor"></textarea>
</div> </div>
</div> </div>
{//附件} {//附件}

View File

@ -25,7 +25,6 @@
<li {if condition="$type eq 'wait'" } class="layui-this" {/if}><a href="{$Request.domain}{:url('cate_type',['ename' => $Request.param.ename,'type' => 'wait',])}">{:lang('未解决')}</a> </li> <li {if condition="$type eq 'wait'" } class="layui-this" {/if}><a href="{$Request.domain}{:url('cate_type',['ename' => $Request.param.ename,'type' => 'wait',])}">{:lang('未解决')}</a> </li>
</ul> </ul>
</div> </div>
<ul class="question-list"> <ul class="question-list">
{article:list} {article:list}
<li> <li>
@ -80,17 +79,17 @@
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{include file="public/menu" /} {include file="public/menu" /}
{/block} {/block}
{block name="script"} {block name="script"}
<script> <script>
layui.use(['laypage'], function(){ layui.use(['laypage'], function(){
var laypage = layui.laypage; var laypage = layui.laypage;
var $ = layui.jquery;
//执行一个laypage实例 //执行一个laypage实例
laypage.render({ laypage.render({

View File

@ -13,21 +13,26 @@
{/block} {/block}
{block name="link"} {/block} {block name="link"} {/block}
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block} {block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
{block name="content"} {block name="content"}
<div class="layui-container"> <div class="layui-container">
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-md8 content detail"> <div class="layui-col-md8 content detail">
<div class="fly-panel detail-box"> <div class="fly-panel detail-box">
{//标题} {//标题}
<div class="title layui-clear"><h1 style="color:{article:title_color /};">{article:title /}</h1></div> <h1>{article:title /}</h1>
{//图标} {//图标}
<div class="user-questions"> <div class="user-questions">
<a class="user-avatar" href="{article:user name='link' /}"> <a class="user-avatar" href="{article:user name='link' /}">
<img src="{article:user name='user_img' /}" alt="{article:user name='name' /}" /> <img src="{article:user name='user_img' /}" alt="{article:user name='name' /}" />
<cite>{article:auther} / </cite> <cite>{article:auther} </cite>
</a> </a>
<span class="user-post-time" data="{$article.create_time}" style="padding-top: 5px"></span> <span class="user-post-time" data="{$article.create_time}" style="padding-top: 5px">{$article.create_time|date="Y-h-d H:i"}</span>
/ <i class="iconfont" title="{:lang('reply')}">&#xe60c;</i> {$article:comments_count} / <i class="iconfont" title="浏览">&#xe60b;</i> {$pv} <i class="iconfont" title="{:lang('reply')}">&#xe60c;</i>
{$article:comments_count}
<i class="iconfont" title="浏览">&#xe60b;</i>
{$pv}
{if ($article.jie == 0) } {if ($article.jie == 0) }
<span class="layui-btn layui-btn-xs" style="background-color: #ff5722">{:lang('no finished')}</span> <span class="layui-btn layui-btn-xs" style="background-color: #ff5722">{:lang('no finished')}</span>
{else /} {else /}
@ -39,17 +44,15 @@
<hr class="layui-border-green" /> <hr class="layui-border-green" />
{//问题内容} {//问题内容}
<div style="margin-top: 15px; font-size: 18px; font-weight: bold; color: rgb(130, 125, 125)">问题描述:</div> <div style="margin: 10px 0; font-size: 16px; font-weight: bold; color: rgb(161, 155, 155)">问题描述:</div>
<hr />
{:hook('taoplayerdiv')} {:hook('taoplayerdiv')}
<div class="detail-body photos" id="content">{article:content}</div> <div class="detail-body photos" id="content">{article:content}</div>
{if (($article.upzip !== '') || session('?user_name'))}
<div class="">
{notempty name="$article.upzip"} {notempty name="$article.upzip"}
{if (session('?user_name'))}
<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> <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} {/if}
{/notempty}
{//解密文件} {//解密文件}
{empty name="passJieMi"} {empty name="passJieMi"}
@ -67,10 +70,15 @@
{/volist} {/volist}
</div> </div>
{/notempty} {/notempty}
<div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125)"> <div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125)">
<p style="line-height:200%;">{$sysInfo.state|raw}</p> <p style="line-height:200%;">{$sysInfo.state|raw}</p>
</div> </div>
<div style="margin-top: 20px">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div> <div style="margin-top: 20px">本文链接:
<a href="{$Request.domain}{$Request.url}">
{$Request.domain}/{$Request.url}
</a>
</div>
</div> </div>
{//评论内容} {//评论内容}
@ -119,7 +127,9 @@
{volist name="$comment.children" id="vo"} {volist name="$comment.children" id="vo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0; background: #f6f6f6"> <div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0; background: #f6f6f6">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$vo.user.user_img}" style="width: 30px; height: 30px; border-radius: 15px; object-fit: cover"></a> <a style="display: inline-block; width: 50px;">
<img src="{$vo.user.user_img}" style="width: 30px; height: 30px; border-radius: 15px; object-fit: cover">
</a>
<div style="float: left;width: calc(100% - 50px);"> <div style="float: left;width: calc(100% - 50px);">
<div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div> <div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$vo.content|raw}</div> <div class="detail-body jieda-body photos">{$vo.content|raw}</div>
@ -146,7 +156,9 @@
{notempty name="$vo.children"} {notempty name="$vo.children"}
{volist name="$vo.children" id="voo"} {volist name="$vo.children" id="voo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0;"> <div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0;">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$voo.user.user_img}" style="width: 30px; height: 30px; object-fit: cover; border-radius: 15px;"></a> <a style="display: inline-block; width: 50px;">
<img src="{$voo.user.user_img}" style="width: 30px; height: 30px; object-fit: cover; border-radius: 15px;">
</a>
<div style="float: left;width: calc(100% - 50px);"> <div style="float: left;width: calc(100% - 50px);">
<div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div> <div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$voo.content|raw}</div> <div class="detail-body jieda-body photos">{$voo.content|raw}</div>
@ -173,11 +185,14 @@
{/volist} {/volist}
{/notempty} {/notempty}
</div> </div>
{else /} {else /}
<div class="detail-body jieda-body photos"> <div class="detail-body jieda-body photos">
<i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i> <i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i>
评论解密后查看 评论解密后查看
</div> </div>
{/if} {/if}
</div> </div>
</li> </li>
@ -192,12 +207,11 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<a name="comment"></a> <a name="comment"></a>
<div class="layui-input-block"> <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 taonyeditor" style="height: 150px"></textarea> <textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea taonyeditor" style="height: 150px"></textarea>
</div> </div>
</div> </div>
<div class="layui-form-item que-comments"> <div class="layui-form-item que-comments">
<input type="hidden" name="article_id" value="{$article.id}" /> <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> <button class="layui-btn layui-btn-danger" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button>
</div> </div>
</div> </div>
@ -231,6 +245,7 @@
<!--底部栏--> <!--底部栏-->
</div> </div>
{include file="public/menu" /} {include file="public/menu" /}
{/block} {/block}
{block name="script"} {block name="script"}
@ -250,66 +265,19 @@
langCancelCollection = "{:lang('cancel collection')}"; langCancelCollection = "{:lang('cancel collection')}";
let taonystatus = "{:hook('taonystatus') ? 1 : 0} "; let taonystatus = "{:hook('taonystatus') ? 1 : 0} ";
layui.use(["fly", "face", "colorpicker", "laypage"], function () { layui.use(["laypage"], function () {
var $ = layui.jquery, var $ = layui.jquery,
form = layui.form, form = layui.form,
fly = layui.fly,
colorpicker = layui.colorpicker,
laytpl = layui.laytpl,
uid = layui.cache.user.uid, uid = layui.cache.user.uid,
laypage = layui.laypage; laypage = layui.laypage;
let AID = "{$article.id}";
//tpl模板给发布时间赋值 let LOGIN_URL = "{:url('login/index')}";
$("div.user-questions").children("span.user-post-time").each(function () {
var othis = $(this);
var string = laytpl("{{ d.time }}").render({
time: othis.attr("data"),
});
var posttime = layui.util.timeAgo(string, 1);
othis.text(posttime);
});
//tpl模板给发布时间赋值
$("div.detail-hits").children("span.post-time").each(function () {
var othis = $(this);
var string = laytpl("{{ d.time }}").render({
time: othis.attr("data"),
});
var posttime = layui.util.timeAgo(string, 1);
othis.text(posttime);
});
//预定义颜色项
colorpicker.render({
elem: "#color",
color: "#393d49",
predefine: true, // 开启预定义颜色
size: "xs",
done: function (color) {
//改变标题颜色
$("h1").css("color", color);
var id = "{$article.id}";
$.ajax({
type: "post",
url: "{:url('Article/titleColor')}",
data: { id: id, title_color: color },
dataType: "json",
success: function (data) {
if (data.code === 0) {
layer.msg(data.msg, { icon: 6, time: 2000 });
} else {
layer.open({ content: data.msg, icon: 5, adim: 6 });
}
},
});
},
});
// 评论接口 // 评论接口
function comment(data){ function comment(data){
if (uid == -1) { if (uid == -1) {
layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = "{:url('login/index')}"}); layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = LOGIN_URL});
return false; return false;
} }
var index = layer.load(1); var index = layer.load(1);
@ -339,7 +307,7 @@
'<input type="hidden" name="article_id" value="{$article.id}">' + '<input type="hidden" name="article_id" value="{$article.id}">' +
'<input name="pid" value="'+ pid +'" class="layui-hide">' + '<input name="pid" value="'+ pid +'" class="layui-hide">' +
'<input name="to_user_id" value="'+ tid +'" class="layui-hide">' + '<input name="to_user_id" value="'+ tid +'" class="layui-hide">' +
'<textarea name="content" required lay-verify="required" class="layui-textarea fly-editor" style="height: 100px; right: 5px; margin: 10px 5px;"></textarea>' + '<textarea name="content" required lay-verify="required" class="layui-textarea " style="height: 100px; right: 5px; margin: 10px 5px;"></textarea>' +
'<button type="submit" class="layui-btn" lay-submit lay-filter="submit-user-comment">提交</button>' + '<button type="submit" class="layui-btn" lay-submit lay-filter="submit-user-comment">提交</button>' +
'</div>' + '</div>' +
'</form>'; '</form>';
@ -362,14 +330,6 @@
return false; return false;
}) })
// 编辑器插件启用状态
if(taonystatus == 0) {
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
// 编辑评论 // 编辑评论
$(".comment-edit").on('click', function () { $(".comment-edit").on('click', function () {
var id = $(this).data('id'); var id = $(this).data('id');
@ -381,6 +341,7 @@
content: "{:url('comment/edit')}" + '?id=' + id content: "{:url('comment/edit')}" + '?id=' + id
}); });
}); });
// 删除评论 // 删除评论
$(".comment-del").on('click', function () { $(".comment-del").on('click', function () {
var id = $(this).data('id'); var id = $(this).data('id');
@ -395,7 +356,6 @@
}) })
}) })
}); });
}
// 评论分页 // 评论分页
laypage.render({ laypage.render({
@ -408,10 +368,9 @@
var page = obj.curr; var page = obj.curr;
var limit = obj.limit; var limit = obj.limit;
var url = "{:url('article_detail',['id' => $article.id ,'ename' =>$article['cate']['ename']])}"; var url = "{:url('article_detail',['id' => $article.id ,'ename' =>$article['cate']['ename']])}";
var id = "{$article.id}";
//首次不执行 //首次不执行
if (!first) { if (!first) {
$.post("{:url('article/detail')}", { id: id, page: page }, function () { $.post("{:url('article/detail')}", { id: AID, page: page }, function () {
location.href = url + '?page=' + page + '#flyReply'; location.href = url + '?page=' + page + '#flyReply';
}); });
} }
@ -427,20 +386,19 @@
data: { id: id }, data: { id: id },
success: function (data) { success: function (data) {
location.href = "{:url('article/download',['id'=>$article.id])}"; location.href = "{:url('article/download',['id'=>$article.id])}";
}, }
}); });
}); });
$("#jiemi").click(function (){ $("#jiemi").click(function (){
//判断登陆 //判断登陆
if(uid == -1){ if(uid == -1){
layer.msg('请先登录再查看', {icon: 6}, function(){location.href = login}) layer.msg('请先登录再查看', {icon: 6}, function(){location.href = LOGIN_URL})
return false; return false;
} }
var id = "{$article.id}";
layer.prompt(function(value, index, elem){ layer.prompt(function(value, index, elem){
// alert(value); //得到value $.post("{:url('article/jiemi')}",{id: AID, art_pass:value},function (res){
$.post("{:url('article/jiemi')}",{id:id, art_pass:value},function (res){ layer.close(index);
if(res.code === 0){ if(res.code === 0){
layer.msg(res.msg,{icon:6,time:2000},function () { layer.msg(res.msg,{icon:6,time:2000},function () {
parent.location.reload(); //刷新父页面注意一定要在关闭当前iframe层之前执行刷新 parent.location.reload(); //刷新父页面注意一定要在关闭当前iframe层之前执行刷新
@ -449,7 +407,7 @@
layer.msg(res.msg,{icon:5,adim:6}); layer.msg(res.msg,{icon:5,adim:6});
} }
}); });
layer.close(index);
}); });
}); });

View File

@ -26,7 +26,7 @@
{block name="column"}{include file="/public/column" /}{/block} {block name="column"}{include file="/public/column" /}{/block}
{block name="content"} {block name="content"}
<main class="py-2 py-md-2 pb-3"> <main class="py-2 py-md-2 pb-3">
<div class="layui-container"> <div class="layui-container">
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-md8"> <div class="layui-col-md8">
@ -111,35 +111,31 @@
</div> </div>
</div> </div>
</div> </div>
</main> </main>
{include file="public/menu" /} {include file="public/menu" /}
{/block} {/block}
{block name="script"} {block name="script"}
<script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script> <script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script>
<script> <script>
layui.use(['laypage'], function(){ layui.use(['laypage'], function(){
var laypage = layui.laypage; var laypage = layui.laypage;
var $ = layui.jquery;
//执行一个laypage实例 //执行一个laypage实例
laypage.render({ laypage.render({
elem: 'pages' //注意,这里的 test1 是 ID不用加 # 号 elem: 'pages' //注意,这里的 test1 是 ID不用加 # 号
,count: "{$artList['total']}" //数据总数,从服务端得到 ,count: "{$artList['total']}" //数据总数,从服务端得到
,limit: "{$artList['per_page']}" ,limit: "{$artList['per_page']}"
,curr : "{$artList['current_page']}" ,curr : "{$artList['current_page']}"
//获取起始页 //获取起始页
,jump: function(obj, first){ ,jump: function(obj, first){
//首次不执行 //首次不执行
if(!first){ if(!first){
var page = obj.curr; var page = obj.curr;
location.href ="{$path}/"+page+'.html'; location.href ="{$path}/"+page+'.html';
} }
} }
})
}); });
}); </script>
</script>
{/block} {/block}

View File

@ -3,8 +3,8 @@
{block name="title"}{$article.title} - {$sysInfo.webname}{/block} {block name="title"}{$article.title} - {$sysInfo.webname}{/block}
{block name="keywords"}{$article.keywords ?: $article.title}{/block} {block name="keywords"}{$article.keywords ?: $article.title}{/block}
{block name="description"}{$article.title},{$article.description}{/block} {block name="description"}{$article.title},{$article.description}{/block}
{block name="ogtitle"}<meta property="og:title" content="{$article.title} - {$sysInfo.webname}">{/block} {block name="ogtitle"}<meta property="og:title" content="{article:title} - {$sysInfo.webname}">{/block}
{block name="ogdescription"}<meta property="og:description" content="{$article.title},{$article.description ?? ''}" />{/block} {block name="ogdescription"}<meta property="og:description" content="{article:title},{$article.description ?? ''}" />{/block}
{block name="ogimage"}<meta property="og:image" content="{:getOnepic($article.content)}"/>{/block} {block name="ogimage"}<meta property="og:image" content="{:getOnepic($article.content)}"/>{/block}
{block name="meta"} {block name="meta"}
<!-- SEO优化 --> <!-- SEO优化 -->
@ -21,31 +21,30 @@
<script type="application/ld+json">{"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld","@id": "{$Request.domain}{$Request.url}","title": "{$article.title}","images": ["{:getOnepic($article.content)}"],"description": "{$article.description ?? ''}","pubDate": "{$article.create_time|date='c'}","upDate": "{$article.update_time|date='c'}"}</script> <script type="application/ld+json">{"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld","@id": "{$Request.domain}{$Request.url}","title": "{$article.title}","images": ["{:getOnepic($article.content)}"],"description": "{$article.description ?? ''}","pubDate": "{$article.create_time|date='c'}","upDate": "{$article.update_time|date='c'}"}</script>
<!-- 特效丶样式 --> <!-- 特效丶样式 -->
<link rel="stylesheet" href="{$Request.domain}/view/common/blog/css/style.css" type="text/css" charset="utf-8"/> <link rel="stylesheet" href="{$Request.domain}/view/common/blog/css/style.css" type="text/css" charset="utf-8"/>
<script type='text/javascript' src="/static/jquery-3.6.0.min.js"></script>
<script type='text/javascript' src="{$Request.domain}/view/common/blog/js/view-image.min.js"></script> <script type='text/javascript' src="{$Request.domain}/view/common/blog/js/view-image.min.js"></script>
<script>window.ViewImage && ViewImage.init('.post-content img');</script> <script>window.ViewImage && ViewImage.init('.post-content img');</script>
{/block} {/block}
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block} {block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
<!-- 内容 -->
{block name="content"} {block name="content"}
<main class="py-2 py-md-2 pb-3" style="transform: none"> <main class="py-2 py-md-2 pb-3">
<div class="layui-container" style="transform: none"> <div class="layui-container">
<div class="layui-row layui-col-space15" style="transform: none">
<div class="layui-row layui-col-space15">
<div class="layui-col-md8" itemscope itemType=""> <div class="layui-col-md8" itemscope itemType="">
<div class="post card"> <div class="post card">
<section class="card-body"> <section class="card-body">
<div class="post-header border-bottom mb-4 pb-4"> <div class="post-header border-bottom mb-4 pb-4">
<h1 class="h3 mb-3" itemprop="headline">{article:title /}</h1> <h1 class="h3 mb-3" itemprop="headline">{article:title /}</h1>
<div class="meta d-flex align-items-center text-xs text-muted"> <div class="meta d-flex align-items-center text-xs text-muted">
<div>
<div class="d-inline-block" itemprop="author" itemscope="" itemtype=""> <div class="d-inline-block" itemprop="author" itemscope="" itemtype="">
<a href="{$Request.domain}" target="_blank" class="text-muted" itemprop="url"><span itemprop="name">{article:auther}</span></a> <a href="{$Request.domain}" target="_blank" class="text-muted" itemprop="url"><span itemprop="name">{article:auther}</span></a>
<a href="{article:cate name='link'}" target="_blank" class="text-muted" rel="category">{article:cate name="name"}</a> <a href="{article:cate name='link'}" target="_blank" class="text-muted" rel="category">{article:cate name="name"}</a>
<time class="d-inline-block" datetime="{$article.create_time|date='Y-m-d h:m:s'}" itemprop="datePublished">{article:time}</time> <time class="d-inline-block" datetime="{$article.create_time|date='Y-m-d h:m:s'}" itemprop="datePublished">{article:time}</time>
</div> </div>
</div>
<div class="ml-auto text-sm yincang"> <div class="ml-auto text-sm yincang">
<span class="mx-1"> <span class="mx-1"><small>阅读 {article:pv /} 次</small></span>
<small>阅读 {article:pv /} 次</small>
</span>
</div> </div>
</div> </div>
<div class="border-theme bg-primary"></div> <div class="border-theme bg-primary"></div>
@ -54,16 +53,13 @@
<article class="post-content detail-body" itemprop="articleBody" view-image> <article class="post-content detail-body" itemprop="articleBody" view-image>
{article:content} {article:content}
</article> </article>
{//文章末尾} <!-- 文章末尾 -->
{if (($article.upzip !== '') || session('?user_name'))}
<div class="">
{notempty name="$article.upzip"} {notempty name="$article.upzip"}
{if (session('?user_name'))}
<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> <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} {/if}
{/notempty}
{//解密文件} <!-- 解密文件 -->
{empty name="passJieMi"} {empty name="passJieMi"}
{if($article.read_type == 1)} {if($article.read_type == 1)}
<div id="jiemi" style="text-align:center"> <div id="jiemi" style="text-align:center">
@ -71,7 +67,7 @@
</div> </div>
{/if} {/if}
{/empty} {/empty}
<!-- 标签 -->
{notempty name="tags"} {notempty name="tags"}
<div style="margin-top: 15px">标签 <div style="margin-top: 15px">标签
{volist name="tags" id="vo" } {volist name="tags" id="vo" }
@ -82,17 +78,16 @@
<div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125);"> <div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125);">
<p style="line-height:200%;">{$sysInfo.state|raw}</p> <p style="line-height:200%;">{$sysInfo.state|raw}</p>
</div> </div>
<div style="margin-top: 20px;">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div> <div style="margin-top: 20px;">
本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a>
</div>
<div class="detail-zan"> <div class="detail-zan">
<span class="jieda-zan" type="zan" id="article-zan"> <span class="jieda-zan" type="zan" id="article-zan">点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em></span>
点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em>
</span>
{volist name="userZanList" id="vo" } {volist name="userZanList" id="vo" }
<span><img src="{$vo.userImg}"></span> <span><img src="{$vo.userImg}"></span>
{/volist} {/volist}
</div> </div>
</section> </section>
<div class="card-footer text-center mt-4"> <div class="card-footer text-center mt-4">
<a href="javascript:" style="color: #FFF !important;" data-img="/qrcode/?text={$Request.domain}{$Request.url}&size=200" data-title="手机扫一扫继续阅读" data-desc="微信或浏览器均可" class="single-popup shangzan mr-3 text-muted text-xs">手机浏览</a> <a href="javascript:" style="color: #FFF !important;" data-img="/qrcode/?text={$Request.domain}{$Request.url}&size=200" data-title="手机扫一扫继续阅读" data-desc="微信或浏览器均可" class="single-popup shangzan mr-3 text-muted text-xs">手机浏览</a>
<a href="javascript:" style="color: #FFF !important;" data-img="{:hook('qqKefu','dashang')}" data-title="赞赏支持一下站长" data-desc="微信赞赏扫码" class="single-popup shangzan text-muted text-xs">赞赏支持</a> <a href="javascript:" style="color: #FFF !important;" data-img="{:hook('qqKefu','dashang')}" data-title="赞赏支持一下站长" data-desc="微信赞赏扫码" class="single-popup shangzan text-muted text-xs">赞赏支持</a>
@ -101,10 +96,12 @@
</div> </div>
</div> </div>
</div> </div>
<div class="post card block d-flex p-4"> <div class="post card block d-flex p-4">
<span class="d-inline-block text-muted mr-2 fanpian pb-2 mb-2"> # 上一篇: {$previous|raw}</span> <span class="d-inline-block text-muted mr-2 fanpian pb-2 mb-2"> # 上一篇: {$previous|raw}</span>
<span class="d-inline-block text-muted mr-2 fanpian"># 下一篇: {$next|raw}</span> <span class="d-inline-block text-muted mr-2 fanpian"># 下一篇: {$next|raw}</span>
</div> </div>
<!-- 相关文章 -->
{notempty name="relationArticle"} {notempty name="relationArticle"}
<section class="list-related"> <section class="list-related">
<div class="content-related card"> <div class="content-related card">
@ -113,7 +110,9 @@
<div class="list list-dots my-n2"> <div class="list list-dots my-n2">
{volist name="relationArticle" id="vo"} {volist name="relationArticle" id="vo"}
<div class="list-item py-2"> <div class="list-item py-2">
<a href="{$Request.domain}{$vo.url}" target="_blank" class="list-title fanpian" title="{$vo.title}" rel="bookmark">{$vo.title} </a> <a href="{$Request.domain}/{$vo.url}" target="_blank" class="list-title fanpian" title="{$vo.title}" rel="bookmark">
{$vo.title}
</a>
</div> </div>
{/volist} {/volist}
</div> </div>
@ -122,6 +121,7 @@
</section> </section>
{/notempty} {/notempty}
<!-- 评论 -->
<section class="comments"> <section class="comments">
<div class="card"> <div class="card">
<div class="card-body pt-4"> <div class="card-body pt-4">
@ -132,14 +132,12 @@
{article:comment} {article:comment}
<li data-id="{comment:id /}" class="jieda-daan"> <li data-id="{comment:id /}" class="jieda-daan">
<div class="detail-about detail-about-reply"> <div class="detail-about detail-about-reply">
<a class="fly-avatar" href="{comment:ulink /}"> <a class="fly-avatar" href="{comment:ulink /}"><img src="{comment:uimg /}" alt="{comment:uname}"></a>
<img src="{comment:uimg /}" alt="{comment:uname}">
</a>
<div class="fly-detail-user"> <div class="fly-detail-user">
<a href="{comment:ulink /}" class="fly-link"> <a href="{comment:ulink /}" class="fly-link"><cite>{comment:uname /}</cite></a>
<cite>{comment:uname /}</cite> {if condition="$article.user_id eq $comment.user_id"}
</a> <span>({:lang('poster')})</span>
{if condition="$article.user_id eq $comment.user_id"}<span>({:lang('poster')})</span>{/if} {/if}
<span>{comment:usign /}</span> <span>{comment:usign /}</span>
</div> </div>
<div class="detail-hits"> <div class="detail-hits">
@ -147,8 +145,8 @@
</div> </div>
{//加密未解密评论不可查看} {//加密未解密评论不可查看}
{if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))}
{if ($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))}
<div class="detail-body jieda-body photos">{comment:content /}</div> <div class="detail-body jieda-body photos">{comment:content /}</div>
<div class="jieda-reply"> <div class="jieda-reply">
{eq name="comment.delete_time" value="0"} {eq name="comment.delete_time" value="0"}
@ -169,7 +167,9 @@
{notempty name="$comment.children"} {notempty name="$comment.children"}
{volist name="$comment.children" id="vo"} {volist name="$comment.children" id="vo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0; background: #f6f6f6"> <div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0; background: #f6f6f6">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$vo.user.user_img}" style="width: 30px; height: 30px; border-radius: 15px; object-fit: cover"></a> <a style="display: inline-block;width: 50px;">
<img src="{$vo.user.user_img}" style="width: 30px; height: 30px; border-radius: 15px; object-fit: cover">
</a>
<div style="float: left;width: calc(100% - 50px);"> <div style="float: left;width: calc(100% - 50px);">
<div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div> <div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$vo.content|raw}</div> <div class="detail-body jieda-body photos">{$vo.content|raw}</div>
@ -195,7 +195,9 @@
{notempty name="$vo.children"} {notempty name="$vo.children"}
{volist name="$vo.children" id="voo"} {volist name="$vo.children" id="voo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0;"> <div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0;">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$voo.user.user_img}" style="width: 30px; height: 30px; object-fit: cover; border-radius: 15px;"></a> <a style="display: inline-block; width: 50px;">
<img src="{$voo.user.user_img}" style="width: 30px; height: 30px; object-fit: cover; border-radius: 15px;">
</a>
<div style="float: left;width: calc(100% - 50px);"> <div style="float: left;width: calc(100% - 50px);">
<div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div> <div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$voo.content|raw}</div> <div class="detail-body jieda-body photos">{$voo.content|raw}</div>
@ -249,7 +251,7 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<a name="comment"></a> <a name="comment"></a>
<div class="comment-textarea mb-3"> <div class="comment-textarea mb-3">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor taonyeditor" style="height: 100px"></textarea> <textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea taonyeditor" style="height: 100px"></textarea>
</div> </div>
</div> </div>
<div class="layui-form-item que-comments"> <div class="layui-form-item que-comments">
@ -265,6 +267,7 @@
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<div class="sidebar layui-col-md4 d-none d-lg-block"> <div class="sidebar layui-col-md4 d-none d-lg-block">
<div class="theiaStickySidebar"> <div class="theiaStickySidebar">
@ -275,11 +278,11 @@
<div> <div>
<div class="widget-author-cover"> <div class="widget-author-cover">
<div class="media media-21x9"> <div class="media media-21x9">
<div class="media-content" style="background-image:url(/view/common/blog/image/user-bg.jpg)"> <div class="media-content" style="background-image:url(/view/common/blog/image/user-bg.jpg)"></div>
</div>
</div> </div>
<div class="widget-author-avatar"> <div class="widget-author-avatar">
<div class="flex-avatar w-80"><img alt="{$article.user.name}" src="{article:user name='user_img'}" class="avatar" height="80" width="80"> <div class="flex-avatar w-80">
<img alt="{$article.user.name}" src="{article:user name='user_img'}" class="avatar" height="80" width="80">
</div> </div>
</div> </div>
</div> </div>
@ -288,15 +291,25 @@
<div class="h6 mb-2">{$article.user.name}</div> <div class="h6 mb-2">{$article.user.name}</div>
<div class="text-xs text-secondary mb-4">本站内容禁止任何人采集</div> <div class="text-xs text-secondary mb-4">本站内容禁止任何人采集</div>
<div class="row g-0 text-center"> <div class="row g-0 text-center">
<div class="col"><div class="font-theme h5">{$article.user.article_count}</div><div class="text-xs text-muted">文章</div></div> <div class="col">
<div class="col"><div class="font-theme h5">{$article.user.comments_count}</div><div class="text-xs text-muted">评论</div></div> <div class="font-theme h5">{$article.user.article_count}</div>
<div class="col"><div class="font-theme h5">{$zanCount}</div><div class="text-xs text-muted">被赞</div></div> <div class="text-xs text-muted">文章</div>
</div>
<div class="col">
<div class="font-theme h5">{$article.user.comments_count}</div>
<div class="text-xs text-muted">评论</div>
</div>
<div class="col">
<div class="font-theme h5">{$zanCount}</div>
<div class="text-xs text-muted">被赞</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</dd> </dd>
</dl> </dl>
{//广告} {//广告}
<!--博客详情广告赞助位--> <!--博客详情广告赞助位-->
{:hook('ads_blog_detail_rimg')} {:hook('ads_blog_detail_rimg')}
@ -315,14 +328,14 @@
<a href="{$vo.url}" target="_blank">{$vo.title}</a> <a href="{$vo.url}" target="_blank">{$vo.title}</a>
</div> </div>
<div class="list-footer"> <div class="list-footer">
<div class="text-muted text-xs"><time class="d-inline-block">{$vo.create_time|date='Y-m-d'}</time> <div class="text-muted text-xs"><time class="d-inline-block">{$vo.create_time|date='Y-m-d'}</time></div>
</div>
</div> </div>
</li> </li>
{/volist} {/volist}
</ul> </ul>
</dd> </dd>
</dl> </dl>
{//标签} {//标签}
{if count($hotTag) > 0} {if count($hotTag) > 0}
<dl class="function" id="rongkeji_retags"> <dl class="function" id="rongkeji_retags">
@ -347,6 +360,7 @@
{//crud管理模块} {//crud管理模块}
{include file="/public/crud" /} {include file="/public/crud" /}
</main> </main>
{include file="public/menu" /} {include file="public/menu" /}
@ -356,8 +370,9 @@
{block name="script"} {block name="script"}
<script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script> <script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script>
<script> <script>
var collectionFind = "{:url('Collection/find')}", var collectionFind = "{:url('Collection/find')}",
collection = "{:url('collection/')}", collection = "{:url('collection/')}",
articleJieset = "{:url('Article/jieset')}", articleJieset = "{:url('Article/jieset')}",
articleDelete = "{:url('Article/delete')}", articleDelete = "{:url('Article/delete')}",
@ -368,34 +383,22 @@ var collectionFind = "{:url('Collection/find')}",
commentJiedaDelete = "{:url('Comment/jiedaDelete')}", commentJiedaDelete = "{:url('Comment/jiedaDelete')}",
langCollection = "{:lang('collection')}", langCollection = "{:lang('collection')}",
langCancelCollection = "{:lang('cancel collection')}"; langCancelCollection = "{:lang('cancel collection')}";
let taonystatus = "{:hook('taonystatus') ? 1 : 0} "; let taonystatus = "{:hook('taonystatus') ? 1 : 0} ";
layui.use(['fly', 'face','colorpicker', 'laypage'], function(){ layui.use(['laypage'], function(){
var $ = layui.jquery var $ = layui.jquery
,form = layui.form ,form = layui.form
,fly = layui.fly
,colorpicker = layui.colorpicker
,laytpl = layui.laytpl
,uid = layui.cache.user.uid
,laypage = layui.laypage; ,laypage = layui.laypage;
var id = "{$article.id}";
let LOGIN_URL = "{:url('login/index')}";
//tpl模板给发布时间赋值 let uid = layui.cache.user.uid;
$('div.detail-hits').children('span.post-time').each(function(){ let id = "{$article.id}";
var othis = $(this), html = othis.html(); let LOGIN_URL = "{:url('login/index')}";
var string = laytpl('{{ d.time }}').render({
time: othis.attr('data')
});
var posttime = layui.util.timeAgo(string, 1);
othis.text(posttime);
});
//文章点赞 //文章点赞
$("#article-zan").on('click',function(){ $("#article-zan").on('click',function(){
//判断登陆 //判断登陆
if(uid == -1){ if(uid == -1){
layer.msg('请登录再点赞', {icon: 6}, function(){location.href = login}) layer.msg('请登录再点赞', {icon: 6}, function(){location.href = LOGIN_URL})
return false; return false;
} }
$.post("{:url('article/userZanArticle')}",{article_id:id,type:1},function(data){ $.post("{:url('article/userZanArticle')}",{article_id:id,type:1},function(data){
@ -409,36 +412,47 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
}) })
}); });
//预定义颜色项 // 评论
colorpicker.render({ form.on('submit(user-comment)',function (data){
elem: '#color' comment(data.field);
,color: '#393d49'
,predefine: true // 开启预定义颜色
,size: 'xs'
,done: function(color){
//改变标题颜色
$('h1').css("color", color);
$.ajax({
type:'post',
url:"{:url('Article/titleColor')}",
data:{id: id,title_color: color},
dataType:'json',
success:function(data){
if(data.code == 0){
layer.msg(data.msg,{icon:6,time:2000
}); });
// 提交回复
form.on('submit(submit-user-comment)', function(data){
comment(data.field);
return false;
})
// 编辑评论
$(".comment-edit").on('click', function () {
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
// 删除评论
$(".comment-del").on('click', function () {
var id = $(this).data('id');
layer.confirm('需要删除吗?', {icon: 3}, function (){
$.post("{:url('comment/jiedaDelete')}", {id: id}, function (res) {
if (res.status === 0) {
toast.success({title: "成功消息", message: res.msg});
location.reload(true);
} else { } else {
layer.open({content:data.msg,icon:5,adim:6}); toast.error({title: "失败消息", message: res.msg});
}
}
});
} }
})
})
}); });
// 评论接口 // 评论接口
function comment(data){ function comment(data){
if (uid == -1) { if (uid == -1) {
layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = "{:url('login/index')}"}); layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = LOGIN_URL});
return false; return false;
} }
var index = layer.load(1); var index = layer.load(1);
@ -468,7 +482,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
'<input type="hidden" name="article_id" value="{$article.id}">' + '<input type="hidden" name="article_id" value="{$article.id}">' +
'<input name="pid" value="'+ pid +'" class="layui-hide">' + '<input name="pid" value="'+ pid +'" class="layui-hide">' +
'<input name="to_user_id" value="'+ tid +'" class="layui-hide">' + '<input name="to_user_id" value="'+ tid +'" class="layui-hide">' +
'<textarea name="content" required lay-verify="required" class="layui-textarea fly-editor taonyeditor" style="height: 100px; right: 5px; margin: 10px 5px;"></textarea>' + '<textarea name="content" required lay-verify="required" class="layui-textarea taonyeditor" style="height: 100px; right: 5px; margin: 10px 5px;"></textarea>' +
'<button type="submit" class="layui-btn" lay-submit lay-filter="submit-user-comment">提交</button>' + '<button type="submit" class="layui-btn" lay-submit lay-filter="submit-user-comment">提交</button>' +
'</div>' + '</div>' +
'</form>'; '</form>';
@ -481,50 +495,41 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
} }
}) })
// 评论 //解密
form.on('submit(user-comment)',function (data){ $("#jiemi").click(function (){
comment(data.field); //判断登陆
}); if(uid == -1){
//提交回复 layer.msg('请先登录再查看', {icon: 6}, function(){location.href = LOGIN_URL})
form.on('submit(submit-user-comment)', function(data){
comment(data.field);
return false; return false;
}) }
var id = "{$article.id}";
layer.prompt(function(value, index, elem){
$.post("{:url('article/jiemi')}",{id:id, art_pass:value},function (res){
layer.close(index);
if(res.code === 0){
layer.msg(res.msg,{icon:6,time:2000},function () {
parent.location.reload(); //刷新父页面注意一定要在关闭当前iframe层之前执行刷新
});
} else {
layer.msg(res.msg,{icon:5,adim:6});
}
});
});
});
// 编辑器插件启用状态 //下载
if(taonystatus == 0) { $('#zip-download').click(function (){
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。 var id = "{$article.id}";
$('.detail-body').each(function(){ $.ajax({
var othis = $(this), html = othis.html(); type:"post",
othis.html(fly.content(html)); url:"{:url('article/download')}",
}); data:{id:id},
} else { success:function (data) {
// 编辑评论 location.href = "{:url('article/download',['id'=>$article.id])}";
$(".comment-edit").on('click', function () {
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
// 删除评论
$(".comment-del").on('click', function () {
var id = $(this).data('id');
layer.confirm('需要删除吗?', {icon: 3}, function (){
$.post("{:url('comment/jiedaDelete')}", {id: id}, function (res) {
if (res.status === 0) {
toast.success({title: "成功消息", message: res.msg});
location.reload(true);
} else {
toast.error({title: "失败消息", message: res.msg});
} }
})
})
}); });
} });
// 评论分页 // 评论分页
laypage.render({ laypage.render({
@ -547,42 +552,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
}, },
}); });
//下载
$('#zip-download').click(function (){
var id = "{$article.id}";
$.ajax({
type:"post",
url:"{:url('article/download')}",
data:{id:id},
success:function (data) {
location.href = "{:url('article/download',['id'=>$article.id])}";
}
}); });
});
$("#jiemi").click(function (){
//判断登陆
if(uid == -1){
layer.msg('请先登录再查看', {icon: 6}, function(){location.href = LOGIN_URL})
return false;
}
var id = "{$article.id}";
layer.prompt(function(value, index, elem){
// alert(value); //得到value
$.post("{:url('article/jiemi')}",{id:id, art_pass:value},function (res){
if(res.code === 0){
layer.msg(res.msg,{icon:6,time:2000},function () {
parent.location.reload(); //刷新父页面注意一定要在关闭当前iframe层之前执行刷新
});
} else {
layer.msg(res.msg,{icon:5,adim:6});
}
});
layer.close(index);
});
});
});
</script> </script>
<!-- 插件hook位 --> <!-- 插件hook位 -->

View File

@ -65,7 +65,7 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<div class="layui-input-block"> <div class="layui-input-block">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="详细内容" class="layui-textarea fly-editor taonyeditor" style="height: 260px;">{$article.content}</textarea> <textarea id="L_content" name="content" required lay-verify="required" placeholder="详细内容" class="layui-textarea taonyeditor" style="height: 260px;">{$article.content}</textarea>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">

View File

@ -17,8 +17,6 @@
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-md8"> <div class="layui-col-md8">
<div class="fly-panel" style="margin-bottom: 0;"> <div class="fly-panel" style="margin-bottom: 0;">
<section id="main" class="list-home list-grid list-grid-padding"> <section id="main" class="list-home list-grid list-grid-padding">
{article:list} {article:list}
<article class="list-item block card-plain"> <article class="list-item block card-plain">
@ -79,7 +77,6 @@
<script> <script>
layui.use(['laypage'], function(){ layui.use(['laypage'], function(){
var laypage = layui.laypage; var laypage = layui.laypage;
//执行一个laypage实例 //执行一个laypage实例
laypage.render({ laypage.render({
elem: 'pages' //注意,这里的 test1 是 ID不用加 # 号 elem: 'pages' //注意,这里的 test1 是 ID不用加 # 号

View File

@ -12,34 +12,30 @@
{/block} {/block}
{block name="link"} {/block} {block name="link"} {/block}
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block} {block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
{block name="content"} {block name="content"}
<div class="layui-container"> <div class="layui-container">
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-md12 content detail"> <div class="layui-col-md12 content detail">
<div class="fly-panel detail-box"> <div class="fly-panel detail-box">
{//标题} <h1 style="margin:10px 5px 15px 5px; text-align: center;">{article:title}</h1>
<h1 style="color:{$article.title_color ?: '#333'}; margin:10px 5px 15px 5px; text-align: center;">{$article.title}</h1>
{//作者} {//作者}
<div class="detail-about" align="center"> <div class="detail-about" style="text-align:center">
<div class="detail-hits" style="left:-30px;"> <div class="detail-hits" style="left:-30px;">
<span>{$article.cate.catename} /</span> <span>{$article.cate.catename}</span>
<span>{$article.user.name} /</span> <span>{$article.user.name}</span>
<span class="post-time" style="padding-top: 5px;" data="{$article.create_time}">{$article.create_time}</span> <span class="post-time" style="padding-top: 5px;" data="{$article.create_time}">{$article.create_time} </span>
<span>/ <i class="iconfont" title="浏览">&#xe60b;</i> {$pv}</span> <span><i class="iconfont" title="浏览">&#xe60b;</i> {article:pv}</span>
</div> </div>
</div> </div>
<hr style="margin-bottom: 25px"> <hr style="margin-bottom: 25px">
{// 内容} {// 内容}
{:hook('taoplayerdiv')} {:hook('taoplayerdiv')}
<div class="detail-body photos" style="font-size: 18px;line-height: 200%;" id="content">{$article.content|raw}</div> <div class="detail-body photos" style="font-size: 18px;line-height: 200%;" id="content">
{if (($article.upzip !== '') || session('?user_name'))} {$article.content|raw}
<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> </div>
{/if}
{//解密文件} {//解密文件}
{empty name="passJieMi"} {empty name="passJieMi"}
@ -57,10 +53,13 @@
{/volist} {/volist}
</div> </div>
{/notempty} {/notempty}
<div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125);"> <div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125);">
<p style="line-height:200%;">{$sysInfo.state|raw}</p> <p style="line-height:200%;">{$sysInfo.state|raw}</p>
</div> </div>
<div style="margin-top: 20px;">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div> <div style="margin-top: 20px;">本文链接:
<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a>
</div>
</div> </div>
</div> </div>
{//crud管理模块} {//crud管理模块}
@ -72,6 +71,7 @@
</div> </div>
</div> </div>
{include file="public/menu" /} {include file="public/menu" /}
{/block} {/block}
{block name="script"} {block name="script"}
@ -87,165 +87,8 @@
commentJiedaDelete = "{:url('Comment/jiedaDelete')}", commentJiedaDelete = "{:url('Comment/jiedaDelete')}",
langCollection = "{:lang('collection')}", langCollection = "{:lang('collection')}",
langCancelCollection = "{:lang('cancel collection')}"; langCancelCollection = "{:lang('cancel collection')}";
let taonystatus = "{:hook('taonystatus') ? 1 : 0} "; let taonystatus = "{:hook('taonystatus') ? 1 : 0} ";
layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
var $ = layui.jquery
,form = layui.form
,fly = layui.fly
,colorpicker = layui.colorpicker
,laytpl = layui.laytpl
,uid = layui.cache.user.uid
,laypage = layui.laypage;
let LOGIN_URL = "{:url('login/index')}";
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
// 编辑器插件启用状态
if(taonystatus == 0) {
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
$("#comment-edit").on('click',function (){
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
}
//tpl模板给发布时间赋值
$('div.detail-hits').children('span.post-time').each(function(){
var othis = $(this), html = othis.html();
var string = laytpl('{{ d.time }}').render({
//time: html
time: othis.attr('data')
});
var posttime = layui.util.timeAgo(string, 1);
othis.text(posttime);
//console.log(othis.attr('data'));
});
//预定义颜色项
colorpicker.render({
elem: '#color'
,color: '#393d49'
,predefine: true // 开启预定义颜色
,size: 'xs'
,done: function(color){
//改变标题颜色
$('h1').css("color", color);
var id = "{$article.id}";
$.ajax({
type:'post',
url:"{:url('Article/titleColor')}",
data:{id: id,title_color: color},
dataType:'json',
success:function(data){
if(data.code == 0){
layer.msg(data.msg,{icon:6,time:2000
});
} else {
layer.open({content:data.msg,icon:5,adim:6});
}
}
});
}
});
//评论需要登陆
form.on('submit(user-comment)',function (data){
var index = layer.load(1);
var filed = data.field;
if (uid == -1) {
layer.msg('请先登陆',{icon:5,time:2000},function(){
location.href = "{:url('login/index')}";
});
} else {
$.ajax({
type: "post",
url: "{:url('article/comment')}",
data: filed,
dataType: "json",
success:function (data) {
if (data.code == 0) {
layer.msg(data.msg,{icon:6,time:2000},function () {
location.reload(true);
});
}else {
layer.open({title:'评论失败',content:data.msg,icon:5,anim:6});
}
}
});
}
return false;
});
// 评论分页
laypage.render({
elem: "pages", //注意,这里的 test1 是 ID不用加 # 号
count: "{$article.comments_count}", //数据总数,从服务端得到
limit: 10,
curr: "{$page}",
//获取起始页
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) {
$.post("{:url('article/detail')}", { id: id, page: page }, function () {
location.href = url + '?page=' + page + '#flyReply';
});
}
},
});
//下载
$('#zip-download').click(function (){
var id = "{$article.id}";
$.ajax({
type:"post",
url:"{:url('article/download')}",
data:{id:id},
success:function (data) {
location.href = "{:url('article/download',['id'=>$article.id])}";
}
});
});
$("#jiemi").click(function (){
//判断登陆
if(uid == -1){
layer.msg('请先登录再查看', {icon: 6}, function(){location.href = LOGIN_URL})
return false;
}
var id = "{$article.id}";
layer.prompt(function(value, index, elem){
// alert(value); //得到value
$.post("{:url('article/jiemi')}",{id:id, art_pass:value},function (res){
if(res.code === 0){
layer.msg(res.msg,{icon:6,time:2000},function () {
parent.location.reload(); //刷新父页面注意一定要在关闭当前iframe层之前执行刷新
});
} else {
layer.msg(res.msg,{icon:5,adim:6});
}
});
layer.close(index);
});
});
});
</script> </script>
<!-- 插件hook位 --> <!-- 插件hook位 -->

View File

@ -24,7 +24,7 @@
<img src="{$Request.domain}{$art.user.user_img}" alt="{$art.user.name}"> <img src="{$Request.domain}{$art.user.user_img}" alt="{$art.user.name}">
</a> </a>
<h2> <h2>
<a href="{$Request.domain}{$art.url}" style="color:{$art.title_color ?? '#333'};">{$art.title}</a> <a href="{$Request.domain}/{$art.url}" style="color:{$art.title_color ?? '#333'};">{$art.title}</a>
</h2> </h2>
<div class="fly-list-info"> <div class="fly-list-info">
@ -35,14 +35,13 @@
<cite>{$art.user.nickname ?: $art.user.name}</cite> <cite>{$art.user.nickname ?: $art.user.name}</cite>
<i>{$art.create_time|date='Y-m-d'}</i> <i>{$art.create_time|date='Y-m-d'}</i>
</a> </a>
{//图标} {//图标}
<span>
{$art.has_img ?= '<span><i class="layui-icon layui-icon-picture" style="color: #5FB878;"></i></span>'} {$art.has_img ?= '<span><i class="layui-icon layui-icon-picture" style="color: #5FB878;"></i></span>'}
{$art.has_video ?= '<span><i class="layui-icon layui-icon-play" style="color: #FF5722;"></i></span>'} {$art.has_video ?= '<span><i class="layui-icon layui-icon-play" style="color: #FF5722;"></i></span>'}
{$art.has_audio ?= '<span><i class="layui-icon layui-icon-speaker" style="color: #000000;"></i></span>'} {$art.has_audio ?= '<span><i class="layui-icon layui-icon-speaker" style="color: #000000;"></i></span>'}
{$art.read_type ?= '<span><i class="layui-icon layui-icon-password" style="color: #FF5722;"></i></span>'} {$art.read_type ?= '<span><i class="layui-icon layui-icon-password" style="color: #FF5722;"></i></span>'}
{$art.upzip ?= '<span><i class="layui-icon layui-icon-file-b" style="color: #009688;" title="附件"></i></span>'} {$art.upzip ?= '<span><i class="layui-icon layui-icon-file-b" style="color: #009688;" title="附件"></i></span>'}
</span>
<span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览">&#xe60b;</i> {$art.pv}</span> <span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览">&#xe60b;</i> {$art.pv}</span>
<span class="fly-list-nums"><i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}</span> <span class="fly-list-nums"><i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}</span>
</div> </div>
@ -72,12 +71,13 @@
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{include file="public/menu" /} {include file="public/menu" /}
{/block} {/block}
{block name="script"} {block name="script"}
<script> <script>
layui.use(['laypage'], function(){ layui.use(['laypage'], function(){
@ -92,13 +92,13 @@
//获取起始页 //获取起始页
,jump: function(obj, first){ ,jump: function(obj, first){
//首次不执行 //首次不执行
if(!first){ if(!first){
window.location.href = '{$path}/'+obj.curr+'.html'; //跳转 window.location.href = '{$path}/'+obj.curr+'.html'; //跳转
} }
} }
}); })
}); });
</script> </script>
{/block} {/block}

View File

@ -20,8 +20,10 @@
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-md8 content detail"> <div class="layui-col-md8 content detail">
<div class="fly-panel detail-box"> <div class="fly-panel detail-box">
{//标题} {//标题}
<h1 style="color:{article:title_color /};">{article:title /}</h1> <h1>{article:title /}</h1>
{//图标} {//图标}
<div class="fly-detail-info"> <div class="fly-detail-info">
<span class="layui-badge layui-bg-green fly-detail-column"> <span class="layui-badge layui-bg-green fly-detail-column">
@ -31,8 +33,12 @@
{article:cate name="name" /} {article:cate name="name" /}
{/if} {/if}
</span> </span>
{if ($article.is_top == 1)}<span class="layui-badge layui-bg-black">{:lang('top')}</span>{/if} {if ($article.is_top == 1)}
{if ($article.is_hot == 1)}<span class="layui-badge layui-bg-red">{:lang('hot')}</span>{/if} <span class="layui-badge layui-bg-black">{:lang('top')}</span>
{/if}
{if ($article.is_hot == 1)}
<span class="layui-badge layui-bg-red">{:lang('hot')}</span>
{/if}
<span id="LAY_jieAdmin" data-id="{article:id /}" data-colurl="{:url('collection/find')}"></span> <span id="LAY_jieAdmin" data-id="{article:id /}" data-colurl="{:url('collection/find')}"></span>
<span class="fly-list-nums"> <span class="fly-list-nums">
<a href="#comment"> <a href="#comment">
@ -41,35 +47,34 @@
<i class="iconfont" title="浏览">&#xe60b;</i>{article:pv /} <i class="iconfont" title="浏览">&#xe60b;</i>{article:pv /}
</span> </span>
</div> </div>
{//作者} {//作者}
<div class="detail-about"> <div class="detail-about">
<a class="fly-avatar" href="{article:user name='link' /}"> <a class="fly-avatar" href="{article:user name='link' /}">
<img src="{article:user name='user_img' /}" alt="{article:user name='name' /}"> <img src="{article:user name='user_img' /}" alt="{article:user name='name' /}">
{if($article.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if} {if($article.user.vip > 0)}
<i class="iconfont icon-renzheng" title="认证信息"></i>
{/if}
</a> </a>
<div class="fly-detail-user"> <div class="fly-detail-user">
<a href="{article:user name='link' /}" class="fly-link"> <a href="{article:user name='link' /}" class="fly-link"><cite>{article:auther}</cite></a>
<cite>{article:auther}</cite>
</a>
<span class="layui-btn layui-btn-xs guanzhu" >关注</span>
</div> </div>
<div class="detail-hits"> <div class="detail-hits">
<span class="post-time" data="{$article.create_time}" style="padding-top: 5px;"></span> <span class="post-time" data="{$article.create_time}" style="padding-top: 5px;">{$article.create_time}</span>
{:hook('ipShow',$article.user.city)} {:hook('ipShow',$article.user.city)}
</div> </div>
</div> </div>
<hr> <hr>
{//内容} {//内容}
{:hook('taoplayerdiv')} {:hook('taoplayerdiv')}
<div class="detail-body photos" id="content">{article:content}</div> <div class="detail-body photos" id="content">{article:content}</div>
{//下载} {//下载}
{if (($article.upzip !== '') || session('?user_name'))}
<div class="">
{notempty name="$article.upzip"} {notempty name="$article.upzip"}
{if(session('?user_name'))}
<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> <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} {/if}
{/notempty}
{//解密文件} {//解密文件}
{empty name="passJieMi"} {empty name="passJieMi"}
@ -87,14 +92,17 @@
{/volist} {/volist}
</div> </div>
{/notempty} {/notempty}
{//网站声明}
<div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125);"> <div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125);">
<p style="line-height:200%; ">{$sysInfo.state|raw}</p> <p style="line-height:200%; ">{$sysInfo.state|raw}</p>
</div> </div>
{//本文链接}
<div style="margin-top: 20px;">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div> <div style="margin-top: 20px;">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div>
<div class="detail-zan"> <div class="detail-zan">
<span class="jieda-zan" type="zan" id="article-zan"> <span class="jieda-zan" type="zan" id="article-zan">
点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em> 点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em>
</span> </span>
<!-- 点赞列表 -->
{volist name="userZanList" id="vo" } {volist name="userZanList" id="vo" }
<span><img src="{$vo.userImg}"></span> <span><img src="{$vo.userImg}"></span>
{/volist} {/volist}
@ -108,11 +116,11 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<a name="comment"></a> <a name="comment"></a>
<div class="layui-input-block"> <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 taonyeditor"></textarea> <textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea taonyeditor"></textarea>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<input type="hidden" name="article_id" value="{$article.id}"> <input type="hidden" name="article_id" value="{article:id}">
<button class="layui-btn" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button> <button class="layui-btn" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button>
</div> </div>
</div> </div>
@ -122,28 +130,24 @@
{//评论内容} {//评论内容}
<div class="fly-panel detail-box" id="flyReply"> <div class="fly-panel detail-box" id="flyReply">
<span style="font-size:18px;">评论 {$article.comments_count}</span> <span style="font-size:18px;">评论 {$article.comments_count}</span>
<ul class="jieda" id="jieda"> <ul class="jieda" id="jieda">
{article:comment} {article:comment}
<li data-id="{comment:id /}" class="jieda-daan"> <li data-id="{comment:id /}" class="jieda-daan">
<div class="detail-about detail-about-reply"> <div class="detail-about detail-about-reply">
<a class="fly-avatar" href="{comment:ulink /}"> <a class="fly-avatar" href="{comment:ulink /}"><img src="{comment:uimg /}" alt="{comment:uname}"></a>
<img src="{comment:uimg /}" alt="{comment:uname}">
</a>
<div class="fly-detail-user"> <div class="fly-detail-user">
<a href="{comment:ulink /}" class="fly-link"> <a href="{comment:ulink /}" class="fly-link"><cite>{comment:uname /}</cite></a>
<cite>{comment:uname /}</cite> {if condition="$article.user_id eq $comment.user_id"}
</a> <span>({:lang('poster')})</span>
{if condition="$article.user_id eq $comment.user_id"}<span>({:lang('poster')})</span>{/if} {/if}
<span>{comment:usign /}</span> <span>{comment:usign /}</span>
</div> </div>
<div class="detail-hits"> <div class="detail-hits">
<span class="post-time" data="{comment:time}"></span>{:hook('ipShow',$comment.user.city)}</span> <span class="post-time">{comment:time}</span>{:hook('ipShow',$comment.user.city)}</span>
</div> </div>
{//加密未解密评论不可查看} {//加密未解密评论不可查看}
{if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))} {if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))}
<div class="detail-body jieda-body photos">{comment:content /}</div> <div class="detail-body jieda-body photos">{comment:content /}</div>
<div class="jieda-reply"> <div class="jieda-reply">
{eq name="comment.delete_time" value="0"} {eq name="comment.delete_time" value="0"}
@ -163,9 +167,10 @@
{// 第二层回复} {// 第二层回复}
{notempty name="$comment.children"} {notempty name="$comment.children"}
{volist name="$comment.children" id="vo"} {volist name="$comment.children" id="vo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0; background: #f6f6f6"> <div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0; background: #f6f6f6">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$vo.user.user_img}" style="width: 30px; height: 30px; border-radius: 15px; object-fit: cover"></a> <a style="display: inline-block; width: 50px;">
<img src="{$vo.user.user_img}" style="width: 30px; height: 30px; border-radius: 15px; object-fit: cover">
</a>
<div style="float: left;width: calc(100% - 50px);"> <div style="float: left;width: calc(100% - 50px);">
<div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div> <div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$vo.content|raw}</div> <div class="detail-body jieda-body photos">{$vo.content|raw}</div>
@ -183,7 +188,6 @@
{/if} {/if}
</div> </div>
{/eq} {/eq}
</div> </div>
</div> </div>
</div> </div>
@ -192,7 +196,9 @@
{notempty name="$vo.children"} {notempty name="$vo.children"}
{volist name="$vo.children" id="voo"} {volist name="$vo.children" id="voo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0;"> <div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0;">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$voo.user.user_img}" style="width: 30px; height: 30px; object-fit: cover; border-radius: 15px;"></a> <a style="display: inline-block; width: 50px;">
<img src="{$voo.user.user_img}" style="width: 30px; height: 30px; object-fit: cover; border-radius: 15px;">
</a>
<div style="float: left;width: calc(100% - 50px);"> <div style="float: left;width: calc(100% - 50px);">
<div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div> <div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$voo.content|raw}</div> <div class="detail-body jieda-body photos">{$voo.content|raw}</div>
@ -215,7 +221,6 @@
</div> </div>
{/volist} {/volist}
{/notempty} {/notempty}
{/volist} {/volist}
{/notempty} {/notempty}
</div> </div>
@ -229,10 +234,8 @@
</li> </li>
{/article:comment} {/article:comment}
</ul> </ul>
<div style="text-align: center" id="pages"></div> <div style="text-align: center" id="pages"></div>
</div> </div>
</div> </div>
{//右栏} {//右栏}
@ -246,21 +249,20 @@
</a> </a>
</div> </div>
<div class="questions"> <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">回答 {$article.user.comments_count}</span>
<span class="layui-badge layui-bg-green">+ 关注</span> <span class="layui-badge layui-bg-green">发表 {$article.user.article_count}</span>
</div> </div>
</div> </div>
</div> </div>
<!-- 联系方式 --> <!-- 联系方式 -->
{:hook('callme_show', ['id' => $article.id, 'uid' => $article.user.id])} {:hook('callme_show', ['id' => $article.id, 'uid' => $article.user.id])}
<!-- 插件hook位 --> <!-- 插件hook位 -->
{:hook('addonhook_detail')} {:hook('addonhook_detail')}
</div> </div>
{//crud管理模块} <!-- crud管理模块 -->
{include file="/public/crud" /} {include file="/public/crud" /}
</div> </div>
<!--底部栏--> <!--底部栏-->
@ -270,7 +272,7 @@
{block name="script"} {block name="script"}
<script> <script>
var collectionFind = "{:url('collection/find')}", var collectionFind = "{:url('collection/find')}",
collection = "{:url('collection/')}", collection = "{:url('collection/')}",
articleJieset = "{:url('Article/jieset')}", articleJieset = "{:url('Article/jieset')}",
articleDelete = "{:url('Article/delete')}", articleDelete = "{:url('Article/delete')}",
@ -283,95 +285,43 @@ var collectionFind = "{:url('collection/find')}",
langCancelCollection = "{:lang('cancel collection')}"; langCancelCollection = "{:lang('cancel collection')}";
let taonystatus = "{:hook('taonystatus') ? 1 : 0} "; let taonystatus = "{:hook('taonystatus') ? 1 : 0} ";
layui.use(['fly', 'face','colorpicker', 'laypage'], function(){ layui.use(['laypage'], function(){
var $ = layui.jquery var $ = layui.jquery
,form = layui.form ,form = layui.form
,fly = layui.fly
,colorpicker = layui.colorpicker
,laytpl = layui.laytpl
,uid = layui.cache.user.uid ,uid = layui.cache.user.uid
,laypage = layui.laypage; ,laypage = layui.laypage;
var id = "{$article.id}";
let LOGIN_URL = "{:url('login/index')}";
//tpl模板给发布时间赋值 let AID = "{$article.id}";
$('div.detail-hits').children('span.post-time').each(function(){ let LOGIN_URL = "{:url('login/index')}";
var othis = $(this), html = othis.html();
var string = laytpl('{{ d.time }}').render({
time: othis.attr('data')
});
var posttime = layui.util.timeAgo(string, 1);
othis.text(posttime);
});
//文章点赞 //文章点赞
$("#article-zan").on('click',function(){ $("#article-zan").on('click',function(){
//判断登陆 //判断登陆
if(uid == -1){ if(uid == -1){
layer.msg('请登录再点赞', {icon: 6}, function(){location.href = login}) layer.msg('请登录再点赞', {icon: 6}, function(){location.href = LOGIN_URL})
return false; return false;
} }
$.post("{:url('article/userZanArticle')}",{article_id:id,type:1},function(data){ $.post("{:url('article/userZanArticle')}",{article_id:AID, type:1},function(data){
if(data.code === 0){ if(data.code === 0){
layer.msg(data.msg,{icon:6,time:2000},function () { layer.msg(data.msg,{icon:6,time:2000},function () { location.reload(true) });
location.reload(true);
});
} else { } else {
layer.msg(data.msg,{icon:6,adim:6}); layer.msg(data.msg,{icon:6,adim:6});
} }
}) })
}); });
//预定义颜色项 // 评论
colorpicker.render({ form.on('submit(user-comment)',function (data){
elem: '#color' comment(data.field);
,color: '#393d49'
,predefine: true // 开启预定义颜色
,size: 'xs'
,done: function(color){
//改变标题颜色
$('h1').css("color", color);
$.ajax({
type:'post',
url:"{:url('Article/titleColor')}",
data:{id: id,title_color: color},
dataType:'json',
success:function(data){
if(data.code === 0){
layer.msg(data.msg,{icon:6,time:2000
});
} else {
layer.open({content:data.msg,icon:5,adim:6});
}
}
});
}
}); });
// 评论接口 // 提交评论
function comment(data){ form.on('submit(submit-user-comment)', function(data){
if (uid == -1) { comment(data.field);
layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = "{:url('login/index')}"});
return false; return false;
} })
var index = layer.load(1);
$.ajax({
type: "post",
url: "{:url('article/comment')}",
data: data,
dataType: "json",
success:function (res) {
layer.close(index);
if (res.code === 0) {
layer.msg(res.msg,{icon:6,time:2000},function () {location.reload(true)});
}else {
layer.open({title:'评论失败',content:res.msg,icon:5,anim:6});
}
}
});
}
// 回复用户 // 回复评论用户
$("span[type='reply']").on('click',function (){ $("span[type='reply']").on('click',function (){
var pid = $(this).attr('data-pid'); var pid = $(this).attr('data-pid');
var tid = $(this).data('tid'); var tid = $(this).data('tid');
@ -381,7 +331,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
'<input type="hidden" name="article_id" value="{$article.id}">' + '<input type="hidden" name="article_id" value="{$article.id}">' +
'<input name="pid" value="'+ pid +'" class="layui-hide">' + '<input name="pid" value="'+ pid +'" class="layui-hide">' +
'<input name="to_user_id" value="'+ tid +'" class="layui-hide">' + '<input name="to_user_id" value="'+ tid +'" class="layui-hide">' +
'<textarea name="content" required lay-verify="required" class="layui-textarea fly-editor" style="height: 100px; right: 5px; margin: 10px 5px;"></textarea>' + '<textarea name="content" required lay-verify="required" class="layui-textarea taonyeditor" style="height: 100px; right: 5px; margin: 10px 5px;"></textarea>' +
'<button type="submit" class="layui-btn" lay-submit lay-filter="submit-user-comment">提交</button>' + '<button type="submit" class="layui-btn" lay-submit lay-filter="submit-user-comment">提交</button>' +
'</div>' + '</div>' +
'</form>'; '</form>';
@ -394,24 +344,6 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
} }
}) })
// 评论
form.on('submit(user-comment)',function (data){
comment(data.field);
});
//提交回复
form.on('submit(submit-user-comment)', function(data){
comment(data.field);
return false;
})
// 编辑器插件启用状态
if(taonystatus == 0) {
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
// 编辑评论 // 编辑评论
$(".comment-edit").on('click', function () { $(".comment-edit").on('click', function () {
var id = $(this).data('id'); var id = $(this).data('id');
@ -423,6 +355,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
content: "{:url('comment/edit')}" + '?id=' + id content: "{:url('comment/edit')}" + '?id=' + id
}); });
}); });
// 删除评论 // 删除评论
$(".comment-del").on('click', function () { $(".comment-del").on('click', function () {
var id = $(this).data('id'); var id = $(this).data('id');
@ -437,30 +370,52 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
}) })
}) })
}); });
}
// 评论分页 // 评论接口
laypage.render({ function comment(data){
elem: "pages", //注意,这里的 test1 是 ID不用加 # 号 if (uid == -1) {
count: "{$comments['total']}", //数据总数,从服务端得到 layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = LOGIN_URL});
limit: 10, return false;
curr: "{$page}", }
//获取起始页 var index = layer.load(1);
jump: function (obj, first) { $.ajax({
var page = obj.curr; type: "post",
var limit = obj.limit; url: "{:url('article/comment')}",
var url = "{:url('article_detail',['id' => $article.id ,'ename' =>$article['cate']['ename']])}"; data: data,
var id = "{$article.id}"; dataType: "json",
//首次不执行 success:function (res) {
if (!first) { layer.close(index);
$.post("{:url('article/detail')}", { id: id, page: page }, function () { if (res.code === 0) {
location.href = url + '?page=' + page + '#comment'; layer.msg(res.msg,{icon:6,time:2000},function () {location.reload(true)});
} else {
layer.open({title:'评论失败',content:res.msg,icon:5,anim:6});
}
}
}); });
} }
},
// 解密内容
$("#jiemi").click(function (){
//判断登陆
if(uid == -1){
layer.msg('请先登录再查看', {icon: 6}, function(){location.href = LOGIN_URL})
return false;
}
layer.prompt(function(value, index, elem){
$.post("{:url('article/jiemi')}",{id: AID, art_pass:value},function (res){
layer.close(index);
if(res.code === 0){
layer.msg(res.msg,{icon:6,time:2000},function () {
parent.location.reload(); //刷新父页面注意一定要在关闭当前iframe层之前执行刷新
});
} else {
layer.msg(res.msg,{icon:5,adim:6});
}
});
});
}); });
//下载 // 下载附件
$('#zip-download').click(function (){ $('#zip-download').click(function (){
var id = "{$article.id}"; var id = "{$article.id}";
$.ajax({ $.ajax({
@ -473,29 +428,27 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
}); });
}); });
$("#jiemi").click(function (){ // 评论分页
//判断登陆 laypage.render({
if(uid == -1){ elem: "pages", //注意,这里的 test1 是 ID不用加 # 号
layer.msg('请先登录再查看', {icon: 6}, function(){location.href = LOGIN_URL}) count: "{$comments['total']}", //数据总数,从服务端得到
return false; limit: 10,
curr: "{$page}",
//获取起始页
jump: function (obj, first) {
var page = obj.curr;
var limit = obj.limit;
var url = "{:url('article_detail',['id' => $article.id ,'ename' =>$article['cate']['ename']])}";
//首次不执行
if (!first) {
$.post("{:url('article/detail')}", { id: AID, page: page }, function () {
location.href = url + '?page=' + page + '#comment';
});
} }
var id = "{$article.id}"; },
layer.prompt(function(value, index, elem){
// alert(value); //得到value
$.post("{:url('article/jiemi')}",{id:id, art_pass:value},function (res){
if(res.code === 0){
layer.msg(res.msg,{icon:6,time:2000},function () {
parent.location.reload(); //刷新父页面注意一定要在关闭当前iframe层之前执行刷新
});
} else {
layer.msg(res.msg,{icon:5,adim:6});
}
});
layer.close(index);
});
}); });
}); });
</script> </script>
<!-- 插件hook位 --> <!-- 插件hook位 -->
@ -504,6 +457,4 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
{//图片点击放大} {//图片点击放大}
{include file="/public/images-click" /} {include file="/public/images-click" /}
{include file="/public/qr-read" /}
{/block} {/block}

View File

@ -52,6 +52,7 @@
var element = layui.element; var element = layui.element;
var toast = layui.toast; var toast = layui.toast;
var notify = layui.notify; var notify = layui.notify;
layui.cache.page = "{$jspage}"; layui.cache.page = "{$jspage}";
layui.cache.user = { layui.cache.user = {
username: "{$user.name ?? '游客'}" username: "{$user.name ?? '游客'}"

View File

@ -1,16 +1,16 @@
<footer class="footer"> <footer class="footer">
<div class="layui-container"> <div class="layui-container">
<div class="footer-col footer-col-logo"> <div class="footer-col footer-col-logo">
<img src="{$sysInfo.logo}" alt="{$sysInfo.webname}"></div> <img src="{$sysInfo.logo}" alt="{$sysInfo.webname}">
</div>
<div class="footer-col footer-col-copy"> <div class="footer-col footer-col-copy">
{:hook('ads_footer_link')} {:hook('ads_footer_link')}
<div class="copyright"> <div class="copyright">
<span class="layui-hide"> v{:config('taoler.version')}</span> <span class="layui-hide"> v{:config('taoler.version')}</span>
<p>Copyright © {:date('Y')} {$sysInfo.copyright|raw} <a href="https://www.aieok.com" target="blank" title="TaoLerCMS" class="layui-hide">TaoLerCMS</a> Copyright © {:date('Y')} {$sysInfo.copyright|raw}
<a href="https://www.aieok.com" target="blank" title="TaoLerCMS" class="layui-hide">TaoLerCMS</a>
<a href="https://beian.miit.gov.cn/" target="blank">{$sysInfo.icp}</a> <a href="https://beian.miit.gov.cn/" target="blank">{$sysInfo.icp}</a>
</p>
</div> </div>
{//websocket统计脚本} {//websocket统计脚本}
<div style="text-align:center;color:#999;font-size:14px;padding:0 0 10px;" id="online_count"></div> <div style="text-align:center;color:#999;font-size:14px;padding:0 0 10px;" id="online_count"></div>
</div> </div>
@ -31,14 +31,15 @@
</div> </div>
</div> </div>
</footer> </footer>
{:hook('callme_foot', ['id' => $article.id ?? '', 'uid' => $article.user.id ?? ''])} {:hook('callme_foot', ['id' => $article.id ?? '', 'uid' => $article.user.id ?? ''])}
{:hook('showLeftLayer')} {:hook('showLeftLayer')}
<script> <script>
var $ = layui.jquery; var $ = layui.jquery;
var articleAdd = "{:url('add_article',['cate'=>$Request.param.ename])}", var articleAdd = "{:url('add_article',['cate'=>$Request.param.ename])}",
uploads = "{:url('article/uploads')}", uploads = "{:url('article/uploads')}",
langUrl = "{:url('index/language')}", langUrl = "{:url('index/language')}",
replyNum = "{:lang('replies')}",
jumpUrl = "{:url('/jump/index/')}"; jumpUrl = "{:url('/jump/index/')}";
</script> </script>