events_code.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <{include file="header.html"}>
  2. <!--公用标题居中显示-->
  3. <{include file="common_header.html"}>
  4. <div class="wrapper clear">
  5. <div class="article_title center"><{$codeInfo.events_name}></div>
  6. <!--公用活动说明样式-->
  7. <div class="article_content">
  8. <{$codeInfo.events_tips}>
  9. </div>
  10. <div class="v_box_w clear">
  11. <{if !$eventsStatus}>
  12. <{if $codeInfo.events_hd_tips}>
  13. <div class="h3_title"><{$codeInfo.events_hd_tips}></div>
  14. <{/if}>
  15. <{include file="event_forms_template.html"}>
  16. <{else}>
  17. <!--公用活动结束提示 begin-->
  18. <div class="v_end_com_box">
  19. <div class="v_end_txt_com center">活动已结束!</div>
  20. <div class="center"><a href="<{$listUrl}>" class="submit_btn_style">参与更多特权活动</a></div>
  21. </div>
  22. <{/if}>
  23. <{if $codeInfo.operationt_tips}>
  24. <div class="h3_title"><span><{$codeInfo.operationt_tips}></span></div>
  25. <{/if}>
  26. <!--公用活动规则样式-->
  27. <div class="activity_des">
  28. <{$codeInfo.events_rules}>
  29. </div>
  30. <div class="clear"></div>
  31. </div>
  32. </div>
  33. <!--公用提示背景遮罩层-->
  34. <div class="a_cover"></div>
  35. <!--公用提示样式一 begin-->
  36. <div class="v_tips_box" id="msg_tips_box">
  37. <div class="v_close_btn"></div>
  38. <p class="tips_msg"></p>
  39. </div>
  40. <!--公用提示样式一 end-->
  41. <!--公用提示样式二 begin-->
  42. <div class="v_tips_box v_tips_box2">
  43. <div class="v_close_btn"></div>
  44. <p class="tips_img"><img src="<{$codeInfo.code_img_url}>"></p>
  45. <p class="tips_txt_show">恭喜您获得<br><{$codeInfo.code_name}></p>
  46. <p class="go_tips_txt">券:<span>请到"我的奖品"中查看</span></p>
  47. <p class="go_tips_btn center">
  48. <a href="<{$giftsUrl}>" class="submit_btn_style">查看详情</a>
  49. </p>
  50. </div>
  51. <!--公用提示样式二 end-->
  52. <script>
  53. var seconds = 2000;
  54. //刷新页面
  55. function reload_page (){
  56. window.location.reload();
  57. }
  58. // 跳转页面
  59. var goUrl = '';
  60. function go_page(){
  61. location.href = goUrl;
  62. }
  63. $(".v_close_btn").on('click', function(){
  64. $(".v_tips_box,.a_cover").hide();
  65. });
  66. KISSY.use('node, io', function (S, Node, IO) {
  67. function showMsg($msg) {
  68. $('.tips_msg').html($msg);
  69. $('#msg_tips_box, .a_cover').fadeIn().delay(2000).fadeOut();
  70. }
  71. function showLoading() {
  72. $('.tips_msg').html('<i class="fa fa-spinner fa-pulse"></i>');
  73. $('#msg_tips_box, .a_cover').fadeIn();
  74. }
  75. $('#common_submit_btn').on('click', function () {
  76. IO.on("send",function(){
  77. showLoading();
  78. });
  79. IO.on("complete",function(){
  80. //$("#v_tips_box").hide();
  81. });
  82. var formData = IO.serialize('#ff');
  83. IO.post('<{$web_cfg.domain}>/?c=EventsCode&a=apply&events_id=<{$codeInfo.id}>'
  84. , formData
  85. , function (data) {
  86. if (data.ok) {
  87. S.log(data.msg);
  88. $("#msg_tips_box").hide();
  89. $(".go_tips_txt span").html(data.msg.codeData.data);
  90. $(".v_tips_box2").fadeIn();
  91. } else {
  92. if(data.msg.url){
  93. $(".tips_msg").html('本活需登录后才可以参与');
  94. $('#msg_tips_box').fadeIn();
  95. goUrl = '<{$loginUrl}>';
  96. setInterval("go_page();",seconds);
  97. return ;
  98. }
  99. showMsg(data.msg);
  100. return ;
  101. }
  102. }
  103. , 'json'
  104. );
  105. return false;
  106. });
  107. });
  108. </script>
  109. <{include file="bottom.html"}>