Commit 34887834 by October

dos

parent 28536b7e
......@@ -22,7 +22,7 @@ return array(
'SHOW_PAGE_TRACE' => false,
'ERROR_PAGE' =>'/50x.html',
'SITE_URL' => 'https://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'moli.gnhj.izhida.cn'),
'SITE_URL' => 'http://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'moli.gnhj.izhida.cn'),
'PUBLISH_MODE' => 'development', // development,test,production
......
......@@ -12,6 +12,9 @@ trait ControllerTrait
// $user = M('User')->find();
// return $user;
// }
// $user = M('User')->find();
// return $user;
$cookie_secret = C('cookie_sign');
$openid = \SignedCookie::get_cookie($this->cookie_uid_key, $cookie_secret, 86400 * 60);
if (!$openid) {
......@@ -32,10 +35,12 @@ trait ControllerTrait
$sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
$site_url = $sys_protocal . $_SERVER['HTTP_HOST'];
}
$callback_url = "{$site_url}/auth";
$state = 1;
SignedCookie::set_cookie("redirect_back", $redirect_url, C('cookie_sign'), 86400 * 60);
$auth_url = $helper->auth_url($callback_url, $this->auth_type, $state);
// var_dump($auth_url);die();
redirect($auth_url);
exit(0);
}
......
......@@ -36,7 +36,7 @@ class IndexController extends Controller
public function get_random_prize($user)
{
$v = rand(0, 1000000) / 1000000;
$today_ratio = 1;
$today_ratio = 0.01;
if ($v > $today_ratio) {
return false;
}
......@@ -65,7 +65,7 @@ class IndexController extends Controller
))->save(array(
'is_get' => 1,
'uid' => $user['id'],
'take_time' => $now
'add_time' => $now
));
if ($result > 0) {
......@@ -118,6 +118,51 @@ class IndexController extends Controller
));
}
}
public function submitInfo(){
$user = $this->get_user_info_from_cookie();
if (!$user) {
$this->ajaxReturn(array(
'status' => 404,
'msg' => '用户信息错误',
'step' => 0
));
return;
}
$name = I('post.name');
$tel = I('post.tel');
$address = I('post.address');
$result = M('user')->where(array(
'id' => $user['id']
))->save(array(
'name' => $name,
'tel' => $tel,
'address' => $address
));
$this->ajaxReturn(array(
'status' => 1,
'msg' => '信息提交成功',
'step' => 0
));
return;
}
public function clear(){
M('prize')->where('1=1')->save(array(
'add_time'=>'',
'is_get' => 0,
'uid' => 0
));
M('user')->where('1=1')->save(array(
'prize_type'=> 0,
'name' => '',
'tel' => '',
'address' => ''
));
}
public function ceshi()
{
......
......@@ -9,7 +9,7 @@
<meta name="format-detection" content="telephone=no">
{:assign var=projectId value=0}
{:assign var=rem value=false}
{:assign var=version value='1.0.8'}
{:assign var=version value='1.3.0'}
{:block name='projectx'}{:/block}
{:if $rem == true}
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no">
......@@ -86,7 +86,7 @@
<body>
<audio src="__CDN__/media/1.mp3" autoplay preload="auto" loop="loop" id="music" style="display:none"></audio>
<audio src="__CDN__/media/3.mp3" autoplay preload="auto" loop="loop" id="music" style="display:none"></audio>
<div class="wrap">
<div class="wrap-inner">
{:if $projectId && strpos( $smarty.server.HTTP_HOST , 'dev.izhida.cn') !== false}
......
......@@ -41,6 +41,15 @@ body {
font-weight: bolder;
}
input {
font-size: 22px;
padding: 0 10px;
box-sizing: border-box;
color: #748b6c;
border:0;
outline:none;
}
#notification_area {
z-index: 20000;
padding: 0;
......@@ -95,8 +104,6 @@ body {
width: 640px;
height: 100%;
top: 0;
transform: translate(0, 0);
-webkit-transform: translate(0, 0);
}
.bg {
......@@ -104,8 +111,6 @@ body {
}
.page {
/* top: 50%;
transform: translate(0, -50%); */
overflow: unset;
display: none;
}
......@@ -124,6 +129,10 @@ body {
-webkit-animation: cloud 5s linear infinite;
}
.maruko {
position:fixed;
}
.block {
animation: bounceIn 1s ease backwards;
-webkit-animation: bounceIn 1s ease backwards;
......@@ -139,10 +148,15 @@ body {
top: -100%;
}
canvas {
.page7 canvas {
display: none;
}
.intro-page {
height: 1238px;
overflow-y: scroll;
}
.leaves-1 {
background: url('../image2/leaves-1.png') left top no-repeat;
width: 71px;
......@@ -170,12 +184,7 @@ canvas {
-webkit-animation: luo 8s 5s ease infinite;
}
.rule-page,
.intro-page {
position: fixed;
z-index: 10;
top: 0;
}
.page1 .light {
animation: point 2s linear infinite;
......@@ -198,6 +207,11 @@ canvas {
-webkit-animation: cloud2 5s linear infinite;
}
.page3 .point {
animation: point 0.5s linear infinite;
-webkit-animation: point 0.5s linear infinite;
}
.first-block,
.second-block {
z-index: 30;
......
......@@ -84,6 +84,8 @@ let scrollTimer,
let fixHeight = document.documentElement.clientHeight > 1238 ? document.documentElement.clientHeight : 1238;
let introScrolltop = 0;
let submitLock = false;
const guardian = [
'事事顺意守',
'健康祈愿守',
......@@ -137,12 +139,84 @@ $(document).ready(function () {
$('.page7 .btn-close-second').on('click', hideSecond)
$('.page7 .btn-share').on('click', showShare)
$('.share-block').on('click', hideShare)
// $('.page').on('click', function () {
// var audio = document.getElementById('music');
// audio.play();
// })
$('.btn-close-first').on('click',hideFirst)
$('.btn-submit').on('click',submitInfo)
$('.page').on('click', function () {
var audio = document.getElementById('music');
audio.play();
})
});
function submitInfo(){
if(!submitLock) {
submitLock = true;
const name = $('input[name=name]').val()
const tel = $('input[name=tel]').val()
const address = $('input[name=address]').val()
if(name.match(/^\s*$/))
{
$('#notification_area').remove();
my_notify('请输入姓名')
return false;
}
if(tel.match(/^\s*$/))
{
$('#notification_area').remove();
my_notify('请输入电话')
return false;
}
if(!tel.match(/^1\d{10}$/))
{
$('#notification_area').remove();
my_notify('电话号码输入有误')
return false;
}
if(address.match(/^\s*$/))
{
$('#notification_area').remove();
my_notify('请输入地址')
return false;
}
$.ajax({
url: '/index/submitInfo',
type: 'POST',
data: {
name: name,
tel: tel,
address: address
},
success: function(resp){
if(resp.status == 1)
{
$('#notification_area').remove();
my_notify('信息已成功提交',2000);
setTimeout(function(){
$('.first-block').hide();
$('#notification_area').remove();
my_notify('请长按页面保存海报');
submitLock = false;
},2000)
}else {
$('#notification_area').remove();
my_notify('网络错误,请重试');
}
}
})
}
}
function hideFirst(){
if(!submitLock)
{
$('.first-block').hide();
$('#notification_area').remove();
my_notify('请长按页面保存海报');
}
}
function hideShare() {
$('.share-block').hide();
}
......@@ -159,36 +233,57 @@ function hideSecond() {
function hideIntro() {
$('.intro-page').hide();
$('.wrap-inner').scrollTop(introScrolltop);
introScrolltop = 0;
// $('.wrap-inner').scrollTop(introScrolltop);
$('.page1').show();
$('.wrap-inner').scrollTop($('.wrap-inner')[0].scrollHeight)
// introScrolltop = 0;
$('.wrap-inner').css({
height: '100%',
overflowY: 'scroll',
marginTop: '0px',
top: 0
})
}
function hideRule() {
// $('.wrap-inner').scrollTop(introScrolltop);
// introScrolltop = 0;
$('.page1').show();
$('.wrap-inner').scrollTop($('.wrap-inner')[0].scrollHeight)
$('.rule-page').hide();
$('.wrap-inner').css({
height: '100%',
overflowX: 'hidden',
overflowY: 'scroll',
transform: 'translate(0,0)',
overflowX: 'hidden',
marginTop: '0px',
top: 0,
})
}
function showRule() {
// introScrolltop = $('.wrap-inner').scrollTop();
$('.wrap-inner').scrollTop(0)
$('.page1').hide();
$('.rule-page').show();
$('.wrap-inner').css({
height: fixHeight + 'px',
overflowX: 'scroll',
overflowY: 'hidden',
transform: 'translate(0,-50%)',
overflow: 'hidden',
marginTop: '-619px',
top: '50%'
})
}
function showIntro() {
introScrolltop = $('.wrap-inner').scrollTop();
$('.wrap-inner').scrollTop(0)
$('.intro-page').show();
// introScrolltop = $('.wrap-inner').scrollTop();
$('.wrap-inner').scrollTop(0);
$('.page1').hide();
$('.intro-page').css('height','100%').show();
$('.wrap-inner').css({
height: '100%',
overflow: 'hidden',
marginTop: '0px',
top: 0
})
}
// function audioAutoPlay(id) {
......@@ -222,9 +317,9 @@ function showItem() {
scrollTimer = setTimeout(() => {
const scrollTop = $('.wrap-inner').scrollTop();
const scrollLeft = $('.wrap-inner').scrollLeft();
if (scrollLeft > 0) {
$('.maruko').css('left', `${scrollLeft + 180}px`)
}
// if (scrollLeft > 0) {
// $('.maruko').css('left', `${scrollLeft + 180}px`)
// }
if (nowShowIndex == 1 && scrollTop > 700) {
$('.title,.page1 .cloud').show();
nowShowIndex++
......@@ -247,17 +342,24 @@ function toscene(event) {
}
function toPage2() {
$('.wrap-inner').css({
height: fixHeight + 'px',
overflowX: 'scroll',
overflowY: 'hidden',
transform: 'translate(0,-50%)',
marginTop: '-619px',
top: '50%'
})
});
$('.maruko').css('top',837 - parseInt(getTranslateDistance()) + 'px')
$('.page1').hide();
$('.page2').show();
fireworkLock = true;
$('.logo').css({
top: 'inherit',
bottom: getTranslateDistance(20)
})
}
function toPage3() {
......@@ -268,7 +370,7 @@ function toPage3() {
function showResult(event) {
window.joinNum++;
if (!createPosterLock) {
const resultFlag = /-(\d)\s/g.exec($(event.target).attr('class'))[1]
let resultFlag = /-(\d)\s/g.exec($(event.target).attr('class'))[1]
if (window.pt === '0') {
$.ajax({
url: '/index/tryprize',
......@@ -276,10 +378,14 @@ function showResult(event) {
success: function (resp) {
if (resp.status == 1) {
resultFlag = 10
$('.page7 .first-block').show();
setTimeout(function(){
$('.page7 .first-block').show();
},1000);
window.pt = '1'
} else {
$('.page7 .second-block').show();
setTimeout(function(){
$('.page7 .second-block').show();
},1000);
window.pt = '2'
}
createPoster(resultFlag)
......@@ -299,7 +405,7 @@ function retry() {
height: '100%',
overflowX: 'hidden',
overflowY: 'scroll',
transform: 'translate(0,0)',
marginTop: '0px',
top: 0,
})
$('.page').hide();
......@@ -320,7 +426,7 @@ function createPoster(resultFlag) {
posterCanvas = canvasinfo[0];
posterCtx = canvasinfo[1];
var posterObj = new Image();
posterObj.src = '/Public/static/image2/result.png';
posterObj.src = '/Public/static/image2/result11.png';
posterObj.onload = function () {
posterCtx.drawImage(posterObj, 0, 0, posterCanvas.width, posterCanvas.height);
......@@ -411,10 +517,8 @@ function getTranslateDistance(cardinal = 0, abs = false) {
function init() {
inited = true;
$('.logo').css({
top: 'inherit',
bottom: getTranslateDistance(61)
})
$('input[name=name]').attr('maxLength',10)
$('input[name=tel]').attr('maxLength',11).attr('type','number')
$('.page6').append('<div class="leaves leaves-1"></div><div class="leaves leaves-2"></div><div class="leaves leaves-3"></div>');
$('.page1').show();
resizeCanvas();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment