作者 景龙
1 个管道 的构建 通过 耗费 1 秒

增加后台星球故事简介为文本

... ... @@ -147,8 +147,8 @@ class AdminStarStoryController extends AdminBaseController
array_push($data['post']['more']['files'], ["url" => $fileUrl, "name" => $data['file_names'][$key]]);
}
}
$contentModel = new PortalPostModel();
$data['post']['excerpt'] = $contentModel->setPostContentAttr($data['post']['excerpt']);
$portalPostModel->adminAddArticle($data['post'], $data['post']['categories']);
$data['post']['id'] = $portalPostModel->id;
... ... @@ -180,6 +180,9 @@ class AdminStarStoryController extends AdminBaseController
$postCategories = $post->categories()->alias('a')->column('a.name', 'a.id');
$postCategoryIds = implode(',', array_keys($postCategories));
$contentModel = new PortalPostModel();
$post['excerpt'] = $contentModel->getPostContentAttr($post['excerpt']);
$themeModel = new ThemeModel();
$articleThemeFiles = $themeModel->getActionThemeFiles('portal/Article/index');
$this->assign('article_theme_files', $articleThemeFiles);
... ... @@ -232,7 +235,8 @@ class AdminStarStoryController extends AdminBaseController
array_push($data['post']['more']['files'], ["url" => $fileUrl, "name" => $data['file_names'][$key]]);
}
}
$contentModel = new PortalPostModel();
$data['post']['excerpt'] = $contentModel->setPostContentAttr($data['post']['excerpt']);
$portalPostModel->adminEditArticle($data['post'], $data['post']['categories']);
$hookParam = [
... ...
... ... @@ -28,6 +28,10 @@ class EnjoyController extends HomeBaseController
$city_name = $this->getCityName();
$this->assign('city_name',$city_name);
//城市名字
$star = new StarController();
$cityName = $star->getCityName($city_id);
$this->assign('cityName',$cityName);
//亲临现场
$position['category_id'] = CityCategoryModel::qlxc;
$field = 'id,thumbnail,post_title,post_excerpt';
... ...
... ... @@ -12,6 +12,7 @@ namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use app\portal\model\CityCategoryModel;
use app\portal\model\PortalPostModel;
use think\Db;
//星域秀场
class RegionController extends HomeBaseController
... ... @@ -43,11 +44,13 @@ class RegionController extends HomeBaseController
//星球故事
$position['category_id'] = CityCategoryModel::xqgs;
$field = 'id,thumbnail,post_excerpt,more';
$field = 'id,thumbnail,post_excerpt,more,excerpt';
$res_xqgs = $this->getChildArticle($position,$field,$this->index_limit);
foreach($res_xqgs as &$value){
$more = json_decode($value['more'],true);
$value['audio'] = isset($more['audio']) && !empty($more['audio'])?$more['audio']:'';
$contentModel = new PortalPostModel();
$value['excerpt'] = $contentModel->getPostContentAttr($value['excerpt']);
}
$this->assign('res_xqgs',$res_xqgs);
... ... @@ -138,6 +141,11 @@ class RegionController extends HomeBaseController
//星球影院更多(按照城市查询)
public function getMoreVideo(){
$city_id = $this->request->param('city_id',0,'intval');
//城市名字
$star = new StarController();
$cityName = $star->getCityName($city_id);
$this->assign('cityName',$cityName);
$position['city_id'] = $city_id;
$position['category_id'] = CityCategoryModel::xqyy;
$field = 'id,post_title,framing,release_time,city_id,more,thumbnail';
... ... @@ -183,11 +191,13 @@ class RegionController extends HomeBaseController
//星球故事更多
public function getMoreStory(){
$position['category_id'] = CityCategoryModel::xqgs;
$field = 'id,thumbnail,post_excerpt,more,create_time';
$field = 'id,thumbnail,post_excerpt,more,create_time,excerpt';
$res = $this->getChildArticlePage($position,$field);
foreach($res['data']['data'] as &$value){
$more = json_decode($value['more'],true);
$value['audio'] = isset($more['audio']) && !empty($more['audio'])?$more['audio']:'';
$contentModel = new PortalPostModel();
$value['excerpt'] = $contentModel->getPostContentAttr($value['excerpt']);
}
$this->assign('res',$res['data']);
$this->assign('page',$res['page']);
... ...
... ... @@ -36,13 +36,15 @@ class StarController extends HomeBaseController
//星球故事
$position['category_id'] = CityCategoryModel::xqgs;
$field = 'id,thumbnail,post_excerpt,more';
$field = 'id,thumbnail,post_excerpt,more,excerpt';
$res_xqgs = $this->getChildArticle($position,$field,1);
foreach($res_xqgs as &$value){
$more = json_decode($value['more'],true);
if(isset($more['audio']) && !empty($more['audio'])){
$value['audio'] = $more['audio'];
}
$contentModel = new PortalPostModel();
$value['excerpt'] = $contentModel->getPostContentAttr($value['excerpt']);
}
if($res_xqgs){
$res_xqgs = $res_xqgs[0];
... ... @@ -317,11 +319,13 @@ class StarController extends HomeBaseController
//星球故事详情
public function getStoryDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more,excerpt';
$res = $this->getDetail($id,$field);
if($res){
$more = json_decode($res['more'],true);
$res['audio'] = isset($more['audio']) && !empty($more['audio'])?$more['audio']:'';
$contentModel = new PortalPostModel();
$res['excerpt'] = $contentModel->getPostContentAttr($res['excerpt']);
}
$this->assign('res',$res);
return $this->fetch();
... ...
... ... @@ -17,12 +17,12 @@ class AdminStarStoryValidate extends Validate
protected $rule = [
'city_id' => 'require',
'post_title' => 'require',
'post_excerpt' => 'require',
// 'excerpt' => 'require',
];
protected $message = [
'city_id.require' => '请选择城市!',
'post_title.require' => '文章标题不能为空!',
'post_excerpt.require' => '文章简介不能为空!',
// 'excerpt.require' => '文章简介不能为空!',
];
... ...
... ... @@ -59,8 +59,7 @@
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
placeholder="请填写简介"></textarea>
<script type="text/plain" id="excerpt" name="post[excerpt]"></script>
</td>
</tr>
<tr>
... ... @@ -158,7 +157,12 @@
editorcontent.sync();
} catch (err) {
}
editorcontent1 = new baidu.editor.ui.Editor();
editorcontent1.render('excerpt');
try {
editorcontent1.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
... ...
... ... @@ -63,8 +63,7 @@
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
placeholder="请填写简介">{$post.post_excerpt}</textarea>
<script type="text/plain" id="excerpt" name="post[excerpt]">{$post.excerpt}</script>
</td>
</tr>
<tr>
... ... @@ -190,6 +189,13 @@
} catch (err) {
}
editorcontent1 = new baidu.editor.ui.Editor();
editorcontent1.render('excerpt');
try {
editorcontent1.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
... ...
... ... @@ -40,14 +40,21 @@
<!--</volist>-->
<!--</select>-->
<div class="select">
<input type="text" value="中国" readonly="readonly">
<input type="hidden" value="{$cityName}" id="cityName">
<form method="GET" action="/portal/enjoy/index">
<input class="show_city" type="text" value="所有" readonly="readonly">
<img src="__TMPL__/public/assets/starImg/down.png" alt="">
<ul style="height:300px;overflow-y: scroll;width:240px;">
<li>所有</li>
<volist name="city_name" id="vo">
<li value="{$vo.id}" <eq name="$vo.id" value="$city_id">selected</eq>>{$vo.name}</li>
<li value="{$vo.id}">{$vo.name}</li>
</volist>
</ul>
<input type="hidden" value="0" name="city_id" id="city_id">
<div style="display:none;">
<input type="submit" id="city_submit"/>
</div>
</form>
</div>
</div>
<!--亲临现场-->
... ... @@ -266,6 +273,14 @@
<script src="__TMPL__/public/assets/js/public.js"></script>
<script>
$(function(){
var value = $('#cityName').val();
if(value != ''){
$('.show_city').val(value);
}else{
$('.show_city').val('所有');
}
$('.select input').click(function() {
if ($(this).next('img').attr('src') == "__TMPL__/public/assets/starImg/down.png") {
$(this).next('img').attr('src', "__TMPL__/public/assets/starImg/up.png")
... ... @@ -277,21 +292,18 @@
});
//点击下拉框事件
$('.select ul li').click(function() {
$('.select input').val($(this).text());
$('.show_city').val($(this).text());
$('.select ul').hide();
var index = $(this).index();
$('#city_id').val($(this).val());
$('.curren').eq(index).addClass('video_active').siblings().removeClass('video_active');
});
$(document).ready(function() {
var val = $('.select input').val();
var val2 = $('.select ul li:first-child').text();
val = val2;
$('.select input').val(val)
$('form').submit();
});
var swiper = new Swiper('.Spot_main .swiper-container', {
slidesPerView: 2,
spaceBetween: 50,
... ... @@ -325,6 +337,7 @@
},
});
});
</script>
</body>
... ...
... ... @@ -31,7 +31,7 @@
<img class="show_indexImg1" src="{:cmf_get_image_url($vo.thumbnail)}" alt="">
<!-- 文字 -->
<div class="show_index_con2Txt2">
{$vo.post_excerpt}
{$vo.excerpt}
</div>
<!-- 进度条 -->
<div class="show_index_progress">
... ...
... ... @@ -27,17 +27,24 @@
<!-- 顶部 -->
<div class="show_9_video_asideTie clearfix">
<p>专辑</p>
<input type="hidden" value="{$cityName}" id="cityName">
<form method="GET" action="/portal/region/getMoreVideo">
<div class="select">
<input type="text" value="所有" readonly="readonly">
<input type="text" class="show_city" value="所有" readonly="readonly">
<img src="__TMPL__/public/assets/starImg/down.png" alt="">
<ul style="height:300px;overflow-y: scroll;width:145px;">
<li>所有</li>
<volist name="city_name" id="vo">
<li value="{$vo.id}" <eq name="$vo.id" value="$city_id">selected</eq>>{$vo.name}</li>
<li value="{$vo.id}">{$vo.name}</li>
</volist>
</ul>
<input type="hidden" value="0" name="city_id" id="city_id">
<div style="display:none;">
<input type="submit" id="city_submit"/>
</div>
</div>
</form>
</div>
<!-- 视频 -->
<div class="show_9_video_asideCon">
<ul class="curren">
... ... @@ -87,6 +94,13 @@
$(function() {
//默认第一个视频
switch_video(0);
var value = $('#cityName').val();
if(value != ''){
$('.show_city').val(value);
}else{
$('.show_city').val('所有');
}
$('.curren').children('li').children('.li_img').css('opacity','0.3');
$('.curren').children('li').eq(0).children('.li_img').css('opacity','1');
... ... @@ -97,8 +111,6 @@
$('.curren').children('li').children('.li_img').css('opacity','0.3');
$('.curren').children('li').children('p').css('color','rgba(153, 153, 153, 1)');
switch_video(index);
});
//鼠标滑过
... ... @@ -123,8 +135,12 @@
//下拉框选择城市
$('.select ul li').click(function() {
var index = $(this).index();
console.log(index);
$('.show_city').val($(this).text());
$('.select ul').hide();
$('#city_id').val($(this).val());
$('form').submit();
});
// 弹出框
... ... @@ -146,8 +162,14 @@
var oneVideo = li_index.children('.li_video').val();
$('#video').attr('src',oneVideo);
// 视频封面图
$('.video_poster').css('z-index', '10');
var oneCover = li_index.children('.li_img').attr('src');
$('.video_poster').attr('src',oneCover);
$('.play_button').css({
'z-index': "11",
"display":"block"
});
//标题,国家,取景,上映时间
var post_title = li_index.children('.li_post_title').val();
var city_name = li_index.children('.li_city_name').val();
... ...
... ... @@ -88,7 +88,7 @@
<img class="show_indexImg1" src="{:cmf_get_image_url($vo.thumbnail)}" alt="">
<!-- 文字 -->
<div class="show_index_con2Txt2">
{$vo.post_excerpt}
{$vo.excerpt}
</div>
<!-- 进度条 -->
<div class="show_index_progress">
... ...
... ... @@ -54,15 +54,15 @@
<!--</div>-->
<!--</div>-->
<!-- 内容 -->
<div class="show_INMain_con2_2 swiper-container2 show_5_swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="show_INMain_con2_2 show_5_swiper">
<div >
<div c>
<div class="show_index_con2Txt clearfix">
<!-- 左侧图片 -->
<img class="show_indexImg1" src="{:cmf_get_image_url($res.thumbnail)}" alt="">
<!-- 文字 -->
<div class="show_index_con2Txt2">
{$res.post_excerpt}
{$res.excerpt}
</div>
<!-- 进度条 -->
<div class="show_index_progress">
... ... @@ -89,15 +89,15 @@
<script src="__TMPL__/public/assets/js/public.js"></script>
<script>
// 星球故事swiper
var swiper = new Swiper('.swiper-container2', {
slidesPerView: 1,
spaceBetween: 30,
// loop: true,
pagination: {
el: '.swiper-pagination',
clickable: true,
},
});
// var swiper = new Swiper('.swiper-container2', {
// slidesPerView: 1,
// spaceBetween: 30,
// // loop: true,
// pagination: {
// el: '.swiper-pagination',
// clickable: true,
// },
// });
</script>
</body>
... ...
... ... @@ -56,7 +56,7 @@
<img class="show_indexImg1" src="{:cmf_get_image_url($res_xqgs.thumbnail)}" alt="">
<!-- 文字 -->
<div class="show_index_con2Txt2">
{$res_xqgs.post_excerpt}
{$res_xqgs.excerpt}
</div>
<!-- 进度条 -->
<div class="show_index_progress">
... ...
... ... @@ -304,21 +304,24 @@ body {
}
.show_index_con2Txt2 {
width: 712px;
height:252px;
width: 760px;
height:350px;
float: left;
padding-top: 24px;
box-sizing: border-box;
margin-left: 39px;
margin-top: 43px;
/*margin-top: 43px;*/
font-size: 16px;
overflow: hidden;
overflow-y: visible;
color: rgba(102, 102, 102, 1);
line-height: 28px;
/*line-height: 28px;*/
}
.show_index_con2Txt2::-webkit-scrollbar {display:none}
.show_index_progress {
width: 800px;
height: 50px;
float: left;
margin-top: 55px;
background: rgba(225, 225, 230, 1);
}
... ...