|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<Container title="公告列表" :scrollStyle="{ padding: 0 }">
|
|
<Container title="公告列表" :scrollStyle="{ padding: 0 }">
|
|
- <view class="notice-page">
|
|
|
|
|
|
+ <view ref="loadMoreTrigger" class="notice-page">
|
|
<!-- 公告列表 -->
|
|
<!-- 公告列表 -->
|
|
<view class="notice-list" v-if="noticeList !='' && noticeList != null">
|
|
<view class="notice-list" v-if="noticeList !='' && noticeList != null">
|
|
<!-- 公告项1 -->
|
|
<!-- 公告项1 -->
|
|
@@ -27,6 +27,11 @@
|
|
</navigator>
|
|
</navigator>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- 加载状态提示 -->
|
|
|
|
+ <view class="loading-status">
|
|
|
|
+ <text v-if="loading">加载中...</text>
|
|
|
|
+ <text v-if="noMore">——已经到底了——</text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</Container>
|
|
</Container>
|
|
</template>
|
|
</template>
|
|
@@ -37,17 +42,31 @@ import CustomerService from '@/components/CustomerService/CustomerService.vue';
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- page: '1',
|
|
|
|
- limit: '10',
|
|
|
|
|
|
+ page: 1,
|
|
|
|
+ limit: 10,
|
|
noticeLink_top: [],
|
|
noticeLink_top: [],
|
|
- noticeList: []
|
|
|
|
|
|
+ noticeList: [],
|
|
|
|
+ loading: false, // 是否正在加载
|
|
|
|
+ noMore: false, // 是否没有更多数据
|
|
|
|
+ observer: null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- mounted() {},
|
|
|
|
|
|
+ onReady() {
|
|
|
|
+ // this.handleScroll();
|
|
|
|
+ },
|
|
onLoad() {
|
|
onLoad() {
|
|
- this.topicnotice_system_list();
|
|
|
|
|
|
+ this.handleScroll();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ handleScroll() {
|
|
|
|
+ const observer = uni.createIntersectionObserver(this);
|
|
|
|
+ observer.relativeToViewport({bottom: 100}).observe('.loading-status', (res) => {
|
|
|
|
+ if (res.intersectionRatio > 0 && !this.loading && !this.noMore) {
|
|
|
|
+ this.notice_system_list();
|
|
|
|
+ this.page++;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
formatTimestamp(timestamp) {
|
|
formatTimestamp(timestamp) {
|
|
if (timestamp) {
|
|
if (timestamp) {
|
|
timestamp = timestamp * 1000;
|
|
timestamp = timestamp * 1000;
|
|
@@ -61,7 +80,7 @@ export default {
|
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
},
|
|
},
|
|
- async topicnotice_system_list() {
|
|
|
|
|
|
+ async notice_system_list() {
|
|
this.$http.request('api/question_bank/question_reception/notice/list', { page: this.page, limit: this.limit }).then((callback) => {
|
|
this.$http.request('api/question_bank/question_reception/notice/list', { page: this.page, limit: this.limit }).then((callback) => {
|
|
if (callback.code == 'success') {
|
|
if (callback.code == 'success') {
|
|
let page = this.page;
|
|
let page = this.page;
|
|
@@ -157,4 +176,10 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.loading-status {
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #999;
|
|
|
|
+ padding: 120rpx 0rpx;
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|