events_try.html 3.7 KB

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