| | |
| | | </view> --> |
| | | |
| | | <!-- 底部导航条 --> |
| | | <u-tabbar :list="tabbar" :mid-button="false"></u-tabbar> |
| | | <u-tabbar :list="tabbar" :mid-button="true"></u-tabbar> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | // pathUrl:"http://localhost:89/", |
| | | pathUrl: this.$store.state.piAPI + "", |
| | | page: 1, |
| | | pagesize: 10, |
| | | pagesize: 99999, |
| | | status: 'loadmore', |
| | | // loadStatus:'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式 |
| | | isLoadMore: false, //是否加载中 |
| | |
| | | query |
| | | .select('#articleBox') |
| | | .boundingClientRect(data => { |
| | | |
| | | that.swiperHeight = (safeArea.bottom - data.top - 50); |
| | | |
| | | }) |
| | |
| | | |
| | | //上拉加载更多 |
| | | onReachBottom() { |
| | | console.log(2323232) |
| | | if (this.status == 'nomore') return; |
| | | this.page = ++this.page; |
| | | setTimeout(() => { |
| | | this.getArtcilePageList(this.tabInfo); |
| | | }, 1000); |
| | | }, 100); |
| | | }, |
| | | methods: { |
| | | goTabDetail(index) { |
| | |
| | | let detail = { |
| | | id: e.id |
| | | }; |
| | | //去跳转 |
| | | uni.navigateTo({ |
| | | url: './article_detail?detailData=' + JSON.stringify(detail) |
| | | }); |
| | | if(e.articleType.indexOf("ksp") != -1){ |
| | | //去跳转 |
| | | uni.navigateTo({ |
| | | url: './article_video?detailData=' + (JSON.stringify(e)) |
| | | }); |
| | | }else{ |
| | | //去跳转 |
| | | uni.navigateTo({ |
| | | url: './article_detail?detailData=' + JSON.stringify(detail) |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | //on input 通过 keyword 关键字查询 |
| | | getKeyword() { |
| | |
| | | } |
| | | } |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + '/article/article/pageDate', |
| | | url: that.$store.state.piAPI + '/article/article/pageDate', |
| | | method: 'GET', |
| | | data: paramData, |
| | | success: (res) => { |
| | | if (res.data.code == 200) { |
| | | if (res.data.data.records) { |
| | | //如果总数小于pageSize,不做其他操作 |
| | | if (res.data.data.total < this.pagesize) { |
| | | if (res.data.data.total < that.pagesize) { |
| | | that.data = res.data.data.records; |
| | | that.status = 'nomore'; |
| | | } else { |
| | | if (res.data.data.records.length < this.pagesize) { |
| | | if (res.data.data.records.length < that.pagesize) { |
| | | //如果数量小于分页数量,则为最后一页 |
| | | this.status = 'nomore' |
| | | } else { |
| | | that.status = 'nomore' |
| | | } else { |
| | | //否则继续加载更多数据 |
| | | this.status = 'loading'; |
| | | that.status = 'loading'; |
| | | } |
| | | res.data.data.records.forEach((item) => { |
| | | that.data.push(item); |
| | |
| | | this.getArtcilePageList(e); |
| | | }, |
| | | refreshing() { |
| | | |
| | | if (this.isRefreshing) { |
| | | return; |
| | | } |
| | |
| | | if (!this.triggered) { |
| | | this.triggered = true; |
| | | } |
| | | |
| | | this.dataListP = []; |
| | | this.dataListQZ = []; |
| | | this.dataListTXL = []; |
| | | |
| | | this.getArtcilePageList(); |
| | | }, |
| | |
| | | </script> |
| | | |
| | | <style> |
| | | page { |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: #f7f7f7; |
| | | } |
| | | |
| | | </style> |
| | | |
| | | <style lang="scss" scoped> |