1.8.6
This commit is contained in:
parent
82985869c8
commit
6740f501d1
@ -77,7 +77,7 @@ class Forum extends AdminController
|
||||
$res['msg'] = '';
|
||||
$res['count'] = $count;
|
||||
foreach($forumList as $k=>$v){
|
||||
$res['data'][]= ['id'=>$v['aid'],'poster'=>$v['name'],'avatar'=>$v['user_img'],'title'=>$v['title'],'content'=>$v['content'],'posttime'=>date("Y-m-d",$v['update_time']),'top'=>$v['is_top'],'hot'=>$v['is_hot'],'reply'=>$v['is_reply'],'check'=>$v['status']];
|
||||
$res['data'][]= ['id'=>$v['aid'],'poster'=>$v['name'],'avatar'=>$v['user_img'],'title'=>htmlspecialchars($v['title']),'content'=>htmlspecialchars($v['content']),'posttime'=>date("Y-m-d",$v['update_time']),'top'=>$v['is_top'],'hot'=>$v['is_hot'],'reply'=>$v['is_reply'],'check'=>$v['status']];
|
||||
}
|
||||
} else {
|
||||
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
||||
@ -262,7 +262,7 @@ class Forum extends AdminController
|
||||
$res = ['code'=>0,'msg'=>'','count'=>$count];
|
||||
foreach($replys as $k => $v){
|
||||
//$res['data'][] = ['id'=>$v['id'],'replyer'=>$v->user->name,'cardid'=>$v->article->title,'avatar'=>$v->user->user_img,'content'=>$v['content'],'replytime'=>$v['create_time']];
|
||||
$res['data'][] = ['id'=>$v['aid'],'replyer'=>$v['name'],'cardid'=>$v['title'],'avatar'=>$v['user_img'],'content'=>$v['content'],'replytime'=>date("Y-m-d",$v['create_time']),'check'=>$v['astatus'],'cid'=>$v['cid']];
|
||||
$res['data'][] = ['id'=>$v['aid'],'replyer'=>$v['name'],'cardid'=>htmlspecialchars($v['title']),'avatar'=>$v['user_img'],'content'=>htmlspecialchars($v['content']),'replytime'=>date("Y-m-d",$v['create_time']),'check'=>$v['astatus'],'cid'=>$v['cid']];
|
||||
}
|
||||
} else {
|
||||
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
||||
|
@ -120,7 +120,7 @@ class Index extends AdminController
|
||||
$res['count'] = $count;
|
||||
foreach($forumList as $k=>$v){
|
||||
$url = (string) str_replace("admin","index",$this->domain.url('article/detail',['id'=>$v['aid']]));
|
||||
$res['data'][]= ['id'=>$url,'title'=>$v['title'],'name'=>$v['name'],'catename'=>$v['catename'],'pv'=>$v['pv']];
|
||||
$res['data'][]= ['id'=>$url,'title'=>htmlspecialchars($v['title']),'name'=>$v['name'],'catename'=>$v['catename'],'pv'=>$v['pv']];
|
||||
}
|
||||
} else {
|
||||
$res = ['code'=>-1,'msg'=>'本周还没有发帖!'];
|
||||
@ -147,7 +147,7 @@ class Index extends AdminController
|
||||
if ($count) {
|
||||
$res = ['code'=>0,'msg'=>'','count'=>$count];
|
||||
foreach($replys as $k => $v){
|
||||
$res['data'][] = ['content'=>$v['content'],'title'=>$v['title'],'cid'=>str_replace("admin","index",$this->domain.(string) url('article/detail',['id'=>$v['cid']])),'name'=>$v['name']];
|
||||
$res['data'][] = ['content'=>htmlspecialchars($v['content']),'title'=>htmlspecialchars($v['title']),'cid'=>str_replace("admin","index",$this->domain.(string) url('article/detail',['id'=>$v['cid']])),'name'=>$v['name']];
|
||||
}
|
||||
} else {
|
||||
$res = ['code'=>-1,'msg'=>'本周还没评论'];
|
||||
|
@ -8,7 +8,6 @@
|
||||
<div class="layadmin-user-login-main">
|
||||
<div class="layadmin-user-login-box layadmin-user-login-header">
|
||||
<h2>TaoLerAdmin</h2>
|
||||
<p>TaoLer管理系统-专业版</p>
|
||||
</div>
|
||||
<div class="layadmin-user-login-box layadmin-user-login-body layui-form">
|
||||
<div class="layui-form-item">
|
||||
|
121
app/index/Index.php
Normal file
121
app/index/Index.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
namespace app\index\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use think\App;
|
||||
use think\facade\View;
|
||||
use think\facade\Request;
|
||||
use think\facade\Db;
|
||||
use app\facade\Article;
|
||||
use app\common\model\Slider;
|
||||
use app\common\lib\Msgres;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @return string
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$types = input('type');
|
||||
|
||||
//幻灯
|
||||
$slider = new Slider();
|
||||
$sliders = $slider->getSliderList(1);
|
||||
//置顶文章
|
||||
$artTop = Article::getArtTop(5);
|
||||
//首页文章列表,显示20个
|
||||
$artList = Article::getArtList(22);
|
||||
//热议文章
|
||||
$artHot = Article::getArtHot(10);
|
||||
//温馨通道
|
||||
$fast_links = $slider->getSliderList(8);
|
||||
//首页赞助
|
||||
$ad_index = $slider->getSliderList(5);
|
||||
//首页右栏图片
|
||||
$ad_comm = $slider->getSliderList(2);
|
||||
//友情链接
|
||||
$friend_links = $slider->getSliderList(9);
|
||||
|
||||
//友情链接申请
|
||||
$adminEmail = Db::name('user')->where('id',1)->cache(true)->value('email');
|
||||
|
||||
$vs = [
|
||||
'slider' => $sliders,
|
||||
'artTop' => $artTop,
|
||||
'artList' => $artList,
|
||||
'artHot' => $artHot,
|
||||
'type' => $types,
|
||||
'ad_index' => $ad_index,
|
||||
'ad_comm' => $ad_comm,
|
||||
'fastlinks' => $fast_links,
|
||||
'flinks' => $friend_links,
|
||||
'adminEmail' => $adminEmail,
|
||||
'jspage' => '',
|
||||
];
|
||||
View::assign($vs);
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//回帖榜
|
||||
public function reply()
|
||||
{
|
||||
$comment = new \app\common\model\Comment();
|
||||
return $comment->reply(20);
|
||||
}
|
||||
|
||||
//搜索功能
|
||||
public function search()
|
||||
{
|
||||
//$t = input('keywords');
|
||||
//halt($t);
|
||||
$ser = Request::only(['keywords']);
|
||||
|
||||
$search = new \app\index\controller\Search();
|
||||
$artList = $search->getSearch($ser['keywords']);
|
||||
$counts = $artList->count();
|
||||
$slider = new Slider();
|
||||
//首页右栏
|
||||
$ad_comm = $slider->getSliderList(2);
|
||||
// 查询热议
|
||||
$artHot = Article::getArtHot(10);
|
||||
|
||||
$searchs = [
|
||||
'artList' => $artList,
|
||||
'keywords' => $ser['keywords'],
|
||||
'counts' => $counts,
|
||||
'ad_comm'=>$ad_comm,
|
||||
'artHot'=>$artHot,
|
||||
'jspage'=>''
|
||||
];
|
||||
View::assign($searchs);
|
||||
return View::fetch('search');
|
||||
}
|
||||
|
||||
public function jump()
|
||||
{
|
||||
$username = Request::param('username');
|
||||
$u = Db::name('user')->whereOr('nickname', $username)->whereOr('name', $username)->find();
|
||||
return redirect((string) url('user/home',['id'=>$u['id']]));
|
||||
|
||||
}
|
||||
|
||||
public function language()
|
||||
{
|
||||
if(request()->isPost()){
|
||||
$language = new \app\common\controller\Language;
|
||||
$lang = $language->select(input('language'));
|
||||
if($lang){
|
||||
return Msgres::success();
|
||||
}
|
||||
}else {
|
||||
return Msgres::error('illegal_request');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
277
app/index/User.php
Normal file
277
app/index/User.php
Normal file
@ -0,0 +1,277 @@
|
||||
<?php
|
||||
namespace app\index\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\validate\User as userValidate;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\Request;
|
||||
use think\facade\Session;
|
||||
use think\facade\Cache;
|
||||
use think\facade\Cookie;
|
||||
use think\facade\View;
|
||||
use app\common\model\Article;
|
||||
use app\common\model\Collection;
|
||||
use app\common\model\User as userModel;
|
||||
use think\facade\Config;
|
||||
use taoler\com\Message;
|
||||
|
||||
class User extends BaseController
|
||||
{
|
||||
protected $middleware = [
|
||||
'logincheck' => ['except' => ['home'] ],
|
||||
];
|
||||
|
||||
//用户中心
|
||||
public function index()
|
||||
{
|
||||
return view();
|
||||
}
|
||||
|
||||
|
||||
//发帖list
|
||||
public function artList()
|
||||
{
|
||||
$article = Article::withCount('comments')->where('user_id',$this->uid)->order('update_time','desc')->paginate(10);
|
||||
//var_dump($article);
|
||||
$count = $article->total();
|
||||
$res = [];
|
||||
if($count){
|
||||
$res['code'] = 0;
|
||||
$res['count'] = $count;
|
||||
foreach($article as $v){
|
||||
$res['data'][] = ['id'=>$v['id'],
|
||||
'title' => htmlspecialchars($v['title']),
|
||||
'url' => (string) url('article/detail',['id'=>$v['id']]),
|
||||
'status' => $v['status'] ? '正常':'待审核',
|
||||
'ctime' => $v['create_time'],
|
||||
'datas' => $v['pv'].'阅/'.$v['comments_count'].'答'
|
||||
];
|
||||
}
|
||||
|
||||
} else {
|
||||
return json(['code'=>-1,'msg'=>'无数据']);
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
|
||||
//收藏list
|
||||
public function collList(){
|
||||
//收藏的帖子
|
||||
$collect = Collection::with(['article'=>function($query){
|
||||
$query->withCount('comments')->where('status',1);
|
||||
}])->where('user_id',$this->uid)->order('create_time','desc')->paginate(10);
|
||||
$count =$collect->total();
|
||||
$res = [];
|
||||
if($count){
|
||||
$res['code'] = 0;
|
||||
$res['count'] = $count ;
|
||||
foreach($collect as $v){
|
||||
|
||||
$res['data'][] = [
|
||||
'id' =>$v['id'],
|
||||
'title' => htmlspecialchars($v['collect_title']),
|
||||
'url' => (string) url('article/detail',['id'=>$v['article_id']]),
|
||||
'auther' => $v['auther'],
|
||||
'status' => is_null(Db::name('article')->field('id')->where('delete_time',0)->find($v['article_id'])) ? '已失效' : '正常',
|
||||
'ctime' => $v['create_time']
|
||||
];
|
||||
}
|
||||
|
||||
} else {
|
||||
return json(['code'=>-1,'msg'=>'无数据']);
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//文章管理
|
||||
public function post()
|
||||
{
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//取消文章收藏
|
||||
public function colltDel()
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$collt = Collection::where('user_id',$this->uid)->find(input('id'));
|
||||
$result = $collt->delete();
|
||||
if($result){
|
||||
$res = ['code'=>0,'msg'=>'取消成功'];
|
||||
} else {
|
||||
$res = ['code'=>0,'msg'=>'取消失败'];
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
}
|
||||
|
||||
//用户设置-我的资料
|
||||
public function set()
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$data = Request::only(['user_id','email','nickname','sex','city','area_id','sign']);
|
||||
$validate = new userValidate;
|
||||
$result = $validate->scene('Set')->check($data);
|
||||
if(!$result){
|
||||
$this->error($validate->getError());
|
||||
} else {
|
||||
//防止重复的email
|
||||
$resEmail = Db::name('user')->where('email',$data['email'])->where('id','<>',$this->uid)->find();
|
||||
if(!is_null($resEmail)){
|
||||
return ['code'=>-1,'msg'=>'email已存在,请更换!'];
|
||||
}
|
||||
//若更换email,需重新激活
|
||||
$mail = Db::name('user')->where('id',$this->uid)->value('email');
|
||||
if($data['email'] !== $mail){
|
||||
$data['active'] = 0;
|
||||
}
|
||||
$user = new userModel;
|
||||
$result = $user->setNew($data);
|
||||
if($result == 1){
|
||||
Cache::tag('user')->clear();
|
||||
return ['code'=>0,'msg'=>'资料更新成功'];
|
||||
} else {
|
||||
$this->error($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
$area = Db::name('user_area')->select();
|
||||
View::assign(['area'=>$area]);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//更换头像
|
||||
public function uploadHeadImg()
|
||||
{
|
||||
$uploads = new \app\common\lib\Uploads();
|
||||
$upRes = $uploads->put('file','head_img',1024,'image','uniqid');
|
||||
$upHeadRes = $upRes->getData();
|
||||
if($upHeadRes['status'] == 0){
|
||||
$name_path = $upHeadRes['url'];
|
||||
//$name = $file->hashName();
|
||||
//$image = \think\Image::open("uploads/$name_path");
|
||||
//$image->thumb(168, 168)->save("uploads/$name_path");
|
||||
|
||||
//查出当前用户头像删除原头像并更新
|
||||
$imgPath = Db::name('user')->where('id',$this->uid)->value('user_img');
|
||||
if(file_exists('.'.$imgPath)){
|
||||
$dirPath = dirname('.'.$imgPath);
|
||||
if($dirPath !== './static/res/images/avatar'){ //防止删除默认头像
|
||||
unlink('.'.$imgPath);
|
||||
}
|
||||
}
|
||||
$result = Db::name('user')
|
||||
->where('id',$this->uid)
|
||||
->update(['user_img'=>$name_path]);
|
||||
Cache::tag(['user','tagArtDetail','tagArt'])->clear();
|
||||
if($result) {
|
||||
$res = ['status'=>0,'msg'=>'头像更新成功'];
|
||||
} else {
|
||||
$res = ['status'=>1,'msg'=>'头像更新失败'];
|
||||
}
|
||||
} else {
|
||||
$res = ['status'=>1,'msg'=>'上传错误'];
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
|
||||
|
||||
public function message()
|
||||
{
|
||||
$uid = Session::get('user_id');
|
||||
$msg = Message::receveMsg($uid);
|
||||
|
||||
View::assign('msg',$msg);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//个人页
|
||||
public function home($id)
|
||||
{
|
||||
//用户
|
||||
$u = Cache::get('user'.$id);
|
||||
if(!$u){
|
||||
$u = Db::name('user')->field('name,nickname,city,sex,sign,user_img,point,vip,create_time')->cache(3600)->find($id);
|
||||
}
|
||||
|
||||
|
||||
//用户发贴
|
||||
$arts = Db::name('user')->alias('u')->join('article a','u.id = a.user_id')->field('u.id,a.id,a.title,a.pv,a.is_hot,a.create_time,a.delete_time')->where('a.delete_time',0)->where('a.user_id',$id)->order(['a.create_time'=>'desc'])->cache(3600)->select();
|
||||
//用户回答
|
||||
$reys = Db::name('comment')->alias('c')->join('article a','c.article_id = a.id')->field('a.id,a.title,c.content,c.create_time,c.delete_time')->where(['a.delete_time'=>0,'c.delete_time'=>0])->where('c.user_id',$id)->order(['c.create_time'=>'desc'])->cache(3600)->select();
|
||||
|
||||
View::assign(['u'=>$u,'arts'=>$arts,'reys'=>$reys,'jspage'=>'']);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
|
||||
public function layout()
|
||||
{
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//邮箱激活
|
||||
public function activate()
|
||||
{
|
||||
//管理员邮箱
|
||||
$adminEmail = Db::name('user')->where('id',1)->cache(true)->value('email');
|
||||
View::assign('adminEmail',$adminEmail);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//邮箱激活
|
||||
public function active()
|
||||
{
|
||||
|
||||
if(Request::isPost()){
|
||||
$email = Request::param('email');
|
||||
$url = Request::domain().Request::root().'/active/index?url='.time().md5($email).$this->uid;
|
||||
$content = "Hi亲爱的{$this->showUser($this->uid)['name']}:</br>您正在进行邮箱激活,请在10分钟内完成激活。 <a href='{$url}' target='_blank' >请点击进行激活</a> </br>若无法跳转请复制链接激活:{$url}";
|
||||
$res = mailto($email,'邮箱激活',$content);
|
||||
if($res){
|
||||
return json(['status'=>0]);
|
||||
}else{
|
||||
return json(['status'=>-1,'发送邮件出错!']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//修改密码
|
||||
public function setPass()
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$data = Request::param();
|
||||
$validate = new userValidate;
|
||||
$res = $validate->scene('setPass')->check($data);
|
||||
if(!$res){
|
||||
return $this->error($validate->getError());
|
||||
}
|
||||
$user = new userModel;
|
||||
$result = $user->setpass($data);
|
||||
if($result == 1) {
|
||||
Session::clear();
|
||||
Cookie::delete('auth');
|
||||
return $this->success('密码修改成功 请登录', (string) url('login/index'));
|
||||
} else {
|
||||
return $this->error($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//退出账户
|
||||
public function logout()
|
||||
{
|
||||
Session::clear();
|
||||
Cookie::delete('auth');
|
||||
//Cookie::delete('user_name');
|
||||
//Cookie::delete('user_id');
|
||||
if(Session::has('user_id')){
|
||||
return json(['code' => -1, 'msg' => '退出失败']);
|
||||
} else {
|
||||
return json(['code' => 200, 'msg' => '退出成功', 'url' => '/']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
55
public/admin/style/login.css
Normal file
55
public/admin/style/login.css
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
|
||||
@Name:layuiAdmin 登入注册页
|
||||
@Author:贤心
|
||||
@Site:http://www.layui.com/admin/
|
||||
@License:GPL-2
|
||||
|
||||
*/
|
||||
|
||||
html,body,#LAY_app{height:100%; background: url(res/bg1.jpg) no-repeat center; background-size: cover;}
|
||||
.layui-layout-body{overflow: auto;}
|
||||
|
||||
#LAY-user-login,
|
||||
.layadmin-user-display-show{display: block !important;}
|
||||
.layadmin-user-login{position: relative; left: 0; top: 0; padding: 110px 0; min-height: 100%; box-sizing: border-box;}
|
||||
.layadmin-user-login-main{width: 375px; margin: 0 auto; box-sizing: border-box; background-color:rgba(0,0,0,.6); border:1px solid; border-radius:15px}
|
||||
.layadmin-user-login-box{padding: 20px;}
|
||||
.layadmin-user-login-header{text-align: center;}
|
||||
.layadmin-user-login-header h2{margin-bottom: 10px; font-weight: 300; font-size: 30px; color: #000;}
|
||||
.layadmin-user-login-header p{font-weight: 300; color: #999;}
|
||||
|
||||
.layadmin-user-login-body .layui-form-item{position: relative;}
|
||||
.layadmin-user-login-icon{position: absolute; left: 1px; top: 1px; width: 38px; line-height: 36px; text-align: center; color: #d2d2d2;}
|
||||
.layadmin-user-login-body .layui-form-item .layui-input{padding-left: 38px;}
|
||||
.layadmin-user-login-codeimg{max-height: 38px; width: 100%; cursor: pointer; box-sizing: border-box;}
|
||||
|
||||
.layadmin-user-login-other{position: relative; font-size: 0; line-height: 38px; padding-top: 20px;}
|
||||
.layadmin-user-login-other>*{display: inline-block; vertical-align: middle; margin-right: 10px; font-size: 14px;}
|
||||
.layadmin-user-login-other .layui-icon{position: relative; top: 2px; font-size: 26px;}
|
||||
.layadmin-user-login-other a:hover{opacity: 0.8;}
|
||||
|
||||
.layadmin-user-jump-change{float: right;}
|
||||
|
||||
.layadmin-user-login-footer{position: absolute; left: 0; bottom: 0; width: 100%; line-height: 30px; padding: 20px; text-align: center; box-sizing: border-box; color: rgba(0,0,0,.5)}
|
||||
.layadmin-user-login-footer span{padding: 0 5px;}
|
||||
.layadmin-user-login-footer a{padding: 0 5px; color: rgba(0,0,0,.5);}
|
||||
.layadmin-user-login-footer a:hover{color: rgba(0,0,0,1);}
|
||||
|
||||
/* 有背景图时 */
|
||||
.layadmin-user-login-main[bgimg]{background-color: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.05);}
|
||||
|
||||
/* 主题背景 */
|
||||
.ladmin-user-login-theme{position: fixed; bottom: 0; left: 0; width: 100%; text-align: center;}
|
||||
.ladmin-user-login-theme ul{display: inline-block; padding: 5px; background-color: #fff;}
|
||||
.ladmin-user-login-theme ul li{display: inline-block; vertical-align: top; width: 64px; height: 43px; cursor: pointer; transition: all .3s; -webkit-transition: all .3s; background-color: #f2f2f2;}
|
||||
.ladmin-user-login-theme ul li:hover{opacity: 0.9}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.layadmin-user-login{padding-top: 60px;}
|
||||
.layadmin-user-login-main{width: 300px;}
|
||||
.layadmin-user-login-box{padding: 10px;}
|
||||
}
|
||||
|
||||
|
||||
|
BIN
public/admin/style/res/bg.jpg
Normal file
BIN
public/admin/style/res/bg.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 310 KiB |
BIN
public/admin/style/res/bg1.jpg
Normal file
BIN
public/admin/style/res/bg1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 314 KiB |
@ -26,7 +26,7 @@ i{font-style: normal;}
|
||||
|
||||
.site-menu{position: fixed; top: 0; bottom: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; z-index: 10001; left: -300px; background-color: #fff; transition: all .3s;}
|
||||
/* 头部伸缩菜单栏 */
|
||||
.site-tree-mobile-top{display: block!important; position: fixed; z-index: 16666668; top: 2px; left: 10px; width: 57px; height: 57px; line-height: 57px; border-radius: 2px; text-align: center; color: #e2e2e2;}
|
||||
.site-tree-mobile-top{display: block!important; position: fixed; z-index: 16666668; top: 2px; left: 50%; width: 57px; height: 57px; line-height: 57px; border-radius: 2px; text-align: center; color: #e2e2e2;}
|
||||
.site-home .site-tree-mobile-top{display: none!important;}
|
||||
.site-mobile .site-tree-mobile-top{display: none !important;}
|
||||
.site-mobile .site-menu{left: 0;}
|
||||
@ -430,8 +430,9 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.jie-row li .jie-user img{position:relative; top: 16px; width: 35px; height: 35px;}
|
||||
|
||||
/* Detail页 */
|
||||
.detail-box{position: relative;padding-left: 20px; padding-top: 15px; padding-right: 20px; padding-bottom: 20px;}
|
||||
.detail h1{font-size: 22px; line-height: 36px; padding-bottom:10px;}
|
||||
.detail-box{position: relative; padding-left: 20px; padding-top: 15px; padding-right: 20px; padding-bottom: 20px;}
|
||||
.detail h1{float: left; font-size: 22px; line-height: 36px; padding-bottom:10px;}
|
||||
.detail-box .title span {float: right; padding-right: 5px;}
|
||||
.detail .fly-avatar{position: absolute; left: 15px; top: 10px;}
|
||||
.detail .fly-avatar img{display: block; width: 45px; height: 45px; margin: 0; border-radius: 100%;}
|
||||
.detail .fly-avatar .icon-renzheng{display: inline-block; width: 15px; height: 15px; line-height: 15px; top: 25px; left: 32px; background-color: #FFB800; color: #fff; border-radius: 50%; font-size: 14px;}
|
||||
|
@ -11,15 +11,16 @@
|
||||
<div class="layui-col-md8 content detail">
|
||||
<div class="fly-panel detail-box">
|
||||
{//标题}
|
||||
<h1 style="color:{$article.title_color};">{$article.title}
|
||||
<div class="title layui-clear">
|
||||
<h1 style="color:{$article.title_color};">{$article.title}</h1>
|
||||
{if ($article.jie == 0)}
|
||||
<span class="layui-btn layui-btn-xs" style="background-color: #FF5722;">{:lang('no finished')}</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs" style="background-color: #009688;">{:lang('finished')}</span>
|
||||
{/if}
|
||||
<span id="LAY_jieAdmin" data-id="{$article['id']}"></span>
|
||||
<span class="layui-hide-xs"><div onclick="PhoneDown();" style="" class="detail_qrcode" id="mobile"></div></span>
|
||||
</h1>
|
||||
</div>
|
||||
<div onclick="PhoneDown();" style="" class="detail_qrcode" id="mobile"></div>
|
||||
|
||||
{//图标}
|
||||
<div class="user-questions">
|
||||
@ -35,7 +36,7 @@
|
||||
|
||||
{//问题内容}
|
||||
<div>问题描述:</div>
|
||||
<div class="detail-body-wenda photos">{$article.content|raw}</div>
|
||||
<div class="detail-body-wenda photos" id="content">{$article.content}</div>
|
||||
|
||||
{//管理}
|
||||
{if (($article.upzip !== '') || (session('user_id')==$article.user_id) OR ($user.auth ?? ''))}
|
||||
@ -105,7 +106,7 @@
|
||||
<div class="detail-hits"><span class="post-time" data="{$vo.create_time}"></span></div>
|
||||
{if $vo.cai == 1}<i class="iconfont icon-caina" title="最佳答案"></i>{/if}
|
||||
</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content}</div>
|
||||
<div class="jieda-reply">
|
||||
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan">
|
||||
<i class="iconfont icon-zan"></i><em>{$vo.zan}</em>赞
|
||||
@ -176,6 +177,7 @@
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
articleJieset = "{:url('Article/jieset')}",
|
||||
@ -292,19 +294,25 @@ layui.use(['fly', 'face','colorpicker','plyr'], function(){
|
||||
});
|
||||
|
||||
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
|
||||
$('.detail-body-wenda').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
othis.html(fly.content(html));
|
||||
});
|
||||
// $('.detail-body-wenda').each(function(){
|
||||
// var othis = $(this), html = othis.html();
|
||||
// othis.html(fly.content(html));
|
||||
// });
|
||||
|
||||
$('.detail-body').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
othis.html(fly.content(html));
|
||||
});
|
||||
|
||||
//加载播放器
|
||||
plyr.setup();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('markdownhook')}
|
||||
|
||||
<script>
|
||||
//扫码阅读
|
||||
$("#rdown").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
@ -339,4 +347,5 @@ $("#rdown").hover(function(){
|
||||
s.parentNode.insertBefore(bp, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
{/block}
|
@ -41,10 +41,11 @@
|
||||
<!--span style="padding-right: 10px; color: #FF7200">悬赏:60飞吻</span-->
|
||||
<span class="post-time" data="{$article.create_time}" style="padding-top: 5px;"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="detail-body photos">{$article.content|raw}</div>
|
||||
<div class="detail-body photos">{$article.content}</div>
|
||||
{//管理}
|
||||
{if (($article.upzip !== '') || (session('user_id')==$article.user_id) OR ($user.auth ?? ''))}
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="detail-assist">
|
||||
{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>
|
||||
@ -92,8 +93,9 @@
|
||||
{if condition="$article.user.id eq $vo.user.id"}<span>({:lang('poster')})</span>{/if}
|
||||
</div>
|
||||
<div class="detail-hits"><span class="post-time" data="{$vo.create_time}"></span></div>
|
||||
{if $vo.cai == 1}<i class="iconfont icon-caina" title="最佳答案"></i>{/if}
|
||||
</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content}</div>
|
||||
<div class="jieda-reply">
|
||||
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan">
|
||||
<i class="iconfont icon-zan"></i><em>{$vo.zan}</em>
|
||||
@ -105,6 +107,7 @@
|
||||
<span type="edit">{:lang('edit')}</span>
|
||||
<span type="del">{:lang('delete')}</span>
|
||||
{/if}
|
||||
{if ($vo.cai == 0) && ((session('user_id') == $article.user_id) OR ($user.auth ?? '')) /}<span class="jieda-accept" type="accept">{:lang('accept')}</span>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user