优化模板
This commit is contained in:
parent
59db926938
commit
38ac88505b
@ -81,11 +81,11 @@
|
||||
</button>
|
||||
</script>
|
||||
<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 type="text/html" id="userInfoTpl">
|
||||
<ul>
|
||||
<li>ID: {{d.id}} 用户名:<a href="{:url('user.user/goUserHome')}?id={{ d.id }}" target="_blank">{{- d.username }}</a></li>
|
||||
<li>ID: {{d.id}} 用户名:{{d.username }}</li>
|
||||
<li>性别:{{#if (d.sex == 0) { }} <span>男</span> {{# }else if(d.sex == 1){ }} <span>女</span> {{# } }} 昵称:{{d.nickname}}</li>
|
||||
<li>电话:{{d.phone}}</li>
|
||||
<li>邮箱:{{d.email}}</li>
|
||||
@ -165,6 +165,7 @@
|
||||
title: '积分/金币',
|
||||
field: 'point',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
edit: 'text'
|
||||
},
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ class Index extends BaseController
|
||||
//置顶文章
|
||||
$artTop = Article::getArtTop(5);
|
||||
//首页文章列表,显示10个
|
||||
$artList = Article::getArtList(15);
|
||||
$artList = Article::getArtList(10);
|
||||
//热议文章
|
||||
$artHot = Article::getArtHot(10);
|
||||
|
||||
|
@ -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 (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 (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 (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);
|
||||
@ -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 (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
|
||||
-- ----------------------------
|
||||
@ -649,10 +663,14 @@ INSERT INTO `tao_user_signrule` VALUES (4, 7, 10, 1677824262, 1677824262, 0);
|
||||
DROP TABLE IF EXISTS `tao_user_viprule`;
|
||||
CREATE TABLE `tao_user_viprule` (
|
||||
`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等级',
|
||||
`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 '认证昵称',
|
||||
`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 '创建时间',
|
||||
`update_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
|
||||
-- ----------------------------
|
||||
INSERT INTO `tao_user_viprule` VALUES (1, '0-99', 0, '游民', '0', 1585476523, 1585544577, 0);
|
||||
INSERT INTO `tao_user_viprule` VALUES (2, '100-299', 1, '富农', '1', 1585476551, 1677823895, 0);
|
||||
INSERT INTO `tao_user_viprule` VALUES (3, '300-500', 2, '地主', '0', 1585545450, 1585546241, 0);
|
||||
INSERT INTO `tao_user_viprule` VALUES (4, '501-699', 3, '土豪', '0', 1585545542, 1585569657, 0);
|
||||
INSERT INTO `tao_user_viprule` VALUES (5, '700-899', 4, '霸主', '0', 1677824242, 1677824242, 0);
|
||||
INSERT INTO `tao_user_viprule` VALUES (6, '900-1000', 5, '王爷', '0', 1677824859, 1677824859, 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, 1, '100-299', '富农', '1', 50, 0, 10, 0, 1585476551, 1698740135, 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, 3, '501-699', '土豪', '0', 10, 0, 100, 0, 1585545542, 1698746583, 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, 5, '900-1000', '王爷', '0', 10, 0, 0, 0, 1677824859, 1677824859, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_user_zan
|
||||
|
@ -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;}
|
||||
.fly-detail-user{white-space: nowrap; overflow: hidden;}
|
||||
.fly-detail-user a{padding-right: 10px; font-size: 14px;}
|
||||
.fly-detail-user .guanzhu{position: absolute; right:10px; }
|
||||
|
||||
/*详情页管理工具条*/
|
||||
.detail-assist{
|
||||
|
@ -813,9 +813,9 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
|
||||
}
|
||||
|
||||
//加载编辑器
|
||||
fly.layEditor({
|
||||
elem: '.fly-editor'
|
||||
});
|
||||
// fly.layEditor({
|
||||
// elem: '.fly-editor'
|
||||
// });
|
||||
|
||||
//手机设备的简单适配 用户中心底部左侧栏导航
|
||||
var treeMobile = $('.site-tree-mobile')
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<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>
|
||||
{//附件}
|
||||
|
@ -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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<ul class="question-list">
|
||||
{article:list}
|
||||
<li>
|
||||
@ -80,17 +79,17 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use(['laypage'], function(){
|
||||
var laypage = layui.laypage;
|
||||
var $ = layui.jquery;
|
||||
|
||||
//执行一个laypage实例
|
||||
laypage.render({
|
||||
|
@ -13,21 +13,26 @@
|
||||
{/block}
|
||||
{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-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8 content detail">
|
||||
<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">
|
||||
<a class="user-avatar" href="{article:user name='link' /}">
|
||||
<img src="{article:user name='user_img' /}" alt="{article:user name='name' /}" />
|
||||
<cite>{article:auther} / </cite>
|
||||
<cite>{article:auther} </cite>
|
||||
</a>
|
||||
<span class="user-post-time" data="{$article.create_time}" style="padding-top: 5px"></span>
|
||||
/ <i class="iconfont" title="{:lang('reply')}"></i> {$article:comments_count} / <i class="iconfont" title="浏览"></i> {$pv}
|
||||
<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')}"></i>
|
||||
{$article:comments_count}
|
||||
<i class="iconfont" title="浏览"></i>
|
||||
{$pv}
|
||||
{if ($article.jie == 0) }
|
||||
<span class="layui-btn layui-btn-xs" style="background-color: #ff5722">{:lang('no finished')}</span>
|
||||
{else /}
|
||||
@ -39,17 +44,15 @@
|
||||
<hr class="layui-border-green" />
|
||||
|
||||
{//问题内容}
|
||||
<div style="margin-top: 15px; font-size: 18px; font-weight: bold; color: rgb(130, 125, 125)">问题描述:</div>
|
||||
<hr />
|
||||
<div style="margin: 10px 0; font-size: 16px; font-weight: bold; color: rgb(161, 155, 155)">问题描述:</div>
|
||||
|
||||
{:hook('taoplayerdiv')}
|
||||
<div class="detail-body photos" id="content">{article:content}</div>
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="">
|
||||
{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>
|
||||
{/notempty}
|
||||
</div>
|
||||
{/if}
|
||||
{/notempty}
|
||||
|
||||
{//解密文件}
|
||||
{empty name="passJieMi"}
|
||||
@ -67,10 +70,15 @@
|
||||
{/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 style="margin-top: 20px">本文链接:
|
||||
<a href="{$Request.domain}{$Request.url}">
|
||||
{$Request.domain}/{$Request.url}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{//评论内容}
|
||||
@ -119,7 +127,9 @@
|
||||
{volist name="$comment.children" id="vo"}
|
||||
|
||||
<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>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
|
||||
@ -146,7 +156,9 @@
|
||||
{notempty name="$vo.children"}
|
||||
{volist name="$vo.children" id="voo"}
|
||||
<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>{$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>
|
||||
@ -173,11 +185,14 @@
|
||||
{/volist}
|
||||
{/notempty}
|
||||
</div>
|
||||
|
||||
{else /}
|
||||
|
||||
<div class="detail-body jieda-body photos">
|
||||
<i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i>
|
||||
评论解密后查看
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
</li>
|
||||
@ -192,12 +207,11 @@
|
||||
<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 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 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>
|
||||
@ -231,6 +245,7 @@
|
||||
<!--底部栏-->
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
@ -250,66 +265,19 @@
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
let taonystatus = "{:hook('taonystatus') ? 1 : 0} ";
|
||||
|
||||
layui.use(["fly", "face", "colorpicker", "laypage"], function () {
|
||||
layui.use(["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;
|
||||
|
||||
|
||||
//tpl模板给发布时间赋值
|
||||
$("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 });
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
let AID = "{$article.id}";
|
||||
let LOGIN_URL = "{:url('login/index')}";
|
||||
|
||||
// 评论接口
|
||||
function comment(data){
|
||||
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;
|
||||
}
|
||||
var index = layer.load(1);
|
||||
@ -339,7 +307,7 @@
|
||||
'<input type="hidden" name="article_id" value="{$article.id}">' +
|
||||
'<input name="pid" value="'+ pid +'" 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>' +
|
||||
'</div>' +
|
||||
'</form>';
|
||||
@ -362,14 +330,6 @@
|
||||
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 () {
|
||||
var id = $(this).data('id');
|
||||
@ -381,6 +341,7 @@
|
||||
content: "{:url('comment/edit')}" + '?id=' + id
|
||||
});
|
||||
});
|
||||
|
||||
// 删除评论
|
||||
$(".comment-del").on('click', function () {
|
||||
var id = $(this).data('id');
|
||||
@ -395,7 +356,6 @@
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 评论分页
|
||||
laypage.render({
|
||||
@ -408,10 +368,9 @@
|
||||
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 () {
|
||||
$.post("{:url('article/detail')}", { id: AID, page: page }, function () {
|
||||
location.href = url + '?page=' + page + '#flyReply';
|
||||
});
|
||||
}
|
||||
@ -427,20 +386,19 @@
|
||||
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})
|
||||
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){
|
||||
$.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层之前执行刷新
|
||||
@ -449,7 +407,7 @@
|
||||
layer.msg(res.msg,{icon:5,adim:6});
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
{block name="column"}{include file="/public/column" /}{/block}
|
||||
|
||||
{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-row layui-col-space15">
|
||||
<div class="layui-col-md8">
|
||||
@ -111,35 +111,31 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
||||
<script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script>
|
||||
<script>
|
||||
<script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script>
|
||||
<script>
|
||||
layui.use(['laypage'], function(){
|
||||
var laypage = layui.laypage;
|
||||
var $ = layui.jquery;
|
||||
|
||||
//执行一个laypage实例
|
||||
laypage.render({
|
||||
elem: 'pages' //注意,这里的 test1 是 ID,不用加 # 号
|
||||
,count: "{$artList['total']}" //数据总数,从服务端得到
|
||||
,limit: "{$artList['per_page']}"
|
||||
,curr : "{$artList['current_page']}"
|
||||
|
||||
//获取起始页
|
||||
,jump: function(obj, first){
|
||||
|
||||
//首次不执行
|
||||
if(!first){
|
||||
var page = obj.curr;
|
||||
location.href ="{$path}/"+page+'.html';
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
{/block}
|
@ -3,8 +3,8 @@
|
||||
{block name="title"}{$article.title} - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$article.keywords ?: $article.title}{/block}
|
||||
{block name="description"}{$article.title},{$article.description}{/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="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="ogimage"}<meta property="og:image" content="{:getOnepic($article.content)}"/>{/block}
|
||||
{block name="meta"}
|
||||
<!-- 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>
|
||||
<!-- 特效丶样式 -->
|
||||
<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>window.ViewImage && ViewImage.init('.post-content img');</script>
|
||||
{/block}
|
||||
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
|
||||
<!-- 内容 -->
|
||||
{block name="content"}
|
||||
<main class="py-2 py-md-2 pb-3" style="transform: none">
|
||||
<div class="layui-container" style="transform: none">
|
||||
<div class="layui-row layui-col-space15" style="transform: none">
|
||||
<main class="py-2 py-md-2 pb-3">
|
||||
<div class="layui-container">
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8" itemscope itemType="">
|
||||
<div class="post card">
|
||||
<section class="card-body">
|
||||
<div class="post-header border-bottom mb-4 pb-4">
|
||||
<h1 class="h3 mb-3" itemprop="headline">{article:title /}</h1>
|
||||
<div class="meta d-flex align-items-center text-xs text-muted">
|
||||
<div>
|
||||
<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="{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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-auto text-sm yincang">
|
||||
<span class="mx-1">
|
||||
<small>阅读 {article:pv /} 次</small>
|
||||
</span>
|
||||
<span class="mx-1"><small>阅读 {article:pv /} 次</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-theme bg-primary"></div>
|
||||
@ -54,16 +53,13 @@
|
||||
<article class="post-content detail-body" itemprop="articleBody" view-image>
|
||||
{article:content}
|
||||
</article>
|
||||
{//文章末尾}
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="">
|
||||
<!-- 文章末尾 -->
|
||||
{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>
|
||||
{/notempty}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{//解密文件}
|
||||
{/notempty}
|
||||
<!-- 解密文件 -->
|
||||
{empty name="passJieMi"}
|
||||
{if($article.read_type == 1)}
|
||||
<div id="jiemi" style="text-align:center">
|
||||
@ -71,7 +67,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
{/empty}
|
||||
|
||||
<!-- 标签 -->
|
||||
{notempty name="tags"}
|
||||
<div style="margin-top: 15px">标签
|
||||
{volist name="tags" id="vo" }
|
||||
@ -82,17 +78,16 @@
|
||||
<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 style="margin-top: 20px;">
|
||||
本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a>
|
||||
</div>
|
||||
<div class="detail-zan">
|
||||
<span class="jieda-zan" type="zan" id="article-zan">
|
||||
点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em>
|
||||
</span>
|
||||
<span class="jieda-zan" type="zan" id="article-zan">点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em></span>
|
||||
{volist name="userZanList" id="vo" }
|
||||
<span><img src="{$vo.userImg}"></span>
|
||||
{/volist}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<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="{:hook('qqKefu','dashang')}" data-title="赞赏支持一下站长" data-desc="微信赞赏扫码" class="single-popup shangzan text-muted text-xs">赞赏支持</a>
|
||||
@ -101,10 +96,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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"># 下一篇: {$next|raw}</span>
|
||||
</div>
|
||||
<!-- 相关文章 -->
|
||||
{notempty name="relationArticle"}
|
||||
<section class="list-related">
|
||||
<div class="content-related card">
|
||||
@ -113,7 +110,9 @@
|
||||
<div class="list list-dots my-n2">
|
||||
{volist name="relationArticle" id="vo"}
|
||||
<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>
|
||||
{/volist}
|
||||
</div>
|
||||
@ -122,6 +121,7 @@
|
||||
</section>
|
||||
{/notempty}
|
||||
|
||||
<!-- 评论 -->
|
||||
<section class="comments">
|
||||
<div class="card">
|
||||
<div class="card-body pt-4">
|
||||
@ -132,14 +132,12 @@
|
||||
{article:comment}
|
||||
<li data-id="{comment:id /}" class="jieda-daan">
|
||||
<div class="detail-about detail-about-reply">
|
||||
<a class="fly-avatar" href="{comment:ulink /}">
|
||||
<img src="{comment:uimg /}" alt="{comment:uname}">
|
||||
</a>
|
||||
<a class="fly-avatar" href="{comment:ulink /}"><img src="{comment:uimg /}" alt="{comment:uname}"></a>
|
||||
<div class="fly-detail-user">
|
||||
<a href="{comment:ulink /}" class="fly-link">
|
||||
<cite>{comment:uname /}</cite>
|
||||
</a>
|
||||
{if condition="$article.user_id eq $comment.user_id"}<span>({:lang('poster')})</span>{/if}
|
||||
<a href="{comment:ulink /}" class="fly-link"><cite>{comment:uname /}</cite></a>
|
||||
{if condition="$article.user_id eq $comment.user_id"}
|
||||
<span>({:lang('poster')})</span>
|
||||
{/if}
|
||||
<span>{comment:usign /}</span>
|
||||
</div>
|
||||
<div class="detail-hits">
|
||||
@ -147,8 +145,8 @@
|
||||
</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="jieda-reply">
|
||||
{eq name="comment.delete_time" value="0"}
|
||||
@ -169,7 +167,9 @@
|
||||
{notempty name="$comment.children"}
|
||||
{volist name="$comment.children" id="vo"}
|
||||
<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>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
|
||||
@ -195,7 +195,9 @@
|
||||
{notempty name="$vo.children"}
|
||||
{volist name="$vo.children" id="voo"}
|
||||
<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>{$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>
|
||||
@ -249,7 +251,7 @@
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<a name="comment"></a>
|
||||
<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 class="layui-form-item que-comments">
|
||||
@ -265,6 +267,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
<div class="sidebar layui-col-md4 d-none d-lg-block">
|
||||
<div class="theiaStickySidebar">
|
||||
@ -275,11 +278,11 @@
|
||||
<div>
|
||||
<div class="widget-author-cover">
|
||||
<div class="media media-21x9">
|
||||
<div class="media-content" style="background-image:url(/view/common/blog/image/user-bg.jpg)">
|
||||
</div>
|
||||
<div class="media-content" style="background-image:url(/view/common/blog/image/user-bg.jpg)"></div>
|
||||
</div>
|
||||
<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>
|
||||
@ -288,15 +291,25 @@
|
||||
<div class="h6 mb-2">{$article.user.name}</div>
|
||||
<div class="text-xs text-secondary mb-4">本站内容禁止任何人采集</div>
|
||||
<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="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 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="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>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
{//广告}
|
||||
<!--博客详情广告赞助位-->
|
||||
{:hook('ads_blog_detail_rimg')}
|
||||
@ -315,14 +328,14 @@
|
||||
<a href="{$vo.url}" target="_blank">{$vo.title}</a>
|
||||
</div>
|
||||
<div class="list-footer">
|
||||
<div class="text-muted text-xs"><time class="d-inline-block">{$vo.create_time|date='Y-m-d'}</time>
|
||||
</div>
|
||||
<div class="text-muted text-xs"><time class="d-inline-block">{$vo.create_time|date='Y-m-d'}</time></div>
|
||||
</div>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
{//标签}
|
||||
{if count($hotTag) > 0}
|
||||
<dl class="function" id="rongkeji_retags">
|
||||
@ -347,6 +360,7 @@
|
||||
|
||||
{//crud管理模块}
|
||||
{include file="/public/crud" /}
|
||||
|
||||
</main>
|
||||
|
||||
{include file="public/menu" /}
|
||||
@ -356,8 +370,9 @@
|
||||
{block name="script"}
|
||||
|
||||
<script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script>
|
||||
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
collection = "{:url('collection/')}",
|
||||
articleJieset = "{:url('Article/jieset')}",
|
||||
articleDelete = "{:url('Article/delete')}",
|
||||
@ -368,34 +383,22 @@ var collectionFind = "{:url('Collection/find')}",
|
||||
commentJiedaDelete = "{:url('Comment/jiedaDelete')}",
|
||||
langCollection = "{:lang('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
|
||||
,form = layui.form
|
||||
,fly = layui.fly
|
||||
,colorpicker = layui.colorpicker
|
||||
,laytpl = layui.laytpl
|
||||
,uid = layui.cache.user.uid
|
||||
,laypage = layui.laypage;
|
||||
var id = "{$article.id}";
|
||||
let LOGIN_URL = "{:url('login/index')}";
|
||||
|
||||
//tpl模板给发布时间赋值
|
||||
$('div.detail-hits').children('span.post-time').each(function(){
|
||||
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);
|
||||
});
|
||||
let uid = layui.cache.user.uid;
|
||||
let id = "{$article.id}";
|
||||
let LOGIN_URL = "{:url('login/index')}";
|
||||
|
||||
//文章点赞
|
||||
$("#article-zan").on('click',function(){
|
||||
//判断登陆
|
||||
if(uid == -1){
|
||||
layer.msg('请登录再点赞', {icon: 6}, function(){location.href = login})
|
||||
layer.msg('请登录再点赞', {icon: 6}, function(){location.href = LOGIN_URL})
|
||||
return false;
|
||||
}
|
||||
$.post("{:url('article/userZanArticle')}",{article_id:id,type:1},function(data){
|
||||
@ -409,36 +412,47 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
})
|
||||
});
|
||||
|
||||
//预定义颜色项
|
||||
colorpicker.render({
|
||||
elem: '#color'
|
||||
,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(user-comment)',function (data){
|
||||
comment(data.field);
|
||||
});
|
||||
// 提交回复
|
||||
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 {
|
||||
layer.open({content:data.msg,icon:5,adim:6});
|
||||
}
|
||||
}
|
||||
});
|
||||
toast.error({title: "失败消息", message: res.msg});
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
// 评论接口
|
||||
function comment(data){
|
||||
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;
|
||||
}
|
||||
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 name="pid" value="'+ pid +'" 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>' +
|
||||
'</div>' +
|
||||
'</form>';
|
||||
@ -481,50 +495,41 @@ 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);
|
||||
//解密
|
||||
$("#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){
|
||||
$.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) {
|
||||
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
|
||||
$('.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
|
||||
});
|
||||
});
|
||||
// 删除评论
|
||||
$(".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});
|
||||
//下载
|
||||
$('#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])}";
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 评论分页
|
||||
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>
|
||||
|
||||
<!-- 插件hook位 -->
|
||||
|
@ -65,7 +65,7 @@
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<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 class="layui-form-item">
|
||||
|
@ -17,8 +17,6 @@
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8">
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
|
||||
|
||||
<section id="main" class="list-home list-grid list-grid-padding">
|
||||
{article:list}
|
||||
<article class="list-item block card-plain">
|
||||
@ -79,7 +77,6 @@
|
||||
<script>
|
||||
layui.use(['laypage'], function(){
|
||||
var laypage = layui.laypage;
|
||||
|
||||
//执行一个laypage实例
|
||||
laypage.render({
|
||||
elem: 'pages' //注意,这里的 test1 是 ID,不用加 # 号
|
||||
|
@ -12,34 +12,30 @@
|
||||
{/block}
|
||||
{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-md12 content detail">
|
||||
<div class="fly-panel detail-box">
|
||||
{//标题}
|
||||
<h1 style="color:{$article.title_color ?: '#333'}; margin:10px 5px 15px 5px; text-align: center;">{$article.title}</h1>
|
||||
<h1 style="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;">
|
||||
<span>{$article.cate.catename} /</span>
|
||||
<span>{$article.user.name} /</span>
|
||||
<span class="post-time" style="padding-top: 5px;" data="{$article.create_time}">{$article.create_time}</span>
|
||||
<span>/ <i class="iconfont" title="浏览"></i> {$pv}</span>
|
||||
<span>{$article.cate.catename}</span>
|
||||
<span>{$article.user.name}</span>
|
||||
<span class="post-time" style="padding-top: 5px;" data="{$article.create_time}">{$article.create_time} </span>
|
||||
<span><i class="iconfont" title="浏览"></i> {article:pv}</span>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="margin-bottom: 25px">
|
||||
|
||||
{// 内容}
|
||||
{:hook('taoplayerdiv')}
|
||||
<div class="detail-body photos" style="font-size: 18px;line-height: 200%;" 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="detail-body photos" style="font-size: 18px;line-height: 200%;" id="content">
|
||||
{$article.content|raw}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{//解密文件}
|
||||
{empty name="passJieMi"}
|
||||
@ -57,10 +53,13 @@
|
||||
{/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 style="margin-top: 20px;">本文链接:
|
||||
<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{//crud管理模块}
|
||||
@ -72,6 +71,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
@ -87,165 +87,8 @@
|
||||
commentJiedaDelete = "{:url('Comment/jiedaDelete')}",
|
||||
langCollection = "{:lang('collection')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
|
||||
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>
|
||||
|
||||
<!-- 插件hook位 -->
|
||||
|
@ -24,7 +24,7 @@
|
||||
<img src="{$Request.domain}{$art.user.user_img}" alt="{$art.user.name}">
|
||||
</a>
|
||||
<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>
|
||||
|
||||
<div class="fly-list-info">
|
||||
@ -35,14 +35,13 @@
|
||||
<cite>{$art.user.nickname ?: $art.user.name}</cite>
|
||||
<i>{$art.create_time|date='Y-m-d'}</i>
|
||||
</a>
|
||||
|
||||
{//图标}
|
||||
<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_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.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="浏览"></i> {$art.pv}</span>
|
||||
<span class="fly-list-nums"><i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}</span>
|
||||
</div>
|
||||
@ -72,12 +71,13 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use(['laypage'], function(){
|
||||
@ -92,13 +92,13 @@
|
||||
|
||||
//获取起始页
|
||||
,jump: function(obj, first){
|
||||
|
||||
//首次不执行
|
||||
if(!first){
|
||||
window.location.href = '{$path}/'+obj.curr+'.html'; //跳转
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
{/block}
|
@ -20,8 +20,10 @@
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8 content detail">
|
||||
<div class="fly-panel detail-box">
|
||||
|
||||
{//标题}
|
||||
<h1 style="color:{article:title_color /};">{article:title /}</h1>
|
||||
<h1>{article:title /}</h1>
|
||||
|
||||
{//图标}
|
||||
<div class="fly-detail-info">
|
||||
<span class="layui-badge layui-bg-green fly-detail-column">
|
||||
@ -31,8 +33,12 @@
|
||||
{article:cate name="name" /}
|
||||
{/if}
|
||||
</span>
|
||||
{if ($article.is_top == 1)}<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}
|
||||
{if ($article.is_top == 1)}
|
||||
<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 class="fly-list-nums">
|
||||
<a href="#comment">
|
||||
@ -41,35 +47,34 @@
|
||||
<i class="iconfont" title="浏览"></i>{article:pv /}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{//作者}
|
||||
<div class="detail-about">
|
||||
<a class="fly-avatar" href="{article:user name='link' /}">
|
||||
<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>
|
||||
<div class="fly-detail-user">
|
||||
<a href="{article:user name='link' /}" class="fly-link">
|
||||
<cite>{article:auther}</cite>
|
||||
</a>
|
||||
<span class="layui-btn layui-btn-xs guanzhu" >关注</span>
|
||||
<a href="{article:user name='link' /}" class="fly-link"><cite>{article:auther}</cite></a>
|
||||
</div>
|
||||
<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)}
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
{//内容}
|
||||
{:hook('taoplayerdiv')}
|
||||
<div class="detail-body photos" id="content">{article:content}</div>
|
||||
{//下载}
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="">
|
||||
{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>
|
||||
{/notempty}
|
||||
</div>
|
||||
{/if}
|
||||
{/notempty}
|
||||
|
||||
{//解密文件}
|
||||
{empty name="passJieMi"}
|
||||
@ -87,14 +92,17 @@
|
||||
{/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 class="detail-zan">
|
||||
<span class="jieda-zan" type="zan" id="article-zan">
|
||||
点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em>
|
||||
</span>
|
||||
<!-- 点赞列表 -->
|
||||
{volist name="userZanList" id="vo" }
|
||||
<span><img src="{$vo.userImg}"></span>
|
||||
{/volist}
|
||||
@ -108,11 +116,11 @@
|
||||
<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 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 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>
|
||||
</div>
|
||||
</div>
|
||||
@ -122,28 +130,24 @@
|
||||
{//评论内容}
|
||||
<div class="fly-panel detail-box" id="flyReply">
|
||||
<span style="font-size:18px;">评论 {$article.comments_count}</span>
|
||||
|
||||
<ul class="jieda" id="jieda">
|
||||
{article:comment}
|
||||
<li data-id="{comment:id /}" class="jieda-daan">
|
||||
<div class="detail-about detail-about-reply">
|
||||
<a class="fly-avatar" href="{comment:ulink /}">
|
||||
<img src="{comment:uimg /}" alt="{comment:uname}">
|
||||
</a>
|
||||
<a class="fly-avatar" href="{comment:ulink /}"><img src="{comment:uimg /}" alt="{comment:uname}"></a>
|
||||
<div class="fly-detail-user">
|
||||
<a href="{comment:ulink /}" class="fly-link">
|
||||
<cite>{comment:uname /}</cite>
|
||||
</a>
|
||||
{if condition="$article.user_id eq $comment.user_id"}<span>({:lang('poster')})</span>{/if}
|
||||
<a href="{comment:ulink /}" class="fly-link"><cite>{comment:uname /}</cite></a>
|
||||
{if condition="$article.user_id eq $comment.user_id"}
|
||||
<span>({:lang('poster')})</span>
|
||||
{/if}
|
||||
<span>{comment:usign /}</span>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
{//加密未解密评论不可查看}
|
||||
{if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))}
|
||||
|
||||
<div class="detail-body jieda-body photos">{comment:content /}</div>
|
||||
<div class="jieda-reply">
|
||||
{eq name="comment.delete_time" value="0"}
|
||||
@ -163,9 +167,10 @@
|
||||
{// 第二层回复}
|
||||
{notempty name="$comment.children"}
|
||||
{volist name="$comment.children" id="vo"}
|
||||
|
||||
<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>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
|
||||
@ -183,7 +188,6 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/eq}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -192,7 +196,9 @@
|
||||
{notempty name="$vo.children"}
|
||||
{volist name="$vo.children" id="voo"}
|
||||
<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>{$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>
|
||||
@ -215,7 +221,6 @@
|
||||
</div>
|
||||
{/volist}
|
||||
{/notempty}
|
||||
|
||||
{/volist}
|
||||
{/notempty}
|
||||
</div>
|
||||
@ -229,10 +234,8 @@
|
||||
</li>
|
||||
{/article:comment}
|
||||
</ul>
|
||||
|
||||
<div style="text-align: center" id="pages"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{//右栏}
|
||||
@ -246,21 +249,20 @@
|
||||
</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>
|
||||
<span class="layui-badge layui-bg-green">回答 {$article.user.comments_count}</span>
|
||||
<span class="layui-badge layui-bg-green">发表 {$article.user.article_count}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 联系方式 -->
|
||||
{:hook('callme_show', ['id' => $article.id, 'uid' => $article.user.id])}
|
||||
|
||||
<!-- 插件hook位 -->
|
||||
{:hook('addonhook_detail')}
|
||||
|
||||
</div>
|
||||
|
||||
{//crud管理模块}
|
||||
<!-- crud管理模块 -->
|
||||
{include file="/public/crud" /}
|
||||
</div>
|
||||
<!--底部栏-->
|
||||
@ -270,7 +272,7 @@
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
var collectionFind = "{:url('collection/find')}",
|
||||
var collectionFind = "{:url('collection/find')}",
|
||||
collection = "{:url('collection/')}",
|
||||
articleJieset = "{:url('Article/jieset')}",
|
||||
articleDelete = "{:url('Article/delete')}",
|
||||
@ -283,95 +285,43 @@ var collectionFind = "{:url('collection/find')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
let taonystatus = "{:hook('taonystatus') ? 1 : 0} ";
|
||||
|
||||
layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
layui.use(['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;
|
||||
var id = "{$article.id}";
|
||||
let LOGIN_URL = "{:url('login/index')}";
|
||||
|
||||
//tpl模板给发布时间赋值
|
||||
$('div.detail-hits').children('span.post-time').each(function(){
|
||||
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);
|
||||
});
|
||||
let AID = "{$article.id}";
|
||||
let LOGIN_URL = "{:url('login/index')}";
|
||||
|
||||
//文章点赞
|
||||
$("#article-zan").on('click',function(){
|
||||
//判断登陆
|
||||
if(uid == -1){
|
||||
layer.msg('请登录再点赞', {icon: 6}, function(){location.href = login})
|
||||
layer.msg('请登录再点赞', {icon: 6}, function(){location.href = LOGIN_URL})
|
||||
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){
|
||||
layer.msg(data.msg,{icon:6,time:2000},function () {
|
||||
location.reload(true);
|
||||
});
|
||||
layer.msg(data.msg,{icon:6,time:2000},function () { location.reload(true) });
|
||||
} else {
|
||||
layer.msg(data.msg,{icon:6,adim:6});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//预定义颜色项
|
||||
colorpicker.render({
|
||||
elem: '#color'
|
||||
,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});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// 评论
|
||||
form.on('submit(user-comment)',function (data){
|
||||
comment(data.field);
|
||||
});
|
||||
|
||||
// 评论接口
|
||||
function comment(data){
|
||||
if (uid == -1) {
|
||||
layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = "{:url('login/index')}"});
|
||||
// 提交评论
|
||||
form.on('submit(submit-user-comment)', function(data){
|
||||
comment(data.field);
|
||||
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 (){
|
||||
var pid = $(this).attr('data-pid');
|
||||
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 name="pid" value="'+ pid +'" 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>' +
|
||||
'</div>' +
|
||||
'</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 () {
|
||||
var id = $(this).data('id');
|
||||
@ -423,6 +355,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
content: "{:url('comment/edit')}" + '?id=' + id
|
||||
});
|
||||
});
|
||||
|
||||
// 删除评论
|
||||
$(".comment-del").on('click', function () {
|
||||
var id = $(this).data('id');
|
||||
@ -437,30 +370,52 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 评论分页
|
||||
laypage.render({
|
||||
elem: "pages", //注意,这里的 test1 是 ID,不用加 # 号
|
||||
count: "{$comments['total']}", //数据总数,从服务端得到
|
||||
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 + '#comment';
|
||||
// 评论接口
|
||||
function comment(data){
|
||||
if (uid == -1) {
|
||||
layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = LOGIN_URL});
|
||||
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});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 解密内容
|
||||
$("#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 (){
|
||||
var id = "{$article.id}";
|
||||
$.ajax({
|
||||
@ -473,29 +428,27 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
});
|
||||
});
|
||||
|
||||
$("#jiemi").click(function (){
|
||||
//判断登陆
|
||||
if(uid == -1){
|
||||
layer.msg('请先登录再查看', {icon: 6}, function(){location.href = LOGIN_URL})
|
||||
return false;
|
||||
// 评论分页
|
||||
laypage.render({
|
||||
elem: "pages", //注意,这里的 test1 是 ID,不用加 # 号
|
||||
count: "{$comments['total']}", //数据总数,从服务端得到
|
||||
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>
|
||||
|
||||
<!-- 插件hook位 -->
|
||||
@ -504,6 +457,4 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
|
||||
{include file="/public/qr-read" /}
|
||||
|
||||
{/block}
|
@ -52,6 +52,7 @@
|
||||
var element = layui.element;
|
||||
var toast = layui.toast;
|
||||
var notify = layui.notify;
|
||||
|
||||
layui.cache.page = "{$jspage}";
|
||||
layui.cache.user = {
|
||||
username: "{$user.name ?? '游客'}"
|
||||
|
@ -1,16 +1,16 @@
|
||||
<footer class="footer">
|
||||
<div class="layui-container">
|
||||
<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">
|
||||
{:hook('ads_footer_link')}
|
||||
<div class="copyright">
|
||||
<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>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{//websocket统计脚本}
|
||||
<div style="text-align:center;color:#999;font-size:14px;padding:0 0 10px;" id="online_count"></div>
|
||||
</div>
|
||||
@ -31,14 +31,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{:hook('callme_foot', ['id' => $article.id ?? '', 'uid' => $article.user.id ?? ''])}
|
||||
{:hook('showLeftLayer')}
|
||||
|
||||
<script>
|
||||
var $ = layui.jquery;
|
||||
var articleAdd = "{:url('add_article',['cate'=>$Request.param.ename])}",
|
||||
uploads = "{:url('article/uploads')}",
|
||||
langUrl = "{:url('index/language')}",
|
||||
replyNum = "{:lang('replies')}",
|
||||
jumpUrl = "{:url('/jump/index/')}";
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user