index.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <extend name="Public:mogubase" />
  2. <block name="content">
  3. <script src="__PUBLIC__/js/jquery/jquery-2.0.3.min.js"></script>
  4. <link rel="stylesheet" type="text/css" href="__PUBLIC__/mogu/index.css" media="all" />
  5. <link rel="stylesheet" href="__PUBLIC__/mogu/aZsui7zFTG4yb9jnBh219.css">
  6. <link rel="stylesheet" type="text/css" href="__PUBLIC__/mogu/base-22357a5508.css" media="all" />
  7. <link rel="stylesheet" type="text/css" href="__PUBLIC__/mogu/pinIndex-2.css?v=232" media="all" />
  8. <script type="text/javascript"> window.use_screen_base = '750'; (function(a,b){var c="orientationchange"in b?"orientationchange":"resize",d=use_screen_base.indexOf("_mate"),e=parseInt(use_screen_base),f=a.documentElement,g=function(){var a=f.clientWidth,c=b.innerWidth;f.style.fontSize=100*(c/e)+"px"};if(/iPad.*OS|iPhone.*OS/.test(navigator.userAgent)&&d>0){var h=a.querySelectorAll("meta[name=viewport]"),i=b.devicePixelRatio;i=i!=1?2:1,h[0]&&h[0].setAttribute("content","width=device-width, user-scalable=no, minimum-scale="+1/i+", maximum-scale="+1/i+", initial-scale="+1/i)}g(),b.addEventListener(c,g,!1),delete use_screen_base})(document,window); </script>
  9. <style>
  10. .bannerPic, .banner_box, .swipe-wrap{ height:auto;}
  11. </style>
  12. <!-- 顶部轮播banner -->
  13. <div id="slider" class="swipe" style="visibility:visible">
  14. <div class="swipe-wrap">
  15. <div class=" lazyloadBg">
  16. <a class=" lazyload-img-end" href="{$slider_nav.url}" style="">
  17. <img src="{$slider_nav.image}" width="100%" />
  18. </a>
  19. </div>
  20. </div>
  21. <div class="swipe-indicator"></div>
  22. </div>
  23. <!-- 顶部轮播banner end -->
  24. <!-- 顶部轮播 1分 banner -->
  25. <div id="slider1" class="swipe" style="visibility:visible;display:none;">
  26. <div class="">
  27. <div class=" lazyloadBg">
  28. <a class=" lazyload-img-end" href="{$slider_newman.url}" style="">
  29. <img src="{$slider_newman.image}" width="100%" />
  30. </a>
  31. </div>
  32. </div>
  33. <div class="swipe-indicator"></div>
  34. </div>
  35. <!-- 顶部轮播banner end -->
  36. <!-- 顶部轮播 抽奖 banner -->
  37. <div id="slider2" class="swipe" style="visibility:visible;display:none;">
  38. <div class="">
  39. <div class=" lazyloadBg">
  40. <a class=" lazyload-img-end" href="{$slider_lottery.url}" >
  41. <img src="{$slider_lottery.image}" width="100%" />
  42. </a>
  43. </div>
  44. </div>
  45. <div class="swipe-indicator"></div>
  46. </div>
  47. <!-- 顶部轮播banner end -->
  48. <div class="list_wrap">
  49. <div class="tab_content goods_wall rec-show-log module_row waterfall-container" id="best_pintuan_wrap">
  50. </div>
  51. </div>
  52. <script src="__PUBLIC__/js/jquery.tmpl.min.js"></script>
  53. <script>
  54. var load_pintuan_url ="{:U('Apiindex/load_index_pintuan')}";
  55. var is_can_next = 1;
  56. var goods_page = 1;
  57. var type = '<?php echo $type; ?>';
  58. var is_index_show =2;
  59. function loaddata()
  60. {
  61. var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度
  62. if ($(document).height() <= totalheight+200) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据
  63. {
  64. if(is_can_next == 1)//加载数据
  65. {
  66. is_can_next = 0;
  67. nextpage();
  68. }
  69. }
  70. }
  71. function nextpage()
  72. {
  73. //is_index_show
  74. if(type == 'all')
  75. {
  76. is_index_show = 2;
  77. }else {
  78. is_index_show = 2;
  79. }
  80. $('#center_pullup').show();
  81. $.ajax(
  82. {
  83. url: load_pintuan_url,
  84. type:'get',
  85. data:{page:goods_page,per_page:10,type:type,is_index_show:is_index_show},
  86. dataType: 'json',
  87. success: function(ret){
  88. var links = [];
  89. if(ret.code == 0)
  90. {
  91. var s_data = ret.data;
  92. for(var i in s_data){
  93. var s_tmp = {};
  94. s_tmp.url = s_data[i].url;
  95. s_tmp.fan_image = s_data[i].image;
  96. s_tmp.name = s_data[i].name;
  97. s_tmp.pin_price = s_data[i].pin_price;
  98. s_tmp.price = s_data[i].danprice;
  99. s_tmp.pin_count = s_data[i].pin_count;
  100. s_tmp.seller_count = s_data[i].seller_count;
  101. links.push(s_tmp);
  102. }
  103. $('#best_pintuan').tmpl(links).appendTo('#best_pintuan_wrap');
  104. goods_page++;
  105. is_can_next = 1;
  106. //bindImgEvent();
  107. } else if(ret.code == 1) {
  108. is_can_next = 0;
  109. }
  110. }
  111. }
  112. );
  113. }
  114. $(function(){
  115. nextpage();
  116. //load best goods
  117. $(window).scroll( function() {
  118. loaddata();
  119. });
  120. })
  121. </script>
  122. <script id="best_pintuan" type="text/x-jquery-tmpl">
  123. <a class="goods_box show-log-item cube-acm-node waterfall-frame-0 waterfall-box waterfall-optimise-show" href="${url}">
  124. <div class="pic_box lazyloadBg">
  125. <div class="lazyload-img-end" style="background-image: url(${fan_image}); background-size: cover;">
  126. {{if type === 'lottery' }}
  127. <img class="flag" src="__PUBLIC__/mogu/image/170731_5e428cacel8ffj5197i38136ii525_168x60.png">
  128. {{/if}}
  129. </div>
  130. </div>
  131. <div class="content">
  132. <h2>${name}</h2>
  133. <div class="l_box">
  134. <p class="price_box">
  135. <span>¥${pin_price}</span>
  136. <del>
  137. ¥${price}
  138. </del>
  139. </p>
  140. <p> ${pin_count}人团 <b> &middot; </b>已团${seller_count}件 </p>
  141. </div>
  142. <div class="open_tuan_btn">
  143. 去开团
  144. </div>
  145. </div>
  146. </a>
  147. </script>
  148. <div id="views">
  149. <div class="page_activity page_type_h5 ">
  150. <div class="module_row module_row_116980 MOD_ID_116891">
  151. <div class="mod_row MCUBE_MOD_ID_116891">
  152. <div class="wall-wrap waterfall-container" id="goods_content">
  153. <p class="hint" style="display: none;">
  154. 数据加载中...
  155. </p>
  156. </div>
  157. </div>
  158. </div>
  159. <div class="module_row module_row_423645 MOD_ID_60139" >
  160. <div class="mod_row MCUBE_MOD_ID_60139">
  161. <a class="to-top-btn J_toTop" href="javascript:;" style="display: none;"></a>
  162. </div>
  163. </div>
  164. <div class="bottom_tab" a="1">
  165. <a href="javascript:;" data-url="all" class="tab change_type <?php if($type == 'all'){ ?> cur<?php } ?>">
  166. <span class="normal" style=" background-size: .5rem;">
  167. 拼团首页</span>
  168. </a>
  169. <a href="javascript:;" data-url="newman" class="tab change_type <?php if($type == 'all'){ ?> cur<?php } ?>">
  170. <span class="newman" style=" background-size: .5rem;">
  171. 1分拼团</span>
  172. </a>
  173. <a href="javascript:;" data-url="lottery" class="tab change_type <?php if($type == 'all'){ ?> cur<?php } ?>">
  174. <span class="lottery" style=" background-size: .5rem;">
  175. 抽奖团</span>
  176. </a>
  177. <a href="{:U('Pingoods/pinlist')}" class="tab">
  178. <span style="background: url(__PUBLIC__/mogu/image/170821_7a759fga0l98jjhjejigh94hj34ii_72x72.png) no-repeat top center; background-size: .5rem;">
  179. 我的拼团</span>
  180. </a>
  181. </div>
  182. <div class="module_row module_row_118905 MOD_ID_45043" >
  183. <div class="mod_row MCUBE_MOD_ID_45043">
  184. </div>
  185. </div>
  186. <div class="module_row module_row_144077 MOD_ID_144060" >
  187. <div class="mod_row MCUBE_MOD_ID_144060">
  188. <div class="maskWrap">
  189. </div>
  190. <input type="hidden" class="popConfig" data-pop="1">
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <div class="detail-plus" id="DetailPlus">
  196. <a href="{:U('Index/index')}" class="gotop"></a>
  197. </div>
  198. <include file="Widget:pin_notify" />
  199. {~W('Share/common_pin_share')}
  200. <style>
  201. .detail-plus {
  202. width: 0.88rem;
  203. height: 0.9rem;
  204. position: fixed;
  205. z-index: 9999999999999999;
  206. right: .1rem;
  207. bottom: 1.5rem;
  208. }
  209. .detail-plus .cart, .detail-plus .gotop {
  210. background: url(__PUBLIC__/mogu/image/back_index.png) no-repeat;
  211. background-size: 0.8rem;
  212. }
  213. .detail-plus .gotop {
  214. background-position: 0 0rem;
  215. width: 0.9rem;
  216. height: 0.9rem;
  217. display: block;
  218. }
  219. .lottery{
  220. background: url(__PUBLIC__/mogu/image/170821_5951l6h436ig1l7010fj37e05iehg_72x72.png) no-repeat top center;
  221. }
  222. .cur .lottery{
  223. background: url(__PUBLIC__/mogu/image/170821_1a06lb2h8eic8gc30ifcc2c3716e3_75x72.png) no-repeat top center;
  224. }
  225. .newman{
  226. background: url(__PUBLIC__/mogu/image/170821_4caa2bah1797i0c1f1824hlih1g30_72x72.png) no-repeat top center;
  227. }
  228. .cur .newman{
  229. background: url(__PUBLIC__/mogu/image/170821_7lakih42kd5d5dg86gj6681dh76gg_72x72.png) no-repeat top center;
  230. }
  231. .normal{
  232. background: url(__PUBLIC__/mogu/image/170821_7l5785llaikkj4e5al161lj49468e_72x72.png) no-repeat top center;
  233. }
  234. .cur .normal{
  235. background: url(__PUBLIC__/mogu/image/170821_2ifi3kcb9j91jae76fc6jh00hc4fl_72x72.png) no-repeat top center;
  236. }
  237. </style>
  238. <script>
  239. var is_can_next = 1;
  240. var goods_page = 1;
  241. $('.change_type').click(function(){
  242. var new_type = $(this).attr('data-url');
  243. var new_type = $(this).attr('data-url');
  244. if(new_type == 'all')
  245. {
  246. $('#slider1').hide();
  247. $('#slider2').hide();
  248. $('#slider').show();
  249. }else if(new_type == 'newman')
  250. {
  251. $('#slider2').hide();
  252. $('#slider').hide();
  253. $('#slider1').show();
  254. }else if(new_type == 'lottery')
  255. {
  256. $('#slider').hide();
  257. $('#slider1').hide();
  258. $('#slider2').show();
  259. }
  260. $(this).addClass('cur').siblings().removeClass('cur');
  261. is_can_next = 0;
  262. goods_page = 1;
  263. type = new_type;
  264. $('#best_pintuan_wrap').html('');
  265. nextpage();
  266. })
  267. $('.mb_go2pre').click(function(){
  268. $('.mb_go2pre').hide();
  269. $('.home_btn').show();
  270. $('#js-hotwords').hide();
  271. })
  272. </script>
  273. </block>