From 069a80889f8561d383ec208a7d3f8f3836ed1c40 Mon Sep 17 00:00:00 2001 From: make Date: Sat, 19 Apr 2025 16:51:13 +0800 Subject: [PATCH] debug --- code/app/home/config/router.php | 62 ++++++++++++++++--- .../view/default/Novel/getSearchNovel.html | 4 +- 2 files changed, 57 insertions(+), 9 deletions(-) diff --git a/code/app/home/config/router.php b/code/app/home/config/router.php index 4d33c81..17adc43 100644 --- a/code/app/home/config/router.php +++ b/code/app/home/config/router.php @@ -169,6 +169,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { }) ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); break; + case 'chapter': //章节 $strView = 'pc/getNovelChapter.html'; @@ -192,6 +193,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { }) ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); break; + case 'novel': //小说详情 $strView = 'pc/getNovelInfo.html'; @@ -247,16 +249,41 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { break; case 'rank': //排行榜 - Route::get($strRoute, [Novel::class, 'getNovelRank']); + $strView = 'pc/getNovelRank.html'; + if ($platform == 'h5') { + $strView = 'novel/getNovelRank.html'; + } + Route::get($strRoute, function () use ($strView) { + return view($strView); + }); break; + case 'boys': //男生 - Route::get($strRoute, [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => $boolIsMobile, 'strChannel' => 'boys']); + $strView = 'pc/getNovelChannel.html'; + if ($platform == 'h5') { + $strView = 'novel/getNovelChannel.html'; + } + Route::get($strRoute, function () use ($strView) { + return view($strView); + })->append(['strChannel' => 'boys']); + + //Route::get($strRoute, [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => $boolIsMobile, 'strChannel' => 'boys']); break; + case 'girls': //女生 - Route::get($strRoute, [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => $boolIsMobile, 'strChannel' => 'girls']); + $strView = 'pc/getNovelChannel.html'; + if ($platform == 'h5') { + $strView = 'novel/getNovelChannel.html'; + } + Route::get($strRoute, function () use ($strView) { + return view($strView); + })->append(['strChannel' => 'girls']); + + //Route::get($strRoute, [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => $boolIsMobile, 'strChannel' => 'girls']); break; + case 'search': //搜素 $strView = 'pc/getSearchNovel.html'; @@ -267,19 +294,40 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { return view($strView); })->ext('html'); break; - + case 'user': //用户中心 - Route::get($strRoute, [User::class, 'Index']); + $strView = 'pc/user/index.html'; + if ($platform == 'h5') { + $strView = 'user/index.html'; + } + Route::get($strRoute, function () use ($strView) { + return view($strView); + }); break; + case 'bookshelf': //书架 - Route::get($strRoute, [User::class, 'getBookShelf']); + $strView = 'pc/user/getBookShelf.html'; + if ($platform == 'h5') { + $strView = 'user/getBookShelf.html'; + } + Route::get($strRoute, function () use ($strView) { + return view($strView); + }); break; + case 'history': //历史记录 - Route::get($strRoute, [User::class, 'getHistory']); + $strView = 'pc/user/getHistory.html'; + if ($platform == 'h5') { + $strView = 'user/getHistory.html'; + } + Route::get($strRoute, function () use ($strView) { + return view($strView); + }); break; + case 'index': // 首页 if ($platform == 'h5') { diff --git a/code/app/home/view/default/Novel/getSearchNovel.html b/code/app/home/view/default/Novel/getSearchNovel.html index 746b213..f4c35c7 100644 --- a/code/app/home/view/default/Novel/getSearchNovel.html +++ b/code/app/home/view/default/Novel/getSearchNovel.html @@ -16,8 +16,8 @@ {block name="main"}
-

{$strSearchKeywords}搜索结果 - {$DomainModel->d_name} 第{$intPage}页

- +

{$Request.get.keyword}搜索结果 - {$DomainModel->d_name} 第{$intPage}页

+ {if empty($arrPage.data)}

没有相关数据

{else}