Browse Source

feat(pagination): 封装分页逻辑

master
peijunlei 2 weeks ago
parent
commit
cd60d58704
  1. 2
      app/controller/frontend/SearchController.php
  2. 92
      app/provider/Bootstrap.php
  3. 1
      public/themes/dist_static/static/css/announce.css
  4. 51
      public/themes/dist_static/static/css/download.css
  5. 1
      public/themes/dist_static/static/css/faq.css
  6. 47
      public/themes/dist_static/static/css/news.css
  7. 59
      public/themes/dist_static/static/css/pagination.css
  8. 1
      public/themes/dist_static/static/css/search.css
  9. 52
      public/themes/dist_static/static/css/video.css
  10. 5
      public/themes/dist_static/static/js/announce.js
  11. 45
      public/themes/dist_static/static/js/download.js
  12. 1
      public/themes/dist_static/static/js/faq.js
  13. 1
      public/themes/dist_static/static/js/news.js
  14. 29
      public/themes/dist_static/static/js/pagination.js
  15. 61
      public/themes/dist_static/static/js/search.js
  16. 1
      public/themes/dist_static/static/js/video.js
  17. 111
      public/themes/website/1/zh/demo/announce.html
  18. 1
      public/themes/website/1/zh/demo/download.html
  19. 1
      public/themes/website/1/zh/demo/faq.html
  20. 24
      public/themes/website/1/zh/demo/news.html
  21. 144
      public/themes/website/1/zh/demo/search.html
  22. 30
      public/themes/website/1/zh/demo/video.html

2
app/controller/frontend/SearchController.php

@ -40,7 +40,7 @@ class SearchController extends BaseController
//搜索 //搜索
$param = $this->request->param(); $param = $this->request->param();
$keywords = $param['q'];
$keywords = $param['q'] ?? '';
$this->assign('keywords',$keywords); $this->assign('keywords',$keywords);
// 获取可以查询的栏目 // 获取可以查询的栏目

92
app/provider/Bootstrap.php

@ -5,26 +5,26 @@ namespace app\provider;
use think\Paginator; use think\Paginator;
/** /**
* Bootstrap 分页驱动
* Bootstrap 分页驱动(前台 d-pagination 结构)
*/ */
class Bootstrap extends Paginator 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 * @param string $text
* @return string * @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 '<button type="button" class="d-pagination__btn" data-page-prev aria-label="'
. htmlentities($text)
. '"' . $disabled . '>'
. $this->getArrowImg()
. '</button>';
} }
/** /**
@ -32,15 +32,15 @@ class Bootstrap extends Paginator
* @param string $text * @param string $text
* @return string * @return string
*/ */
protected function getNextButton(string $text = '&raquo;'): string
protected function getNextButton(string $text = '下一页'): string
{ {
if (!$this->hasMore) {
return $this->getDisabledTextWrapper($text);
}
$disabled = !$this->hasMore ? ' disabled' : '';
$url = $this->currentPage + 1;
return $this->getPageLinkWrapper($url, $text);
return '<button type="button" class="d-pagination__btn d-pagination__btn--next" data-page-next aria-label="'
. htmlentities($text)
. '"' . $disabled . '>'
. $this->getArrowImg()
. '</button>';
} }
/** /**
@ -96,7 +96,7 @@ class Bootstrap extends Paginator
} }
/** /**
* 渲染分页html
* 渲染分页 html
* @return mixed * @return mixed
*/ */
public function render() public function render()
@ -104,66 +104,73 @@ class Bootstrap extends Paginator
if ($this->hasPages()) { if ($this->hasPages()) {
if ($this->simple) { if ($this->simple) {
return sprintf( return sprintf(
'<ul class="pager">%s %s</ul>',
$this->getPreviousButton(),
$this->getNextButton()
);
} else {
return sprintf(
'<ul class="d-pagination">%s %s %s</ul>',
'<nav class="d-pagination" data-pagination>%s%s</nav>',
$this->getPreviousButton(), $this->getPreviousButton(),
$this->getLinks(),
$this->getNextButton() $this->getNextButton()
); );
} }
return sprintf(
'<nav class="d-pagination" data-pagination>%s%s%s</nav>',
$this->getPreviousButton(),
$this->getLinks(),
$this->getNextButton()
);
} }
return '';
} }
/** /**
* 生成一个可点击的按钮
* 生成一个可点击的页码按钮
* *
* @param string $url
* @param string $url 这里实际是页码数字
* @param string $page * @param string $page
* @return string * @return string
*/ */
protected function getAvailablePageWrapper(string $url, string $page): string protected function getAvailablePageWrapper(string $url, string $page): string
{ {
return '<button type="button" class="d-pagination__page" data-page="' . $url . '">' . $page . '</button>';
// return '<li><a href="' . htmlentities($url) . '">' . $page . '</a></li>';
return '<button type="button" class="d-pagination__page" data-page="'
. htmlentities((string)$url)
. '">'
. $page
. '</button>';
} }
/** /**
* 生成一个禁用的按钮
* 生成一个禁用的按钮(兼容旧调用)
* *
* @param string $text * @param string $text
* @return string * @return string
*/ */
protected function getDisabledTextWrapper(string $text): string protected function getDisabledTextWrapper(string $text): string
{ {
return '<button type="button" class="d-pagination__btn" aria-label="' . $text . '" disabled>' . $text . '</button>';
// return '<li class="disabled"><span>' . $text . '</span></li>';
return '<button type="button" class="d-pagination__page" disabled>' . $text . '</button>';
} }
/** /**
* 生成一个激活的按钮
* 生成一个激活的页码按钮
* *
* @param string $text * @param string $text
* @return string * @return string
*/ */
protected function getActivePageWrapper(string $text): string protected function getActivePageWrapper(string $text): string
{ {
return '<button type="button" class="d-pagination__page is-active" aria-current="page">' . $text . '</button>';
// return '<li class="active"><span>' . $text . '</span></li>';
return '<button type="button" class="d-pagination__page is-active" data-page="'
. htmlentities((string)$text)
. '" aria-current="page">'
. $text
. '</button>';
} }
/** /**
* 生成省略号按钮
* 生成省略号
* *
* @return string * @return string
*/ */
protected function getDots(): string protected function getDots(): string
{ {
return $this->getDisabledTextWrapper('...');
return '<span class="d-pagination__page" aria-hidden="true">...</span>';
} }
/** /**
@ -177,7 +184,7 @@ class Bootstrap extends Paginator
$html = ''; $html = '';
foreach ($urls as $page => $url) { foreach ($urls as $page => $url) {
$html .= $this->getPageLinkWrapper($url, $page);
$html .= $this->getPageLinkWrapper((string)$url, (string)$page);
} }
return $html; return $html;
@ -187,7 +194,7 @@ class Bootstrap extends Paginator
* 生成普通页码按钮 * 生成普通页码按钮
* *
* @param string $url * @param string $url
* @param string $page
* @param string $page
* @return string * @return string
*/ */
protected function getPageLinkWrapper(string $url, string $page): string protected function getPageLinkWrapper(string $url, string $page): string
@ -199,7 +206,7 @@ class Bootstrap extends Paginator
return $this->getAvailablePageWrapper($url, $page); return $this->getAvailablePageWrapper($url, $page);
} }
private function getPageRange(int $start, int $end)
private function getPageRange(int $start, int $end): array
{ {
$urls = []; $urls = [];
@ -209,4 +216,9 @@ class Bootstrap extends Paginator
return $urls; return $urls;
} }
private function getArrowImg(): string
{
return '<img src="' . self::ARROW_SVG . '" alt="" width="17" height="7" />';
}
} }

1
public/themes/dist_static/static/css/announce.css

@ -123,6 +123,7 @@
display: grid; display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 2.5rem; gap: 2.5rem;
margin-bottom: 3.5rem;
} }
.a-card { .a-card {

51
public/themes/dist_static/static/css/download.css

@ -187,49 +187,6 @@
height: 1.5rem; 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) { @media (max-width: 1439px) {
.d-page { .d-page {
padding-top: calc(var(--header-h) + 40Px); padding-top: calc(var(--header-h) + 40Px);
@ -330,12 +287,4 @@
width: 20Px; width: 20Px;
height: 20Px; height: 20Px;
} }
.d-pagination {
gap: 8Px;
}
.d-pagination__btn, .d-pagination__page {
width: 40Px;
height: 40Px;
font-size: 16Px;
}
} }

1
public/themes/dist_static/static/css/faq.css

@ -71,6 +71,7 @@
.f-list { .f-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 3.5rem;
} }
.f-item { .f-item {

47
public/themes/dist_static/static/css/news.css

@ -264,44 +264,6 @@
border-top-color: var(--color-primary); 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) { @media (max-width: 1439px) {
.n-page { .n-page {
padding-top: calc(var(--header-h) + 48Px); padding-top: calc(var(--header-h) + 48Px);
@ -463,13 +425,4 @@
.n-card .n-link { .n-card .n-link {
padding-top: 16Px; padding-top: 16Px;
} }
.n-pagination {
gap: 10Px;
}
.n-pagination__btn, .n-pagination__page {
width: 40Px;
height: 40Px;
border-radius: 12Px;
font-size: 16Px;
}
} }

59
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;
}
}

1
public/themes/dist_static/static/css/search.css

@ -107,6 +107,7 @@
.sr-list { .sr-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 3.5rem;
} }
.sr-item { .sr-item {

52
public/themes/dist_static/static/css/video.css

@ -224,49 +224,6 @@
color: var(--color-primary); 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 { .v-modal {
position: fixed; position: fixed;
inset: 0; inset: 0;
@ -443,13 +400,4 @@
.v-card__date { .v-card__date {
font-size: 14Px; font-size: 14Px;
} }
.v-pagination {
gap: 8Px;
}
.v-pagination__btn, .v-pagination__page {
width: 40Px;
height: 40Px;
border-radius: 12Px;
font-size: 16Px;
}
} }

5
public/themes/dist_static/static/js/announce.js

@ -1,4 +1,5 @@
import "./common.js"; import "./common.js";
import "./pagination.js";
//#region js/announce.js //#region js/announce.js
function setActiveNav() { function setActiveNav() {
const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav"); const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav");
@ -64,13 +65,13 @@ function initTabKeywordsSearch() {
const params = new URLSearchParams(); const params = new URLSearchParams();
const keywords = $(this).find('[name="keywords"]').val().trim(); const keywords = $(this).find('[name="keywords"]').val().trim();
const tabId = getActiveTabId(); const tabId = getActiveTabId();
if (tabId) params.set("tab", tabId);
if (tabId) params.set("cid", tabId);
if (keywords) params.set("keywords", keywords); if (keywords) params.set("keywords", keywords);
const query = params.toString(); const query = params.toString();
window.location.href = query ? `${window.location.pathname}?${query}` : window.location.pathname; window.location.href = query ? `${window.location.pathname}?${query}` : window.location.pathname;
}); });
const searchParams = new URLSearchParams(window.location.search); const searchParams = new URLSearchParams(window.location.search);
const tabParam = searchParams.get("tab");
const tabParam = searchParams.get("cid");
const keywordsParam = searchParams.get("keywords"); const keywordsParam = searchParams.get("keywords");
if (keywordsParam) $("[data-tab-search] [name='keywords']").val(keywordsParam); if (keywordsParam) $("[data-tab-search] [name='keywords']").val(keywordsParam);
if (tabParam) activateTabById(tabParam); if (tabParam) activateTabById(tabParam);

45
public/themes/dist_static/static/js/download.js

@ -1,4 +1,5 @@
import "./common.js"; import "./common.js";
import "./pagination.js";
//#region js/download.js //#region js/download.js
function setActiveNav() { function setActiveNav() {
const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav"); const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav");
@ -28,31 +29,13 @@ $(function() {
return $active.attr("data-tab") || ""; return $active.attr("data-tab") || "";
}; };
const getKeywords = () => $("[data-tab-search] [name='keywords']").val().trim(); 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(); const params = new URLSearchParams();
if (tabId) params.set("cid", tabId); if (tabId) params.set("cid", tabId);
if (keywords) params.set("keywords", keywords); if (keywords) params.set("keywords", keywords);
if (page && Number(page) > 1) params.set("page", String(page));
const query = params.toString(); const query = params.toString();
return query ? `${window.location.pathname}?${query}` : window.location.pathname; 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) => { const activateTabById = (tabId) => {
if (!tabId) return; if (!tabId) return;
const $dropdownItem = $(`.d-tabs__dropdown-item[data-tab="${tabId}"]`).first(); const $dropdownItem = $(`.d-tabs__dropdown-item[data-tab="${tabId}"]`).first();
@ -66,15 +49,6 @@ $(function() {
const $target = $(`.d-tabs__item[data-tab="${tabId}"]`).first(); const $target = $(`.d-tabs__item[data-tab="${tabId}"]`).first();
if ($target.length) activateTab($target); 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() { $(".d-tabs__item:not([data-dropdown-trigger])").on("click", function() {
activateTab($(this)); activateTab($(this));
closeDropdowns(); closeDropdowns();
@ -107,25 +81,10 @@ $(function() {
keywords: $(this).find('[name="keywords"]').val().trim() 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 searchParams = new URLSearchParams(window.location.search);
const tabParam = searchParams.get("cid"); const tabParam = searchParams.get("cid");
const keywordsParam = searchParams.get("keywords"); const keywordsParam = searchParams.get("keywords");
const pageParam = searchParams.get("page");
if (keywordsParam) $("[data-tab-search] [name='keywords']").val(keywordsParam); if (keywordsParam) $("[data-tab-search] [name='keywords']").val(keywordsParam);
if (tabParam) activateTabById(tabParam); if (tabParam) activateTabById(tabParam);
activatePageById(pageParam || 1);
}); });
//#endregion //#endregion

1
public/themes/dist_static/static/js/faq.js

@ -1,4 +1,5 @@
import "./common.js"; import "./common.js";
import "./pagination.js";
//#region js/faq.js //#region js/faq.js
function setActiveNav() { function setActiveNav() {
const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav"); const pageNav = document.querySelector("[data-nav]")?.getAttribute("data-nav");

1
public/themes/dist_static/static/js/news.js

@ -1,2 +1,3 @@
import "./common.js"; import "./common.js";
import "./pagination.js";
import "./news2.js"; import "./news2.js";

29
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

61
public/themes/dist_static/static/js/search.js

@ -1,68 +1,13 @@
import "./common.js"; import "./common.js";
import "./pagination.js";
//#region js/search.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() { $(function() {
const q = getQuery();
const q = new URLSearchParams(window.location.search).get("q")?.trim() || "";
if (q) $(".sr-search .s-search__input").val(q); 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() { $(".sr-hot__tag").on("click", function() {
const keyword = $(this).attr("data-keyword") || $(this).text().trim(); const keyword = $(this).attr("data-keyword") || $(this).text().trim();
$(".sr-search .s-search__input").val(keyword); $(".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 //#endregion

1
public/themes/dist_static/static/js/video.js

@ -1,4 +1,5 @@
import "./common.js"; import "./common.js";
import "./pagination.js";
//#region assets/videos/banner.mp4 //#region assets/videos/banner.mp4
var banner_default = "" + new URL("../assets/banner-BKfbidi-.mp4", import.meta.url).href; var banner_default = "" + new URL("../assets/banner-BKfbidi-.mp4", import.meta.url).href;
//#endregion //#endregion

111
public/themes/website/1/zh/demo/announce.html

@ -43,10 +43,11 @@
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
<script type="module" crossorigin src="./static/js/announce.js"></script>
<link rel="modulepreload" crossorigin href="./static/js/common.js">
<link rel="stylesheet" crossorigin href="./static/css/common.css">
<link rel="stylesheet" crossorigin href="./static/css/announce.css">
<script type="module" crossorigin src="/themes/dist_static/static/js/announce.js"></script>
<link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/pagination.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/announce.css">
</head> </head>
<body> <body>
@ -57,8 +58,8 @@
<main class="main-announce" data-header-dark data-nav="服务支持"> <main class="main-announce" data-header-dark data-nav="服务支持">
<div class="a-page section__wrap"> <div class="a-page section__wrap">
<div class="a-head"> <div class="a-head">
<h1 class="a-head__title">产品公告</h1>
<p class="a-head__desc">了解产品最新动态</p>
<h1 class="a-head__title">{$current_cate.title}</h1>
<p class="a-head__desc">{$current_cate.description}</p>
</div> </div>
<div class="a-toolbar"> <div class="a-toolbar">
@ -70,14 +71,10 @@
</svg> </svg>
</button> </button>
<div class="a-filter__dropdown" data-filter-dropdown hidden> <div class="a-filter__dropdown" data-filter-dropdown hidden>
<button type="button" class="a-filter__dropdown-item is-active" data-filter-clear>全部</button>
<button type="button" class="a-filter__dropdown-item">工业控制</button>
<button type="button" class="a-filter__dropdown-item">伺服系统</button>
<button type="button" class="a-filter__dropdown-item">变频器</button>
<button type="button" class="a-filter__dropdown-item">软启动器</button>
<button type="button" class="a-filter__dropdown-item">工业机器人</button>
<button type="button" class="a-filter__dropdown-item">具身机器人部件</button>
<button type="button" class="a-filter__dropdown-item">纺织行业专用</button>
<button type="button" class="a-filter__dropdown-item is-active" data-tab="{$current_cate.id}" data-filter-clear>全部</button>
{volist name="sub_cates" id="vo"}
<button type="button" class="a-filter__dropdown-item" data-tab="{$vo.id}">{$vo.title}</button>
{/volist}
</div> </div>
</div> </div>
<form class="s-search" role="search" data-tab-search> <form class="s-search" role="search" data-tab-search>
@ -88,86 +85,10 @@
</div> </div>
<div class="a-grid"> <div class="a-grid">
<a class="a-card" href="/assets/attachments/产品公告测试文件.pdf" target="_blank">
<time class="a-card__date" datetime="2025-06-10">2025.06.10</time>
<h2 class="a-card__title">产品停产公告——MC2系列伺服电机60、80框</h2>
<span class="a-card__link">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</span>
</a>
<a class="a-card" href="/assets/attachments/产品公告测试文件.pdf" target="_blank">
<time class="a-card__date" datetime="2025-06-10">2025.06.10</time>
<h2 class="a-card__title">产品停产公告——MC2系列伺服电机60、80框</h2>
<span class="a-card__link">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</span>
</a>
<a class="a-card" href="/assets/attachments/产品公告测试文件.pdf" target="_blank">
<time class="a-card__date" datetime="2025-06-10">2025.06.10</time>
<h2 class="a-card__title">产品停产公告——MC2系列伺服电机60、80框</h2>
<span class="a-card__link">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</span>
</a>
<a class="a-card" href="/assets/attachments/产品公告测试文件.pdf" target="_blank">
<time class="a-card__date" datetime="2025-06-10">2025.06.10</time>
<h2 class="a-card__title">产品停产公告——MC2系列伺服电机60、80框</h2>
<span class="a-card__link">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</span>
</a>
<a class="a-card" href="/assets/attachments/产品公告测试文件.pdf" target="_blank">
<time class="a-card__date" datetime="2025-06-10">2025.06.10</time>
<h2 class="a-card__title">产品停产公告——MC2系列伺服电机60、80框</h2>
<span class="a-card__link">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</span>
</a>
<a class="a-card" href="/assets/attachments/产品公告测试文件.pdf" target="_blank">
<time class="a-card__date" datetime="2025-06-10">2025.06.10</time>
<h2 class="a-card__title">产品停产公告——MC2系列伺服电机60、80框</h2>
<span class="a-card__link">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</span>
</a>
<a class="a-card" href="/assets/attachments/产品公告测试文件.pdf" target="_blank">
<time class="a-card__date" datetime="2025-06-10">2025.06.10</time>
<h2 class="a-card__title">产品停产公告——MC2系列伺服电机60、80框</h2>
<span class="a-card__link">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</span>
</a>
<a class="a-card" href="/assets/attachments/产品公告测试文件.pdf" target="_blank">
<time class="a-card__date" datetime="2025-06-10">2025.06.10</time>
<h2 class="a-card__title">产品停产公告——MC2系列伺服电机60、80框</h2>
{hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="8" item="vo"}
<a class="a-card" href="{$vo.url ?? ''}" target="_blank">
<time class="a-card__date" datetime="{$vo.publish_time}">{$vo.publish_time}</time>
<h2 class="a-card__title">{$vo.title}</h2>
<span class="a-card__link"> <span class="a-card__link">
<span>探索更多</span> <span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000"> <svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
@ -176,7 +97,9 @@
</span> </span>
</a> </a>
{/hcTaglib:contentPage}
</div> </div>
{$hc_content|raw}
</div> </div>
</main> </main>
<div class="mask" id="mask"> <div class="mask" id="mask">

1
public/themes/website/1/zh/demo/download.html

@ -48,6 +48,7 @@
<script type="module" crossorigin src="/themes/dist_static/static/js/download.js"></script> <script type="module" crossorigin src="/themes/dist_static/static/js/download.js"></script>
<link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js"> <link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css"> <link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/pagination.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/download.css"> <link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/download.css">
</head> </head>

1
public/themes/website/1/zh/demo/faq.html

@ -46,6 +46,7 @@
<script type="module" crossorigin src="/themes/dist_static/static/js/faq.js"></script> <script type="module" crossorigin src="/themes/dist_static/static/js/faq.js"></script>
<link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js"> <link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css"> <link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/pagination.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/faq.css"> <link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/faq.css">
</head> </head>

24
public/themes/website/1/zh/demo/news.html

@ -53,6 +53,7 @@
<link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js" /> <link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js" />
<link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/news2.js" /> <link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/news2.js" />
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css" /> <link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css" />
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/pagination.css" />
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/news.css" /> <link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/news.css" />
</head> </head>
@ -92,16 +93,11 @@
<article class="n-featured"> <article class="n-featured">
<div class="n-featured__swiper swiper"> <div class="n-featured__swiper swiper">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
{hcTaglib:contentPage2 cid="$current_cate_id" mainField="id,category_id,title,sub_title,thumbnail,content,description,create_time" subField="" name="hc_content" limit="100" item="content_sub22" sort="sort asc"}
{/hcTaglib:contentPage2}
{volist name="hc_content" id="vo_content"}
{hcTaglib:content cid="$current_cate_id" mainField="id,category_id,title,sub_title,thumbnail,content,description,create_time" subField="" name="hc_featured" limit="10" item="vo_content" sort="sort asc"}
{php} {php}
$content = $vo_content['content'] ?? ''; // 富文本
$description = $vo_content['description'] ?? ''; $description = $vo_content['description'] ?? '';
$title = $vo_content['description'] ?? '';
$title = $vo_content['title'] ?? '';
$create_time_str = $vo_content['create_time'] ?? ''; $create_time_str = $vo_content['create_time'] ?? '';
// dd($vo_content->toArray());exit;
{/php} {/php}
<div class="swiper-slide n-featured__slide" data-category="company"> <div class="swiper-slide n-featured__slide" data-category="company">
<div class="n-featured__media"> <div class="n-featured__media">
@ -125,7 +121,7 @@
</div> </div>
</div> </div>
</div> </div>
{/volist}
{/hcTaglib:content}
</div> </div>
</div> </div>
@ -162,14 +158,16 @@
{volist name="hc_content" id="vo_content"} {volist name="hc_content" id="vo_content"}
{php} {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 = ''; $create_time_str = '';
if(!empty($create_time_int)){ 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} {/php}
<article class="n-card" data-category="insight"> <article class="n-card" data-category="insight">

144
public/themes/website/1/zh/demo/search.html

@ -43,10 +43,11 @@
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
<script type="module" crossorigin src="./static/js/search.js"></script>
<link rel="modulepreload" crossorigin href="./static/js/common.js">
<link rel="stylesheet" crossorigin href="./static/css/common.css">
<link rel="stylesheet" crossorigin href="./static/css/search.css">
<script type="module" crossorigin src="/themes/dist_static/static/js/search.js"></script>
<link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/pagination.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/search.css">
</head> </head>
<body> <body>
@ -60,7 +61,7 @@
<h1 class="sr-hero__title">搜索</h1> <h1 class="sr-hero__title">搜索</h1>
<form class="s-search sr-search" action="/search.html" method="get" role="search"> <form class="s-search sr-search" action="/search.html" method="get" role="search">
<img class="s-search__icon" src="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='24.000000'%20height='24.000000'%20fill='none'%3e%3crect%20id='搜索'%20width='24.000000'%20height='24.000000'%20x='0.000000'%20y='0.000000'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='矢量%203'%20d='M15.8481%2017.1208C14.4808%2018.2114%2012.7482%2018.8633%2010.8633%2018.8633C6.44506%2018.8633%202.86328%2015.2816%202.86328%2010.8633C2.86328%206.445%206.44506%202.86328%2010.8633%202.86328C15.2815%202.86328%2018.8633%206.445%2018.8633%2010.8633C18.8633%2012.7482%2018.2114%2014.4808%2017.1208%2015.8481L21.136%2019.8633L19.8633%2021.136L15.8481%2017.1208ZM17.0632%2010.8633C17.0632%207.43908%2014.2874%204.66326%2010.8633%204.66326C7.4392%204.66326%204.66332%207.43908%204.66332%2010.8633C4.66332%2014.2875%207.4392%2017.0633%2010.8633%2017.0633C14.2874%2017.0633%2017.0632%2014.2875%2017.0632%2010.8633Z'%20fill='rgb(175,181,185)'%20fill-rule='evenodd'%20/%3e%3c/svg%3e" alt="" width="24" height="24" /> <img class="s-search__icon" src="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='24.000000'%20height='24.000000'%20fill='none'%3e%3crect%20id='搜索'%20width='24.000000'%20height='24.000000'%20x='0.000000'%20y='0.000000'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='矢量%203'%20d='M15.8481%2017.1208C14.4808%2018.2114%2012.7482%2018.8633%2010.8633%2018.8633C6.44506%2018.8633%202.86328%2015.2816%202.86328%2010.8633C2.86328%206.445%206.44506%202.86328%2010.8633%202.86328C15.2815%202.86328%2018.8633%206.445%2018.8633%2010.8633C18.8633%2012.7482%2018.2114%2014.4808%2017.1208%2015.8481L21.136%2019.8633L19.8633%2021.136L15.8481%2017.1208ZM17.0632%2010.8633C17.0632%207.43908%2014.2874%204.66326%2010.8633%204.66326C7.4392%204.66326%204.66332%207.43908%204.66332%2010.8633C4.66332%2014.2875%207.4392%2017.0633%2010.8633%2017.0633C14.2874%2017.0633%2017.0632%2014.2875%2017.0632%2010.8633Z'%20fill='rgb(175,181,185)'%20fill-rule='evenodd'%20/%3e%3c/svg%3e" alt="" width="24" height="24" />
<input class="s-search__input" type="search" name="q" placeholder="请输入您想了解的内容" autocomplete="off" />
<input class="s-search__input" type="search" name="q" value="{$keywords}" placeholder="请输入您想了解的内容" autocomplete="off" />
<button class="s-search__btn" type="submit">搜索</button> <button class="s-search__btn" type="submit">搜索</button>
</form> </form>
<div class="sr-hot"> <div class="sr-hot">
@ -73,122 +74,37 @@
</div> </div>
</div> </div>
<div class="sr-tabs" role="tablist" aria-label="结果分类">
<button type="button" class="sr-tabs__item is-active" role="tab" aria-selected="true" data-type="all">
全部 ( <span data-count="all">4</span> )
</button>
<button type="button" class="sr-tabs__item" role="tab" aria-selected="false" data-type="product">
产品 ( <span data-count="product">1</span> )
</button>
<button type="button" class="sr-tabs__item" role="tab" aria-selected="false" data-type="solution">
解决方案 ( <span data-count="solution">1</span> )
</button>
<button type="button" class="sr-tabs__item" role="tab" aria-selected="false" data-type="news">
新闻 ( <span data-count="news">1</span> )
</button>
<button type="button" class="sr-tabs__item" role="tab" aria-selected="false" data-type="faq">
常见问题 ( <span data-count="faq">1</span> )
</button>
</div>
<div class="sr-list"> <div class="sr-list">
<article class="sr-item" data-type="news" data-keywords="福州晚报 睿能电子 工业自动化 制造业">
<a class="sr-item__media" href="/news-detail.html">
<img src="./static/images/img-1-MkFq2q3F.png" alt="" width="300" height="200" loading="lazy" />
</a>
<div class="sr-item__body">
<div class="sr-item__main">
<div class="sr-item__meta">
<span class="sr-item__type">新闻</span>
<span class="sr-item__sep" aria-hidden="true"></span>
<time class="sr-item__date" datetime="2026-05-11">2026-05-11</time>
</div>
<h2 class="sr-item__title">
<a href="/news-detail.html">福州晚报专访睿能电子副总经理王开伟:工业自动化生产不靠人盯,制造业迎来新变化</a>
</h2>
</div>
<a class="sr-item__more" href="/news-detail.html">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</a>
</div>
</article>
<article class="sr-item" data-type="product" data-keywords="X5 运动控制型PLC PLC">
<a class="sr-item__media" href="/product.html">
<img src="./static/images/img-2-BH-lworg.png" alt="" width="300" height="200" loading="lazy" />
</a>
<div class="sr-item__body">
<div class="sr-item__main">
<div class="sr-item__meta">
<span class="sr-item__type">产品</span>
<span class="sr-item__sep" aria-hidden="true"></span>
<time class="sr-item__date" datetime="2026-05-11">2026-05-11</time>
</div>
<h2 class="sr-item__title">
<a href="/product.html">X5 运动控制型PLC</a>
</h2>
</div>
<a class="sr-item__more" href="/product.html">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</a>
</div>
</article>
<article class="sr-item" data-type="faq" data-keywords="睿能科技 公司 FAQ">
<a class="sr-item__media" href="/faq.html">
<img src="./static/images/img-3-CqySoykq.png" alt="" width="300" height="200" loading="lazy" />
</a>
<div class="sr-item__body">
<div class="sr-item__main">
<div class="sr-item__meta">
<span class="sr-item__type">常见问题</span>
<span class="sr-item__sep" aria-hidden="true"></span>
<time class="sr-item__date" datetime="2026-05-11">2026-05-11</time>
</div>
<h2 class="sr-item__title">
<a href="/faq.html">睿能科技是一家什么样的公司?</a>
</h2>
<p class="sr-item__desc">
睿能科技成立于2007年,总部位于福建福州,是一家专注于工业自动化控制产品研发、生产、销售及半导体产品分销的高新技术企业。公司于2017年在上海证券交易所主板上市。
</p>
</div>
<a class="sr-item__more" href="/faq.html">
<span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
</svg>
</a>
</div>
</article>
<article class="sr-item" data-type="solution" data-keywords="冶金 行业 解决方案">
<a class="sr-item__media" href="/solution.html">
<img src="./static/images/img-4-BOyEZbe9.png" alt="" width="300" height="200" loading="lazy" />
{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}
<article class="sr-item" data-keywords="{$vo.title}">
<a class="sr-item__media" href="{$sr_url}">
<img src="{$sr_thumb}" alt="" width="300" height="200" loading="lazy" />
</a> </a>
<div class="sr-item__body"> <div class="sr-item__body">
<div class="sr-item__main"> <div class="sr-item__main">
<div class="sr-item__meta"> <div class="sr-item__meta">
<span class="sr-item__type">解决方案</span>
<span class="sr-item__type">{if !empty($vo['category'][0]['title'])}{$vo.category.0.title}{else /}内容{/if}</span>
<span class="sr-item__sep" aria-hidden="true"></span> <span class="sr-item__sep" aria-hidden="true"></span>
<time class="sr-item__date" datetime="2026-05-11">2026-05-11</time>
<time class="sr-item__date" datetime="{$sr_date}">{$sr_date}</time>
</div> </div>
<h2 class="sr-item__title"> <h2 class="sr-item__title">
<a href="/solution.html">冶金行业解决方案</a>
<a href="{$sr_url}">{$vo.title}</a>
</h2> </h2>
<p class="sr-item__desc">
冶金工业一直面临着数据量大、信息系统多、黑箱体系、信息孤岛、控制滞后的问题。睿能科技结合多年行业经验,配合先进控制技术和多目标优化技术等智能算法,形成一体化冶金行业解决方案,以优质的产品和服务不断为冶金行业的...
</p>
{notempty name="vo.description"}
<p class="sr-item__desc">{$vo.description}</p>
{/notempty}
</div> </div>
<a class="sr-item__more" href="/solution.html">
<a class="sr-item__more" href="{$sr_url}">
<span>探索更多</span> <span>探索更多</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000"> <svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.501953" height="6.661133" fill="none" customFrame="#000000">
<path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" /> <path id="箭头 2" d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="rgb(102,102,102)" fill-rule="nonzero" />
@ -197,9 +113,13 @@
</a> </a>
</div> </div>
</article> </article>
{/volist}
</div> </div>
<p class="sr-empty" hidden>未找到相关结果,请尝试其他关键词</p>
{empty name="list"}
<p class="sr-empty">未找到相关结果,请尝试其他关键词</p>
{/empty}
{$list_page|raw}
</div> </div>
</main> </main>

30
public/themes/website/1/zh/demo/video.html

@ -46,6 +46,7 @@
<script type="module" crossorigin src="/themes/dist_static/static/js/video.js"></script> <script type="module" crossorigin src="/themes/dist_static/static/js/video.js"></script>
<link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js"> <link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css"> <link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/pagination.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/video.css"> <link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/video.css">
</head> </head>
@ -84,7 +85,7 @@
</div> </div>
<div class="v-grid"> <div class="v-grid">
{hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="1" item="vo"}
{hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="12" item="vo"}
<button type="button" class="v-card" data-video-src="{$vo.url}"> <button type="button" class="v-card" data-video-src="{$vo.url}">
<div class="v-card__media"> <div class="v-card__media">
<img class="v-card__cover" src="{$vo.thumbnail.url ?? ''}" alt="" width="400" height="225" <img class="v-card__cover" src="{$vo.thumbnail.url ?? ''}" alt="" width="400" height="225"
@ -98,20 +99,21 @@
<time class="v-card__date" datetime="{$vo.publish_time}">{$vo.publish_time}</time> <time class="v-card__date" datetime="{$vo.publish_time}">{$vo.publish_time}</time>
</button> </button>
{/hcTaglib:contentPage} {/hcTaglib:contentPage}
{$hc_content|raw}
</div>
</div>
{$hc_content|raw}
<div class="v-modal" id="v-modal" hidden>
<div class="v-modal__backdrop" data-v-modal-close></div>
<div class="v-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="v-modal-title">
<div class="v-modal__head">
<h2 class="v-modal__title" id="v-modal-title">视频播放</h2>
<button type="button" class="v-modal__close" data-v-modal-close aria-label="关闭">
<img src="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3e%3cpath%20d='M1.5%201.5L14.5%2014.5M14.5%201.5L1.5%2014.5'%20stroke='%23fff'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e" alt="" width="16" height="16" aria-hidden="true" />
</button>
</div>
<div class="v-modal__body">
<video class="v-modal__video" id="v-modal-video" controls playsinline></video>
<div class="v-modal" id="v-modal" hidden>
<div class="v-modal__backdrop" data-v-modal-close></div>
<div class="v-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="v-modal-title">
<div class="v-modal__head">
<h2 class="v-modal__title" id="v-modal-title">视频播放</h2>
<button type="button" class="v-modal__close" data-v-modal-close aria-label="关闭">
<img src="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3e%3cpath%20d='M1.5%201.5L14.5%2014.5M14.5%201.5L1.5%2014.5'%20stroke='%23fff'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e" alt="" width="16" height="16" aria-hidden="true" />
</button>
</div>
<div class="v-modal__body">
<video class="v-modal__video" id="v-modal-video" controls playsinline></video>
</div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save