Compare commits
2 Commits
75f9dac254
...
14b818db4c
Author | SHA1 | Date |
---|---|---|
yin5th | 14b818db4c | |
yin5th | 90b5d5b700 |
|
@ -31,18 +31,16 @@ class Article extends Base
|
|||
$keywords = $article['seo_keywords'] ?: $this->system['seo_keywords'];
|
||||
$title = $article['seo_title'] ?: $article['title'].' | '.$this->system['seo_title'];
|
||||
|
||||
$pathArr = explode(',', $category['path']);
|
||||
$secondCategoryId = isset($pathArr[3]) && !empty($pathArr[3]) ? $pathArr[3] : $article['category_id'];
|
||||
$secondCategory = Category::getById($secondCategoryId);
|
||||
|
||||
$this->data['images'] = json_decode($article['imgs'], true);
|
||||
$this->data['images'] = json_decode($this->isMobile ? $article['imgs_mobile'] :$article['imgs'], true);
|
||||
|
||||
$this->setSeo($title, $keywords, $description);
|
||||
$this->data['firstBg'] = $this->firstBanner($category);
|
||||
$this->data['item'] = MArticle::parseInfo($article);
|
||||
$this->data['category'] = $category;
|
||||
$this->data['secondInfo'] = $secondCategory;
|
||||
// $this->data['secondInfo'] = $secondCategory;
|
||||
$this->data['categoryId'] = $category['id'];
|
||||
$this->data['categoryPath'] = Category::categoryPath($category['path']);
|
||||
$this->data['topCategoryId'] = Category::firstGradeId($category['path'], $category['id']);
|
||||
$this->detailPrevAndNext($article);
|
||||
$this->detailRecommendList($article, $category['recommend_num']);
|
||||
|
@ -86,7 +84,6 @@ class Article extends Base
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$this->data['prev'] = $prev;
|
||||
$this->data['next'] = $next;
|
||||
}
|
||||
|
@ -118,11 +115,16 @@ class Article extends Base
|
|||
// 自定义分页驱动
|
||||
app('think\App')->bind(Paginator::class, DxtcPageA::class);
|
||||
|
||||
|
||||
$this->data['categoryPath'] = Category::categoryPath($category['path']);
|
||||
$this->data['topCategoryId'] = Category::firstGradeId($category['path'], $categoryId);
|
||||
|
||||
$this->data['items'] = MArticle::getList($categoryId, $category['number'] ?? 10);
|
||||
$items = MArticle::getList($categoryId, $category['number'] ?? 10);
|
||||
foreach ($items as $item) {
|
||||
$item['uri'] = archiveGetUri($item);
|
||||
$item['create_date_d'] = date('d', $item['create_time']);
|
||||
$item['create_date_y_m'] = date('Y.m', $item['create_time']);
|
||||
}
|
||||
$this->data['items'] = $items;
|
||||
$this->data['category'] = $category;
|
||||
|
||||
$this->data['categoryId'] = $categoryId;
|
||||
|
@ -158,5 +160,30 @@ class Article extends Base
|
|||
return $this->json(0, 'ok', $items);
|
||||
}
|
||||
|
||||
//文章列表接口,获取栏目下文章列表
|
||||
public function getList()
|
||||
{
|
||||
$categoryId = input('category_id/d', 0);
|
||||
$page = input('page/d', 1);
|
||||
$size = input('size/d', 10);
|
||||
|
||||
if ($categoryId <= 0) {
|
||||
return $this->json(1, '参数错误');
|
||||
}
|
||||
$category = Category::getById($categoryId);
|
||||
if (empty($category)) {
|
||||
return $this->json(2, '栏目不存在');
|
||||
}
|
||||
|
||||
$items = MArticle::findListByWhere(["category_id" => $categoryId], $page, $size);
|
||||
|
||||
foreach ($items as $item) {
|
||||
$item['uri'] = archiveGetUri($item);
|
||||
$item['create_date_d'] = date('d', $item['create_time']);
|
||||
$item['create_date_y_m'] = date('Y-m', $item['create_time']);
|
||||
$item['src'] = $this->isMobile ? $item['src_mobile'] : $item['src'];
|
||||
}
|
||||
|
||||
return $this->json(0, 'ok', $items);
|
||||
}
|
||||
}
|
|
@ -195,6 +195,16 @@ class Article extends Base
|
|||
$item = input('post.item/a');
|
||||
$img = input('post.img', '');
|
||||
$imgMobile = input('post.img_mobile', '');
|
||||
$imgs = input('post.img_imgs', []);
|
||||
$imgsMobile = input('post.img_imgs_mobile', []);
|
||||
|
||||
$imgs = json_encode($imgs, true);
|
||||
$imgsMobile = json_encode($imgsMobile, true);
|
||||
|
||||
$item['imgs'] = $imgs;
|
||||
$item['imgs_mobile'] = $imgsMobile;
|
||||
// var_dump($item);exit;
|
||||
|
||||
$logo = input('post.img_logo', '');
|
||||
$banner = input('post.img_banner', '');
|
||||
$video = input('post.video', '');
|
||||
|
@ -357,6 +367,8 @@ class Article extends Base
|
|||
}
|
||||
}
|
||||
|
||||
$this->getImgSize($categoryId);
|
||||
|
||||
$this->data['item'] = $article;
|
||||
$this->data['category'] = $category;
|
||||
$this->data['imgSize'] = $imgSize;
|
||||
|
@ -496,6 +508,8 @@ class Article extends Base
|
|||
$imgSize = System::getArticleImageSize();
|
||||
}
|
||||
|
||||
$this->getImgSize($categoryId);
|
||||
|
||||
$this->data['category'] = $category;
|
||||
$this->data['imgSize'] = $imgSize;
|
||||
$this->data['attributeList'] = MArticle::getAttributeList([$categoryId]);
|
||||
|
|
|
@ -86,4 +86,27 @@ class Base extends BaseController
|
|||
|
||||
return $this->redirect(url('manager.error/jump', $result));
|
||||
}
|
||||
|
||||
// 根据活动
|
||||
protected function getImgSize($categoryId)
|
||||
{
|
||||
$pcImgSize = '';//组图
|
||||
$mobileImgSize = '';//手机组图
|
||||
$coverSize = '';//封面图
|
||||
$mobileCoverSize = '';//手机封面图
|
||||
switch ($categoryId) {
|
||||
// 品牌活动
|
||||
case 39:
|
||||
$pcImgSize = '1360*680px';
|
||||
$mobileImgSize = '365*185px';
|
||||
$coverSize = '340*225px';
|
||||
$mobileCoverSize = '185*120px';
|
||||
break;
|
||||
}
|
||||
|
||||
$this->data['pcImgSize'] = $pcImgSize;
|
||||
$this->data['mobileImgSize'] = $mobileImgSize;
|
||||
$this->data['coverSize'] = $coverSize;
|
||||
$this->data['mobileCoverSize'] = $mobileCoverSize;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,13 +31,13 @@ class Article extends Base
|
|||
{
|
||||
$data = [];
|
||||
$recommendCategoryList = [];
|
||||
if(count(array_intersect($categoryIds, $recommendCategoryList)) > 0) {
|
||||
if (count(array_intersect($categoryIds, $recommendCategoryList)) > 0) {
|
||||
$data['recommend'] = '推荐';
|
||||
}
|
||||
|
||||
// 新闻动态
|
||||
$communityCategoryIds = Category::getCategoryWithChildrenIds(Category::CATEGORY_NEWS);
|
||||
if(count(array_intersect($categoryIds, $communityCategoryIds)) > 0) {
|
||||
if (count(array_intersect($categoryIds, $communityCategoryIds)) > 0) {
|
||||
$data['top'] = '置顶';
|
||||
$data['hot'] = '热门';
|
||||
$data['recommend'] = '推荐';
|
||||
|
@ -50,7 +50,6 @@ class Article extends Base
|
|||
*********************************************/
|
||||
|
||||
|
||||
|
||||
//获取最高访问的文章列表
|
||||
public static function getMostVisited($limit = 5)
|
||||
{
|
||||
|
@ -192,7 +191,7 @@ class Article extends Base
|
|||
if (is_array($param) && count($param) > 0) {
|
||||
$pageParam['param'] = $param;
|
||||
foreach ($param as $vo) {
|
||||
if (in_array($vo, ['top', 'hot', 'recommend'], true)) {
|
||||
if (in_array($vo, ['top', 'hot', 'recommend', 'is_prev'], true)) {
|
||||
$whereMap[] = ["{$vo}", '=', 1];
|
||||
}
|
||||
}
|
||||
|
@ -497,6 +496,7 @@ class Article extends Base
|
|||
$createTime = is_numeric($item['create_time']) ? $item['create_time'] : strtotime($item['create_time']);
|
||||
$item['create_date'] = date('Y-m-d', $createTime);
|
||||
$item['create_dateTime'] = date('Y-m-d H:i:s', $createTime);
|
||||
$item['create_y_m_d'] = date('Y.m.d', $createTime);
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ class Article extends Base
|
|||
$categoryIds = Category::where('parent_id', Category::CATEGORY_INFO)->order('sort', 'asc')->column('title', 'id');
|
||||
$list = self::with(["archivesCategory"])
|
||||
->whereIn("category_id", array_keys($categoryIds))
|
||||
->order(["sort"=>"desc","id"=>"desc"])
|
||||
->order(["sort" => "desc", "id" => "desc"])
|
||||
->select();
|
||||
$data = [];
|
||||
foreach ($categoryIds as $categoryId => $title) {
|
||||
|
@ -552,18 +552,18 @@ class Article extends Base
|
|||
public static function getIndexTop($categoryId)
|
||||
{
|
||||
return self::with(["archivesCategory"])
|
||||
->where("category_id",$categoryId)
|
||||
->where("top",1)
|
||||
->order(["sort"=>"desc"])
|
||||
->where("category_id", $categoryId)
|
||||
->where("top", 1)
|
||||
->order(["sort" => "desc"])
|
||||
->find();
|
||||
}
|
||||
|
||||
public static function getIndexList($categoryId,$num)
|
||||
public static function getIndexList($categoryId, $num)
|
||||
{
|
||||
return self::with(["archivesCategory"])
|
||||
->where("category_id",$categoryId)
|
||||
->where("top","<>",1)
|
||||
->order([ 'sort' => 'desc',"id"=>"desc"])
|
||||
->where("category_id", $categoryId)
|
||||
->where("top", "<>", 1)
|
||||
->order(['sort' => 'desc', "id" => "desc"])
|
||||
->limit($num)
|
||||
->select();
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ class Category extends Base
|
|||
{
|
||||
// 文章类
|
||||
// 新闻动态
|
||||
public const CATEGORY_NEWS = 7;
|
||||
public const CATEGORY_NEWS = 22;
|
||||
//企业简介
|
||||
public const CATEGORY_INFO = 3;
|
||||
//团队管理
|
||||
|
@ -20,6 +20,8 @@ class Category extends Base
|
|||
public const CATEGORY_COMPANY_EVENT = 37;
|
||||
// 企业荣誉
|
||||
public const CATEGORY_COMPANY_HONOR = 38;
|
||||
// 品牌活动
|
||||
public const CATEGORY_BRAND_ACTIVITY = 39;
|
||||
//关于我们
|
||||
public const CATEGORY_COMPANY = 2;
|
||||
//物业服务
|
||||
|
@ -494,6 +496,6 @@ class Category extends Base
|
|||
$arr[] = $id;
|
||||
}
|
||||
}
|
||||
return Category::whereIn('id', $arr)->field('id,title,src,src_mobile,path,route')->select()->toArray();
|
||||
return Category::whereIn('id', $arr)->field('id,title,src,src_mobile,path,route,url')->select()->toArray();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ Route::get('/', 'index/index');
|
|||
Route::get('/article/detail/:id', "article/detail")->pattern(['id' => '\d+']);
|
||||
Route::get('article', "article/index");
|
||||
Route::get('position/:id', "position/detail")->pattern(['id' => '\d+']);
|
||||
Route::get('/activity/:id', "article/detail")->pattern(['id' => '\d+']);
|
||||
Route::get('/news/:id', "article/detail")->pattern(['id' => '\d+']);
|
||||
Route::get('/product/detail/:id', "product/detail")->pattern(['id' => '\d+']);
|
||||
Route::rule('articles/ajaxlist', 'article/ajaxList', 'GET|POST');
|
||||
Route::get('articles/:category_id', "article/index");
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
{layout name="layout" /}
|
||||
{php}
|
||||
use app\model\Category;
|
||||
$childrenMenu = Category::getChildrenByParentId($topCategoryId);
|
||||
{/php}
|
||||
|
||||
{include file="public/about_second" /}
|
||||
|
||||
<!-- 活动详情 -->
|
||||
<div class="pull-section pull-content-bg content-bg-white">
|
||||
<div class="activities-detail w1360 wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="detail-top detail-top-cloumn">
|
||||
<!-- 轮播 -->
|
||||
<div class="detail-swiper swiper">
|
||||
<div class="swiper-wrapper">
|
||||
{if !empty($images)}
|
||||
{foreach $images as $img}
|
||||
<div class="swiper-slide">
|
||||
<img src="{$img.src ?? ''}" alt="{$img.title}">
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
<!-- 切换按钮 -->
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
<!-- 分页器 -->
|
||||
<div class="swiper-pagination"></div>
|
||||
</div>
|
||||
<!-- 标题 -->
|
||||
<div class="detai-title detai-title-cloumn">
|
||||
<h1 class="color-blue wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">{$item.title}</h1>
|
||||
<div class="sub-bid wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">{$item.sub_title}</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 详情 -->
|
||||
<div class="activities-detail-txt flex wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="rich-txt color-66 wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
{$item.content|raw}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 上下篇 -->
|
||||
<div class="part-list flex">
|
||||
{if !empty($prev)}
|
||||
<div class="item flex"><strong class="color-blue">上一篇:</strong><a class="clips1" href="/activity/{$prev.id}.html">{$prev['title']}</a></div>
|
||||
{/if}
|
||||
<em></em>
|
||||
{if !empty($next)}
|
||||
<div class="item flex"><strong class="color-blue">下一篇:</strong><a class="clips1" href="/activity/{$next.id}.html">{$next['title']}</a></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,46 +1,45 @@
|
|||
{layout name="layout_two" /}
|
||||
{layout name="layout" /}
|
||||
{php}
|
||||
use app\model\Category;
|
||||
$position = Category::getPosition($category["id"]);
|
||||
use app\model\Block;
|
||||
$childrenMenu = Category::getChildrenByParentId($category['parent_id']);
|
||||
$blocks = Block::getByCategoryId(Category::CATEGORY_NEWS);
|
||||
$blocks = Block::convertValue($blocks);
|
||||
{/php}
|
||||
<div class="bannerdata">
|
||||
<div class="img"><img src="{$category['src']}" alt="{$category['title']}"></div>
|
||||
</div>
|
||||
<div class="searceboxtop">
|
||||
<div class="cont w1360">
|
||||
<div class="navminbox">
|
||||
{$position|raw}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contentboxer">
|
||||
<div class="newsdatabox w1360">
|
||||
<div class="left">
|
||||
<div class="h1">{$item['title']??''}</div>
|
||||
<div class="cion">
|
||||
<div class="p">发布时间:{$item['create_time']|date="Y.m.d"}</div>
|
||||
<div class="p">文章来源:{$item['source']??'中正物业'}</div>
|
||||
<div class="p">浏览:{$item['views']}</div>
|
||||
</div>
|
||||
<div class="text">
|
||||
{$item['content']|raw}
|
||||
</div>
|
||||
<div class="page">
|
||||
<div class="more">
|
||||
{if !empty($prev)}
|
||||
<a href="{:archiveGetUri($prev)}">上一篇:<i>{$prev['title']}</i></a>
|
||||
{/if}
|
||||
{if !empty($next)}
|
||||
<a href="{:archiveGetUri($next)}">下一篇:<i>{$next['title']}</i></a>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="m"><a href="{:getUri($category)}"><i>返回列表</i></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a href="/property-services"><img src="__STATIC__/web/images/img19.jpg" alt=""></a>
|
||||
<a href="/company-profile"><img src="__STATIC__/web/images/img20.jpg" alt=""></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="public/about_second" /}
|
||||
|
||||
<!-- 新闻详情 -->
|
||||
<div class="news-detail-bg w1360 flex wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="news-detail-txt">
|
||||
<h1 class="color-blue wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">{$item.title}</h1>
|
||||
<div class="news-survey color-66 flex wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">
|
||||
<span class="flex"><img src="__STATIC__/web/images/icon/icon-time-detail.png"><em class="pc-show">发布</em>时间:{$item.create_y_m_d}</span>
|
||||
<span class="flex"><img src="__STATIC__/web/images/icon/icon-source.png"><em class="pc-show">文章</em>来源:{$item.source ?: '中正物业'}</span>
|
||||
<span class="flex"><img src="__STATIC__/web/images/icon/icon-browse.png">浏览:{$item.views}</span>
|
||||
</div>
|
||||
<div class="rich-txt wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
{$item.content|raw}
|
||||
</div>
|
||||
<!-- 上下篇 -->
|
||||
<div class="part-list flex">
|
||||
{if !empty($prev)}
|
||||
<div class="item flex"><strong class="color-blue">上一篇:</strong><a class="clips1" href="/news/{$prev.id}.html">{$prev['title']}</a></div>
|
||||
{/if}
|
||||
<em></em>
|
||||
{if !empty($next)}
|
||||
<div class="item flex"><strong class="color-blue">下一篇:</strong><a class="clips1" href="/news/{$next.id}.html">{$next['title']}</a></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="news-side wow fadeInUp pc-show" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<a href="{$blocks['news_detail_right_img_1']['link'] ?: 'javascript:;'}" class="news-side-services color-white wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0" style="background: url({$blocks['news_detail_right_img_1']['value']});">
|
||||
<p class="font-helvetica">{$blocks['news_detail_right_title_en_1']['value']}</p>
|
||||
<span>{:nl2br($blocks['news_detail_right_title_1']['value'])}</span>
|
||||
</a>
|
||||
<div class="news-side-flag color-white wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s" style="background: url({$blocks['news_detail_right_img_2']['value']});">
|
||||
<p>{:nl2br($blocks['news_detail_right_title_2']['value'])}</p>
|
||||
<strong class="uppercase font-helvetica">{$blocks['news_detail_right_title_en_2']['value']}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,129 +1,110 @@
|
|||
{layout name="layout_two"/}
|
||||
{layout name="layout"/}
|
||||
{php}
|
||||
use app\model\Category;
|
||||
use app\model\Article;
|
||||
use app\model\Block;
|
||||
$position = Category::getPosition($category["id"]);
|
||||
$topNews = Article::getLastTopList($category["id"],1,[],["top"=>"desc"]);
|
||||
$topNews = empty($topNews)?[]:$topNews[0];
|
||||
$blocks = Block::getByCategoryId(Category::CATEGORY_NEWS_BLOCK);
|
||||
$blocks = Block::convertValue($blocks);
|
||||
{/php}
|
||||
<div class="bannerdata">
|
||||
<div class="img"><img src="{$category['src']}" alt="{$category['title']}"></div>
|
||||
</div>
|
||||
<div class="searceboxtop">
|
||||
<div class="cont w1360">
|
||||
<div class="navminbox">
|
||||
{$position|raw}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contentboxer">
|
||||
{if !empty($topNews)}
|
||||
<div class="newsboxone">
|
||||
<div class="cont w1360">
|
||||
<a href="{:archiveGetUri($topNews)}" class="a"><div class="img"><img src="{$topNews['src']}" alt="{$topNews['title']}"></div></a>
|
||||
<div class="text">
|
||||
<div class="e wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">{$topNews['create_time']|date="Y.m.d"}</div>
|
||||
<a href="{:archiveGetUri($topNews)}" class="a">
|
||||
<div class="h1 wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">
|
||||
{$topNews['title']}
|
||||
</div></a>
|
||||
<div class="p wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.4s">
|
||||
{$topNews['summary']}
|
||||
</div>
|
||||
<a href="{:archiveGetUri($topNews)}" class="s wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.6s">点击详情 +</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
$childrenMenu = Category::getChildrenByParentId($topCategoryId);
|
||||
$childrenCate = Category::getChildrenByParentId(Category::CATEGORY_NEWS);
|
||||
|
||||
<div class="newslist">
|
||||
<div class="cont w1360">
|
||||
<div class="left">
|
||||
<div id="content">
|
||||
{foreach $items as $item}
|
||||
<div class="li wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<a href="{:archiveGetUri($item)}">
|
||||
<div class="time">
|
||||
<div>
|
||||
<div class="m">{$item['create_time']|date="d"}</div>
|
||||
<div class="f">{$item['create_time']|date="Y-m"}</div>
|
||||
$topNews = Article::getLastTopList($category["id"],1,[],["top"=>"desc"]);
|
||||
if (!$topNews->isEmpty()) {
|
||||
$topNews = empty($topNews)?[]: ($topNews[0] ?? []);
|
||||
$topNewsYm = date('Y.m', $topNews['create_time']);
|
||||
$topNewsDay = date('d', $topNews['create_time']);
|
||||
}
|
||||
{/php}
|
||||
|
||||
{include file="public/about_second" /}
|
||||
|
||||
{include file="public/news_second" /}
|
||||
|
||||
{if !$topNews->isEmpty()}
|
||||
<!-- 推荐新闻 -->
|
||||
<div class="news-first-bg wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<a href="/news/{$topNews.id}.html" class="news-first w1360 bg-col-f5 flex">
|
||||
<div class="img"><img src="{$isMobile ? $topNews['src_mobile'] : $topNews['src']}" alt="{$topNews['title']}"></div>
|
||||
<div class="txt wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="time color-blue">
|
||||
<strong class="pc-show">{$topNewsDay}</strong>
|
||||
<span>{$topNewsYm}<em class="wap-show">.{$topNewsDay}</em></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="h1">{$item['title']}</div>
|
||||
<div class="p">{$item['summary']}</div>
|
||||
<h2 class="color-blue clips1">{$topNews['title']}</h2>
|
||||
<div class="info color-66 clips4">{$topNews['summary']}</div>
|
||||
<span class="article-more-btn color-blue">查看详情<img src="__STATIC__/web/images/icon/icon-arrow-more.png" alt="查看详情"></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- 新闻列表 -->
|
||||
<div class="pull-section pull-content-bg news-list-bg bg-col-f5 wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="news-list w1360">
|
||||
{foreach $items as $item}
|
||||
<a href="/news/{$item.id}.html" class="news-item bg-col-white flex wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="img"><img src="{$isMobile ? $item['src_mobile'] : $item['src']}" alt="{$item.title}"></div>
|
||||
<div class="txt wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<em class="wap-show">{$item.create_date_y_m}.{$item.create_date_d}</em>
|
||||
<h2 class="clips1">{$item.title}</h2>
|
||||
<div class="info color-66 clips4">{$item.summary}</div>
|
||||
<span class="article-more-btn color-blue pc-show">查看详情<img src="__STATIC__/web/images/icon/icon-arrow-more.png" alt="查看详情"></span>
|
||||
</div>
|
||||
<div class="time-bg pc-show">
|
||||
<div class="time color-blue">
|
||||
<img src="__STATIC__/web/images/icon/icon-time.png" alt="日期">
|
||||
<strong>{$item.create_date_d}</strong>
|
||||
<span>{$item.create_date_y_m}<em class="wap-show">.{$item.create_date_d}</em></span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
<div class="more wow fadeInUp" id="more" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<a href="javascript:;">更多+</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
{if !empty($blocks['img_1'])}
|
||||
<a href="{$blocks['img_1']['link']}" class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0"><img src="{$blocks['img_1']['value']}" alt=""></a>
|
||||
{/if}
|
||||
{if !empty($blocks['img_2'])}
|
||||
<a href="{$blocks['img_2']['link']}" class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s"><img src="{$blocks['img_2']['value']}" alt=""></a>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: center;margin-top: 15px;display: none" class="show-msg">没有更多了</div>
|
||||
<!-- 加载更多 -->
|
||||
<div class="load-more-news bg-col-white color-blue get-more-list" data-href="/article/getList?category_id={$category['id']}" data-page="2" data-size="{$category['number'] ?? 10}">点击加载更多</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var page= 2;
|
||||
$("#more").on("click",function () {
|
||||
$.ajax('/article/ajaxList',{
|
||||
data:{
|
||||
category_id:{$category['id']},
|
||||
page:page,
|
||||
},
|
||||
|
||||
dataType:'json',//服务器返回json格式数据
|
||||
type:'post',//HTTP请求类型
|
||||
timeout:10000,//超时时间设置为10秒;
|
||||
success:function(data){
|
||||
if(data.code == 0){
|
||||
if(data.data.length > 0){
|
||||
$('body').on('click', '.get-more-list', function () {
|
||||
let that = $(this);
|
||||
let url = that.data('href');
|
||||
let page = that.data('page');
|
||||
let size = that.data('size');
|
||||
$.post(url, {page: page, size: size}, function (res) {
|
||||
if (res.code === 0) {
|
||||
if (!res.data || res.data.length <= 0) {
|
||||
$('.show-msg').show();
|
||||
setTimeout(function () {
|
||||
$('.show-msg').hide();
|
||||
}, 2000)
|
||||
return false;
|
||||
}
|
||||
let html = '';
|
||||
$.each(data.data,function(i,item){
|
||||
html += `<div class="li ">
|
||||
<a href="${item.uri}">
|
||||
<div class="time">
|
||||
<div>
|
||||
<div class="m">${item.create_date_d}</div>
|
||||
<div class="f">${item.create_date_y_m}</div>
|
||||
$.each(res.data, function (index, item) {
|
||||
html += `
|
||||
<a href="/news/${item.id}.html" class="news-item bg-col-white flex wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="img"><img src="${item.src}" alt="${item.title}"></div>
|
||||
<div class="txt wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<em class="wap-show">${item.create_date_y_m}.${item.create_date_d}</em>
|
||||
<h2 class="clips1">${item.title}</h2>
|
||||
<div class="info color-66 clips4">${item.summary}</div>
|
||||
<span class="article-more-btn color-blue pc-show">查看详情<img src="__STATIC__/web/images/icon/icon-arrow-more.png" alt="查看详情"></span>
|
||||
</div>
|
||||
<div class="time-bg pc-show">
|
||||
<div class="time color-blue">
|
||||
<img src="__STATIC__/web/images/icon/icon-time.png" alt="日期">
|
||||
<strong>${item.create_date_d}</strong>
|
||||
<span>${item.create_date_y_m}<em class="wap-show">.${item.create_date_d}</em></span>
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="h1">${item.title}</div>
|
||||
<div class="p">${item.summary}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>`
|
||||
|
||||
`;
|
||||
})
|
||||
$("#content").append(html);
|
||||
page++;
|
||||
}else{
|
||||
$("#more").remove();
|
||||
that.data('page', page)
|
||||
$('.show-msg').before(html);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
error:function(xhr,type,errorThrown){
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
</script>
|
|
@ -44,7 +44,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">封面图</label>
|
||||
<div class="layui-input-block">
|
||||
{:widget('manager.upload/image',['imgSize' => $imgSize])}
|
||||
{:widget('manager.upload/image',['imgSize' => $imgSize ?: $coverSize])}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -53,7 +53,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">手机封面图</label>
|
||||
<div class="layui-input-block">
|
||||
{:widget('manager.upload/image',['imgSize' => $imgSize, 'append' => '_mobile'])}
|
||||
{:widget('manager.upload/image',['imgSize' => $imgSize ?: $mobileCoverSize, 'append' => '_mobile'])}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -66,11 +66,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{if $allowImgs}
|
||||
{if in_array($category['id'], [39])}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">组图</label>
|
||||
<div class="layui-input-block">
|
||||
{:widget('manager.upload/multi',['append' => '_imgs','imgs' => $item.imgs??'', 'num' => $item.num??10, 'imgSize' => '600px*400px', $item['id']??''])}
|
||||
{:widget('manager.upload/multi',['append' => '_imgs','imgs' => $item.imgs??'', 'num' => $item.num??10, 'imgSize' => $pcImgSize, $item['id']??''])}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-hide">
|
||||
<label class="layui-form-label">组图-手机端</label>
|
||||
<div class="layui-input-block">
|
||||
{//:widget('manager.upload/multi',['append' => '_imgs_mobile','imgs' => $item.imgs_mobile??'', 'num' => $item.num??10, 'imgSize' => $mobileImgSize, $item['id']??''])}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -192,6 +199,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{if $category['id'] == 39}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">活动预告</label>
|
||||
<div class="layui-inline new-inline">
|
||||
<select name="item[is_prev]">
|
||||
<option value="0" selected>否</option>
|
||||
<option value="1">是</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if !(in_array($category['id'],[37,38]))}
|
||||
{if !isset($allowContent) || $allowContent}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
break;
|
||||
}
|
||||
{/php}
|
||||
{:widget('manager.upload/image',['src' => $item.src??'', 'imgSize' => $imgSize])}
|
||||
{:widget('manager.upload/image',['src' => $item.src??'', 'imgSize' => $imgSize ?: $coverSize])}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -64,14 +64,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">手机封面图</label>
|
||||
<div class="layui-input-block">
|
||||
{php}
|
||||
switch ($category['id']) {
|
||||
case 37:
|
||||
$imgSize = '365*135';
|
||||
break;
|
||||
}
|
||||
{/php}
|
||||
{:widget('manager.upload/image',['src' => $item.src_mobile??'','imgSize' => $imgSize, 'append' => '_mobile'])}
|
||||
{:widget('manager.upload/image',['src' => $item.src_mobile??'','imgSize' => $imgSize ?: $mobileCoverSize, 'append' => '_mobile'])}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -84,11 +77,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{if $allowImgs}
|
||||
{if in_array($category['id'], [39])}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">组图</label>
|
||||
<div class="layui-input-block">
|
||||
{:widget('manager.upload/multi',['append' => '_imgs', 'imgs' => $item.imgs??'', 'num' => $item.num??10, 'imgSize' => '600px*400px', $item['id']??''])}
|
||||
{:widget('manager.upload/multi',['append' => '_imgs', 'imgs' => $item.imgs??'', 'num' => $item.num??10, 'imgSize' => $pcImgSize, $item['id']??''])}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-hide">
|
||||
<label class="layui-form-label">组图-手机端</label>
|
||||
<div class="layui-input-block">
|
||||
{//:widget('manager.upload/multi',['append' => '_imgs_mobile','imgs' => $item.imgs_mobile??'', 'num' => $item.num??10, 'imgSize' => $mobileImgSize, $item['id']??''])}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -208,6 +208,17 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{if $category['id'] == 39}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">活动预告</label>
|
||||
<div class="layui-inline new-inline">
|
||||
<select name="item[is_prev]">
|
||||
<option value="0" {if $item['is_prev'] == 0}selected{/if}>否</option>
|
||||
<option value="1" {if $item['is_prev']}selected{/if}>是</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if !(in_array($category['id'],[37,38]))}
|
||||
{if !isset($allowContent) || $allowContent}
|
||||
|
@ -236,7 +247,6 @@
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if $allowTag ?? false}
|
||||
|
|
|
@ -68,6 +68,7 @@ use app\model\Category as VCategory;
|
|||
<col width="150px">
|
||||
{/if}
|
||||
<col width="75px">
|
||||
<col width="75px">
|
||||
<col width="390px">
|
||||
</colgroup>
|
||||
<thead>
|
||||
|
@ -84,6 +85,9 @@ use app\model\Category as VCategory;
|
|||
<td>属性</td>
|
||||
{/if}
|
||||
<td>状态</td>
|
||||
{if $category.id == 39}
|
||||
<td>活动预告</td>
|
||||
{/if}
|
||||
<td>操作</td>
|
||||
</thead>
|
||||
{foreach name="list" item="item"}
|
||||
|
@ -111,6 +115,9 @@ use app\model\Category as VCategory;
|
|||
<td>
|
||||
{$item.status ? '<span class="text-green">正常</span>':'<span class="text-warning">隐藏</span>'}
|
||||
</td>
|
||||
{if $category.id == 39}
|
||||
<td>{$item.is_prev == 1 ? '是' : '否'}</td>
|
||||
{/if}
|
||||
<td>
|
||||
<div style="width: 340px;">
|
||||
{if !empty($attributeList)}
|
||||
|
|
|
@ -20,7 +20,7 @@ use app\service\Image as WImage;
|
|||
<input type="hidden" name="img{$append}[{$k}][src]" value="{$img.src}" class="info-src" />
|
||||
</div>
|
||||
<div class="operate2">
|
||||
<i class="img-change layui-icon" title="替换图片"></i>
|
||||
<!-- <i class="img-change layui-icon" title="替换图片"></i>-->
|
||||
<!-- <i onclick="CHANGE_MULTI_CLOUD_IMG(this)" class="cloud-img-change layui-icon" title="选择替换图片"></i>-->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -55,7 +55,7 @@ use app\service\Image as WImage;
|
|||
</style>
|
||||
<script type="text/javascript">
|
||||
var _token = $('#token').attr('content');
|
||||
var append = $('.append-val').val();
|
||||
var append = "{$append}";
|
||||
var page = 1;
|
||||
|
||||
$(document).on("click", ".layer-photos", function(e) {
|
||||
|
@ -105,7 +105,7 @@ use app\service\Image as WImage;
|
|||
|
||||
$('#upload_img_list{$append}').append('<dd class="item_img" id="img_'+ append + numid +'">'+
|
||||
'<div class="imgs"><div class="operate"><i onclick="UPLOAD_IMG_DEL(this)" class="close layui-icon"></i></div>'+
|
||||
'<img src="' +res.data.thumb_src +'"></div>'+
|
||||
'<img src="' +res.data.src +'"></div>'+
|
||||
'<input type="hidden" name="img{$append}['+numid+'][src]" value="'+ res.data.src +'" />'+
|
||||
'<div class="info">'+ fieldList +'</div></dd>');
|
||||
numid++;
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
{layout name="layout"/}
|
||||
{php}
|
||||
use app\model\Article;
|
||||
use app\model\Category;
|
||||
$childrenMenu = Category::getChildrenByParentId($topCategoryId);
|
||||
$items = Article::getList(Category::CATEGORY_BRAND_ACTIVITY, $category['number'] ?? 4);
|
||||
$previewList = Article::getList(Category::CATEGORY_BRAND_ACTIVITY, 10, null, ['is_prev']);
|
||||
{/php}
|
||||
|
||||
{include file="public/about_second" /}
|
||||
|
||||
<!-- 品牌活动 -->
|
||||
<div class="pull-section brand-activities-bg wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="brand-activities w1360">
|
||||
<div class="profile-title culture-title honor-title activities-title">
|
||||
<p class="capitalize font-helvetica color-blue wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">{$blocks['brand_activity']['value']}</p>
|
||||
<strong class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">{$blocks['brand_activity']['title']}</strong>
|
||||
</div>
|
||||
<div class="activities-list flex">
|
||||
{foreach $items as $item}
|
||||
<a href="/activity/{$item.id}.html" class="activities-item flex wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="img"><img src="{$isMobile ? $item.src_mobile : $item.src}" alt="{$item.title}"></div>
|
||||
<div class="txt bg-col-f5">
|
||||
<h2 class="clips1">{$item.title}</h2>
|
||||
<p class="color-66 clips3">{$item.summary}</p>
|
||||
<span class="article-more-btn color-blue">查看详情<img src="__STATIC__/web/images/icon/icon-arrow-more.png" alt="查看详情"></span>
|
||||
</div>
|
||||
</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center;margin-top: 15px;display: none" class="show-msg">没有更多了</div>
|
||||
<div class="load-more color-66 get-more-list" data-href="/article/getList?category_id={:Category::CATEGORY_BRAND_ACTIVITY}" data-page="2" data-size="{$category['number'] ?? 4}">点击加载更多</div>
|
||||
</div>
|
||||
|
||||
<!-- 活动预告 -->
|
||||
<div class="pull-section pull-content-bg bg-col-f5 wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="profile-title culture-title honor-title activities-title w1360">
|
||||
<p class="capitalize font-helvetica color-blue wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">{$blocks['event_preview']['value']}</p>
|
||||
<strong class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">{$blocks['event_preview']['title']}</strong>
|
||||
</div>
|
||||
<div class="event-preview">
|
||||
<div class="preview-swiper swiper">
|
||||
<div class="swiper-wrapper">
|
||||
{foreach $previewList as $prev}
|
||||
<a href="/activity/{$prev.id}.html" class="preview-item swiper-slide flex">
|
||||
<div class="img"><img src="{$isMobile ? $prev.src_mobile : $prev.src}" alt="{$prev.title}"></div>
|
||||
<div class="txt bg-col-white">
|
||||
<h2 class="clips1">{$prev.title}</h2>
|
||||
<p class="color-66 clips3">{$prev.summary}</p>
|
||||
<span class="article-more-btn color-blue">查看详情<img src="__STATIC__/web/images/icon/icon-arrow-more.png" alt="查看详情"></span>
|
||||
<em class="uppercase font-helvetica pc-show">Events</em>
|
||||
</div>
|
||||
</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
<!-- 切换按钮 -->
|
||||
<div class="swiper-button-prev"><img src="__STATIC__/web/images/icon/icon-preview-btn.png" alt="向前"></div>
|
||||
<div class="swiper-button-next"><img src="__STATIC__/web/images/icon/icon-preview-btn.png" alt="向后"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('body').on('click', '.get-more-list', function () {
|
||||
let that = $(this);
|
||||
let url = that.data('href');
|
||||
let page = that.data('page');
|
||||
let size = that.data('size');
|
||||
$.post(url, {page: page, size: size}, function (res) {
|
||||
if (res.code === 0) {
|
||||
if (!res.data || res.data.length <= 0) {
|
||||
$('.show-msg').show();
|
||||
setTimeout(function () {
|
||||
$('.show-msg').hide();
|
||||
}, 2000)
|
||||
return false;
|
||||
}
|
||||
let html = '';
|
||||
$.each(res.data, function (index, item) {
|
||||
html += `
|
||||
<a href="/activity/id=${item.id}.html" class="activities-item flex wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
<div class="img"><img src="${item.src}" alt="${item.title}"></div>
|
||||
<div class="txt bg-col-f5">
|
||||
<h2 class="clips1">${item.title}</h2>
|
||||
<p class="color-66 clips3">${item.summary}</p>
|
||||
<span class="article-more-btn color-blue">查看详情<img src="__STATIC__/web/images/icon/icon-arrow-more.png" alt="查看详情"></span>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
})
|
||||
page++;
|
||||
that.data('page', page)
|
||||
$('.activities-list').append(html);
|
||||
return false;
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
|
@ -6,13 +6,23 @@
|
|||
<!-- 当前位置 -->
|
||||
<div class="position flex pc-show">
|
||||
<div class="img"><img src="__STATIC__/web/images/icon/icon-position.png" alt="当前位置"></span></div>
|
||||
<div class="txt color-blue flex"><a href="/">首页</a><a href="{$categoryPath[0]['url'] ?: '/company-profile'}">{$categoryPath[0]['title'] ?? ''}</a>{$category.title ?? ''}</div>
|
||||
<div class="txt color-blue flex">
|
||||
<a href="/">首页</a>
|
||||
{foreach $categoryPath as $path}
|
||||
{if !empty($path['url'])}
|
||||
<a href="{$path['url']}">{$path['title'] ?? ''}</a>
|
||||
{else /}
|
||||
<a href="{$path['route'] ?? 'javascript:;'}">{$path['title'] ?? ''}</a>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{$category.title ?? ''}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 二级导航 -->
|
||||
<div class="sub-nav-bg">
|
||||
<div class="sub-nav">
|
||||
{foreach $childrenMenu as $childrenMenuItem}
|
||||
<a href="{:getUri($childrenMenuItem)}" {if $category["id"] ==$childrenMenuItem['id'] }class="active"{/if}>{$childrenMenuItem['title']}</a>
|
||||
<a href="{:getUri($childrenMenuItem)}" {if $category["id"] ==$childrenMenuItem['id'] || $category["parent_id"] ==$childrenMenuItem['id'] }class="active"{/if}>{$childrenMenuItem['title']}</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<!-- 新闻导航 -->
|
||||
<div class="news-nav flex w1360 wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
|
||||
{foreach $childrenCate as $childrenItem}
|
||||
<a href="{:getUri($childrenItem)}" class="bg-col-blue color-white {if $category['id'] == $childrenItem['id']}active{/if}">{$childrenItem['title']}</a>
|
||||
{/foreach}
|
||||
</div>
|
Loading…
Reference in New Issue