|
@@ -2,7 +2,7 @@ |
|
@@ -2,7 +2,7 @@ |
2
|
* @Author: Targaryen
|
2
|
* @Author: Targaryen
|
3
|
* @Date: 2017-04-26 17:19:19
|
3
|
* @Date: 2017-04-26 17:19:19
|
4
|
* @Last Modified by: Targaryen
|
4
|
* @Last Modified by: Targaryen
|
5
|
- * @Last Modified time: 2017-05-02 13:51:31
|
5
|
+ * @Last Modified time: 2017-05-02 14:40:52
|
6
|
*/
|
6
|
*/
|
7
|
'use strict';
|
7
|
'use strict';
|
8
|
|
8
|
|
|
@@ -10,7 +10,7 @@ const lazyLoad = require('yoho-jquery-lazyload'); |
|
@@ -10,7 +10,7 @@ const lazyLoad = require('yoho-jquery-lazyload'); |
10
|
|
10
|
|
11
|
import {Controller} from 'yoho-mvc';
|
11
|
import {Controller} from 'yoho-mvc';
|
12
|
import {
|
12
|
import {
|
13
|
- NavView
|
13
|
+ ListView
|
14
|
} from './view';
|
14
|
} from './view';
|
15
|
import {
|
15
|
import {
|
16
|
Guang
|
16
|
Guang
|
|
@@ -22,14 +22,14 @@ class IndexController extends Controller { |
|
@@ -22,14 +22,14 @@ class IndexController extends Controller { |
22
|
|
22
|
|
23
|
lazyLoad($('img.lazy'));
|
23
|
lazyLoad($('img.lazy'));
|
24
|
|
24
|
|
25
|
- this.navView = new NavView();
|
25
|
+ this.listView = new ListView();
|
26
|
this.guangModel = new Guang();
|
26
|
this.guangModel = new Guang();
|
27
|
|
27
|
|
28
|
this.page = 1;
|
28
|
this.page = 1;
|
29
|
this.onLoading = false;
|
29
|
this.onLoading = false;
|
30
|
|
30
|
|
31
|
- this.navView.on('tabchange', this.tabChange.bind(this));
|
|
|
32
|
- this.navView.on('loadmore', this.loadMore.bind(this));
|
31
|
+ this.listView.on('tabchange', this.tabChange.bind(this));
|
|
|
32
|
+ this.listView.on('loadmore', this.loadMore.bind(this));
|
33
|
}
|
33
|
}
|
34
|
|
34
|
|
35
|
/**
|
35
|
/**
|
|
@@ -47,7 +47,7 @@ class IndexController extends Controller { |
|
@@ -47,7 +47,7 @@ class IndexController extends Controller { |
47
|
let $result = $(result);
|
47
|
let $result = $(result);
|
48
|
|
48
|
|
49
|
lazyLoad($result.find('img.lazy'));
|
49
|
lazyLoad($result.find('img.lazy'));
|
50
|
- this.navView.listChange($result);
|
50
|
+ this.listView.listChange($result);
|
51
|
});
|
51
|
});
|
52
|
}
|
52
|
}
|
53
|
|
53
|
|
|
@@ -64,14 +64,14 @@ class IndexController extends Controller { |
|
@@ -64,14 +64,14 @@ class IndexController extends Controller { |
64
|
let noResult = !result || result.length < 1 || (result.list && result.list.length < 1);
|
64
|
let noResult = !result || result.length < 1 || (result.list && result.list.length < 1);
|
65
|
|
65
|
|
66
|
if (noResult) {
|
66
|
if (noResult) {
|
67
|
- this.navView.listAppend('<div class="search-divide">没有更多内容了...</div>');
|
67
|
+ this.listView.listAppend('<div class="search-divide">没有更多内容了...</div>');
|
68
|
return false;
|
68
|
return false;
|
69
|
}
|
69
|
}
|
70
|
|
70
|
|
71
|
let $result = $(result);
|
71
|
let $result = $(result);
|
72
|
|
72
|
|
73
|
lazyLoad($result.find('img.lazy'));
|
73
|
lazyLoad($result.find('img.lazy'));
|
74
|
- this.navView.listAppend($result);
|
74
|
+ this.listView.listAppend($result);
|
75
|
|
75
|
|
76
|
this.onLoading = false;
|
76
|
this.onLoading = false;
|
77
|
});
|
77
|
});
|