Commit 00db46f4 by zhangheng

j

parent c851b4ed
...@@ -103,6 +103,7 @@ trait ControllerTrait ...@@ -103,6 +103,7 @@ trait ControllerTrait
// $user['reg_ip'] = $this->getIP(); // $user['reg_ip'] = $this->getIP();
// $user['last_visit'] = time(); // $user['last_visit'] = time();
$user['play_num'] =2;
$user['last_ip'] = $this->getIP(); $user['last_ip'] = $this->getIP();
M('User')->token(false)->add($user); M('User')->token(false)->add($user);
} }
......
...@@ -46,7 +46,7 @@ class IndexController extends Controller ...@@ -46,7 +46,7 @@ class IndexController extends Controller
'id'=>1 'id'=>1
))->getField('sate'); ))->getField('sate');
if($openSate==0){ if($openSate==0){
die(); die("活动未开始!");
} }
$user = $this->get_user_info_from_cookie(); $user = $this->get_user_info_from_cookie();
if (!$user) { if (!$user) {
...@@ -126,13 +126,13 @@ class IndexController extends Controller ...@@ -126,13 +126,13 @@ class IndexController extends Controller
)); ));
return; return;
} }
// if($user['play_num']==0){ if($user['play_num']==0){
// $this->ajaxReturn(array( $this->ajaxReturn(array(
// 'errcode' => 2, 'errcode' => 2,
// 'errmsg' => null 'errmsg' => null
// )); ));
// return; return;
// } }
$type_list = array('6JTjh8cPcQ6Rh4Zs','wrwSQkP7aBSTSz6Q','DQxcxExXHmrrJhpW','Mx7cz5zBhJ4XTWWw','BnFaQJ23ddQ6CcfG','4fzkwfPHZZZmnQJx','NCnWMkSN5jSBErP6','Ce238NWT3GAkmXNB','7QnGFjs7JDxWe2xQ','5Qtk2aKHsG42PbRz'); $type_list = array('6JTjh8cPcQ6Rh4Zs','wrwSQkP7aBSTSz6Q','DQxcxExXHmrrJhpW','Mx7cz5zBhJ4XTWWw','BnFaQJ23ddQ6CcfG','4fzkwfPHZZZmnQJx','NCnWMkSN5jSBErP6','Ce238NWT3GAkmXNB','7QnGFjs7JDxWe2xQ','5Qtk2aKHsG42PbRz');
$channel_urt=$_POST['channel']; $channel_urt=$_POST['channel'];
$c_z=in_array($channel_urt,$type_list); $c_z=in_array($channel_urt,$type_list);
...@@ -146,9 +146,6 @@ class IndexController extends Controller ...@@ -146,9 +146,6 @@ class IndexController extends Controller
)); ));
return; return;
} }
M('User')->where(array(
'id' => $user['id']
))->setDec('play_num');
$channel=M('Prize')->where(array( $channel=M('Prize')->where(array(
'channel'=>$channel_urt 'channel'=>$channel_urt
))->find(); ))->find();
...@@ -176,7 +173,9 @@ class IndexController extends Controller ...@@ -176,7 +173,9 @@ class IndexController extends Controller
)); ));
return; return;
} }
M('User')->where(array(
'id' => $user['id']
))->setDec('play_num');
$prize = $this->get_random_prize($user,$channel_urt); $prize = $this->get_random_prize($user,$channel_urt);
if ($prize) { if ($prize) {
$this->ajaxReturn(array( $this->ajaxReturn(array(
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
// })(document, window); // })(document, window);
</script> </script>
<title>谁是桃源幸运锦鲤</title> <title>谁是桃源幸运锦鲤</title>
<link href="__CDN__/css/main.css?t=1.94" rel="stylesheet"> <link href="__CDN__/css/main.css?t=2" rel="stylesheet">
<style> <style>
</style> </style>
...@@ -51,14 +51,11 @@ ...@@ -51,14 +51,11 @@
<body> <body>
<div id="container"> <div id="container">
<div class="map-bj">
<span>正在开奖...</span>
<div class="btn-prize" style="display: none"> <img src="__CDN__/images/prize.png">
点击抽奖
</div> </div>
<img class="prize-type" src="__CDN__/images/prize.png" style="display: none"> <img class="prize-type" src="__CDN__/images/prize.png" style="display: none">
</div> </div>
<script> <script>
if (!/android/i.test(navigator.userAgent)) { if (!/android/i.test(navigator.userAgent)) {
...@@ -76,7 +73,7 @@ ...@@ -76,7 +73,7 @@
src="http://api2.izhida.cn/wechat_js_config?app_id=wx4c3c856ab83a946b&v=1.2.1&api_list=all&app_stat_key=t6NkwipRePFcidTJ"></script> src="http://api2.izhida.cn/wechat_js_config?app_id=wx4c3c856ab83a946b&v=1.2.1&api_list=all&app_stat_key=t6NkwipRePFcidTJ"></script>
<script type="text/javascript" src="__CDN__/js/jquery.qrcode.min.js"></script> <script type="text/javascript" src="__CDN__/js/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="__CDN__/js/index.js?t=1.54"></script> <script type="text/javascript" src="__CDN__/js/index.js?t=2"></script>
<link href="__CDN__/css/notify.css" rel="stylesheet"> <link href="__CDN__/css/notify.css" rel="stylesheet">
<script type="text/javascript" src="__CDN__/js/jquery-notify.js"></script> <script type="text/javascript" src="__CDN__/js/jquery-notify.js"></script>
......
...@@ -158,7 +158,7 @@ ul, li { ...@@ -158,7 +158,7 @@ ul, li {
height: 100%; height: 100%;
} }
.flex, #container .btn-prize { .flex {
display: -webkit-box; display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */ /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; display: -moz-box;
...@@ -173,29 +173,25 @@ ul, li { ...@@ -173,29 +173,25 @@ ul, li {
#container { #container {
position: relative; position: relative;
background: url("../images/bj.jpg") no-repeat center;
width: 640px; width: 640px;
height: 1238px; height: 1238px;
} }
#container .btn-prize { #container .map-bj {
background: url("../images/btn-prize.png") no-repeat center;
background-size: 100% 100%;
position: absolute; position: absolute;
top: 460px; top: 398px;
left: 182px; }
justify-content: center; #container .map-bj img {
align-items: center; width: 314px;
width: 250px; height: 312px;
height: 250px; }
font-size: 35px; #container .map-bj span {
color: red; font-size: 30px;
font-weight: bold; color: #e9674f;
} }
#container .prize-type { #container .prize-type {
position: absolute; position: absolute;
width: 250px; width: 250px;
height: 250px; height: 250px;
/* opacity: 0; */
top: 420px; top: 420px;
left: 182px; left: 182px;
} }
......
...@@ -195,36 +195,28 @@ ul, li { ...@@ -195,36 +195,28 @@ ul, li {
#container { #container {
position: relative; position: relative;
background: url("../images/bj.jpg") no-repeat center;
width: torem(640px); width: torem(640px);
height: torem(1238px); height: torem(1238px);
.btn-prize { .map-bj {
background: url("../images/btn-prize.png") no-repeat center;
background-size: 100% 100%;
position: absolute; position: absolute;
top: 460px; top:torem(398px);
left: 182px; img {
@extend .flex; width: torem(314px);
justify-content: center; height: torem(312px);
align-items: center; }
width: 250px; span{
height: 250px; font-size: 30px;
font-size: 35px; color: #e9674f;
color: red; }
font-weight: bold;
} }
.prize-type { .prize-type {
position: absolute; position: absolute;
width: 250px; width: 250px;
height: 250px; height: 250px;
/* opacity: 0; */
top: 420px; top: 420px;
left: 182px; left: 182px;
//.bounceInDown {
// -webkit-animation: bounceInDown 1s ease 0s 1;
// @include animate_forwards;
// opacity: 0;
//}
} }
.word { .word {
font-size: 40px; font-size: 40px;
......
var prize_word=[
'家和万事兴',
'和谐美满',
'和和美美',
'和和睦睦 ',
'和气生财',
'和蔼可亲'
];
var prize_lock=1;
$(document).ready(function () { $(document).ready(function () {
try { try {
...@@ -20,21 +12,14 @@ $(document).ready(function () { ...@@ -20,21 +12,14 @@ $(document).ready(function () {
this.css('z-index', window['max_zindex']); this.css('z-index', window['max_zindex']);
this.show(); this.show();
}; };
if(window.type==1){ // if(window.type==1){
$('.prize-type').show(); // $('.prize-type').show();
}else { // }else {
$('.btn-prize').show(); // $('.btn-prize').show();
} // }
$('.btn-prize').on('click',function () {
if(prize_lock==2){
return;
}
btnPrize();
});
}); });
function btnPrize() { function btnPrize() {
prize_lock=2;
$('.btn-prize').text('抽奖中...');
$.ajax({ $.ajax({
url: '/index/tryPrize', url: '/index/tryPrize',
type: 'post', type: 'post',
......
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