更新:品质与服务
parent
c60a8ed350
commit
9650e478a8
|
@ -33,30 +33,42 @@ class Page extends Base
|
|||
} else {
|
||||
$topCategory = Category::getById($TopCId);
|
||||
}
|
||||
$childCategory = Category::getChildrenByParentId($category['id']);
|
||||
$childCategory = Category::getChildrenByParentId($topCategory['id']);
|
||||
|
||||
$this->data['topCategory'] = $topCategory;
|
||||
$this->data['childCategory'] = $childCategory;
|
||||
switch ($template) {
|
||||
case 'about' :
|
||||
$this->assignAbout($topCategory, $category, $childCategory);
|
||||
$this->assignAbout($childCategory);
|
||||
break;
|
||||
case 'service' :
|
||||
$this->assignService($childCategory);
|
||||
break;
|
||||
default :
|
||||
}
|
||||
}
|
||||
|
||||
// 走进超宇
|
||||
private function assignAbout($topCategory, $category, $childCategory)
|
||||
// 获取单页栏目IDs
|
||||
private function getBlockCateIds($categoryItems)
|
||||
{
|
||||
if(empty($childCategory)) {
|
||||
$childCategory = Category::getChildrenByParentId($topCategory['id']);
|
||||
$blockCateIds = [];
|
||||
foreach ($categoryItems as $cate) {
|
||||
if($cate['model_id'] == Model::PAGE) {
|
||||
$blockCateIds[] = $cate['id'];
|
||||
}
|
||||
}
|
||||
return $blockCateIds;
|
||||
}
|
||||
|
||||
// 走进超宇
|
||||
private function assignAbout($childCategory)
|
||||
{
|
||||
$honorTopCId = Category::$CIdList['honors_manage'] ?? 0;
|
||||
$historyCId = Category::$CIdList['history_manage'] ?? 0;
|
||||
$historyCate = Category::getById($historyCId);
|
||||
$honors = [];
|
||||
$blockCateIds = [];
|
||||
$blocks = [];
|
||||
$blockCateIds = $this->getBlockCateIds($childCategory);
|
||||
if($honorTopCId) {
|
||||
$honors = Category::getChildrenByParentId($honorTopCId);
|
||||
foreach ($honors as &$honor) {
|
||||
|
@ -64,11 +76,6 @@ class Page extends Base
|
|||
}
|
||||
unset($honor);
|
||||
}
|
||||
foreach ($childCategory as $cate) {
|
||||
if($cate['model_id'] == Model::PAGE) {
|
||||
$blockCateIds[] = $cate['id'];
|
||||
}
|
||||
}
|
||||
$blockList = Block::getByCategoryIds($blockCateIds);
|
||||
$aboutChildrenFlip = array_flip(Category::$CIdList['about_children']);
|
||||
foreach ($childCategory as $cate) {
|
||||
|
@ -78,7 +85,19 @@ class Page extends Base
|
|||
$this->data['blocks'] = $blocks;
|
||||
$this->data['honors'] = $honors;
|
||||
$this->data['historyList'] = History::getByCategoryId($historyCId, true, $historyCate['number'] ?? -1);
|
||||
//dump($this->data['honors']);
|
||||
//dump($this->data['historyList']);
|
||||
}
|
||||
|
||||
// 品质与服务
|
||||
private function assignService($childCategory)
|
||||
{
|
||||
$blocks = [];
|
||||
$blockCateIds = $this->getBlockCateIds($childCategory);
|
||||
$blockList = Block::getByCategoryIds($blockCateIds);
|
||||
$serviceChildrenFlip = array_flip(Category::$CIdList['service_children']);
|
||||
foreach ($childCategory as $cate) {
|
||||
$blocks[$serviceChildrenFlip[$cate['id']]] = $blockList[$cate['id']] ?? [];
|
||||
}
|
||||
|
||||
$this->data['blocks'] = $blocks;
|
||||
}
|
||||
}
|
|
@ -15,7 +15,14 @@ class Category extends Base
|
|||
'honors_manage' => 26, // 荣誉资质管理
|
||||
'history_manage' => 29, // 发展历程管理
|
||||
'products' => 2, // 产品中心
|
||||
'marketing' => 15, // 网络营销(主)
|
||||
'products' => 2, // 产品中心
|
||||
'products' => 2, // 产品中心
|
||||
'service' => 5, // 品质与服务
|
||||
'service_children' => [
|
||||
'before' => 12, // 售前服务
|
||||
'in_progress' => 13, // 售中服务
|
||||
'after' => 14, // 售后服务
|
||||
],
|
||||
'marketing_children' => [
|
||||
'marketing_network' => 16, // 网络营销
|
||||
'achievement' => 17, // 主要业绩
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
{layout name="layout"}
|
||||
|
||||
<!-- banner -->
|
||||
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban2.jpg')});">
|
||||
<div class="info">
|
||||
<div class="w-1200">
|
||||
<strong>{$topCategory.title}</strong>
|
||||
<p>{:nl2br($topCategory.description ?? '')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="all-center-box">
|
||||
<div class="service-box1 w-100" id="service1">
|
||||
<div class="w-1200">
|
||||
<div class="all-title-box2 w-100"><span>{$blocks['before']['title']['value'] ?? ''}</span><p>{:nl2br($blocks['before']['subtitle']['value'] ?? '')}</p></div>
|
||||
<div class="box-info w-100">
|
||||
<img src="{$blocks['before']['img']['value'] ?? ''}" >
|
||||
</div>
|
||||
<div class="w-100 text-center"><img src="__IMG__/ser1_bg.png" ></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="service-box1 w-100 service-box2" id="service2">
|
||||
<div class="w-1200">
|
||||
<div class="all-title-box2 w-100"><span>{$blocks['in_progress']['title']['value'] ?? ''}</span><p>{:nl2br($blocks['in_progress']['subtitle']['value'] ?? '')}</p></div>
|
||||
<div class="box-info w-100">
|
||||
<img src="{$blocks['in_progress']['img']['value'] ?? ''}" >
|
||||
</div>
|
||||
<div class="w-100 text-center"><img src="__IMG__/ser2_bg.png" ></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="service-box3 w-100" id="service3">
|
||||
<div class="w-1200">
|
||||
<div class="all-title-box2 w-100"><span>售后技术服务</span><p>After sales technology service</p></div>
|
||||
<div class="box-info w-100">
|
||||
<div class="pull-right">
|
||||
<img src="{$blocks['after']['img']['value'] ?? ''}" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue