feat: 问答中心

This commit is contained in:
2025-04-12 17:57:16 +08:00
parent 03b7e0d288
commit d2c755fd0a
4 changed files with 98 additions and 35 deletions

View File

@@ -0,0 +1,52 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use app\index\model\FaqModel;
use app\index\model\SysBannerItemModel;
use think\facade\View;
/**
* 问答中心控制器
*/
class Faq extends Common
{
/**
* 问答列表
*/
public function index()
{
$param = request()->param([
'page/d' => 1,
'size/d' => 12
]);
// 获取banner焦点图
$banner = SysBannerItemModel::hasWhere('banner', [
'language_id' => $this->lang_id,
'unique_label' => 'BANNER_67fa37f30e151'
])
->type('image')
->visible(['id', 'title', 'image', 'link'])
->find();
View::assign('banner', $banner);
// 获取问答列表
$faq = FaqModel::field([
'id',
'image',
'question',
'answer',
])
->language($this->lang_id)
->order(['sort' => 'asc', 'id' => 'desc'])
->paginate([
'list_rows' => $param['size'],
'page' => $param['page'],
]);
View::assign('faq', $faq);
return View::fetch('index');
}
}

View File

@@ -34,5 +34,11 @@ Route::group('article', function() {
Route::post('comment', 'Article/comment'); Route::post('comment', 'Article/comment');
}); });
// 问答中心
Route::group('faq', function() {
// 问答列表页
Route::get('index', 'Faq/index');
});
// 数据迁移 // 数据迁移
Route::get('/data/migration', 'DataMigration/index'); Route::get('/data/migration', 'DataMigration/index');

View File

@@ -0,0 +1,34 @@
{extend name="public/base" /}
{block name="title"}
<title>常见FQ_下载与服务_中文官网帮助信息_ORICO/奥睿科官网</title>
{/block}
{block name="style"}
<link rel="stylesheet" href="__CSS__/faq.css">
{/block}
{block name="main"}
<div class="orico_Page_fq">
<!--内容 -->
<div class="img-responsive">
<img src="{$banner.image}" />
</div>
<div class="fqMain">
{notempty name="faq"}
<ul class="Table-Row">
{volist name="faq" id="vo"}
<li class="Table-Cell">
<div class="img-responsive">
<img src="{$vo.image}" />
</div>
<div class="faq-all-text">
<div class="faq-title">{$vo.question}</div>
<div class="faq-des">{$vo.answer|raw}</div>
</div>
</li>
{/volist}
</ul>
<!-- 分页-->
<div >{$faq|raw}</div>
{/notempty}
</div>
</div>
{/block}

View File

@@ -1,7 +1,7 @@
.orico_Page_fq { .orico_Page_fq {
width: 100%; width: 100%;
position: relative; position: relative;
height: 100vh; height: auto;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
background: #f2f2f2; background: #f2f2f2;
@@ -40,50 +40,21 @@
color: #737373; color: #737373;
line-height: 1.875em; line-height: 1.875em;
} }
.orico_Page_fq .fqMain .Page { .orico_Page_fq .fqMain .pagination {
zoom: 1; zoom: 1;
text-align: center; text-align: center;
color: #555; color: #555;
clear: both; clear: both;
padding-bottom: 2rem; padding-bottom: 2rem;
} }
.orico_Page_fq .fqMain .Page span { .orico_Page_fq .fqMain .pagination li {
padding: 0px 0px;
display: inline-block;
}
.orico_Page_fq .fqMain .Page .p_page {
display: flex;
align-items: center;
justify-content: center;
}
.orico_Page_fq .fqMain .Page .p_page .a_prev,
.orico_Page_fq .fqMain .Page .p_page .a_next {
display: inline-block;
width: 10px;
height: 21px;
}
.orico_Page_fq .fqMain .Page .p_page .a_prev {
background: url(../fqimg/pfl.png) no-repeat;
margin-right: 10px;
padding: 0 10px;
}
.orico_Page_fq .fqMain .Page .p_page .a_next {
background: url(../fqimg/prh.png) no-repeat;
margin-left: 10px;
padding: 0 10px;
}
.orico_Page_fq .fqMain .Page .p_page .num a {
display: inline-block; display: inline-block;
width: 34px; width: 34px;
height: 22px; height: 22px;
line-height: 22px; line-height: 22px;
text-align: center;
vertical-align: middle;
font-size: 16px; font-size: 16px;
color: #444;
} }
.orico_Page_fq .fqMain .Page .p_page .num a.a_cur, .orico_Page_fq .fqMain .pagination li.active {
.orico_Page_fq .fqMain .Page .p_page .num a:hover { background-color: #444444;
background: #444; color: #ffffff;
color: #fff;
} }