events_code.html 2.5 KB

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