Commit 34887834 by October

dos

parent 28536b7e
...@@ -22,7 +22,7 @@ return array( ...@@ -22,7 +22,7 @@ return array(
'SHOW_PAGE_TRACE' => false, 'SHOW_PAGE_TRACE' => false,
'ERROR_PAGE' =>'/50x.html', '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 'PUBLISH_MODE' => 'development', // development,test,production
......
...@@ -12,6 +12,9 @@ trait ControllerTrait ...@@ -12,6 +12,9 @@ trait ControllerTrait
// $user = M('User')->find(); // $user = M('User')->find();
// return $user; // return $user;
// } // }
// $user = M('User')->find();
// return $user;
$cookie_secret = C('cookie_sign'); $cookie_secret = C('cookie_sign');
$openid = \SignedCookie::get_cookie($this->cookie_uid_key, $cookie_secret, 86400 * 60); $openid = \SignedCookie::get_cookie($this->cookie_uid_key, $cookie_secret, 86400 * 60);
if (!$openid) { if (!$openid) {
...@@ -32,10 +35,12 @@ trait ControllerTrait ...@@ -32,10 +35,12 @@ trait ControllerTrait
$sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://'; $sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
$site_url = $sys_protocal . $_SERVER['HTTP_HOST']; $site_url = $sys_protocal . $_SERVER['HTTP_HOST'];
} }
$callback_url = "{$site_url}/auth"; $callback_url = "{$site_url}/auth";
$state = 1; $state = 1;
SignedCookie::set_cookie("redirect_back", $redirect_url, C('cookie_sign'), 86400 * 60); SignedCookie::set_cookie("redirect_back", $redirect_url, C('cookie_sign'), 86400 * 60);
$auth_url = $helper->auth_url($callback_url, $this->auth_type, $state); $auth_url = $helper->auth_url($callback_url, $this->auth_type, $state);
// var_dump($auth_url);die();
redirect($auth_url); redirect($auth_url);
exit(0); exit(0);
} }
......
...@@ -36,7 +36,7 @@ class IndexController extends Controller ...@@ -36,7 +36,7 @@ class IndexController extends Controller
public function get_random_prize($user) public function get_random_prize($user)
{ {
$v = rand(0, 1000000) / 1000000; $v = rand(0, 1000000) / 1000000;
$today_ratio = 1; $today_ratio = 0.01;
if ($v > $today_ratio) { if ($v > $today_ratio) {
return false; return false;
} }
...@@ -65,7 +65,7 @@ class IndexController extends Controller ...@@ -65,7 +65,7 @@ class IndexController extends Controller
))->save(array( ))->save(array(
'is_get' => 1, 'is_get' => 1,
'uid' => $user['id'], 'uid' => $user['id'],
'take_time' => $now 'add_time' => $now
)); ));
if ($result > 0) { if ($result > 0) {
...@@ -119,6 +119,51 @@ class IndexController extends Controller ...@@ -119,6 +119,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() public function ceshi()
{ {
for ($i = 0; $i < 20; $i++) { for ($i = 0; $i < 20; $i++) {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
{:assign var=projectId value=0} {:assign var=projectId value=0}
{:assign var=rem value=false} {:assign var=rem value=false}
{:assign var=version value='1.0.8'} {:assign var=version value='1.3.0'}
{:block name='projectx'}{:/block} {:block name='projectx'}{:/block}
{:if $rem == true} {:if $rem == true}
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no">
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<body> <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">
<div class="wrap-inner"> <div class="wrap-inner">
{:if $projectId && strpos( $smarty.server.HTTP_HOST , 'dev.izhida.cn') !== false} {:if $projectId && strpos( $smarty.server.HTTP_HOST , 'dev.izhida.cn') !== false}
......
...@@ -41,6 +41,15 @@ body { ...@@ -41,6 +41,15 @@ body {
font-weight: bolder; font-weight: bolder;
} }
input {
font-size: 22px;
padding: 0 10px;
box-sizing: border-box;
color: #748b6c;
border:0;
outline:none;
}
#notification_area { #notification_area {
z-index: 20000; z-index: 20000;
padding: 0; padding: 0;
...@@ -95,8 +104,6 @@ body { ...@@ -95,8 +104,6 @@ body {
width: 640px; width: 640px;
height: 100%; height: 100%;
top: 0; top: 0;
transform: translate(0, 0);
-webkit-transform: translate(0, 0);
} }
.bg { .bg {
...@@ -104,8 +111,6 @@ body { ...@@ -104,8 +111,6 @@ body {
} }
.page { .page {
/* top: 50%;
transform: translate(0, -50%); */
overflow: unset; overflow: unset;
display: none; display: none;
} }
...@@ -124,6 +129,10 @@ body { ...@@ -124,6 +129,10 @@ body {
-webkit-animation: cloud 5s linear infinite; -webkit-animation: cloud 5s linear infinite;
} }
.maruko {
position:fixed;
}
.block { .block {
animation: bounceIn 1s ease backwards; animation: bounceIn 1s ease backwards;
-webkit-animation: bounceIn 1s ease backwards; -webkit-animation: bounceIn 1s ease backwards;
...@@ -139,10 +148,15 @@ body { ...@@ -139,10 +148,15 @@ body {
top: -100%; top: -100%;
} }
canvas { .page7 canvas {
display: none; display: none;
} }
.intro-page {
height: 1238px;
overflow-y: scroll;
}
.leaves-1 { .leaves-1 {
background: url('../image2/leaves-1.png') left top no-repeat; background: url('../image2/leaves-1.png') left top no-repeat;
width: 71px; width: 71px;
...@@ -170,12 +184,7 @@ canvas { ...@@ -170,12 +184,7 @@ canvas {
-webkit-animation: luo 8s 5s ease infinite; -webkit-animation: luo 8s 5s ease infinite;
} }
.rule-page,
.intro-page {
position: fixed;
z-index: 10;
top: 0;
}
.page1 .light { .page1 .light {
animation: point 2s linear infinite; animation: point 2s linear infinite;
...@@ -198,6 +207,11 @@ canvas { ...@@ -198,6 +207,11 @@ canvas {
-webkit-animation: cloud2 5s linear infinite; -webkit-animation: cloud2 5s linear infinite;
} }
.page3 .point {
animation: point 0.5s linear infinite;
-webkit-animation: point 0.5s linear infinite;
}
.first-block, .first-block,
.second-block { .second-block {
z-index: 30; z-index: 30;
......
...@@ -84,6 +84,8 @@ let scrollTimer, ...@@ -84,6 +84,8 @@ let scrollTimer,
let fixHeight = document.documentElement.clientHeight > 1238 ? document.documentElement.clientHeight : 1238; let fixHeight = document.documentElement.clientHeight > 1238 ? document.documentElement.clientHeight : 1238;
let introScrolltop = 0; let introScrolltop = 0;
let submitLock = false;
const guardian = [ const guardian = [
'事事顺意守', '事事顺意守',
'健康祈愿守', '健康祈愿守',
...@@ -137,12 +139,84 @@ $(document).ready(function () { ...@@ -137,12 +139,84 @@ $(document).ready(function () {
$('.page7 .btn-close-second').on('click', hideSecond) $('.page7 .btn-close-second').on('click', hideSecond)
$('.page7 .btn-share').on('click', showShare) $('.page7 .btn-share').on('click', showShare)
$('.share-block').on('click', hideShare) $('.share-block').on('click', hideShare)
// $('.page').on('click', function () { $('.btn-close-first').on('click',hideFirst)
// var audio = document.getElementById('music'); $('.btn-submit').on('click',submitInfo)
// audio.play(); $('.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() { function hideShare() {
$('.share-block').hide(); $('.share-block').hide();
} }
...@@ -159,36 +233,57 @@ function hideSecond() { ...@@ -159,36 +233,57 @@ function hideSecond() {
function hideIntro() { function hideIntro() {
$('.intro-page').hide(); $('.intro-page').hide();
$('.wrap-inner').scrollTop(introScrolltop); // $('.wrap-inner').scrollTop(introScrolltop);
introScrolltop = 0; $('.page1').show();
$('.wrap-inner').scrollTop($('.wrap-inner')[0].scrollHeight)
// introScrolltop = 0;
$('.wrap-inner').css({
height: '100%',
overflowY: 'scroll',
marginTop: '0px',
top: 0
})
} }
function hideRule() { function hideRule() {
// $('.wrap-inner').scrollTop(introScrolltop);
// introScrolltop = 0;
$('.page1').show();
$('.wrap-inner').scrollTop($('.wrap-inner')[0].scrollHeight)
$('.rule-page').hide(); $('.rule-page').hide();
$('.wrap-inner').css({ $('.wrap-inner').css({
height: '100%', height: '100%',
overflowX: 'hidden',
overflowY: 'scroll', overflowY: 'scroll',
transform: 'translate(0,0)', overflowX: 'hidden',
marginTop: '0px',
top: 0, top: 0,
}) })
} }
function showRule() { function showRule() {
// introScrolltop = $('.wrap-inner').scrollTop();
$('.wrap-inner').scrollTop(0)
$('.page1').hide();
$('.rule-page').show(); $('.rule-page').show();
$('.wrap-inner').css({ $('.wrap-inner').css({
height: fixHeight + 'px', height: fixHeight + 'px',
overflowX: 'scroll', overflow: 'hidden',
overflowY: 'hidden', marginTop: '-619px',
transform: 'translate(0,-50%)',
top: '50%' top: '50%'
}) })
} }
function showIntro() { function showIntro() {
introScrolltop = $('.wrap-inner').scrollTop(); // introScrolltop = $('.wrap-inner').scrollTop();
$('.wrap-inner').scrollTop(0) $('.wrap-inner').scrollTop(0);
$('.intro-page').show(); $('.page1').hide();
$('.intro-page').css('height','100%').show();
$('.wrap-inner').css({
height: '100%',
overflow: 'hidden',
marginTop: '0px',
top: 0
})
} }
// function audioAutoPlay(id) { // function audioAutoPlay(id) {
...@@ -222,9 +317,9 @@ function showItem() { ...@@ -222,9 +317,9 @@ function showItem() {
scrollTimer = setTimeout(() => { scrollTimer = setTimeout(() => {
const scrollTop = $('.wrap-inner').scrollTop(); const scrollTop = $('.wrap-inner').scrollTop();
const scrollLeft = $('.wrap-inner').scrollLeft(); const scrollLeft = $('.wrap-inner').scrollLeft();
if (scrollLeft > 0) { // if (scrollLeft > 0) {
$('.maruko').css('left', `${scrollLeft + 180}px`) // $('.maruko').css('left', `${scrollLeft + 180}px`)
} // }
if (nowShowIndex == 1 && scrollTop > 700) { if (nowShowIndex == 1 && scrollTop > 700) {
$('.title,.page1 .cloud').show(); $('.title,.page1 .cloud').show();
nowShowIndex++ nowShowIndex++
...@@ -247,17 +342,24 @@ function toscene(event) { ...@@ -247,17 +342,24 @@ function toscene(event) {
} }
function toPage2() { function toPage2() {
$('.wrap-inner').css({ $('.wrap-inner').css({
height: fixHeight + 'px', height: fixHeight + 'px',
overflowX: 'scroll', overflowX: 'scroll',
overflowY: 'hidden', overflowY: 'hidden',
transform: 'translate(0,-50%)', marginTop: '-619px',
top: '50%' top: '50%'
}) });
$('.maruko').css('top',837 - parseInt(getTranslateDistance()) + 'px')
$('.page1').hide(); $('.page1').hide();
$('.page2').show(); $('.page2').show();
fireworkLock = true; fireworkLock = true;
$('.logo').css({
top: 'inherit',
bottom: getTranslateDistance(20)
})
} }
function toPage3() { function toPage3() {
...@@ -268,7 +370,7 @@ function toPage3() { ...@@ -268,7 +370,7 @@ function toPage3() {
function showResult(event) { function showResult(event) {
window.joinNum++; window.joinNum++;
if (!createPosterLock) { 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') { if (window.pt === '0') {
$.ajax({ $.ajax({
url: '/index/tryprize', url: '/index/tryprize',
...@@ -276,10 +378,14 @@ function showResult(event) { ...@@ -276,10 +378,14 @@ function showResult(event) {
success: function (resp) { success: function (resp) {
if (resp.status == 1) { if (resp.status == 1) {
resultFlag = 10 resultFlag = 10
setTimeout(function(){
$('.page7 .first-block').show(); $('.page7 .first-block').show();
},1000);
window.pt = '1' window.pt = '1'
} else { } else {
setTimeout(function(){
$('.page7 .second-block').show(); $('.page7 .second-block').show();
},1000);
window.pt = '2' window.pt = '2'
} }
createPoster(resultFlag) createPoster(resultFlag)
...@@ -299,7 +405,7 @@ function retry() { ...@@ -299,7 +405,7 @@ function retry() {
height: '100%', height: '100%',
overflowX: 'hidden', overflowX: 'hidden',
overflowY: 'scroll', overflowY: 'scroll',
transform: 'translate(0,0)', marginTop: '0px',
top: 0, top: 0,
}) })
$('.page').hide(); $('.page').hide();
...@@ -320,7 +426,7 @@ function createPoster(resultFlag) { ...@@ -320,7 +426,7 @@ function createPoster(resultFlag) {
posterCanvas = canvasinfo[0]; posterCanvas = canvasinfo[0];
posterCtx = canvasinfo[1]; posterCtx = canvasinfo[1];
var posterObj = new Image(); var posterObj = new Image();
posterObj.src = '/Public/static/image2/result.png'; posterObj.src = '/Public/static/image2/result11.png';
posterObj.onload = function () { posterObj.onload = function () {
posterCtx.drawImage(posterObj, 0, 0, posterCanvas.width, posterCanvas.height); posterCtx.drawImage(posterObj, 0, 0, posterCanvas.width, posterCanvas.height);
...@@ -411,10 +517,8 @@ function getTranslateDistance(cardinal = 0, abs = false) { ...@@ -411,10 +517,8 @@ function getTranslateDistance(cardinal = 0, abs = false) {
function init() { function init() {
inited = true; inited = true;
$('.logo').css({ $('input[name=name]').attr('maxLength',10)
top: 'inherit', $('input[name=tel]').attr('maxLength',11).attr('type','number')
bottom: getTranslateDistance(61)
})
$('.page6').append('<div class="leaves leaves-1"></div><div class="leaves leaves-2"></div><div class="leaves leaves-3"></div>'); $('.page6').append('<div class="leaves leaves-1"></div><div class="leaves leaves-2"></div><div class="leaves leaves-3"></div>');
$('.page1').show(); $('.page1').show();
resizeCanvas(); 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