From cf685cd7b45ace39aab5944e585ccd5e25cb9f46 Mon Sep 17 00:00:00 2001 From: make Date: Sun, 6 Apr 2025 15:31:29 +0800 Subject: [PATCH] =?UTF-8?q?PC=20=E7=AB=AF=20=E9=A1=B5=E9=9D=A2=20head?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/app/home/BaseController.php | 3 +- code/app/home/controller/Novel.php | 12 +- .../home/view/kuangyu/Pc/getArticleInfo.html | 17 +- .../home/view/kuangyu/Pc/getArticleList.html | 17 +- .../home/view/kuangyu/Pc/getKanNovelInfo.html | 145 ++++++---- code/app/home/view/kuangyu/Pc/getLibrary.html | 23 +- .../home/view/kuangyu/Pc/getNovelChannel.html | 16 +- .../home/view/kuangyu/Pc/getNovelChapter.html | 261 +++++++----------- .../view/kuangyu/Pc/getNovelChapterAll.html | 57 +++- .../home/view/kuangyu/Pc/getNovelInfo.html | 139 ++++++---- .../home/view/kuangyu/Pc/getNovelRank.html | 8 +- .../home/view/kuangyu/Pc/getSearchNovel.html | 16 +- .../home/view/kuangyu/Pc/getUserIndex.html | 144 ---------- code/app/home/view/kuangyu/Pc/index.html | 30 +- code/app/home/view/kuangyu/baseH5.html | 4 + code/app/home/view/kuangyu/basePc.html | 13 +- code/config/view.php | 2 + code/database/seeders/SystemConfigSeeder.php | 5 + .../kuangyu/home/bai_web/css/style.css | 7 + .../template/kuangyu/public/js/common.js | 13 +- 20 files changed, 418 insertions(+), 514 deletions(-) delete mode 100644 code/app/home/view/kuangyu/Pc/getUserIndex.html diff --git a/code/app/home/BaseController.php b/code/app/home/BaseController.php index 650a39e..dd400b8 100644 --- a/code/app/home/BaseController.php +++ b/code/app/home/BaseController.php @@ -62,7 +62,8 @@ abstract class BaseController */ protected function initialize() { - + // TODO 因为视图无法渲染 request 暂时使用这个 + View::assign("DomainModel", $this->request->DomainModel); $this->initSiteTKD(); } diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index f8d4654..5d51413 100644 --- a/code/app/home/controller/Novel.php +++ b/code/app/home/controller/Novel.php @@ -379,7 +379,6 @@ class Novel extends BaseController // 分品拼音 $arrNovel['category_pinyin'] = CategoryModel::getPinYinByZh($arrNovel['og_novel_category']); - // 最后章节 $ChapterModel = new ChapterModel; $arrLatestChapter = $ChapterModel->getLatestChapter($intNId); @@ -431,11 +430,16 @@ class Novel extends BaseController $strKeywords = ConverterMovel::convert($strKeywordsTemplate); $strDescription = ConverterMovel::convert($strDescriptionTemplate); + // js使用到 + $arrNovelJs = $arrNovel; + unset($arrNovelJs['n_related_novel'], $arrNovelJs['n_forge_novel'], $arrNovelJs['n_page_description']); View::assign([ 'arrRelateveNovel' => $arrRelateveNovel, 'arrNovel' => $arrNovel, + 'arrNovelJs' => $arrNovelJs, 'arrChapter' => $arrChapter, + 'arrLatestChapter' => $arrLatestChapter, 'arrNovelClicks' => $arrNovelClicks, 'strFocus' => $strFocus, 'strPageCode' => 'boy', @@ -443,11 +447,12 @@ class Novel extends BaseController 'strKeywords' => $strKeywords, 'strDescription' => $strDescription, ]); + if ($boolIsMobile) { - return View::fetch(); + return View::fetch('getNovelInfo'); } else { - return View::fetch('pc/getKanNovelInfo'); + return View::fetch('pc/getNovelInfo'); } } @@ -526,6 +531,7 @@ class Novel extends BaseController 'arrRelateveNovel' => $arrRelateveNovel, 'arrNovel' => $arrNovel, 'arrChapter' => $arrChapter, + 'arrLatestChapter' => $arrLatestChapter, 'arrNovelClicks' => $arrNovelClicks, 'strFocus' => $strFocus, 'strPageCode' => 'boy', diff --git a/code/app/home/view/kuangyu/Pc/getArticleInfo.html b/code/app/home/view/kuangyu/Pc/getArticleInfo.html index 9f73cd8..bb26dab 100644 --- a/code/app/home/view/kuangyu/Pc/getArticleInfo.html +++ b/code/app/home/view/kuangyu/Pc/getArticleInfo.html @@ -10,14 +10,15 @@ + { + "@context": "{$DomainModel->d_domain}", + "@type": "book", + "headline": "{$strTitle??''}", + "description": "{$strDescription??''}", + "datePublished": "{:date('Y-m-d')}" + } + + {/block} {block name="head-js"}{/block} diff --git a/code/app/home/view/kuangyu/Pc/getArticleList.html b/code/app/home/view/kuangyu/Pc/getArticleList.html index b057d9d..9aa03ec 100644 --- a/code/app/home/view/kuangyu/Pc/getArticleList.html +++ b/code/app/home/view/kuangyu/Pc/getArticleList.html @@ -10,14 +10,15 @@ + { + "@context": "{$DomainModel->d_domain}", + "@type": "book", + "headline": "{$strTitle??''}", + "description": "{$strDescription??''}", + "datePublished": "{:date('Y-m-d')}" + } + + {/block} {block name="head-js"}{/block} diff --git a/code/app/home/view/kuangyu/Pc/getKanNovelInfo.html b/code/app/home/view/kuangyu/Pc/getKanNovelInfo.html index 6bd8d0d..d8cbeb1 100644 --- a/code/app/home/view/kuangyu/Pc/getKanNovelInfo.html +++ b/code/app/home/view/kuangyu/Pc/getKanNovelInfo.html @@ -4,23 +4,62 @@ {block name="description"}{$strDescription??''}{/block} {block name="head"} - - - - + + + + + + + + + + + + + + + + + + + +{/block} {block name="head-js"}{/block} {block name="head-css"} - + {/block} {block name="main"} @@ -40,7 +79,7 @@ {/volist} - + @@ -190,7 +233,7 @@ {/block} -{block name="customize"} +{block name="customize"} {/block} diff --git a/code/app/home/view/kuangyu/Pc/getLibrary.html b/code/app/home/view/kuangyu/Pc/getLibrary.html index 5db00b0..1e3b7a1 100644 --- a/code/app/home/view/kuangyu/Pc/getLibrary.html +++ b/code/app/home/view/kuangyu/Pc/getLibrary.html @@ -6,22 +6,23 @@ - - + + + { + "@context": "{$DomainModel->d_domain}", + "@type": "book", + "headline": "{$strTitle??''}", + "description": "{$strDescription??''}", + "datePublished": "{:date('Y-m-d')}" + } + + {/block} {block name="head-js"}{/block} {block name="head-css"} - + {/block} diff --git a/code/app/home/view/kuangyu/Pc/getNovelChannel.html b/code/app/home/view/kuangyu/Pc/getNovelChannel.html index ae3af19..d6a372f 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelChannel.html +++ b/code/app/home/view/kuangyu/Pc/getNovelChannel.html @@ -6,25 +6,25 @@ - - + + - +{/block} {block name="head-css"} {eq name="strPageCode" value="boys"} - + {else} - + {/eq} {/block} diff --git a/code/app/home/view/kuangyu/Pc/getNovelChapter.html b/code/app/home/view/kuangyu/Pc/getNovelChapter.html index 2ad8004..2455f50 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelChapter.html +++ b/code/app/home/view/kuangyu/Pc/getNovelChapter.html @@ -2,57 +2,74 @@ - - + + - - {$strTitle??''} + + {$strTitle??''} {block name="head-css"} - + {/block} - - - - - - + + + + + + + + + + + + + + + + + + + - +
@@ -68,32 +85,8 @@ 最近阅读 @@ -102,26 +95,26 @@ 快速导航
@@ -236,61 +228,18 @@ 设置 -
书架
- + 详情
- - - - - - + - + diff --git a/code/app/home/view/kuangyu/Pc/getNovelChapterAll.html b/code/app/home/view/kuangyu/Pc/getNovelChapterAll.html index be51ec8..cbda96b 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelChapterAll.html +++ b/code/app/home/view/kuangyu/Pc/getNovelChapterAll.html @@ -4,22 +4,59 @@ {block name="description"}{$strDescription??''}{/block} {block name="head"} - - - - + + + + + + + + + + + + + + + + + + + {block name="head-css"} - + {/block} {block name="head-js"}{/block} diff --git a/code/app/home/view/kuangyu/Pc/getNovelInfo.html b/code/app/home/view/kuangyu/Pc/getNovelInfo.html index 0565c0c..2b162b7 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelInfo.html +++ b/code/app/home/view/kuangyu/Pc/getNovelInfo.html @@ -6,19 +6,30 @@ - - - - + + + + + + + + + + + + - + {/block} -{block name="customize"} +{block name="customize"} {/block} {block name="footer-js"} {/block} \ No newline at end of file diff --git a/code/app/home/view/kuangyu/Pc/getNovelRank.html b/code/app/home/view/kuangyu/Pc/getNovelRank.html index 341300d..00557fd 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelRank.html +++ b/code/app/home/view/kuangyu/Pc/getNovelRank.html @@ -6,21 +6,21 @@ - + {/block} {block name="head-css"} - + {/block} {block name="head-js"}{/block} {block name='body-class'}body-rank-class{/block} diff --git a/code/app/home/view/kuangyu/Pc/getSearchNovel.html b/code/app/home/view/kuangyu/Pc/getSearchNovel.html index 528a13a..f5c7e18 100644 --- a/code/app/home/view/kuangyu/Pc/getSearchNovel.html +++ b/code/app/home/view/kuangyu/Pc/getSearchNovel.html @@ -6,16 +6,16 @@ - + {block name="head-js"}{/block} @@ -23,22 +23,13 @@ {block name="main"}
-
搜索“{$strSearchKeywords}”相关结果共有 {$arrPage.total} 部小说
-
- -
{if empty($arrPage.data)}

没有相关数据

@@ -83,7 +74,6 @@
-
{/block} diff --git a/code/app/home/view/kuangyu/Pc/getUserIndex.html b/code/app/home/view/kuangyu/Pc/getUserIndex.html deleted file mode 100644 index 8bb99f8..0000000 --- a/code/app/home/view/kuangyu/Pc/getUserIndex.html +++ /dev/null @@ -1,144 +0,0 @@ -{extend name="basePcUser" /} -{block name="title"}{$strTitle??''}{/block} -{block name="keywords"}{$strKeywords??''}{/block} -{block name="description"}{$strDescription??''}{/block} -{block name="head-js"}{/block} - - -{block name="main"} -
- -
- -
-
- - -
-
-
- 最近阅读 - 查看更多>> -
- -
-
-
- 热读作品 -
    -
  • -
  • -
  • -
-
-
- {foreach $arrNewsNovel as $key=>$Novel} - - {/foreach} - -
-
-
- -
-
-
推荐作品
-
    - {foreach $arrNewsNovel as $key=>$Novel} -
  • - - - -

    - - 我真是一条龙 - - - 兔子很淡定 - - - 我的父亲告诉我,在我出生那一年,天上金光闪耀,隐隐约约中,好像能看到云朵里有条龙在盘旋,紧接着,一道金光照入我们的村子,我便出生了……为寻答案来人间,天龙问世扰乾坤。 - 无情无义闹天下,千军万马赴黄泉。 - 本站提示:各位书友要是觉得《我真是一条龙》还不错的话请不要忘记向您QQ群和微博里的朋友推荐哦! -

    -
  • - {/foreach} - -
-
-
-
-
-{/block} - -{block name="customize"} {/block} \ No newline at end of file diff --git a/code/app/home/view/kuangyu/Pc/index.html b/code/app/home/view/kuangyu/Pc/index.html index 69f4749..1b5e5ae 100644 --- a/code/app/home/view/kuangyu/Pc/index.html +++ b/code/app/home/view/kuangyu/Pc/index.html @@ -2,20 +2,23 @@ {block name="title"}{$strTitle??''}{/block} {block name="keywords"}{$strKeywords??''}{/block} {block name="description"}{$strDescription??''}{/block} +{block name="head-css"} + +{/block} {block name="head"} - + {/block} @@ -23,6 +26,7 @@ {block name="main"} +
@@ -114,12 +118,9 @@

排行榜 - + + +

    @@ -192,12 +193,9 @@

    排行榜 - + + +

      diff --git a/code/app/home/view/kuangyu/baseH5.html b/code/app/home/view/kuangyu/baseH5.html index a550076..d70fb2c 100644 --- a/code/app/home/view/kuangyu/baseH5.html +++ b/code/app/home/view/kuangyu/baseH5.html @@ -97,6 +97,10 @@ {include file="Public/footer" /} {block name="customize"}{/block} + + diff --git a/code/app/home/view/kuangyu/basePc.html b/code/app/home/view/kuangyu/basePc.html index 9aeb79f..69ecfa6 100644 --- a/code/app/home/view/kuangyu/basePc.html +++ b/code/app/home/view/kuangyu/basePc.html @@ -6,7 +6,7 @@ {block name="title"}{/block} - + @@ -74,6 +74,10 @@ {block name="customize"}{/block} + + @@ -85,8 +89,11 @@ {site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/} - - {Request->DomainModel->d_statis} + + + + {$DomainModel->d_statis|raw} + diff --git a/code/config/view.php b/code/config/view.php index d1ce0ca..a436de8 100644 --- a/code/config/view.php +++ b/code/config/view.php @@ -14,6 +14,8 @@ return [ 'view_suffix' => 'html', // 模板文件名分隔符 'view_depr' => DIRECTORY_SEPARATOR, + // 允许 PHP 函数调用 + 'tpl_deny_php' => false, // 模板引擎普通标签开始标记 'tpl_begin' => '{', // 模板引擎普通标签结束标记 diff --git a/code/database/seeders/SystemConfigSeeder.php b/code/database/seeders/SystemConfigSeeder.php index f239d47..c02e822 100644 --- a/code/database/seeders/SystemConfigSeeder.php +++ b/code/database/seeders/SystemConfigSeeder.php @@ -53,6 +53,11 @@ class SystemConfigSeeder 'sc_val' => "dl", 'sc_description' => '代理商API域名-解析前缀dl-open. 后缀是.xyz ,但这里不需要填前缀和后缀', ], + [ + 'sc_code' => 'PUSH_API_DOMAIN', + 'sc_val' => "api.test.com", + 'sc_description' => 'api', + ], [ 'sc_code' => 'PUBLIC_TONGJI_CODE', 'sc_val' => "", diff --git a/code/public/template/kuangyu/home/bai_web/css/style.css b/code/public/template/kuangyu/home/bai_web/css/style.css index c1eb339..2b7d3ee 100644 --- a/code/public/template/kuangyu/home/bai_web/css/style.css +++ b/code/public/template/kuangyu/home/bai_web/css/style.css @@ -61,6 +61,11 @@ s{background: url(../images/iconC.png) no-repeat;} .headWrap_r .long .search_btn s{background-position: -30px 0;} .headWrap_r .search .search_btn:hover s{background-position: -30px 0;} +/* 首页 */ +.btn_toggle_mod_bang{ + width: 33px; line-height: 24px; text-align: center; border-radius: 4px; margin-left: 5px; cursor: pointer; font-size: 13px; +} + /* 登陆 */ .headWrap_r .login{float: right; position: relative; background: #fff; padding-top: 32px;} .headWrap_r .login .login_before{width: 100px; height: 18px; line-height: 20px; padding-left: 20px; cursor: pointer; display: block;} @@ -320,6 +325,8 @@ display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;} .find .opt ul li .on:hover{color: #fff;} .find .opt .no_bor{border-bottom: none;} + + /*列表*/ .result{background: #fff; width: 1100px; overflow: hidden;} .search_tip{text-align: center;} diff --git a/code/public/template/kuangyu/public/js/common.js b/code/public/template/kuangyu/public/js/common.js index a33f352..ad98914 100644 --- a/code/public/template/kuangyu/public/js/common.js +++ b/code/public/template/kuangyu/public/js/common.js @@ -126,9 +126,7 @@ function incShouCangFun(intId) { function addBookshelfFun(NovelInfo) { if (!NovelInfo) { - NovelInfo = JSON.parse(arrNovel) - NovelInfo['c_sort_num'] = strChapterSort; - NovelInfo['c_name'] = strChapterName; + NovelInfo = arrNovel } let arrBookshelf = JSON.parse(localStorage.getItem('strBookshelfKey')) || []; @@ -251,17 +249,14 @@ function displayBookshelf() { // 加入阅读记录 function addHistoryFun(NovelInfo) { - // 如果没有传入 NovelInfo,则使用 arrNovel 并补充字段 if (!NovelInfo) { - NovelInfo = JSON.parse(arrNovel); - NovelInfo['c_sort_num'] = strChapterSort; - NovelInfo['c_name'] = strChapterName; + NovelInfo = arrNovel + } // 获取本地存储中的历史记录 let arrBookshelf = JSON.parse(localStorage.getItem('strHistoryKey')) || []; - // 检查书籍是否已存在 const index = arrBookshelf.findIndex(item => item.n_id === NovelInfo.n_id); @@ -379,7 +374,7 @@ function displayHistory() { // 方法1:使用 fetch API async function reportStats(data) { try { - const response = await fetch('http://api.novel2.com/publish', { + const response = await fetch(strPushApi+'/publish', { method: 'POST', // mode: 'no-cors', // 添加这行 headers: {