123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <{include file="header.html"}>
- <{include file="nav.html"}>
- <!--公用标题居中显示-->
- <{include file="common_header.html"}>
- <{include file="events_top.html"}>
- <div class="wrapper clear">
- <div class="ac_title_com_app"><{$scratchData.events.events_name}></div>
- <!--公用活动说明样式-->
- <div class="ac_content">
- <{$scratchData.events.events_tips}>
- </div>
-
- <{if $eventsStatus != 'STATUS_HAS_RESTRTICTIONS'}>
- <{if $scratchData.events.events_hd_tips}>
- <div class="ac_title_com_line"><span><{$scratchData.events.events_hd_tips}></span></div>
- <{/if}>
-
- <{*挂奖区域*}>
- <div class="canvas_box">
- <span class="can_container">
- <!--中奖-->
- <{if !$eventsStatus}>
- <div id="inner_box" class="v_win_tips v_inner_box center" ></div>
- <img id="redux" src="<{$web_cfg.cdn}>/public/static/img/v_cover_bg.jpg" />
- <{else}>
- <div class="v_inner_box center" ></div>
- <img src="<{$web_cfg.cdn}>/public/static/img/v_cover_bg.jpg" />
- <{/if}>
- </span>
- </div>
- <{/if}>
-
-
- <{if !$eventsStatus}>
- <div class="v_reset_btn" style="display: none;"><a href="<{$web_cfg.url}>" >再刮一次</a></div>
- <{elseif $eventsStatus == 'STATUS_HAS_RESTRTICTIONS'}>
- <div class="v_end_com_box">
- <div class="v_end_txt_com center">已经到达参与上限</div>
- <div class="center"><a href="<{$listUrl}>" class="v_com_btn">参与更多特权活动</a></div>
- </div>
- <{else}>
- <div class="v_end_com_box">
- <div class="v_end_txt_com center">活动已结束!</div>
- <div class="center"><a href="<{$listUrl}>" class="v_com_btn">参与更多特权活动</a></div>
- </div>
- <div class="a_cover_alpha"></div>
- <{/if}>
-
- <div class="clear"></div>
-
-
- <div class="ac_title_com_line"><span>奖品设置</span></div>
- <div class="vpro_list_show">
- <{assign var=count value=$scratchData.prize|@count }>
- <{foreach from=$scratchData.prize item=prize name=prize}>
- <dl <{if $smarty.foreach.prize.iteration == $count}>style="border-bottom:0px;"<{/if}>>
- <dt><img src="<{$prize.img_url}>"></dt>
- <dd>
- <p><{$prize.prize_name}></p>
- </dd>
- </dl>
- <{/foreach}>
- <div class="clear"></div>
- </div>
- <{if $scratchData.events.share_button == 2}>
- <{include file="share_button.html"}>
- <{/if}>
-
- <{if $scratchData.events.operationt_tips}>
- <div class="ac_title_com_line"><span><{$scratchData.events.operationt_tips}></span></div>
- <{/if}>
- <!--公用活动规则样式-->
- <div class="activity_des">
- <{$scratchData.events.events_rules}>
- </div>
-
- <div class="clear"></div>
-
- </div>
- <!--公用提示背景遮罩层-->
- <div class="a_cover"></div>
- <!--虚拟中奖提示 begin-->
- <div class="coupon_tips_box v_tips_box" id="code_tips_box" style="display:none">
- <p class="coupon_code"><img src=""></p>
- <p class="tips_txt_show"></p>
- <p class="go_tips_txt"></p>
- <p class="go_tips_btn">
- <a href="<{$giftsUrl}>">查看奖品</a>
- </p>
- </div>
- <!--虚拟中奖提示 end-->
- <!--实物中奖提示 begin-->
- <div class="coupon_tips_box v_tips_box" id="object_tips_box" style="display:none">
- <p class="coupon_code"><img src=""></p>
- <p class="object_name"></p>
- <p class="go_tips_btn">
- <a class="share" href="">领取奖品</a>
- </p>
- </div>
- <!--实物中奖提示 end-->
- <div class="vote_tips_box" id="tips_box" style="display:none;">
- <p class="tips_msg" >提示信息</p>
- <div class="tips_close_btn" id="tips_close_btn"><span></span></div>
- </div>
- <script type="text/javascript" src="<{$web_cfg.cdn}>/public/static/js/jquery.eraser.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- init();
- function init(event) {
- scratch();
- $("#redux").eraser({
- size: 20,//定义笔头大小
- completeRatio: .3,//当画布被擦除30%时触发事件
- completeFunction: showResult
- });
- }
-
- $('#reset').click(function () {
- scratch();
- $("#redux").eraser('reset');
- $(".v_tips_box, vote_tips_box").fadeOut();
- });
-
-
- //刮奖结果提示
- function showResult(){
- var winData = $('#winData').data();
- console.log(winData);
-
- if (winData.type == 1) {
- $.get('<{$web_cfg.domain}>/?c=EventsScratch&a=UserRestrictions'
- , {events_id: <{$scratchData.events.id}> ,lottery_data_id:winData.lottery_data_id}
- , function(data){
- if(data.ok){
- objectAward(winData);
- }else{
- showFail(data.msg);
- }
- }, 'json'
- );
-
- }
-
- if (winData.type == 2) {
- $.get('<{$web_cfg.domain}>/?c=EventsScratch&a=UserRestrictions'
- , {events_id: <{$scratchData.events.id}> ,lottery_data_id:winData.lottery_data_id}
- , function(data){
- if(data.ok){
- virtualAward(winData);
- }else{
- showFail(data.msg);
- }
- }, 'json'
- );
- }
-
- if (winData.errcode == 'NO_PERMISSION') {
- showFail('本活动需登录后才可以参与', true);
- }
-
- if (winData.errcode == 'INVALID_ID') {
- showFail('无效id');
- }
-
- if ($.isEmptyObject(winData)) {
-
- $.get('<{$web_cfg.domain}>/?c=EventsScratch&a=CKEventRestrictions'
- , {events_id: <{$scratchData.events.id}>}
- , function(data){
- if(data.ok){
- $('.v_reset_btn').show();
- }else{
- $('.v_reset_btn').hide();
- }
- }, 'json'
- );
-
- // 判断是否显示再挂一次按钮
-
- showFail('未中奖,谢谢参与!');
-
-
- }
-
- }
-
- $(".tips_close_btn").on('click', function(){
- $(".vote_tips_box, .a_cover").hide();
- });
-
- function scratch() {
-
-
-
- $.get('<{$web_cfg.domain}>/?c=EventsScratch&a=scratch'
- , {events_id: <{$scratchData.events.id}>}
- , function (data) {
- /*
- $('#inner_box_x, #inner_img_x').hide();
- $('#inner_box, #redux').show();
- */
- if (data.ok) {
- var ncop = '';
- if (!$.isEmptyObject(data.msg)) {
- ncop = '<p><img src="'+data.msg.img_url+'"></p>';
- ncop += '<p>'+data.msg.prize_name+'</p>';
- } else {
- ncop = '<p><img id="v_lose_icon" src="<{$web_cfg.cdn}>/public/static/img/v_lose_bg.jpg"></p>';
- }
- $('.v_win_tips').html(ncop);
- } else {
- switch (data.msg.errcode) {
- case 'INVALID_ID':
- showFail('无效id');
- break;
- case 'NO_PERMISSION':
- showFail('本活动需登录后才可以参与', true);
- break;
- default:
- showFail('未知错误');
- break;
- }
- }
-
- $('#winData').data(data.msg);
- }
- , 'json'
- );
- }
-
- //提示虚拟奖品
- function virtualAward(data) {
- var $msgBox = $('#code_tips_box');
- $('.tips_txt_show', $msgBox).html('您已获得'+data.prize_name+'<br>'+data.virtual_data);
- $('.coupon_code img', $msgBox).attr('src', data.img_url);
- $msgBox.show();
- $('.a_cover').show();
- }
-
- //提示实物奖品
- function objectAward(data) {
- var $msgBox = $('#object_tips_box');
- $('.object_name', $msgBox).html('您已获得<br>'+data.prize_name);
- $('.coupon_code img', $msgBox).attr('src', data.img_url);
- $('.share', $msgBox).attr('href', '<{$web_cfg.domain}>/?c=Express&lottery_data_id='+data.lottery_data_id);
- $msgBox.show();
- $('.a_cover').show();
- }
-
- //消息提示
- function showFail(msg, isPer) {
- var $msgBox = $('#tips_box');
- if (isPer) $('.go_tips_btn').show();
- $('.tips_msg', $msgBox).html(msg);
- $('#tips_box, .a_cover').fadeIn().delay(2000).fadeOut();
- }
-
- $('.vogue_add_btn').on('click', function() {
- $('#add_tips').show();
- });
-
- $('.add_join_btn').on('click', function () {
- $('#add_tips').hide();
- });
-
- //判断当前页图片加载完成loading消失
- $(".vpro_list_show dl dt img").each(function(){
- $(this).load(function(){
- $(this).parent().css("background","none");
- })
- });
- });
- </script>
- <span id="winData"></span>
- <{include file="bottom.html"}>
|