From 040f6eece84cde35b82664161180984093dba6d2 Mon Sep 17 00:00:00 2001 From: taoser Date: Tue, 3 Aug 2021 17:33:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=9A=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=A4=9A=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- app/admin/controller/Forum.php | 61 ++-- app/admin/controller/Sign.php | 4 +- app/admin/controller/Vip.php | 4 +- app/admin/view/forum/tags.html | 61 ++-- app/admin/view/forum/tagsform.html | 8 + app/admin/view/set/system/server.html | 10 +- app/admin/view/slider/index.html | 6 +- app/common.php | 2 +- app/common/controller/BaseController.php | 2 + app/common/model/Article.php | 26 +- app/common/model/Cate.php | 6 +- app/index/controller/Article.php | 29 +- app/install/data/taoler.sql | 7 +- config/taoler.php | 2 +- extend/taoler/com/Files.php | 23 ++ public/static/admin/modules/forum.js | 11 +- public/static/admin/style/admin.css | 2 - public/static/res/css/global.css | 135 ++++--- public/static/res/mods/index.js | 3 +- view/taoler/index/article/ask/cate.html | 118 ++++++ view/taoler/index/article/ask/detail.html | 341 ++++++++++++++++++ view/taoler/index/article/posts/cate.html | 109 ++++++ view/taoler/index/article/posts/detail.html | 315 ++++++++++++++++ view/taoler/index/article/说明.txt | 11 + view/taoler/index/index/index.html | 1 - view/taoler/index/public/header.html | 4 +- view/taoler/index/public/index-forumlist.html | 2 - view/taoler/index/user/home.html | 2 +- 29 files changed, 1121 insertions(+), 188 deletions(-) create mode 100644 view/taoler/index/article/ask/cate.html create mode 100644 view/taoler/index/article/ask/detail.html create mode 100644 view/taoler/index/article/posts/cate.html create mode 100644 view/taoler/index/article/posts/detail.html create mode 100644 view/taoler/index/article/说明.txt diff --git a/README.md b/README.md index a766253..989b57e 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ * 后台:http://adm.aieok.com:888 * 账号:test * 密码:test123 - * 版本:TaoLer 1.7.25 - * 日期:2021.7.23 + * 版本:TaoLer 1.7.28 + * 日期:2021.8.03 #### 项目地址 diff --git a/app/admin/controller/Forum.php b/app/admin/controller/Forum.php index 2a46a13..e133acb 100644 --- a/app/admin/controller/Forum.php +++ b/app/admin/controller/Forum.php @@ -12,7 +12,9 @@ use think\facade\View; use think\facade\Request; use think\facade\Db; use think\facade\Session; +use think\facade\Cache; use think\exception\ValidateException; +use taoler\com\Files; class Forum extends AdminController { @@ -150,63 +152,66 @@ class Forum extends AdminController $res['count']= count($list); $res['data'] = []; foreach($list as $k=>$v){ - $res['data'][] = ['sort'=>$v['sort'],'id' => $v['id'],'tags'=>$v['catename'],'ename'=>$v['ename'],'icon'=>$v['icon'],'is_hot'=>$v['is_hot'],'desc'=>$v['desc']]; + $res['data'][] = ['sort'=>$v['sort'],'id' => $v['id'],'tags'=>$v['catename'],'ename'=>$v['ename'],'detpl'=>$v['detpl'],'icon'=>$v['icon'],'is_hot'=>$v['is_hot'],'desc'=>$v['desc']]; } } return json($res); } + //详情模板 + $sys = $this->getSystem(); + $template = Files::getDirName('../view/'.$sys['template'].'/index/article/'); + View::assign(['template'=>$template]); return View::fetch(); } - //添加帖子分类 - public function addtags() + //添加和编辑帖子分类 + public function tagsform() { + $addOrEdit = !is_null(input('id'));//true是编辑false新增 + $msg = $addOrEdit ? lang('edit') : lang('add'); if(Request::isAjax()){ $data = Request::param(); $list = Db::name('cate')->cache('catename')->save($data); if($list){ - return json(['code'=>0,'msg'=>'添加分类成功']); + return json(['code'=>0,'msg'=> $msg.'分类成功']); }else{ - return json(['code'=>-1,'msg'=>'添加分类失败']); + return json(['code'=>-1,'msg'=> $msg.'分类失败']); } } - return view('tagsform'); - + $tplname = $addOrEdit ? Db::name('cate')->where('id',input('id'))->value('detpl') : ''; + //详情模板 + $sys = $this->getSystem(); + $template = Files::getDirName('../view/'.$sys['template'].'/index/article/'); + View::assign(['template'=>$template,'tplname'=>$tplname]); + return View::fetch(); } - //编辑帖子分类 - public function tagsform() + //详情页模板设置 + public function tplSet() { - if(Request::isAjax()){ - $data = Request::param(); - $list = Db::name('cate')->cache('catename')->update($data); - - if($list){ - return json(['code'=>0,'msg'=>'修改分类成功']); - }else{ - return json(['code'=>-1,'msg'=>'修改分类失败']); - } + if(Request::isPost()){ + $data = Request::only(['id','detpl']); + Db::name('cate')->cache('catename')->update($data); } - return View::fetch(); + } //删除帖子分类 public function tagsdelete() { if(Request::isAjax()){ - $data = Request::param(); + $id = Request::param('id'); $cate = new Cate; - $result = $cate->del($data); + $result = $cate->del($id); - - if($result == 1){ - Cache::tag('catename')->clear(); - return json(['code'=>0,'msg'=>'删除分类成功']); - }else{ - return json(['code'=>-1,'msg'=>'删除分类失败']); - } + if($result == 1){ + Cache::tag('catename')->clear(); + return json(['code'=>0,'msg'=>'删除分类成功']); + }else{ + return json(['code'=>-1,'msg'=>$result]); + } } } diff --git a/app/admin/controller/Sign.php b/app/admin/controller/Sign.php index a338532..d2d6906 100644 --- a/app/admin/controller/Sign.php +++ b/app/admin/controller/Sign.php @@ -1,13 +1,13 @@ +.layui-table-body, .layui-table-box, .layui-table-cell{ +overflow: visible; +} + +/* 设置下拉框的高度与表格单元相同 */ + td .layui-table-cell .layui-form-select { + margin-top: -10px; + margin-left: -15px; + margin-right: -15px; +} + +{/block} {block name="body"}
@@ -10,6 +24,13 @@
+
diff --git a/app/admin/view/slider/index.html b/app/admin/view/slider/index.html index 4a1dbbd..eeb8163 100644 --- a/app/admin/view/slider/index.html +++ b/app/admin/view/slider/index.html @@ -40,10 +40,10 @@ {$vo.slid_over|date='Y-m-d'} {$vo.slid_status ?'显示':'禁止'} - 编辑 + {if condition="checkRuleButton('admin/Slider/delete')"} - 删除 - {else /}删除{/if} + + {else /}{/if} {/volist} diff --git a/app/common.php b/app/common.php index a86f569..297d81f 100644 --- a/app/common.php +++ b/app/common.php @@ -91,7 +91,7 @@ function getCateDesc($ename) //过滤文章摘要 function getArtContent($content) { - return mb_substr(strip_tags($content),0,100).'...'; + return mb_substr(strip_tags($content),0,50).'...'; } diff --git a/app/common/controller/BaseController.php b/app/common/controller/BaseController.php index 4ae6189..8adb164 100644 --- a/app/common/controller/BaseController.php +++ b/app/common/controller/BaseController.php @@ -59,6 +59,7 @@ class BaseController extends BaseCtrl //2.将catelist变量赋给模板 公共模板nav.html View::assign('cateList',$cateList); + return $cateList; } @@ -95,6 +96,7 @@ class BaseController extends BaseCtrl Cache::set('footlinks',$foot_links,3600); } View::assign(['sysInfo'=>$sysInfo,'headlinks'=>$head_links,'footlinks'=>$foot_links]); + return $sysInfo; } } diff --git a/app/common/model/Article.php b/app/common/model/Article.php index 77611c4..9a59042 100644 --- a/app/common/model/Article.php +++ b/app/common/model/Article.php @@ -124,7 +124,7 @@ class Article extends Model $artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_hot,pv,jie,upzip,has_img,has_video,has_audio') ->with([ 'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename,ename'); + $query->where('delete_time',0)->field('id,catename,ename,detpl'); }, 'user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); @@ -209,7 +209,7 @@ class Article extends Model switch ($type) { //查询文章,15个分1页 case 'jie': - $artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ + $artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename,ename'); }, @@ -225,7 +225,7 @@ class Article extends Model break; case 'hot': - $artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ + $artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename,ename'); }, @@ -241,7 +241,7 @@ class Article extends Model break; case 'top': - $artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ + $artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename,ename'); }, @@ -255,9 +255,25 @@ class Article extends Model 'path' =>$url.'[PAGE]'.$suffix ]); break; + + case 'wait': + $artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ + 'cate' => function($query){ + $query->where('delete_time',0)->field('id,catename,ename'); + }, + 'user' => function($query){ + $query->field('id,name,nickname,user_img,area_id,vip'); + } + ])->withCount(['comments'])->where('status',1)->where($where)->where('jie',0)->order(['is_top'=>'desc','create_time'=>'desc']) + ->paginate([ + 'list_rows' => 15, + 'page' => $page, + 'path' =>$url.'[PAGE]'.$suffix + ]); + break; default: - $artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ + $artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename,ename'); }, diff --git a/app/common/model/Cate.php b/app/common/model/Cate.php index 6327d31..2a097f9 100644 --- a/app/common/model/Cate.php +++ b/app/common/model/Cate.php @@ -11,15 +11,15 @@ class Cate extends Model protected $deleteTime = 'delete_time'; protected $defaultSoftDelete = 0; - public function del($data) + public function del($id) { - $cates = $this->find($data['id']); + $cates = $this->find($id); $res = $cates->delete(); if($res){ return 1; }else{ - return -1; + return '删除分类失败'; } } diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index d63800e..cde7cca 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -33,7 +33,7 @@ class Article extends BaseController //获取分类ID $ename = Request::param('ename'); $type = Request::param('type') ?? 'all'; - + $tpl = Db::name('cate')->where('ename',$ename)->value('detpl'); //分页伪静态 $str = Request::baseUrl(); //不带参数在url $patterns = "/\d+/"; //数字正则 @@ -74,7 +74,7 @@ class Article extends BaseController $ad_comm = $ad->getSliderList(6); View::assign(['type'=>$type,'artList'=>$artList,'artHot'=>$artHot,'ad_cateImg'=>$ad_cateImg,'ad_comm'=>$ad_comm,'jspage'=>'jie']); - return View::fetch(); + return View::fetch('article/'.$tpl.'/cate'); } //文章详情页 @@ -82,6 +82,8 @@ class Article extends BaseController { $article = new ArticleModel(); $artDetail = $article->getArtDetail($id); + $arId = $artDetail->cate->id; + $tpl = Db::name('cate')->where('id',$arId)->value('detpl'); if(!$artDetail){ // 抛出 HTTP 异常 throw new \think\exception\HttpException(404, '异常消息'); @@ -92,22 +94,7 @@ class Article extends BaseController //dump($comments); $artDetail->inc('pv')->update(); $pv = Db::name('article')->field('pv')->where('id',$id)->value('pv'); - $download = $artDetail->upzip ? download($artDetail->upzip,'file') : ''; - -/* - $nt = time(); - $ft = $article->comments; - $ct[] = []; - foreach($ft as $c){ - $t = $c->create_time; - $ct[] = intval(($nt - strtotime($t))/86400); - } - dump($nt); - dump($ct); - $this->assign('ct',$ct); - $article->append(['comment.ct'])->toArray(); - //halt($article); -*/ + $download = $artDetail->upzip ? download($artDetail->upzip,'file') : ''; // 热议文章 $artHot = $article->getArtHot(10); @@ -117,9 +104,9 @@ class Article extends BaseController $ad_artImg = $ad->getSliderList(4); //分类钻展赞助 $ad_comm = $ad->getSliderList(7); - + View::assign(['article'=>$artDetail,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_artImg,'ad_comm'=>$ad_comm,$download,'jspage'=>'jie']); - return View::fetch(); + return View::fetch('article/'.$tpl.'/detail'); } //文章评论 @@ -167,7 +154,7 @@ class Article extends BaseController { if (Request::isAjax()) { $data = Request::only(['cate_id', 'title', 'title_color', 'user_id', 'content', 'upzip', 'tags', 'captcha']); - $validate = new \app\common\validate\Article; //调用验证器 + $validate = new \app\common\validate\Article; //调用验证器 $result = $validate->scene('Artadd')->check($data); //进行数据验证 if (true !== $result) { return Msgres::error($validate->getError()); diff --git a/app/install/data/taoler.sql b/app/install/data/taoler.sql index 242fb78..961fff3 100644 --- a/app/install/data/taoler.sql +++ b/app/install/data/taoler.sql @@ -270,6 +270,7 @@ CREATE TABLE `tao_cate` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id', `catename` varchar(20) NOT NULL COMMENT '导航名称', `ename` varchar(20) NOT NULL DEFAULT '' COMMENT '分类别名', + `detpl` varchar(20) NOT NULL COMMENT '详情模板', `icon` varchar(50) DEFAULT NULL COMMENT '图标', `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序', `status` enum('0','1') NOT NULL DEFAULT '1' COMMENT '状态1启用0禁用', @@ -286,9 +287,9 @@ CREATE TABLE `tao_cate` ( -- ---------------------------- -- Records of tao_cate -- ---------------------------- -INSERT INTO `tao_cate` VALUES ('1', '提问', 'ask', 'layui-icon-help', '1', '1', '0', 'TaoLer社区提问专栏1', '0', '0', '0', '0'); -INSERT INTO `tao_cate` VALUES ('2', '分享', 'share', 'layui-icon-share', '2', '1', '0', '', '0', '0', '0', '0'); -INSERT INTO `tao_cate` VALUES ('3', '讨论', 'talk', 'layui-icon-dialogue', '3', '1', '0', '', '1', '0', '0', '0'); +INSERT INTO `tao_cate` VALUES ('1', '提问', 'ask', 'ask', 'layui-icon-help', '1', '1', '0', 'TaoLer社区提问专栏1', '0', '0', '0', '0'); +INSERT INTO `tao_cate` VALUES ('2', '分享', 'share', 'posts', 'layui-icon-share', '2', '1', '0', '', '0', '0', '0', '0'); +INSERT INTO `tao_cate` VALUES ('3', '讨论', 'talk', 'posts', 'layui-icon-dialogue', '3', '1', '0', '', '1', '0', '0', '0'); -- ---------------------------- -- Table structure for tao_collection diff --git a/config/taoler.php b/config/taoler.php index 7634370..eb342ef 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -7,7 +7,7 @@ return [ //应用名,此项不可更改 'appname' => 'TaoLer', //版本配置 - 'version' => '1.7.27', + 'version' => '1.7.28', //加盐 'salt' => 'taoler', //数据库备份目录 diff --git a/extend/taoler/com/Files.php b/extend/taoler/com/Files.php index 83c2ec4..ad3bdb3 100644 --- a/extend/taoler/com/Files.php +++ b/extend/taoler/com/Files.php @@ -35,6 +35,29 @@ class Files } } + /** + * 获取目录下文件 + * @param $path string 目录 + * @return array + */ + public static function getDirFiles($path,$type) + { + if (is_dir($path)) { + $arr = array(); + $data = scandir($path); + foreach ($data as $value){ + if($value !='.' && $value != '..'){ + if($type == 1){//获取文件夹下文件名 index.html + $arr[] = $value; + }else{//获取无后缀名称 index + $arr[] = basename($value,".html"); + } + } + } + return $arr; + } + } + /** * 列出目录下的所有文件,包括子目录文件,不包含sql目录 * @param $dirName diff --git a/public/static/admin/modules/forum.js b/public/static/admin/modules/forum.js index 6dc7823..60ca5d0 100644 --- a/public/static/admin/modules/forum.js +++ b/public/static/admin/modules/forum.js @@ -220,11 +220,9 @@ layui.define(['table', 'form'], function(exports){ ,{field: 'id', title: 'ID',width: 60} ,{field: 'tags', title: '分类名', minWidth: 100} ,{field: 'ename', title: 'EN别名', minWidth: 100} - ,{ - title: '图标', align: 'center', - templet: '

' - } - ,{field: 'is_hot', title: '热门', templet: '#buttonHot'} + ,{field: 'detpl',title: '模板', align: 'center',width: 100,templet: '#inputSel'} + ,{title: '图标', align: 'center',width: 50,templet: '

'} + ,{field: 'is_hot', title: '热门', align: 'center',width: 50, templet: '#buttonHot'} ,{field: 'desc', title: '描述', minWidth: 100} ,{title: '操作', width: 100, align: 'center', toolbar: '#layuiadmin-app-cont-tagsbar'} ]] @@ -276,6 +274,7 @@ layui.define(['table', 'form'], function(exports){ ,sort = othis.find('input[name="sort"]').val() ,tags = othis.find('input[name="tags"]').val() ,ename = othis.find('input[name="ename"]').val() + ,detpl = othis.find('select[name="detpl"]').val() ,icon = othis.find('input[name="icon"]').val() ,desc = othis.find('input[name="desc"]').val(); @@ -284,7 +283,7 @@ layui.define(['table', 'form'], function(exports){ $.ajax({ type:"post", url:forumTagsForm, - data:{"id":data.id,"sort":sort,"catename":tags,"ename":ename,"icon":icon,"desc":desc}, + data:{"id":data.id,"sort":sort,"catename":tags,"ename":ename,"detpl":detpl,"icon":icon,"desc":desc}, daType:"json", success:function (data){ if (data.code == 0) { diff --git a/public/static/admin/style/admin.css b/public/static/admin/style/admin.css index 98e9446..22c58fb 100644 --- a/public/static/admin/style/admin.css +++ b/public/static/admin/style/admin.css @@ -539,5 +539,3 @@ html{background-color: #f2f2f2; color: #666;} .xm-body .xm-option.hide-icon.selected { background-color: #1890ff !important; } - - diff --git a/public/static/res/css/global.css b/public/static/res/css/global.css index 96e8319..4ded2d5 100644 --- a/public/static/res/css/global.css +++ b/public/static/res/css/global.css @@ -63,148 +63,77 @@ i{font-style: normal;} } .icon-zan:before { content: "\e612"; } - .icon-jiazaizhong:before { content: "\e60e"; } - .icon-sousuo:before { content: "\e621"; } - .icon-quanpingpad:before { content: "\e61d"; } - .icon-shezhi:before { content: "\e607"; } - .icon-renzhengv:before { content: "\e62b"; } - .icon-shijian:before { content: "\e60a"; } - .icon-guanbi:before { content: "\e614"; } - .icon-tianjia:before { content: "\e616"; } - .icon-tuichu:before { content: "\e601"; } - .icon-shui:before { content: "\e602"; } - .icon-qq:before { content: "\e618"; } - .icon-weibo:before { content: "\e617"; } - .icon-tupian:before { content: "\e608"; } - .icon-logo:before { content: "\e603"; } - .icon-daima:before { content: "\e609"; } - .icon-biaoqing:before { content: "\e60f"; } - .icon-nan:before { content: "\e619"; } - .icon-nv:before { content: "\e61a"; } - .icon-quitquanping:before { content: "\e61e"; } - .icon-zuichun:before { content: "\e61c"; } - .icon-charushuipingxian:before { content: "\e622"; } - .icon-yulan:before { content: "\e60d"; } - .icon-liulanyanjing:before { content: "\e60b"; } - .icon-touxiang:before { content: "\e604"; } - .icon-caina:before { content: "\e613"; } - .icon-room:before { content: "\e615"; } - .icon-svgmoban53:before { content: "\e610"; } - .icon-shichang:before { content: "\e600"; } - .icon-shouye:before { content: "\e605"; } - .icon-tishilian:before { content: "\e629"; } - .icon-fabu:before { content: "\e606"; } - .icon-pinglun:before { content: "\e60c"; } - .icon-zan1:before { content: "\e611"; } - .icon-chengshi:before { content: "\e61b"; } - .icon-lianjie:before { content: "\e620"; } - .icon-yulan1:before { content: "\e785"; } - .icon-renshu:before { content: "\e61f"; } - .icon-huizongzuoyoutuodong:before { content: "\e623"; } - .icon-404:before { content: "\e627"; } - .icon-iconmingxinganli:before { content: "\e652"; } - .icon-wenda:before { content: "\e626"; } - .icon-top:before { content: "\e624"; } - .icon-ui:before { content: "\e625"; } - .icon-fengexian:before { content: "\e63a"; } - .icon-jiacu:before { content: "\e62f"; } - .icon-kiss:before { content: "\e6cd"; } - .icon-biaoqing1:before { content: "\e63b"; } - .icon-liwu:before { content: "\e9c5"; } - .icon-emwdaima:before { content: "\e62a"; } - .icon-quanzi:before { content: "\e7bb"; } - .icon-wendang:before { content: "\e722"; } - .icon-jifen:before { content: "\e632"; } - .icon-aqrenzheng:before { content: "\e62d"; } - .icon-pinglun1:before { content: "\e631"; } - .icon-web:before { content: "\e6e9"; } - .icon-yxj-expression:before { content: "\e628"; } - .icon-tongzhi:before { content: "\e647"; } - .icon-kaifashili:before { content: "\e638"; } - .icon-huiyuan:before { content: "\e637"; } - .icon-pinglun2:before { content: "\e62c"; } - .icon-alipay:before { content: "\e630"; } - .icon-jiaoliu:before { content: "\e6b7"; } - .icon-chanpin:before { content: "\e634"; } - .icon-renzheng:before { content: "\e62e"; } - .icon-tiezi:before { content: "\e635"; } - .icon-rizhi:before { content: "\e69d"; } - .icon-weixinzhifu:before { content: "\e633"; } - .icon-yinyong:before { content: "\e636"; } - .icon-xiazai:before { content: "\e78e"; } - - /* 辅助 */ a:hover{color: #009688; transition: all .3s;} pre{position: relative; margin: 10px 0; padding: 15px; line-height: 20px; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;} @@ -378,6 +307,17 @@ pre{position: relative; margin: 10px 0; padding: 15px; line-height: 20px; border .layui-textarea:hover, .layui-textarea:focus{border-color: #e6e6e6 !important;} +/* 主页置顶列表 */ +.fly-panel-top{margin-bottom: 15px; padding: 5px 5px 10px 0px;border-radius: 2px; background-color: #fff; box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);} +.fly-panel-top[pad20]{padding: 20px;} +.fly-list-top li{position: relative; height: 20px; line-height: 20px; padding: 8px 15px 10px 20px; border-bottom: 1px dotted #e2e2e2;} +.fly-list-top li:last-child{border-bottom: none;} +.fly-list-top .top-list-tag{float:left;} +.fly-list-info-top{position: relative;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} +.fly-list-info-top span{font-size: 10px; color: #cccccc;} +.fly-list-top li h2{position: relative; left:15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} +.fly-list-top li h2 a{display: inline-block; padding-right: 10px; font-size: 16px;} + /* 列表 */ .fly-list li{position: relative; height: 45px; line-height: 22px; padding: 15px 15px 15px 75px; border-bottom: 1px dotted #e2e2e2;} .fly-list li:last-child{border-bottom: none;} @@ -417,7 +357,26 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co .layui-edit-face ul li{cursor: pointer; float: left; border: 1px solid #e8e8e8; height: 22px; width: 26px; overflow: hidden; margin: -1px 0 0 -1px; padding: 4px 2px; text-align: center;} .layui-edit-face ul li:hover{position: relative; z-index: 2; border: 1px solid #eb7350; background: #fff9ec;} -/* 签到 */ +/*问题列表*/ +.question-list{width: 100%;} +.question-list li{line-height: 30px; padding: 10px 15px 15px 20px; border-bottom: 1px dotted #e2e2e2; } +.que-sta-jie, +.que-sta-ask{float: left; margin-top:5px; margin-right:10px; text-align:center; padding:2px; width:38px; height:38px; line-height: 20px; border-radius: 10%; color: #fff;} +.que-sta-jie{background: #5FB878;} +.que-sta-ask{background: #FF5722;} +.que-body{width:100%; padding: 0px; } +.que-body h2{margin-right:10px; line-height: 26px; font-size: 16px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;} +.que-body h2 a{display: inline-block; max-width: 95%; height: 20px; font-size: 16px;} +.que-body .que-user-info{display: block; text-overflow: ellipsis;} +.que-body .que-user-info a{margin-right: 10px;} +.que-body .que-user-info .que-avatar{top: 20px;} +.que-body .que-user-info .que-avatar img{width: 25px; height: 25px; margin-top: 10; border-radius: 100%;} +.que-body .que-user-info .que-avatar i{position: absolute; left: 35px; top: 15px; } +.que-body .que-user-info span{display: inline-block; font-size: 12px; padding-left: 5px;} +.que-content{font-size: 14px; color:#999;} + + + /* 签到 */ .fly-signin cite{padding: 0 5px; color: #FF5722; font-style: normal;} .fly-signin .layui-badge-dot{top: -7px; margin-left: 0px;} .fly-signin-list{padding: 0; line-height: 30px;} @@ -471,8 +430,12 @@ 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{padding-left: 20px; padding-top: 15px; padding-right: 20px; padding-bottom: 20px;} +.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 .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;} + .fly-detail-info{position: relative; margin: 10px 0 15px;} .fly-detail-info .layui-btn{height: 20px; line-height: 20px; vertical-align: top; border-radius: 0;} .fly-detail-info .layui-btn+.layui-btn{margin-left: 0;} @@ -483,9 +446,9 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co .detail-about .jie-status, .detail-about .jie-status-ok{color:#fff;} .detail-about .fly-jing{padding:0 6px; background-color:#c00; color:#fff;} .detail-about .detail-hits{position: relative; top: 5px; line-height: 20px;} +.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 .icon-renzheng{top: 1px;} .fly-detail-user .guanzhu{position: absolute; right:10px; } .detail-assist{position: relative; height:22px; margin-top: 10px; line-height: 15px; padding: 5px 10px 5px 10px; font-size: 13px; background-color: #f8f8f8; color: #999;border-radius:5px;} @@ -515,6 +478,30 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co .detail-body ul>li{margin-top: 0;} .detail-body .layui-elem-quote{margin: 10px 0; font-size: 14px; line-height: 26px;} +/*详情页-问答*/ +.user-questions{position:relative; margin: 5px 0 15px;} +.user-questions .user-avatar img{width: 25px; height: 25px; margin-top: 10; border-radius: 100%;} +.user-questions .user-questions-right{position:absolute; right:0px; display: inline-block; font-size: 14px; padding-left: 5px;} +.user-questions .user-questions-right i{padding: 0 3px 0 15px; font-size: 22px; color: #999;} + +.detail-body-wenda{margin: 10px 0 5px; line-height: 26px; font-size: 16px; color: #999; word-wrap: break-word;} +.detail-body-wenda p{margin-bottom:15px;} +.detail-body-wenda img{max-width: 100%; cursor: pointer;} +.detail-body-wenda .layui-btn{margin: 0 10px 10px 0;} +.detail-body-wenda .layui-btn a{color: #fff;} +.detail-body-wenda ul>li{margin-top: 0;} +.detail-body-wenda .layui-elem-quote{margin: 10px 0; font-size: 14px; line-height: 26px;} +.layui-form-pane{position:relative; width:100%;} +.que-comments{position:absolute;right:20px;bottom:5px;} + +.wenda-user{height:200px; margin: 0,auto; text-align: center; pardding-top:20px;} +.wenda-user .user-img{posation:relative; width:100%;} +.wenda-user .user-img img{width:150px;height:150px; border-radius: 100%;} +.wenda-user .user-img i{posation:absolute;right:20px;top:30px;width: 25px; height:25px; color:#fff; font-site:18px; border-radius: 100%;background-color:#FFB800;} +.wenda-user .questions{height:30px;margin:20px 20px;} + + + /* 详情页的底部操作条 */ .site-tree-mobile-detail-bottom{display: block!important; position: fixed; z-index: 1000; bottom: 0px; left: 0px; width: 100%; height: 30px; line-height: 30px; border-radius: 2px; text-align: center; color: #e2e2e2;background:#eeeeee} .site-home .site-tree-mobile-detail-bottom{display: none!important;} diff --git a/public/static/res/mods/index.js b/public/static/res/mods/index.js index 55e3e77..8e82b0e 100644 --- a/public/static/res/mods/index.js +++ b/public/static/res/mods/index.js @@ -1097,12 +1097,11 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], shade: [0.2, '#000'] }); var url = $(this).data('url'); - var locationurl = $(this).attr('location-url'); $.getJSON(url, function(data) { if (data.code == 200) { layer.close(loading); layer.msg(data.msg, { icon: 1, time: 1000 }, function() { - location.href = locationurl; + location.href = data.url; }); } else { layer.close(loading); diff --git a/view/taoler/index/article/ask/cate.html b/view/taoler/index/article/ask/cate.html new file mode 100644 index 0000000..9f8dba4 --- /dev/null +++ b/view/taoler/index/article/ask/cate.html @@ -0,0 +1,118 @@ +{extend name="public/base" /} +{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block} +{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block} +{block name="description"}{$Request.param.ename|getCateDesc}{/block} +{block name="column"}{include file="/public/column" /}{/block} + +{block name="content"} +
+
+
+
+ +
    + {volist name="artList" id="art"} +
  • + {if ($art.jie == 1)} +
    + 已解 + +
    + {else /} +
    + 未解 + +
    + {/if} +
    +

    + {$art.title} +

    + +
    +
    {:getArtContent($art.content)}
    +
  • + {/volist} +
+ +
{$artList|raw}
+ + +
+ +
+
+
+
+ {volist name="ad_cateImg" id="vo"} + + {/volist} +
+
+
+
{:lang('hot post list')}
+ {volist name="artHot" id="vo"} +
+ {$vo.title} + {$vo.comments_count} +
+ {/volist} +
+ +
+
{:lang('sponsor')}- + {:lang('i want to join')} +
+
+ {volist name="ad_comm" id="vo"} + {$vo.slid_name} + {/volist} +
+
+
+
+
+{include file="public/menu" /} +{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/view/taoler/index/article/ask/detail.html b/view/taoler/index/article/ask/detail.html new file mode 100644 index 0000000..986bd69 --- /dev/null +++ b/view/taoler/index/article/ask/detail.html @@ -0,0 +1,341 @@ +{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} +{block name="link"}{/block} +{block name="column"}
{include file="/public/column" /}
{/block} +{block name="content"} +
+
+
+
+ {//标题} +

{$article.title} + {if ($article.jie == 0)} + {:lang('no finished')} + {else /} + {:lang('finished')} + {/if} + +
+

+ + {//图标} +
+ + {$article.user.name} + {$article.user.nickname ?: $article.user.name} + + 2019-12-01 + + {$comments->count()}{$pv} + +
+ + {//问题内容} +
问题描述:{$article.content|raw}
+ + {//管理} + {if (($article.upzip !== '') || session('?user_name'))} +
+ {notempty name="$article.upzip"} + + {/notempty} +
+ {if ($user.auth ?? '')} + + {if($article.is_top == 0)} + {else /}{:lang('cancel topping')}{/if} + {if($article.is_hot == 0)} + + {else /} + {:lang('cancel hoting')} + {/if} + {if($article.is_reply == 1)} + + {else /} + {:lang('enable reply')} + {/if} + {:lang('title color')} + {/if} + {if(session('user_name')==$article.user.name || ($user.auth ?? ''))} + {:lang('edit')} + {/if} +
+
+ {/if} +
+ {//评论区} + {if condition="$article.is_reply == 1"} +
+
+ +
+ +
+
+
+ + + +
+
+ {else /} +
本帖已设置禁止回复
+ {/if} + {//评论内容} +
+ 评论 {$comments->count()} +
    + {volist name="comments" id="vo" empty= ""} +
  • + +
    + +  {if($vo.user.vip > 0)}{/if} + +
    + + {$vo.user.nickname ?: $vo.user.name} + + {if condition="$article.user.id eq $vo.user.id"}({:lang('poster')}){/if} +
    +
    + {if $vo.cai == 1}{/if} +
    +
    {$vo.content|raw}
    +
    + + {$vo.zan}赞 + + {:lang('reply')} + {//评论编辑删除采纳权限} +
    + {if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')} + {:lang('edit')} + {:lang('delete')} + {/if} + {if ($vo.cai == 0) && ((session('user_id') == $article.user_id) OR ($user.auth ?? '')) /}{:lang('accept')}{/if} +
    +
    +
  • + {/volist} +
+
{$comments|raw}
+ +
+
+
+ +
+
+ +
+ 回答 100 提问 100 + 关注 +
+
+
+
+
{:lang('sponsor')}- + {:lang('i want to join')} +
+
+ {volist name="ad_comm" id="vo"} + {$vo.slid_name} + {/volist} +
+
+
+
{:lang('hot post list')}
+ {volist name="artHot" id="vo"} +
+ {$vo.title} + {$vo.comments_count} +
+ {/volist} +
+
+ {volist name="ad_art" id="vo"} + + {/volist} +
+
+
+ +
+
+
+
+{include file="public/menu" /} +{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/view/taoler/index/article/posts/cate.html b/view/taoler/index/article/posts/cate.html new file mode 100644 index 0000000..0c3b32d --- /dev/null +++ b/view/taoler/index/article/posts/cate.html @@ -0,0 +1,109 @@ +{extend name="public/base" /} +{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block} +{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block} +{block name="description"}{$Request.param.ename|getCateDesc}{/block} +{block name="column"}{include file="/public/column" /}{/block} + +{block name="content"} +
+
+
+
+ +
{$artList|raw}
+ + +
+ +
+
+
+
+ {volist name="ad_cateImg" id="vo"} + + {/volist} +
+
+
+
{:lang('hot post list')}
+ {volist name="artHot" id="vo"} +
+ {$vo.title} + {$vo.comments_count} +
+ {/volist} +
+ +
+
{:lang('sponsor')}- + {:lang('i want to join')} +
+
+ {volist name="ad_comm" id="vo"} + {$vo.slid_name} + {/volist} +
+
+
+
+
+{include file="public/menu" /} +{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/view/taoler/index/article/posts/detail.html b/view/taoler/index/article/posts/detail.html new file mode 100644 index 0000000..e5262f4 --- /dev/null +++ b/view/taoler/index/article/posts/detail.html @@ -0,0 +1,315 @@ +{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} +{block name="link"}{/block} +{block name="column"}
{include file="/public/column" /}
{/block} +{block name="content"} +
+
+
+
+ {//标题} +

{$article.title} +
+

+ {//图标} +
+ {:cookie('think_lang') == 'en-us' ? $article.cate.ename : $article.cate.catename} + {if ($article.is_top == 1)}{:lang('top')}{/if} + {if ($article.is_hot == 1)}{:lang('hot')}{/if} + + + {$comments->count()}{$pv} + +
+ {//作者} + +
{$article.content|raw}
+ {//管理} + {if (($article.upzip !== '') || session('?user_name'))} +
+ {notempty name="$article.upzip"} + + {/notempty} +
+ {if ($user.auth ?? '')} + + {if($article.is_top == 0)} + {else /}{:lang('cancel topping')}{/if} + {if($article.is_hot == 0)} + + {else /} + {:lang('cancel hoting')} + {/if} + {if($article.is_reply == 1)} + + {else /} + {:lang('enable reply')} + {/if} + {:lang('title color')} + {/if} + {if(session('user_name')==$article.user.name || ($user.auth ?? ''))} + {:lang('edit')} + {/if} +
+
+ {/if} +
+ {//评论} +
+ 评论 {$comments->count()} + +
{$comments|raw}
+ {if condition="$article.is_reply == 1"} +
+
+ +
+ +
+
+
+ + + +
+
+ {else /} +
本帖已设置禁止回复
+ {/if} +
+
+
+
+
{:lang('sponsor')}- + {:lang('i want to join')} +
+
+ {volist name="ad_comm" id="vo"} + {$vo.slid_name} + {/volist} +
+
+
+
{:lang('hot post list')}
+ {volist name="artHot" id="vo"} +
+ {$vo.title} + {$vo.comments_count} +
+ {/volist} +
+
+ {volist name="ad_art" id="vo"} + + {/volist} +
+
+
+ +
+
+
+
+{include file="public/menu" /} +{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/view/taoler/index/article/说明.txt b/view/taoler/index/article/说明.txt new file mode 100644 index 0000000..f2be86d --- /dev/null +++ b/view/taoler/index/article/说明.txt @@ -0,0 +1,11 @@ +articleĿ¼µĿ¼Ϊģļ +ļ¿ɰ +cate.html Ϊģ +detail.html Ϊҳģ +add.html ģ +edit.html ༭ģ + + +ɾݴӸģļӦļУ +ļеΪļ + diff --git a/view/taoler/index/index/index.html b/view/taoler/index/index/index.html index 0663107..33e6da7 100644 --- a/view/taoler/index/index/index.html +++ b/view/taoler/index/index/index.html @@ -28,7 +28,6 @@
- {include file="public/filter" /}
{//移动端LOGO} - +