index.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. {extend name="default/base/base_home" /}
  2. {block name="mall_main"}
  3. <link rel="stylesheet" href="{$Think.HOME_SITE_ROOT}/css/live_list.css">
  4. <div id="pclive-top">
  5. <div class="w1200">
  6. <img width="1190" height="207" src="{$Think.HOME_SITE_ROOT}/images/live/58b9654aN2be569d9.jpg" alt="" />
  7. </div>
  8. </div>
  9. <div class="pclive-content">
  10. <div class="w1200">
  11. <div class="ui-ceilinglamp-8" style="height:75px;">
  12. <ul id="ceilinglamp" class="title-tab">
  13. <li class="fore0 curr-layout" onclick="changeTab(0)"><a href="javascript:void(0)"><i></i>{$Think.lang.hot_live}</a></li>
  14. <li class="fore1" onclick="changeTab(1)"><a href="javascript:void(0)"><i></i>{$Think.lang.live_preview}</a></li>
  15. <li class="fore2" onclick="changeTab(2)"><a href="javascript:void(0)"><i></i>{$Think.lang.live_replay}</a></li>
  16. </ul>
  17. </div>
  18. </div>
  19. <ul class="w1200 content-layout">
  20. <!--热门直播 start-->
  21. <li id="pc-hotlive" class="w1200 channel-comfloor hotlive-20170124 curr-layout">
  22. <div class="m">
  23. <div class="mc">
  24. <ul class="list">
  25. <li class='no-record'><p style="height:30px;line-height:30px;text-align:center;">{$Think.lang.ds_common_result_null}</p></li>
  26. </ul>
  27. </div>
  28. <div class="mb">
  29. </div>
  30. </div> </li>
  31. <!--热门直播 end-->
  32. <!--直播预告 start-->
  33. <li id="foreshow" class="w1200 channel-comfloor hotlive-20170124">
  34. <div class="m">
  35. <div class="mc">
  36. <ul class="list">
  37. <li class='no-record'><p style="height:30px;line-height:30px;text-align:center;">{$Think.lang.ds_common_result_null}</p></li>
  38. </ul>
  39. </div>
  40. <div class="mb">
  41. </div>
  42. </div> </li>
  43. <!--精彩回放 end-->
  44. <li id="playback" class="w1200 channel-comfloor hotlive-20170124">
  45. <div class="m">
  46. <div class="mc">
  47. <div class="anchor-list">
  48. <ul class="list">
  49. <li class='no-record'><p style="height:30px;line-height:30px;text-align:center;">{$Think.lang.ds_common_result_null}</p></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="mb">
  55. </div> </li>
  56. <!--精彩回放 end-->
  57. </ul>
  58. </div>
  59. <script id="goods_template" type="text/html">
  60. <li class="c-live J-tips1">
  61. <div class="anchor">
  62. <%=store_name%>
  63. </div>
  64. <div class="player-box">
  65. <div class="player"></div>
  66. <div class="player-img" style="<%if(!live_apply_cover_video){%>background-image:url(<%=live_apply_cover_image_url%>)<%}else{%>background-color:#000<%}%>">
  67. <%if(live_apply_cover_video){%>
  68. <video style='width:100%;height:100%' src="<%=live_apply_cover_video_url%>" muted="muted" autoplay="autoplay" loop="loop" />
  69. <%}%>
  70. </div>
  71. <div class="player-info">
  72. <div class="p-static">
  73. <i></i>
  74. <%if(state==1){%>
  75. {$Think.lang.live_on}
  76. <%}%>
  77. <%if(state==2){%>
  78. {$Think.lang.live_wait}
  79. <%}%>
  80. <%if(state==3){%>
  81. {$Think.lang.live_end}
  82. <%}%>
  83. </div>
  84. <a class="player-btn" href="{:url('MemberLive/index')}?live_apply_id=<%=live_apply_id%>"> <span></span> </a>
  85. <div class="zan-btn">
  86. <i></i>
  87. <span></span>
  88. </div>
  89. </div>
  90. <div class="player-title">
  91. <div class="p-tips1">
  92. <%if(state==2){%>
  93. <%=live_apply_play_time_text%>{$Think.lang.go_to_play}
  94. <%}%>
  95. </div>
  96. <div class="p-tips2">
  97. <%=live_apply_name%>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="anchor-products">
  102. <%if(!goods_list.length){%>
  103. <div class="noshare-tips">
  104. <i></i>
  105. <p>{$Think.lang.no_goods_share}</p>
  106. <p>{$Think.lang.play_with_video_user}</p>
  107. </div>
  108. <%}else{%>
  109. <dl class="live-products">
  110. <dt>
  111. </dt>
  112. <dd style="position: relative;">
  113. <ul style="left:0;width:<%=goods_list.length*162%>px">
  114. <%for(var i in goods_list){%>
  115. <li class="fore0 J-list">
  116. <div class="p-img">
  117. <a href="{:url('MemberLive/index')}?live_apply_id=<%=live_apply_id%>"> <img width="152" height="152" src="<%=goods_list[i].goods_image%>" /> </a>
  118. </div>
  119. <div class="p-name">
  120. <%=goods_list[i].goods_name%>
  121. </div>
  122. <div class="p-price">
  123. <span class="J-p-63213282503"><strong>&yen;</strong><%=goods_list[i].goods_price%></span>
  124. <del class="J-m-63213282503">
  125. &yen;<%=goods_list[i].goods_marketprice%>
  126. </del>
  127. </div> </li>
  128. <%}%>
  129. </ul>
  130. <div class="page-box">
  131. <a onclick="goSlide($(this).parent().prev(), 0)" class="page-prev page-btn" href="javascript:void(0);">&lt;</a>
  132. <a onclick="goSlide($(this).parent().prev(), 1)" class="page-next page-btn" href="javascript:void(0);">&gt;</a>
  133. </div>
  134. </dd>
  135. </dl>
  136. <%}%>
  137. </div> </li>
  138. </script>
  139. <script src="{$Think.PLUGINS_SITE_ROOT}/template.min.js"></script>
  140. <script>
  141. $(function(){
  142. loadMore()
  143. })
  144. function changeTab(index) {
  145. $('#ceilinglamp li').removeClass('curr-layout')
  146. $('.content-layout li').removeClass('curr-layout')
  147. switch (index) {
  148. case 0:
  149. $('.fore0').addClass('curr-layout')
  150. $('#pc-hotlive').addClass('curr-layout')
  151. break;
  152. case 1:
  153. $('.fore1').addClass('curr-layout')
  154. $('#foreshow').addClass('curr-layout')
  155. break;
  156. case 2:
  157. $('.fore2').addClass('curr-layout')
  158. $('#playback').addClass('curr-layout')
  159. break;
  160. }
  161. loadMore()
  162. }
  163. function goSlide(obj, dir) {
  164. var left = obj.position().left;
  165. if (dir) {
  166. //向右
  167. if (-left >= (Math.ceil(obj.find('li').length / 3) - 1) * 162) {
  168. return
  169. }
  170. obj.css('left', (left - (162 * 3)) + 'px')
  171. } else {
  172. if (left >= 0) {
  173. return
  174. }
  175. obj.css('left', (left + (162 * 3)) + 'px')
  176. }
  177. }
  178. $(window).on("scroll", function () {
  179. var windowHeight = $(window).height();//当前窗口的高度
  180. var scrollTop = $(window).scrollTop();//当前滚动条从上往下滚动的距离
  181. var docHeight = $(document).height(); //当前文档的高度
  182. //当 滚动条距底部的距离 + 滚动条滚动的距离 >= 文档的高度 - 窗口的高度
  183. //换句话说:(滚动条滚动的距离 + 窗口的高度 = 文档的高度) 这个是基本的公式
  184. if (scrollTop + windowHeight + 500 >= docHeight) {
  185. loadMore()
  186. }
  187. });
  188. var page = new Array(0, 0, 0);
  189. var no_more = new Array(false, false, false);
  190. function loadMore() {
  191. var index
  192. var state
  193. var obj
  194. index = 0
  195. state = 1
  196. obj='pc-hotlive'
  197. if ($('.fore0').hasClass('curr-layout')) {
  198. } else if ($('.fore1').hasClass('curr-layout')) {
  199. index = 1
  200. state = 2
  201. obj='foreshow'
  202. } else if ($('.fore2').hasClass('curr-layout')) {
  203. index = 2
  204. state = 3
  205. obj='playback'
  206. }
  207. if (no_more[index]) {
  208. return
  209. }
  210. page[index]++
  211. $.getJSON(HOMESITEURL + '/Live/get_live_list', {state: state, page: page[index]}, function (res) {
  212. if (!res.result.hasmore) {
  213. no_more[index] = true
  214. }
  215. if(res.result.live_apply_list.length){
  216. $('#'+obj+' .no-record').hide()
  217. }
  218. for(var i in res.result.live_apply_list){
  219. var item = template.render('goods_template', res.result.live_apply_list[i]);
  220. $('#'+obj+' .list').append(item);
  221. }
  222. })
  223. }
  224. </script>
  225. {/block}