index.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. {% if 'pic' in data and data['pic'] %}
  35. <section class="m-wrapper">
  36. <div >
  37. <section class="img-wrap">
  38. <img src="{{data['pic']['value']}}" width="100%" />
  39. <p style="display:none;">{{data['pic']['cdates']}}</p>
  40. </section>
  41. </div>
  42. </section>
  43. {% end %}
  44. <section class="m-wrapper" id="dever-list">
  45. <div >
  46. {% for v in data['list'] %}
  47. <section class="img-wrap">
  48. <img src="{{v['pic']}}" width="100%" />
  49. <p style="display:none;">{{v['cdates']}}</p>
  50. </section>
  51. {% end %}
  52. </div>
  53. {% if data['page']['total'] > 1 %}
  54. {%set current = int(data['page']['current']) %}
  55. {% if current > 1 %}
  56. {%set prev = current-1 %}
  57. {% else %}
  58. {%set prev = 1 %}
  59. {% end %}
  60. {% if current > data['page']['total'] %}
  61. {%set next = data['page']['total'] %}
  62. {% else %}
  63. {%set next = current+1 %}
  64. {% end %}
  65. {%set url = '/origin?id=' + data['info']['id'] %}
  66. {% if '?' in url %}
  67. {%set cUrl = url +'&page=' %}
  68. {% else %}
  69. {%set cUrl = url +'?page=' %}
  70. {% end %}
  71. <section class="loading-more paging" {% if next != data['page']['total']%}link="{{cUrl}}{{next}}"{% end %} dever-list="#dever-list"><i></i>加载中...</section>
  72. <script>
  73. //瀑布流分页
  74. var _Dever_Page =
  75. {
  76. name : '.paging',
  77. Init : function()
  78. {
  79. if ($(this.name).length) {
  80. var self = this;
  81. $(window).scroll(function() {
  82. if ($(window).scrollTop() >= $(document).height() - $(window).height()) {
  83. self.Start(self.name);
  84. }
  85. });
  86. }
  87. }
  88. ,Start : function(page)
  89. {
  90. page = page ? page : this.name;
  91. if ($(page).length) {
  92. $(page).hide();
  93. var url = $(page + ':last').attr('link');
  94. if (url) {
  95. $(".loading-more").show();
  96. var key = $(page).attr('dever-list');
  97. $.get(url, function(t) {
  98. t = '<div>' + t + '</div>';
  99. var c = $(t).find(key).html();
  100. if (c) {
  101. $(key).append(c);
  102. $(".loading-more").hide();
  103. var l = $(t).find(page).attr('link');
  104. $(page).attr('link', l);
  105. }
  106. });
  107. }
  108. }
  109. }
  110. ,Ajax : function(e)
  111. {
  112. var self = this;
  113. e.find('a').each(function() {
  114. var url = $(this).attr('href');
  115. $(this).attr('href', 'javascript:;');
  116. $(this).unbind('click').bind('click', function() {
  117. $.get(url.replace('callback', ''), function(t) {
  118. e.html(t);
  119. self.Ajax(e);
  120. });
  121. });
  122. });
  123. }
  124. }
  125. $(function()
  126. {
  127. _Dever_Page.Init();
  128. });
  129. </script>
  130. {% end %}
  131. </section>
  132. </body>
  133. </html>