许静 5 년 전
부모
커밋
8d178b2fde
1개의 변경된 파일6개의 추가작업 그리고 11개의 파일을 삭제
  1. 6
    11
      src/pages/activity/index.js

+ 6
- 11
src/pages/activity/index.js 파일 보기

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