events_cutscreen.html 11 KB

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