approved.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <style>
  2. .right-content{
  3. padding-top:54px!important; padding-left:0!important; width:970px!important;
  4. }
  5. </style>
  6. <div class="content">
  7. <% include ../leftBar.html %>
  8. <!-- right content start -->
  9. <div class="right-content">
  10. <div class="pageInfo">My Shows</div>
  11. <div id="tabs-container">
  12. <% include topBar.html %>
  13. <div class="showApproved">
  14. <div class="showApprovedTitle">
  15. <ul>
  16. <li>Show title</li>
  17. <li>Show type</li>
  18. <li>Start time</li>
  19. <li>Duration</li>
  20. <li>Tickets sold</li>
  21. <li></li>
  22. </ul>
  23. </div>
  24. <%if(approvedList.length>0){%>
  25. <%for(var data of approvedList){%>
  26. <div class="showApprovedList">
  27. <ul>
  28. <li>
  29. <%if(data.no_read){%>
  30. <div><img class="unreadLiveShow" src="<%=public_path%>/img/u84.png"></div>
  31. <%}%>
  32. <a href="/broadcast/myShow/liveShowInfo?live_show_sn=<%=data.live_show_id%>" class="beyondHiding" style="display: block; width: 140px;"><%=data.show_title%></a>
  33. </li>
  34. <li class="beyondHiding"><%=showType[data.classify]%></li>
  35. <li class="scheduledLiveListTimeSent showColor_139818" data-time="<%=data.start_time*1000%>"></li>
  36. <li class="showColor_F8834E"><%=data.duration%> minutes</li>
  37. <li><%=data.ticket_num%></li>
  38. <li>
  39. <div class="liveShowStartTime" data-id="<%=data.live_show_id%>" data-time="<%=data.left_sec_to_start%>" data-duration="<%=data.duration%>" style="margin-top: 10px; margin-left: 50px;">
  40. <a target="_blank" class="liveShowStartTimeBtn noliveing cursorDefault">Start My Show</a>
  41. <div class="Countdown" style="display: none;">
  42. start in <span class="startTime"></span>
  43. </div>
  44. </div>
  45. </li>
  46. </ul>
  47. </div>
  48. <%}%>
  49. <%}else{%>
  50. <div class="noData clear">No shows approved.</div>
  51. <%}%>
  52. </div>
  53. </div>
  54. <div id="page" class="pagenation"></div>
  55. </div>
  56. <!-- right content end -->
  57. </div>
  58. <script>
  59. $(function(){
  60. liveShowStartTime();
  61. function liveShowStartTime(){
  62. var RemainingTime = $('.liveShowStartTime');
  63. for(var i=0; i < RemainingTime.length; i++) {
  64. var reservationTime = RemainingTime.eq(i).attr('data-time');
  65. thirtyCount(reservationTime,RemainingTime.eq(i));
  66. }
  67. }
  68. /**
  69. * 节目列表30分钟倒计时功能
  70. * @param startTime
  71. * @param demo
  72. */
  73. function thirtyCount(startTime,demo){
  74. var time = startTime;
  75. var liveShowId = demo.attr('data-id');
  76. var duration = demo.attr('data-duration');
  77. duration = -duration;
  78. var url = '/page/anchor.html#liveShowid='+liveShowId;
  79. if(time < 0){return;};
  80. if(time > 30 * 60){
  81. //30分钟之前不需要倒数
  82. setTimeout(()=>{thirtyCount(startTime,demo);},(time - 30* 60) * 1000);
  83. return;
  84. };
  85. //分钟数
  86. var min = Math.ceil(time/60);
  87. //秒数零头
  88. var seconds = time%60;
  89. //倒数30分钟需要修改按钮状态
  90. var Countdown = function (){
  91. if(min < 30 && min > 3){
  92. var html = min+':00';
  93. demo.find('.startTime').html(html);
  94. demo.find('.Countdown').show();
  95. }else if(min <= 3 && min > duration){
  96. var html = min+':00';
  97. if(min <= 0 && min > duration){
  98. demo.find('.Countdown').hide();
  99. }else{
  100. demo.find('.Countdown').show();
  101. }
  102. demo.find('.startTime').html(html);
  103. demo.find('.liveShowStartTimeBtn').attr('href',url);
  104. demo.find('.liveShowStartTimeBtn').removeClass('noliveing');
  105. demo.find('.liveShowStartTimeBtn').removeClass('cursorDefault');
  106. demo.find('.liveShowStartTimeBtn').addClass('liveing');
  107. }
  108. }
  109. Countdown();
  110. var timefn = function fn(){
  111. min--;
  112. //倒数30分钟需要修改按钮状态
  113. Countdown();
  114. if(min == duration){
  115. demo.find('.Countdown').hide();
  116. demo.find('.liveShowStartTimeBtn').removeAttribute('href');
  117. demo.find('.liveShowStartTimeBtn').addClass('noliveing');
  118. demo.find('.liveShowStartTimeBtn').addClass('cursorDefault');
  119. demo.find('.liveShowStartTimeBtn').removeClass('liveing');
  120. return;
  121. };
  122. setTimeout(()=>{fn();},60 * 1000);
  123. };
  124. //初次使用
  125. setTimeout(()=>{timefn();},seconds * 1000);
  126. };
  127. anchorReservationTimeSent();
  128. //分页
  129. var pages = Math.ceil(<%=approvedListCount%>/<%=step%>);
  130. if(pages>1) {
  131. page('page', pages);
  132. }
  133. })
  134. </script>