|
@@ -11,7 +11,10 @@ Page({ |
|
@@ -11,7 +11,10 @@ Page({ |
|
11
|
* 页面的初始数据
|
11
|
* 页面的初始数据
|
|
12
|
*/
|
12
|
*/
|
|
13
|
data: {
|
13
|
data: {
|
|
14
|
- list: [[],[],[],[],[]],
|
14
|
+ list: [
|
|
|
|
15
|
+ [],[],[],[],[],
|
|
|
|
16
|
+ [],[],[],[]
|
|
|
|
17
|
+ ],
|
|
15
|
total: 0,
|
18
|
total: 0,
|
|
16
|
tabType:1,
|
19
|
tabType:1,
|
|
17
|
hasMore:true,
|
20
|
hasMore:true,
|
|
@@ -85,9 +88,10 @@ Page({ |
|
@@ -85,9 +88,10 @@ Page({ |
|
85
|
offset:this.offset,
|
88
|
offset:this.offset,
|
|
86
|
limit:this.limit,
|
89
|
limit:this.limit,
|
|
87
|
}).then(res => {
|
90
|
}).then(res => {
|
|
88
|
- let total = res.data.length
|
|
|
|
89
|
- let data = this.formatList(res.data);
|
|
|
|
90
|
- this.hasMore=res.data.length>=this.limit
|
91
|
+ let resData=res.data||[]
|
|
|
|
92
|
+ let total = resData.length
|
|
|
|
93
|
+ let data = this.formatList(resData);
|
|
|
|
94
|
+ this.hasMore=resData.length>=this.limit
|
|
91
|
if(this.hasMore){
|
95
|
if(this.hasMore){
|
|
92
|
this.offset+=this.limit
|
96
|
this.offset+=this.limit
|
|
93
|
}
|
97
|
}
|
|
@@ -113,8 +117,9 @@ Page({ |
|
@@ -113,8 +117,9 @@ Page({ |
|
113
|
return dlist;
|
117
|
return dlist;
|
|
114
|
},
|
118
|
},
|
|
115
|
switchTab(e) {
|
119
|
switchTab(e) {
|
|
|
|
120
|
+ this.tabType=util.attr(e, 'index')
|
|
116
|
this.setData({
|
121
|
this.setData({
|
|
117
|
- tabFlag: util.attr(e, 'index'),
|
122
|
+ tabType: this.tabType,
|
|
118
|
})
|
123
|
})
|
|
119
|
this.getListData();
|
124
|
this.getListData();
|
|
120
|
},
|
125
|
},
|
|
@@ -153,7 +158,7 @@ Page({ |
|
@@ -153,7 +158,7 @@ Page({ |
|
153
|
this.tabType=util.attr(e,'type')
|
158
|
this.tabType=util.attr(e,'type')
|
|
154
|
this.setData({
|
159
|
this.setData({
|
|
155
|
tabType:this.tabType,
|
160
|
tabType:this.tabType,
|
|
156
|
- list: [[],[],[],[],[]],
|
161
|
+ list: [[],[],[],[],[],[],[],[],[]],
|
|
157
|
hasMore:false
|
162
|
hasMore:false
|
|
158
|
})
|
163
|
})
|
|
159
|
this.getListData()
|
164
|
this.getListData()
|