debug
This commit is contained in:
@@ -2,16 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use app\home\controller\Novel;
|
||||
use think\facade\Route;
|
||||
|
||||
# 路由别名,可以忽略
|
||||
// Route::alias("/index.html", "/")->append(['boolIsMobile' => true]);
|
||||
// Route::alias("/pc/index.html", "/")->append(['boolIsMobile' => false]);
|
||||
|
||||
Route::get("/",'Index/index')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/index",'Index/index')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/index",'Index/getPcIndex')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get("/pc/",'Index/getPcIndex')->append(['boolIsMobile' => false]);
|
||||
Route::get("/", 'Index/index')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/index", 'Index/index')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/index", 'Index/getPcIndex')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get("/pc/", 'Index/getPcIndex')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 书架
|
||||
Route::get('bookshelf', 'User/getBookShelf')->ext('html')->append(['boolIsMobile' => true]);
|
||||
@@ -19,17 +20,17 @@ Route::get('/pc/bookshelf', 'User/getBookShelf')->ext('html')->append(['boolIsMo
|
||||
|
||||
//排行榜
|
||||
Route::get('rank', 'Novel/getNovelRank')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/rank",'Novel/getNovelRank')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get("/pc/rank", 'Novel/getNovelRank')->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 男生/女生
|
||||
Route::get('boy', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => true,'strChannel'=>'boys']);
|
||||
Route::get('pc/boy', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => false,'strChannel'=>'boys']);
|
||||
Route::get('girl', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => true,'strChannel'=>'girls']);
|
||||
Route::get('pc/girl', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => false,'strChannel'=>'girls']);
|
||||
Route::get('novel-boys-channel', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => true,'strChannel'=>'boys']);
|
||||
Route::get('pc/novel-boys-channel', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => false,'strChannel'=>'boys']);
|
||||
Route::get('novel-girls-channel', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => true,'strChannel'=>'girls']);
|
||||
Route::get('pc/novel-girls-channel', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => false,'strChannel'=>'girls']);
|
||||
Route::get('boy', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => true, 'strChannel' => 'boys']);
|
||||
Route::get('pc/boy', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => false, 'strChannel' => 'boys']);
|
||||
Route::get('girl', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => true, 'strChannel' => 'girls']);
|
||||
Route::get('pc/girl', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => false, 'strChannel' => 'girls']);
|
||||
Route::get('novel-boys-channel', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => true, 'strChannel' => 'boys']);
|
||||
Route::get('pc/novel-boys-channel', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => false, 'strChannel' => 'boys']);
|
||||
Route::get('novel-girls-channel', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => true, 'strChannel' => 'girls']);
|
||||
Route::get('pc/novel-girls-channel', 'Novel/getNovelChannel')->ext('html')->append(['boolIsMobile' => false, 'strChannel' => 'girls']);
|
||||
|
||||
//分类
|
||||
Route::get('class', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]);
|
||||
@@ -43,7 +44,7 @@ Route::get('/pc/books/[:intCategoryId]-[:intPage]', 'Novel/getNovelCategory')->e
|
||||
|
||||
// 书库
|
||||
Route::get('library', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("pc/library",'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get("pc/library", 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('shuku', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('pc/shuku', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('shuku/[:strNovelChannel]-[:intCategoryId]-[:strStatus]-[:strTextNumber]-[:strUpdateTime]-[:strSort]-[:intPage]', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => true]);
|
||||
@@ -60,14 +61,36 @@ Route::get('/article/info-:intArticleId', 'Novel/getArticleInfo')->ext('html')->
|
||||
Route::get('/pc/article/info-:intArticleId', 'Novel/getArticleInfo')->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 小说详情
|
||||
Route::get('/info/:intNovelId', 'Novel/getNovelInfo')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/info/:intNovelId', 'Novel/getNovelInfo')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/novel/:intNovelId', 'Novel/getNovelInfo')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/novel/:intNovelId', 'Novel/getNovelInfo')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/shu/:intNovelId', 'Novel/getNovelInfo')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/shu/:intNovelId', 'Novel/getNovelInfo')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/kan/:intNovelId', 'Novel/getNovelInfo')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/kan/:intNovelId', 'Novel/getNovelInfo')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/info/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/info/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/novel/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/novel/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// example
|
||||
// /book/{strPinYin}-{intNId}.html
|
||||
// /novel/{strPinYin}-{intNId}.html
|
||||
// /novel-{strPinYin}-{intNId}.html
|
||||
// /book-{strPinYin}-{intNId}.html
|
||||
Route::get('/pc/book/:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 1])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
Route::get('/pc/novel/:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 2])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
Route::get('/pc/novel-:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 3])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
Route::get('/pc/book-:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 4])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
|
||||
// 小说章节
|
||||
Route::get('chapter/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/getNovelChapter')->ext('html')->append(['boolIsMobile' => true]);
|
||||
|
||||
@@ -13,7 +13,7 @@ class Novel extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
@@ -120,10 +120,10 @@ class Novel extends BaseController
|
||||
}
|
||||
|
||||
// 书库 [:strNovelChannel]-[:intCategoryId]-[:strStatus]-[:strTextNumber]-[:strUpdateTime]-[:strSort]
|
||||
public function getLibrary(Request $Request,$strNovelChannel=null,$intCategoryId=null,$strStatus=null,$strTextNumber=null,$strUpdateTime=null,$strSort=null,$intPage=1)
|
||||
public function getLibrary(Request $Request, $strNovelChannel = null, $intCategoryId = null, $strStatus = null, $strTextNumber = null, $strUpdateTime = null, $strSort = null, $intPage = 1)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
|
||||
// 模拟数据
|
||||
$arrNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
@@ -147,13 +147,40 @@ class Novel extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 书架
|
||||
public function getBookShelf(Request $Request)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
// 模拟数据
|
||||
$arrNewsNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
['id' => 2, 'name' => '小说2', 'author' => '作者2'],
|
||||
['id' => 3, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 4, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 5, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
];
|
||||
|
||||
View::assign([
|
||||
'arrNewsNovel' => $arrNewsNovel,
|
||||
'strPageCode' => 'bookshelf'
|
||||
]);
|
||||
if ($boolIsMobile) {
|
||||
return View::fetch();
|
||||
} else {
|
||||
return View::fetch('pc/getBookShelf');
|
||||
}
|
||||
}
|
||||
|
||||
// 男生女生频道
|
||||
public function getNovelChannel(Request $Request)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
$strNovelChannel = $Request->param('strChannel'); // 区分男生/女生频道
|
||||
|
||||
|
||||
// 模拟数据-推荐等级为9的,连载的,男生频道/女生频道, 随机12个小说
|
||||
$arrRecommendSerializationNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
@@ -179,8 +206,8 @@ class Novel extends BaseController
|
||||
['id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
|
||||
];
|
||||
|
||||
];
|
||||
|
||||
// 模拟数据-最近更新-随机50
|
||||
$arrNewsUpdateNovel = [
|
||||
@@ -219,13 +246,13 @@ class Novel extends BaseController
|
||||
return View::fetch('pc/getNovelChannel');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 分类
|
||||
public function getNovelCategory(Request $Request,$intCategoryId = null ,$intPage = 1)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
$strChannel = $Request->param('strChannel'); // 区分男生 / 女生频道
|
||||
|
||||
|
||||
// 模拟数据-推荐等级为9的,连载的,男生频道/女生频道, 随机12个小说
|
||||
$arrRecommendSerializationNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
@@ -251,8 +278,8 @@ class Novel extends BaseController
|
||||
['id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
|
||||
];
|
||||
|
||||
];
|
||||
|
||||
// 模拟数据-最近更新-随机50
|
||||
$arrNewsUpdateNovel = [
|
||||
@@ -293,10 +320,14 @@ class Novel extends BaseController
|
||||
}
|
||||
|
||||
// 小说详情
|
||||
public function getNovelInfo(Request $Request,$intNovelId = 1)
|
||||
public function getNovelInfo(Request $Request)
|
||||
{
|
||||
$intNId = $Request->param('n_id');
|
||||
|
||||
|
||||
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
|
||||
// 模拟数据-随机推荐数据10条
|
||||
$arrRecommendNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
@@ -313,7 +344,7 @@ class Novel extends BaseController
|
||||
// 相邻推荐->关联的 kan 数据
|
||||
// 精品推荐->同分类随机10条数据
|
||||
// 最新要点->取新意章节, 随机提取一部分内容 大概150字数
|
||||
|
||||
|
||||
|
||||
View::assign([
|
||||
'arrRecommendNovel' => $arrRecommendNovel,
|
||||
@@ -330,7 +361,7 @@ class Novel extends BaseController
|
||||
public function getNovelChapter(Request $Request, $intNovelId = 1, $intChapterId = 1, $intChapterPage = 1)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
|
||||
// 模拟数据
|
||||
$arrNewsNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
@@ -382,13 +413,13 @@ class Novel extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 小说章节-搜索
|
||||
public function getSearchNovel(Request $Request)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
|
||||
// 模拟数据
|
||||
$arrSearchNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
@@ -413,10 +444,10 @@ class Novel extends BaseController
|
||||
}
|
||||
|
||||
// 小说章节-文章-自定义页面-列表
|
||||
public function getArticleList(Request $Request,$intCategoryId = null ,$intPage = 1)
|
||||
public function getArticleList(Request $Request, $intCategoryId = null, $intPage = 1)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
|
||||
// 模拟数据
|
||||
$arrNewsNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
@@ -441,10 +472,10 @@ class Novel extends BaseController
|
||||
}
|
||||
|
||||
// 小说章节-文章-自定义页面-详情
|
||||
public function getArticleInfo(Request $Request,$intArticleId)
|
||||
public function getArticleInfo(Request $Request, $intArticleId)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
|
||||
// 模拟数据
|
||||
$arrNewsNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
@@ -467,7 +498,4 @@ class Novel extends BaseController
|
||||
return View::fetch('pc/getArticleInfo');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -48,18 +48,24 @@
|
||||
<div class="area_head">
|
||||
<span class="log_line"></span>
|
||||
<h4><s class="book"></s>完本推荐</h4>
|
||||
|
||||
<!-- test code start -->
|
||||
<i>{site:grm domain="Request->DomainModel->d_domain" code="kuangyu-pc-index" line="50" diff="0"/}</i>
|
||||
<i>{site:wz wz="保存永久访问二维码" /}</i>
|
||||
<!-- test code end -->
|
||||
|
||||
<span class="log_line"></span>
|
||||
</div>
|
||||
<ul class="f2_list" mod="hot_tj">
|
||||
{foreach $arrRecommendEndNovel as $key=>$Novel}
|
||||
<li>
|
||||
<a href="/pc/novel/334.html" title="{$Novel->og_novel_book_name}" target="_blank" class="book_cov">
|
||||
<a href='/pc{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}' title="{$Novel->og_novel_book_name}" target="_blank" class="book_cov">
|
||||
<img class="lazyload_book_cover lazyload-img"
|
||||
src="/static/img/default.jpg" data-src="{$Novel->n_cover_path}"
|
||||
alt="{$Novel->og_novel_book_name}">
|
||||
</a>
|
||||
<div class="book_inf">
|
||||
<h3><a href="/pc/novel/334.html" title="{$Novel->og_novel_book_name}" target="_blank">{$Novel->og_novel_book_name}</a></h3>
|
||||
<h3><a href='/pc{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}' title="{$Novel->og_novel_book_name}" target="_blank">{$Novel->og_novel_book_name}</a></h3>
|
||||
<span class="aut">{$Novel->og_novel_author}</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user