events_try.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <{include file="header.html"}>
  2. <!--公用标题居中显示-->
  3. <{include file="common_header.html"}>
  4. <!---->
  5. <div class="wrapper clear">
  6. <div class="try_show_box clear">
  7. <div class="article_title center"><{$tryInfo.events_name}></div>
  8. <div class="article_content clear">
  9. <{$tryInfo.events_tips}>
  10. </div>
  11. </div>
  12. <div class="v_box_w clear">
  13. <{if !$eventsStatus}>
  14. <{if $tryInfo.events_hd_tips}>
  15. <div class="h3_title"><{$tryInfo.events_hd_tips}></div>
  16. <{/if}>
  17. <{include file="event_forms_template.html"}>
  18. <{else}>
  19. <!--公用活动结束提示 begin-->
  20. <div class="v_end_com_box">
  21. <div class="v_end_txt_com center">活动已结束!</div>
  22. <div class="center"><a href="<{$listUrl}>" class="submit_btn_style">参与更多特权活动</a></div>
  23. </div>
  24. <{/if}>
  25. <{if $tryInfo.share_button == 2}>
  26. <{include file="share_button.html"}>
  27. <{/if}>
  28. <!--公用活动规则样式-->
  29. <{if $tryInfo.operationt_tips}>
  30. <div class="h3_title"><{$tryInfo.operationt_tips}></div>
  31. <{/if}>
  32. <div class="activity_des">
  33. <{$tryInfo.events_rules}>
  34. </div>
  35. <div class="clear"></div>
  36. </div>
  37. </div>
  38. <!--公用提示背景遮罩层-->
  39. <div class="a_cover"></div>
  40. <div class="v_tips_box v_tips_box2" id="error_tips_box">
  41. <div class="v_close_btn"></div>
  42. <p class="tips_msg" id="error_msg">错误信息</p>
  43. </div>
  44. <!--活动结束提示+按钮-->
  45. <div class="v_tips_box v_tips_box2" id="try_tips_box">
  46. <div class="v_close_btn"></div>
  47. <p>您的申请提交成功!</p>
  48. <p><a href="javascript:;" class="v2_close_btn submit_btn_style">确认</a></p>
  49. </div>
  50. <script>
  51. var seconds = 2000;
  52. function clearCover(){
  53. $('.a_cover').fadeOut(200);
  54. }
  55. function showOkMsg(){
  56. $('.a_cover').fadeIn(200);
  57. $('#try_tips_box').fadeIn(200);
  58. }
  59. var goUrl = '';
  60. function go_page(){
  61. location.href = goUrl;
  62. }
  63. function showErrorMsg(data_msg){
  64. $('.v_close_btn').show();
  65. $('#error_msg').html(data_msg);
  66. $('#error_tips_box').fadeIn(200);
  67. $('.a_cover').fadeIn(200);
  68. }
  69. function showErrorMsgGoPage(data_msg){
  70. $('.v_close_btn').show();
  71. $('#error_msg').html(data_msg);
  72. $('#error_tips_box').fadeIn();
  73. $('.a_cover').fadeIn();
  74. setInterval("go_page();",seconds+100);
  75. }
  76. KISSY.use('node, io', function (S, Node, IO) {
  77. var $ = S.all;
  78. //视频自适应
  79. var screenWidth = $(window).width();
  80. var baseWidth = 510;
  81. var video_scale = screenWidth / baseWidth;
  82. $(".video_iframe").each(function () {
  83. var new_width = $(this).width() * video_scale;
  84. $(this).width(new_width - 20);
  85. var new_height = $(this).height() * video_scale;
  86. $(this).height(new_height - 20);
  87. });
  88. function showErrorMsgBox(msg){
  89. $(".v_tips_box").fadeOut();
  90. $("#error_msg").html(msg);
  91. $("#error_tips_box").show();
  92. }
  93. $(".v_close_btn,.v2_close_btn").on('click', function(){
  94. $(".v_tips_box,.a_cover").hide();
  95. });
  96. IO.on("send",function(){
  97. //$(".a_cover").css("opacity", 0);
  98. showErrorMsg('<i class="fa fa-spinner fa-pulse"></i>');
  99. $('.a_cover').fadeIn();
  100. });
  101. IO.on("complete",function(){
  102. //$("#error_tips_box").fadeOut();
  103. });
  104. $('#common_submit_btn').on('click', function () {
  105. var formData = IO.serialize('#ff');
  106. IO.post('<{$web_cfg.domain}>/?c=EventsTry&a=apply&events_id=<{$tryInfo.id}>'
  107. , formData
  108. , function (data) {
  109. if (data.ok) {
  110. showOkMsg();
  111. } else {
  112. if(data.msg.url){
  113. goUrl = '<{$loginUrl}>';
  114. showErrorMsgGoPage('本活需登录后才可以参与');
  115. return;
  116. }
  117. showErrorMsg(data.msg);
  118. }
  119. }
  120. , 'json'
  121. );
  122. return false;
  123. });
  124. });
  125. </script>
  126. <{include file="bottom.html"}>