优化前端html
This commit is contained in:
parent
8c70a21d43
commit
0aec4ca54c
@ -69,7 +69,7 @@ class Article extends BaseController
|
|||||||
//通用右栏
|
//通用右栏
|
||||||
$ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select();
|
$ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select();
|
||||||
|
|
||||||
View::assign(['type'=>$type,'artList'=>$artList,'artHot'=>$artHot,'ad_cate'=>$ad_cate,'ad_comm'=>$ad_comm]);
|
View::assign(['type'=>$type,'artList'=>$artList,'artHot'=>$artHot,'ad_cate'=>$ad_cate,'ad_comm'=>$ad_comm,'jspage'=>'jie']);
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class Article extends BaseController
|
|||||||
//通用右栏
|
//通用右栏
|
||||||
$ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select();
|
$ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select();
|
||||||
|
|
||||||
View::assign(['article'=>$artDetail,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_article,'ad_comm'=>$ad_comm,$download]);
|
View::assign(['article'=>$artDetail,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_article,'ad_comm'=>$ad_comm,$download,'jspage'=>'jie']);
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,6 +178,7 @@ class Article extends BaseController
|
|||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
View::assign(['jspage'=>'jie']);
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +224,7 @@ class Article extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
View::assign(['article'=>$article,'tags'=>$tags]);
|
View::assign(['article'=>$article,'tags'=>$tags,'jspage'=>'jie']);
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
70
app/index/controller/Doc.php
Normal file
70
app/index/controller/Doc.php
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\index\controller;
|
||||||
|
|
||||||
|
use app\common\controller\BaseController;
|
||||||
|
use think\facade\View;
|
||||||
|
use think\facade\Request;
|
||||||
|
use think\facade\Db;
|
||||||
|
use think\facade\Cache;
|
||||||
|
use app\common\model\Article;
|
||||||
|
use app\common\model\User;
|
||||||
|
use app\common\model\Cate;
|
||||||
|
use app\common\model\Comment;
|
||||||
|
|
||||||
|
|
||||||
|
class Doc extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
public function timeline()
|
||||||
|
{
|
||||||
|
$types = input('type');
|
||||||
|
//幻灯
|
||||||
|
$sliders = Cache::get('slider');
|
||||||
|
if(!$sliders){
|
||||||
|
$sliders = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',1)->whereTime('slid_over','>=',time())->select();
|
||||||
|
Cache::set('slider',$sliders,3600);
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新日志
|
||||||
|
$timeline = Db::name('time_line')->where('delete_time',0)->order('create_time','desc')->select();
|
||||||
|
|
||||||
|
//热议文章
|
||||||
|
$artHot = Article::field('id,title')->withCount('comments')->where(['status'=>1,'delete_time'=>0])->whereTime('create_time', 'year')->order('comments_count','desc')->limit(10)->select();
|
||||||
|
|
||||||
|
//首页赞助
|
||||||
|
$ad_index = Cache::get('adindex');
|
||||||
|
if(!$ad_index){
|
||||||
|
$ad_index = Db::name('slider')->where(['slid_status'=>1,'delete_time'=>0,'slid_type'=>3])->whereTime('slid_over','>=',time())->select();
|
||||||
|
Cache::set('adindex',$ad_index,3600);
|
||||||
|
}
|
||||||
|
|
||||||
|
//首页右栏
|
||||||
|
$ad_comm = Cache::get('adcomm');
|
||||||
|
if(!$ad_comm){
|
||||||
|
$ad_comm = Db::name('slider')->where(['slid_status'=>1,'delete_time'=>0,'slid_type'=>2])->whereTime('slid_over','>=',time())->select();
|
||||||
|
Cache::set('adcomm',$ad_comm,3600);
|
||||||
|
}
|
||||||
|
|
||||||
|
//友情链接
|
||||||
|
$friend_links = Cache::get('flinks');
|
||||||
|
if(!$friend_links){
|
||||||
|
$friend_links = Db::name('slider')->where(['slid_status'=>1,'delete_time'=>0,'slid_type'=>6])->whereTime('slid_over','>=',time())->field('slid_name,slid_href')->select();
|
||||||
|
Cache::set('flinks',$friend_links,3600);
|
||||||
|
}
|
||||||
|
|
||||||
|
$vs = [
|
||||||
|
'slider' => $sliders,
|
||||||
|
'timeline' => $timeline,
|
||||||
|
'artHot' => $artHot,
|
||||||
|
'type' => $types,
|
||||||
|
'ad_index' => $ad_index,
|
||||||
|
'ad_comm' => $ad_comm,
|
||||||
|
'flinks' => $friend_links,
|
||||||
|
'jspage' => '',
|
||||||
|
];
|
||||||
|
View::assign($vs);
|
||||||
|
|
||||||
|
return View::fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -64,6 +64,7 @@ class Index extends BaseController
|
|||||||
'ad_index' => $ad_index,
|
'ad_index' => $ad_index,
|
||||||
'ad_comm' => $ad_comm,
|
'ad_comm' => $ad_comm,
|
||||||
'flinks' => $friend_links,
|
'flinks' => $friend_links,
|
||||||
|
'jspage' => '',
|
||||||
];
|
];
|
||||||
View::assign($vs);
|
View::assign($vs);
|
||||||
|
|
||||||
@ -98,7 +99,7 @@ class Index extends BaseController
|
|||||||
$artHot = Article::getArtHot(10);
|
$artHot = Article::getArtHot(10);
|
||||||
|
|
||||||
View::assign($searchs);
|
View::assign($searchs);
|
||||||
View::assign(['flinks'=>$friend_links,'artHot'=>$artHot]);
|
View::assign(['flinks'=>$friend_links,'artHot'=>$artHot,'jspage'=>'']);
|
||||||
return View::fetch('search');
|
return View::fetch('search');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,14 +13,20 @@ use think\facade\Cache;
|
|||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
use app\common\model\User;
|
use app\common\model\User;
|
||||||
|
|
||||||
|
|
||||||
class Login extends BaseController
|
class Login extends BaseController
|
||||||
{
|
{
|
||||||
//已登陆检测
|
//已登陆中间件检测
|
||||||
protected $middleware = [
|
protected $middleware = [
|
||||||
'logedcheck' => ['except' => ['index'] ]
|
'logedcheck' => ['except' => ['index'] ]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
//给模板中JScace文件赋值
|
||||||
|
protected function initialize()
|
||||||
|
{
|
||||||
|
parent::initialize();
|
||||||
|
View::assign(['jspage'=>'user']);
|
||||||
|
}
|
||||||
|
|
||||||
//用户登陆
|
//用户登陆
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
@ -75,6 +81,7 @@ class Login extends BaseController
|
|||||||
return Msgres::error($res);
|
return Msgres::error($res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return View::fetch('login');
|
return View::fetch('login');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +110,6 @@ class Login extends BaseController
|
|||||||
}
|
}
|
||||||
return json($res);
|
return json($res);
|
||||||
}
|
}
|
||||||
//加载注册模板
|
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{extend name="public/base" /}
|
{extend name="public/base" /}
|
||||||
|
|
||||||
{block name="title"}发表帖子{/block}
|
{block name="title"}发表帖子{/block}
|
||||||
{block name="column"}{/block}
|
{block name="column"}{/block}
|
||||||
{block name="content"}
|
{block name="content"}
|
||||||
@ -141,20 +142,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
layui.cache.page = 'jie';
|
layui.use(['fly','form','colorpicker','upload'], function(){
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use(['fly','form','colorpicker','upload'], function(){
|
|
||||||
var $ = layui.$
|
var $ = layui.$
|
||||||
,fly = layui.fly
|
,fly = layui.fly
|
||||||
,form = layui.form
|
,form = layui.form
|
||||||
@ -271,4 +259,3 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
{block name="cachepage"}jie{/block}
|
|
@ -97,20 +97,7 @@
|
|||||||
{/block}
|
{/block}
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
layui.cache.page = 'jie';
|
layui.use(['laypage'], function(){
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use(['fly','laypage'], function(){
|
|
||||||
var laypage = layui.laypage;
|
var laypage = layui.laypage;
|
||||||
|
|
||||||
//执行一个laypage实例
|
//执行一个laypage实例
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{extend name="public/base" /}
|
{extend name="public/base" /}
|
||||||
|
|
||||||
{block name="title"}{$article.title}-{$sysInfo.webname}{/block}
|
{block name="title"}{$article.title}-{$sysInfo.webname}{/block}
|
||||||
{block name="keywords"}{$article.title},{$article.tags}{/block}
|
{block name="keywords"}{$article.title},{$article.tags}{/block}
|
||||||
{block name="description"}{$article.title},{:getArtContent($article.content)}{/block}
|
{block name="description"}{$article.title},{:getArtContent($article.content)}{/block}
|
||||||
@ -216,31 +217,18 @@
|
|||||||
{/block}
|
{/block}
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
var collectionFind = "{:url('index/Collection/find')}",
|
var collectionFind = "{:url('Collection/find')}",
|
||||||
articleJieset = "{:url('index/Article/jieset')}",
|
articleJieset = "{:url('Article/jieset')}",
|
||||||
articleDelete = "{:url('index/Article/delete')}",
|
articleDelete = "{:url('Article/delete')}",
|
||||||
collection = "{:url('index/Collection/')}",
|
collection = "{:url('Collection/')}",
|
||||||
commentJiedaZan = "{:url('index/Comment/jiedaZan')}",
|
commentJiedaZan = "{:url('Comment/jiedaZan')}",
|
||||||
commentJiedaCai = "{:url('index/Comment/jiedaCai')}",
|
commentJiedaCai = "{:url('Comment/jiedaCai')}",
|
||||||
commentGetDa = "{:url('index/Comment/getDa')}",
|
commentGetDa = "{:url('Comment/getDa')}",
|
||||||
commentUpdateDa = "{:url('index/Comment/updateDa')}",
|
commentUpdateDa = "{:url('Comment/updateDa')}",
|
||||||
commentJiedaDelete = "{:url('index/Comment/jiedaDelete')}",
|
commentJiedaDelete = "{:url('Comment/jiedaDelete')}",
|
||||||
langCollection = "{:lang('collection')}",
|
langCollection = "{:lang('collection')}",
|
||||||
langCancelCollection = "{:lang('cancel collection')}";
|
langCancelCollection = "{:lang('cancel collection')}";
|
||||||
layui.cache.page = 'jie';
|
layui.use(['fly', 'face','colorpicker'], function(){
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use(['fly', 'face','colorpicker'], function(){
|
|
||||||
var $ = layui.$
|
var $ = layui.$
|
||||||
,fly = layui.fly
|
,fly = layui.fly
|
||||||
,colorpicker = layui.colorpicker;
|
,colorpicker = layui.colorpicker;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{extend name="public/base" /}
|
{extend name="public/base" /}
|
||||||
|
|
||||||
{block name="title"}编辑帖子{/block}
|
{block name="title"}编辑帖子{/block}
|
||||||
{block name="column"}{/block}
|
{block name="column"}{/block}
|
||||||
{block name="content"}
|
{block name="content"}
|
||||||
@ -138,20 +139,7 @@
|
|||||||
|
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
layui.cache.page = 'jie';
|
layui.use(['fly','colorpicker','form','upload'], function(){
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use(['fly','colorpicker','form','upload'], function(){
|
|
||||||
var $ = layui.$
|
var $ = layui.$
|
||||||
,colorpicker = layui.colorpicker
|
,colorpicker = layui.colorpicker
|
||||||
,form = layui.form
|
,form = layui.form
|
||||||
@ -188,84 +176,84 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//编辑文章
|
//编辑文章
|
||||||
form.on('submit(article-edit)', function(data){
|
form.on('submit(article-edit)', function(data){
|
||||||
var field = data.field;
|
var field = data.field;
|
||||||
var numArr = new Array();
|
var numArr = new Array();
|
||||||
$('.layui-btn-container').children('button').each(function(){
|
$('.layui-btn-container').children('button').each(function(){
|
||||||
numArr.push($(this).val());//添加至数组
|
numArr.push($(this).val());//添加至数组
|
||||||
});
|
});
|
||||||
tags = numArr.join(',');
|
tags = numArr.join(',');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url:"{:url('article/edit')}",
|
url:"{:url('article/edit')}",
|
||||||
data:{"id":field.id,"cate_id":field.cate_id,"title":field.title,"title_color":field.title_color,"user_id":field.user_id,"content":field.content,"upzip":field.upzip,"tags":tags,"captcha":field.captcha},
|
data:{"id":field.id,"cate_id":field.cate_id,"title":field.title,"title_color":field.title_color,"user_id":field.user_id,"content":field.content,"upzip":field.upzip,"tags":tags,"captcha":field.captcha},
|
||||||
daType:"json",
|
daType:"json",
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
layer.msg(data.msg,{
|
layer.msg(data.msg,{
|
||||||
icon:6,
|
icon:6,
|
||||||
time:2000
|
time:2000
|
||||||
}, function(){
|
}, function(){
|
||||||
location.href = data.url;
|
location.href = data.url;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
layer.open({
|
layer.open({
|
||||||
title:'编辑失败',
|
title:'编辑失败',
|
||||||
content:data.msg,
|
content:data.msg,
|
||||||
icon:5,
|
icon:5,
|
||||||
anim:6
|
anim:6
|
||||||
});
|
});
|
||||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//添加tags
|
//添加tags
|
||||||
$('#article-tags-button').on('click',function(){
|
$('#article-tags-button').on('click',function(){
|
||||||
var tags = $("input[name='tags']").val();
|
var tags = $("input[name='tags']").val();
|
||||||
|
|
||||||
if(tags == ''){
|
if(tags == ''){
|
||||||
layer.msg('不能为空');
|
layer.msg('不能为空');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var numArr = new Array();
|
var numArr = new Array();
|
||||||
$('.layui-btn-container').children('button').each(function(){
|
$('.layui-btn-container').children('button').each(function(){
|
||||||
numArr.push($(this).val());//添加至数组
|
numArr.push($(this).val());//添加至数组
|
||||||
});
|
});
|
||||||
for(var i=0; i<numArr.length; i++){
|
for(var i=0; i<numArr.length; i++){
|
||||||
if(tags.indexOf(numArr[i])>=0){
|
if(tags.indexOf(numArr[i])>=0){
|
||||||
layer.msg('不能重复添加'+numArr[i]);
|
layer.msg('不能重复添加'+numArr[i]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//保存tags
|
//保存tags
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url:"{:url('article/tags')}",
|
url:"{:url('article/tags')}",
|
||||||
data:{"tags":tags},
|
data:{"tags":tags},
|
||||||
daType:"json",
|
daType:"json",
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
for(var i=0; i<data.data.length; i++){
|
for(var i=0; i<data.data.length; i++){
|
||||||
$('.layui-btn-container').append('<button type="button" class="layui-btn" value='+data.data[i]+'>'+data.data[i]+'</button>');
|
$('.layui-btn-container').append('<button type="button" class="layui-btn" value='+data.data[i]+'>'+data.data[i]+'</button>');
|
||||||
}
|
}
|
||||||
$("input[name='tags']").val("");
|
$("input[name='tags']").val("");
|
||||||
} else {
|
} else {
|
||||||
layer.open({
|
layer.open({
|
||||||
title:'添加失败',
|
title:'添加失败',
|
||||||
content:data.msg,
|
content:data.msg,
|
||||||
icon:5,
|
icon:5,
|
||||||
anim:6
|
anim:6
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//删除tag
|
//删除tag
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
@ -137,21 +137,4 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script>
|
|
||||||
layui.cache.page = 'index';
|
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use('fly');
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{/block}
|
{/block}
|
@ -101,6 +101,7 @@
|
|||||||
|
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
|
var replyUrl = "{:url('index/reply')}";
|
||||||
layui.use(['form', 'layer'], function() {
|
layui.use(['form', 'layer'], function() {
|
||||||
var form = layui.form;
|
var form = layui.form;
|
||||||
var layer = layui.layer;
|
var layer = layui.layer;
|
||||||
@ -226,21 +227,4 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script>
|
|
||||||
var replyUrl = "{:url('index/reply')}";
|
|
||||||
layui.cache.page = 'index';
|
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use('fly');
|
|
||||||
</script>
|
|
||||||
{/block}
|
{/block}
|
@ -1,9 +1,7 @@
|
|||||||
|
|
||||||
{extend name="public/base" /}
|
{extend name="public/base" /}
|
||||||
|
|
||||||
{block name="title"}
|
{block name="title"}{$sysInfo.webname}{$keywords}搜索内容{/block}
|
||||||
TP5学习制作:Tao.2019
|
|
||||||
{/block}
|
|
||||||
|
|
||||||
{block name="column"}
|
{block name="column"}
|
||||||
{include file="/public/column" /}
|
{include file="/public/column" /}
|
||||||
@ -14,21 +12,16 @@ TP5学习制作:Tao.2019
|
|||||||
<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;">
|
||||||
|
|
||||||
<div class="fly-panel-title fly-filter">
|
<div class="fly-panel-title fly-filter">
|
||||||
<a href="" class="layui-this">“{$keywords}” 共{$counts}条结果</a>
|
<a href="" class="layui-this">“{$keywords}” 共{$counts}条结果</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="fly-list">
|
<ul class="fly-list">
|
||||||
{volist name="artList" id="art"}
|
{volist name="artList" id="art"}
|
||||||
<li>
|
<li>
|
||||||
|
|
||||||
<a href="{:url('user/home',['id'=>$art.user_id])}" class="fly-avatar">
|
<a href="{:url('user/home',['id'=>$art.user_id])}" class="fly-avatar">
|
||||||
<img src="{$art.user.user_img}" alt="{$art.user_id|getUserName}">
|
<img src="{$art.user.user_img}" alt="{$art.user_id|getUserName}">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
<a class="layui-badge">{$art.cate.catename}</a>
|
<a class="layui-badge">{$art.cate.catename}</a>
|
||||||
<a href="{:url('article/detail',['id' => $art.id])}">{$art.title}</a>
|
<a href="{:url('article/detail',['id' => $art.id])}">{$art.title}</a>
|
||||||
@ -56,10 +49,9 @@ TP5学习制作:Tao.2019
|
|||||||
</li>
|
</li>
|
||||||
{/volist}
|
{/volist}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-col-md4">
|
<div class="layui-col-md4">
|
||||||
<!--温馨通道-->
|
<!--温馨通道-->
|
||||||
<div class="fly-panel">
|
<div class="fly-panel">
|
||||||
@ -67,15 +59,15 @@ TP5学习制作:Tao.2019
|
|||||||
{include file="public/index-static" /}
|
{include file="public/index-static" /}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<dl class="fly-panel fly-list-one">
|
<dl class="fly-panel fly-list-one">
|
||||||
<dt class="fly-panel-title">本周热议</dt>
|
<dt class="fly-panel-title">本周热议</dt>
|
||||||
{volist name="artHot" id="vo" empty="还没有帖子"}
|
{volist name="artHot" id="vo" empty="还没有帖子"}
|
||||||
<dd>
|
<dd>
|
||||||
<a href="{:url('jie/detail',['id'=>$vo.id])}">{$vo.title}</a>
|
<a href="{:url('jie/detail',['id'=>$vo.id])}">{$vo.title}</a>
|
||||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||||
</dd>
|
</dd>
|
||||||
{/volist}
|
{/volist}
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<div class="fly-panel">
|
<div class="fly-panel">
|
||||||
<div class="fly-panel-title">
|
<div class="fly-panel-title">
|
||||||
@ -86,27 +78,11 @@ TP5学习制作:Tao.2019
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{include file="public/flink" /}
|
{include file="public/flink" /}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
|
||||||
layui.cache.page = 'index';
|
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user.name? $user['user_img']:'/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ? $user.point : ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use('fly');
|
|
||||||
</script>
|
|
||||||
{/block}
|
{/block}
|
@ -15,7 +15,7 @@
|
|||||||
<div class="layui-tab-item layui-show">
|
<div class="layui-tab-item layui-show">
|
||||||
|
|
||||||
|
|
||||||
{if cache('repass')==1}
|
{if cache('repass')==1}
|
||||||
<div class="layui-form layui-form-pane">
|
<div class="layui-form layui-form-pane">
|
||||||
<form id="form2">
|
<form id="form2">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
@ -31,10 +31,10 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{elseif cache('repass')==2 /}
|
{elseif cache('repass')==2 /}
|
||||||
|
|
||||||
<!-- 重置密码 -->
|
<!-- 重置密码 -->
|
||||||
<div class="fly-msg">{:lang('reset password')}</div>
|
<div class="fly-msg">{:lang('reset password')}</div>
|
||||||
<div class="layui-form layui-form-pane" style="margin-top: 30px;">
|
<div class="layui-form layui-form-pane" style="margin-top: 30px;">
|
||||||
<form id="form3">
|
<form id="form3">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
@ -76,7 +76,7 @@
|
|||||||
<div class="fly-error">该重置密码链接已失效,请重新校验您的信息</div>
|
<div class="fly-error">该重置密码链接已失效,请重新校验您的信息</div>
|
||||||
<div class="fly-error">非法链接,请重新校验您的信息</div>
|
<div class="fly-error">非法链接,请重新校验您的信息</div>
|
||||||
|
|
||||||
{else /}
|
{else /}
|
||||||
|
|
||||||
<div class="layui-form layui-form-pane">
|
<div class="layui-form layui-form-pane">
|
||||||
<form method="post" id="form1">
|
<form method="post" id="form1">
|
||||||
@ -103,7 +103,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -118,32 +118,32 @@ $(function() {
|
|||||||
loading = layer.load(2, {
|
loading = layer.load(2, {
|
||||||
shade: [0.2, '#000']
|
shade: [0.2, '#000']
|
||||||
});
|
});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url:"{:url('login/forget')}",
|
url:"{:url('login/forget')}",
|
||||||
data:$('#form1').serialize(),
|
data:$('#form1').serialize(),
|
||||||
daType:"json",
|
daType:"json",
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
layer.close(loading);
|
layer.close(loading);
|
||||||
layer.msg(data.msg,{
|
layer.msg(data.msg,{
|
||||||
icon:6,
|
icon:6,
|
||||||
time:2000
|
time:2000
|
||||||
},function(){
|
},function(){
|
||||||
location.href = data.url;
|
location.href = data.url;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
layer.close(loading);
|
layer.close(loading);
|
||||||
layer.open({
|
layer.open({
|
||||||
title:'发送失败',
|
title:'发送失败',
|
||||||
content:data.msg,
|
content:data.msg,
|
||||||
icon:5,
|
icon:5,
|
||||||
anim:6
|
anim:6
|
||||||
});
|
});
|
||||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?id=1'+Math.random());
|
layui.jquery('#captcha').attr('src', '{:captcha_src()}?id=1'+Math.random());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -218,22 +218,6 @@ $(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
layui.cache.page = 'user';
|
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use('fly');
|
|
||||||
</script>
|
|
||||||
{/block}
|
{/block}
|
||||||
|
@ -63,49 +63,32 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
$('#login').click(function() {
|
$('#login').click(function() {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url:"{:url('login/index')}",
|
url:"{:url('login/index')}",
|
||||||
data:$('form').serialize(),
|
data:$('form').serialize(),
|
||||||
daType:"json",
|
daType:"json",
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
layer.msg(data.msg,{
|
layer.msg(data.msg,{
|
||||||
icon:6,
|
icon:6,
|
||||||
time:2000
|
time:2000
|
||||||
}, function(){
|
}, function(){
|
||||||
location.href = data.url;
|
location.href = data.url;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
layer.open({
|
layer.open({
|
||||||
title:'登陆失败',
|
title:'登陆失败',
|
||||||
content:data.msg,
|
content:data.msg,
|
||||||
icon:5,
|
icon:5,
|
||||||
anim:6
|
anim:6
|
||||||
});
|
});
|
||||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
layui.cache.page = 'user';
|
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use('fly');
|
|
||||||
</script>
|
|
||||||
{/block}
|
{/block}
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
{extend name="public:base" /}
|
{extend name="public:base" /}
|
||||||
|
|
||||||
{block name="title"}注册账号{/block}
|
{block name="title"}注册账号{/block}
|
||||||
{block name="column"}{/block}
|
{block name="column"}{/block}
|
||||||
{block name="content"}
|
{block name="content"}
|
||||||
@ -67,7 +67,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
@ -78,50 +77,34 @@ $(function() {
|
|||||||
loading = layer.load(2, {
|
loading = layer.load(2, {
|
||||||
shade: [0.2, '#000']
|
shade: [0.2, '#000']
|
||||||
});
|
});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url:"{:url('login/reg')}",
|
url:"{:url('login/reg')}",
|
||||||
data:$('form').serialize(),
|
data:$('form').serialize(),
|
||||||
daType:"json",
|
daType:"json",
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
layer.close(loading);
|
layer.close(loading);
|
||||||
layer.msg(data.msg,{
|
layer.msg(data.msg,{
|
||||||
icon:6,
|
icon:6,
|
||||||
time:2000
|
time:2000
|
||||||
},function(){
|
},function(){
|
||||||
location.href = data.url;
|
location.href = data.url;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
layer.close(loading);
|
layer.close(loading);
|
||||||
layer.open({
|
layer.open({
|
||||||
title:'注册失败',
|
title:'注册失败',
|
||||||
content:data.msg,
|
content:data.msg,
|
||||||
icon:5,
|
icon:5,
|
||||||
anim:6
|
anim:6
|
||||||
});
|
});
|
||||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
|
||||||
layui.cache.page = 'user';
|
|
||||||
layui.cache.user = {
|
|
||||||
username: '{$user.name??'游客'}'
|
|
||||||
,uid: '{$user.id ?? -1}'
|
|
||||||
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
|
||||||
,experience: '{$user.point ?? ''}'
|
|
||||||
,sex: '{$user.sex ? '女':'男'}'
|
|
||||||
};
|
|
||||||
layui.config({
|
|
||||||
version: "3.0.0"
|
|
||||||
,base: '/static/res/mods/'
|
|
||||||
}).extend({
|
|
||||||
fly: 'index'
|
|
||||||
}).use('fly');
|
|
||||||
</script>
|
|
||||||
{/block}
|
{/block}
|
||||||
|
@ -31,6 +31,22 @@
|
|||||||
{block name="column"}导航{/block}
|
{block name="column"}导航{/block}
|
||||||
{block name="content"}内容{/block}
|
{block name="content"}内容{/block}
|
||||||
{include file="public/footer" /}
|
{include file="public/footer" /}
|
||||||
|
<script>
|
||||||
|
layui.cache.page = '{$jspage}';
|
||||||
|
layui.cache.user = {
|
||||||
|
username: '{$user.name??'游客'}'
|
||||||
|
,uid: '{$user.id ?? -1}'
|
||||||
|
,avatar: '{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}'
|
||||||
|
,experience: '{$user.point ?? ''}'
|
||||||
|
,sex: '{$user.sex ? '女':'男'}'
|
||||||
|
};
|
||||||
|
layui.config({
|
||||||
|
version: "3.0.0"
|
||||||
|
,base: '/static/res/mods/'
|
||||||
|
}).extend({
|
||||||
|
fly: 'index'
|
||||||
|
}).use('fly');
|
||||||
|
</script>
|
||||||
{block name="script"}{/block}
|
{block name="script"}{/block}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
{/volist}
|
{/volist}
|
||||||
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>
|
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>
|
||||||
{if session('?user_id')}
|
{if session('?user_id')}
|
||||||
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="{:url('user/post')}">{:lang('add post')}</a></li>
|
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="{:url('user/post')}">{:lang('my post')}</a></li>
|
||||||
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="{:url('user/post#collection')}">{:lang('my collection')}</a></li>
|
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="{:url('user/post#collection')}">{:lang('my collection')}</a></li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user