|
@@ -3,6 +3,7 @@
|
|
|
<head>
|
|
|
{%include '../inc/header.html'%}
|
|
|
<link href="{{static_url('mobile/css/index.css')}}" rel="stylesheet">
|
|
|
+ {%include '../inc/script.html'%}
|
|
|
</head>
|
|
|
<body>
|
|
|
<section class="m-wrapper">
|
|
@@ -28,16 +29,101 @@
|
|
|
</dl>
|
|
|
</section>
|
|
|
</section>
|
|
|
- <section class="m-wrapper">
|
|
|
- {% for v in data['list'] %}
|
|
|
- <section class="img-wrap">
|
|
|
- <img src="{{v['pic']}}" width="100%" />
|
|
|
- <p>{{v['cdates']}}</p>
|
|
|
- </section>
|
|
|
+ <section class="m-wrapper" id="dever-list">
|
|
|
+ <div >
|
|
|
+ {% for v in data['list'] %}
|
|
|
+ <section class="img-wrap">
|
|
|
+ <img src="{{v['pic']}}" width="100%" />
|
|
|
+ <p>{{v['cdates']}}</p>
|
|
|
+ </section>
|
|
|
+ {% end %}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {% if data['page']['total'] > 1 %}
|
|
|
+ {%set current = int(data['page']['current']) %}
|
|
|
+ {% if current > 1 %}
|
|
|
+ {%set prev = current-1 %}
|
|
|
+ {% else %}
|
|
|
+ {%set prev = 1 %}
|
|
|
+ {% end %}
|
|
|
+
|
|
|
+ {% if current > data['page']['total'] %}
|
|
|
+ {%set next = data['page']['total'] %}
|
|
|
+ {% else %}
|
|
|
+ {%set next = current+1 %}
|
|
|
+ {% end %}
|
|
|
+ {%set url = '/origin?id=' + data['info']['id'] %}
|
|
|
+ {% if '?' in url %}
|
|
|
+ {%set cUrl = url +'&page=' %}
|
|
|
+ {% else %}
|
|
|
+ {%set cUrl = url +'?page=' %}
|
|
|
+ {% end %}
|
|
|
+
|
|
|
+ <section class="loading-more paging" {% if next != data['page']['total']%}link="{{cUrl}}{{next}}"{% end %} dever-list="#dever-list"><i></i>加载中...</section>
|
|
|
+ <script>
|
|
|
+ //瀑布流分页
|
|
|
+ var _Dever_Page =
|
|
|
+ {
|
|
|
+ name : '.paging',
|
|
|
+ Init : function()
|
|
|
+ {
|
|
|
+ if ($(this.name).length) {
|
|
|
+ var self = this;
|
|
|
+ $(window).scroll(function() {
|
|
|
+ if ($(window).scrollTop() >= $(document).height() - $(window).height()) {
|
|
|
+ self.Start(self.name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ,Start : function(page)
|
|
|
+ {
|
|
|
+ page = page ? page : this.name;
|
|
|
+ if ($(page).length) {
|
|
|
+ $(page).hide();
|
|
|
+ var url = $(page + ':last').attr('link');
|
|
|
+ if (url) {
|
|
|
+ $(".loading-more").show();
|
|
|
+ var key = $(page).attr('dever-list');
|
|
|
+ $.get(url, function(t) {
|
|
|
+ t = '<div>' + t + '</div>';
|
|
|
+ var c = $(t).find(key).html();
|
|
|
+ if (c) {
|
|
|
+ $(key).append(c);
|
|
|
+ $(".loading-more").hide();
|
|
|
+ var l = $(t).find(page).attr('link');
|
|
|
+ $(page).attr('link', l);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ,Ajax : function(e)
|
|
|
+ {
|
|
|
+ var self = this;
|
|
|
+ e.find('a').each(function() {
|
|
|
+ var url = $(this).attr('href');
|
|
|
+
|
|
|
+ $(this).attr('href', 'javascript:;');
|
|
|
+
|
|
|
+ $(this).unbind('click').bind('click', function() {
|
|
|
+ $.get(url.replace('callback', ''), function(t) {
|
|
|
+ e.html(t);
|
|
|
+ self.Ajax(e);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $(function()
|
|
|
+ {
|
|
|
+ _Dever_Page.Init();
|
|
|
+ });
|
|
|
+ </script>
|
|
|
{% end %}
|
|
|
- <section class="loading-more"><i></i>加载中...</section>
|
|
|
</section>
|
|
|
|
|
|
-{%include '../inc/script.html'%}
|
|
|
</body>
|
|
|
</html>
|