|
@@ -37,13 +37,17 @@ export default class Index extends Component {
|
37
|
37
|
console.log('活动列表')
|
38
|
38
|
})
|
39
|
39
|
}
|
40
|
|
-
|
41
|
|
- componentDidShow () {
|
|
40
|
+ onPageScroll(e) {
|
|
41
|
+ console.log(e,"e")
|
|
42
|
+ //这个就是滚动到的位置,可以用这个位置来写判断
|
|
43
|
+ }
|
|
44
|
+
|
|
45
|
+ componentDidShow() {
|
42
|
46
|
// // this.onPullDownRefresh()
|
43
|
47
|
// console.log('----', this)
|
44
|
48
|
this.loadData(1)
|
45
|
49
|
}
|
46
|
|
-
|
|
50
|
+
|
47
|
51
|
componentWillUnmount() {
|
48
|
52
|
const { recordId } = this.state
|
49
|
53
|
recordId && updatePoint(recordId)
|
|
@@ -99,7 +103,7 @@ export default class Index extends Component {
|
99
|
103
|
|
100
|
104
|
// debugger
|
101
|
105
|
rest && rest()
|
102
|
|
-
|
|
106
|
+
|
103
|
107
|
this.refreshing = false
|
104
|
108
|
}
|
105
|
109
|
|
|
@@ -111,9 +115,9 @@ export default class Index extends Component {
|
111
|
115
|
|
112
|
116
|
loadData = (page) => {
|
113
|
117
|
this.loadList(page).then(res => {
|
114
|
|
- const {records, list, total, current, pages} = res || {}
|
|
118
|
+ const { records, list, total, current, pages } = res || {}
|
115
|
119
|
const _list = records || list || []
|
116
|
|
- const newList = current <= 1 ? _list: this.state.list.concat(_list)
|
|
120
|
+ const newList = current <= 1 ? _list : this.state.list.concat(_list)
|
117
|
121
|
|
118
|
122
|
this.setState({
|
119
|
123
|
list: newList,
|
|
@@ -133,6 +137,7 @@ export default class Index extends Component {
|
133
|
137
|
isEmpty={isEmpty}
|
134
|
138
|
emptyText="暂无活动~"
|
135
|
139
|
hasMore={hasMore}
|
|
140
|
+ onPageScroll={fn=>this.onPageScroll(fn)}
|
136
|
141
|
onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
|
137
|
142
|
onScrollToLower={fn => this.onScrollToLower(fn)}
|
138
|
143
|
>
|