123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <template>
- <view class="mineActive">
- <statusBar :item="navBarData"></statusBar>
-
- <msgPop></msgPop>
- <view class="list">
- <scroll-view style="height: 100%;" scroll-y="true" @scrolltolower="lower">
- <view>
- <listBlock1 ref="listBlock1" :classList="activeList"></listBlock1>
- </view>
- <view class="loading">
- <view v-if="Loading==1">数据加载中...</view>
- <view v-if="Loading==2">没有更多了~~</view>
- </view>
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- navBarData: {
- title: '我的活动',
- btn: 1
- },
- activeList: [],
- Loading: 0,
- currentPage: 1,
- };
- },
-
-
-
- methods: {
- gotoDetail(e) {
- let data = e.currentTarget.dataset.all
- uni.navigateTo({
- url: `/pages/activityDetail/activityDetail?acId=${data.acId}`,
- });
- },
-
- lower() {
- console.log('没触底?');
- if (this.Loading == 2) return
- this.Loading = 1
- this.currentPage++
- setTimeout(this.getdata, 1000)
- },
-
- getdata() {
- let data = {
- oid: this.$store.state.user.openid,
- type: 2,
- currentPage: this.currentPage,
- lim: 30
- }
- this.$request('/selectRegistered', "POST", data).then(res => {
- console.log('获取数据', res[0]);
- if (!res[0].length) {
- this.Loading = 2
- } else {
- this.Loading = 0
- }
-
-
- if (this.currentPage == 1) {
-
- this.activeList = []
- }
- this.activeList = [...this.activeList, ...res[0]]
-
- })
- }
- },
- onLoad() {},
- onShow() {
- this.Loading = 0
- this.currentPage = 1
-
- this.getdata()
-
- this.$refs.listBlock1.getdata()
- }
- }
- </script>
- <style lang="scss">
- .loading {
- height: 30rpx;
- text-align: center;
- padding-top: 20rpx;
- padding-bottom: 100rpx;
- font-size: 26rpx;
- color: #888;
- line-height: 2em;
- }
- .mineActive {
- display: flex;
- flex-direction: column;
- height: 100vh;
- .list {
- flex: 1;
- overflow: hidden;
- }
- }
- </style>
|