Commit 00db46f4 by zhangheng

j

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