index.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. {%include '../inc/header.html'%}
  5. <link href="{{static_url('mobile/css/index.css')}}" rel="stylesheet">
  6. {%include '../inc/script.html'%}
  7. </head>
  8. <body>
  9. <section class="m-wrapper">
  10. {%include 'menu.html'%}
  11. <section class="banner">
  12. <img src="{{data['info']['pic']}}" width="100%">
  13. </section>
  14. <section class="li-1">
  15. <dl>
  16. <dt><i class="ico ico1"></i></dt>
  17. <dd class="tit">{{data['info']['name']}}</dd>
  18. <dd>批次:{{data['info']['number']}}号</dd>
  19. </dl>
  20. <dl>
  21. <dt><i class="ico ico2"></i></dt>
  22. <dd class="tit">{{data['farm']['name']}}</dd>
  23. <dd>{{data['farm']['address']}}<br>{{data['farm']['tel']}}</dd>
  24. </dl>
  25. <dl>
  26. <dt><i class="ico ico3"></i></dt>
  27. <dd class="tit green">{{data['zhou']}}天</dd>
  28. <dd>{{data['info']['zzdates']}}种植 ~ {{data['info']['csdates']}}采收</dd>
  29. </dl>
  30. </section>
  31. </section>
  32. <section class="m-wrapper" id="dever-list">
  33. <div >
  34. {% for v in data['list'] %}
  35. <section class="img-wrap">
  36. <img src="{{v['pic']}}" width="100%" />
  37. <p>{{v['cdates']}}</p>
  38. </section>
  39. {% end %}
  40. </div>
  41. {% if data['page']['total'] > 1 %}
  42. {%set current = int(data['page']['current']) %}
  43. {% if current > 1 %}
  44. {%set prev = current-1 %}
  45. {% else %}
  46. {%set prev = 1 %}
  47. {% end %}
  48. {% if current > data['page']['total'] %}
  49. {%set next = data['page']['total'] %}
  50. {% else %}
  51. {%set next = current+1 %}
  52. {% end %}
  53. {%set url = '/origin?id=' + data['info']['id'] %}
  54. {% if '?' in url %}
  55. {%set cUrl = url +'&page=' %}
  56. {% else %}
  57. {%set cUrl = url +'?page=' %}
  58. {% end %}
  59. <section class="loading-more paging" {% if next != data['page']['total']%}link="{{cUrl}}{{next}}"{% end %} dever-list="#dever-list"><i></i>加载中...</section>
  60. <script>
  61. //瀑布流分页
  62. var _Dever_Page =
  63. {
  64. name : '.paging',
  65. Init : function()
  66. {
  67. if ($(this.name).length) {
  68. var self = this;
  69. $(window).scroll(function() {
  70. if ($(window).scrollTop() >= $(document).height() - $(window).height()) {
  71. self.Start(self.name);
  72. }
  73. });
  74. }
  75. }
  76. ,Start : function(page)
  77. {
  78. page = page ? page : this.name;
  79. if ($(page).length) {
  80. $(page).hide();
  81. var url = $(page + ':last').attr('link');
  82. if (url) {
  83. $(".loading-more").show();
  84. var key = $(page).attr('dever-list');
  85. $.get(url, function(t) {
  86. t = '<div>' + t + '</div>';
  87. var c = $(t).find(key).html();
  88. if (c) {
  89. $(key).append(c);
  90. $(".loading-more").hide();
  91. var l = $(t).find(page).attr('link');
  92. $(page).attr('link', l);
  93. }
  94. });
  95. }
  96. }
  97. }
  98. ,Ajax : function(e)
  99. {
  100. var self = this;
  101. e.find('a').each(function() {
  102. var url = $(this).attr('href');
  103. $(this).attr('href', 'javascript:;');
  104. $(this).unbind('click').bind('click', function() {
  105. $.get(url.replace('callback', ''), function(t) {
  106. e.html(t);
  107. self.Ajax(e);
  108. });
  109. });
  110. });
  111. }
  112. }
  113. $(function()
  114. {
  115. _Dever_Page.Init();
  116. });
  117. </script>
  118. {% end %}
  119. </section>
  120. </body>
  121. </html>