events_cutscreen.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <{include file="header.html"}>
  2. <{include file="nav.html"}>
  3. <link rel="stylesheet" type="text/css" href="<{$web_cfg.cdn}>/public/static/css/??swiper.min.css,swiper.animate.min.css" />
  4. <script src="<{$web_cfg.cdn}>/public/static/js/??swiper.jquery.min.js,swiper.animate.min.js"></script>
  5. <style>
  6. .swiper-container {width:100%; position:absolute;}
  7. .page-screen {
  8. background-attachment: scroll;
  9. background-position: top center;
  10. background-repeat: no-repeat;
  11. background-size: 320px auto;
  12. }
  13. .background_image {
  14. display: block;
  15. overflow: hidden;
  16. width: 100%;
  17. z-index: 0;
  18. position: absolute;
  19. }
  20. .upper_image {
  21. position: absolute;
  22. }
  23. .button_image {
  24. position: absolute;
  25. }
  26. @-webkit-keyframes right_start {
  27. 0%,30% {opacity: 0;-webkit-transform: translate(10px, 0) rotate(-90deg);}
  28. 60% {opacity: 1;-webkit-transform: translate(0,0) rotate(-90deg);}
  29. 100% {opacity: 0;-webkit-transform: translate(-8px, 0) rotate(-90deg);}
  30. }
  31. @-moz-keyframes right_start {
  32. 0%,30% {opacity: 0;-moz-transform: translate(10px,0) rotate(-90deg);}
  33. 60% {opacity: 1;-moz-transform: translate(0,0) rotate(-90deg);}
  34. 100% {opacity: 0;-moz-transform: translate(-8px,0) rotate(-90deg);}
  35. }
  36. @keyframes right_start {
  37. 0%,30% {opacity: 0;transform: translate(10px,0) rotate(-90deg);}
  38. 60% {opacity: 1;transform: translate(0,0) rotate(-90deg);}
  39. 100% {opacity: 0;transform: translate(-8px,0) rotate(-90deg);}
  40. }
  41. @-webkit-keyframes botton_start {
  42. 0%,30% {opacity: 0;-webkit-transform: translate(0,10px);}
  43. 60% {opacity: 1;-webkit-transform: translate(0,0);}
  44. 100% {opacity: 0;-webkit-transform: translate(0,-8px);}
  45. }
  46. @-moz-keyframes botton_start {
  47. 0%,30% {opacity: 0;-moz-transform: translate(0,10px);}
  48. 60% {opacity: 1;-moz-transform: translate(0,0);}
  49. 100% {opacity: 0;-moz-transform: translate(0,-8px);}
  50. }
  51. @keyframes botton_start {
  52. 0%,30% {opacity: 0;transform: translate(0,10px);}
  53. 60% {opacity: 1;transform: translate(0,0);}
  54. 100% {opacity: 0;transform: translate(0,-8px);}
  55. }
  56. .bottom_arrow {
  57. width: 20px;
  58. height: 15px;
  59. position: absolute;
  60. z-index: 999;
  61. bottom: 10px;
  62. left: 50%;
  63. animation: botton_start 1.5s infinite ease-in-out;
  64. -webkit-animation: botton_start 1.5s infinite ease-in-out;
  65. -moz-animation: botton_start 1.5s infinite ease-in-out;
  66. }
  67. .right_arrow {
  68. width: 20px;
  69. height: 15px;
  70. position: absolute;
  71. z-index: 999;
  72. right: 10px;
  73. top: 50%;
  74. animation: right_start 1.5s infinite ease-in-out;
  75. -webkit-animation: right_start 1.5s infinite ease-in-out;
  76. -moz-animation: right_start 1.5s infinite ease-in-out;
  77. }
  78. .music {
  79. width: 30px;
  80. height: 30px;
  81. overflow: hidden;
  82. position: fixed;
  83. z-index: 999;
  84. background: url("<{$web_cfg.cdn}>/public/static/img/music.png") no-repeat -30px 0px;
  85. background-size: 60px 30px;
  86. }
  87. .music.left {top:2%;left:3%;}
  88. .music.right {top:2%;right:3%;}
  89. .music.off {background-position: 0px 0px;}
  90. .mask {background-color:<{$cutScreenInfo.loading_bg_color}>;display: block;height: 100%;position: absolute;width: 100%;z-index: 200;}
  91. .loading{position:relative;text-align:center;top:40%; color:<{$cutScreenInfo.loading_text_color}>;}
  92. .loading i{font-size:30px;}
  93. .loading p{font-size: 12px;}
  94. .swiper-slide {overflow: hidden;}
  95. .ks-input {
  96. position: fixed;
  97. top: 20%;
  98. width: 100%;
  99. z-index: 990;
  100. display: none;
  101. }
  102. .ks-input .join_submit_box {
  103. background: #f2f2f4 none repeat scroll 0 0;
  104. margin: 0 10px;
  105. padding: 22px 10px 10px;
  106. }
  107. .input-mask {
  108. background: #000 none repeat scroll 0 0;
  109. display: block;
  110. height: 100%;
  111. left: 0;
  112. opacity: 0.5;
  113. position: fixed;
  114. top: 0;
  115. width: 100%;
  116. z-index: -1;
  117. }
  118. </style>
  119. <div class="mask">
  120. <div class="loading">
  121. <i class="fa fa-spinner fa-pulse"></i>
  122. <p><span>0</span>%</p>
  123. </div>
  124. </div>
  125. <div class="wrapper jsc-sidebar-content jsc-sidebar-pulled">
  126. <{if $cutScreenInfo.music_url}>
  127. <div class="music <{if $cutScreenInfo.music_position == 1}>right<{/if}>"></div>
  128. <{/if}>
  129. <div class="swiper-container">
  130. <div class="swiper-wrapper">
  131. <{foreach from=$pageData item=item}>
  132. <div class="swiper-slide" style="<{if $item.background_color}>background-color:<{$item.background_color}><{/if}>">
  133. <{if $item.bgimage_url}><img class="background_image" style="" src="<{$item.bgimage_url}>" ><{/if}>
  134. <{foreach from=$item.layers item=layer}>
  135. <{if $layer.url}>
  136. <{if $layer.link}>
  137. <a href="<{$layer.link}>">
  138. <{/if}>
  139. <{if $layer.input_btn}>
  140. <a class="show_input_btn" href="javascript:;">
  141. <{/if}>
  142. <img class="upper_image ani" style=
  143. "
  144. width:<{$layer.width}>px;
  145. height:<{$layer.height}>px;
  146. <{$layer.style}>
  147. "
  148. <{if $layer.action && $layer.action != 'rest'}>
  149. swiper-animate-effect="<{if $layer.action == 'up'}>fadeInUp<{else}>fadeInRight<{/if}>"
  150. swiper-animate-duration="0.3s"
  151. swiper-animate-delay="0.1s"
  152. <{/if}>
  153. src="<{$layer.url}>"
  154. >
  155. <{if $layer.input_btn}>
  156. </a>
  157. <{/if}>
  158. <{if $layer.link}>
  159. </a>
  160. <{/if}>
  161. <{/if}>
  162. <{if $layer.video_url}>
  163. <iframe class="upper_image ani" width=<{$layer.video_width}> height=<{$layer.video_height}> src="<{$layer.video_url}>"
  164. style="<{$layer.style}>"
  165. <{if $layer.action && $layer.action != 'rest'}>
  166. swiper-animate-effect="<{if $layer.action == 'up'}>fadeInUp<{else}>fadeInRight<{/if}>"
  167. swiper-animate-duration="0.3s"
  168. swiper-animate-delay="0.1s"
  169. <{/if}>
  170. frameborder=0 allowfullscreen></iframe>
  171. <{/if}>
  172. <{/foreach}>
  173. </div>
  174. <{/foreach}>
  175. </div>
  176. </div>
  177. <{if $cutScreenInfo.cut_fx == 'fadeInUp'}>
  178. <img class="bottom_arrow" src="<{$web_cfg.cdn}>/public/static/img/arrow.png" >
  179. <{/if}>
  180. <{if $cutScreenInfo.cut_fx == 'fadeInRight'}>
  181. <img class="right_arrow" src="<{$web_cfg.cdn}>/public/static/img/arrow.png" >
  182. <{/if}>
  183. </div>
  184. <div class="ks-input">
  185. <div class="input-mask"></div>
  186. <div class="v_close_btn hide_input_btn" style="right:10px;"></div>
  187. <{include file="event_forms_template.html"}>
  188. </div>
  189. <!--公用提示背景遮罩层-->
  190. <div class="a_cover"></div>
  191. <div class="v_tips_box v_tips_box2" id="error_tips_box">
  192. <div class="v_close_btn" id="tips_close_btn"></div>
  193. <p class="tips_msg" id="error_msg">错误信息</p>
  194. </div>
  195. <!--活动结束提示+按钮-->
  196. <div class="v_tips_box v_tips_box2" id="try_tips_box">
  197. <div class="v_close_btn" id="tips_close_btn"></div>
  198. <p>提交成功!</p>
  199. <p><a href="javascript:;" class="v2_close_btn submit_btn_style">确认</a></p>
  200. </div>
  201. <script>
  202. KISSY.use('node, dom, io, gallery/xplayer/2.1.0/index', function (S, Node, DOM, IO, Xplayer) {
  203. S.log('image loading start');
  204. var $ = S.all, slide;
  205. //loading
  206. var waitLoadingImgs = <{$waitLoadingImgs}>,
  207. hasLoadingTimes = 0, hasLoadingProgress = 0, loadNum = $(".mask p span");
  208. var runId, waitRunData = [];
  209. updateProgress(15, 100, 0);
  210. var avgTime = Math.round(70/waitLoadingImgs.length);
  211. for (var i = 0; i < waitLoadingImgs.length; i++) {
  212. var oi = new Image();
  213. oi.src = waitLoadingImgs[i];
  214. oi.onload = function () {
  215. ++hasLoadingTimes;
  216. S.log('image loading ok');
  217. updateProgress(avgTime, 100, 0);
  218. };
  219. }
  220. var ID = setInterval(function () {
  221. if (hasLoadingTimes == waitLoadingImgs.length) {
  222. clearInterval(ID);
  223. updateProgress(15, 1000, 1);
  224. S.log('image loading done');
  225. }
  226. }, 10);
  227. function updateProgress(num, time, isDone) {
  228. waitRunData.push(num+'-'+time+'-'+isDone);
  229. }
  230. runQueue();
  231. function runQueue() {
  232. if (runId > 0) clearInterval(runId);
  233. var time = 0, addnum = 0, tmpnum = 1;
  234. var rundata = waitRunData.shift();
  235. if (S.isUndefined(rundata)) {
  236. rundata = '';
  237. }
  238. rundata = rundata.split('-');
  239. addnum = rundata[0];
  240. time = rundata[1];
  241. isDone = rundata[2];
  242. var millisec = time/addnum;
  243. runId = setInterval(function () {
  244. if (tmpnum > addnum) {
  245. if (isDone == 1) {
  246. clearInterval(runId);
  247. loadNum.html(100);
  248. //
  249. jQuery(".mask").fadeOut();
  250. swiperInit();
  251. return false;
  252. }
  253. //S.log('runqueue');
  254. runQueue();
  255. return;
  256. }
  257. ++tmpnum;
  258. ++hasLoadingProgress;
  259. if (hasLoadingProgress > 100) hasLoadingProgress = 100;
  260. loadNum.html(hasLoadingProgress);
  261. }, millisec);
  262. }
  263. //20s
  264. setTimeout(function () {
  265. clearInterval(runId);
  266. loadNum.html(100);
  267. swiperInit();
  268. $(".mask").fadeOut();
  269. }, 15000);
  270. <{if $cutScreenInfo.music_url}>
  271. var XiamiPlay = new Xplayer({"autoplay": false});
  272. XiamiPlay.load({
  273. 'url' : '<{$cutScreenInfo.music_url}>',
  274. });
  275. XiamiPlay.play();
  276. $(".music").on('click', function () {
  277. if ($(this).hasClass('off')) {
  278. $(this).removeClass('off');
  279. XiamiPlay.play();
  280. } else {
  281. $(this).addClass('off');
  282. XiamiPlay.pause();
  283. }
  284. });
  285. XiamiPlay.on("ended", function(e) {
  286. XiamiPlay.play();
  287. });
  288. <{/if}>
  289. var screenHeight = $(window).height();
  290. var headerHeight = $(".wrapper-header").height();
  291. $(".swiper-container").height(screenHeight - headerHeight);
  292. <{if $cutScreenInfo.cut_fx == 'fadeInRight'}>
  293. var direction = 'horizontal';
  294. <{else}>
  295. var direction = 'vertical';
  296. <{/if}>
  297. var swiper_params = {
  298. direction : direction // vertical \ horizontal
  299. , speed: 300
  300. , onInit: function(swiper){
  301. swiperAnimateCache(swiper);
  302. swiperAnimate(swiper);
  303. }
  304. , onSlideChangeEnd: function(swiper){
  305. swiperAnimate(swiper);
  306. if (swiper.isEnd) {
  307. $('.bottom_arrow, right_arrow').hide();
  308. } else {
  309. $('.bottom_arrow, right_arrow').show();
  310. }
  311. }
  312. };
  313. var isSwiper = false;
  314. function swiperInit () {
  315. if (!isSwiper) {
  316. var swiper = new Swiper('.swiper-container', swiper_params);//start swiper
  317. isSwiper = true;
  318. slide = $(swiper.slides[swiper.activeIndex]);
  319. }
  320. }
  321. $(".bottom_arrow").width();
  322. function showErrorMsgBox(msg){
  323. $(".v_tips_box").fadeOut();
  324. $("#error_msg").html(msg);
  325. $("#error_tips_box").show();
  326. }
  327. $(".v_close_btn,.v2_close_btn").on('click', function(){
  328. $(".v_tips_box,.a_cover").hide();
  329. });
  330. IO.on("send",function(){
  331. showErrorMsg('<i class="fa fa-spinner fa-pulse"></i>');
  332. $('.a_cover').fadeIn();
  333. });
  334. $('#common_submit_btn', slide).on('click', function () {
  335. var formData = IO.serialize('#ff');
  336. IO.post('<{$web_cfg.domain}>/?c=EventsCutScreen&a=SubmitForm&events_id=<{$cutScreenInfo.id}>'
  337. , formData
  338. , function (data) {
  339. if (data.ok) {
  340. showOkMsg();
  341. $(".ks-input").fadeOut(.3);
  342. } else {
  343. showErrorMsg(data.msg);
  344. }
  345. }
  346. , 'json'
  347. );
  348. return false;
  349. });
  350. $(".show_input_btn").on('click', function () {
  351. $(".ks-input").fadeIn(.3);
  352. });
  353. $(".hide_input_btn").on('click', function () {
  354. $(".ks-input").fadeOut(.3);
  355. });
  356. });
  357. function showOkMsg(){
  358. $('.a_cover').fadeIn(200);
  359. $('#try_tips_box').fadeIn(200);
  360. }
  361. function showErrorMsg(data_msg){
  362. $('#tips_close_btn').show();
  363. $('#error_msg').html(data_msg);
  364. $('#error_tips_box').fadeIn(200);
  365. $('.a_cover').fadeIn(200);
  366. }
  367. </script>
  368. <{include file="bottom.html"}>