feat: 添加新控制器
parent
f3242717c6
commit
b15058d546
view
|
@ -0,0 +1,160 @@
|
||||||
|
<?php
|
||||||
|
namespace app\controller\en;
|
||||||
|
|
||||||
|
use app\model\{Article as MArticle, Category};
|
||||||
|
|
||||||
|
class Article extends Base
|
||||||
|
{
|
||||||
|
//列表页
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$categoryId = input('param.category_id/d', 0);
|
||||||
|
if($categoryId <= 0){
|
||||||
|
return $this->error('错误页面');
|
||||||
|
}
|
||||||
|
$category = Category::getById($categoryId);
|
||||||
|
if(empty($category)){
|
||||||
|
return $this->error('错误页面');
|
||||||
|
}
|
||||||
|
$description = $category['description'] ? $category['description'] : $this->system['seo_description'];
|
||||||
|
$this->setSeo($category['title'], $this->system['seo_keywords'], $description);
|
||||||
|
|
||||||
|
$this->data['category'] = $category;
|
||||||
|
$this->data['categoryId'] = $categoryId;
|
||||||
|
$this->templateAssign($category);
|
||||||
|
return $this->view($category['template_list'] ?? '');
|
||||||
|
}
|
||||||
|
|
||||||
|
//详情
|
||||||
|
public function detail($id=0)
|
||||||
|
{
|
||||||
|
if($id <= 0){
|
||||||
|
return $this->error('错误页面');
|
||||||
|
}
|
||||||
|
$article = MArticle::getById($id);
|
||||||
|
if(empty($article)){
|
||||||
|
return $this->error('无此文章');
|
||||||
|
}
|
||||||
|
MArticle::updateById($id, ['views' => $article['views'] + 1]);
|
||||||
|
$category = Category::getById($article['category_id']);
|
||||||
|
$keywords = $article['seo_keywords'] ? $article['seo_keywords'] : $this->system['seo_keywords'];
|
||||||
|
$description = $article['seo_description'] ? $article['seo_description'] : $this->system['seo_description'];
|
||||||
|
$this->setSeo($article['title'], $keywords, $description);
|
||||||
|
|
||||||
|
$this->data['article'] = $article;
|
||||||
|
$this->data['category'] = $category;
|
||||||
|
$this->data['categoryId'] = $category['id'];
|
||||||
|
$this->templateDetailAssign($article, $category);
|
||||||
|
return $this->view($category['template_detail'] ?? '');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表数据绑定
|
||||||
|
private function templateAssign($category)
|
||||||
|
{
|
||||||
|
$template = strtolower($category['template_list'] ?? '');
|
||||||
|
$TopCId = Category::firstGradeById($category['id']);
|
||||||
|
if($TopCId == $category['id']) {
|
||||||
|
$topCategory = $category;
|
||||||
|
} else {
|
||||||
|
$topCategory = Category::getById($TopCId);
|
||||||
|
}
|
||||||
|
$categoryChildren = Category::getChildrenByParentId($topCategory['id']);
|
||||||
|
$this->data['topCategory'] = $topCategory;
|
||||||
|
$this->data['categoryChildren'] = $categoryChildren;
|
||||||
|
switch($template) {
|
||||||
|
case 'products' :
|
||||||
|
$this->assignProducts($topCategory, $category, $categoryChildren);
|
||||||
|
break;
|
||||||
|
case 'news_center' :
|
||||||
|
case 'news' :
|
||||||
|
$this->assignNews($topCategory, $category, $categoryChildren);
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
$this->data['items'] = MArticle::getListPageByCategory($category['id'], $category['number'] ? $category['number'] : 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情数据绑定
|
||||||
|
private function templateDetailAssign($article, $category)
|
||||||
|
{
|
||||||
|
$template = strtolower($category['template_detail'] ?? '');
|
||||||
|
$TopCId = Category::firstGradeById($category['id']);
|
||||||
|
if($TopCId == $category['id']) {
|
||||||
|
$topCategory = $category;
|
||||||
|
} else {
|
||||||
|
$topCategory = Category::getById($TopCId);
|
||||||
|
}
|
||||||
|
$this->data['topCategory'] = $topCategory;
|
||||||
|
switch ($template) {
|
||||||
|
case 'product':
|
||||||
|
$this->assignDetailForProduct($article, $topCategory);
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
$this->data['prev'] = MArticle::getPrevArticleByIdAndCategories($article['id'], [$article['category_id']], true, $article['sort'], true);
|
||||||
|
$this->data['next'] = MArticle::getNextArticleByIdAndCategories($article['id'], [$article['category_id']], true, $article['sort'], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 产品 - 展示当前分类和所有子类产品
|
||||||
|
private function assignProducts($topCategory, $category, $categoryChildren)
|
||||||
|
{
|
||||||
|
$keyword = input('param.keyword', '');
|
||||||
|
$cateIds[] = $category['id'];
|
||||||
|
if($topCategory['id'] == $category['id']) {
|
||||||
|
$children = $categoryChildren;
|
||||||
|
} else {
|
||||||
|
$children = Category::getChildrenByParentId($category['id']);
|
||||||
|
}
|
||||||
|
foreach ($children as $child) {
|
||||||
|
$cateIds[] = $child['id'];
|
||||||
|
}
|
||||||
|
$items = MArticle::getListPageByCategories($cateIds, $category['number'] ? $category['number'] : 20, $keyword);
|
||||||
|
$items->appends(['category_id'=>$category['id']]);
|
||||||
|
$this->data['items'] = $items;
|
||||||
|
$this->data['keyword'] = $keyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新闻
|
||||||
|
private function assignNews($topCategory, $category, $categoryChildren)
|
||||||
|
{
|
||||||
|
if($topCategory['id'] == $category['id']) {
|
||||||
|
// 新闻中心
|
||||||
|
$cateList = [];
|
||||||
|
$newsChildrenFlip = array_flip(Category::$CIdList['news_children']);
|
||||||
|
foreach ($categoryChildren as $cate) {
|
||||||
|
$num = 3;
|
||||||
|
if($cate['id'] == Category::$CIdList['news_children']['dynamics']) {
|
||||||
|
$num = 4;
|
||||||
|
}
|
||||||
|
$cate['items'] = MArticle::getLatestByCategory($cate['id'], $num, 1);
|
||||||
|
$cateList[$newsChildrenFlip[$cate['id']]] = $cate;
|
||||||
|
}
|
||||||
|
$this->data['cateList'] = $cateList;
|
||||||
|
} else {
|
||||||
|
// 新闻子栏目
|
||||||
|
$keyword = input('param.keyword', '');
|
||||||
|
$this->data['items'] = MArticle::getListPageByCategory($category['id'], $category['number'] ? $category['number'] : 20, $keyword);
|
||||||
|
$this->data['keyword'] = $keyword;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 产品详情
|
||||||
|
private function assignDetailForProduct($article, $topCategory)
|
||||||
|
{
|
||||||
|
$cateIds[] = $article['category_id'];
|
||||||
|
$currentCateId = input('param.source', 0);
|
||||||
|
$categoryList = Category::getChildrenByParentId($topCategory['id']);
|
||||||
|
if($currentCateId == $topCategory['id']) {
|
||||||
|
foreach ($categoryList as $cate) {
|
||||||
|
$cateIds[] = $cate['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->data['categoryChildren'] = $categoryList;
|
||||||
|
$this->data['prev'] = MArticle::getPrevArticleByIdAndCategories($article['id'], $cateIds, true, $article['sort'], true);
|
||||||
|
$this->data['next'] = MArticle::getNextArticleByIdAndCategories($article['id'], $cateIds, true, $article['sort'], true);
|
||||||
|
$this->data['currentCateId'] = $currentCateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
<?php
|
||||||
|
namespace app\controller\en;
|
||||||
|
|
||||||
|
use app\controller\BaseController;
|
||||||
|
use app\model\System;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制器基础类
|
||||||
|
*/
|
||||||
|
class Base extends BaseController
|
||||||
|
{
|
||||||
|
//需要向模板传递的值
|
||||||
|
protected $data = [];
|
||||||
|
//系统配置信息
|
||||||
|
protected $system = [];
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
protected function initialize()
|
||||||
|
{
|
||||||
|
$this->middleware = ['csrf'];
|
||||||
|
$this->system = System::getSystem();
|
||||||
|
$this->data['system'] = $this->system;
|
||||||
|
$this->setCsrfToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置SEO信息
|
||||||
|
protected function setSeo($title, $keywords, $description)
|
||||||
|
{
|
||||||
|
$this->data['seoTitle'] = $title;
|
||||||
|
$this->data['seoKeywords'] = $keywords;
|
||||||
|
$this->data['seoDescription'] = $description;
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置默认SEO信息
|
||||||
|
protected function setDefaultSeo()
|
||||||
|
{
|
||||||
|
$this->data['seoTitle'] = $this->system['seo_title'];
|
||||||
|
$this->data['seoKeywords'] = $this->system['seo_keywords'];
|
||||||
|
$this->data['seoDescription'] = $this->system['seo_description'];
|
||||||
|
}
|
||||||
|
|
||||||
|
//模板
|
||||||
|
protected function view($template = '')
|
||||||
|
{
|
||||||
|
return view($template)->assign($this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setCsrfToken()
|
||||||
|
{
|
||||||
|
$this->data['_token'] = session('_token') ?? '';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,193 @@
|
||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\controller\en;
|
||||||
|
|
||||||
|
use think\{App, Validate};
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制器基础类
|
||||||
|
*/
|
||||||
|
abstract class BaseController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Request实例
|
||||||
|
* @var \think\Request
|
||||||
|
*/
|
||||||
|
protected $request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用实例
|
||||||
|
* @var \think\App
|
||||||
|
*/
|
||||||
|
protected $app;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否批量验证
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $batchValidate = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制器中间件
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $middleware = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造方法
|
||||||
|
* @access public
|
||||||
|
* @param App $app 应用对象
|
||||||
|
*/
|
||||||
|
public function __construct(App $app)
|
||||||
|
{
|
||||||
|
$this->app = $app;
|
||||||
|
$this->request = $this->app->request;
|
||||||
|
|
||||||
|
// 控制器初始化
|
||||||
|
$this->initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
protected function initialize()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证数据
|
||||||
|
* @access protected
|
||||||
|
* @param array $data 数据
|
||||||
|
* @param string|array $validate 验证器名或者验证规则数组
|
||||||
|
* @param array $message 提示信息
|
||||||
|
* @param bool $batch 是否批量验证
|
||||||
|
* @return array|string|true
|
||||||
|
* @throws ValidateException
|
||||||
|
*/
|
||||||
|
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
|
||||||
|
{
|
||||||
|
if (is_array($validate)) {
|
||||||
|
$v = new Validate();
|
||||||
|
$v->rule($validate);
|
||||||
|
} else {
|
||||||
|
if (strpos($validate, '.')) {
|
||||||
|
// 支持场景
|
||||||
|
list($validate, $scene) = explode('.', $validate);
|
||||||
|
}
|
||||||
|
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
|
||||||
|
$v = new $class();
|
||||||
|
if (!empty($scene)) {
|
||||||
|
$v->scene($scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$v->message($message);
|
||||||
|
|
||||||
|
// 是否批量验证
|
||||||
|
if ($batch || $this->batchValidate) {
|
||||||
|
$v->batch(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $v->failException(true)->check($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作成功跳转的快捷方法
|
||||||
|
* @access protected
|
||||||
|
* @param mixed $msg 提示信息
|
||||||
|
* @param string $url 跳转的URL地址
|
||||||
|
* @param mixed $data 返回的数据
|
||||||
|
* @param integer $wait 跳转等待时间
|
||||||
|
* @param array $header 发送的Header信息
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function success($msg = '', string $url = null, $data = '', int $wait = 3, array $header = [])
|
||||||
|
{
|
||||||
|
if (is_null($url) && isset($_SERVER["HTTP_REFERER"])) {
|
||||||
|
$url = $_SERVER["HTTP_REFERER"];
|
||||||
|
} elseif ($url) {
|
||||||
|
$url = (strpos($url, '://') || 0 === strpos($url, '/')) ? $url : $this->app->route->buildUrl($url);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = [
|
||||||
|
'code' => 1,
|
||||||
|
'msg' => $msg,
|
||||||
|
'data' => $data,
|
||||||
|
'url' => $url,
|
||||||
|
'wait' => $wait,
|
||||||
|
];
|
||||||
|
return $this->redirect(url('error/jump',$result));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作错误跳转的快捷方法
|
||||||
|
* @access protected
|
||||||
|
* @param mixed $msg 提示信息
|
||||||
|
* @param string $url 跳转的URL地址
|
||||||
|
* @param mixed $data 返回的数据
|
||||||
|
* @param integer $wait 跳转等待时间
|
||||||
|
* @param array $header 发送的Header信息
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function error($msg = '', string $url = null, $data = '', int $wait = 3)
|
||||||
|
{
|
||||||
|
if (is_null($url)) {
|
||||||
|
$referer = $_SERVER['HTTP_REFERER'] ?? null;
|
||||||
|
if (empty($referer)) {
|
||||||
|
$url = $this->request->isAjax() ? '' : '/';
|
||||||
|
} else {
|
||||||
|
$url = $this->request->isAjax() ? '' : 'javascript:history.back(-1);';
|
||||||
|
}
|
||||||
|
} elseif ($url) {
|
||||||
|
$url = (strpos($url, '://') || 0 === strpos($url, '/')) ? $url : $this->app->route->buildUrl($url);
|
||||||
|
}
|
||||||
|
$result = [
|
||||||
|
'code' => 0,
|
||||||
|
'msg' => $msg,
|
||||||
|
'data' => $data,
|
||||||
|
'url' => $url,
|
||||||
|
'wait' => $wait,
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this->redirect(url('error/jump', $result));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回封装后的API数据到客户端
|
||||||
|
* 以json格式抛出异常
|
||||||
|
* @access protected
|
||||||
|
* @param mixed $data 要返回的数据
|
||||||
|
* @param integer $code 返回的code
|
||||||
|
* @param mixed $msg 提示信息
|
||||||
|
* @param string $type 返回数据格式
|
||||||
|
* @param array $header 发送的Header信息
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function json($code = 0, $msg = 'ok', $data= [])
|
||||||
|
{
|
||||||
|
$result = [
|
||||||
|
'code' => $code,
|
||||||
|
'msg' => $msg,
|
||||||
|
'time' => time(),
|
||||||
|
'data' => $data
|
||||||
|
];
|
||||||
|
return json($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL重定向
|
||||||
|
* @access protected
|
||||||
|
* @param string $url 跳转的URL表达式
|
||||||
|
* @param array|integer $params 其它URL参数
|
||||||
|
* @param integer $code http code
|
||||||
|
* @param array $with 隐式传参
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function redirect($url)
|
||||||
|
{
|
||||||
|
if(!is_string($url)){
|
||||||
|
$url = $url->__toString();
|
||||||
|
}
|
||||||
|
return redirect($url);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace app\controller\en;
|
||||||
|
|
||||||
|
|
||||||
|
class Error extends BaseController
|
||||||
|
{
|
||||||
|
public function __call($method, $args)
|
||||||
|
{
|
||||||
|
if(request()->isAjax()) {
|
||||||
|
return $this->json(404, 'error request!');
|
||||||
|
} else {
|
||||||
|
$referer = $_SERVER['HTTP_REFERER'] ?? null;
|
||||||
|
if (empty($referer)) {
|
||||||
|
$url = '/';
|
||||||
|
} else {
|
||||||
|
$domain = $this->request->domain();
|
||||||
|
$urlInfo = parse_url($referer);
|
||||||
|
$scheme = $urlInfo['scheme'] ?? '';
|
||||||
|
$requestSrc = '';
|
||||||
|
if (!empty($scheme)) {
|
||||||
|
$requestSrc = $scheme.'://'.($urlInfo['host'] ?? '');
|
||||||
|
}
|
||||||
|
if($domain != $requestSrc) {
|
||||||
|
$url = '/';
|
||||||
|
} else {
|
||||||
|
$url = 'javascript:history.back(-1);';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$result = [
|
||||||
|
'code' => 404,
|
||||||
|
'msg' => 'Invalid request! No related resources found.',
|
||||||
|
'data' => [],
|
||||||
|
'url' => $url,
|
||||||
|
'wait' => 5,
|
||||||
|
];
|
||||||
|
return view('error/400')->assign($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function jump()
|
||||||
|
{
|
||||||
|
$param = request()->param();
|
||||||
|
return view()->assign($param);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
namespace app\controller\en;
|
||||||
|
|
||||||
|
use app\model\{Category, Block, Article, Slide};
|
||||||
|
|
||||||
|
class Index extends Base
|
||||||
|
{
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$category = Category::getIndex();
|
||||||
|
$categoryId = $category['id'] ?? 0;
|
||||||
|
$this->data['categoryId'] = $categoryId;
|
||||||
|
$this->setSeo($this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']);
|
||||||
|
$blocks = Block::getByCategoryId($categoryId);
|
||||||
|
$blocks = Block::analysisBlock($blocks);
|
||||||
|
$this->data['blocks'] = $blocks;
|
||||||
|
// 轮播图
|
||||||
|
$this->data['slides'] = Slide::getList();
|
||||||
|
// 营销网络栏目ID
|
||||||
|
$this->data['marketingCId'] = Category::$CIdList['marketing'];
|
||||||
|
// 关联产品分类
|
||||||
|
$productsCenterCId = Category::$CIdList['products'];
|
||||||
|
$this->data['productsCenter'] = Category::getById($productsCenterCId);
|
||||||
|
$this->data['products'] = Category::getChildrenByParentId($productsCenterCId);
|
||||||
|
// 关联新闻
|
||||||
|
$this->data['newsCenter'] = Category::getById(Category::$CIdList['news']);
|
||||||
|
$newsCIdList = [Category::$CIdList['news_children']['enterprise'], Category::$CIdList['news_children']['industry']];
|
||||||
|
$newsList = Category::getListByIds($newsCIdList);
|
||||||
|
foreach ($newsList as &$cate) {
|
||||||
|
$cate['items'] = Article::getLatestByCategory($cate['id'], 4, 1);
|
||||||
|
}
|
||||||
|
unset($cate);
|
||||||
|
$this->data['newsList'] = $newsList;
|
||||||
|
return $this->view();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
namespace app\controller\en;
|
||||||
|
|
||||||
|
use app\model\Message as MMessage;
|
||||||
|
use app\validate\Message as VMessage;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 留言
|
||||||
|
* Class Message
|
||||||
|
* @package app\controller
|
||||||
|
*/
|
||||||
|
class Message extends Base
|
||||||
|
{
|
||||||
|
// 新增留言
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
if(request()->isPost()) {
|
||||||
|
$msgData = [
|
||||||
|
'company_name' => trim(input('post.company_name', '')),
|
||||||
|
'name' => trim(input('post.name', '')),
|
||||||
|
'phone' => trim(input('post.phone', '')),
|
||||||
|
'email' => trim(input('post.email', '')),
|
||||||
|
'content' => trim(input('post.content', '')),
|
||||||
|
];
|
||||||
|
// 安全过滤
|
||||||
|
$msgData = array_map('strip_tags', $msgData);
|
||||||
|
try {
|
||||||
|
validate(VMessage::class)->check($msgData);
|
||||||
|
$msgData['ip'] = request()->ip();
|
||||||
|
$msgData['create_time'] = time();
|
||||||
|
MMessage::create($msgData);
|
||||||
|
return $this->json();
|
||||||
|
} catch (ValidateException $e) {
|
||||||
|
return $this->json(2, $e->getError());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return $this->json(1, '非法请求');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
<?php
|
||||||
|
namespace app\controller\en;
|
||||||
|
|
||||||
|
use app\model\{Achievement, AchievementInfo, Category, Block, Article, History, Model};
|
||||||
|
|
||||||
|
class Page extends Base
|
||||||
|
{
|
||||||
|
// 默认单页页面
|
||||||
|
public function index($categoryId)
|
||||||
|
{
|
||||||
|
$category = Category::getById($categoryId);
|
||||||
|
if ($category) {
|
||||||
|
$description = $category['description'] ? $category['description'] : $this->system['seo_description'];
|
||||||
|
$this->setSeo($category['title'], $this->system['seo_keywords'], $description);
|
||||||
|
} else {
|
||||||
|
return $this->error('页面错误');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->data['categoryId'] = $categoryId;
|
||||||
|
$this->data['category'] = $category;
|
||||||
|
$this->data['blocks'] = Block::getByCategoryId($categoryId);
|
||||||
|
$this->templateDetailAssign($category);
|
||||||
|
|
||||||
|
return $this->view($category['template_detail']);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function templateDetailAssign($category)
|
||||||
|
{
|
||||||
|
$template = $category['template_detail'] ?? '';
|
||||||
|
$TopCId = Category::firstGradeById($category['id']);
|
||||||
|
if($TopCId == $category['id']) {
|
||||||
|
$topCategory = $category;
|
||||||
|
} else {
|
||||||
|
$topCategory = Category::getById($TopCId);
|
||||||
|
}
|
||||||
|
$childCategory = Category::getChildrenByParentId($topCategory['id']);
|
||||||
|
|
||||||
|
$this->data['topCategory'] = $topCategory;
|
||||||
|
$this->data['childCategory'] = $childCategory;
|
||||||
|
switch ($template) {
|
||||||
|
case 'about' :
|
||||||
|
$this->assignAbout($childCategory);
|
||||||
|
break;
|
||||||
|
case 'service' :
|
||||||
|
$this->assignService($childCategory);
|
||||||
|
break;
|
||||||
|
case 'marketing' :
|
||||||
|
$this->assignMarketing($childCategory);
|
||||||
|
break;
|
||||||
|
case 'contact' :
|
||||||
|
$this->assignContact($childCategory);
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
$this->data['blocks'] = Block::getByCategoryId($category['id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取单页栏目IDs
|
||||||
|
private function getBlockCateIds($categoryItems)
|
||||||
|
{
|
||||||
|
$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 = [];
|
||||||
|
$blocks = [];
|
||||||
|
$blockCateIds = $this->getBlockCateIds($childCategory);
|
||||||
|
if($honorTopCId) {
|
||||||
|
$honors = Category::getChildrenByParentId($honorTopCId);
|
||||||
|
foreach ($honors as &$honor) {
|
||||||
|
$honor['items'] = Article::getListByCategoryIds([$honor['id']], $honor['number'] ? $honor['number'] : 20, '', [], 1);
|
||||||
|
}
|
||||||
|
unset($honor);
|
||||||
|
}
|
||||||
|
$blockList = Block::getByCategoryIds($blockCateIds);
|
||||||
|
$aboutChildrenFlip = array_flip(Category::$CIdList['about_children']);
|
||||||
|
foreach ($childCategory as $cate) {
|
||||||
|
$blocks[$aboutChildrenFlip[$cate['id']]] = $blockList[$cate['id']] ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->data['blocks'] = $blocks;
|
||||||
|
$this->data['honors'] = $honors;
|
||||||
|
$this->data['historyList'] = array_reverse(History::getByCategoryId($historyCId, true, $historyCate['number'] ?? -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 品质与服务
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 营销网络
|
||||||
|
private function assignMarketing($childCategory)
|
||||||
|
{
|
||||||
|
$blocks = [];
|
||||||
|
$blockCateIds = $this->getBlockCateIds($childCategory);
|
||||||
|
$blockList = Block::getByCategoryIds($blockCateIds);
|
||||||
|
$marketingChildrenFlip = array_flip(Category::$CIdList['marketing_children']);
|
||||||
|
foreach ($childCategory as $cate) {
|
||||||
|
$blocks[$marketingChildrenFlip[$cate['id']]] = $blockList[$cate['id']] ?? [];
|
||||||
|
}
|
||||||
|
$achievementCate = Category::getById(Category::$CIdList['achievement_manage']);
|
||||||
|
$achievementList = [];
|
||||||
|
if ($achievementCate) {
|
||||||
|
$achievementList = Achievement::getListByCategoryId($achievementCate['id'], $achievementCate['number'] ? $achievementCate['number'] : 10, true);
|
||||||
|
}
|
||||||
|
$this->data['blocks'] = $blocks;
|
||||||
|
$this->data['achievementList'] = $achievementList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 联系我们
|
||||||
|
private function assignContact($childCategory)
|
||||||
|
{
|
||||||
|
$blocks = [];
|
||||||
|
$blockCateIds = $this->getBlockCateIds($childCategory);
|
||||||
|
$blockList = Block::getByCategoryIds($blockCateIds);
|
||||||
|
$contactChildrenFlip = array_flip(Category::$CIdList['contact_children']);
|
||||||
|
foreach ($childCategory as $cate) {
|
||||||
|
$blocks[$contactChildrenFlip[$cate['id']]] = $blockList[$cate['id']] ?? [];
|
||||||
|
}
|
||||||
|
$jobsCate = Category::getById(Category::$CIdList['jobs_manage']);
|
||||||
|
$jobList = Article::getLatestByCategory($jobsCate['id'], $jobsCate['number'] ? $jobsCate['number'] : 10, 1);
|
||||||
|
$this->data['blocks'] = $blocks;
|
||||||
|
$this->data['jobList'] = $jobList;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,54 +1,54 @@
|
||||||
{layout name="layout" /}
|
{layout name="layout" /}
|
||||||
|
|
||||||
<!-- banner -->
|
<!-- banner -->
|
||||||
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban4.jpg')});">
|
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban4.jpg')});">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="w-1200 pt118" id="news">
|
<div class="w-1200 pt118" id="news">
|
||||||
<strong>{$category.title ?? ''}</strong>
|
<strong>{$category.title ?? ''}</strong>
|
||||||
<p>{:nl2br($category.description ?? '')}</p>
|
<p>{:nl2br($category.description ?? '')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<div class="all-center-box">
|
<div class="all-center-box">
|
||||||
<div class="news-box1 w-100">
|
<div class="news-box1 w-100">
|
||||||
<!--
|
<!--
|
||||||
<div class="w-1200 search-form-box">
|
<div class="w-1200 search-form-box">
|
||||||
<form action="{:url('article/index', ['category_id'=> $categoryId])}" method="get" class="layui-form between-center w-100">
|
<form action="{:url('article/index', ['category_id'=> $categoryId])}" method="get" class="layui-form between-center w-100">
|
||||||
<input class="layui-input" name="keyword" placeholder="关键词查询..." value="{$keyword ?? ''}"/>
|
<input class="layui-input" name="keyword" placeholder="关键词查询..." value="{$keyword ?? ''}"/>
|
||||||
<button type="submit" class="layui-btn layui-btn-normal">查询</button>
|
<button type="submit" class="layui-btn layui-btn-normal">查询</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
{if isset($items)}
|
{if isset($items)}
|
||||||
<div class="center-block w-100">
|
<div class="center-block w-100">
|
||||||
<ul>
|
<ul>
|
||||||
{foreach $items as $item}
|
{foreach $items as $item}
|
||||||
<li>
|
<li>
|
||||||
<a href="{:url('article/detail', ['id'=>$item['id']])}" class="between-center">
|
<a href="{:url('article/detail', ['id'=>$item['id']])}" class="between-center">
|
||||||
<div class="pull-left">{$item['create_time']|date="Y.m.d"}</div>
|
<div class="pull-left">{$item['create_time']|date="Y.m.d"}</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<div class="imgs"><img src="{:getImgSrc($item, '__IMG__/default_bg.jpg')}" ></div>
|
<div class="imgs"><img src="{:getImgSrc($item, '__IMG__/default_bg.jpg')}" ></div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span title="{$item['title'] ?? ''}">{$item['title'] ?? ''}</span>
|
<span title="{$item['title'] ?? ''}">{$item['title'] ?? ''}</span>
|
||||||
<em>{$item['create_time']|date="Y.m.d"}</em>
|
<em>{$item['create_time']|date="Y.m.d"}</em>
|
||||||
<p>{:nl2br($item['summary'] ?? '')}</p>
|
<p>{:nl2br($item['summary'] ?? '')}</p>
|
||||||
<i>了解详情+</i>
|
<i>了解详情+</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="pager w-100 div-pc">
|
<div class="pager w-100 div-pc">
|
||||||
{$items->render()|raw}
|
{$items->render()|raw}
|
||||||
</div>
|
</div>
|
||||||
<div class="pager w-100 div-phone">
|
<div class="pager w-100 div-phone">
|
||||||
{$items->render(5)|raw}
|
{$items->render(5)|raw}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -1,99 +1,99 @@
|
||||||
{layout name="layout"}
|
{layout name="layout"}
|
||||||
|
|
||||||
<!-- banner -->
|
<!-- banner -->
|
||||||
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban4.jpg')});">
|
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban4.jpg')});">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="w-1200 pt118" id="news">
|
<div class="w-1200 pt118" id="news">
|
||||||
<strong>{$topCategory.title ?? ''}</strong>
|
<strong>{$topCategory.title ?? ''}</strong>
|
||||||
<p>{:nl2br($topCategory.description ?? '')}</p>
|
<p>{:nl2br($topCategory.description ?? '')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<div class="all-center-box">
|
<div class="all-center-box">
|
||||||
<!-- Corporate -->
|
<!-- Corporate -->
|
||||||
{if isset($cateList['enterprise']) && !empty($cateList['enterprise'])}
|
{if isset($cateList['enterprise']) && !empty($cateList['enterprise'])}
|
||||||
<div class="news-box1 w-100" id="news1">
|
<div class="news-box1 w-100" id="news1">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="all-title-box2 w-100"><span>{$cateList['enterprise']['title'] ?? ''}</span><p>{$cateList['enterprise']['description'] ?? ''}</p></div>
|
<div class="all-title-box2 w-100"><span>{$cateList['enterprise']['title'] ?? ''}</span><p>{$cateList['enterprise']['description'] ?? ''}</p></div>
|
||||||
<div class="center-block w-100">
|
<div class="center-block w-100">
|
||||||
<ul>
|
<ul>
|
||||||
{if isset($cateList['enterprise']['items']) && count($cateList['enterprise']['items']) > 0}
|
{if isset($cateList['enterprise']['items']) && count($cateList['enterprise']['items']) > 0}
|
||||||
{foreach $cateList['enterprise']['items'] as $item}
|
{foreach $cateList['enterprise']['items'] as $item}
|
||||||
<li>
|
<li>
|
||||||
<a href="{:url('article/detail', ['id'=>$item['id']])}" class="between-center">
|
<a href="{:url('article/detail', ['id'=>$item['id']])}" class="between-center">
|
||||||
<div class="pull-left">{$item['create_time']|date="Y.m.d"}</div>
|
<div class="pull-left">{$item['create_time']|date="Y.m.d"}</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<div class="imgs"><img src="{:getImgSrc($item, '__IMG__/default_bg.jpg')}" ></div>
|
<div class="imgs"><img src="{:getImgSrc($item, '__IMG__/default_bg.jpg')}" ></div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span title="{$item['title'] ?? ''}">{$item['title'] ?? ''}</span>
|
<span title="{$item['title'] ?? ''}">{$item['title'] ?? ''}</span>
|
||||||
<em>{$item['create_time']|date="Y.m.d"}</em>
|
<em>{$item['create_time']|date="Y.m.d"}</em>
|
||||||
<p>{:nl2br($item['summary'] ?? '')}</p>
|
<p>{:nl2br($item['summary'] ?? '')}</p>
|
||||||
<i>了解详情+</i>
|
<i>了解详情+</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="more w-100"><a href="{:url('article/index', ['category_id'=>$cateList['enterprise']['id']])}">点击展开更多</a></div>
|
<div class="more w-100"><a href="{:url('article/index', ['category_id'=>$cateList['enterprise']['id']])}">点击展开更多</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<!-- Industry -->
|
<!-- Industry -->
|
||||||
{if isset($cateList['industry']) && !empty($cateList['industry'])}
|
{if isset($cateList['industry']) && !empty($cateList['industry'])}
|
||||||
<div class="news-box1 w-100 news-box2" id="news2">
|
<div class="news-box1 w-100 news-box2" id="news2">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="all-title-box2 w-100"><span>{$cateList['industry']['title'] ?? ''}</span><p>{$cateList['industry']['description'] ?? ''}</p></div>
|
<div class="all-title-box2 w-100"><span>{$cateList['industry']['title'] ?? ''}</span><p>{$cateList['industry']['description'] ?? ''}</p></div>
|
||||||
<div class="center-block w-100">
|
<div class="center-block w-100">
|
||||||
<ul>
|
<ul>
|
||||||
{if isset($cateList['enterprise']['items']) && count($cateList['enterprise']['items']) > 0}
|
{if isset($cateList['enterprise']['items']) && count($cateList['enterprise']['items']) > 0}
|
||||||
{foreach $cateList['enterprise']['items'] as $item}
|
{foreach $cateList['enterprise']['items'] as $item}
|
||||||
<li>
|
<li>
|
||||||
<a href="{:url('article/detail', ['id'=>$item['id']])}" class="between-center">
|
<a href="{:url('article/detail', ['id'=>$item['id']])}" class="between-center">
|
||||||
<div class="pull-left">{$item['create_time']|date="Y.m.d"}</div>
|
<div class="pull-left">{$item['create_time']|date="Y.m.d"}</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<div class="imgs"><img src="{:getImgSrc($item, '__IMG__/default_bg.jpg')}" ></div>
|
<div class="imgs"><img src="{:getImgSrc($item, '__IMG__/default_bg.jpg')}" ></div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span title="{$item['title'] ?? ''}">{$item['title'] ?? ''}</span>
|
<span title="{$item['title'] ?? ''}">{$item['title'] ?? ''}</span>
|
||||||
<em>{$item['create_time']|date="Y.m.d"}</em>
|
<em>{$item['create_time']|date="Y.m.d"}</em>
|
||||||
<p>{:nl2br($item['summary'] ?? '')}</p>
|
<p>{:nl2br($item['summary'] ?? '')}</p>
|
||||||
<i>了解详情+</i>
|
<i>了解详情+</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="more w-100"><a href="">点击展开更多</a></div>
|
<div class="more w-100"><a href="">点击展开更多</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<!-- Latest -->
|
<!-- Latest -->
|
||||||
{if isset($cateList['dynamics']) && !empty($cateList['dynamics'])}
|
{if isset($cateList['dynamics']) && !empty($cateList['dynamics'])}
|
||||||
<div class="news-box3 w-100" id="news3">
|
<div class="news-box3 w-100" id="news3">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="between-top">
|
<div class="between-top">
|
||||||
<div class="all-title-box2"><span>{$cateList['dynamics']['title'] ?? ''}</span><p>{$cateList['dynamics']['description'] ?? ''}</p></div>
|
<div class="all-title-box2"><span>{$cateList['dynamics']['title'] ?? ''}</span><p>{$cateList['dynamics']['description'] ?? ''}</p></div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<ul>
|
<ul>
|
||||||
{if isset($cateList['dynamics']['items']) && count($cateList['dynamics']['items']) > 0}
|
{if isset($cateList['dynamics']['items']) && count($cateList['dynamics']['items']) > 0}
|
||||||
{foreach $cateList['dynamics']['items'] as $item}
|
{foreach $cateList['dynamics']['items'] as $item}
|
||||||
<li><a href="{:url('article/detail', ['id'=>$item['id']])}">
|
<li><a href="{:url('article/detail', ['id'=>$item['id']])}">
|
||||||
<span title="{$item['title'] ?? ''}">{$item['title'] ?? ''}</span>
|
<span title="{$item['title'] ?? ''}">{$item['title'] ?? ''}</span>
|
||||||
<i>{$item['create_time']|date="Y年m月d日"}</i></a>
|
<i>{$item['create_time']|date="Y年m月d日"}</i></a>
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="more w-100"><a href="{:url('article/index', ['category_id'=>$cateList['dynamics']['id']])}">点击展开更多</a></div>
|
<div class="more w-100"><a href="{:url('article/index', ['category_id'=>$cateList['dynamics']['id']])}">点击展开更多</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
{layout name="layout" /}
|
{layout name="layout" /}
|
||||||
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban4.jpg')});">
|
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban4.jpg')});">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="w-1200 pt118" id="news">
|
<div class="w-1200 pt118" id="news">
|
||||||
<strong>{$category.title ?? ''}</strong>
|
<strong>{$category.title ?? ''}</strong>
|
||||||
<p>{:nl2br($category.description ?? '')}</p>
|
<p>{:nl2br($category.description ?? '')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<div class="all-center-box">
|
<div class="all-center-box">
|
||||||
<div class="news-info w-100">
|
<div class="news-info w-100">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="top-box w-100">
|
<div class="top-box w-100">
|
||||||
<span>{$article.title}</span>
|
<span>{$article.title}</span>
|
||||||
<p>{$article.create_time|date="Y/m/d"}</p>
|
<p>{$article.create_time|date="Y/m/d"}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="cen-box w-100">
|
<div class="cen-box w-100">
|
||||||
{:nl2br($article.content)}
|
{:nl2br($article.content)}
|
||||||
</div>
|
</div>
|
||||||
<div class="lower-box w-100">
|
<div class="lower-box w-100">
|
||||||
<p>
|
<p>
|
||||||
{if isset($prev) && count($prev) >0}
|
{if isset($prev) && count($prev) >0}
|
||||||
<a href="{:url('article/detail', ['id' => $prev.id])}">上一篇</a>
|
<a href="{:url('article/detail', ['id' => $prev.id])}">上一篇</a>
|
||||||
{/if}
|
{/if}
|
||||||
{if (isset($prev) && count($prev) >0) && (isset($next) && count($next) >0)} / {/if}
|
{if (isset($prev) && count($prev) >0) && (isset($next) && count($next) >0)} / {/if}
|
||||||
{if isset($next) && count($next) >0}
|
{if isset($next) && count($next) >0}
|
||||||
<a href="{:url('article/detail', ['id' => $next.id])}">下一篇</a>
|
<a href="{:url('article/detail', ['id' => $next.id])}">下一篇</a>
|
||||||
{/if}
|
{/if}
|
||||||
</p>
|
</p>
|
||||||
<a href="{:url('article/index', ['category_id'=>$article['category_id']])}" class="btns">返回</a>
|
<a href="{:url('article/index', ['category_id'=>$article['category_id']])}" class="btns">返回</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -1,55 +1,55 @@
|
||||||
{layout name="layout" /}
|
{layout name="layout" /}
|
||||||
|
|
||||||
<!-- banner -->
|
<!-- banner -->
|
||||||
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban3.jpg')});">
|
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban3.jpg')});">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="w-1200 pt118">
|
<div class="w-1200 pt118">
|
||||||
<strong>{$topCategory.title ?? ''}</strong>
|
<strong>{$topCategory.title ?? ''}</strong>
|
||||||
<p>{:nl2br($topCategory.description ?? '')}</p>
|
<p>{:nl2br($topCategory.description ?? '')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<div class="all-center-box">
|
<div class="all-center-box">
|
||||||
<div class="news-info w-100">
|
<div class="news-info w-100">
|
||||||
<div class="w-1200 product-title-box">
|
<div class="w-1200 product-title-box">
|
||||||
{if isset($categoryChildren) && count($categoryChildren) >0}
|
{if isset($categoryChildren) && count($categoryChildren) >0}
|
||||||
{foreach $categoryChildren as $idx => $cate}
|
{foreach $categoryChildren as $idx => $cate}
|
||||||
{php}
|
{php}
|
||||||
$active = '';
|
$active = '';
|
||||||
if($categoryId == $cate['id']) {
|
if($categoryId == $cate['id']) {
|
||||||
$active = 'active';
|
$active = 'active';
|
||||||
} elseif ($categoryId == $topCategory['id'] && $idx == 0) {
|
} elseif ($categoryId == $topCategory['id'] && $idx == 0) {
|
||||||
$active = 'active';
|
$active = 'active';
|
||||||
}
|
}
|
||||||
{/php}
|
{/php}
|
||||||
<div class="product-item {$active}">
|
<div class="product-item {$active}">
|
||||||
<a href="{:url('article/index', ['category_id'=>$cate.id])}">{$cate.title}</a>
|
<a href="{:url('article/index', ['category_id'=>$cate.id])}">{$cate.title}</a>
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="top-box w-100">
|
<div class="top-box w-100">
|
||||||
<span>{$article.title}</span>
|
<span>{$article.title}</span>
|
||||||
<p>{$article.create_time|date="Y/m/d"}</p>
|
<p>{$article.create_time|date="Y/m/d"}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="cen-box w-100">
|
<div class="cen-box w-100">
|
||||||
{:nl2br($article.content)}
|
{:nl2br($article.content)}
|
||||||
</div>
|
</div>
|
||||||
<div class="lower-box w-100">
|
<div class="lower-box w-100">
|
||||||
<p>
|
<p>
|
||||||
{if isset($prev) && count($prev) >0}
|
{if isset($prev) && count($prev) >0}
|
||||||
<a href="{:url('article/detail', ['id' => $prev.id, 'source'=>$currentCateId])}">上一篇</a>
|
<a href="{:url('article/detail', ['id' => $prev.id, 'source'=>$currentCateId])}">上一篇</a>
|
||||||
{/if}
|
{/if}
|
||||||
{if (isset($prev) && count($prev) >0) && (isset($next) && count($next) >0)}/{/if}
|
{if (isset($prev) && count($prev) >0) && (isset($next) && count($next) >0)}/{/if}
|
||||||
{if isset($next) && count($next) >0}
|
{if isset($next) && count($next) >0}
|
||||||
<a href="{:url('article/detail', ['id' => $next.id, 'source'=>$currentCateId])}">下一篇</a>
|
<a href="{:url('article/detail', ['id' => $next.id, 'source'=>$currentCateId])}">下一篇</a>
|
||||||
{/if}
|
{/if}
|
||||||
</p>
|
</p>
|
||||||
<a href="{:url('article/index', ['category_id'=>$currentCateId])}" class="btns">返回</a>
|
<a href="{:url('article/index', ['category_id'=>$currentCateId])}" class="btns">返回</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -1,70 +1,70 @@
|
||||||
{layout name="layout" /}
|
{layout name="layout" /}
|
||||||
|
|
||||||
<!-- banner -->
|
<!-- banner -->
|
||||||
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban3.jpg')});">
|
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban3.jpg')});">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="w-1200 pt118" id="product">
|
<div class="w-1200 pt118" id="product">
|
||||||
<strong>{$category.title ?? ''}</strong>
|
<strong>{$category.title ?? ''}</strong>
|
||||||
<p>{:nl2br($category.description ?? '')}</p>
|
<p>{:nl2br($category.description ?? '')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<div class="all-center-box">
|
<div class="all-center-box">
|
||||||
<div class="product-box w-100">
|
<div class="product-box w-100">
|
||||||
<!--
|
<!--
|
||||||
<div class="w-1200 search-form-box">
|
<div class="w-1200 search-form-box">
|
||||||
<form action="{:url('products.search')}" class="layui-form between-center w-100" method="get">
|
<form action="{:url('products.search')}" class="layui-form between-center w-100" method="get">
|
||||||
<select name="category_id">
|
<select name="category_id">
|
||||||
<option value="{$topCategory.id}">产品选择</option>
|
<option value="{$topCategory.id}">产品选择</option>
|
||||||
{if isset($categoryChildren) && count($categoryChildren) >0}
|
{if isset($categoryChildren) && count($categoryChildren) >0}
|
||||||
{foreach $categoryChildren as $cate}
|
{foreach $categoryChildren as $cate}
|
||||||
<option value="{$cate.id}" {if $categoryId == $cate.id}selected="selected"{/if}>{$cate.title}</option>
|
<option value="{$cate.id}" {if $categoryId == $cate.id}selected="selected"{/if}>{$cate.title}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</select>
|
</select>
|
||||||
<input name="keyword" class="layui-input" placeholder="关键词查询..." value="{$keyword ?? ''}"/>
|
<input name="keyword" class="layui-input" placeholder="关键词查询..." value="{$keyword ?? ''}"/>
|
||||||
<button type="submit" class="layui-btn layui-btn-normal">查询</button>
|
<button type="submit" class="layui-btn layui-btn-normal">查询</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<div class="w-1200 product-title-box">
|
<div class="w-1200 product-title-box">
|
||||||
{if isset($categoryChildren) && count($categoryChildren) >0}
|
{if isset($categoryChildren) && count($categoryChildren) >0}
|
||||||
{foreach $categoryChildren as $idx => $cate}
|
{foreach $categoryChildren as $idx => $cate}
|
||||||
{php}
|
{php}
|
||||||
$active = '';
|
$active = '';
|
||||||
if($categoryId == $cate['id']) {
|
if($categoryId == $cate['id']) {
|
||||||
$active = 'active';
|
$active = 'active';
|
||||||
} elseif ($categoryId == $topCategory['id'] && $idx == 0) {
|
} elseif ($categoryId == $topCategory['id'] && $idx == 0) {
|
||||||
$active = 'active';
|
$active = 'active';
|
||||||
}
|
}
|
||||||
{/php}
|
{/php}
|
||||||
<div class="product-item {$active}">
|
<div class="product-item {$active}">
|
||||||
<a href="{:url('article/index#product', ['category_id'=>$cate.id])}">{$cate.title}</a>
|
<a href="{:url('article/index#product', ['category_id'=>$cate.id])}">{$cate.title}</a>
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
{if isset($items)}
|
{if isset($items)}
|
||||||
<div class="center-block w-100">
|
<div class="center-block w-100">
|
||||||
<ul>
|
<ul>
|
||||||
{foreach $items as $item}
|
{foreach $items as $item}
|
||||||
<li>
|
<li>
|
||||||
<a>
|
<a>
|
||||||
<span><img src="{:getImgSrc($item, '__IMG__/default_bg.jpg')}" ></span><p>{$item.title}</p>
|
<span><img src="{:getImgSrc($item, '__IMG__/default_bg.jpg')}" ></span><p>{$item.title}</p>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="pager w-100 div-pc">
|
<div class="pager w-100 div-pc">
|
||||||
{$items->render()|raw}
|
{$items->render()|raw}
|
||||||
</div>
|
</div>
|
||||||
<div class="pager w-100 div-phone">
|
<div class="pager w-100 div-phone">
|
||||||
{$items->render(5)|raw}
|
{$items->render(5)|raw}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -1,132 +1,132 @@
|
||||||
{layout name="layout" /}
|
{layout name="layout" /}
|
||||||
|
|
||||||
<!-- slide -->
|
<!-- slide -->
|
||||||
<div class="banner-box w-100">
|
<div class="banner-box w-100">
|
||||||
<div class="swiper-container">
|
<div class="swiper-container">
|
||||||
<div class="swiper-wrapper">
|
<div class="swiper-wrapper">
|
||||||
{if isset($slides) && count($slides) > 0}
|
{if isset($slides) && count($slides) > 0}
|
||||||
{foreach $slides as $banner}
|
{foreach $slides as $banner}
|
||||||
<div class="swiper-slide center-center" style="background-image: url({$banner.src});">
|
<div class="swiper-slide center-center" style="background-image: url({$banner.src});">
|
||||||
{php}
|
{php}
|
||||||
$bannerLink = 'javascript:;';
|
$bannerLink = 'javascript:;';
|
||||||
if(!empty($banner['url'])) {
|
if(!empty($banner['url'])) {
|
||||||
$bannerLink = $banner['url'];
|
$bannerLink = $banner['url'];
|
||||||
}
|
}
|
||||||
{/php}
|
{/php}
|
||||||
<a href="{$bannerLink}" class="center-center banner-slide-link">
|
<a href="{$bannerLink}" class="center-center banner-slide-link">
|
||||||
<div class="w-1500">
|
<div class="w-1500">
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
<p>{:nl2br($banner.title ?? '')}</p>
|
<p>{:nl2br($banner.title ?? '')}</p>
|
||||||
<i>{:nl2br($banner.description ?? '')}</i>
|
<i>{:nl2br($banner.description ?? '')}</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="swiper-page"><div class="w-1500"><div class="swiper-pagination"></div></div></div>
|
<div class="swiper-page"><div class="w-1500"><div class="swiper-pagination"></div></div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="all-center-box">
|
<div class="all-center-box">
|
||||||
<!-- products -->
|
<!-- products -->
|
||||||
<div class="home-box1 w-100">
|
<div class="home-box1 w-100">
|
||||||
<div class="w-1500">
|
<div class="w-1500">
|
||||||
<div class="all-title-box1 w-100"><span>{$productsCenter['title'] ?? '产品中心'}</span>
|
<div class="all-title-box1 w-100"><span>{$productsCenter['title'] ?? '产品中心'}</span>
|
||||||
<p>{$productsCenter['description'] ?? 'product center'}</p></div>
|
<p>{$productsCenter['description'] ?? 'product center'}</p></div>
|
||||||
<div class="center-block w-100">
|
<div class="center-block w-100">
|
||||||
{if isset($products) && count($products) > 0}
|
{if isset($products) && count($products) > 0}
|
||||||
<ul>
|
<ul>
|
||||||
{foreach $products as $idx => $product}
|
{foreach $products as $idx => $product}
|
||||||
<li {if $idx == 0}class="active"{/if}>
|
<li {if $idx == 0}class="active"{/if}>
|
||||||
<div class="box-info" style="background-image: url({$product['src']});">
|
<div class="box-info" style="background-image: url({$product['src']});">
|
||||||
<div class="box1">
|
<div class="box1">
|
||||||
<span>{$product['title']}</span>
|
<span>{$product['title']}</span>
|
||||||
<p>{$product['description']}</p>
|
<p>{$product['description']}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="box2">
|
<div class="box2">
|
||||||
<a href="{:url('article/index', ['category_id'=>$product['id']])}">了解详情+</a>
|
<a href="{:url('article/index', ['category_id'=>$product['id']])}">了解详情+</a>
|
||||||
<i>{:str_pad($idx + 1, 2, '0', STR_PAD_LEFT)}</i>
|
<i>{:str_pad($idx + 1, 2, '0', STR_PAD_LEFT)}</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- marketing -->
|
<!-- marketing -->
|
||||||
<div class="home-box2 w-100" style="background-image: url({$blocks['marketing_background']['value'] ?? ''});">
|
<div class="home-box2 w-100" style="background-image: url({$blocks['marketing_background']['value'] ?? ''});">
|
||||||
<div class="w-1500">
|
<div class="w-1500">
|
||||||
<div class="pull-left column-between">
|
<div class="pull-left column-between">
|
||||||
<div class="all-title-box1 w-100"><span>{$blocks['marketing_name']['value'] ?? ''}</span>
|
<div class="all-title-box1 w-100"><span>{$blocks['marketing_name']['value'] ?? ''}</span>
|
||||||
<p>{:nl2br($blocks['marketing_describe']['value'] ?? '')}</p></div>
|
<p>{:nl2br($blocks['marketing_describe']['value'] ?? '')}</p></div>
|
||||||
{php}
|
{php}
|
||||||
$marketingLink = url('page/index', ['category_id'=>$marketingCId]);
|
$marketingLink = url('page/index', ['category_id'=>$marketingCId]);
|
||||||
if(isset($blocks['marketing_background']['link']) && !empty($blocks['marketing_background']['link'])) {
|
if(isset($blocks['marketing_background']['link']) && !empty($blocks['marketing_background']['link'])) {
|
||||||
$marketingLink = $blocks['marketing_background']['link'];
|
$marketingLink = $blocks['marketing_background']['link'];
|
||||||
}
|
}
|
||||||
{/php}
|
{/php}
|
||||||
<a href="{$marketingLink ?? 'javascript:;'}">了解详情++</a>
|
<a href="{$marketingLink ?? 'javascript:;'}">了解详情++</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- news -->
|
<!-- news -->
|
||||||
<div class="home-box3 w-100">
|
<div class="home-box3 w-100">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="top-box w-100"><div class="between-bottom"><span>{$newsCenter['title'] ?? '新闻动态'}</span><i>{$newsCenter['description'] ?? ''}</i></div></div>
|
<div class="top-box w-100"><div class="between-bottom"><span>{$newsCenter['title'] ?? '新闻动态'}</span><i>{$newsCenter['description'] ?? ''}</i></div></div>
|
||||||
<div class="lower-box w-100">
|
<div class="lower-box w-100">
|
||||||
{if isset($newsList) && count($newsList) > 0}
|
{if isset($newsList) && count($newsList) > 0}
|
||||||
{foreach $newsList as $newsCate}
|
{foreach $newsList as $newsCate}
|
||||||
<ul>
|
<ul>
|
||||||
<p>{$newsCate.title ?? ''}</p>
|
<p>{$newsCate.title ?? ''}</p>
|
||||||
{if isset($newsCate['items']) && count($newsCate['items']) > 0}
|
{if isset($newsCate['items']) && count($newsCate['items']) > 0}
|
||||||
{foreach $newsCate['items'] as $news}
|
{foreach $newsCate['items'] as $news}
|
||||||
<li>
|
<li>
|
||||||
<a href="{:url('article/detail', ['id'=>$news['id']])}">
|
<a href="{:url('article/detail', ['id'=>$news['id']])}">
|
||||||
<span title="{$news['title']|raw}">{$news['title']|raw}</span>
|
<span title="{$news['title']|raw}">{$news['title']|raw}</span>
|
||||||
<i>{$news['create_time']|date='Y年m月d日'}</i>
|
<i>{$news['create_time']|date='Y年m月d日'}</i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var swiper = new Swiper('.banner-box .swiper-container', {
|
var swiper = new Swiper('.banner-box .swiper-container', {
|
||||||
loop: true,
|
loop: true,
|
||||||
speed: 1000,
|
speed: 1000,
|
||||||
autoplay: {
|
autoplay: {
|
||||||
delay: 6000,
|
delay: 6000,
|
||||||
disableOnInteraction: false,
|
disableOnInteraction: false,
|
||||||
},
|
},
|
||||||
navigation: {
|
navigation: {
|
||||||
nextEl: '.banner-box .swiper-button-next',
|
nextEl: '.banner-box .swiper-button-next',
|
||||||
prevEl: '.banner-box .swiper-button-prev',
|
prevEl: '.banner-box .swiper-button-prev',
|
||||||
},
|
},
|
||||||
pagination :{
|
pagination :{
|
||||||
el: '.banner-box .swiper-pagination',
|
el: '.banner-box .swiper-pagination',
|
||||||
clickable :true,
|
clickable :true,
|
||||||
},
|
},
|
||||||
on:{
|
on:{
|
||||||
init: function(){
|
init: function(){
|
||||||
|
|
||||||
},
|
},
|
||||||
transitionEnd: function(){
|
transitionEnd: function(){
|
||||||
$('.banner-box .swiper-container .swiper-slide .w-1500').eq(this.activeIndex).addClass('active')
|
$('.banner-box .swiper-container .swiper-slide .w-1500').eq(this.activeIndex).addClass('active')
|
||||||
},
|
},
|
||||||
transitionStart: function(){
|
transitionStart: function(){
|
||||||
$('.banner-box .swiper-container .swiper-slide .w-1500').removeClass('active')
|
$('.banner-box .swiper-container .swiper-slide .w-1500').removeClass('active')
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -1,182 +1,182 @@
|
||||||
{layout name="layout"}
|
{layout name="layout"}
|
||||||
<!-- banner -->
|
<!-- banner -->
|
||||||
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban1.jpg')});">
|
<div class="page-banner w-100" style="background-image: url({:getImgSrc($topCategory, '__IMG__/page_ban1.jpg')});">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<strong>{$topCategory.title}</strong>
|
<strong>{$topCategory.title}</strong>
|
||||||
<p>{:nl2br($topCategory.description ?? '')}</p>
|
<p>{:nl2br($topCategory.description ?? '')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Company -->
|
<!-- Company -->
|
||||||
<div class="all-center-box">
|
<div class="all-center-box">
|
||||||
<div class="about-box1 w-100 center-center" id="about1">
|
<div class="about-box1 w-100 center-center" id="about1">
|
||||||
<div class="w-1200 disFlex">
|
<div class="w-1200 disFlex">
|
||||||
<div class="pull-left"><img class="imgH" src="{$blocks['company']['img']['value'] ?? ''}" ></div>
|
<div class="pull-left"><img class="imgH" src="{$blocks['company']['img']['value'] ?? ''}" ></div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<div class="all-title-box2 w-100"><span>{$blocks['company']['title']['value'] ?? ''}</span><p>{$blocks['company']['subtitle']['value'] ?? ''}</p></div>
|
<div class="all-title-box2 w-100"><span>{$blocks['company']['title']['value'] ?? ''}</span><p>{$blocks['company']['subtitle']['value'] ?? ''}</p></div>
|
||||||
<div class="box-info w-100">{:nl2br($blocks['company']['description']['value'] ?? '')}</div>
|
<div class="box-info w-100">{:nl2br($blocks['company']['description']['value'] ?? '')}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Honors -->
|
<!-- Honors -->
|
||||||
|
|
||||||
<div class="about-box2 w-100" id="about2">
|
<div class="about-box2 w-100" id="about2">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="top-box w-100 between-center">
|
<div class="top-box w-100 between-center">
|
||||||
<div class="all-title-box2"><span>{$blocks['honor']['title']['value'] ?? ''}</span><p>{$blocks['honor']['subtitle']['value'] ?? ''}</p></div>
|
<div class="all-title-box2"><span>{$blocks['honor']['title']['value'] ?? ''}</span><p>{$blocks['honor']['subtitle']['value'] ?? ''}</p></div>
|
||||||
<div class="fr">
|
<div class="fr">
|
||||||
{if isset($honors) && count($honors) > 0}
|
{if isset($honors) && count($honors) > 0}
|
||||||
{foreach $honors as $k => $honor}
|
{foreach $honors as $k => $honor}
|
||||||
<span {if $k == 0}class="active"{/if}>{$honor.title}</span>
|
<span {if $k == 0}class="active"{/if}>{$honor.title}</span>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{if isset($honors) && count($honors) > 0}
|
{if isset($honors) && count($honors) > 0}
|
||||||
{foreach $honors as $k => $honor}
|
{foreach $honors as $k => $honor}
|
||||||
<div class="lower-box w-100">
|
<div class="lower-box w-100">
|
||||||
<div class="div-pc w-100">
|
<div class="div-pc w-100">
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
<ul>
|
<ul>
|
||||||
{foreach $honor.items as $item}
|
{foreach $honor.items as $item}
|
||||||
<li><img src="{:getImgSrc($item, '__IMG__/default_bg.png')}"></li>
|
<li><img src="{:getImgSrc($item, '__IMG__/default_bg.png')}"></li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<ul>
|
<ul>
|
||||||
{foreach $honor.items as $item}
|
{foreach $honor.items as $item}
|
||||||
<li title="{$item.title}">{$item.title}</li>
|
<li title="{$item.title}">{$item.title}</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-phone w-100">
|
<div class="div-phone w-100">
|
||||||
<div class="swiper-container">
|
<div class="swiper-container">
|
||||||
<div class="swiper-wrapper">
|
<div class="swiper-wrapper">
|
||||||
{foreach $honor.items as $item}
|
{foreach $honor.items as $item}
|
||||||
<div class="swiper-slide"><span><img src="{:getImgSrc($item, '__IMG__/default_bg.png')}" onclick="tanchuImg(this)"></span><p>{$item.title}</p></div>
|
<div class="swiper-slide"><span><img src="{:getImgSrc($item, '__IMG__/default_bg.png')}" onclick="tanchuImg(this)"></span><p>{$item.title}</p></div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="honor-tc">
|
<div class="honor-tc">
|
||||||
<div class="center-center">
|
<div class="center-center">
|
||||||
<i onclick="$('.honor-tc').fadeOut();"></i>
|
<i onclick="$('.honor-tc').fadeOut();"></i>
|
||||||
<img src="" >
|
<img src="" >
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var swiper = new Swiper('.about-box2 .div-phone .swiper-container', {
|
var swiper = new Swiper('.about-box2 .div-phone .swiper-container', {
|
||||||
loop:true,
|
loop:true,
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
autoplay:true
|
autoplay:true
|
||||||
});
|
});
|
||||||
$('.about-box2 .top-box .fr span').click(function(){
|
$('.about-box2 .top-box .fr span').click(function(){
|
||||||
swiper.update()
|
swiper.update()
|
||||||
})
|
})
|
||||||
function tanchuImg(obj){
|
function tanchuImg(obj){
|
||||||
var imgsrc = $(obj).attr('src')
|
var imgsrc = $(obj).attr('src')
|
||||||
$('.honor-tc').find('img').attr('src',imgsrc);
|
$('.honor-tc').find('img').attr('src',imgsrc);
|
||||||
$('.honor-tc').fadeIn();
|
$('.honor-tc').fadeIn();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<!-- Structure -->
|
<!-- Structure -->
|
||||||
<div id="about3" class="w-100">
|
<div id="about3" class="w-100">
|
||||||
<div class="about-box3 w-100" >
|
<div class="about-box3 w-100" >
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="all-title-box2"><span>{$blocks['structure']['title']['value'] ?? ''}</span><p>{$blocks['structure']['subtitle']['value'] ?? ''}</p></div>
|
<div class="all-title-box2"><span>{$blocks['structure']['title']['value'] ?? ''}</span><p>{$blocks['structure']['subtitle']['value'] ?? ''}</p></div>
|
||||||
<div class="box-info w-100">
|
<div class="box-info w-100">
|
||||||
<img src="{$blocks['structure']['img']['value'] ?? ''}" >
|
<img src="{$blocks['structure']['img']['value'] ?? ''}" >
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- History -->
|
<!-- History -->
|
||||||
<div class="about-box4 w-100" id="about4">
|
<div class="about-box4 w-100" id="about4">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="all-title-box2"><span>{$blocks['history']['title']['value'] ?? ''}</span><p>{$blocks['history']['subtitle']['value'] ?? ''}</p></div>
|
<div class="all-title-box2"><span>{$blocks['history']['title']['value'] ?? ''}</span><p>{$blocks['history']['subtitle']['value'] ?? ''}</p></div>
|
||||||
<div class="top-box w-100">
|
<div class="top-box w-100">
|
||||||
<div class="swiper-container">
|
<div class="swiper-container">
|
||||||
<div class="swiper-wrapper">
|
<div class="swiper-wrapper">
|
||||||
{if isset($historyList) && count($historyList) > 0}
|
{if isset($historyList) && count($historyList) > 0}
|
||||||
{foreach $historyList as $history}
|
{foreach $historyList as $history}
|
||||||
<div class="swiper-slide"><p><span>{$history.title}</span><em> / 年</em></p><i></i></div>
|
<div class="swiper-slide"><p><span>{$history.title}</span><em> / 年</em></p><i></i></div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="lower-box w-100">
|
<div class="lower-box w-100">
|
||||||
{if isset($historyList) && count($historyList) > 0}
|
{if isset($historyList) && count($historyList) > 0}
|
||||||
{foreach $historyList as $history}
|
{foreach $historyList as $history}
|
||||||
<div class="center-block w-100">
|
<div class="center-block w-100">
|
||||||
{foreach $history['info'] as $k => $info}
|
{foreach $history['info'] as $k => $info}
|
||||||
<p class="lower-box-item">{if $k > 0}<hr />{/if}{:nl2br($info['title'] ?? '')}</p>
|
<p class="lower-box-item">{if $k > 0}<hr />{/if}{:nl2br($info['title'] ?? '')}</p>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="swiper-btn">
|
<div class="swiper-btn">
|
||||||
<div class="swiper-button-prev"></div>
|
<div class="swiper-button-prev"></div>
|
||||||
<div class="swiper-button-next"></div>
|
<div class="swiper-button-next"></div>
|
||||||
<span>点击前后翻看</span>
|
<span>点击前后翻看</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="about-box5 w-100" id="about5">
|
<div class="about-box5 w-100" id="about5">
|
||||||
<div class="w-1200">
|
<div class="w-1200">
|
||||||
<div class="video-box w-100">
|
<div class="video-box w-100">
|
||||||
<i style="background-image: url({$blocks['video']['video']['img'] ?? ''});"></i>
|
<i style="background-image: url({$blocks['video']['video']['img'] ?? ''});"></i>
|
||||||
<video src="{$blocks['video']['video']['value'] ?? ''}" controls playsinline="isiPhoneShowPlaysinline" x5-video-player-type="h5-page" t7-video-player-type="inline" webkit-playsinline="isiPhoneShowPlaysinline" x-webkit-airplay="" preload="none"></video>
|
<video src="{$blocks['video']['video']['value'] ?? ''}" controls playsinline="isiPhoneShowPlaysinline" x5-video-player-type="h5-page" t7-video-player-type="inline" webkit-playsinline="isiPhoneShowPlaysinline" x-webkit-airplay="" preload="none"></video>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var initialSlide = 0;
|
var initialSlide = 0;
|
||||||
if($('.about-box4 .lower-box .center-block').length > 1){
|
if($('.about-box4 .lower-box .center-block').length > 1){
|
||||||
initialSlide = 1
|
initialSlide = 1
|
||||||
}
|
}
|
||||||
var swiper = new Swiper('.about-box4 .swiper-container', {
|
var swiper = new Swiper('.about-box4 .swiper-container', {
|
||||||
loop:true,
|
loop:true,
|
||||||
initialSlide:initialSlide,
|
initialSlide:initialSlide,
|
||||||
slidesPerView: 3,
|
slidesPerView: 3,
|
||||||
spaceBetween: 0,
|
spaceBetween: 0,
|
||||||
centeredSlides : true,
|
centeredSlides : true,
|
||||||
slideToClickedSlide: true,
|
slideToClickedSlide: true,
|
||||||
speed: 1000,
|
speed: 1000,
|
||||||
autoplay: {
|
autoplay: {
|
||||||
delay: 6000,
|
delay: 6000,
|
||||||
disableOnInteraction: false,
|
disableOnInteraction: false,
|
||||||
},
|
},
|
||||||
navigation: {
|
navigation: {
|
||||||
nextEl: '.about-box4 .swiper-button-next',
|
nextEl: '.about-box4 .swiper-button-next',
|
||||||
prevEl: '.about-box4 .swiper-button-prev',
|
prevEl: '.about-box4 .swiper-button-prev',
|
||||||
},
|
},
|
||||||
on:{
|
on:{
|
||||||
init: function(){
|
init: function(){
|
||||||
$('.about-box4 .lower-box .center-block').hide().eq(initialSlide).show()
|
$('.about-box4 .lower-box .center-block').hide().eq(initialSlide).show()
|
||||||
},
|
},
|
||||||
transitionEnd: function(){
|
transitionEnd: function(){
|
||||||
},
|
},
|
||||||
transitionStart: function(){
|
transitionStart: function(){
|
||||||
$('.about-box4 .lower-box .center-block').hide().eq(this.realIndex).fadeIn()
|
$('.about-box4 .lower-box .center-block').hide().eq(this.realIndex).fadeIn()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
breakpoints: {
|
breakpoints: {
|
||||||
1280: { //当屏幕宽度大于等于1280
|
1280: { //当屏幕宽度大于等于1280
|
||||||
slidesPerView: 3,
|
slidesPerView: 3,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -1,79 +1,79 @@
|
||||||
{php}
|
{php}
|
||||||
//dump($menus);
|
//dump($menus);
|
||||||
function getMenus($menus, $level = 1, $currentFirstId, $categoryId) {
|
function getMenus($menus, $level = 1, $currentFirstId, $categoryId) {
|
||||||
$menuHtml = '';
|
$menuHtml = '';
|
||||||
$levelList = ['nav-first','nav-second','nav-third'];
|
$levelList = ['nav-first','nav-second','nav-third'];
|
||||||
$navClass = $levelList[$level - 1] ?? '';
|
$navClass = $levelList[$level - 1] ?? '';
|
||||||
if (count($menus) > 0) {
|
if (count($menus) > 0) {
|
||||||
$menuHtml .= '';
|
$menuHtml .= '';
|
||||||
if($level > 1) {
|
if($level > 1) {
|
||||||
$menuHtml .= '<div class="'.$navClass.'" >';
|
$menuHtml .= '<div class="'.$navClass.'" >';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach ($menus as $menu) {
|
foreach ($menus as $menu) {
|
||||||
$activeClass = '';
|
$activeClass = '';
|
||||||
if ($currentFirstId == $menu['id'] || $categoryId == $menu['id'] || ($currentFirstId == 0 && $menu['is_index'])) {
|
if ($currentFirstId == $menu['id'] || $categoryId == $menu['id'] || ($currentFirstId == 0 && $menu['is_index'])) {
|
||||||
$activeClass = ' active';
|
$activeClass = ' active';
|
||||||
}
|
}
|
||||||
$aHref = getUri($menu);
|
$aHref = getUri($menu);
|
||||||
$aHref = empty($aHref) ? 'javascript:;' : $aHref;
|
$aHref = empty($aHref) ? 'javascript:;' : $aHref;
|
||||||
$spanClass = '';
|
$spanClass = '';
|
||||||
$hasChild = false;
|
$hasChild = false;
|
||||||
if (isset($menu['children']) && count($menu['children']) > 0) {
|
if (isset($menu['children']) && count($menu['children']) > 0) {
|
||||||
$hasChild = true;
|
$hasChild = true;
|
||||||
$spanClass = 'class="cur"';
|
$spanClass = 'class="cur"';
|
||||||
}
|
}
|
||||||
if($level == 1) {
|
if($level == 1) {
|
||||||
$menuHtml .= '<li class="'.$activeClass.'" >';
|
$menuHtml .= '<li class="'.$activeClass.'" >';
|
||||||
$menuHtml .= '<span '.$spanClass.'><a href="'.$aHref.'" target="'.$menu['style'].'">'.$menu['title'].'</a></span>';
|
$menuHtml .= '<span '.$spanClass.'><a href="'.$aHref.'" target="'.$menu['style'].'">'.$menu['title'].'</a></span>';
|
||||||
if ($hasChild) {
|
if ($hasChild) {
|
||||||
$menuHtml .= getMenus($menu['children'], $level + 1, $currentFirstId, $categoryId);
|
$menuHtml .= getMenus($menu['children'], $level + 1, $currentFirstId, $categoryId);
|
||||||
}
|
}
|
||||||
$menuHtml .= '</li>';
|
$menuHtml .= '</li>';
|
||||||
} else {
|
} else {
|
||||||
if($menu['template_list']=='products'){
|
if($menu['template_list']=='products'){
|
||||||
$menuHtml .= '<a href="'.$aHref.'#product" target="'.$menu['style'].'" class="'.$activeClass.'">';
|
$menuHtml .= '<a href="'.$aHref.'#product" target="'.$menu['style'].'" class="'.$activeClass.'">';
|
||||||
}else if($menu['template_list']=='news'){
|
}else if($menu['template_list']=='news'){
|
||||||
$menuHtml .= '<a href="'.$aHref.'#news" target="'.$menu['style'].'" class="'.$activeClass.'">';
|
$menuHtml .= '<a href="'.$aHref.'#news" target="'.$menu['style'].'" class="'.$activeClass.'">';
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
$menuHtml .= '<a href="'.$aHref.'" target="'.$menu['style'].'" class="'.$activeClass.'">';
|
$menuHtml .= '<a href="'.$aHref.'" target="'.$menu['style'].'" class="'.$activeClass.'">';
|
||||||
}
|
}
|
||||||
$menuHtml .= '<span '.$spanClass.'>'.$menu['title'].'</span>';
|
$menuHtml .= '<span '.$spanClass.'>'.$menu['title'].'</span>';
|
||||||
if ($hasChild) {
|
if ($hasChild) {
|
||||||
$menuHtml .= getMenus($menu['children'], $level + 1, $currentFirstId, $categoryId);
|
$menuHtml .= getMenus($menu['children'], $level + 1, $currentFirstId, $categoryId);
|
||||||
}
|
}
|
||||||
$menuHtml .= '</a>';
|
$menuHtml .= '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($level > 1) {
|
if($level > 1) {
|
||||||
$menuHtml .= '</div>';
|
$menuHtml .= '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $menuHtml;
|
return $menuHtml;
|
||||||
}
|
}
|
||||||
{/php}
|
{/php}
|
||||||
|
|
||||||
<div class="head-box w-100">
|
<div class="head-box w-100">
|
||||||
<div class="w-1500">
|
<div class="w-1500">
|
||||||
<div class="center-block w-100 between-center">
|
<div class="center-block w-100 between-center">
|
||||||
<div class="logo center-center">
|
<div class="logo center-center">
|
||||||
<a href="{:url('/')}"><img src="__IMG__/logo.png"></a>
|
<a href="{:url('/')}"><img src="__IMG__/logo.png"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<ul>
|
<ul>
|
||||||
{:getMenus($menus, 1, $currentFirstId, $categoryId)}
|
{:getMenus($menus, 1, $currentFirstId, $categoryId)}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="language">
|
<!-- <div class="language">
|
||||||
<a href="" class="active">中文</a> / <a href="">English</a>
|
<a href="" class="active">中文</a> / <a href="">English</a>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="nav_btn">
|
<div class="nav_btn">
|
||||||
<i class="bar-top"></i>
|
<i class="bar-top"></i>
|
||||||
<i class="bar-cen"></i>
|
<i class="bar-cen"></i>
|
||||||
<i class="bar-bom"></i>
|
<i class="bar-bom"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue