优化前端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();
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@ -178,6 +178,7 @@ class Article extends BaseController
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
View::assign(['jspage'=>'jie']);
|
||||
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();
|
||||
}
|
||||
|
||||
|
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_comm' => $ad_comm,
|
||||
'flinks' => $friend_links,
|
||||
'jspage' => '',
|
||||
];
|
||||
View::assign($vs);
|
||||
|
||||
@ -98,7 +99,7 @@ class Index extends BaseController
|
||||
$artHot = Article::getArtHot(10);
|
||||
|
||||
View::assign($searchs);
|
||||
View::assign(['flinks'=>$friend_links,'artHot'=>$artHot]);
|
||||
View::assign(['flinks'=>$friend_links,'artHot'=>$artHot,'jspage'=>'']);
|
||||
return View::fetch('search');
|
||||
}
|
||||
|
||||
|
@ -13,13 +13,19 @@ use think\facade\Cache;
|
||||
use think\facade\View;
|
||||
use app\common\model\User;
|
||||
|
||||
|
||||
class Login extends BaseController
|
||||
{
|
||||
//已登陆检测
|
||||
//已登陆中间件检测
|
||||
protected $middleware = [
|
||||
'logedcheck' => ['except' => ['index'] ]
|
||||
];
|
||||
|
||||
//给模板中JScace文件赋值
|
||||
protected function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
View::assign(['jspage'=>'user']);
|
||||
}
|
||||
|
||||
//用户登陆
|
||||
public function index()
|
||||
@ -75,6 +81,7 @@ class Login extends BaseController
|
||||
return Msgres::error($res);
|
||||
}
|
||||
}
|
||||
|
||||
return View::fetch('login');
|
||||
}
|
||||
|
||||
@ -103,7 +110,6 @@ class Login extends BaseController
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
//加载注册模板
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}发表帖子{/block}
|
||||
{block name="column"}{/block}
|
||||
{block name="content"}
|
||||
@ -141,20 +142,7 @@
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
layui.cache.page = 'jie';
|
||||
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(){
|
||||
layui.use(['fly','form','colorpicker','upload'], function(){
|
||||
var $ = layui.$
|
||||
,fly = layui.fly
|
||||
,form = layui.form
|
||||
@ -270,5 +258,4 @@
|
||||
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
{block name="cachepage"}jie{/block}
|
||||
{/block}
|
@ -97,20 +97,7 @@
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.cache.page = 'jie';
|
||||
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(){
|
||||
layui.use(['laypage'], function(){
|
||||
var laypage = layui.laypage;
|
||||
|
||||
//执行一个laypage实例
|
||||
|
@ -1,4 +1,5 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}{$article.title}-{$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$article.title},{$article.tags}{/block}
|
||||
{block name="description"}{$article.title},{:getArtContent($article.content)}{/block}
|
||||
@ -216,31 +217,18 @@
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
var collectionFind = "{:url('index/Collection/find')}",
|
||||
articleJieset = "{:url('index/Article/jieset')}",
|
||||
articleDelete = "{:url('index/Article/delete')}",
|
||||
collection = "{:url('index/Collection/')}",
|
||||
commentJiedaZan = "{:url('index/Comment/jiedaZan')}",
|
||||
commentJiedaCai = "{:url('index/Comment/jiedaCai')}",
|
||||
commentGetDa = "{:url('index/Comment/getDa')}",
|
||||
commentUpdateDa = "{:url('index/Comment/updateDa')}",
|
||||
commentJiedaDelete = "{:url('index/Comment/jiedaDelete')}",
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
articleJieset = "{:url('Article/jieset')}",
|
||||
articleDelete = "{:url('Article/delete')}",
|
||||
collection = "{:url('Collection/')}",
|
||||
commentJiedaZan = "{:url('Comment/jiedaZan')}",
|
||||
commentJiedaCai = "{:url('Comment/jiedaCai')}",
|
||||
commentGetDa = "{:url('Comment/getDa')}",
|
||||
commentUpdateDa = "{:url('Comment/updateDa')}",
|
||||
commentJiedaDelete = "{:url('Comment/jiedaDelete')}",
|
||||
langCollection = "{:lang('collection')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
layui.cache.page = 'jie';
|
||||
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(){
|
||||
layui.use(['fly', 'face','colorpicker'], function(){
|
||||
var $ = layui.$
|
||||
,fly = layui.fly
|
||||
,colorpicker = layui.colorpicker;
|
||||
|
@ -1,4 +1,5 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}编辑帖子{/block}
|
||||
{block name="column"}{/block}
|
||||
{block name="content"}
|
||||
@ -138,20 +139,7 @@
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.cache.page = 'jie';
|
||||
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(){
|
||||
layui.use(['fly','colorpicker','form','upload'], function(){
|
||||
var $ = layui.$
|
||||
,colorpicker = layui.colorpicker
|
||||
,form = layui.form
|
||||
@ -188,84 +176,84 @@
|
||||
}
|
||||
});
|
||||
|
||||
//编辑文章
|
||||
form.on('submit(article-edit)', function(data){
|
||||
var field = data.field;
|
||||
var numArr = new Array();
|
||||
$('.layui-btn-container').children('button').each(function(){
|
||||
numArr.push($(this).val());//添加至数组
|
||||
});
|
||||
tags = numArr.join(',');
|
||||
$.ajax({
|
||||
type:"post",
|
||||
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},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}, function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'编辑失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
};
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
//编辑文章
|
||||
form.on('submit(article-edit)', function(data){
|
||||
var field = data.field;
|
||||
var numArr = new Array();
|
||||
$('.layui-btn-container').children('button').each(function(){
|
||||
numArr.push($(this).val());//添加至数组
|
||||
});
|
||||
tags = numArr.join(',');
|
||||
$.ajax({
|
||||
type:"post",
|
||||
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},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}, function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'编辑失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
};
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//添加tags
|
||||
$('#article-tags-button').on('click',function(){
|
||||
var tags = $("input[name='tags']").val();
|
||||
//添加tags
|
||||
$('#article-tags-button').on('click',function(){
|
||||
var tags = $("input[name='tags']").val();
|
||||
|
||||
if(tags == ''){
|
||||
layer.msg('不能为空');
|
||||
return false;
|
||||
}
|
||||
if(tags == ''){
|
||||
layer.msg('不能为空');
|
||||
return false;
|
||||
}
|
||||
|
||||
var numArr = new Array();
|
||||
$('.layui-btn-container').children('button').each(function(){
|
||||
numArr.push($(this).val());//添加至数组
|
||||
});
|
||||
for(var i=0; i<numArr.length; i++){
|
||||
if(tags.indexOf(numArr[i])>=0){
|
||||
layer.msg('不能重复添加'+numArr[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//保存tags
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('article/tags')}",
|
||||
data:{"tags":tags},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
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>');
|
||||
}
|
||||
$("input[name='tags']").val("");
|
||||
} else {
|
||||
layer.open({
|
||||
title:'添加失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
var numArr = new Array();
|
||||
$('.layui-btn-container').children('button').each(function(){
|
||||
numArr.push($(this).val());//添加至数组
|
||||
});
|
||||
for(var i=0; i<numArr.length; i++){
|
||||
if(tags.indexOf(numArr[i])>=0){
|
||||
layer.msg('不能重复添加'+numArr[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//保存tags
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('article/tags')}",
|
||||
data:{"tags":tags},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
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>');
|
||||
}
|
||||
$("input[name='tags']").val("");
|
||||
} else {
|
||||
layer.open({
|
||||
title:'添加失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//删除tag
|
||||
$(document).ready(function(){
|
||||
|
@ -137,21 +137,4 @@
|
||||
});
|
||||
|
||||
</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}
|
@ -101,6 +101,7 @@
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
var replyUrl = "{:url('index/reply')}";
|
||||
layui.use(['form', 'layer'], function() {
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
@ -226,21 +227,4 @@
|
||||
});
|
||||
|
||||
</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}
|
@ -1,9 +1,7 @@
|
||||
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}
|
||||
TP5学习制作:Tao.2019
|
||||
{/block}
|
||||
{block name="title"}{$sysInfo.webname}{$keywords}搜索内容{/block}
|
||||
|
||||
{block name="column"}
|
||||
{include file="/public/column" /}
|
||||
@ -14,21 +12,16 @@ TP5学习制作:Tao.2019
|
||||
<div class="layui-row layui-col-space15">
|
||||
|
||||
<div class="layui-col-md8">
|
||||
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
|
||||
<div class="fly-panel-title fly-filter">
|
||||
<a href="" class="layui-this">“{$keywords}” 共{$counts}条结果</a>
|
||||
</div>
|
||||
|
||||
<ul class="fly-list">
|
||||
{volist name="artList" id="art"}
|
||||
<li>
|
||||
|
||||
<a href="{:url('user/home',['id'=>$art.user_id])}" class="fly-avatar">
|
||||
<img src="{$art.user.user_img}" alt="{$art.user_id|getUserName}">
|
||||
</a>
|
||||
|
||||
<h2>
|
||||
<a class="layui-badge">{$art.cate.catename}</a>
|
||||
<a href="{:url('article/detail',['id' => $art.id])}">{$art.title}</a>
|
||||
@ -56,10 +49,9 @@ TP5学习制作:Tao.2019
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-md4">
|
||||
<!--温馨通道-->
|
||||
<div class="fly-panel">
|
||||
@ -67,15 +59,15 @@ TP5学习制作:Tao.2019
|
||||
{include file="public/index-static" /}
|
||||
</div>
|
||||
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">本周热议</dt>
|
||||
{volist name="artHot" id="vo" empty="还没有帖子"}
|
||||
<dd>
|
||||
<a href="{:url('jie/detail',['id'=>$vo.id])}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">本周热议</dt>
|
||||
{volist name="artHot" id="vo" empty="还没有帖子"}
|
||||
<dd>
|
||||
<a href="{:url('jie/detail',['id'=>$vo.id])}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">
|
||||
@ -86,27 +78,11 @@ TP5学习制作:Tao.2019
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/flink" /}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{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}
|
@ -15,7 +15,7 @@
|
||||
<div class="layui-tab-item layui-show">
|
||||
|
||||
|
||||
{if cache('repass')==1}
|
||||
{if cache('repass')==1}
|
||||
<div class="layui-form layui-form-pane">
|
||||
<form id="form2">
|
||||
<div class="layui-form-item">
|
||||
@ -31,10 +31,10 @@
|
||||
</form>
|
||||
</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;">
|
||||
<form id="form3">
|
||||
<div class="layui-form-item">
|
||||
@ -76,7 +76,7 @@
|
||||
<div class="fly-error">该重置密码链接已失效,请重新校验您的信息</div>
|
||||
<div class="fly-error">非法链接,请重新校验您的信息</div>
|
||||
|
||||
{else /}
|
||||
{else /}
|
||||
|
||||
<div class="layui-form layui-form-pane">
|
||||
<form method="post" id="form1">
|
||||
@ -103,7 +103,7 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -118,32 +118,32 @@ $(function() {
|
||||
loading = layer.load(2, {
|
||||
shade: [0.2, '#000']
|
||||
});
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('login/forget')}",
|
||||
data:$('#form1').serialize(),
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.close(loading);
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
},function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.open({
|
||||
title:'发送失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?id=1'+Math.random());
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('login/forget')}",
|
||||
data:$('#form1').serialize(),
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.close(loading);
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
},function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.open({
|
||||
title:'发送失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?id=1'+Math.random());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
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}
|
||||
|
@ -63,49 +63,32 @@
|
||||
$(function() {
|
||||
$('#login').click(function() {
|
||||
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('login/index')}",
|
||||
data:$('form').serialize(),
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}, function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'登陆失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('login/index')}",
|
||||
data:$('form').serialize(),
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}, function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'登陆失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</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}
|
@ -1,5 +1,5 @@
|
||||
|
||||
{extend name="public:base" /}
|
||||
|
||||
{block name="title"}注册账号{/block}
|
||||
{block name="column"}{/block}
|
||||
{block name="content"}
|
||||
@ -67,7 +67,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
@ -78,50 +77,34 @@ $(function() {
|
||||
loading = layer.load(2, {
|
||||
shade: [0.2, '#000']
|
||||
});
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('login/reg')}",
|
||||
data:$('form').serialize(),
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.close(loading);
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
},function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.open({
|
||||
title:'注册失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('login/reg')}",
|
||||
data:$('form').serialize(),
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.close(loading);
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
},function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.open({
|
||||
title:'注册失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</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}
|
||||
|
@ -31,6 +31,22 @@
|
||||
{block name="column"}导航{/block}
|
||||
{block name="content"}内容{/block}
|
||||
{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}
|
||||
</body>
|
||||
</html>
|
||||
|
@ -11,7 +11,7 @@
|
||||
{/volist}
|
||||
<li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>
|
||||
{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>
|
||||
{/if}
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user