From cd60d587047fa7d67e7e73f2ebca6d1c780d2609 Mon Sep 17 00:00:00 2001 From: peijunlei Date: Wed, 2 Sep 2026 17:19:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(pagination):=20=E5=B0=81=E8=A3=85=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/frontend/SearchController.php | 2 +- app/provider/Bootstrap.php | 94 ++++++++------ public/themes/dist_static/static/css/announce.css | 1 + public/themes/dist_static/static/css/download.css | 51 -------- public/themes/dist_static/static/css/faq.css | 1 + public/themes/dist_static/static/css/news.css | 47 ------- .../themes/dist_static/static/css/pagination.css | 59 +++++++++ public/themes/dist_static/static/css/search.css | 1 + public/themes/dist_static/static/css/video.css | 52 -------- public/themes/dist_static/static/js/announce.js | 5 +- public/themes/dist_static/static/js/download.js | 45 +------ public/themes/dist_static/static/js/faq.js | 1 + public/themes/dist_static/static/js/news.js | 1 + public/themes/dist_static/static/js/pagination.js | 29 +++++ public/themes/dist_static/static/js/search.js | 61 +-------- public/themes/dist_static/static/js/video.js | 1 + public/themes/website/1/zh/demo/announce.html | 111 +++------------- public/themes/website/1/zh/demo/download.html | 1 + public/themes/website/1/zh/demo/faq.html | 1 + public/themes/website/1/zh/demo/news.html | 24 ++-- public/themes/website/1/zh/demo/search.html | 144 +++++---------------- public/themes/website/1/zh/demo/video.html | 30 +++-- 22 files changed, 234 insertions(+), 528 deletions(-) create mode 100644 public/themes/dist_static/static/css/pagination.css create mode 100644 public/themes/dist_static/static/js/pagination.js diff --git a/app/controller/frontend/SearchController.php b/app/controller/frontend/SearchController.php index 32278f2..f7f7290 100644 --- a/app/controller/frontend/SearchController.php +++ b/app/controller/frontend/SearchController.php @@ -40,7 +40,7 @@ class SearchController extends BaseController //搜索 $param = $this->request->param(); - $keywords = $param['q']; + $keywords = $param['q'] ?? ''; $this->assign('keywords',$keywords); // 获取可以查询的栏目 diff --git a/app/provider/Bootstrap.php b/app/provider/Bootstrap.php index 2c3a33f..8cc9720 100644 --- a/app/provider/Bootstrap.php +++ b/app/provider/Bootstrap.php @@ -5,26 +5,26 @@ namespace app\provider; use think\Paginator; /** - * Bootstrap 分页驱动 + * Bootstrap 分页驱动(前台 d-pagination 结构) */ class Bootstrap extends Paginator { + private const ARROW_SVG = "data:image/svg+xml,%3csvg%20viewBox='0%200%2016.51%206.661'%20xmlns='http://www.w3.org/2000/svg'%20width='16.51'%20height='6.661'%20fill='none'%3e%3cpath%20d='M0%202.831h16v1H0V2.831zm15.293.5L12.818.856a.5.5%200%200%201%20.707-.707l2.829%202.828a.5.5%200%200%201%200%20.708l-2.829%202.828a.5.5%200%201%201-.707-.707L15.293%203.331z'%20fill='%232e353a'/%3e%3c/svg%3e"; /** * 上一页按钮 * @param string $text * @return string */ - protected function getPreviousButton(string $text = "«"): string + protected function getPreviousButton(string $text = '上一页'): string { + $disabled = $this->currentPage() <= 1 ? ' disabled' : ''; - if ($this->currentPage() <= 1) { - return $this->getDisabledTextWrapper($text); - } - - $url = $this->currentPage - 1; - - return $this->getPageLinkWrapper($url, $text); + return ''; } /** @@ -32,15 +32,15 @@ class Bootstrap extends Paginator * @param string $text * @return string */ - protected function getNextButton(string $text = '»'): string + protected function getNextButton(string $text = '下一页'): string { - if (!$this->hasMore) { - return $this->getDisabledTextWrapper($text); - } - - $url = $this->currentPage + 1; + $disabled = !$this->hasMore ? ' disabled' : ''; - return $this->getPageLinkWrapper($url, $text); + return ''; } /** @@ -96,7 +96,7 @@ class Bootstrap extends Paginator } /** - * 渲染分页html + * 渲染分页 html * @return mixed */ public function render() @@ -104,66 +104,73 @@ class Bootstrap extends Paginator if ($this->hasPages()) { if ($this->simple) { return sprintf( - '', - $this->getPreviousButton(), - $this->getNextButton() - ); - } else { - return sprintf( - '', + '', $this->getPreviousButton(), - $this->getLinks(), $this->getNextButton() ); } + + return sprintf( + '', + $this->getPreviousButton(), + $this->getLinks(), + $this->getNextButton() + ); } + + return ''; } /** - * 生成一个可点击的按钮 + * 生成一个可点击的页码按钮 * - * @param string $url + * @param string $url 这里实际是页码数字 * @param string $page * @return string */ protected function getAvailablePageWrapper(string $url, string $page): string { - return ''; -// return '
  • ' . $page . '
  • '; + return ''; } /** - * 生成一个禁用的按钮 + * 生成一个禁用的按钮(兼容旧调用) * * @param string $text * @return string */ protected function getDisabledTextWrapper(string $text): string { - return ''; -// return '
  • ' . $text . '
  • '; + return ''; } /** - * 生成一个激活的按钮 + * 生成一个激活的页码按钮 * * @param string $text * @return string */ protected function getActivePageWrapper(string $text): string { - return ''; -// return '
  • ' . $text . '
  • '; + return ''; } /** - * 生成省略号按钮 + * 生成省略号 * * @return string */ protected function getDots(): string { - return $this->getDisabledTextWrapper('...'); + return ''; } /** @@ -177,7 +184,7 @@ class Bootstrap extends Paginator $html = ''; foreach ($urls as $page => $url) { - $html .= $this->getPageLinkWrapper($url, $page); + $html .= $this->getPageLinkWrapper((string)$url, (string)$page); } return $html; @@ -187,7 +194,7 @@ class Bootstrap extends Paginator * 生成普通页码按钮 * * @param string $url - * @param string $page + * @param string $page * @return string */ protected function getPageLinkWrapper(string $url, string $page): string @@ -198,8 +205,8 @@ class Bootstrap extends Paginator return $this->getAvailablePageWrapper($url, $page); } - - private function getPageRange(int $start, int $end) + + private function getPageRange(int $start, int $end): array { $urls = []; @@ -209,4 +216,9 @@ class Bootstrap extends Paginator return $urls; } + + private function getArrowImg(): string + { + return ''; + } } diff --git a/public/themes/dist_static/static/css/announce.css b/public/themes/dist_static/static/css/announce.css index a0279de..110b6db 100644 --- a/public/themes/dist_static/static/css/announce.css +++ b/public/themes/dist_static/static/css/announce.css @@ -123,6 +123,7 @@ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem; + margin-bottom: 3.5rem; } .a-card { diff --git a/public/themes/dist_static/static/css/download.css b/public/themes/dist_static/static/css/download.css index 666498f..d3de9a9 100644 --- a/public/themes/dist_static/static/css/download.css +++ b/public/themes/dist_static/static/css/download.css @@ -187,49 +187,6 @@ height: 1.5rem; } -.d-pagination { - display: flex; - align-items: center; - justify-content: center; - gap: 0.75rem; -} -.d-pagination__btn, .d-pagination__page { - display: inline-flex; - align-items: center; - justify-content: center; - width: 3rem; - height: 3rem; - padding: 0; - border: 0; - border-radius: 0.5rem; - background: rgba(175, 181, 185, 0.15); - color: rgba(46, 53, 58, 0.6); - font-family: "MiSans VF", "PingFang SC", sans-serif; - font-size: var(--font-20); - font-weight: 400; - line-height: var(--font-24); - cursor: default; -} -.d-pagination__btn img { - display: block; - width: 1.0625rem; - height: auto; - transform: scaleX(-1); - filter: grayscale(1) opacity(0.45); -} -.d-pagination__btn--next img { - transform: none; - filter: none; -} -.d-pagination__btn:disabled { - opacity: 0.55; - cursor: not-allowed; -} -.d-pagination__page.is-active { - background: var(--color-primary); - color: var(--color-white); -} - @media (max-width: 1439px) { .d-page { padding-top: calc(var(--header-h) + 40Px); @@ -330,12 +287,4 @@ width: 20Px; height: 20Px; } - .d-pagination { - gap: 8Px; - } - .d-pagination__btn, .d-pagination__page { - width: 40Px; - height: 40Px; - font-size: 16Px; - } } \ No newline at end of file diff --git a/public/themes/dist_static/static/css/faq.css b/public/themes/dist_static/static/css/faq.css index 05d174c..a67e64b 100644 --- a/public/themes/dist_static/static/css/faq.css +++ b/public/themes/dist_static/static/css/faq.css @@ -71,6 +71,7 @@ .f-list { display: flex; flex-direction: column; + margin-bottom: 3.5rem; } .f-item { diff --git a/public/themes/dist_static/static/css/news.css b/public/themes/dist_static/static/css/news.css index d3f5b33..ffa745d 100644 --- a/public/themes/dist_static/static/css/news.css +++ b/public/themes/dist_static/static/css/news.css @@ -264,44 +264,6 @@ border-top-color: var(--color-primary); } -.n-pagination { - display: flex; - align-items: center; - justify-content: center; - gap: 0.5rem; -} -.n-pagination__btn, .n-pagination__page { - display: inline-flex; - align-items: center; - justify-content: center; - width: 3rem; - height: 3rem; - padding: 0; - background-color: rgba(175, 181, 185, 0.15); - border-radius: 1rem; - color: var(--color-text-muted); - font-family: "MiSans VF", "PingFang SC", sans-serif; - font-size: var(--font-18); - font-weight: 400; - line-height: var(--font-24); - cursor: default; -} -.n-pagination__btn img { - display: block; - width: 0.875rem; - height: auto; - transform: scaleX(-1); - filter: grayscale(1) opacity(0.45); -} -.n-pagination__btn--next img { - transform: none; - filter: none; -} -.n-pagination__page.is-active { - background: var(--color-primary); - color: var(--color-white); -} - @media (max-width: 1439px) { .n-page { padding-top: calc(var(--header-h) + 48Px); @@ -463,13 +425,4 @@ .n-card .n-link { padding-top: 16Px; } - .n-pagination { - gap: 10Px; - } - .n-pagination__btn, .n-pagination__page { - width: 40Px; - height: 40Px; - border-radius: 12Px; - font-size: 16Px; - } } \ No newline at end of file diff --git a/public/themes/dist_static/static/css/pagination.css b/public/themes/dist_static/static/css/pagination.css new file mode 100644 index 0000000..ddab417 --- /dev/null +++ b/public/themes/dist_static/static/css/pagination.css @@ -0,0 +1,59 @@ +.d-pagination { + display: flex; + align-items: center; + justify-content: center; + gap: 0.75rem; +} +.d-pagination__btn, +.d-pagination__page { + display: inline-flex; + align-items: center; + justify-content: center; + width: 3rem; + height: 3rem; + padding: 0; + border: 0; + border-radius: 0.5rem; + background: rgba(175, 181, 185, 0.15); + color: rgba(46, 53, 58, 0.6); + font-family: "MiSans VF", "PingFang SC", sans-serif; + font-size: var(--font-20); + font-weight: 400; + line-height: var(--font-24); + cursor: default; +} +.d-pagination__btn:not(:disabled), +.d-pagination__page[data-page]:not(.is-active) { + cursor: pointer; +} +.d-pagination__btn img { + display: block; + width: 1.0625rem; + height: auto; + transform: scaleX(-1); + filter: grayscale(1) opacity(0.45); +} +.d-pagination__btn--next img { + transform: none; + filter: none; +} +.d-pagination__btn:disabled { + opacity: 0.55; + cursor: not-allowed; +} +.d-pagination__page.is-active { + background: var(--color-primary); + color: var(--color-white); +} + +@media (max-width: 576px) { + .d-pagination { + gap: 8Px; + } + .d-pagination__btn, + .d-pagination__page { + width: 40Px; + height: 40Px; + font-size: 16Px; + } +} diff --git a/public/themes/dist_static/static/css/search.css b/public/themes/dist_static/static/css/search.css index 6eb3bbe..45ca8c2 100644 --- a/public/themes/dist_static/static/css/search.css +++ b/public/themes/dist_static/static/css/search.css @@ -107,6 +107,7 @@ .sr-list { display: flex; flex-direction: column; + margin-bottom: 3.5rem; } .sr-item { diff --git a/public/themes/dist_static/static/css/video.css b/public/themes/dist_static/static/css/video.css index eff9a04..7df7ca3 100644 --- a/public/themes/dist_static/static/css/video.css +++ b/public/themes/dist_static/static/css/video.css @@ -224,49 +224,6 @@ color: var(--color-primary); } -.v-pagination { - display: flex; - align-items: center; - justify-content: center; - gap: 0.75rem; -} -.v-pagination__btn, .v-pagination__page { - display: inline-flex; - align-items: center; - justify-content: center; - width: 3rem; - height: 3rem; - padding: 0; - border: 0; - border-radius: 1rem; - background: rgba(175, 181, 185, 0.15); - color: rgba(46, 53, 58, 0.6); - font-family: "MiSans VF", "PingFang SC", sans-serif; - font-size: var(--font-20); - font-weight: 400; - line-height: var(--font-24); - cursor: default; -} -.v-pagination__btn img { - display: block; - width: 1.0625rem; - height: auto; - transform: scaleX(-1); - filter: grayscale(1) opacity(0.45); -} -.v-pagination__btn--next img { - transform: none; - filter: none; -} -.v-pagination__btn:disabled { - opacity: 0.55; - cursor: not-allowed; -} -.v-pagination__page.is-active { - background: var(--color-primary); - color: var(--color-white); -} - .v-modal { position: fixed; inset: 0; @@ -443,13 +400,4 @@ .v-card__date { font-size: 14Px; } - .v-pagination { - gap: 8Px; - } - .v-pagination__btn, .v-pagination__page { - width: 40Px; - height: 40Px; - border-radius: 12Px; - font-size: 16Px; - } } \ No newline at end of file diff --git a/public/themes/dist_static/static/js/announce.js b/public/themes/dist_static/static/js/announce.js index d2836a0..9351ca0 100644 --- a/public/themes/dist_static/static/js/announce.js +++ b/public/themes/dist_static/static/js/announce.js @@ -1,4 +1,5 @@ import "./common.js"; +import "./pagination.js"; //#region js/announce.js function setActiveNav() { const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav"); @@ -64,13 +65,13 @@ function initTabKeywordsSearch() { const params = new URLSearchParams(); const keywords = $(this).find('[name="keywords"]').val().trim(); const tabId = getActiveTabId(); - if (tabId) params.set("tab", tabId); + if (tabId) params.set("cid", tabId); if (keywords) params.set("keywords", keywords); const query = params.toString(); window.location.href = query ? `${window.location.pathname}?${query}` : window.location.pathname; }); const searchParams = new URLSearchParams(window.location.search); - const tabParam = searchParams.get("tab"); + const tabParam = searchParams.get("cid"); const keywordsParam = searchParams.get("keywords"); if (keywordsParam) $("[data-tab-search] [name='keywords']").val(keywordsParam); if (tabParam) activateTabById(tabParam); diff --git a/public/themes/dist_static/static/js/download.js b/public/themes/dist_static/static/js/download.js index 09e467f..032c59e 100644 --- a/public/themes/dist_static/static/js/download.js +++ b/public/themes/dist_static/static/js/download.js @@ -1,4 +1,5 @@ import "./common.js"; +import "./pagination.js"; //#region js/download.js function setActiveNav() { const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav"); @@ -28,31 +29,13 @@ $(function() { return $active.attr("data-tab") || ""; }; const getKeywords = () => $("[data-tab-search] [name='keywords']").val().trim(); - const getCurrentPage = () => { - const activePage = Number($(".d-pagination__page.is-active").attr("data-page") || 1); - return Number.isFinite(activePage) && activePage > 0 ? activePage : 1; - }; - const getMaxPage = () => { - let max = 1; - $(".d-pagination__page[data-page]").each(function() { - const page = Number($(this).attr("data-page") || 0); - if (page > max) max = page; - }); - return max; - }; - const buildQueryUrl = ({ tabId = getActiveTabId(), keywords = getKeywords(), page } = {}) => { + const buildQueryUrl = ({ tabId = getActiveTabId(), keywords = getKeywords() } = {}) => { const params = new URLSearchParams(); if (tabId) params.set("cid", tabId); if (keywords) params.set("keywords", keywords); - if (page && Number(page) > 1) params.set("page", String(page)); const query = params.toString(); return query ? `${window.location.pathname}?${query}` : window.location.pathname; }; - const goToPage = (page) => { - const nextPage = Number(page); - if (!Number.isFinite(nextPage) || nextPage < 1) return; - window.location.href = buildQueryUrl({ page: nextPage }); - }; const activateTabById = (tabId) => { if (!tabId) return; const $dropdownItem = $(`.d-tabs__dropdown-item[data-tab="${tabId}"]`).first(); @@ -66,15 +49,6 @@ $(function() { const $target = $(`.d-tabs__item[data-tab="${tabId}"]`).first(); if ($target.length) activateTab($target); }; - const activatePageById = (page) => { - const pageNum = Number(page) || 1; - const $target = $(`.d-pagination__page[data-page="${pageNum}"]`).first(); - if (!$target.length) return; - $(".d-pagination__page").removeClass("is-active").removeAttr("aria-current"); - $target.addClass("is-active").attr("aria-current", "page"); - $("[data-page-prev]").prop("disabled", pageNum <= 1); - $("[data-page-next]").prop("disabled", pageNum >= getMaxPage()); - }; $(".d-tabs__item:not([data-dropdown-trigger])").on("click", function() { activateTab($(this)); closeDropdowns(); @@ -107,25 +81,10 @@ $(function() { keywords: $(this).find('[name="keywords"]').val().trim() }); }); - $(".d-pagination__page").on("click", function() { - const page = $(this).attr("data-page"); - if (!page || $(this).hasClass("is-active")) return; - goToPage(page); - }); - $("[data-page-prev]").on("click", function() { - if ($(this).prop("disabled")) return; - goToPage(getCurrentPage() - 1); - }); - $("[data-page-next]").on("click", function() { - if ($(this).prop("disabled")) return; - goToPage(getCurrentPage() + 1); - }); const searchParams = new URLSearchParams(window.location.search); const tabParam = searchParams.get("cid"); const keywordsParam = searchParams.get("keywords"); - const pageParam = searchParams.get("page"); if (keywordsParam) $("[data-tab-search] [name='keywords']").val(keywordsParam); if (tabParam) activateTabById(tabParam); - activatePageById(pageParam || 1); }); //#endregion diff --git a/public/themes/dist_static/static/js/faq.js b/public/themes/dist_static/static/js/faq.js index adecbff..ac2d890 100644 --- a/public/themes/dist_static/static/js/faq.js +++ b/public/themes/dist_static/static/js/faq.js @@ -1,4 +1,5 @@ import "./common.js"; +import "./pagination.js"; //#region js/faq.js function setActiveNav() { const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav"); diff --git a/public/themes/dist_static/static/js/news.js b/public/themes/dist_static/static/js/news.js index 4438445..056d3e1 100644 --- a/public/themes/dist_static/static/js/news.js +++ b/public/themes/dist_static/static/js/news.js @@ -1,2 +1,3 @@ import "./common.js"; +import "./pagination.js"; import "./news2.js"; diff --git a/public/themes/dist_static/static/js/pagination.js b/public/themes/dist_static/static/js/pagination.js new file mode 100644 index 0000000..96bdef8 --- /dev/null +++ b/public/themes/dist_static/static/js/pagination.js @@ -0,0 +1,29 @@ +//#region js/pagination.js +function getCurrentPage() { + const activePage = Number($("[data-pagination] .d-pagination__page.is-active").attr("data-page") || 1); + return Number.isFinite(activePage) && activePage > 0 ? activePage : 1; +} +function goToPage(page) { + const nextPage = Number(page); + if (!Number.isFinite(nextPage) || nextPage < 1) return; + const url = new URL(window.location.href); + if (nextPage <= 1) url.searchParams.delete("page"); + else url.searchParams.set("page", String(nextPage)); + const query = url.searchParams.toString(); + window.location.href = query ? `${url.pathname}?${query}` : url.pathname; +} +$(function() { + $(document).on("click", "[data-pagination] .d-pagination__page[data-page]", function() { + if ($(this).hasClass("is-active") || $(this).prop("disabled")) return; + goToPage($(this).attr("data-page")); + }); + $(document).on("click", "[data-pagination] [data-page-prev]", function() { + if ($(this).prop("disabled")) return; + goToPage(getCurrentPage() - 1); + }); + $(document).on("click", "[data-pagination] [data-page-next]", function() { + if ($(this).prop("disabled")) return; + goToPage(getCurrentPage() + 1); + }); +}); +//#endregion diff --git a/public/themes/dist_static/static/js/search.js b/public/themes/dist_static/static/js/search.js index 6b0ea96..674b72f 100644 --- a/public/themes/dist_static/static/js/search.js +++ b/public/themes/dist_static/static/js/search.js @@ -1,68 +1,13 @@ import "./common.js"; +import "./pagination.js"; //#region js/search.js -function getQuery() { - return new URLSearchParams(window.location.search).get("q")?.trim() || ""; -} -function matchItem($item, type, keyword) { - const itemType = $item.attr("data-type") || ""; - if (type !== "all" && itemType !== type) return false; - if (!keyword) return true; - return [ - $item.attr("data-keywords") || "", - $item.find(".sr-item__title").text(), - $item.find(".sr-item__desc").text(), - $item.find(".sr-item__type").text() - ].join(" ").toLowerCase().includes(keyword.toLowerCase()); -} -function updateCounts($items) { - const keyword = ($(".sr-search .s-search__input").val() || "").trim(); - [ - "all", - "product", - "solution", - "news", - "faq" - ].forEach((type) => { - const count = $items.filter((_, el) => matchItem($(el), type, keyword)).length; - $(`[data-count="${type}"]`).text(String(count)); - }); -} -function applyFilter() { - const type = $(".sr-tabs__item.is-active").attr("data-type") || "all"; - const keyword = ($(".sr-search .s-search__input").val() || "").trim(); - const $items = $(".sr-item"); - let visible = 0; - $items.each(function() { - const show = matchItem($(this), type, keyword); - this.hidden = !show; - if (show) visible += 1; - }); - updateCounts($items); - $(".sr-empty").prop("hidden", visible > 0); -} $(function() { - const q = getQuery(); + const q = new URLSearchParams(window.location.search).get("q")?.trim() || ""; if (q) $(".sr-search .s-search__input").val(q); - $(".sr-tabs__item").on("click", function() { - const $btn = $(this); - $btn.addClass("is-active").attr("aria-selected", "true"); - $btn.siblings(".sr-tabs__item").removeClass("is-active").attr("aria-selected", "false"); - applyFilter(); - }); $(".sr-hot__tag").on("click", function() { const keyword = $(this).attr("data-keyword") || $(this).text().trim(); $(".sr-search .s-search__input").val(keyword); - applyFilter(); - }); - $(".sr-search").on("submit", function(e) { - e.preventDefault(); - const keyword = ($(".sr-search .s-search__input").val() || "").trim(); - const url = new URL(window.location.href); - if (keyword) url.searchParams.set("q", keyword); - else url.searchParams.delete("q"); - window.history.replaceState({}, "", url); - applyFilter(); + $(".sr-search").trigger("submit"); }); - applyFilter(); }); //#endregion diff --git a/public/themes/dist_static/static/js/video.js b/public/themes/dist_static/static/js/video.js index 892d555..29312a4 100644 --- a/public/themes/dist_static/static/js/video.js +++ b/public/themes/dist_static/static/js/video.js @@ -1,4 +1,5 @@ import "./common.js"; +import "./pagination.js"; //#region assets/videos/banner.mp4 var banner_default = "" + new URL("../assets/banner-BKfbidi-.mp4", import.meta.url).href; //#endregion diff --git a/public/themes/website/1/zh/demo/announce.html b/public/themes/website/1/zh/demo/announce.html index 7cae52c..0c8cd24 100644 --- a/public/themes/website/1/zh/demo/announce.html +++ b/public/themes/website/1/zh/demo/announce.html @@ -43,10 +43,11 @@ integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> - - - - + + + + + @@ -57,8 +58,8 @@
    -

    产品公告

    -

    了解产品最新动态

    +

    {$current_cate.title}

    +

    {$current_cate.description}

    @@ -70,14 +71,10 @@
    + {$hc_content|raw}
    diff --git a/public/themes/website/1/zh/demo/download.html b/public/themes/website/1/zh/demo/download.html index cee8774..609a39f 100644 --- a/public/themes/website/1/zh/demo/download.html +++ b/public/themes/website/1/zh/demo/download.html @@ -48,6 +48,7 @@ + diff --git a/public/themes/website/1/zh/demo/faq.html b/public/themes/website/1/zh/demo/faq.html index 2a67632..0069f42 100644 --- a/public/themes/website/1/zh/demo/faq.html +++ b/public/themes/website/1/zh/demo/faq.html @@ -46,6 +46,7 @@ + diff --git a/public/themes/website/1/zh/demo/news.html b/public/themes/website/1/zh/demo/news.html index 18c57ea..cb59d25 100644 --- a/public/themes/website/1/zh/demo/news.html +++ b/public/themes/website/1/zh/demo/news.html @@ -53,6 +53,7 @@ + @@ -92,16 +93,11 @@
    @@ -162,14 +158,16 @@ {volist name="hc_content" id="vo_content"} {php} - $content = $hc_content['content'] ?? ''; - $description = $hc_content['description'] ?? ''; - $create_time_int = $hc_content['create_time'] ?? ''; + $description = $vo_content['description'] ?? ''; + $create_time_int = $vo_content['create_time'] ?? ''; $create_time_str = ''; if(!empty($create_time_int)){ - $create_time_str = date('Y-m-d', $create_time_int); + if (is_numeric($create_time_int)) { + $create_time_str = date('Y-m-d', (int)$create_time_int); + } else { + $create_time_str = $create_time_int; + } } - // dd($hc_content->toArray());exit; {/php}
    diff --git a/public/themes/website/1/zh/demo/search.html b/public/themes/website/1/zh/demo/search.html index f222216..859dd34 100644 --- a/public/themes/website/1/zh/demo/search.html +++ b/public/themes/website/1/zh/demo/search.html @@ -43,10 +43,11 @@ integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> - - - - + + + + + @@ -60,7 +61,7 @@

    搜索

    - +
    @@ -73,122 +74,37 @@
    -
    - - - - - -
    -
    - - - - - - -
    - - + {volist name="list" id="vo"} + {php} + $sr_date = ''; + $sr_time = $vo['publish_time'] ?? ($vo['create_time'] ?? ''); + if (!empty($sr_time)) { + $sr_date = is_numeric($sr_time) ? date('Y-m-d', (int)$sr_time) : $sr_time; + } + $sr_cid = $vo['category_id'] ?? ($vo['category'][0]['id'] ?? 0); + $sr_thumb = is_array($vo['thumbnail'] ?? null) ? ($vo['thumbnail']['url'] ?? '') : ''; + $sr_url = hcUrl('detail/index', ['id' => $vo['id'], 'cid' => $sr_cid]); + {/php} +
    + +
    - 解决方案 + {if !empty($vo['category'][0]['title'])}{$vo.category.0.title}{else /}内容{/if} - +

    - 冶金行业解决方案 + {$vo.title}

    -

    - 冶金工业一直面临着数据量大、信息系统多、黑箱体系、信息孤岛、控制滞后的问题。睿能科技结合多年行业经验,配合先进控制技术和多目标优化技术等智能算法,形成一体化冶金行业解决方案,以优质的产品和服务不断为冶金行业的... -

    + {notempty name="vo.description"} +

    {$vo.description}

    + {/notempty}
    - + 探索更多 @@ -197,9 +113,13 @@
    + {/volist}
    - + {empty name="list"} +

    未找到相关结果,请尝试其他关键词

    + {/empty} + {$list_page|raw} diff --git a/public/themes/website/1/zh/demo/video.html b/public/themes/website/1/zh/demo/video.html index ddd047e..2388f7f 100644 --- a/public/themes/website/1/zh/demo/video.html +++ b/public/themes/website/1/zh/demo/video.html @@ -46,6 +46,7 @@ + @@ -84,7 +85,7 @@
    - {hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="1" item="vo"} + {hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="12" item="vo"} {/hcTaglib:contentPage} - {$hc_content|raw} -
    + + {$hc_content|raw} -