index.html 4.5 KB

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