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

修改后台添加城市的权重,是否显示等 页面bug

... ... @@ -120,6 +120,7 @@ class EnjoyController extends HomeBaseController
$res = Db::name('city_category')
->where('pid','<>',0)
->where('id','<>',CityCategoryModel::xqgh_cc)
->where('id','<>',CityCategoryModel::djxq)
->where('delete_time',0)
->field('id,name')->select()->toArray();
return $res;
... ...
... ... @@ -65,6 +65,20 @@ class IndexController extends HomeBaseController
}
$this->assign('res_xqyy',$res_xqyy);
//推广视频
$position = CityCategoryModel::xqyy;
$city_id = CityCategoryModel::djxq;
$field = 'id,more,thumbnail';
$res_djxq = $this->getVideo($position,$city_id,$field,1);
foreach($res_djxq as &$value){
$video = json_decode($value['more'],true);
$value['video'] = $video['video'];
}
if($res_djxq){
$res_djxq = $res_djxq[0];
}
$this->assign('res_djxq',$res_djxq);
//星域秀场->明星访谈
$position = CityCategoryModel::mxft;
$field = 'id,full_name,position,trade,post_excerpt,thumbnail avatar';
... ... @@ -148,13 +162,38 @@ class IndexController extends HomeBaseController
return $res;
}
//获取推荐视频
public function getVideo($position,$city_id,$field,$limit=''){
$pre = CityCategoryModel::pre;
$limit = empty($limit)?0:$limit;
$post_id = Db::table($pre.'portal_category_post')
->whereIn('category_id',$position)
->field('post_id')
->select()
->toArray();
$post_id = array_column($post_id,'post_id');
//查询文章
$res = Db::table($pre.'portal_post')
->whereIn('id',$post_id)
->where('city_id', $city_id)
->where('delete_time', 0)
->field($field)
->limit($limit)
->order('weigh desc')
->select()
->toArray();
return $res;
}
//获取各洲对应的城市
private function getCity($pid){
$pre = CityCategoryModel::pre;
$res = Db::table($pre.'city_category')
->where('pid',$pid)
->where('is_show',1)
->where('delete_time', 0)
->field('id,pid,name')
->order('weigh desc')
->select()
->toArray();
return $res;
... ...
... ... @@ -54,6 +54,7 @@ class CityCategoryModel extends Model
//城市
const xqgh_cc = 65;//星球故事
const djxq = 68;//独角星球
//五大洲
const asia = 1;//亚洲
... ...
... ... @@ -47,6 +47,20 @@
</div>
<span class="form-required">图片参考尺寸:1920*666</span>
</div>
<div class="form-group">
<label for="input-name">是否显示</label>
<div>
是:<input class="" type="radio" name="is_show" value="1" checked/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
否:<input class="" type="radio" name="is_show" value="0"/>
</div>
</div>
<div class="form-group">
<label for="input-name">权重</label>
<div>
<input type="number" class="form-control" id="input-weigh" name="weigh" value="0">
</div>
</div>
</div>
</div>
... ...
... ... @@ -52,6 +52,20 @@
</div>
<span class="form-required">图片参考尺寸:1920*666</span>
</div>
<div class="form-group">
<label for="input-name">是否显示</label>
<div>
是:<input class="" type="radio" name="is_show" value="1" <eq name="1" value="$category_name.is_show">checked</eq>/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
否:<input class="" type="radio" name="is_show" value="0" <eq name="0" value="$category_name.is_show">checked</eq>/>
</div>
</div>
<div class="form-group">
<label for="input-name">权重</label>
<div>
<input type="number" class="form-control" id="input-weigh" name="weigh" value="{$category_name.weigh}">
</div>
</div>
</div>
</div>
... ...
... ... @@ -31,6 +31,8 @@
<th width="200">ID</th>
<th width="400">分类名称</th>
<th>banner图</th>
<th>是否显示</th>
<th width="200">权重</th>
<th width="210">操作</th>
</tr>
</thead>
... ... @@ -48,6 +50,20 @@
</notempty>
</td>
<td>
<notempty name="vo.is_show">
<span class="label label-success">
显示
</span>
<else/>
<span class="label label-default">
隐藏
</span>
</notempty>
</td>
<td>
<b>{$vo.weigh}</b>
</td>
<td>
<a class="btn btn-xs btn-primary" href="{:url('AdminCityCategory/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
<a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('AdminCityCategory/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
</td>
... ...
... ... @@ -44,7 +44,7 @@
<!-- 头部 -->
<div class="show_main_Tit clearfix">
<h1>{$res.post_title}</h1>
<p>{$res.create_time|date="Y-m-d",###}</p>
<!--<p>{$res.create_time|date="Y-m-d",###}</p>-->
</div>
<!-- 文字内容 -->
<div class="show_main_txt">
... ...
... ... @@ -14,7 +14,7 @@
/*width: 625px;*/
/*height: 648px;*/
/*}*/
.Spot_items, .swiper-slide-prev, .swiper-slide-prev .Spot_item img {
.Walker_main .Spot_items,.Walker_main .swiper-slide-prev,.Walker_main .swiper-slide-prev .Spot_item img {
max-width: 1200px;
}
.Spot_main .swiper-slide-next .Spot_top img {
... ...
... ... @@ -31,7 +31,7 @@
<div class="outdoors">
<div class="outdoors_title clearfix">
<div class="outdoors_title_left fl">{$res.post_title}</div>
<div class="outdoors_title_right fr">{$res.create_time|date="Y-m-d",###}</div>
<!--<div class="outdoors_title_right fr">{$res.create_time|date="Y-m-d",###}</div>-->
</div>
<div class="outdoors_text">
{$res.post_content}
... ...
... ... @@ -44,12 +44,15 @@
margin: auto;
display: block;
height: 100%;
width: 100%;
}
.mask_video img {
width: 30px;
height: 30px;
cursor: pointer;
position: absolute;
right: -100px;
top: -30px;
right: -25px;
top: -27px;
}
</style>
</head>
... ... @@ -59,7 +62,7 @@
<div class="mask" id="mask">
<div class="mask_video" >
<img id="nos" src="__TMPL__/public/assets/starImg/nos.png" alt="">
<video id="video2" src="http://xingqiu.qiniu.brotop.cn/portal/20190513/79713d2ec80f05fcaea36c685494c86b.mp4?e=1558360608&token=UjVH2DxMRL57-Lx4-JFaELCh7icERqJ1NxWf6smj:BgYec03rGPUNK7FcCld3qgrLMk0=&attname=Greenland+-+Rough.+Real+Remote..mp4"></video>
<video id="video2" src="{:cmf_get_file_download_url($res_djxq.video)}"></video>
</div>
</div>
<!-- 侧边 -->
... ... @@ -91,10 +94,10 @@
<!-- 首页主体内容 -->
<div id="star_main">
<!-- 星球奇境 -->
<div class="star_happy" id="star">
<div class="star_happy">
<div>
<span class="happy_title clearfix">
<p>星球<i>奇境</i></p>
<p id="star">星球<i>奇境</i></p>
<p>PLANET DISCOVERY</p>
</span>
<em class="north clearfix">
... ... @@ -668,6 +671,14 @@
</notempty>
<img onclick="bofang()" class="show_in_banner2" src="__TMPL__/public/assets/starImg/aicon_30.png" alt="">
</div>
<!-- 更多按钮 -->
<div class="star_gall_more">
<a href="/portal/region/getMoreVideo">MORE+</a>
</div>
<!-- 人物简介 -->
<notempty name="res_mxft">
<!-- 标题 -->
... ...
... ... @@ -35,7 +35,7 @@
<!-- 头部 -->
<div class="show_main_Tit clearfix">
<h1>{$res.post_title}</h1>
<p>{$res.create_time|date="Y-m-d",###}</p>
<!--<p>{$res.create_time|date="Y-m-d",###}</p>-->
</div>
<!-- 文字内容 -->
<div class="show_main_txt">
... ...
... ... @@ -23,6 +23,7 @@
<body>
<include file="public@header"/>
<!-- 弹出框 -->
<div class="mask">
</div>
... ... @@ -108,29 +109,32 @@
$('video').bind('contextmenu', function() {
return false;
});
//监听播放时间
var video = document.getElementById('video');
//使用事件监听方式捕捉事件
video.addEventListener("timeupdate", function() {
var timeDisplay;
//用秒数来显示当前播放进度
timeDisplay = Math.floor(video.currentTime);
console.log(Math.floor(video.currentTime));
video.addEventListener('play', function() {
video.currentTime = 0;
});
//当视频播放到 15s的时候做处理
if (timeDisplay >= 5) {
//登录
var users = $('#users').val();
if(users == 0){
//监听播放时间
video_mask('您还不是VIP,可试看20秒');
var video = document.getElementById('video');
//使用事件监听方式捕捉事件
video.addEventListener("timeupdate", function() {
var timeDisplay;
//用秒数来显示当前播放进度
timeDisplay = Math.floor(video.currentTime);
console.log(Math.floor(video.currentTime));
video.addEventListener('play', function() {
video.currentTime = 0;
}),
video_mask('1111');
video.pause();
}
}, false);
});
//当视频播放到 15s的时候做处理
if (timeDisplay >= 20) {
video.addEventListener('play', function() {
video.currentTime = 0;
}),
video_mask('会员可观看完整视频');
video.pause();
}
}, false);
}
//默认第一个视频
switch_video(0);
var value = $('#cityName').val();
... ...
... ... @@ -21,7 +21,7 @@
<!-- 内容一 -->
<div class="show_4_con1">
<h1>{$res.post_title}</h1>
<span>{$res.create_time|date="Y-m-d",###}</span>
<!--<span>{$res.create_time|date="Y-m-d",###}</span>-->
<img src="{:cmf_get_image_url($res.image_url)}" alt="">
<div class="show_4_txt">
{$res.post_content}
... ...
... ... @@ -27,7 +27,7 @@
<div class="show6_con_top2">
<h1>{$res.full_name}</h1>
<h2></h2>
<span>{$res.create_time|date="Y-m-d",###}</span>
<!--<span>{$res.create_time|date="Y-m-d",###}</span>-->
<p class="show6_con_top3">
{$res.post_excerpt}
</p>
... ...
... ... @@ -27,7 +27,7 @@
<div class="show6_con_top2">
<h1>{$res.full_name}</h1>
<h2>{$res.position} {$res.trade}</h2>
<span>{$res.create_time|date="Y-m-d",###}</span>
<!--<span>{$res.create_time|date="Y-m-d",###}</span>-->
<p class="show6_con_top3">
{$res.post_excerpt}
</p>
... ...
... ... @@ -27,7 +27,7 @@
<!-- 头部 -->
<div class="show_main_Tit clearfix">
<h1>{$res.post_title}</h1>
<p>{$res.create_time|date="Y-m-d",###}</p>
<!--<p>{$res.create_time|date="Y-m-d",###}</p>-->
</div>
<!-- 文字内容 -->
<div class="show_main_txt">
... ...
... ... @@ -27,7 +27,7 @@
<!-- 头部 -->
<div class="show_main_Tit clearfix">
<h1>{$res.post_title}</h1>
<p>{$res.create_time|date="Y-m-d",###}</p>
<!--<p>{$res.create_time|date="Y-m-d",###}</p>-->
</div>
<!-- 文字内容 -->
<div class="show_main_txt">
... ...
... ... @@ -37,7 +37,7 @@
<!-- 内容 -->
<div class="show_INMain_con2_2 show_5_swiper">
<div >
<div c>
<div>
<div class="show_index_con2Txt clearfix">
<!-- 左侧图片 -->
<img class="show_indexImg1" src="{:cmf_get_image_url($res.thumbnail)}" alt="">
... ...
.mask{
position:fixed;
/*left: 44%;*/
top: 40%;
left: 50%;
transform: translate(-50%,-50%);
-webkit-transform: translate(-50%,-50%);
-o-transform: translate(-50%,-50%);
-moz-transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
top: 52%;
left: 45%;
transform: translate(-52%,-45%);
-webkit-transform: translate(-52%,-45%);
-o-transform: translate(-52%,-45%);
-moz-transform: translate(-52%,-45%);
-ms-transform: translate(-52%,-45%);
display: none;
/*top: 300px;*/
padding: 24px 32px;
... ...
... ... @@ -182,7 +182,7 @@ function video_mask(msg) {
setTimeout(function(){
$('.mask').hide();
$('.mask').text('');
},4000);
},6000);
}
//获取url的参数
... ...