events_try.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. <div class="v_tips_box v_tips_box2" id="error_tips_box">
  9. <div class="v_close_btn"></div>
  10. <p class="tips_msg" id="error_msg">错误信息</p>
  11. </div>
  12. <!--活动结束提示+按钮-->
  13. <div class="v_tips_box v_tips_box2" id="try_tips_box">
  14. <div class="v_close_btn"></div>
  15. <p>您的申请提交成功!</p>
  16. <p><a href="javascript:;" class="v2_close_btn submit_btn_style">确认</a></p>
  17. </div>
  18. <script>
  19. var seconds = 2000;
  20. function clearCover(){
  21. $('.a_cover').fadeOut(200);
  22. }
  23. function showOkMsg(){
  24. $('.a_cover').fadeIn(200);
  25. $('#try_tips_box').fadeIn(200);
  26. }
  27. var goUrl = '';
  28. function go_page(){
  29. location.href = goUrl;
  30. }
  31. function showErrorMsg(data_msg){
  32. $('.v_close_btn').show();
  33. $('#error_msg').html(data_msg);
  34. $('#error_tips_box').fadeIn(200);
  35. $('.a_cover').fadeIn(200);
  36. }
  37. function showErrorMsgGoPage(data_msg){
  38. $('.v_close_btn').show();
  39. $('#error_msg').html(data_msg);
  40. $('#error_tips_box').fadeIn();
  41. $('.a_cover').fadeIn();
  42. setInterval("go_page();",seconds+100);
  43. }
  44. KISSY.use('node, io', function (S, Node, IO) {
  45. var $ = S.all;
  46. //视频自适应
  47. var screenWidth = $(window).width();
  48. var baseWidth = 510;
  49. var video_scale = screenWidth / baseWidth;
  50. $(".video_iframe").each(function () {
  51. var new_width = $(this).width() * video_scale;
  52. $(this).width(new_width - 20);
  53. var new_height = $(this).height() * video_scale;
  54. $(this).height(new_height - 20);
  55. });
  56. function showErrorMsgBox(msg){
  57. $(".v_tips_box").fadeOut();
  58. $("#error_msg").html(msg);
  59. $("#error_tips_box").show();
  60. }
  61. $(".v_close_btn,.v2_close_btn").on('click', function(){
  62. $(".v_tips_box,.a_cover").hide();
  63. });
  64. /*
  65. IO.on("send",function(){
  66. //$(".a_cover").css("opacity", 0);
  67. showErrorMsg('<i class="fa fa-spinner fa-pulse"></i>');
  68. $('.a_cover').fadeIn();
  69. });
  70. IO.on("complete",function(){
  71. //$("#error_tips_box").fadeOut();
  72. });
  73. */
  74. $('#common_submit_btn').on('click', function () {
  75. var formData = IO.serialize('#ff');
  76. IO.post('<{$web_cfg.domain}>/?c=EventsTry&a=apply&events_id=<{$tryInfo.id}>'
  77. , formData
  78. , function (data) {
  79. if (data.ok) {
  80. //showOkMsg();
  81. toast('提交成功,请等待管理员审核');
  82. } else {
  83. if(data.msg.url){
  84. loadLogin();
  85. return;
  86. goUrl = '<{$loginUrl}>';
  87. showErrorMsgGoPage('本活动需登录后才可以参与');
  88. return;
  89. }
  90. toast(data.msg, 1);
  91. }
  92. }
  93. , 'json'
  94. );
  95. return false;
  96. });
  97. });
  98. </script>
  99. <{include file="bottom.html"}>