bhq@iemsoft.cn
2018-11-27 e2b48dac099e43f4b3243cdf19a7522e4b5eccbe
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>大转盘</title>
    <meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1">
    <style>
        *{padding: 0; margin: 0;}
        body{ background:url(dzp/bg.png);}
        .grid{ width: 320px; margin: 0 auto; position: relative; overflow: hidden;}
        #banner{
            width:270px;
            height: 270px;
            background: url(dzp/1.png) no-repeat;
            -webkit-background-size: 270px auto;
            background-size: 270px auto;
            overflow: hidden;
            margin: 0 auto;
            position:relative;
          }
            #banner .inner{
                height: 255px;
                width: 255px;
                background:url(dzp/2.png);
                margin: 0 auto;
                -webkit-background-size: 255px auto;
                background-size: 255px auto;
                position: relative;
            }
            
            #banner #zhen{
                height: 224px;
                width: 112px;
                position: absolute;
                left: 50%;
                top: 15px;
                margin-left: -56px;
                background: url(dzp/3.png);
            }
 
 
          .block{
              background-color: #FFF9B3;
              border: 2px solid #306931;
              margin:0 10px 10px 10px;
              border-radius: 8px;
              padding: 8px;
              position: relative;
              font-size: 12px;
          }
          .block .title{
              font-size: 16px;
              line-height: 24px;
              background:url(dzp/tit.png) no-repeat;
              padding-left: 7px;
              width: 123px;
              color: #fff;
              height: 24px;
              -webkit-background-size: 123px auto;
              background-size: 123px auto;
          }
          .block p{
              line-height: 22px;
              font-size: 14px;
              line-height: 30px;
          }
        
 
        #mask{
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 5;
            background: rgba(0,0,0,.4);
            display: none;
        }
        #dialog{
            position: absolute;
            top: 50%;
            left: 50%;
            height: 100px;
            width: 276px;
            margin-left: -150px;
            margin-top: -50px;
 
            border: 2px solid #306931;
            padding: 10px;
            background-color: #fff;
            display: none;
            z-index: 6;
            font-weight: bold;
            font-size: 20px;
        }
        #dialog.yes{
            color: #900;
            background-image: url(dzp/y.png);
            background-position: right bottom;
            background-repeat: no-repeat;
            -webkit-background-size:100px auto ;
            background-size:100px auto ;
        }
        #dialog.yes a{ display: block;}
 
        #dialog.no{ color: #333;}
        #dialog.no button{ display: block;}
        #content{
            text-align: center;
        }
        #dialog button,#dialog a{
            display: none;
            font-size: 14px;
            position: absolute;
            bottom: 10px;
            left: 50%;
            height: 30px;
            width: 80px;
            line-height: 30px;
            margin-left: -40px;
            background-color: #2C6C4E;
            border: none;
            color: #fff;
            text-align: center;
        }
 
        li{ list-style: none; font-size: 14px; line-height: 30px;}
 
        .jilu{ height: 30px; width: 100%; overflow: hidden; background-color: #eee; }
        .jilu li{ height: 30px; line-height: 30px; text-align: center;}
    </style>
</head>
<body>
 
    <div class="grid">
        <div id="banner">
            <div class="inner">
                <div id="zhen"></div>
            </div>
        </div>
        <div class="block">
            <div class="title">剩余次数</div>
            <p >你还可抽奖的次数:<span class="num"><?php echo $awardNum;?></span></p>
        </div>
        <div class="block">
            <div class="title">奖项设置</div>
            <ul>
            <?php foreach($actList as $v){?>
            <li class="tpl-prize-item">
                        <span class="prize-num tpl-prize-num"></span>
                        <span class="prize-name tpl-prize-name"><?php echo $v['title'];?>---<?php echo $v['awardname'];?></span>
                        <span class="prize-number tpl-prize-number">奖品数量:<?php echo $v['num'];?></span>
                    </li>
                            <?php }?>
                            
                                    </ul>
        </div>
        <div class="block">
            <div class="title">活动规则</div>
            <p><?php echo $act['content'];?></p>
        </div>
        <div class="block">
            <div class="title">中奖记录</div>
                            <p>兑奖截止<?php echo $act['overymd'];?></p>
                            <?php foreach($award as $v){?>
                            <p><?php echo $v['nickname'];?>---<?php echo $v['class_name'];?></p>
                            <?php }?>
                    </div>
        <?php if($uid){?><div class="block">
            <div class="title">我的中奖记录</div>
                            <p>兑奖截止<?php echo $act['overymd'];?></p>
                            <?php foreach($award as $v){
                            if($v['uid'] == $uid){
                            ?>
                            <p><?php echo $v['nickname'];?>---<?php echo $v['class_name'];?>---<?php echo $v['code'];?></p>
                            <?php }}?>
                    </div><?php }?>
    </div>
    <div id="mask"></div>
    <div id="dialog" class="yes">
        <div id="content"></div>
        <a href="javascript:location.reload()">确定</a>
        <button id="close">关闭</button>
    </div>
    
</body>
</html>
<script src="dzp/jq.js"></script>
<script>
    $(function() {
        var data = [
            { type : 1 ,msg :'一等奖'},
            { type : 0 ,msg : '谢谢参与'},
            { type : 0 ,msg : ''},
            { type : 0 ,msg : '要加油哦'},
            { type : 1 ,msg : '三等奖'},
            { type : 0 ,msg : '运气不够'},
            { type : 0 ,msg : ''},
            { type : 0 ,msg : '再接再厉'},
            { type : 1 ,msg : '二等奖'},
            { type : 0 ,msg : '祝你好运'},
            { type : 0 ,msg : ''},
            { type : 0 ,msg : '不要灰心'}
        ]
 
        var tt = null;
        $("#zhen").click(function() {
            // 显示结果
            var $me = $(this);
            $.getJSON("act_prize.php?aid=<?php echo $aid;?>", function(json){
                if(json.msg == 2){
                    $("#content").html(json.prize);
                    $("#dialog").attr("class",'no').show();
                }else{
                    var r = 1440 + 30*(json.r-1);
                    var style ;
                    style = '-webkit-transition-delay:1s;-webkit-transition: all 3s;transition: all 3s;-webkit-transform: rotate('+r+'deg);'+'-moz-transition-delay:1s;-moz-transition: all 3s;transition: all 3s;-moz-transform: rotate('+r+'deg);'+'transition-delay:1s;transition: all 3s;transition: all 3s;transform: rotate('+r+'deg);'+'filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);';
                    $me.attr('style',style);
                    wxch_show(json);
                    if(json.num >= 1){
                        $(".num").text(json.num-1);
                    }else{
                        $(".num").text(json.num);
                    }
                }
            });
        });
 
        function wxch_show (json) {
            var angle = 30*(json.r-1);
            setTimeout(function() {
                $("#mask").show();
                $("#zhen").attr('style','-webkit-transform: rotate('+angle+'deg);-moz-transform: rotate('+angle+'deg);transform: rotate('+angle+'deg);')
                if (json.msg == 1) {
                    $("#content").html(json.prize);
                    $("#dialog").attr("class",'yes').show();
                }else {
                    $("#content").html(json.prize);
                    $("#dialog").attr("class",'no').show();
                }
            }, 3000);
        }
 
        $("#mask").on('click',function() {
            $(this).hide();
            $("#dialog").hide();
        });
 
        $("#close").click(function() {
            $("#mask").trigger('click');
        });
    });
</script>