Browse Source

feat(ui): 使用动态UI ID替换硬编码的栏目ID,更新首页内容以支持多语言

master
peijunlei 2 weeks ago
parent
commit
06618cd218
  1. 25
      public/themes/website/1/en/demo/single_index.html
  2. 25
      public/themes/website/1/zh/demo/single_index.html

25
public/themes/website/1/en/demo/single_index.html

@ -59,12 +59,17 @@
<!-- header -->
{include file="components/header"}
<main class="main-home">
{php}
$ui_product = uiId('product');
$ui_solution = uiId('solution');
$ui_news = uiId('news');
{/php}
{if !empty($sub_cates[0])}
<section class="section-banner">
<div class="section-banner__swiper swiper">
<div class="swiper-wrapper">
{php}
$news = getChildCategoriesContent(361,$seller_id,5);
$news = getChildCategoriesContent($ui_news,$seller_id,5);
{/php}
{hcTaglib:content cid="$sub_cates[0]['id']" moduleId="1" item="vo" limit="5" mainField="*" subField="*" key="key"}
<article class="swiper-slide section-banner__slide section__wrap">
@ -75,7 +80,7 @@
<p class="section__eyebrow">{$vo.title ?? ''}</p>
<h1 class="section__title section__title--hero">{$vo.sub_title|raw}</h1>
<p class="section__desc">{$vo.description ?? ''}</p>
{hcTaglib:category id="333" item="vo" field="*"}
{hcTaglib:category id="$ui_product" item="vo" field="*"}
<a class="s-btn s-btn--primary s-btn--pill" href="{$vo.alias ?? '/'}">Explore more</a>
{/hcTaglib:category}
</div>
@ -142,7 +147,7 @@
</div>
<div class="section-1__swiper swiper">
<div class="swiper-wrapper">
{hcTaglib:allSubCategory pid="333" field="*" max-level="2" item="vo" sort="sort asc" key="key"}
{hcTaglib:allSubCategory pid="$ui_product" field="*" max-level="2" item="vo" sort="sort asc" key="key"}
<article class="swiper-slide section-1__item">
{hcTaglib:category id="$vo.id" item="vv" field="*"}
<a href="{$vv.alias}?cat=product-control-{$vv.id}">
@ -730,7 +735,7 @@
</div>
</div>
<div class="section-1__more">
{hcTaglib:category id="333" item="vo" field="*"}
{hcTaglib:category id="$ui_product" item="vo" field="*"}
<a class="s-btn s-btn--primary s-btn--pill" href="{$vo.alias ?? '/'}">Explore more</a>
{/hcTaglib:category}
</div>
@ -765,7 +770,7 @@
<section class="section-2">
<div class="section-2__swiper swiper">
<div class="swiper-wrapper">
{hcTaglib:allSubCategory pid="345" field="*" max-level="2" item="vo" sort=""}
{hcTaglib:allSubCategory pid="$ui_solution" field="*" max-level="2" item="vo" sort=""}
<article class="swiper-slide section-2__slide section__wrap">
<div class="section-2__bg">
<video src="{$vo.thumbnail.url ?? ''}" muted loop playsinline></video>
@ -788,8 +793,8 @@
</div>
</div>
<nav class="section-2__nav section__wrap" aria-label="Application scenarios">
{hcTaglib:allSubCategory pid="345" field="*" max-level="2" item="vo" sort="" key="key}
<button type="button" data-index="{$key}}">
{hcTaglib:allSubCategory pid="$ui_solution" field="*" max-level="2" item="vo" sort="" key="key"}
<button type="button" data-index="{$key}">
<span class="section-2__nav-index">0{$key}</span>
<span class="section-2__nav-label">{$vo.title}</span>
</button>
@ -876,12 +881,12 @@
<div class="section__inner">
<div class="section-5__header">
<h2 class="section__title">{$sub_cates[5]['title']}</h2>
{hcTaglib:category id="361" item="vo" field="*"}
{hcTaglib:category id="$ui_news" item="vo" field="*"}
<a class="s-btn s-btn--primary s-btn--pill m-none" href="{$vo.alias ?? '/'}">Explore more</a>
{/hcTaglib:category}
</div>
<div class="section-5__body">
{php}$news = getChildCategoriesContent(361,$seller_id,4);{/php}
{php}$news = getChildCategoriesContent($ui_news,$seller_id,4);{/php}
{if(!empty($news[0]))}
<article class="section-5__featured">
<a class="section-5__featured-media" href="{:hcUrl('detail/index',['id'=>$news[0]['id'],'cid'=>$news[0]['category_id']])}">
@ -935,7 +940,7 @@
</ul>
</div>
<div class="section-5__more d-flex pc-none justify-content-center pt-5">
{hcTaglib:category id="361" item="vo" field="*"}
{hcTaglib:category id="$ui_news" item="vo" field="*"}
<a class="s-btn s-btn--primary s-btn--pill" href="{$vo.alias ?? ''}">Explore more</a>
{/hcTaglib:category}
</div>

25
public/themes/website/1/zh/demo/single_index.html

@ -59,12 +59,17 @@
<!-- header -->
{include file="components/header"}
<main class="main-home">
{php}
$ui_product = uiId('product');
$ui_solution = uiId('solution');
$ui_news = uiId('news');
{/php}
{if !empty($sub_cates[0])}
<section class="section-banner">
<div class="section-banner__swiper swiper">
<div class="swiper-wrapper">
{php}
$news = getChildCategoriesContent(361,$seller_id,5);
$news = getChildCategoriesContent($ui_news,$seller_id,5);
{/php}
{hcTaglib:content cid="$sub_cates[0]['id']" moduleId="1" item="vo" limit="5" mainField="*" subField="*" key="key"}
<article class="swiper-slide section-banner__slide section__wrap">
@ -75,7 +80,7 @@
<p class="section__eyebrow">{$vo.title ?? ''}</p>
<h1 class="section__title section__title--hero">{$vo.sub_title|raw}</h1>
<p class="section__desc">{$vo.description ?? ''}</p>
{hcTaglib:category id="333" item="vo" field="*"}
{hcTaglib:category id="$ui_product" item="vo" field="*"}
<a class="s-btn s-btn--primary s-btn--pill" href="{$vo.alias ?? '/'}">探索更多</a>
{/hcTaglib:category}
</div>
@ -142,7 +147,7 @@
</div>
<div class="section-1__swiper swiper">
<div class="swiper-wrapper">
{hcTaglib:allSubCategory pid="333" field="*" max-level="2" item="vo" sort="sort asc" key="key"}
{hcTaglib:allSubCategory pid="$ui_product" field="*" max-level="2" item="vo" sort="sort asc" key="key"}
<article class="swiper-slide section-1__item">
{hcTaglib:category id="$vo.id" item="vv" field="*"}
<a href="{$vv.alias}?cat=product-control-{$vv.id}">
@ -730,7 +735,7 @@
</div>
</div>
<div class="section-1__more">
{hcTaglib:category id="333" item="vo" field="*"}
{hcTaglib:category id="$ui_product" item="vo" field="*"}
<a class="s-btn s-btn--primary s-btn--pill" href="{$vo.alias ?? '/'}">探索更多</a>
{/hcTaglib:category}
</div>
@ -765,7 +770,7 @@
<section class="section-2">
<div class="section-2__swiper swiper">
<div class="swiper-wrapper">
{hcTaglib:allSubCategory pid="345" field="*" max-level="2" item="vo" sort=""}
{hcTaglib:allSubCategory pid="$ui_solution" field="*" max-level="2" item="vo" sort=""}
<article class="swiper-slide section-2__slide section__wrap">
<div class="section-2__bg">
<video src="{$vo.thumbnail.url ?? ''}" muted loop playsinline></video>
@ -788,8 +793,8 @@
</div>
</div>
<nav class="section-2__nav section__wrap" aria-label="应用场景">
{hcTaglib:allSubCategory pid="345" field="*" max-level="2" item="vo" sort="" key="key}
<button type="button" data-index="{$key}}">
{hcTaglib:allSubCategory pid="$ui_solution" field="*" max-level="2" item="vo" sort="" key="key"}
<button type="button" data-index="{$key}">
<span class="section-2__nav-index">0{$key}</span>
<span class="section-2__nav-label">{$vo.title}</span>
</button>
@ -876,12 +881,12 @@
<div class="section__inner">
<div class="section-5__header">
<h2 class="section__title">{$sub_cates[5]['title']}</h2>
{hcTaglib:category id="361" item="vo" field="*"}
{hcTaglib:category id="$ui_news" item="vo" field="*"}
<a class="s-btn s-btn--primary s-btn--pill m-none" href="{$vo.alias ?? '/'}">探索更多</a>
{/hcTaglib:category}
</div>
<div class="section-5__body">
{php}$news = getChildCategoriesContent(361,$seller_id,4);{/php}
{php}$news = getChildCategoriesContent($ui_news,$seller_id,4);{/php}
{if(!empty($news[0]))}
<article class="section-5__featured">
<a class="section-5__featured-media" href="{:hcUrl('detail/index',['id'=>$news[0]['id'],'cid'=>$news[0]['category_id']])}">
@ -935,7 +940,7 @@
</ul>
</div>
<div class="section-5__more d-flex pc-none justify-content-center pt-5">
{hcTaglib:category id="361" item="vo" field="*"}
{hcTaglib:category id="$ui_news" item="vo" field="*"}
<a class="s-btn s-btn--primary s-btn--pill" href="{$vo.alias ?? ''}">探索更多</a>
{/hcTaglib:category}
</div>

Loading…
Cancel
Save