|
@@ -3,19 +3,20 @@
|
|
|
<statusBar :item="navbarData"></statusBar>
|
|
|
<!-- 消息提示 -->
|
|
|
<msgPop></msgPop>
|
|
|
- <view class="list">
|
|
|
+ <view>
|
|
|
+ <listBlock1 ref="listBlock1" :classList='classList'></listBlock1>
|
|
|
+ </view>
|
|
|
+ <view class="loading">
|
|
|
+ <view v-if="Loading==1">数据加载中...</view>
|
|
|
+ <view v-if="Loading==2">没有更多了~~</view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="list">
|
|
|
<scroll-view style="height: 100%;" scroll-y="true" refresher-enabled='true' :refresher-triggered="trigger"
|
|
|
- @refresherrefresh='pulling' @scrolltolower="lower">
|
|
|
- <view>
|
|
|
- <listBlock1 ref="listBlock1" :classList='classList'></listBlock1>
|
|
|
- </view>
|
|
|
- <view class="loading">
|
|
|
- <view v-if="Loading==1">数据加载中...</view>
|
|
|
- <view v-if="Loading==2">没有更多了~~</view>
|
|
|
- </view>
|
|
|
+ @refresherrefresh='pulling'>
|
|
|
+
|
|
|
</scroll-view>
|
|
|
- </view>
|
|
|
-
|
|
|
+ </view> -->
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -29,7 +30,7 @@
|
|
|
},
|
|
|
|
|
|
// 控制刷新
|
|
|
- trigger: false,
|
|
|
+ trigger: false,
|
|
|
// 渲染数据
|
|
|
classList: [],
|
|
|
// 触底加载动画提示
|
|
@@ -48,7 +49,7 @@
|
|
|
setTimeout(() => {
|
|
|
this.trigger = false;
|
|
|
}, 1000);
|
|
|
-
|
|
|
+
|
|
|
// 资源库
|
|
|
this.classList = []
|
|
|
this.Loading = 0 //0默认值 1加载中 2没有更多了
|
|
@@ -56,14 +57,14 @@
|
|
|
|
|
|
this.getData()
|
|
|
},
|
|
|
- // 触底
|
|
|
- lower() {
|
|
|
- console.log('没触底?');
|
|
|
- if (this.Loading == 2) return
|
|
|
- this.Loading = 1
|
|
|
- this.currentPage++
|
|
|
- setTimeout(this.getData, 1000)
|
|
|
- },
|
|
|
+ // // 触底
|
|
|
+ // lower() {
|
|
|
+ // console.log('没触底?');
|
|
|
+ // if (this.Loading == 2) return
|
|
|
+ // this.Loading = 1
|
|
|
+ // this.currentPage++
|
|
|
+ // setTimeout(this.getData, 1000)
|
|
|
+ // },
|
|
|
// 获取页面数据
|
|
|
getData() {
|
|
|
let data = {
|
|
@@ -74,7 +75,11 @@
|
|
|
}
|
|
|
this.$request('/selectActivity', "POST", data).then(res => {
|
|
|
// console.log('获取数据', res[0]);
|
|
|
-
|
|
|
+
|
|
|
+ if (this.currentPage == 1) {
|
|
|
+ this.classList = []
|
|
|
+ }
|
|
|
+
|
|
|
if (!res[0].length) {
|
|
|
this.Loading = 2
|
|
|
} else {
|
|
@@ -88,23 +93,26 @@
|
|
|
},
|
|
|
},
|
|
|
// 触底加载更多
|
|
|
- // onReachBottom() {
|
|
|
- // if (this.newsLoading == 2) {
|
|
|
- // return
|
|
|
- // }
|
|
|
- // this.newsLoading = 1
|
|
|
- // this.currentPage++
|
|
|
- // setTimeout(this.getData, 2000)
|
|
|
-
|
|
|
- // },
|
|
|
+ onReachBottom() {
|
|
|
+ // if (this.newsLoading == 2) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // this.newsLoading = 1
|
|
|
+ // this.currentPage++
|
|
|
+ // setTimeout(this.getData, 1000)
|
|
|
+ console.log('没触底?');
|
|
|
+ if (this.Loading == 2) return
|
|
|
+ this.Loading = 1
|
|
|
+ this.currentPage++
|
|
|
+ setTimeout(this.getData, 1000)
|
|
|
+ },
|
|
|
onLoad() {
|
|
|
// this.getData()
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.classList= []
|
|
|
// 一进页面就加载数据
|
|
|
this.getData()
|
|
|
-
|
|
|
+
|
|
|
this.$refs.listBlock1.getdata()
|
|
|
// this.$refs.listBlock1.getSub()
|
|
|
}
|
|
@@ -116,9 +124,11 @@
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- .list{
|
|
|
+
|
|
|
+ .list {
|
|
|
flex: 1;
|
|
|
}
|
|
|
+
|
|
|
.list1btn {
|
|
|
z-index: 5;
|
|
|
border: none;
|
|
@@ -135,6 +145,6 @@
|
|
|
letter-spacing: 1px;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
</style>
|