落地页视频置顶判断

master
liuweiwen 5 years ago
parent cdeea23034
commit 188abdcbdd

@ -384,6 +384,31 @@
</td> </td>
</tr> </tr>
<tr>
<td class="l">ios视频是否置顶</td>
<if condition="$data['ios_video_top'] eq 1">
<td class="r" >
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="0" name="ios_video_top" > 不置顶
</label>
<label>
<input type="radio" class="inp_radio" value="1" name="ios_video_top" checked="checked"> 置顶
</label></span>
</td>
<else/>
<td class="r" >
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="0" name="ios_video_top" checked="checked"> 不置顶
</label>
<label>
<input type="radio" class="inp_radio" value="1" name="ios_video_top" > 置顶
</label></span>
</td>
</if>
</tr>
<notempty name="data.accredit_img"> <notempty name="data.accredit_img">

@ -179,7 +179,8 @@ class HomeController extends Controller
'game_size', 'game_size',
'introduction', 'introduction',
'flooring_page_video', 'flooring_page_video',
'supersign_status' 'supersign_status',
'ios_video_top'
]; ];
$map = ['id' => intval($gameId)]; $map = ['id' => intval($gameId)];
$game = M('game', 'tab_')->field($columns)->where($map)->find(); $game = M('game', 'tab_')->field($columns)->where($map)->find();

@ -45,6 +45,8 @@
<div class="home"> <div class="home">
<!--落地页视频置顶-->
<?php if ($game['ios_video_top'] == 1):?>
<div class="home-fiexd" <?php if (empty($game['flooring_page_video'])):?> style="height: 0" <?php endif;?> > <div class="home-fiexd" <?php if (empty($game['flooring_page_video'])):?> style="height: 0" <?php endif;?> >
<div class="home-fiexdBox"> <div class="home-fiexdBox">
@ -57,17 +59,29 @@
<div class="fiexd-heard"> <div class="fiexd-heard">
<div class="fiexd-heardBox" style="display: none;"> <div class="fiexd-heardBox" style="display: none;">
<!-- <div>完成</div>--> <!-- <div>完成</div>-->
<img src="{$game['icon']}" alt="" style="ma"> <img src="{$game['icon']}" alt="" style="">
<div class="fiexd-pay">
<!-- <span>App购买</span>-->
<div class="download">下载</div> <div class="download">下载</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!--落地页视频不置顶-->
<?php else:?>
<div class="home-fiexd-two" style="background: #fff;width: 100%;height: 4.22rem;">
<div class="home-video">
<video id="shakeVideo" src="{$game['flooring_page_video']}" autoplay controls muted webkit-playsinline="true" playsinline="true"></video>
</div>
<div class="fiexd-heard" style="width: 100%;position: fixed;top: 0; left: 0;background: rgba(255, 255, 255,0);display: none;">
<div class="fiexd-heardBox">
<img src="{$game['icon']}" alt="" style="">
<div class="download">下载</div>
</div>
</div>
</div>
<?php endif;?>
<div class="home-box"> <div class="home-box">
<div class="heard"> <div class="heard">
@ -335,17 +349,30 @@
<script src="__STATIC__/ios9/js/layer/layer.js?VerNo=20190923" type="text/javascript"></script> <script src="__STATIC__/ios9/js/layer/layer.js?VerNo=20190923" type="text/javascript"></script>
<script> <script>
$(window).scroll(function () { $(window).scroll(function () {
var v = ($(this).scrollTop()) / 100; <?php if ($game['ios_video_top'] == 1):?>
//为什么除以100是因为我希望当$(this).scrollTop()为100的过程中 var v=($(this).scrollTop())/100;
//透明度由0变为1$(this).scrollTop()/100得到的值正好与opacity的范围[0,1]相符合。
$(".fiexd-heardBox").show(); $(".fiexd-heardBox").show();
$('.fiexd-heard').css('backgroundColor', 'rgba(255, 255, 255,' + v + ')'); $('.home-fiexd .fiexd-heard').css('backgroundColor','rgba(255, 255, 255,'+v+')');
var t = $(window).scrollTop(); var t = $(window).scrollTop();
if (t < 10) { if(t<10){
console.log(111) $(".home-fiexd .fiexd-heardBox").hide();
$(".fiexd-heardBox").hide(); }
<?php else:?>
var t = $(window).scrollTop();
var h=$('.home-video').height();
if(t>h){
var v=($(this).scrollTop())/100;
$(".home-fiexd-two .fiexd-heard").show();
$('.home-fiexd-two .fiexd-heard').css('backgroundColor','rgba(255, 255, 255,'+v+')');
}else{
if(t<h){
$(".home-fiexd-two .fiexd-heard").hide();
} }
}
<?php endif;?>
}) })
</script> </script>
@ -355,6 +382,7 @@
<?php if(!empty($game['flooring_page_video'])):?> <?php if(!empty($game['flooring_page_video'])):?>
var video = document.getElementById("shakeVideo"); var video = document.getElementById("shakeVideo");
console.log(video)
video.play(); video.play();
document.addEventListener('WeixinJSBridgeReady',function(){ document.addEventListener('WeixinJSBridgeReady',function(){
video.play(); video.play();

@ -656,3 +656,4 @@ VALUES ('ServerNotice', '游戏区服预告', '0', '', '1', '{\"1\":[\"289\",\"2
--- liuweiwen 2019-12-09 --- liuweiwen 2019-12-09
ALTER TABLE tab_game ADD `flooring_page_video` varchar(150) NOT NULL DEFAULT '' COMMENT '落地页视频'; ALTER TABLE tab_game ADD `flooring_page_video` varchar(150) NOT NULL DEFAULT '' COMMENT '落地页视频';
ALTER TABLE tab_game ADD `supersign_status` tinyint(1) DEFAULT '1' COMMENT '超级签开关1-开启0-关闭'; ALTER TABLE tab_game ADD `supersign_status` tinyint(1) DEFAULT '1' COMMENT '超级签开关1-开启0-关闭';
ALTER TABLE tab_game ADD `ios_video_top` tinyint(1) DEFAULT '1' COMMENT 'ios落地页视频是否置顶1-置顶0-不置顶';

@ -40,6 +40,7 @@
font-size: 0.32rem; font-size: 0.32rem;
color: #007AFF; color: #007AFF;
line-height: 1.2rem; line-height: 1.2rem;
height: 100%;
} }
.fiexd-heardBox>img{ .fiexd-heardBox>img{
width: 0.6rem; width: 0.6rem;
@ -55,7 +56,7 @@
font-size: 0.2rem; font-size: 0.2rem;
margin-right: 0.14rem; margin-right: 0.14rem;
} }
.fiexd-pay>div{ .download{
width: 1.5rem; width: 1.5rem;
height: 0.6rem; height: 0.6rem;
background-color: #007AFF; background-color: #007AFF;
@ -65,7 +66,6 @@
line-height: 0.6rem; line-height: 0.6rem;
color: #fff; color: #fff;
font-weight: 500; font-weight: 500;
margin-top: 0.3rem;
} }
.heard{ .heard{
width: 100%; width: 100%;

Loading…
Cancel
Save